forked from TrueCloudLab/frostfs-node
[#160] Update metabase with new root and phy flags processing
Now root and phy (leaf) filters work like flags. They work with any matcher and any value. So meta-storage sets `true` value for all root and phy objects and puts them into separate bucket. We also do not work with inversion anymore, so it either added to the bucket or not. We don't need to store both options. This is the reason `selectAll` function is changed a bit. Now it performs some low-level parsing from primary bucket and root bucket. Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
2c50032831
commit
03fed8ca59
4 changed files with 76 additions and 62 deletions
|
@ -164,31 +164,11 @@ func TestDB_SelectProperties(t *testing.T) {
|
|||
fs.AddRootFilter()
|
||||
testSelect(t, db, fs, parAddr)
|
||||
|
||||
// non-root filter
|
||||
// phy filter
|
||||
fs = fs[:0]
|
||||
fs.AddNonRootFilter()
|
||||
fs.AddPhyFilter()
|
||||
testSelect(t, db, fs, childAddr)
|
||||
|
||||
// root filter (with random false value)
|
||||
fs = fs[:0]
|
||||
fs.AddFilter(v2object.FilterPropertyRoot, "some false value", objectSDK.MatchStringEqual)
|
||||
testSelect(t, db, fs, childAddr)
|
||||
|
||||
// leaf filter
|
||||
fs = fs[:0]
|
||||
fs.AddLeafFilter()
|
||||
testSelect(t, db, fs, childAddr)
|
||||
|
||||
// non-leaf filter
|
||||
fs = fs[:0]
|
||||
fs.AddNonLeafFilter()
|
||||
testSelect(t, db, fs, parAddr)
|
||||
|
||||
// leaf filter (with random false value)
|
||||
fs = fs[:0]
|
||||
fs.AddFilter(v2object.FilterPropertyLeaf, "some false value", objectSDK.MatchStringEqual)
|
||||
testSelect(t, db, fs, parAddr)
|
||||
|
||||
lnk := object.NewRaw()
|
||||
lnk.SetContainerID(testCID())
|
||||
lnk.SetID(testOID())
|
||||
|
@ -290,7 +270,7 @@ func TestVirtualObject(t *testing.T) {
|
|||
testSelect(t, db, fs, childAddr, parAddr)
|
||||
|
||||
// filter leaves
|
||||
fs.AddLeafFilter()
|
||||
fs.AddPhyFilter()
|
||||
|
||||
// only child object should appear
|
||||
testSelect(t, db, fs, childAddr)
|
||||
|
@ -298,7 +278,7 @@ func TestVirtualObject(t *testing.T) {
|
|||
fs = fs[:0]
|
||||
|
||||
// filter non-leaf objects
|
||||
fs.AddNonLeafFilter()
|
||||
fs.AddRootFilter()
|
||||
|
||||
// only parent object should appear
|
||||
testSelect(t, db, fs, parAddr)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue