godruid

package module
v0.0.0-...-918893f Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2021 License: MIT Imports: 7 Imported by: 3

README

godruid

An open source Golang client for Druid

Node: This project is not yet beta released. It should certainly contains bugs, and the apis could change in any time. So please be really careful if you choose to use it in production. Currently the groupBy and topN queries are used in our production.

Any bug fixes, issues, contributions, questions are welcome.

Documentation

Index

Constants

View Source
const (
	LOWERSTRICT = "lowerStrict"
	UPPERSTRICT = "upperStrict"
	LOWERLIMIT  = "lowerLimit"
	UPPERLIMIT  = "upperLimit"
)

Filter constants

View Source
const (
	TIMEOUT                  = "timeout"
	SKIPEMPTYBUCKETS         = "skipEmptyBuckets"
	QUERYID                  = "queryId"
	POPULATECACHE            = "populateCache"
	POPULATERESULTLEVELCACHE = "populateResultLevelCache"
)

Context constants

View Source
const (
	DirectionASC  = "ASCENDING"
	DirectionDESC = "DESCENDING"
)
View Source
const (
	DefaultQueryEndPoint = "/druid/v2"
)
View Source
const (
	DefaultRetentionRulesEndPoint = "/druid/coordinator/v1/rules/%s"
)
View Source
const (
	DefaultSupervisorEndPoint = "/druid/indexer/v1/supervisor"
)

Variables

View Source
var (
	ToIncludeAll  = &ToInclude{Type: "All"}
	ToIncludeNone = &ToInclude{Type: "None"}
)
View Source
var (
	SearchSortLexicographic = &SearchSort{Type: "lexicographic"}
	SearchSortStrlen        = &SearchSort{Type: "strlen"}
)
View Source
var (
	ErrDatasourceEmpty = errors.New("coordinatorClient: datasource is empty")
)

Functions

func GranDuration

func GranDuration(duration string, origin string) granDuration

func GranPeriod

func GranPeriod(period string, timeZone string, origin string) granPeriod

func GranUniform

func GranUniform(segmentGranularity, queryGranularity string, rollup bool) granUniform

Types

type AggRefer

type AggRefer struct {
	Name  string
	Refer string // The refer of Name, empty means Name has no refer.
}

The agg reference.

type Aggregation

type Aggregation struct {
	Type        string       `json:"type"`
	Name        string       `json:"name,omitempty"`
	FieldName   string       `json:"fieldName,omitempty"`
	FieldNames  []string     `json:"fieldNames,omitempty"`
	FnAggregate string       `json:"fnAggregate,omitempty"`
	FnCombine   string       `json:"fnCombine,omitempty"`
	FnReset     string       `json:"fnReset,omitempty"`
	ByRow       bool         `json:"byRow,omitempty"`
	Filter      *Filter      `json:"filter,omitempty"`
	Resolution  int32        `json:"resolution,omitempty"`
	NumBuckets  int32        `json:"numBuckets,omitempty"`
	LowerLimit  string       `json:"lowerLimit,omitempty"`
	UpperLimit  string       `json:"upperLimit,omitempty"`
	Aggregator  *Aggregation `json:"aggregator,omitempty"`
	Round       bool         `json:"round,omitempty"`
	K           int32        `json:"k,omitempty"` // druid-datasketches extension
}

func AggCardinality

func AggCardinality(name string, fieldNames []string, byRow ...bool) Aggregation

func AggCount

func AggCount(name string) *Aggregation

func AggDoubleMax

func AggDoubleMax(name, fieldName string) *Aggregation

func AggDoubleMean

func AggDoubleMean(name, fieldName string) *Aggregation

func AggDoubleMin

func AggDoubleMin(name, fieldName string) *Aggregation

func AggDoubleSum

func AggDoubleSum(name, fieldName string) *Aggregation

func AggFiltered

func AggFiltered(filter *Filter, aggregator *Aggregation) Aggregation

func AggHistoFold

func AggHistoFold(name string, fieldName string, resolution int32, numBuckets int32, lowerLimit string, upperLimit string) Aggregation

func AggJavaScript

func AggJavaScript(name, fnAggregate, fnCombine, fnReset string, fieldNames []string) Aggregation

func AggLongMax

func AggLongMax(name, fieldName string) *Aggregation

func AggLongMin

func AggLongMin(name, fieldName string) *Aggregation

func AggLongSum

func AggLongSum(name, fieldName string) *Aggregation

func AggMax

func AggMax(name, fieldName string) *Aggregation

func AggMin

func AggMin(name, fieldName string) *Aggregation

func AggRawJson

func AggRawJson(rawJson string) *Aggregation

func ExtAggQuantile

func ExtAggQuantile(name string, fieldName string, k int32) *Aggregation

druid-datasketches extension

func ExtAggThetaSketch

func ExtAggThetaSketch(name string, fieldName string) *Aggregation

druid-datasketches extension

func ExtAggVariance

func ExtAggVariance(name, fieldName string) *Aggregation

druid-stats extension

type Bound

type Bound struct {
	Type      string    `json:"type"`
	MinCoords []float64 `json:"minCoords,omitempty"`
	MaxCoords []float64 `json:"maxCoords,omitempty"`
	Coords    []float64 `json:"coords,omitempty"`
	Radius    float64   `json:"radius,omitempty"`
}

type Client

type Client struct {
	Url      string
	EndPoint string

	Debug        bool
	LastRequest  string
	LastResponse string
	HttpClient   *http.Client
}

func (*Client) Query

func (c *Client) Query(query Query, authToken string) (err error)

func (*Client) QueryRaw

func (c *Client) QueryRaw(req []byte, authToken string) (result []byte, err error)

type Column

type Column struct {
	AsNumber  bool   `json:"asNumber"`
	Dimension string `json:"dimension"`
	Direction string `json:"direction"`
}

type ColumnItem

type ColumnItem struct {
	Type        string      `json:"type"`
	Size        int         `json:"size"`
	Cardinality interface{} `json:"cardinality"`
}

type ConsumerProperties

type ConsumerProperties struct {
	BootstrapServers string `json:"bootstrap.servers"`
	SASLMechanism    string `json:"sasl.mechanism"`
	SecurityProtocal string `json:"security.protocol"`
	SASLJAASConfig   string `json:"sasl.jaas.config"`
}

type CoordinatorClient

type CoordinatorClient struct {
	Url      string
	EndPoint string

	Debug        bool
	LastRequest  string
	LastResponse string
	HttpClient   *http.Client
}

func (*CoordinatorClient) CreateOrUpdateRetentionRule

func (c *CoordinatorClient) CreateOrUpdateRetentionRule(ctx context.Context, datasource string, rules RetentionRulesSpec, authToken string) (err error)

func (*CoordinatorClient) Post

func (c *CoordinatorClient) Post(ctx context.Context, req []byte, authToken string) (result []byte, err error)

type DataSchema

type DataSchema struct {
	Datasource      string         `json:"dataSource"`
	GranularitySpec Granlarity     `json:"granularitySpec"`
	Parser          *Parser        `json:"parser,omitempty"`
	MetricsSpec     []*MetricsSpec `json:"metricsSpec,omitempty"`
}

type DataSource

type DataSource struct {
	Type  string      `json:"type"`
	Name  string      `json:"name,omitempty"`
	Query interface{} `json:"query,omitempty"`
}

func DataSourceQuery

func DataSourceQuery(query interface{}) *DataSource

func DataSourceTable

func DataSourceTable(name string) *DataSource

type DimExtractionFn

type DimExtractionFn struct {
	Type        string       `json:"type"`
	Expr        string       `json:"expr,omitempty"`
	Query       *SearchQuery `json:"query,omitempty"`
	Format      string       `json:"format,omitempty"`
	Function    string       `json:"function,omitempty"`
	TimeZone    string       `json:"timeZone,omitempty"`
	Locale      string       `json:"locale,omitempty"`
	Granularity string       `json:"granularity,omitempty"`
	AsMillis    bool         `json:"asMillis,omitempty"`
}

func DimExFnJavascript

func DimExFnJavascript(function string) *DimExtractionFn

func DimExFnPartial

func DimExFnPartial(expr string) *DimExtractionFn

func DimExFnRegex

func DimExFnRegex(expr string) *DimExtractionFn

func DimExFnSearchQuerySpec

func DimExFnSearchQuerySpec(query *SearchQuery) *DimExtractionFn

func DimExFnTime

func DimExFnTime(timeFormat, timeZone string, locale string, granularity string, asMillis bool) *DimExtractionFn

type DimFiltered

type DimFiltered struct {
	Type     string  `json:"type"`
	Delegate DimSpec `json:"delegate"`
	Pattern  string  `json:"pattern,omitempty"`
}

func DimFilteredRegex

func DimFilteredRegex(delegate DimSpec, pattern string) *DimFiltered

type DimSpec

type DimSpec interface{}

func DimDefault

func DimDefault(dimension, outputName string) DimSpec

func DimExtraction

func DimExtraction(dimension, outputName string, fn *DimExtractionFn) DimSpec

type DimValue

type DimValue struct {
	Dimension string `json:"dimension"`
	Value     string `json:"value"`
}

type Dimension

type Dimension struct {
	Type         string           `json:"type"`
	Dimension    string           `json:"dimension"`
	OutputName   string           `json:"outputName"`
	ExtractionFn *DimExtractionFn `json:"extractionFn,omitempty"`
}

type EmptyDimension

type EmptyDimension struct{}

type ExtractionFn

type ExtractionFn interface{}

type Filter

type Filter struct {
	Type         string        `json:"type"`
	Dimension    string        `json:"dimension,omitempty"`
	Value        interface{}   `json:"value,omitempty"`
	Values       interface{}   `json:"values,omitempty"`
	Pattern      string        `json:"pattern,omitempty"`
	Function     string        `json:"function,omitempty"`
	Field        *Filter       `json:"field,omitempty"`
	Fields       []*Filter     `json:"fields,omitempty"`
	Upper        float32       `json:"upper,omitempty"`
	Lower        float32       `json:"lower,omitempty"`
	Ordering     Ordering      `json:"ordering,omitempty"`
	UpperStrict  bool          `json:"upperStrict,omitempty"`
	LowerStrict  bool          `json:"lowerStrict,omitempty"`
	ExtractionFn *ExtractionFn `json:"extractionFn,omitempty"`
	Bound        *Bound        `json:"bound,omitempty"`
}

func FilterAnd

func FilterAnd(filters ...*Filter) *Filter

func FilterJavaScript

func FilterJavaScript(dimension, function string) *Filter

func FilterLowerBound

func FilterLowerBound(dimension string, ordering Ordering, bound float32, strict bool) *Filter

func FilterLowerUpperBound

func FilterLowerUpperBound(dimension string, ordering Ordering, lowerBound float32, lowerStrict bool, upperBound float32, upperStrict bool) *Filter

func FilterNot

func FilterNot(filter *Filter) *Filter

func FilterOr

func FilterOr(filters ...*Filter) *Filter

func FilterRegex

func FilterRegex(dimension, pattern string) *Filter

func FilterSelector

func FilterSelector(dimension string, value interface{}) *Filter

func FilterSpatialRadius

func FilterSpatialRadius(dimension string, coords SpatialCoordinates, radius float64) *Filter

func FilterSpatialRectangle

func FilterSpatialRectangle(dimension string, minCoords SpatialCoordinates, maxCoords SpatialCoordinates) *Filter

func FilterUpperBound

func FilterUpperBound(dimension string, ordering Ordering, bound float32, strict bool) *Filter

type Granlarity

type Granlarity interface{}

type GroupbyItem

type GroupbyItem struct {
	Version   string                 `json:"version"`
	Timestamp string                 `json:"timestamp"`
	Event     map[string]interface{} `json:"event"`
}

type Having

type Having struct {
	Type        string      `json:"type"`
	Aggregation string      `json:"aggregation,omitempty"`
	Value       interface{} `json:"value,omitempty"`
	HavingSpec  *Having     `json:"havingSpec,omitempty"`
	HavingSpecs []*Having   `json:"havingSpecs,omitempty"`
}

func HavingAnd

func HavingAnd(havings ...*Having) *Having

func HavingEqualTo

func HavingEqualTo(agg string, value interface{}) *Having

func HavingGreaterThan

func HavingGreaterThan(agg string, value interface{}) *Having

func HavingLessThan

func HavingLessThan(agg string, value interface{}) *Having

func HavingNot

func HavingNot(having *Having) *Having

func HavingOr

func HavingOr(havings ...*Having) *Having

type IOConfig

type IOConfig interface{}

func IOConfigKafka

func IOConfigKafka(topic, latestMessageRejectPeriod, earlyMessageRejectionPeriod, bootstrapServers, saslMechanism, securityProtocal, sasLJAASConfig string) IOConfig

type Intervals

type Intervals interface{}

type Limit

type Limit struct {
	Type    string   `json:"type"`
	Limit   int      `json:"limit"`
	Columns []Column `json:"columns,omitempty"`
}

func LimitDefault

func LimitDefault(limit int, columns ...[]Column) *Limit

type MetricsSpec

type MetricsSpec struct {
	Type      string `json:"type"`
	Name      string `json:"name"`
	FieldName string `json:"fieldName,omitempty"`
	InputType string `json:"inputType,omitempty"`
	Estimator string `json:"estimator,omitempty"`
}

type Ordering

type Ordering string
const (
	LEXICOGRAPHIC Ordering = "lexicographic"
	ALPHANUMERIC  Ordering = "alphanumeric"
	NUMERIC       Ordering = "numeric"
	STRLEN        Ordering = "strlen"
)

type OverlordClient

type OverlordClient struct {
	Url      string
	EndPoint string

	Debug        bool
	LastRequest  string
	LastResponse string
	HttpClient   *http.Client
}

func (*OverlordClient) CreateOrUpdateSupervisor

func (c *OverlordClient) CreateOrUpdateSupervisor(ctx context.Context, spec SupervisorSpec, authToken string) (err error)

func (*OverlordClient) Post

func (c *OverlordClient) Post(ctx context.Context, req []byte, authToken string) (result []byte, err error)

type ParseSpec

type ParseSpec struct {
	Format        string         `json:"format"`
	TimestampSpec *TimestampSpec `json:"timestampSpec"`
	DimensionSpec DimSpec        `json:"dimensionsSpec"`
}

type Parser

type Parser struct {
	Type      string     `json:"type"`
	ParseSpec *ParseSpec `json:"parseSpec"`
}

type PostAggregation

type PostAggregation struct {
	Type        string            `json:"type"`
	Name        string            `json:"name,omitempty"`
	Value       interface{}       `json:"value,omitempty"`
	Fn          string            `json:"fn,omitempty"`
	Fields      []PostAggregation `json:"fields,omitempty"`
	FieldName   string            `json:"fieldName,omitempty"`
	FieldNames  []string          `json:"fieldNames,omitempty"`
	Function    string            `json:"function,omitempty"`
	Fraction    float64           `json:"fraction,omitempty"`    // druid-datasketches extension - quantiles
	Fractions   []float64         `json:"fractions,omitempty"`   // druid-datasketches extension - quantiles
	Field       *PostAggregation  `json:"field,omitempty"`       // druid-datasketches extension
	SplitPoints []float64         `json:"splitPoints,omitempty"` // druid-datasketches extension - histogram
}

func ExtPostAggHistogram

func ExtPostAggHistogram(name, fieldName string, splitPoints []float64) PostAggregation

druid-datasketchess extension

func ExtPostAggQuantile

func ExtPostAggQuantile(name, fieldName string, fraction float64) PostAggregation

druid-datasketchess extension

func ExtPostAggQuantiles

func ExtPostAggQuantiles(name, fieldName string, fractions []float64) PostAggregation

druid-datasketchess extension

func ExtPostAggStdDev

func ExtPostAggStdDev(name, fieldName string) PostAggregation

druid-stats extension

func PostAggArithmetic

func PostAggArithmetic(name, fn string, fields []PostAggregation) PostAggregation

func PostAggConstant

func PostAggConstant(name string, value interface{}) PostAggregation

func PostAggFieldAccessor

func PostAggFieldAccessor(fieldName string) PostAggregation

func PostAggFieldHyperUnique

func PostAggFieldHyperUnique(fieldName string) PostAggregation

func PostAggJavaScript

func PostAggJavaScript(name, function string, fieldNames []string) PostAggregation

func PostAggRawJson

func PostAggRawJson(rawJson string) PostAggregation

func (PostAggregation) GetReferAggs

func (pa PostAggregation) GetReferAggs(parentName ...string) (refers []AggRefer)

Return the aggregations or post aggregations which this post aggregation used. It could be helpful while automatically filling the aggregations or post aggregations base on this.

type Query

type Query interface {
	GetRawJSON() []byte
	// contains filtered or unexported methods
}

The Query interface stands for any kinds of druid query.

type QueryGroupBy

type QueryGroupBy struct {
	QueryType        QueryType              `json:"queryType"`
	DataSource       *DataSource            `json:"dataSource"`
	Dimensions       []DimSpec              `json:"dimensions"`
	Granularity      Granlarity             `json:"granularity"`
	LimitSpec        *Limit                 `json:"limitSpec,omitempty"`
	Having           *Having                `json:"having,omitempty"`
	Filter           *Filter                `json:"filter,omitempty"`
	Aggregations     []Aggregation          `json:"aggregations"`
	PostAggregations []PostAggregation      `json:"postAggregations,omitempty"`
	Intervals        Intervals              `json:"intervals"`
	Context          map[string]interface{} `json:"context,omitempty"`
	VirtualColumns   []VirtualColumn        `json:"virtualColumns,omitempty"`
	QueryResult      []GroupbyItem          `json:"-"`
	RawJSON          []byte
}

func (*QueryGroupBy) GetRawJSON

func (q *QueryGroupBy) GetRawJSON() []byte

type QueryScan

type QueryScan struct {
	QueryType      QueryType              `json:"queryType"`
	DataSource     *DataSource            `json:"dataSource"`
	Limit          int                    `json:"limit,omitempty"`
	Columns        []string               `json:"columns,omitempty"`
	ResultFormat   string                 `json:"resultFormat,omitempty"`
	Metric         interface{}            `json:"metric"` // *TopNMetric
	Filter         *Filter                `json:"filter,omitempty"`
	Intervals      Intervals              `json:"intervals"`
	Context        map[string]interface{} `json:"context,omitempty"`
	VirtualColumns []VirtualColumn        `json:"virtualColumns,omitempty"`
	QueryResult    []ScanBlob             `json:"-"`
	RawJSON        []byte
}

func (*QueryScan) GetRawJSON

func (q *QueryScan) GetRawJSON() []byte

type QuerySearch

type QuerySearch struct {
	QueryType        QueryType              `json:"queryType"`
	DataSource       *DataSource            `json:"dataSource"`
	Granularity      Granlarity             `json:"granularity"`
	Filter           *Filter                `json:"filter,omitempty"`
	Intervals        Intervals              `json:"intervals"`
	SearchDimensions []string               `json:"searchDimensions,omitempty"`
	Query            *SearchQuery           `json:"query"`
	Sort             *SearchSort            `json:"sort"`
	Context          map[string]interface{} `json:"context,omitempty"`
	VirtualColumns   []VirtualColumn        `json:"virtualColumns,omitempty"`
	QueryResult      []SearchItem           `json:"-"`
	RawJSON          []byte
}

func (*QuerySearch) GetRawJSON

func (q *QuerySearch) GetRawJSON() []byte

type QuerySegmentMetadata

type QuerySegmentMetadata struct {
	QueryType      QueryType              `json:"queryType"`
	DataSource     *DataSource            `json:"dataSource"`
	Intervals      Intervals              `json:"intervals"`
	ToInclude      *ToInclude             `json:"toInclude,omitempty"`
	Merge          interface{}            `json:"merge,omitempty"`
	Context        map[string]interface{} `json:"context,omitempty"`
	VirtualColumns []VirtualColumn        `json:"virtualColumns,omitempty"`
	QueryResult    []SegmentMetaData      `json:"-"`
	RawJSON        []byte
}

func (*QuerySegmentMetadata) GetRawJSON

func (q *QuerySegmentMetadata) GetRawJSON() []byte

type QuerySelect

type QuerySelect struct {
	QueryType      QueryType              `json:"queryType"`
	DataSource     *DataSource            `json:"dataSource"`
	Intervals      Intervals              `json:"intervals"`
	Filter         *Filter                `json:"filter,omitempty"`
	Dimensions     []DimSpec              `json:"dimensions"`
	Metrics        []string               `json:"metrics"`
	Granularity    Granlarity             `json:"granularity"`
	PagingSpec     map[string]interface{} `json:"pagingSpec,omitempty"`
	Context        map[string]interface{} `json:"context,omitempty"`
	VirtualColumns []VirtualColumn        `json:"virtualColumns,omitempty"`
	QueryResult    SelectBlob             `json:"-"`
	RawJSON        []byte
}

func (*QuerySelect) GetRawJSON

func (q *QuerySelect) GetRawJSON() []byte

type QueryTimeBoundary

type QueryTimeBoundary struct {
	QueryType  QueryType              `json:"queryType"`
	DataSource *DataSource            `json:"dataSource"`
	Bound      string                 `json:"bound,omitempty"`
	Context    map[string]interface{} `json:"context,omitempty"`

	QueryResult []TimeBoundaryItem `json:"-"`
	RawJSON     []byte
}

func (*QueryTimeBoundary) GetRawJSON

func (q *QueryTimeBoundary) GetRawJSON() []byte

type QueryTimeseries

type QueryTimeseries struct {
	QueryType        QueryType              `json:"queryType"`
	DataSource       *DataSource            `json:"dataSource"`
	Granularity      Granlarity             `json:"granularity"`
	Filter           *Filter                `json:"filter,omitempty"`
	Aggregations     []Aggregation          `json:"aggregations"`
	PostAggregations []PostAggregation      `json:"postAggregations,omitempty"`
	Intervals        Intervals              `json:"intervals"`
	Context          map[string]interface{} `json:"context,omitempty"`
	VirtualColumns   []VirtualColumn        `json:"virtualColumns,omitempty"`
	QueryResult      []Timeseries           `json:"-"`
	RawJSON          []byte
}

func (*QueryTimeseries) GetRawJSON

func (q *QueryTimeseries) GetRawJSON() []byte

type QueryTopN

type QueryTopN struct {
	QueryType        QueryType              `json:"queryType"`
	DataSource       *DataSource            `json:"dataSource"`
	Granularity      Granlarity             `json:"granularity"`
	Dimension        DimSpec                `json:"dimension"`
	Threshold        int                    `json:"threshold"`
	Metric           interface{}            `json:"metric"` // *TopNMetric
	Filter           *Filter                `json:"filter,omitempty"`
	Aggregations     []Aggregation          `json:"aggregations"`
	PostAggregations []PostAggregation      `json:"postAggregations,omitempty"`
	Intervals        Intervals              `json:"intervals"`
	Context          map[string]interface{} `json:"context,omitempty"`
	VirtualColumns   []VirtualColumn        `json:"virtualColumns,omitempty"`
	QueryResult      []TopNItem             `json:"-"`
	RawJSON          []byte
}

func (*QueryTopN) GetRawJSON

func (q *QueryTopN) GetRawJSON() []byte

type QueryType

type QueryType string
const (
	TIMESERIES      QueryType = "timeseries"
	TOPN            QueryType = "topN"
	SEARCH          QueryType = "search"
	GROUPBY         QueryType = "groupBy"
	SEGMENTMETADATA QueryType = "segmentMetadata"
	TIMEBOUNDARY    QueryType = "timeBoundary"
	SELECT          QueryType = "select"
	SCAN            QueryType = "scan"
)

type RegisteredLookupExtractionFn

type RegisteredLookupExtractionFn struct {
	Type   string `json:"type"`
	Lookup string `json:"lookup"`
}

type RetentionRule

type RetentionRule struct {
	Type             string            `json:"type"`
	Period           string            `json:"period,omitempty"`
	IncludeFuture    bool              `json:"includeFuture,omitempty"`
	Interval         string            `json:"interval,omitempty"`
	TieredReplicants *TieredReplicants `json:"tieredReplicants,omitempty"`
}

func DropBeforeByPeriodRetensionRule

func DropBeforeByPeriodRetensionRule(period string) *RetentionRule

func LoadForeverRetensionRule

func LoadForeverRetensionRule() *RetentionRule

type RetentionRules

type RetentionRules struct {
	Rules               []*RetentionRule
	RetentionRuleResult *RetentionRulesResult `json:"-"`
	RawJSON             []byte                `json:"-"`
}

func (*RetentionRules) GetRawJSON

func (s *RetentionRules) GetRawJSON() []byte

type RetentionRulesResult

type RetentionRulesResult struct {
	// contains filtered or unexported fields
}

type RetentionRulesSpec

type RetentionRulesSpec interface {
	GetRawJSON() []byte
	// contains filtered or unexported methods
}

type ScanBlob

type ScanBlob struct {
	SegmentID string                   `json:"segmentId"`
	Columns   []string                 `json:"columns"`
	Events    []map[string]interface{} `json:"events"`
}

type SearchItem

type SearchItem struct {
	Timestamp string     `json:"timestamp"`
	Result    []DimValue `json:"result"`
}

type SearchQuery

type SearchQuery struct {
	Type   string        `json:"type"`
	Value  interface{}   `json:"value,omitempty"`
	Values []interface{} `json:"values,omitempty"`
}

func SearchQueryFragmentSearch

func SearchQueryFragmentSearch(values []interface{}) *SearchQuery

func SearchQueryInsensitiveContains

func SearchQueryInsensitiveContains(value interface{}) *SearchQuery

type SearchSort

type SearchSort struct {
	Type string `json:"type"`
}

type SegmentMetaData

type SegmentMetaData struct {
	Id        string                `json:"id"`
	Intervals Intervals             `json:"intervals"`
	Columns   map[string]ColumnItem `json:"columns"`
}

type SelectBlob

type SelectBlob struct {
	Timestamp string       `json:"timestamp"`
	Result    SelectResult `json:"result"`
}

Select json blob from druid comes back as following: http://druid.io/docs/latest/querying/select-query.html the interesting results are in events blob which we call as 'SelectEvent'.

type SelectEvent

type SelectEvent struct {
	SegmentId string                 `json:"segmentId"`
	Offset    int64                  `json:"offset"`
	Event     map[string]interface{} `json:"event"`
}

type SelectResult

type SelectResult struct {
	PagingIdentifiers map[string]interface{} `json:"pagingIdentifiers"`
	Events            []SelectEvent          `json:"events"`
}

type SimpleGran

type SimpleGran string
const (
	GranAll        SimpleGran = "all"
	GranNone       SimpleGran = "none"
	GranMinute     SimpleGran = "minute"
	GranFifteenMin SimpleGran = "fifteen_minute"
	GranThirtyMin  SimpleGran = "thirty_minute"
	GranHour       SimpleGran = "hour"
	GranDay        SimpleGran = "day"
)

type SpatialCoordinates

type SpatialCoordinates struct {
	Latitude  float64
	Longitude float64
}

type Supervisor

type Supervisor struct {
	Id string `json:"id"`
}

type SupervisorKafka

type SupervisorKafka struct {
	Type         string       `json:"type"`
	IOConfig     IOConfig     `json:"ioConfig"`
	TuningConfig TuningConfig `json:"tuningConfig"`
	DataSchema   *DataSchema  `json:"dataSchema"`
	SubmitResult Supervisor   `json:"-"`
	RawJSON      []byte       `json:"-"`
}

func (*SupervisorKafka) GetRawJSON

func (s *SupervisorKafka) GetRawJSON() []byte

type SupervisorSpec

type SupervisorSpec interface {
	GetRawJSON() []byte
	// contains filtered or unexported methods
}

type TieredReplicants

type TieredReplicants struct {
	Hot         int `json:"hot,omitempty"`
	DefaultTier int `json:"_default_tier,omitempty"`
}

type TimeBoundary

type TimeBoundary struct {
	MinTime string `json:"minTime"`
	MaxTime string `json:"maxTime"`
}

type TimeBoundaryItem

type TimeBoundaryItem struct {
	Timestamp string       `json:"timestamp"`
	Result    TimeBoundary `json:"result"`
}

type TimeExtractionDimensionSpec

type TimeExtractionDimensionSpec struct {
	Type               string       `json:"type"`
	Dimension          string       `json:"dimension"`
	OutputName         string       `json:"outputName"`
	ExtractionFunction ExtractionFn `json:"extractionFn"`
}

type TimeExtractionFn

type TimeExtractionFn struct {
	Type     string `json:"type"`
	Format   string `json:"format"`
	TimeZone string `json:"timeZone"`
	Locale   string `json:"locale"`
}

type Timeseries

type Timeseries struct {
	Timestamp string                 `json:"timestamp"`
	Result    map[string]interface{} `json:"result"`
}

type TimestampSpec

type TimestampSpec struct {
	Column string `json:"column"`
	Format string `json:"format"`
}

type ToInclude

type ToInclude struct {
	Type    string   `json:"type"`
	Columns []string `json:"columns,omitempty"`
}

func ToIncludeList

func ToIncludeList(columns []string) *ToInclude

type TopNItem

type TopNItem struct {
	Timestamp string                   `json:"timestamp"`
	Result    []map[string]interface{} `json:"result"`
}

type TopNMetric

type TopNMetric struct {
	Type         string      `json:"type"`
	Metric       interface{} `json:"metric,omitempty"`
	PreviousStop string      `json:"previousStop"`
}

func TopNMetricAlphaNumeric

func TopNMetricAlphaNumeric(previousStop string) *TopNMetric

func TopNMetricInverted

func TopNMetricInverted(metric *TopNMetric) *TopNMetric

func TopNMetricLexicographic

func TopNMetricLexicographic(previousStop string) *TopNMetric

func TopNMetricNumeric

func TopNMetricNumeric(metric string) *TopNMetric

type TuningConfig

type TuningConfig interface{}

func TuningConfigKafka

func TuningConfigKafka(maxRowPerSegment int) TuningConfig

type VirtualColumn

type VirtualColumn struct {
	Type       string                  `json:"type"`
	Name       string                  `json:"name"`
	Expression string                  `json:"expression"`
	OutputType VirtualColumnOutputType `json:"outputType"`
}

func NewVirtualColumn

func NewVirtualColumn(name string, expression string, outputType VirtualColumnOutputType) VirtualColumn

type VirtualColumnOutputType

type VirtualColumnOutputType string
const (
	VirtualColumnLong   VirtualColumnOutputType = "LONG"
	VirtualColumnFloat  VirtualColumnOutputType = "FLOAT"
	VirtualColumnDouble VirtualColumnOutputType = "DOUBLE"
	VirtualColumnString VirtualColumnOutputType = "STRING"
)

Jump to

Keyboard shortcuts

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