Documentation ¶
Index ¶
- Constants
- Variables
- func NewTableClient(directory string) (chunk.TableClient, error)
- func OpenBoltdbFile(path string) (*bbolt.DB, error)
- type BoltDBConfig
- type BoltIndexClient
- func (b *BoltIndexClient) BatchWrite(ctx context.Context, batch chunk.WriteBatch) error
- func (b *BoltIndexClient) GetDB(name string, operation int) (*bbolt.DB, error)
- func (b *BoltIndexClient) NewWriteBatch() chunk.WriteBatch
- func (b *BoltIndexClient) QueryDB(ctx context.Context, db *bbolt.DB, query chunk.IndexQuery, ...) error
- func (b *BoltIndexClient) QueryPages(ctx context.Context, queries []chunk.IndexQuery, ...) error
- func (b *BoltIndexClient) QueryWithCursor(_ context.Context, c *bbolt.Cursor, query chunk.IndexQuery, ...) error
- func (b *BoltIndexClient) Stop()
- func (b *BoltIndexClient) WriteToDB(ctx context.Context, db *bbolt.DB, writes TableWrites) error
- type BoltWriteBatch
- type FSConfig
- type FSObjectClient
- func (f *FSObjectClient) DeleteChunksBefore(ctx context.Context, ts time.Time) error
- func (f *FSObjectClient) DeleteObject(ctx context.Context, objectKey string) error
- func (f *FSObjectClient) GetObject(_ context.Context, objectKey string) (io.ReadCloser, error)
- func (f *FSObjectClient) List(ctx context.Context, prefix, delimiter string) ([]chunk.StorageObject, []chunk.StorageCommonPrefix, error)
- func (f *FSObjectClient) PutObject(_ context.Context, objectKey string, object io.ReadSeeker) error
- func (FSObjectClient) Stop()
- type TableClient
- func (c *TableClient) CreateTable(ctx context.Context, desc chunk.TableDesc) error
- func (c *TableClient) DeleteTable(ctx context.Context, name string) error
- func (c *TableClient) DescribeTable(ctx context.Context, name string) (desc chunk.TableDesc, isActive bool, err error)
- func (c *TableClient) ListTables(ctx context.Context) ([]string, error)
- func (*TableClient) Stop()
- func (c *TableClient) UpdateTable(ctx context.Context, current, expected chunk.TableDesc) error
- type TableWrites
Constants ¶
const ( DBOperationRead = iota DBOperationWrite )
Variables ¶
var (
ErrUnexistentBoltDB = errors.New("boltdb file does not exist")
)
var Fixtures = []testutils.Fixture{
&fixture{
name: "boltdb",
},
}
Fixtures for unit testing GCP storage.
Functions ¶
func NewTableClient ¶
func NewTableClient(directory string) (chunk.TableClient, error)
NewTableClient returns a new TableClient.
Types ¶
type BoltDBConfig ¶
type BoltDBConfig struct {
Directory string `yaml:"directory"`
}
BoltDBConfig for a BoltDB index client.
func (*BoltDBConfig) RegisterFlags ¶
func (cfg *BoltDBConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags registers flags.
type BoltIndexClient ¶ added in v0.7.0
type BoltIndexClient struct {
// contains filtered or unexported fields
}
func NewBoltDBIndexClient ¶
func NewBoltDBIndexClient(cfg BoltDBConfig) (*BoltIndexClient, error)
NewBoltDBIndexClient creates a new IndexClient that used BoltDB.
func (*BoltIndexClient) BatchWrite ¶ added in v0.7.0
func (b *BoltIndexClient) BatchWrite(ctx context.Context, batch chunk.WriteBatch) error
func (*BoltIndexClient) GetDB ¶ added in v0.7.0
GetDB should always return a db for write operation unless an error occurs while doing so. While for read operation it should throw ErrUnexistentBoltDB error if file does not exist for reading
func (*BoltIndexClient) NewWriteBatch ¶ added in v0.7.0
func (b *BoltIndexClient) NewWriteBatch() chunk.WriteBatch
func (*BoltIndexClient) QueryDB ¶ added in v0.7.0
func (b *BoltIndexClient) QueryDB(ctx context.Context, db *bbolt.DB, query chunk.IndexQuery, callback func(chunk.IndexQuery, chunk.ReadBatch) (shouldContinue bool)) error
func (*BoltIndexClient) QueryPages ¶ added in v0.7.0
func (b *BoltIndexClient) QueryPages(ctx context.Context, queries []chunk.IndexQuery, callback func(chunk.IndexQuery, chunk.ReadBatch) (shouldContinue bool)) error
func (*BoltIndexClient) QueryWithCursor ¶ added in v1.5.0
func (b *BoltIndexClient) QueryWithCursor(_ context.Context, c *bbolt.Cursor, query chunk.IndexQuery, callback func(chunk.IndexQuery, chunk.ReadBatch) (shouldContinue bool)) error
func (*BoltIndexClient) Stop ¶ added in v0.7.0
func (b *BoltIndexClient) Stop()
func (*BoltIndexClient) WriteToDB ¶ added in v1.3.0
func (b *BoltIndexClient) WriteToDB(ctx context.Context, db *bbolt.DB, writes TableWrites) error
type BoltWriteBatch ¶ added in v1.3.0
type BoltWriteBatch struct {
Writes map[string]TableWrites
}
func (*BoltWriteBatch) Add ¶ added in v1.3.0
func (b *BoltWriteBatch) Add(tableName, hashValue string, rangeValue []byte, value []byte)
func (*BoltWriteBatch) Delete ¶ added in v1.3.0
func (b *BoltWriteBatch) Delete(tableName, hashValue string, rangeValue []byte)
type FSConfig ¶
type FSConfig struct {
Directory string `yaml:"directory"`
}
FSConfig is the config for a FSObjectClient.
func (*FSConfig) RegisterFlags ¶
RegisterFlags registers flags.
type FSObjectClient ¶
type FSObjectClient struct {
// contains filtered or unexported fields
}
FSObjectClient holds config for filesystem as object store
func NewFSObjectClient ¶
func NewFSObjectClient(cfg FSConfig) (*FSObjectClient, error)
NewFSObjectClient makes a chunk.Client which stores chunks as files in the local filesystem.
func (*FSObjectClient) DeleteChunksBefore ¶
DeleteChunksBefore implements BucketClient
func (*FSObjectClient) DeleteObject ¶ added in v0.7.0
func (f *FSObjectClient) DeleteObject(ctx context.Context, objectKey string) error
func (*FSObjectClient) GetObject ¶ added in v0.7.0
func (f *FSObjectClient) GetObject(_ context.Context, objectKey string) (io.ReadCloser, error)
GetObject from the store
func (*FSObjectClient) List ¶ added in v0.7.0
func (f *FSObjectClient) List(ctx context.Context, prefix, delimiter string) ([]chunk.StorageObject, []chunk.StorageCommonPrefix, error)
List implements chunk.ObjectClient. FSObjectClient assumes that prefix is a directory, and only supports "" and "/" delimiters.
func (*FSObjectClient) PutObject ¶ added in v0.7.0
func (f *FSObjectClient) PutObject(_ context.Context, objectKey string, object io.ReadSeeker) error
PutObject into the store
type TableClient ¶ added in v1.1.0
type TableClient struct {
// contains filtered or unexported fields
}
func (*TableClient) CreateTable ¶ added in v1.1.0
func (*TableClient) DeleteTable ¶ added in v1.1.0
func (c *TableClient) DeleteTable(ctx context.Context, name string) error
func (*TableClient) DescribeTable ¶ added in v1.1.0
func (*TableClient) ListTables ¶ added in v1.1.0
func (c *TableClient) ListTables(ctx context.Context) ([]string, error)
func (*TableClient) Stop ¶ added in v1.2.0
func (*TableClient) Stop()
func (*TableClient) UpdateTable ¶ added in v1.1.0
type TableWrites ¶ added in v1.3.0
type TableWrites struct {
// contains filtered or unexported fields
}