Documentation
¶
Index ¶
- Constants
- type Storage
- func (s *Storage) DeleteActiveTasks(ctx context.Context) ([]*logstorage.DeleteTask, error)
- func (s *Storage) DeleteRunTask(ctx context.Context, taskID string, timestamp int64, ...) error
- func (s *Storage) DeleteStopTask(ctx context.Context, taskID string) error
- func (s *Storage) GetFieldNames(qctx *logstorage.QueryContext) ([]logstorage.ValueWithHits, error)
- func (s *Storage) GetFieldValues(qctx *logstorage.QueryContext, fieldName string, limit uint64) ([]logstorage.ValueWithHits, error)
- func (s *Storage) GetStreamFieldNames(qctx *logstorage.QueryContext) ([]logstorage.ValueWithHits, error)
- func (s *Storage) GetStreamFieldValues(qctx *logstorage.QueryContext, fieldName string, limit uint64) ([]logstorage.ValueWithHits, error)
- func (s *Storage) GetStreamIDs(qctx *logstorage.QueryContext, limit uint64) ([]logstorage.ValueWithHits, error)
- func (s *Storage) GetStreams(qctx *logstorage.QueryContext, limit uint64) ([]logstorage.ValueWithHits, error)
- func (s *Storage) GetTenantIDs(ctx context.Context, start, end int64) ([]logstorage.TenantID, error)
- func (s *Storage) MustStop()
- func (s *Storage) RunQuery(qctx *logstorage.QueryContext, writeBlock logstorage.WriteDataBlockFunc) error
Constants ¶
const ( // FieldNamesProtocolVersion is the version of the protocol used for /internal/select/field_names HTTP endpoint. // // It must be updated every time the protocol changes. FieldNamesProtocolVersion = "v4" // FieldValuesProtocolVersion is the version of the protocol used for /internal/select/field_values HTTP endpoint. // // It must be updated every time the protocol changes. FieldValuesProtocolVersion = "v4" // StreamFieldNamesProtocolVersion is the version of the protocol used for /internal/select/stream_field_names HTTP endpoint. // // It must be updated every time the protocol changes. StreamFieldNamesProtocolVersion = "v4" // StreamFieldValuesProtocolVersion is the version of the protocol used for /internal/select/stream_field_values HTTP endpoint. // // It must be updated every time the protocol changes. StreamFieldValuesProtocolVersion = "v4" // StreamsProtocolVersion is the version of the protocol used for /internal/select/streams HTTP endpoint. // // It must be updated every time the protocol changes. StreamsProtocolVersion = "v4" // StreamIDsProtocolVersion is the version of the protocol used for /internal/select/stream_ids HTTP endpoint. // // It must be updated every time the protocol changes. StreamIDsProtocolVersion = "v4" // QueryProtocolVersion is the version of the protocol used for /internal/select/query HTTP endpoint. // // It must be updated every time the protocol changes. QueryProtocolVersion = "v4" // DeleteRunTaskProtocolVersion is the version of the protocol used for /internal/delete/run_task HTTP endpoint. // // It must be updated every time the protocol changes. DeleteRunTaskProtocolVersion = "v1" // DeleteStopTaskProtocolVersion is the version of the protocol used for /internal/delete/stop_task HTTP endpoint. // // It must be updated every time the protocol changes. DeleteStopTaskProtocolVersion = "v1" // DeleteActiveTasksProtocolVersion is the version of the protocol used for /internal/delete/active_tasks endpoint. // // It must be updated every time the protocol changes. DeleteActiveTasksProtocolVersion = "v1" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage is a network storage for querying remote storage nodes in the cluster.
func NewStorage ¶
func NewStorage(addrs []string, authCfgs []*promauth.Config, isTLSs []bool, disableCompression bool) *Storage
NewStorage returns new Storage for the given addrs and the given authCfgs.
If disableCompression is set, then uncompressed responses are received from storage nodes.
Call MustStop on the returned storage when it is no longer needed.
func (*Storage) DeleteActiveTasks ¶ added in v0.5.1
func (s *Storage) DeleteActiveTasks(ctx context.Context) ([]*logstorage.DeleteTask, error)
DeleteActiveTasks returns the list of active delete tasks started via DeleteRunTask
func (*Storage) DeleteRunTask ¶ added in v0.5.1
func (s *Storage) DeleteRunTask(ctx context.Context, taskID string, timestamp int64, tenantIDs []logstorage.TenantID, f *logstorage.Filter) error
DeleteRunTask starts deletion of logs for the given filter f at the given tenantIDs.
func (*Storage) DeleteStopTask ¶ added in v0.5.1
DeleteStopTask stops the delete task with the given taskID.
func (*Storage) GetFieldNames ¶
func (s *Storage) GetFieldNames(qctx *logstorage.QueryContext) ([]logstorage.ValueWithHits, error)
GetFieldNames executes qctx and returns field names seen in results.
func (*Storage) GetFieldValues ¶
func (s *Storage) GetFieldValues(qctx *logstorage.QueryContext, fieldName string, limit uint64) ([]logstorage.ValueWithHits, error)
GetFieldValues executes qctx and returns unique values for the fieldName seen in results.
If limit > 0, then up to limit unique values are returned.
func (*Storage) GetStreamFieldNames ¶
func (s *Storage) GetStreamFieldNames(qctx *logstorage.QueryContext) ([]logstorage.ValueWithHits, error)
GetStreamFieldNames executes qctx and returns stream field names seen in results.
func (*Storage) GetStreamFieldValues ¶
func (s *Storage) GetStreamFieldValues(qctx *logstorage.QueryContext, fieldName string, limit uint64) ([]logstorage.ValueWithHits, error)
GetStreamFieldValues executes qctx and returns stream field values for the given fieldName seen in results.
If limit > 0, then up to limit unique stream field values are returned.
func (*Storage) GetStreamIDs ¶
func (s *Storage) GetStreamIDs(qctx *logstorage.QueryContext, limit uint64) ([]logstorage.ValueWithHits, error)
GetStreamIDs executes qctx and returns streamIDs seen in query results.
If limit > 0, then up to limit unique streamIDs are returned.
func (*Storage) GetStreams ¶
func (s *Storage) GetStreams(qctx *logstorage.QueryContext, limit uint64) ([]logstorage.ValueWithHits, error)
GetStreams executes qctx and returns streams seen in query results.
If limit > 0, then up to limit unique streams are returned.
func (*Storage) GetTenantIDs ¶ added in v0.5.1
func (s *Storage) GetTenantIDs(ctx context.Context, start, end int64) ([]logstorage.TenantID, error)
GetTenantIDs returns tenantIDs for the given start and end.
func (*Storage) RunQuery ¶
func (s *Storage) RunQuery(qctx *logstorage.QueryContext, writeBlock logstorage.WriteDataBlockFunc) error
RunQuery runs the given qctx and calls writeBlock for the returned data blocks