tchannelthrift

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2021 License: Apache-2.0 Imports: 16 Imported by: 8

Documentation

Overview

Package tchannelthrift contains code for servicing RPC requests via tchannel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Context

func Context(ctx thrift.Context) context.Context

Context returns an M3DB context from the thrift context

func NewContext

func NewContext(timeout time.Duration) (thrift.Context, stdctx.CancelFunc)

NewContext returns a new thrift context and cancel func with embedded M3DB context

func NewContextWithEndpoint added in v1.2.0

func NewContextWithEndpoint(ctx context.Context, endpoint Endpoint) context.Context

NewContextWithEndpoint creates a new context.Context with the Endpoint set as a value.

func RegisterServer

func RegisterServer(channel *tchannel.Channel, service thrift.TChanServer, contextPool context.Pool)

RegisterServer will register a tchannel thrift server and create and close M3DB contexts per request

Types

type BlockMetadataV2Pool

type BlockMetadataV2Pool interface {
	// Get returns a block metadata
	Get() *rpc.BlockMetadataV2

	// Put puts a block metadata back to pool
	Put(m *rpc.BlockMetadataV2)
}

BlockMetadataV2Pool provides a pool for block metadata

func NewBlockMetadataV2Pool

func NewBlockMetadataV2Pool(opts pool.ObjectPoolOptions) BlockMetadataV2Pool

NewBlockMetadataV2Pool creates a new block metadata pool

type BlockMetadataV2SlicePool

type BlockMetadataV2SlicePool interface {
	// Get returns a block metadata slice
	Get() []*rpc.BlockMetadataV2

	// Put puts a block metadata slice back to pool
	Put(m []*rpc.BlockMetadataV2)
}

BlockMetadataV2SlicePool provides a pool for block metadata slices

func NewBlockMetadataV2SlicePool

func NewBlockMetadataV2SlicePool(opts pool.ObjectPoolOptions, capacity int) BlockMetadataV2SlicePool

NewBlockMetadataV2SlicePool creates a new blockMetadataV2Slice pool

type Endpoint added in v1.2.0

type Endpoint int

Endpoint is a type representing an API endpoint

const (
	// Unknown represents an unknown endpoint.
	Unknown Endpoint = iota
	// AggregateRaw represents the AggregateRaw endpoint.
	AggregateRaw
	// Fetch represents the Fetch endpoint.
	Fetch
	// FetchBatchRaw represents the FetchBatchRaw endpoint.
	FetchBatchRaw
	// FetchBatchRawV2 represents the FetchBatchRawV2 endpoint.
	FetchBatchRawV2
	// FetchTagged represents the FetchTagged endpoint.
	FetchTagged
	// Query represents the Query endpoint.
	Query
)

func EndpointFromContext added in v1.2.0

func EndpointFromContext(ctx context.Context) Endpoint

EndpointFromContext returns the Endpoint within the context or Unknown if not available.

func (Endpoint) String added in v1.2.0

func (e Endpoint) String() string

String returns the string value of Endpoint enum.

type Key added in v1.2.0

type Key string

Key is a specific string type for context setting.

const EndpointContextKey Key = "endpoint"

EndpointContextKey is the key for setting and retrieving the endpoint from context.

type Options

type Options interface {
	// SetClockOptions sets the clock options.
	SetClockOptions(value clock.Options) Options

	// ClockOptions returns the clock options.
	ClockOptions() clock.Options

	// SetInstrumentOptions sets the instrumentation options.
	SetInstrumentOptions(value instrument.Options) Options

	// InstrumentOptions returns the instrumentation options.
	InstrumentOptions() instrument.Options

	// SetTopologyInitializer sets the TopologyInitializer.
	SetTopologyInitializer(value topology.Initializer) Options

	// TopologyInitializer returns the TopologyInitializer.
	TopologyInitializer() topology.Initializer

	// SetIdentifierPool sets the identifier pool.
	SetIdentifierPool(value ident.Pool) Options

	// IdentifierPool returns the identifier pool.
	IdentifierPool() ident.Pool

	// SetBlockMetadataV2Pool sets the block metadata pool.
	SetBlockMetadataV2Pool(value BlockMetadataV2Pool) Options

	// BlockMetadataV2Pool returns the block metadata pool.
	BlockMetadataV2Pool() BlockMetadataV2Pool

	// SetBlockMetadataV2SlicePool sets the block metadata slice pool.
	SetBlockMetadataV2SlicePool(value BlockMetadataV2SlicePool) Options

	// BlockMetadataV2SlicePool returns the block metadata slice pool.
	BlockMetadataV2SlicePool() BlockMetadataV2SlicePool

	// SetTagEncoderPool sets the tag encoder pool.
	SetTagEncoderPool(value serialize.TagEncoderPool) Options

	// TagEncoderPool returns the tag encoder pool.
	TagEncoderPool() serialize.TagEncoderPool

	// SetCheckedBytesWrapperPool sets the checked bytes wrapper pool.
	SetCheckedBytesWrapperPool(value xpool.CheckedBytesWrapperPool) Options

	// CheckedBytesWrapperPool returns the checked bytes wrapper pool.
	CheckedBytesWrapperPool() xpool.CheckedBytesWrapperPool

	// SetMaxOutstandingWriteRequests sets the maximum number of allowed
	// outstanding write requests.
	SetMaxOutstandingWriteRequests(value int) Options

	// MaxOutstandingWriteRequests returns the maxinum number of allowed
	// outstanding write requests.
	MaxOutstandingWriteRequests() int

	// SetMaxOutstandingReadRequests sets the maximum number of allowed
	// outstanding read requests.
	SetMaxOutstandingReadRequests(value int) Options

	// MaxOutstandingReadRequests returns the maxinum number of allowed
	// outstanding read requests.
	MaxOutstandingReadRequests() int

	// QueryLimits returns the QueryLimits.
	QueryLimits() limits.QueryLimits

	// SetQueryLimits sets the QueryLimits.
	SetQueryLimits(value limits.QueryLimits) Options

	// PermitsOptions returns the permits options.
	PermitsOptions() permits.Options

	// SetPermitsOptions sets the permits options.
	SetPermitsOptions(value permits.Options) Options

	// SetFetchTaggedSeriesBlocksPerBatch sets the series blocks allowed to be read
	// per permit acquired.
	SetFetchTaggedSeriesBlocksPerBatch(value int) Options
}

Options controls server behavior

func NewOptions

func NewOptions() Options

NewOptions creates new options.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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