storage

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthSource        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowSource          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupSource = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrMissingReadSource = errors.New("missing ReadSource")
)

Functions

func HasFieldKeyOrValue

func HasFieldKeyOrValue(expr cnosql.Expr) (bool, bool)

func HasSingleMeasurementNoOR

func HasSingleMeasurementNoOR(expr cnosql.Expr) (string, bool)

HasSingleMeasurementNoOR determines if an index optimisation is available.

Typically the read service will use the query engine to retrieve all field keys for all measurements that match the expression, which can be very inefficient if it can be proved that only one measurement matches the expression.

This condition is determined when the following is true:

  • there is only one occurrence of the tag key `_measurement`.
  • there are no OR operators in the expression tree.
  • the operator for the `_measurement` binary expression is ==.

func NewContextWithReadOptions

func NewContextWithReadOptions(ctx context.Context, opts *ReadOptions) context.Context

NewContextWithRequestOptions returns a new Context with nodeID added.

func RewriteExprRemoveFieldKeyAndValue

func RewriteExprRemoveFieldKeyAndValue(expr cnosql.Expr) cnosql.Expr

Types

type MetaClient

type MetaClient interface {
	Database(name string) *meta.DatabaseInfo
	ShardGroupsByTimeRange(database, policy string, min, max time.Time) (a []meta.ShardGroupInfo, err error)
}

type ReadOptions

type ReadOptions struct {
	NodeID uint64
}

ReadOptions are additional options that may be passed with context.Context to configure the behavior of a storage read request.

func ReadOptionsFromContext

func ReadOptionsFromContext(ctx context.Context) *ReadOptions

ReadOptionsFromContext returns the ReadOptions associated with the context or nil if no additional options have been specified.

type ReadSource

type ReadSource struct {
	// Database identifies which database to query.
	Database string `protobuf:"bytes,1,opt,name=database,proto3" json:"database,omitempty"`
	// RetentionPolicy identifies which retention policy to query.
	RetentionPolicy string `protobuf:"bytes,2,opt,name=retention_policy,json=retentionPolicy,proto3" json:"retention_policy,omitempty"`
}

func GetReadSource

func GetReadSource(any types.Any) (*ReadSource, error)

GetReadSource will attempt to unmarshal a ReadSource from the ReadRequest or return an error if no valid resource is present.

func (*ReadSource) Descriptor

func (*ReadSource) Descriptor() ([]byte, []int)

func (*ReadSource) Marshal

func (m *ReadSource) Marshal() (dAtA []byte, err error)

func (*ReadSource) MarshalTo

func (m *ReadSource) MarshalTo(dAtA []byte) (int, error)

func (*ReadSource) MarshalToSizedBuffer

func (m *ReadSource) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ReadSource) ProtoMessage

func (*ReadSource) ProtoMessage()

func (*ReadSource) Reset

func (m *ReadSource) Reset()

func (*ReadSource) Size

func (m *ReadSource) Size() (n int)

func (*ReadSource) String

func (m *ReadSource) String() string

func (*ReadSource) Unmarshal

func (m *ReadSource) Unmarshal(dAtA []byte) error

func (*ReadSource) XXX_DiscardUnknown

func (m *ReadSource) XXX_DiscardUnknown()

func (*ReadSource) XXX_Marshal

func (m *ReadSource) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ReadSource) XXX_Merge

func (m *ReadSource) XXX_Merge(src proto.Message)

func (*ReadSource) XXX_Size

func (m *ReadSource) XXX_Size() int

func (*ReadSource) XXX_Unmarshal

func (m *ReadSource) XXX_Unmarshal(b []byte) error

type Store

type Store struct {
	TSDBStore  *tsdb.Store
	MetaClient MetaClient
	Logger     *zap.Logger
}

func NewStore

func NewStore(store *tsdb.Store, metaClient MetaClient) *Store

func (*Store) ReadFilter

func (s *Store) ReadFilter(ctx context.Context, req *datatypes.ReadFilterRequest) (reads.ResultSet, error)

func (*Store) WithLogger

func (s *Store) WithLogger(log *zap.Logger)

WithLogger sets the logger for the service.

Jump to

Keyboard shortcuts

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