mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-09-05 08:10:50 +00:00
make index column label and options RLocks
This commit is contained in:
parent
ce7283ae1b
commit
023dbbcdfd
1 changed files with 16 additions and 2 deletions
18
index.go
18
index.go
|
|
@ -129,12 +129,26 @@ func (i *Index) SetColumnLabel(v string) error {
|
|||
|
||||
// ColumnLabel returns the column label.
|
||||
func (i *Index) ColumnLabel() string {
|
||||
i.mu.Lock()
|
||||
i.mu.RLock()
|
||||
v := i.columnLabel
|
||||
i.mu.Unlock()
|
||||
i.mu.RUnlock()
|
||||
return v
|
||||
}
|
||||
|
||||
// Options returns all options for this index.
|
||||
func (i *Index) Options() IndexOptions {
|
||||
i.mu.RLock()
|
||||
defer i.mu.RUnlock()
|
||||
return i.options()
|
||||
}
|
||||
|
||||
func (i *Index) options() IndexOptions {
|
||||
return IndexOptions{
|
||||
ColumnLabel: i.columnLabel,
|
||||
TimeQuantum: i.timeQuantum,
|
||||
}
|
||||
}
|
||||
|
||||
// Open opens and initializes the index.
|
||||
func (i *Index) Open() error {
|
||||
// Ensure the path exists.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue