From 4738a818d2bf339b8cc5d6da25edb02e7c7692d5 Mon Sep 17 00:00:00 2001 From: Travis Date: Thu, 4 Mar 2021 23:12:42 -0600 Subject: [PATCH] change attributes file ".data" to "column/row-attributes" --- holder.go | 8 +++++++- holder_test.go | 4 ++-- index.go | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/holder.go b/holder.go index f385f0b89..065ac4ded 100644 --- a/holder.go +++ b/holder.go @@ -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 diff --git a/holder_test.go b/holder_test.go index 5f5aca69d..f3ba426af 100644 --- a/holder_test.go +++ b/holder_test.go @@ -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) } diff --git a/index.go b/index.go index 0f0725dc9..ce7c235dd 100644 --- a/index.go +++ b/index.go @@ -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 }