mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-10-07 19:37:51 +00:00
change attributes file ".data" to "column/row-attributes"
This commit is contained in:
parent
345d076fdf
commit
4738a818d2
3 changed files with 10 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
2
index.go
2
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue