cassandra

package
v1.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fixtures

func Fixtures() ([]testutils.Fixture, error)

Fixtures for unit testing Cassandra integration.

func NewTableClient

func NewTableClient(ctx context.Context, cfg Config) (chunk.TableClient, error)

NewTableClient returns a new TableClient.

Types

type Config

type Config struct {
	Addresses                string        `yaml:"addresses,omitempty"`
	Port                     int           `yaml:"port,omitempty"`
	Keyspace                 string        `yaml:"keyspace,omitempty"`
	Consistency              string        `yaml:"consistency,omitempty"`
	ReplicationFactor        int           `yaml:"replication_factor,omitempty"`
	DisableInitialHostLookup bool          `yaml:"disable_initial_host_lookup,omitempty"`
	SSL                      bool          `yaml:"SSL,omitempty"`
	HostVerification         bool          `yaml:"host_verification,omitempty"`
	CAPath                   string        `yaml:"CA_path,omitempty"`
	Auth                     bool          `yaml:"auth,omitempty"`
	Username                 string        `yaml:"username,omitempty"`
	Password                 string        `yaml:"password,omitempty"`
	Timeout                  time.Duration `yaml:"timeout,omitempty"`
	ConnectTimeout           time.Duration `yaml:"connect_timeout,omitempty"`
}

Config for a StorageClient

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

RegisterFlags adds the flags required to config this to the given FlagSet

type StorageClient

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

StorageClient implements chunk.IndexClient and chunk.ObjectClient for Cassandra.

func NewStorageClient

func NewStorageClient(cfg Config, schemaCfg chunk.SchemaConfig) (*StorageClient, error)

NewStorageClient returns a new StorageClient.

func (*StorageClient) BatchWrite

func (s *StorageClient) BatchWrite(ctx context.Context, batch chunk.WriteBatch) error

BatchWrite implement chunk.IndexClient.

func (*StorageClient) GetChunks

func (s *StorageClient) GetChunks(ctx context.Context, input []chunk.Chunk) ([]chunk.Chunk, error)

GetChunks implements chunk.ObjectClient.

func (*StorageClient) NewWriteBatch

func (s *StorageClient) NewWriteBatch() chunk.WriteBatch

NewWriteBatch implement chunk.IndexClient.

func (*StorageClient) PutChunks

func (s *StorageClient) PutChunks(ctx context.Context, chunks []chunk.Chunk) error

PutChunks implements chunk.ObjectClient.

func (*StorageClient) QueryPages

func (s *StorageClient) QueryPages(ctx context.Context, queries []chunk.IndexQuery, callback func(chunk.IndexQuery, chunk.ReadBatch) bool) error

QueryPages implement chunk.IndexClient.

func (*StorageClient) Stop

func (s *StorageClient) Stop()

Stop implement chunk.IndexClient.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL