node

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 45 Imported by: 5 modules, 4 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewServer

func NewServer(
	service Service,
	address string,
	contextPool context.Pool,
	opts Options,
) ns.NetworkService

NewServer creates a new node TChannel Thrift network service

Types

type FetchTaggedResultsIter added in v1.2.0

type FetchTaggedResultsIter interface {
	// NumIDs returns the total number of series IDs in the result.
	NumIDs() int

	// Exhaustive returns true if NumIDs is all IDs that the query could have returned.
	Exhaustive() bool

	// WaitedIndex counts how many times index querying had to wait for permits.
	WaitedIndex() int

	// WaitedSeriesRead counts how many times series being read had to wait for permits.
	WaitedSeriesRead() int

	// Namespace is the namespace.
	Namespace() ident.ID

	// Next advances to the next element, returning if one exists.
	//
	// Iterators that embed this interface should expose a Current() function to return the element retrieved by Next.
	// If an error occurs this returns false and it can be retrieved with Err.
	Next(ctx context.Context) bool

	// Err returns a non-nil error if an error occurred when calling Next().
	Err() error

	// Current returns the current IDResult fetched with Next. The result is only valid if Err is nil.
	Current() IDResult

	// Close closes the iterator. The provided error is non-nil if the client of the Iterator encountered an error
	// while iterating.
	Close(err error)
}

FetchTaggedResultsIter iterates over the results from FetchTagged The iterator is not thread safe and must only be accessed from a single goroutine.

type IDResult added in v1.2.0

type IDResult interface {
	// ID returns the series ID.
	ID() []byte

	// WriteTags writes the encoded tags to provided slice. Callers must use the returned reference in case the slice needs
	// to grow, just like append().
	WriteTags(dst []byte) ([]byte, error)

	// WriteSegments writes the Segments to the provided slice. Callers must use the returned reference in case the slice
	// needs to grow, just like append().
	// This method blocks until segment data is available or the context deadline expires.
	WriteSegments(ctx context.Context, dst []*rpc.Segments) ([]*rpc.Segments, error)
}

IDResult is the FetchTagged result for a series ID.

type NewTChanChannelFn added in v1.0.1

type NewTChanChannelFn func(
	service Service,
	channelName string,
	opts *tchannel.ChannelOptions,
) (*tchannel.Channel, error)

NewTChanChannelFn creates a tchan channel.

type NewTChanNodeServerFn added in v0.15.0

type NewTChanNodeServerFn func(
	service Service,
	iOpts instrument.Options,
) thrift.TChanServer

NewTChanNodeServerFn creates a tchan node server.

type Options added in v0.15.0

type Options interface {
	// SetChannelOptions sets a tchan channel options.
	SetChannelOptions(value *tchannel.ChannelOptions) Options

	// ChannelOptions returns the tchan channel options.
	ChannelOptions() *tchannel.ChannelOptions

	// SetTChanChannelFn sets a tchan node channel registration.
	SetTChanChannelFn(value NewTChanChannelFn) Options

	// TChanChannelFn returns a tchan node channel registration.
	TChanChannelFn() NewTChanChannelFn

	// SetTChanNodeServerFn sets a tchan node server builder.
	SetTChanNodeServerFn(value NewTChanNodeServerFn) Options

	// TChanNodeServerFn returns a tchan node server builder.
	TChanNodeServerFn() NewTChanNodeServerFn

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

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

Options are thrift options.

func NewOptions added in v0.15.0

func NewOptions(chanOpts *tchannel.ChannelOptions) Options

NewOptions creates a new options.

type Service added in v0.9.0

type Service interface {
	rpc.TChanNode

	// FetchTaggedIter returns an iterator for the results of FetchTagged.
	// It is the responsibility of the caller to close the returned iterator.
	FetchTaggedIter(ctx context.Context, req *rpc.FetchTaggedRequest) (FetchTaggedResultsIter, error)

	// SetDatabase only safe to be called one time once the service has started.
	SetDatabase(db storage.Database) error

	// Database returns the current database.
	Database() (storage.Database, error)

	// SetMetadata sets a metadata key to the given value.
	SetMetadata(key, value string)

	// Metadata returns the metadata for the given key and a bool indicating
	// if it is present.
	Metadata(key string) (string, bool)
}

Service is the interface for the node RPC service.

func NewService

func NewService(db storage.Database, opts tchannelthrift.Options) Service

NewService creates a new node TChannel Thrift service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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