[#191] v2/object: Rename leaf
filter to phy
Signed-off-by: Alex Vanin <alexey@nspcc.ru>
This commit is contained in:
parent
ef31dec43a
commit
91eade02cd
3 changed files with 18 additions and 18 deletions
|
@ -70,7 +70,7 @@ const (
|
||||||
fKeyHomomorphicHash
|
fKeyHomomorphicHash
|
||||||
fKeyParent
|
fKeyParent
|
||||||
fKeyPropRoot
|
fKeyPropRoot
|
||||||
fKeyPropLeaf
|
fKeyPropPhy
|
||||||
fKeyPropChildfree
|
fKeyPropChildfree
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -98,8 +98,8 @@ func (k filterKey) String() string {
|
||||||
return v2object.FilterHeaderParent
|
return v2object.FilterHeaderParent
|
||||||
case fKeyPropRoot:
|
case fKeyPropRoot:
|
||||||
return v2object.FilterPropertyRoot
|
return v2object.FilterPropertyRoot
|
||||||
case fKeyPropLeaf:
|
case fKeyPropPhy:
|
||||||
return v2object.FilterPropertyLeaf
|
return v2object.FilterPropertyPhy
|
||||||
case fKeyPropChildfree:
|
case fKeyPropChildfree:
|
||||||
return v2object.FilterPropertyChildfree
|
return v2object.FilterPropertyChildfree
|
||||||
}
|
}
|
||||||
|
@ -211,16 +211,16 @@ func (f *SearchFilters) AddNonRootFilter() {
|
||||||
f.addRootFilter(false)
|
f.addRootFilter(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *SearchFilters) addLeafFilter(val bool) {
|
func (f *SearchFilters) addPhyFilter(val bool) {
|
||||||
f.addReservedFilter(MatchStringEqual, fKeyPropLeaf, boolStringer(val))
|
f.addReservedFilter(MatchStringEqual, fKeyPropPhy, boolStringer(val))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *SearchFilters) AddLeafFilter() {
|
func (f *SearchFilters) AddPhyFilter() {
|
||||||
f.addLeafFilter(true)
|
f.addPhyFilter(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *SearchFilters) AddNonLeafFilter() {
|
func (f *SearchFilters) AddNonPhyFilter() {
|
||||||
f.addLeafFilter(false)
|
f.addPhyFilter(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f *SearchFilters) addChildFreeFilter(val bool) {
|
func (f *SearchFilters) addChildFreeFilter(val bool) {
|
||||||
|
|
|
@ -81,31 +81,31 @@ func TestSearchFilters_AddNonRootFilter(t *testing.T) {
|
||||||
require.Equal(t, v2object.BooleanPropertyValueFalse, f.Value())
|
require.Equal(t, v2object.BooleanPropertyValueFalse, f.Value())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSearchFilters_AddLeafFilter(t *testing.T) {
|
func TestSearchFilters_AddPhyFilter(t *testing.T) {
|
||||||
fs := new(object.SearchFilters)
|
fs := new(object.SearchFilters)
|
||||||
|
|
||||||
fs.AddLeafFilter()
|
fs.AddPhyFilter()
|
||||||
|
|
||||||
require.Len(t, *fs, 1)
|
require.Len(t, *fs, 1)
|
||||||
|
|
||||||
f := (*fs)[0]
|
f := (*fs)[0]
|
||||||
|
|
||||||
require.Equal(t, object.MatchStringEqual, f.Operation())
|
require.Equal(t, object.MatchStringEqual, f.Operation())
|
||||||
require.Equal(t, v2object.FilterPropertyLeaf, f.Header())
|
require.Equal(t, v2object.FilterPropertyPhy, f.Header())
|
||||||
require.Equal(t, v2object.BooleanPropertyValueTrue, f.Value())
|
require.Equal(t, v2object.BooleanPropertyValueTrue, f.Value())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestSearchFilters_AddNonLeafFilter(t *testing.T) {
|
func TestSearchFilters_AddNonPhyFilter(t *testing.T) {
|
||||||
fs := new(object.SearchFilters)
|
fs := new(object.SearchFilters)
|
||||||
|
|
||||||
fs.AddNonLeafFilter()
|
fs.AddNonPhyFilter()
|
||||||
|
|
||||||
require.Len(t, *fs, 1)
|
require.Len(t, *fs, 1)
|
||||||
|
|
||||||
f := (*fs)[0]
|
f := (*fs)[0]
|
||||||
|
|
||||||
require.Equal(t, object.MatchStringEqual, f.Operation())
|
require.Equal(t, object.MatchStringEqual, f.Operation())
|
||||||
require.Equal(t, v2object.FilterPropertyLeaf, f.Header())
|
require.Equal(t, v2object.FilterPropertyPhy, f.Header())
|
||||||
require.Equal(t, v2object.BooleanPropertyValueFalse, f.Value())
|
require.Equal(t, v2object.BooleanPropertyValueFalse, f.Value())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -33,11 +33,11 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// FilterPropertyRoot is a filter key to check if an object is a top object in a split hierarchy.
|
// FilterPropertyRoot is a filter key to check if regular object is on top of split hierarchy.
|
||||||
FilterPropertyRoot = ReservedFilterPrefix + "ROOT"
|
FilterPropertyRoot = ReservedFilterPrefix + "ROOT"
|
||||||
|
|
||||||
// FilterPropertyLeaf is a filter key to check if an object is a leaf in a split hierarchy.
|
// FilterPropertyPhy is a filter key to check if an object physically stored on a node.
|
||||||
FilterPropertyLeaf = ReservedFilterPrefix + "LEAF"
|
FilterPropertyPhy = ReservedFilterPrefix + "PHY"
|
||||||
|
|
||||||
// FilterPropertyChildfree is a filter key to check if an object has empty children list in `Split` header.
|
// FilterPropertyChildfree is a filter key to check if an object has empty children list in `Split` header.
|
||||||
FilterPropertyChildfree = ReservedFilterPrefix + "CHILDFREE"
|
FilterPropertyChildfree = ReservedFilterPrefix + "CHILDFREE"
|
||||||
|
|
Loading…
Reference in a new issue