make index column label and options RLocks

This commit is contained in:
Matthew Jaffee 2017-09-19 16:03:10 -05:00 committed by Travis
parent ce7283ae1b
commit 023dbbcdfd
No known key found for this signature in database
GPG key ID: 7F08008DFD9314C9

View file

@ -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.