change attributes file ".data" to "column/row-attributes"

This commit is contained in:
Travis 2021-03-04 23:12:42 -06:00
parent 345d076fdf
commit 4738a818d2
No known key found for this signature in database
GPG key ID: 37080CC2042BA34E
3 changed files with 10 additions and 4 deletions

View file

@ -59,6 +59,12 @@ const (
// DefaultFieldsDir is the default fields directory used by each index.
DefaultFieldsDir = "fields"
// ColumnAttrsFileName is the name of the file used for the column attributes store.
ColumnAttrsFileName = "column-attributes"
// RowAttrsFileName is the name of the file used for the row attributes store.
RowAttrsFileName = "row-attributes"
)
func init() {
@ -1304,7 +1310,7 @@ func (h *Holder) newIndex(path, name string) (*Index, error) {
index.serializer = h.serializer
index.Schemator = h.schemator
index.newAttrStore = h.NewAttrStore
index.columnAttrs = h.NewAttrStore(filepath.Join(index.path, ".data"))
index.columnAttrs = h.NewAttrStore(filepath.Join(index.path, ColumnAttrsFileName))
index.OpenTranslateStore = h.OpenTranslateStore
index.translationSyncer = h.translationSyncer
return index, nil

View file

@ -63,7 +63,7 @@ func TestHolder_Open(t *testing.T) {
t.Fatal(err)
} else if err := h.Holder.Close(); err != nil {
t.Fatal(err)
} else if err := os.Truncate(filepath.Join(h.IndexPath("test"), ".data"), 2); err != nil {
} else if err := os.Truncate(filepath.Join(h.IndexPath("test"), pilosa.ColumnAttrsFileName), 2); err != nil {
t.Fatal(err)
}
@ -135,7 +135,7 @@ func TestHolder_Open(t *testing.T) {
t.Fatal(err)
} else if err := h.Holder.Close(); err != nil {
t.Fatal(err)
} else if err := os.Truncate(filepath.Join(h.Path(), "foo", "bar", ".data"), 2); err != nil {
} else if err := os.Truncate(filepath.Join(h.Path(), "foo", "bar", pilosa.RowAttrsFileName), 2); err != nil {
t.Fatal(err)
}

View file

@ -795,7 +795,7 @@ func (i *Index) newField(path, name string) (*Field, error) {
f.broadcaster = i.broadcaster
f.schemator = i.Schemator
f.serializer = i.serializer
f.rowAttrStore = i.newAttrStore(filepath.Join(f.path, ".data"))
f.rowAttrStore = i.newAttrStore(filepath.Join(f.path, RowAttrsFileName))
f.OpenTranslateStore = i.OpenTranslateStore
return f, nil
}