pilosa: github.com/pilosa/pilosa/boltdb Index | Files

package boltdb

import "github.com/pilosa/pilosa/boltdb"

Copyright 2017 Pilosa Corp.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Package Files

attrstore.go translate.go

Variables

var (
    // ErrTranslateStoreClosed is returned when reading from an TranslateEntryReader
    // and the underlying store is closed.
    ErrTranslateStoreClosed = errors.New("boltdb: translate store closing")
)

func NewAttrStore Uses

func NewAttrStore(path string) pilosa.AttrStore

NewAttrStore returns a new instance of AttrStore.

func OpenTranslateStore Uses

func OpenTranslateStore(path, index, field string) (pilosa.TranslateStore, error)

OpenTranslateStore opens and initializes a boltdb translation store.

type TranslateEntryReader Uses

type TranslateEntryReader struct {
    // contains filtered or unexported fields
}

func (*TranslateEntryReader) Close Uses

func (r *TranslateEntryReader) Close() error

Close closes the reader.

func (*TranslateEntryReader) ReadEntry Uses

func (r *TranslateEntryReader) ReadEntry(entry *pilosa.TranslateEntry) error

ReadEntry reads the next entry from the underlying translate store.

type TranslateStore Uses

type TranslateStore struct {

    // File path to database file.
    Path string
    // contains filtered or unexported fields
}

TranslateStore is an on-disk storage engine for translating string-to-uint64 values.

func NewTranslateStore Uses

func NewTranslateStore(index, field string) *TranslateStore

NewTranslateStore returns a new instance of TranslateStore.

func (*TranslateStore) Close Uses

func (s *TranslateStore) Close() (err error)

Close closes the underlying database.

func (*TranslateStore) EntryReader Uses

func (s *TranslateStore) EntryReader(ctx context.Context, offset uint64) (pilosa.TranslateEntryReader, error)

Reader returns a reader that streams the underlying data file.

func (*TranslateStore) ForceSet Uses

func (s *TranslateStore) ForceSet(id uint64, key string) error

ForceSet writes the id/key pair to the store even if read only. Used by replication.

func (*TranslateStore) MaxID Uses

func (s *TranslateStore) MaxID() (max uint64, err error)

MaxID returns the highest id in the store.

func (*TranslateStore) Open Uses

func (s *TranslateStore) Open() (err error)

Open opens the translate file.

func (*TranslateStore) ReadOnly Uses

func (s *TranslateStore) ReadOnly() bool

ReadOnly returns true if the store is in read-only mode.

func (*TranslateStore) SetReadOnly Uses

func (s *TranslateStore) SetReadOnly(v bool)

SetReadOnly toggles whether store is in read-only mode.

func (*TranslateStore) Size Uses

func (s *TranslateStore) Size() int64

Size returns the number of bytes in the data file.

func (*TranslateStore) TranslateID Uses

func (s *TranslateStore) TranslateID(id uint64) (string, error)

TranslateID converts an integer ID to a string key. Returns a blank string if ID does not exist.

func (*TranslateStore) TranslateIDs Uses

func (s *TranslateStore) TranslateIDs(ids []uint64) ([]string, error)

TranslateIDs converts a list of integer IDs to a list of string keys.

func (*TranslateStore) TranslateKey Uses

func (s *TranslateStore) TranslateKey(key string) (id uint64, _ error)

TranslateKeys converts a string key to an integer ID. If key does not have an associated id then one is created.

func (*TranslateStore) TranslateKeys Uses

func (s *TranslateStore) TranslateKeys(keys []string) (ids []uint64, _ error)

TranslateKeys converts a string key to an integer ID. If key does not have an associated id then one is created.

func (*TranslateStore) WriteNotify Uses

func (s *TranslateStore) WriteNotify() <-chan struct{}

WriteNotify returns a channel that is closed when a new entry is written.

Package boltdb imports 13 packages (graph) and is imported by 4 packages. Updated 2019-10-19. Refresh now. Tools for package owners.