Documentation ¶
Index ¶
- Constants
- Variables
- func APIErrorToLogFields(apiErr *api_service_protos.TError) []zap.Field
- func AllStreamResponsesSuccessfull[T StreamResponse](responses []T) bool
- func AnnotateLoggerForUnaryCall(l *zap.Logger, method string, dsi *api_common.TDataSourceInstance) *zap.Logger
- func AnnotateLoggerWithDataSourceInstance(l *zap.Logger, dsi *api_common.TDataSourceInstance) *zap.Logger
- func AnnotateLoggerWithMethod(l *zap.Logger, method string) *zap.Logger
- func DiffStatusSensors(oldSnapshot, newSnapshot *MetricsSnapshot, typ, method, name, status string) (float64, error)
- func DurationFromString(src string) (time.Duration, error)
- func EndpointToString(ep *api_common.TEndpoint) string
- func IsSuccess(apiErr *api_service_protos.TError) bool
- func ListSplitsResponsesToSplits(in []*api_service_protos.TListSplitsResponse) []*api_service_protos.TSplit
- func LogCloserError(logger *zap.Logger, closer io.Closer, msg string)
- func MakeListType(ydbType *Ydb.Type) *Ydb.Type
- func MakeOptionalType(ydbType *Ydb.Type) *Ydb.Type
- func MakePrimitiveType(typeId Ydb.Type_PrimitiveTypeId) *Ydb.Type
- func MakeTypedValue(ydbType *Ydb.Type, value any) *Ydb.TypedValue
- func MakeYdbDateTimeType(ydbTypeID Ydb.Type_PrimitiveTypeId, format api_service_protos.EDateTimeFormat) (*Ydb.Type, error)
- func MustDurationFromString(src string) time.Duration
- func MustTimeToYDBType[OUT ydbTime](f func(t *time.Time) (OUT, error), t time.Time) OUT
- func NewAPIErrorFromStdError(err error, kind api_common.EDataSourceKind) *api_service_protos.TError
- func NewConfigFromPrototextFile[T AppConfig](configPath string, dst T) error
- func NewDefaultLogger() *zap.Logger
- func NewLoggerFromConfig(cfg *config.TLoggerConfig) (*zap.Logger, error)
- func NewSTDErrorFromAPIError(apiErr *api_service_protos.TError) error
- func NewSuccess() *api_service_protos.TError
- func NewTestLogger(t *testing.T) *zap.Logger
- func ReadResponsesToArrowRecords(responses []*api_service_protos.TReadSplitsResponse) ([]arrow.Record, error)
- func SchemaToSelectWhatItems(schema *api_service_protos.TSchema, whitelist map[string]struct{}) *api_service_protos.TSelect_TWhat
- func SelectToFields(slct *api_service_protos.TSelect) []zap.Field
- func SelectWhatToArrowSchema(selectWhat *api_service_protos.TSelect_TWhat) (*arrow.Schema, error)
- func SelectWhatToYDBTypes(selectWhat *api_service_protos.TSelect_TWhat) ([]*Ydb.Type, error)
- func TimeToYDBDate(t *time.Time) (uint16, error)
- func TimeToYDBDatetime(t *time.Time) (uint32, error)
- func TimeToYDBTimestamp(t *time.Time) (uint64, error)
- func YdbTypeToYdbPrimitiveTypeID(ydbType *Ydb.Type) (Ydb.Type_PrimitiveTypeId, error)
- func YdbTypesToArrowBuilders(ydbTypes []*Ydb.Type, arrowAllocator memory.Allocator) ([]array.Builder, error)
- type AppConfig
- type ArrowArrayType
- type ArrowBuilder
- type ClientBuffering
- func (c *ClientBuffering) Close()
- func (c *ClientBuffering) DescribeTable(ctx context.Context, dsi *api_common.TDataSourceInstance, ...) (*api_service_protos.TDescribeTableResponse, error)
- func (c *ClientBuffering) ListSplits(ctx context.Context, slct *api_service_protos.TSelect) ([]*api_service_protos.TListSplitsResponse, error)
- func (c *ClientBuffering) ReadSplits(ctx context.Context, splits []*api_service_protos.TSplit) ([]*api_service_protos.TReadSplitsResponse, error)
- type ClientStreaming
- func (c *ClientStreaming) Close()
- func (c *ClientStreaming) DescribeTable(ctx context.Context, dsi *api_common.TDataSourceInstance, ...) (*api_service_protos.TDescribeTableResponse, error)
- func (c *ClientStreaming) ListSplits(ctx context.Context, slct *api_service_protos.TSelect) (<-chan *StreamResult[*api_service_protos.TListSplitsResponse], error)
- func (c *ClientStreaming) ReadSplits(ctx context.Context, splits []*api_service_protos.TSplit) (<-chan *StreamResult[*api_service_protos.TReadSplitsResponse], error)
- type MetricsSnapshot
- type QueryLogger
- type QueryLoggerFactory
- type StatusSensor
- type StreamResponse
- type StreamResult
- type TestingServer
- type ValueType
Constants ¶
View Source
const (
ForbidRetries = "FORBID_RETRIES"
)
Variables ¶
View Source
var ( ErrTableDoesNotExist = fmt.Errorf("table does not exist") ErrDataSourceNotSupported = fmt.Errorf("data source not supported") ErrDataTypeNotSupported = fmt.Errorf("data type not supported") ErrDataTypeMismatch = fmt.Errorf("data type mismatch") ErrMethodNotSupported = fmt.Errorf("method not supported") ErrReadLimitExceeded = fmt.Errorf("read limit exceeded") ErrInvalidRequest = fmt.Errorf("invalid request") ErrValueOutOfTypeBounds = fmt.Errorf("value is out of possible range of values for the type") ErrUnimplemented = fmt.Errorf("unimplemented") ErrUnimplementedTypedValue = fmt.Errorf("unimplemented typed value") ErrUnimplementedExpression = fmt.Errorf("unimplemented expression") ErrUnsupportedExpression = fmt.Errorf("expression is not supported") ErrUnimplementedOperation = fmt.Errorf("unimplemented operation") ErrUnimplementedPredicateType = fmt.Errorf("unimplemented predicate type") ErrInvariantViolation = fmt.Errorf("implementation error (invariant violation)") ErrUnimplementedArithmeticalExpression = fmt.Errorf("unimplemented arithmetical expression") ErrEmptyTableName = fmt.Errorf("empty table name") ErrPageSizeExceeded = fmt.Errorf("page size exceeded, check service configuration") )
Functions ¶
func APIErrorToLogFields ¶
func APIErrorToLogFields(apiErr *api_service_protos.TError) []zap.Field
func AllStreamResponsesSuccessfull ¶
func AllStreamResponsesSuccessfull[T StreamResponse](responses []T) bool
func AnnotateLoggerForUnaryCall ¶
func AnnotateLoggerForUnaryCall(l *zap.Logger, method string, dsi *api_common.TDataSourceInstance) *zap.Logger
func AnnotateLoggerWithDataSourceInstance ¶
func AnnotateLoggerWithDataSourceInstance(l *zap.Logger, dsi *api_common.TDataSourceInstance) *zap.Logger
func DiffStatusSensors ¶ added in v0.2.13
func DiffStatusSensors(oldSnapshot, newSnapshot *MetricsSnapshot, typ, method, name, status string) (float64, error)
func DurationFromString ¶ added in v0.2.18
func EndpointToString ¶
func EndpointToString(ep *api_common.TEndpoint) string
func IsSuccess ¶
func IsSuccess(apiErr *api_service_protos.TError) bool
func ListSplitsResponsesToSplits ¶
func ListSplitsResponsesToSplits(in []*api_service_protos.TListSplitsResponse) []*api_service_protos.TSplit
func MakePrimitiveType ¶
func MakePrimitiveType(typeId Ydb.Type_PrimitiveTypeId) *Ydb.Type
func MakeTypedValue ¶
func MakeTypedValue(ydbType *Ydb.Type, value any) *Ydb.TypedValue
func MakeYdbDateTimeType ¶ added in v0.1.2
func MakeYdbDateTimeType(ydbTypeID Ydb.Type_PrimitiveTypeId, format api_service_protos.EDateTimeFormat) (*Ydb.Type, error)
func MustDurationFromString ¶ added in v0.2.18
func MustTimeToYDBType ¶
func NewAPIErrorFromStdError ¶
func NewAPIErrorFromStdError(err error, kind api_common.EDataSourceKind) *api_service_protos.TError
func NewConfigFromPrototextFile ¶ added in v0.1.2
func NewDefaultLogger ¶
func NewLoggerFromConfig ¶
func NewLoggerFromConfig(cfg *config.TLoggerConfig) (*zap.Logger, error)
func NewSTDErrorFromAPIError ¶
func NewSTDErrorFromAPIError(apiErr *api_service_protos.TError) error
func NewSuccess ¶
func NewSuccess() *api_service_protos.TError
func ReadResponsesToArrowRecords ¶
func ReadResponsesToArrowRecords(responses []*api_service_protos.TReadSplitsResponse) ([]arrow.Record, error)
func SchemaToSelectWhatItems ¶
func SchemaToSelectWhatItems( schema *api_service_protos.TSchema, whitelist map[string]struct{}, ) *api_service_protos.TSelect_TWhat
func SelectToFields ¶
func SelectToFields(slct *api_service_protos.TSelect) []zap.Field
func SelectWhatToArrowSchema ¶
func SelectWhatToArrowSchema(selectWhat *api_service_protos.TSelect_TWhat) (*arrow.Schema, error)
func SelectWhatToYDBTypes ¶
func SelectWhatToYDBTypes(selectWhat *api_service_protos.TSelect_TWhat) ([]*Ydb.Type, error)
func YdbTypeToYdbPrimitiveTypeID ¶
func YdbTypeToYdbPrimitiveTypeID(ydbType *Ydb.Type) (Ydb.Type_PrimitiveTypeId, error)
Types ¶
type AppConfig ¶ added in v0.1.2
type AppConfig interface { *config.TClientConfig | *config.TBenchmarkConfig proto.Message }
type ArrowArrayType ¶
type ArrowBuilder ¶
type ArrowBuilder[VT ValueType] interface { AppendNull() Append(value VT) }
type ClientBuffering ¶ added in v0.1.2
type ClientBuffering struct {
// contains filtered or unexported fields
}
func NewClientBufferingFromClientConfig ¶ added in v0.1.2
func NewClientBufferingFromClientConfig(logger *zap.Logger, clientCfg *config.TClientConfig) (*ClientBuffering, error)
func NewClientBufferingFromServerConfig ¶ added in v0.1.2
func NewClientBufferingFromServerConfig(logger *zap.Logger, serverCfg *config.TServerConfig) (*ClientBuffering, error)
func (*ClientBuffering) DescribeTable ¶ added in v0.1.2
func (c *ClientBuffering) DescribeTable( ctx context.Context, dsi *api_common.TDataSourceInstance, typeMappingSettings *api_service_protos.TTypeMappingSettings, tableName string, ) (*api_service_protos.TDescribeTableResponse, error)
func (*ClientBuffering) ListSplits ¶ added in v0.1.2
func (c *ClientBuffering) ListSplits( ctx context.Context, slct *api_service_protos.TSelect, ) ([]*api_service_protos.TListSplitsResponse, error)
func (*ClientBuffering) ReadSplits ¶ added in v0.1.2
func (c *ClientBuffering) ReadSplits( ctx context.Context, splits []*api_service_protos.TSplit, ) ([]*api_service_protos.TReadSplitsResponse, error)
type ClientStreaming ¶ added in v0.1.2
type ClientStreaming struct {
// contains filtered or unexported fields
}
func NewClientStreamingFromClientConfig ¶ added in v0.1.2
func NewClientStreamingFromClientConfig(logger *zap.Logger, clientCfg *config.TClientConfig) (*ClientStreaming, error)
func NewClientStreamingFromServerConfig ¶ added in v0.1.2
func NewClientStreamingFromServerConfig(logger *zap.Logger, serverCfg *config.TServerConfig) (*ClientStreaming, error)
func (*ClientStreaming) Close ¶ added in v0.1.2
func (c *ClientStreaming) Close()
func (*ClientStreaming) DescribeTable ¶ added in v0.1.2
func (c *ClientStreaming) DescribeTable( ctx context.Context, dsi *api_common.TDataSourceInstance, typeMappingSettings *api_service_protos.TTypeMappingSettings, tableName string, ) (*api_service_protos.TDescribeTableResponse, error)
func (*ClientStreaming) ListSplits ¶ added in v0.1.2
func (c *ClientStreaming) ListSplits( ctx context.Context, slct *api_service_protos.TSelect, ) (<-chan *StreamResult[*api_service_protos.TListSplitsResponse], error)
func (*ClientStreaming) ReadSplits ¶ added in v0.1.2
func (c *ClientStreaming) ReadSplits( ctx context.Context, splits []*api_service_protos.TSplit, ) (<-chan *StreamResult[*api_service_protos.TReadSplitsResponse], error)
type MetricsSnapshot ¶ added in v0.2.13
type MetricsSnapshot struct {
// contains filtered or unexported fields
}
MetricsSnapshot is an instant view of statistics provided by the `fq-connector-go` service
func NewMetricsSnapshot ¶ added in v0.2.13
func NewMetricsSnapshot(endpoint *api_common.TEndpoint, useTLS bool) (*MetricsSnapshot, error)
func (*MetricsSnapshot) FindStatusSensors ¶ added in v0.2.13
func (ms *MetricsSnapshot) FindStatusSensors(typ, method, name, status string) []StatusSensor
type QueryLogger ¶
func (*QueryLogger) Dump ¶
func (ql *QueryLogger) Dump(query string, args ...any)
type QueryLoggerFactory ¶
type QueryLoggerFactory struct {
// contains filtered or unexported fields
}
func NewQueryLoggerFactory ¶
func NewQueryLoggerFactory(cfg *config.TLoggerConfig) QueryLoggerFactory
func (*QueryLoggerFactory) Make ¶
func (f *QueryLoggerFactory) Make(logger *zap.Logger) QueryLogger
type StatusSensor ¶ added in v0.2.13
type StreamResponse ¶
type StreamResponse interface { *api_service_protos.TListSplitsResponse | *api_service_protos.TReadSplitsResponse GetError() *api_service_protos.TError }
type StreamResult ¶ added in v0.1.2
type StreamResult[T StreamResponse] struct { Response T Err error }
type TestingServer ¶ added in v0.2.21
type TestingServer interface { Start() ClientBuffering() *ClientBuffering ClientStreaming() *ClientStreaming MetricsSnapshot() (*MetricsSnapshot, error) Stop() }
TestingServer is mainly used in integration tests or benchmarks. It may be either a real Connector server embedded in this process, or a Connector client connected to the remote server instance.
func NewTestingServerRemote ¶ added in v0.2.21
func NewTestingServerRemote(logger *zap.Logger, clientCfg *config.TClientConfig) (TestingServer, error)
Click to show internal directories.
Click to hide internal directories.