Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore - update qnfs database to using subing.Suber #834

Open
20 tasks
m00sey opened this issue Jul 31, 2024 · 4 comments
Open
20 tasks

Chore - update qnfs database to using subing.Suber #834

m00sey opened this issue Jul 31, 2024 · 4 comments
Assignees

Comments

@m00sey
Copy link
Member

m00sey commented Jul 31, 2024

Currently the .qnfs sub db uses the "legacy" 😬 approach of creating a Baser property and adding methods to Baser

The sub db created here:

self.qnfs = self.env.open_db(key=b'qnfs.', dupsort=True)

The additional functionality added to Baser here:

def putQnfs(self, key, vals):

Newer sub dbs that have been added using the subing.Suber and associated classes:

class Suber(SuberBase):

The chore is to update usages of the .qnfs associated functionality from Baser and implement it as a subing.Suber:

self.qnfs = subing.Suber(db=self, subkey="qnfs.")

**.db.addQnf becomes **db.qnfs.add

  • add new subing.Suber qnfs sub db to basing
  • remove old .qnfs initialization
  • updated usages of putQnfs
  • removed putQnfs
  • updated usages of addQnf
  • removed addQnf
  • updated usages of getQnfs
  • removed getQnfs
  • updated usages of getQnfLast
  • removed getQnfLast
  • updated usages of getQnfItemsNext
  • removed getQnfItemsNext
  • updated usages of getQnfItemsNextIter
  • removed getQnfItemsNextIter
  • updated usages of cntQnfs
  • removed cntQnfs
  • updated usages of delQnfs
  • removed delQnfs
  • updated usages of delQnf
  • removed delQnf
@arilieb
Copy link
Contributor

arilieb commented Aug 5, 2024

Working on this now

@m00sey m00sey assigned m00sey and arilieb and unassigned arilieb and m00sey Aug 5, 2024
@arilieb
Copy link
Contributor

arilieb commented Aug 5, 2024

Question: delQnf is used to delete a single escrow value at a given key. I am attempting to replace this with functionality from subing.Suber in eventing.py. the Suber class does not have built in functionality for this, as its rem method removes the everything stored at the key, rather than a single value. Which, if any, of the following approaches should I take?

  • use a different class, perhaps IoSetSuber, as the rem function from that class seems suited to the task
  • use get and pin methods from the Suber class to overwrite the set of values at key with the the values minus the deleted value
  • write a new method in the Suber class

@pfeairheller
Copy link
Member

You have to look at the existing definition of theqnf database. If is an "insertion order set", (usually indicated by dupsort=True in the table creation), you HAVE to use IoSetSuber. That is the only way this will be a proper replacement.

@arilieb
Copy link
Contributor

arilieb commented Aug 20, 2024

Created PR with the discussed changes. #849

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants