cassandra

package
v0.0.0-...-f307310 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	HealthCheckId  = "com.hailocab.service.cassandra"
	MaxConnCheckId = "com.hailocab.service.cassandra.maxconns"
)

Variables

View Source
var (
	DefaultPoolConstructor func([]string, string, gossie.PoolOptions) (gossie.ConnectionPool, error) = gossie.NewConnectionPool
	// Pointer to the underlying ConnectionPool constructor to use (used to switch out the pool implementation when
	// mocking)
	PoolConstructor func([]string, string, gossie.PoolOptions) (gossie.ConnectionPool, error) = DefaultPoolConstructor
)

Functions

func ConnectionPool

func ConnectionPool(ks string) (gossie.ConnectionPool, error)

ConnectionPool yields a configured connection pool for the given keyspace This should be called on each use, as this will mean that you will always get an up-to-date connection pool (automatically updated if the config changes)

func HealthCheck

func HealthCheck(keyspace string, cfs []string) healthcheck.Checker

HealthCheck asserts we can connect to C* and

func MaxConnHealthCheck

func MaxConnHealthCheck(maxconns int) healthcheck.Checker

MaxConnHealthCheck asserts that the total number of established connections to all cassandra nodes falls below a given max threshold.

func NewMockConnectionPool

func NewMockConnectionPool(nodes []string, keyspace string, options gossie.PoolOptions) (gossie.ConnectionPool, error)

Types

type MockConnectionPool

type MockConnectionPool struct {
	mock.Mock
	// contains filtered or unexported fields
}

func (*MockConnectionPool) Batch

func (cp *MockConnectionPool) Batch() gossie.Batch

func (*MockConnectionPool) Close

func (cp *MockConnectionPool) Close() error

func (*MockConnectionPool) Keyspace

func (cp *MockConnectionPool) Keyspace() string

func (*MockConnectionPool) Query

func (*MockConnectionPool) Reader

func (cp *MockConnectionPool) Reader() gossie.Reader

func (*MockConnectionPool) Schema

func (cp *MockConnectionPool) Schema() *gossie.Schema

func (*MockConnectionPool) Writer

func (cp *MockConnectionPool) Writer() gossie.Writer

type MockQuery

type MockQuery struct {
	mock.Mock
	gossie.Query
}

type MockReader

type MockReader struct {
	mock.Mock
}

func (*MockReader) Cf

func (r *MockReader) Cf(cf string) gossie.Reader

func (*MockReader) Columns

func (r *MockReader) Columns(columns [][]byte) gossie.Reader

func (*MockReader) ConsistencyLevel

func (r *MockReader) ConsistencyLevel(level int) gossie.Reader

func (*MockReader) Count

func (r *MockReader) Count(key []byte) (int, error)

func (*MockReader) Get

func (r *MockReader) Get(key []byte) (*gossie.Row, error)

func (*MockReader) IndexedGet

func (r *MockReader) IndexedGet(rang *gossie.IndexedRange) ([]*gossie.Row, error)

func (*MockReader) MultiCount

func (r *MockReader) MultiCount(keys [][]byte) ([]*gossie.RowColumnCount, error)

func (*MockReader) MultiGet

func (r *MockReader) MultiGet(keys [][]byte) ([]*gossie.Row, error)

func (*MockReader) RangeGet

func (r *MockReader) RangeGet(rang *gossie.Range) ([]*gossie.Row, error)

func (*MockReader) Slice

func (r *MockReader) Slice(slice *gossie.Slice) gossie.Reader

func (*MockReader) Where

func (r *MockReader) Where(column []byte, op gossie.Operator, value []byte) gossie.Reader

type MockWriter

type MockWriter struct {
	mock.Mock
}

func (*MockWriter) ConsistencyLevel

func (w *MockWriter) ConsistencyLevel(level int) gossie.Writer

func (*MockWriter) Delete

func (w *MockWriter) Delete(cf string, key []byte) gossie.Writer

func (*MockWriter) DeleteColumns

func (w *MockWriter) DeleteColumns(cf string, key []byte, columns [][]byte) gossie.Writer

func (*MockWriter) DeltaCounters

func (w *MockWriter) DeltaCounters(cf string, row *gossie.Row) gossie.Writer

func (*MockWriter) Insert

func (w *MockWriter) Insert(cf string, row *gossie.Row) gossie.Writer

func (*MockWriter) InsertTtl

func (w *MockWriter) InsertTtl(cf string, row *gossie.Row, ttl int) gossie.Writer

func (*MockWriter) Run

func (w *MockWriter) Run() error

type MultiRowProvider

type MultiRowProvider struct {
	// mapping for unmarshaling a row into a struct
	Mapping gossie.Mapping
	// our buffer of rows
	Buffer []*gossie.Row
	// how many columns to limit to
	ColumnLimit int
	// contains filtered or unexported fields
}

func (*MultiRowProvider) Key

func (r *MultiRowProvider) Key() ([]byte, error)

func (*MultiRowProvider) Next

func (r *MultiRowProvider) Next(destination interface{}) error

func (*MultiRowProvider) NextColumn

func (r *MultiRowProvider) NextColumn() (*gossie.Column, error)

func (*MultiRowProvider) Rewind

func (r *MultiRowProvider) Rewind()

type SingleRowProvider

type SingleRowProvider struct {
	Row *gossie.Row
	// contains filtered or unexported fields
}

func (*SingleRowProvider) Key

func (r *SingleRowProvider) Key() ([]byte, error)

func (*SingleRowProvider) NextColumn

func (r *SingleRowProvider) NextColumn() (*gossie.Column, error)

func (*SingleRowProvider) Rewind

func (r *SingleRowProvider) Rewind()

Directories

Path Synopsis
Offers up a recipe built on Gossie to make dealing with time indexes simple.
Offers up a recipe built on Gossie to make dealing with time indexes simple.

Jump to

Keyboard shortcuts

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