id
int32
0
167k
repo
stringlengths
5
54
path
stringlengths
4
155
func_name
stringlengths
1
118
original_string
stringlengths
52
85.5k
language
stringclasses
1 value
code
stringlengths
52
85.5k
code_tokens
list
docstring
stringlengths
6
2.61k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
85
252
124,100
influxdata/influxdb
chronograf/server/auth.go
RawStoreAccess
func RawStoreAccess(logger chronograf.Logger, next http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { ctx := r.Context() if isServer := hasServerContext(ctx); isServer { next(w, r) return } log := logger. WithField("component", "raw_store"). WithField("remot...
go
func RawStoreAccess(logger chronograf.Logger, next http.HandlerFunc) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { ctx := r.Context() if isServer := hasServerContext(ctx); isServer { next(w, r) return } log := logger. WithField("component", "raw_store"). WithField("remot...
[ "func", "RawStoreAccess", "(", "logger", "chronograf", ".", "Logger", ",", "next", "http", ".", "HandlerFunc", ")", "http", ".", "HandlerFunc", "{", "return", "func", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{...
// RawStoreAccess gives a super admin access to the data store without a facade.
[ "RawStoreAccess", "gives", "a", "super", "admin", "access", "to", "the", "data", "store", "without", "a", "facade", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/auth.go#L59-L83
124,101
influxdata/influxdb
chronograf/mocks/auth.go
Validate
func (a *Authenticator) Validate(context.Context, *http.Request) (oauth2.Principal, error) { return a.Principal, a.ValidateErr }
go
func (a *Authenticator) Validate(context.Context, *http.Request) (oauth2.Principal, error) { return a.Principal, a.ValidateErr }
[ "func", "(", "a", "*", "Authenticator", ")", "Validate", "(", "context", ".", "Context", ",", "*", "http", ".", "Request", ")", "(", "oauth2", ".", "Principal", ",", "error", ")", "{", "return", "a", ".", "Principal", ",", "a", ".", "ValidateErr", "\...
// Validate returns Principal associated with authenticated and authorized // entity if successful.
[ "Validate", "returns", "Principal", "associated", "with", "authenticated", "and", "authorized", "entity", "if", "successful", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/mocks/auth.go#L20-L22
124,102
influxdata/influxdb
chronograf/mocks/auth.go
Extend
func (a *Authenticator) Extend(ctx context.Context, w http.ResponseWriter, p oauth2.Principal) (oauth2.Principal, error) { cookie := http.Cookie{} http.SetCookie(w, &cookie) return a.Principal, a.ExtendErr }
go
func (a *Authenticator) Extend(ctx context.Context, w http.ResponseWriter, p oauth2.Principal) (oauth2.Principal, error) { cookie := http.Cookie{} http.SetCookie(w, &cookie) return a.Principal, a.ExtendErr }
[ "func", "(", "a", "*", "Authenticator", ")", "Extend", "(", "ctx", "context", ".", "Context", ",", "w", "http", ".", "ResponseWriter", ",", "p", "oauth2", ".", "Principal", ")", "(", "oauth2", ".", "Principal", ",", "error", ")", "{", "cookie", ":=", ...
// Extend will extend the lifetime of a already validated Principal
[ "Extend", "will", "extend", "the", "lifetime", "of", "a", "already", "validated", "Principal" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/mocks/auth.go#L25-L30
124,103
influxdata/influxdb
chronograf/mocks/auth.go
Authorize
func (a *Authenticator) Authorize(ctx context.Context, w http.ResponseWriter, p oauth2.Principal) error { cookie := http.Cookie{} http.SetCookie(w, &cookie) return nil }
go
func (a *Authenticator) Authorize(ctx context.Context, w http.ResponseWriter, p oauth2.Principal) error { cookie := http.Cookie{} http.SetCookie(w, &cookie) return nil }
[ "func", "(", "a", "*", "Authenticator", ")", "Authorize", "(", "ctx", "context", ".", "Context", ",", "w", "http", ".", "ResponseWriter", ",", "p", "oauth2", ".", "Principal", ")", "error", "{", "cookie", ":=", "http", ".", "Cookie", "{", "}", "\n\n", ...
// Authorize will grant privileges to a Principal
[ "Authorize", "will", "grant", "privileges", "to", "a", "Principal" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/mocks/auth.go#L33-L38
124,104
influxdata/influxdb
chronograf/mocks/auth.go
ValidAuthorization
func (a *Authenticator) ValidAuthorization(ctx context.Context, serializedAuthorization string) (oauth2.Principal, error) { return oauth2.Principal{}, nil }
go
func (a *Authenticator) ValidAuthorization(ctx context.Context, serializedAuthorization string) (oauth2.Principal, error) { return oauth2.Principal{}, nil }
[ "func", "(", "a", "*", "Authenticator", ")", "ValidAuthorization", "(", "ctx", "context", ".", "Context", ",", "serializedAuthorization", "string", ")", "(", "oauth2", ".", "Principal", ",", "error", ")", "{", "return", "oauth2", ".", "Principal", "{", "}", ...
// ValidAuthorization returns the Principal
[ "ValidAuthorization", "returns", "the", "Principal" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/mocks/auth.go#L44-L46
124,105
influxdata/influxdb
chronograf/mocks/auth.go
Serialize
func (a *Authenticator) Serialize(context.Context, oauth2.Principal) (string, error) { return a.Serialized, nil }
go
func (a *Authenticator) Serialize(context.Context, oauth2.Principal) (string, error) { return a.Serialized, nil }
[ "func", "(", "a", "*", "Authenticator", ")", "Serialize", "(", "context", ".", "Context", ",", "oauth2", ".", "Principal", ")", "(", "string", ",", "error", ")", "{", "return", "a", ".", "Serialized", ",", "nil", "\n", "}" ]
// Serialize the serialized values stored on the Authenticator
[ "Serialize", "the", "serialized", "values", "stored", "on", "the", "Authenticator" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/mocks/auth.go#L49-L51
124,106
influxdata/influxdb
http/query_handler.go
NewFluxBackend
func NewFluxBackend(b *APIBackend) *FluxBackend { return &FluxBackend{ Logger: b.Logger.With(zap.String("handler", "query")), QueryEventRecorder: b.QueryEventRecorder, ProxyQueryService: b.FluxService, OrganizationService: b.OrganizationService, } }
go
func NewFluxBackend(b *APIBackend) *FluxBackend { return &FluxBackend{ Logger: b.Logger.With(zap.String("handler", "query")), QueryEventRecorder: b.QueryEventRecorder, ProxyQueryService: b.FluxService, OrganizationService: b.OrganizationService, } }
[ "func", "NewFluxBackend", "(", "b", "*", "APIBackend", ")", "*", "FluxBackend", "{", "return", "&", "FluxBackend", "{", "Logger", ":", "b", ".", "Logger", ".", "With", "(", "zap", ".", "String", "(", "\"", "\"", ",", "\"", "\"", ")", ")", ",", "Que...
// NewFluxBackend returns a new instance of FluxBackend.
[ "NewFluxBackend", "returns", "a", "new", "instance", "of", "FluxBackend", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/http/query_handler.go#L47-L55
124,107
influxdata/influxdb
http/query_handler.go
getFluxSuggestions
func (h *FluxHandler) getFluxSuggestions(w http.ResponseWriter, r *http.Request) { span, r := tracing.ExtractFromHTTPRequest(r, "FluxHandler") defer span.Finish() ctx := r.Context() completer := complete.DefaultCompleter() names := completer.FunctionNames() var functions []suggestionResponse for _, name := rang...
go
func (h *FluxHandler) getFluxSuggestions(w http.ResponseWriter, r *http.Request) { span, r := tracing.ExtractFromHTTPRequest(r, "FluxHandler") defer span.Finish() ctx := r.Context() completer := complete.DefaultCompleter() names := completer.FunctionNames() var functions []suggestionResponse for _, name := rang...
[ "func", "(", "h", "*", "FluxHandler", ")", "getFluxSuggestions", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "span", ",", "r", ":=", "tracing", ".", "ExtractFromHTTPRequest", "(", "r", ",", "\"", "\"", ")",...
// getFluxSuggestions returns a list of available Flux functions for the Flux Builder
[ "getFluxSuggestions", "returns", "a", "list", "of", "available", "Flux", "functions", "for", "the", "Flux", "Builder" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/http/query_handler.go#L240-L275
124,108
influxdata/influxdb
http/query_handler.go
SimpleQuery
func SimpleQuery(addr, flux, org, token string) ([]byte, error) { u, err := newURL(addr, fluxPath) if err != nil { return nil, err } params := url.Values{} params.Set(OrgName, org) u.RawQuery = params.Encode() header := true qr := &QueryRequest{ Type: "flux", Query: flux, Dialect: QueryDialect{ Hea...
go
func SimpleQuery(addr, flux, org, token string) ([]byte, error) { u, err := newURL(addr, fluxPath) if err != nil { return nil, err } params := url.Values{} params.Set(OrgName, org) u.RawQuery = params.Encode() header := true qr := &QueryRequest{ Type: "flux", Query: flux, Dialect: QueryDialect{ Hea...
[ "func", "SimpleQuery", "(", "addr", ",", "flux", ",", "org", ",", "token", "string", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "u", ",", "err", ":=", "newURL", "(", "addr", ",", "fluxPath", ")", "\n", "if", "err", "!=", "nil", "{", "r...
// SimpleQuery runs a flux query with common parameters and returns CSV results.
[ "SimpleQuery", "runs", "a", "flux", "query", "with", "common", "parameters", "and", "returns", "CSV", "results", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/http/query_handler.go#L438-L487
124,109
influxdata/influxdb
chronograf/server/queryconfig.go
ToQueryConfig
func ToQueryConfig(query string) chronograf.QueryConfig { qc, err := influx.Convert(query) if err == nil { return qc } return chronograf.QueryConfig{ RawText: &query, Fields: []chronograf.Field{}, GroupBy: chronograf.GroupBy{ Tags: []string{}, }, Tags: make(map[string][]string), } }
go
func ToQueryConfig(query string) chronograf.QueryConfig { qc, err := influx.Convert(query) if err == nil { return qc } return chronograf.QueryConfig{ RawText: &query, Fields: []chronograf.Field{}, GroupBy: chronograf.GroupBy{ Tags: []string{}, }, Tags: make(map[string][]string), } }
[ "func", "ToQueryConfig", "(", "query", "string", ")", "chronograf", ".", "QueryConfig", "{", "qc", ",", "err", ":=", "influx", ".", "Convert", "(", "query", ")", "\n", "if", "err", "==", "nil", "{", "return", "qc", "\n", "}", "\n", "return", "chronogra...
// ToQueryConfig converts InfluxQL into queryconfigs // If influxql cannot be represented by a full query config, then, the // query config's raw text is set to the query.
[ "ToQueryConfig", "converts", "InfluxQL", "into", "queryconfigs", "If", "influxql", "cannot", "be", "represented", "by", "a", "full", "query", "config", "then", "the", "query", "config", "s", "raw", "text", "is", "set", "to", "the", "query", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/queryconfig.go#L13-L26
124,110
influxdata/influxdb
chronograf/server/queryconfig.go
ValidateQueryConfig
func ValidateQueryConfig(q *chronograf.QueryConfig) error { for _, fld := range q.Fields { invalid := fmt.Errorf(`invalid field type "%s" ; expect func, field, integer, number, regex, wildcard`, fld.Type) if !validFieldTypes[fld.Type] { return invalid } for _, arg := range fld.Args { if !validFieldTypes[...
go
func ValidateQueryConfig(q *chronograf.QueryConfig) error { for _, fld := range q.Fields { invalid := fmt.Errorf(`invalid field type "%s" ; expect func, field, integer, number, regex, wildcard`, fld.Type) if !validFieldTypes[fld.Type] { return invalid } for _, arg := range fld.Args { if !validFieldTypes[...
[ "func", "ValidateQueryConfig", "(", "q", "*", "chronograf", ".", "QueryConfig", ")", "error", "{", "for", "_", ",", "fld", ":=", "range", "q", ".", "Fields", "{", "invalid", ":=", "fmt", ".", "Errorf", "(", "`invalid field type \"%s\" ; expect func, field, integ...
// ValidateQueryConfig checks any query config input
[ "ValidateQueryConfig", "checks", "any", "query", "config", "input" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/queryconfig.go#L38-L51
124,111
influxdata/influxdb
kit/check/response.go
HasCheck
func (r *Response) HasCheck(name string) bool { found := false for _, check := range r.Checks { if check.Name == name { found = true break } } return found }
go
func (r *Response) HasCheck(name string) bool { found := false for _, check := range r.Checks { if check.Name == name { found = true break } } return found }
[ "func", "(", "r", "*", "Response", ")", "HasCheck", "(", "name", "string", ")", "bool", "{", "found", ":=", "false", "\n", "for", "_", ",", "check", ":=", "range", "r", ".", "Checks", "{", "if", "check", ".", "Name", "==", "name", "{", "found", "...
// HasCheck verifies whether the receiving Response has a check with the given name or not.
[ "HasCheck", "verifies", "whether", "the", "receiving", "Response", "has", "a", "check", "with", "the", "given", "name", "or", "not", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/kit/check/response.go#L12-L21
124,112
influxdata/influxdb
kit/check/response.go
Less
func (r Responses) Less(i, j int) bool { if r[i].Status == r[j].Status { return r[i].Name < r[j].Name } return r[i].Status < r[j].Status }
go
func (r Responses) Less(i, j int) bool { if r[i].Status == r[j].Status { return r[i].Name < r[j].Name } return r[i].Status < r[j].Status }
[ "func", "(", "r", "Responses", ")", "Less", "(", "i", ",", "j", "int", ")", "bool", "{", "if", "r", "[", "i", "]", ".", "Status", "==", "r", "[", "j", "]", ".", "Status", "{", "return", "r", "[", "i", "]", ".", "Name", "<", "r", "[", "j",...
// Less defines the order in which responses are sorted. // // Failing responses are always sorted before passing responses. Responses with // the same status are then sorted according to the name of the check.
[ "Less", "defines", "the", "order", "in", "which", "responses", "are", "sorted", ".", "Failing", "responses", "are", "always", "sorted", "before", "passing", "responses", ".", "Responses", "with", "the", "same", "status", "are", "then", "sorted", "according", "...
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/kit/check/response.go#L32-L37
124,113
influxdata/influxdb
tsdb/series_partition.go
NewSeriesPartition
func NewSeriesPartition(id int, path string) *SeriesPartition { p := &SeriesPartition{ id: id, path: path, closing: make(chan struct{}), CompactThreshold: DefaultSeriesPartitionCompactThreshold, LargeWriteThreshold: DefaultLargeSeriesWriteThreshold, tracker: ...
go
func NewSeriesPartition(id int, path string) *SeriesPartition { p := &SeriesPartition{ id: id, path: path, closing: make(chan struct{}), CompactThreshold: DefaultSeriesPartitionCompactThreshold, LargeWriteThreshold: DefaultLargeSeriesWriteThreshold, tracker: ...
[ "func", "NewSeriesPartition", "(", "id", "int", ",", "path", "string", ")", "*", "SeriesPartition", "{", "p", ":=", "&", "SeriesPartition", "{", "id", ":", "id", ",", "path", ":", "path", ",", "closing", ":", "make", "(", "chan", "struct", "{", "}", ...
// NewSeriesPartition returns a new instance of SeriesPartition.
[ "NewSeriesPartition", "returns", "a", "new", "instance", "of", "SeriesPartition", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L57-L70
124,114
influxdata/influxdb
tsdb/series_partition.go
Open
func (p *SeriesPartition) Open() error { if p.closed { return errors.New("tsdb: cannot reopen series partition") } // Create path if it doesn't exist. if err := os.MkdirAll(filepath.Join(p.path), 0777); err != nil { return err } // Open components. if err := func() (err error) { if err := p.openSegments(...
go
func (p *SeriesPartition) Open() error { if p.closed { return errors.New("tsdb: cannot reopen series partition") } // Create path if it doesn't exist. if err := os.MkdirAll(filepath.Join(p.path), 0777); err != nil { return err } // Open components. if err := func() (err error) { if err := p.openSegments(...
[ "func", "(", "p", "*", "SeriesPartition", ")", "Open", "(", ")", "error", "{", "if", "p", ".", "closed", "{", "return", "errors", ".", "New", "(", "\"", "\"", ")", "\n", "}", "\n\n", "// Create path if it doesn't exist.", "if", "err", ":=", "os", ".", ...
// Open memory maps the data file at the partition's path.
[ "Open", "memory", "maps", "the", "data", "file", "at", "the", "partition", "s", "path", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L73-L107
124,115
influxdata/influxdb
tsdb/series_partition.go
Close
func (p *SeriesPartition) Close() (err error) { p.once.Do(func() { close(p.closing) }) p.wg.Wait() p.mu.Lock() defer p.mu.Unlock() p.closed = true for _, s := range p.segments { if e := s.Close(); e != nil && err == nil { err = e } } p.segments = nil if p.index != nil { if e := p.index.Close(); e ...
go
func (p *SeriesPartition) Close() (err error) { p.once.Do(func() { close(p.closing) }) p.wg.Wait() p.mu.Lock() defer p.mu.Unlock() p.closed = true for _, s := range p.segments { if e := s.Close(); e != nil && err == nil { err = e } } p.segments = nil if p.index != nil { if e := p.index.Close(); e ...
[ "func", "(", "p", "*", "SeriesPartition", ")", "Close", "(", ")", "(", "err", "error", ")", "{", "p", ".", "once", ".", "Do", "(", "func", "(", ")", "{", "close", "(", "p", ".", "closing", ")", "}", ")", "\n", "p", ".", "wg", ".", "Wait", "...
// Close unmaps the data files.
[ "Close", "unmaps", "the", "data", "files", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L151-L175
124,116
influxdata/influxdb
tsdb/series_partition.go
Compacting
func (p *SeriesPartition) Compacting() bool { p.mu.RLock() defer p.mu.RUnlock() return p.compacting }
go
func (p *SeriesPartition) Compacting() bool { p.mu.RLock() defer p.mu.RUnlock() return p.compacting }
[ "func", "(", "p", "*", "SeriesPartition", ")", "Compacting", "(", ")", "bool", "{", "p", ".", "mu", ".", "RLock", "(", ")", "\n", "defer", "p", ".", "mu", ".", "RUnlock", "(", ")", "\n", "return", "p", ".", "compacting", "\n", "}" ]
// Compacting returns if the SeriesPartition is currently compacting.
[ "Compacting", "returns", "if", "the", "SeriesPartition", "is", "currently", "compacting", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L344-L348
124,117
influxdata/influxdb
tsdb/series_partition.go
FindIDBySeriesKey
func (p *SeriesPartition) FindIDBySeriesKey(key []byte) SeriesID { return p.FindIDTypedBySeriesKey(key).SeriesID() }
go
func (p *SeriesPartition) FindIDBySeriesKey(key []byte) SeriesID { return p.FindIDTypedBySeriesKey(key).SeriesID() }
[ "func", "(", "p", "*", "SeriesPartition", ")", "FindIDBySeriesKey", "(", "key", "[", "]", "byte", ")", "SeriesID", "{", "return", "p", ".", "FindIDTypedBySeriesKey", "(", "key", ")", ".", "SeriesID", "(", ")", "\n", "}" ]
// FindIDBySeriesKey return the series id for the series key.
[ "FindIDBySeriesKey", "return", "the", "series", "id", "for", "the", "series", "key", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L421-L423
124,118
influxdata/influxdb
tsdb/series_partition.go
FindIDTypedBySeriesKey
func (p *SeriesPartition) FindIDTypedBySeriesKey(key []byte) SeriesIDTyped { p.mu.RLock() if p.closed { p.mu.RUnlock() return SeriesIDTyped{} } id := p.index.FindIDBySeriesKey(p.segments, key) p.mu.RUnlock() return id }
go
func (p *SeriesPartition) FindIDTypedBySeriesKey(key []byte) SeriesIDTyped { p.mu.RLock() if p.closed { p.mu.RUnlock() return SeriesIDTyped{} } id := p.index.FindIDBySeriesKey(p.segments, key) p.mu.RUnlock() return id }
[ "func", "(", "p", "*", "SeriesPartition", ")", "FindIDTypedBySeriesKey", "(", "key", "[", "]", "byte", ")", "SeriesIDTyped", "{", "p", ".", "mu", ".", "RLock", "(", ")", "\n", "if", "p", ".", "closed", "{", "p", ".", "mu", ".", "RUnlock", "(", ")",...
// FindIDTypedBySeriesKey return the typed series id for the series key.
[ "FindIDTypedBySeriesKey", "return", "the", "typed", "series", "id", "for", "the", "series", "key", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L426-L435
124,119
influxdata/influxdb
tsdb/series_partition.go
DiskSize
func (p *SeriesPartition) DiskSize() uint64 { p.mu.RLock() defer p.mu.RUnlock() return p.diskSize() }
go
func (p *SeriesPartition) DiskSize() uint64 { p.mu.RLock() defer p.mu.RUnlock() return p.diskSize() }
[ "func", "(", "p", "*", "SeriesPartition", ")", "DiskSize", "(", ")", "uint64", "{", "p", ".", "mu", ".", "RLock", "(", ")", "\n", "defer", "p", ".", "mu", ".", "RUnlock", "(", ")", "\n", "return", "p", ".", "diskSize", "(", ")", "\n", "}" ]
// DiskSize returns the number of bytes taken up on disk by the partition.
[ "DiskSize", "returns", "the", "number", "of", "bytes", "taken", "up", "on", "disk", "by", "the", "partition", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L450-L454
124,120
influxdata/influxdb
tsdb/series_partition.go
AppendSeriesIDs
func (p *SeriesPartition) AppendSeriesIDs(a []SeriesID) []SeriesID { for _, segment := range p.segments { a = segment.AppendSeriesIDs(a) } return a }
go
func (p *SeriesPartition) AppendSeriesIDs(a []SeriesID) []SeriesID { for _, segment := range p.segments { a = segment.AppendSeriesIDs(a) } return a }
[ "func", "(", "p", "*", "SeriesPartition", ")", "AppendSeriesIDs", "(", "a", "[", "]", "SeriesID", ")", "[", "]", "SeriesID", "{", "for", "_", ",", "segment", ":=", "range", "p", ".", "segments", "{", "a", "=", "segment", ".", "AppendSeriesIDs", "(", ...
// AppendSeriesIDs returns a list of all series ids.
[ "AppendSeriesIDs", "returns", "a", "list", "of", "all", "series", "ids", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L485-L490
124,121
influxdata/influxdb
tsdb/series_partition.go
activeSegment
func (p *SeriesPartition) activeSegment() *SeriesSegment { if len(p.segments) == 0 { return nil } return p.segments[len(p.segments)-1] }
go
func (p *SeriesPartition) activeSegment() *SeriesSegment { if len(p.segments) == 0 { return nil } return p.segments[len(p.segments)-1] }
[ "func", "(", "p", "*", "SeriesPartition", ")", "activeSegment", "(", ")", "*", "SeriesSegment", "{", "if", "len", "(", "p", ".", "segments", ")", "==", "0", "{", "return", "nil", "\n", "}", "\n", "return", "p", ".", "segments", "[", "len", "(", "p"...
// activeSegment returns the last segment.
[ "activeSegment", "returns", "the", "last", "segment", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L493-L498
124,122
influxdata/influxdb
tsdb/series_partition.go
writeLogEntry
func (p *SeriesPartition) writeLogEntry(data []byte) (offset int64, err error) { segment := p.activeSegment() if segment == nil || !segment.CanWrite(data) { if segment, err = p.createSegment(); err != nil { return 0, err } } return segment.WriteLogEntry(data) }
go
func (p *SeriesPartition) writeLogEntry(data []byte) (offset int64, err error) { segment := p.activeSegment() if segment == nil || !segment.CanWrite(data) { if segment, err = p.createSegment(); err != nil { return 0, err } } return segment.WriteLogEntry(data) }
[ "func", "(", "p", "*", "SeriesPartition", ")", "writeLogEntry", "(", "data", "[", "]", "byte", ")", "(", "offset", "int64", ",", "err", "error", ")", "{", "segment", ":=", "p", ".", "activeSegment", "(", ")", "\n", "if", "segment", "==", "nil", "||",...
// writeLogEntry appends an entry to the end of the active segment. // If there is no more room in the segment then a new segment is added.
[ "writeLogEntry", "appends", "an", "entry", "to", "the", "end", "of", "the", "active", "segment", ".", "If", "there", "is", "no", "more", "room", "in", "the", "segment", "then", "a", "new", "segment", "is", "added", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L513-L521
124,123
influxdata/influxdb
tsdb/series_partition.go
createSegment
func (p *SeriesPartition) createSegment() (*SeriesSegment, error) { // Close writer for active segment, if one exists. if segment := p.activeSegment(); segment != nil { if err := segment.CloseForWrite(); err != nil { return nil, err } } // Generate a new sequential segment identifier. var id uint16 if len...
go
func (p *SeriesPartition) createSegment() (*SeriesSegment, error) { // Close writer for active segment, if one exists. if segment := p.activeSegment(); segment != nil { if err := segment.CloseForWrite(); err != nil { return nil, err } } // Generate a new sequential segment identifier. var id uint16 if len...
[ "func", "(", "p", "*", "SeriesPartition", ")", "createSegment", "(", ")", "(", "*", "SeriesSegment", ",", "error", ")", "{", "// Close writer for active segment, if one exists.", "if", "segment", ":=", "p", ".", "activeSegment", "(", ")", ";", "segment", "!=", ...
// createSegment appends a new segment
[ "createSegment", "appends", "a", "new", "segment" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L524-L553
124,124
influxdata/influxdb
tsdb/series_partition.go
AddSeriesCreated
func (t *seriesPartitionTracker) AddSeriesCreated(n uint64) { if !t.enabled { return } labels := t.Labels() t.metrics.SeriesCreated.With(labels).Add(float64(n)) }
go
func (t *seriesPartitionTracker) AddSeriesCreated(n uint64) { if !t.enabled { return } labels := t.Labels() t.metrics.SeriesCreated.With(labels).Add(float64(n)) }
[ "func", "(", "t", "*", "seriesPartitionTracker", ")", "AddSeriesCreated", "(", "n", "uint64", ")", "{", "if", "!", "t", ".", "enabled", "{", "return", "\n", "}", "\n\n", "labels", ":=", "t", ".", "Labels", "(", ")", "\n", "t", ".", "metrics", ".", ...
// AddSeriesCreated increases the number of series created in the partition by n.
[ "AddSeriesCreated", "increases", "the", "number", "of", "series", "created", "in", "the", "partition", "by", "n", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L597-L604
124,125
influxdata/influxdb
tsdb/series_partition.go
SubSeries
func (t *seriesPartitionTracker) SubSeries(n uint64) { if !t.enabled { return } labels := t.Labels() t.metrics.Series.With(labels).Sub(float64(n)) }
go
func (t *seriesPartitionTracker) SubSeries(n uint64) { if !t.enabled { return } labels := t.Labels() t.metrics.Series.With(labels).Sub(float64(n)) }
[ "func", "(", "t", "*", "seriesPartitionTracker", ")", "SubSeries", "(", "n", "uint64", ")", "{", "if", "!", "t", ".", "enabled", "{", "return", "\n", "}", "\n\n", "labels", ":=", "t", ".", "Labels", "(", ")", "\n", "t", ".", "metrics", ".", "Series...
// SubSeries decreases the number of series in the partition by n.
[ "SubSeries", "decreases", "the", "number", "of", "series", "in", "the", "partition", "by", "n", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L627-L634
124,126
influxdata/influxdb
tsdb/series_partition.go
SetDiskSize
func (t *seriesPartitionTracker) SetDiskSize(sz uint64) { if !t.enabled { return } labels := t.Labels() t.metrics.DiskSize.With(labels).Set(float64(sz)) }
go
func (t *seriesPartitionTracker) SetDiskSize(sz uint64) { if !t.enabled { return } labels := t.Labels() t.metrics.DiskSize.With(labels).Set(float64(sz)) }
[ "func", "(", "t", "*", "seriesPartitionTracker", ")", "SetDiskSize", "(", "sz", "uint64", ")", "{", "if", "!", "t", ".", "enabled", "{", "return", "\n", "}", "\n\n", "labels", ":=", "t", ".", "Labels", "(", ")", "\n", "t", ".", "metrics", ".", "Dis...
// SetDiskSize sets the number of bytes used by files for in partition.
[ "SetDiskSize", "sets", "the", "number", "of", "bytes", "used", "by", "files", "for", "in", "partition", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L637-L644
124,127
influxdata/influxdb
tsdb/series_partition.go
SetSegments
func (t *seriesPartitionTracker) SetSegments(n uint64) { if !t.enabled { return } labels := t.Labels() t.metrics.Segments.With(labels).Set(float64(n)) }
go
func (t *seriesPartitionTracker) SetSegments(n uint64) { if !t.enabled { return } labels := t.Labels() t.metrics.Segments.With(labels).Set(float64(n)) }
[ "func", "(", "t", "*", "seriesPartitionTracker", ")", "SetSegments", "(", "n", "uint64", ")", "{", "if", "!", "t", ".", "enabled", "{", "return", "\n", "}", "\n\n", "labels", ":=", "t", ".", "Labels", "(", ")", "\n", "t", ".", "metrics", ".", "Segm...
// SetSegments sets the number of segments files for the partition.
[ "SetSegments", "sets", "the", "number", "of", "segments", "files", "for", "the", "partition", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L647-L654
124,128
influxdata/influxdb
tsdb/series_partition.go
incCompactions
func (t *seriesPartitionTracker) incCompactions(status string, duration time.Duration) { if !t.enabled { return } if duration > 0 { labels := t.Labels() labels["component"] = "index" t.metrics.CompactionDuration.With(labels).Observe(duration.Seconds()) } labels := t.Labels() labels["status"] = status t...
go
func (t *seriesPartitionTracker) incCompactions(status string, duration time.Duration) { if !t.enabled { return } if duration > 0 { labels := t.Labels() labels["component"] = "index" t.metrics.CompactionDuration.With(labels).Observe(duration.Seconds()) } labels := t.Labels() labels["status"] = status t...
[ "func", "(", "t", "*", "seriesPartitionTracker", ")", "incCompactions", "(", "status", "string", ",", "duration", "time", ".", "Duration", ")", "{", "if", "!", "t", ".", "enabled", "{", "return", "\n", "}", "\n\n", "if", "duration", ">", "0", "{", "lab...
// incCompactions increments the number of compactions for the partition. // Callers should use IncCompactionOK and IncCompactionErr.
[ "incCompactions", "increments", "the", "number", "of", "compactions", "for", "the", "partition", ".", "Callers", "should", "use", "IncCompactionOK", "and", "IncCompactionErr", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L682-L696
124,129
influxdata/influxdb
tsdb/series_partition.go
Compact
func (c *SeriesPartitionCompactor) Compact(p *SeriesPartition) (time.Duration, error) { // Snapshot the partitions and index so we can check tombstones and replay at the end under lock. p.mu.RLock() segments := CloneSeriesSegments(p.segments) index := p.index.Clone() seriesN := p.index.Count() p.mu.RUnlock() no...
go
func (c *SeriesPartitionCompactor) Compact(p *SeriesPartition) (time.Duration, error) { // Snapshot the partitions and index so we can check tombstones and replay at the end under lock. p.mu.RLock() segments := CloneSeriesSegments(p.segments) index := p.index.Clone() seriesN := p.index.Count() p.mu.RUnlock() no...
[ "func", "(", "c", "*", "SeriesPartitionCompactor", ")", "Compact", "(", "p", "*", "SeriesPartition", ")", "(", "time", ".", "Duration", ",", "error", ")", "{", "// Snapshot the partitions and index so we can check tombstones and replay at the end under lock.", "p", ".", ...
// Compact rebuilds the series partition index.
[ "Compact", "rebuilds", "the", "series", "partition", "index", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/series_partition.go#L717-L758
124,130
influxdata/influxdb
tsdb/tsm1/encoding.go
Encode
func (a Values) Encode(buf []byte) ([]byte, error) { if len(a) == 0 { panic("unable to encode block type") } switch a[0].(type) { case FloatValue: return encodeFloatBlock(buf, a) case IntegerValue: return encodeIntegerBlock(buf, a) case UnsignedValue: return encodeUnsignedBlock(buf, a) case BooleanValue...
go
func (a Values) Encode(buf []byte) ([]byte, error) { if len(a) == 0 { panic("unable to encode block type") } switch a[0].(type) { case FloatValue: return encodeFloatBlock(buf, a) case IntegerValue: return encodeIntegerBlock(buf, a) case UnsignedValue: return encodeUnsignedBlock(buf, a) case BooleanValue...
[ "func", "(", "a", "Values", ")", "Encode", "(", "buf", "[", "]", "byte", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "if", "len", "(", "a", ")", "==", "0", "{", "panic", "(", "\"", "\"", ")", "\n", "}", "\n\n", "switch", "a", "[", ...
// Encode converts the values to a byte slice. If there are no values, // this function panics.
[ "Encode", "converts", "the", "values", "to", "a", "byte", "slice", ".", "If", "there", "are", "no", "values", "this", "function", "panics", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/encoding.go#L96-L115
124,131
influxdata/influxdb
tsdb/tsm1/encoding.go
InfluxQLType
func (a Values) InfluxQLType() (influxql.DataType, error) { if len(a) == 0 { return influxql.Unknown, fmt.Errorf("no values to infer type") } switch a[0].(type) { case FloatValue: return influxql.Float, nil case IntegerValue: return influxql.Integer, nil case UnsignedValue: return influxql.Unsigned, nil ...
go
func (a Values) InfluxQLType() (influxql.DataType, error) { if len(a) == 0 { return influxql.Unknown, fmt.Errorf("no values to infer type") } switch a[0].(type) { case FloatValue: return influxql.Float, nil case IntegerValue: return influxql.Integer, nil case UnsignedValue: return influxql.Unsigned, nil ...
[ "func", "(", "a", "Values", ")", "InfluxQLType", "(", ")", "(", "influxql", ".", "DataType", ",", "error", ")", "{", "if", "len", "(", "a", ")", "==", "0", "{", "return", "influxql", ".", "Unknown", ",", "fmt", ".", "Errorf", "(", "\"", "\"", ")"...
// InfluxQLType returns the influxql.DataType the values map to.
[ "InfluxQLType", "returns", "the", "influxql", ".", "DataType", "the", "values", "map", "to", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/encoding.go#L141-L160
124,132
influxdata/influxdb
tsdb/tsm1/encoding.go
BlockType
func BlockType(block []byte) (byte, error) { blockType := block[0] switch blockType { case BlockFloat64, BlockInteger, BlockUnsigned, BlockBoolean, BlockString: return blockType, nil default: return 0, fmt.Errorf("unknown block type: %d", blockType) } }
go
func BlockType(block []byte) (byte, error) { blockType := block[0] switch blockType { case BlockFloat64, BlockInteger, BlockUnsigned, BlockBoolean, BlockString: return blockType, nil default: return 0, fmt.Errorf("unknown block type: %d", blockType) } }
[ "func", "BlockType", "(", "block", "[", "]", "byte", ")", "(", "byte", ",", "error", ")", "{", "blockType", ":=", "block", "[", "0", "]", "\n", "switch", "blockType", "{", "case", "BlockFloat64", ",", "BlockInteger", ",", "BlockUnsigned", ",", "BlockBool...
// BlockType returns the type of value encoded in a block or an error // if the block type is unknown.
[ "BlockType", "returns", "the", "type", "of", "value", "encoded", "in", "a", "block", "or", "an", "error", "if", "the", "block", "type", "is", "unknown", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/encoding.go#L164-L172
124,133
influxdata/influxdb
tsdb/tsm1/encoding.go
BlockCount
func BlockCount(block []byte) int { if len(block) <= encodedBlockHeaderSize { panic(fmt.Sprintf("count of short block: got %v, exp %v", len(block), encodedBlockHeaderSize)) } // first byte is the block type tb, _, err := unpackBlock(block[1:]) if err != nil { panic(fmt.Sprintf("BlockCount: error unpacking bloc...
go
func BlockCount(block []byte) int { if len(block) <= encodedBlockHeaderSize { panic(fmt.Sprintf("count of short block: got %v, exp %v", len(block), encodedBlockHeaderSize)) } // first byte is the block type tb, _, err := unpackBlock(block[1:]) if err != nil { panic(fmt.Sprintf("BlockCount: error unpacking bloc...
[ "func", "BlockCount", "(", "block", "[", "]", "byte", ")", "int", "{", "if", "len", "(", "block", ")", "<=", "encodedBlockHeaderSize", "{", "panic", "(", "fmt", ".", "Sprintf", "(", "\"", "\"", ",", "len", "(", "block", ")", ",", "encodedBlockHeaderSiz...
// BlockCount returns the number of timestamps encoded in block.
[ "BlockCount", "returns", "the", "number", "of", "timestamps", "encoded", "in", "block", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/encoding.go#L175-L185
124,134
influxdata/influxdb
tsdb/tsm1/encoding.go
DecodeBlock
func DecodeBlock(block []byte, vals []Value) ([]Value, error) { if len(block) <= encodedBlockHeaderSize { panic(fmt.Sprintf("decode of short block: got %v, exp %v", len(block), encodedBlockHeaderSize)) } blockType, err := BlockType(block) if err != nil { return nil, err } switch blockType { case BlockFloat...
go
func DecodeBlock(block []byte, vals []Value) ([]Value, error) { if len(block) <= encodedBlockHeaderSize { panic(fmt.Sprintf("decode of short block: got %v, exp %v", len(block), encodedBlockHeaderSize)) } blockType, err := BlockType(block) if err != nil { return nil, err } switch blockType { case BlockFloat...
[ "func", "DecodeBlock", "(", "block", "[", "]", "byte", ",", "vals", "[", "]", "Value", ")", "(", "[", "]", "Value", ",", "error", ")", "{", "if", "len", "(", "block", ")", "<=", "encodedBlockHeaderSize", "{", "panic", "(", "fmt", ".", "Sprintf", "(...
// DecodeBlock takes a byte slice and decodes it into values of the appropriate type // based on the block.
[ "DecodeBlock", "takes", "a", "byte", "slice", "and", "decodes", "it", "into", "values", "of", "the", "appropriate", "type", "based", "on", "the", "block", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/encoding.go#L189-L257
124,135
influxdata/influxdb
tsdb/tsm1/encoding.go
DecodeFloatBlock
func DecodeFloatBlock(block []byte, a *[]FloatValue) ([]FloatValue, error) { // Block type is the next block, make sure we actually have a float block blockType := block[0] if blockType != BlockFloat64 { return nil, fmt.Errorf("invalid block type: exp %d, got %d", BlockFloat64, blockType) } block = block[1:] t...
go
func DecodeFloatBlock(block []byte, a *[]FloatValue) ([]FloatValue, error) { // Block type is the next block, make sure we actually have a float block blockType := block[0] if blockType != BlockFloat64 { return nil, fmt.Errorf("invalid block type: exp %d, got %d", BlockFloat64, blockType) } block = block[1:] t...
[ "func", "DecodeFloatBlock", "(", "block", "[", "]", "byte", ",", "a", "*", "[", "]", "FloatValue", ")", "(", "[", "]", "FloatValue", ",", "error", ")", "{", "// Block type is the next block, make sure we actually have a float block", "blockType", ":=", "block", "[...
// DecodeFloatBlock decodes the float block from the byte slice // and appends the float values to a.
[ "DecodeFloatBlock", "decodes", "the", "float", "block", "from", "the", "byte", "slice", "and", "appends", "the", "float", "values", "to", "a", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/encoding.go#L311-L366
124,136
influxdata/influxdb
tsdb/tsm1/encoding.go
DecodeBooleanBlock
func DecodeBooleanBlock(block []byte, a *[]BooleanValue) ([]BooleanValue, error) { // Block type is the next block, make sure we actually have a float block blockType := block[0] if blockType != BlockBoolean { return nil, fmt.Errorf("invalid block type: exp %d, got %d", BlockBoolean, blockType) } block = block[1...
go
func DecodeBooleanBlock(block []byte, a *[]BooleanValue) ([]BooleanValue, error) { // Block type is the next block, make sure we actually have a float block blockType := block[0] if blockType != BlockBoolean { return nil, fmt.Errorf("invalid block type: exp %d, got %d", BlockBoolean, blockType) } block = block[1...
[ "func", "DecodeBooleanBlock", "(", "block", "[", "]", "byte", ",", "a", "*", "[", "]", "BooleanValue", ")", "(", "[", "]", "BooleanValue", ",", "error", ")", "{", "// Block type is the next block, make sure we actually have a float block", "blockType", ":=", "block"...
// DecodeBooleanBlock decodes the boolean block from the byte slice // and appends the boolean values to a.
[ "DecodeBooleanBlock", "decodes", "the", "boolean", "block", "from", "the", "byte", "slice", "and", "appends", "the", "boolean", "values", "to", "a", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/encoding.go#L416-L467
124,137
influxdata/influxdb
tsdb/tsm1/reader_range_iterator.go
HasData
func (b *TimeRangeIterator) HasData() bool { if b.Err() != nil { return false } e := excludeEntries(b.iter.Entries(), b.tr) if len(e) == 0 { return false } b.trbuf = b.r.TombstoneRange(b.iter.Key(), b.trbuf[:0]) var ts []TimeRange if len(b.trbuf) > 0 { ts = excludeTimeRanges(b.trbuf, b.tr) } if len(t...
go
func (b *TimeRangeIterator) HasData() bool { if b.Err() != nil { return false } e := excludeEntries(b.iter.Entries(), b.tr) if len(e) == 0 { return false } b.trbuf = b.r.TombstoneRange(b.iter.Key(), b.trbuf[:0]) var ts []TimeRange if len(b.trbuf) > 0 { ts = excludeTimeRanges(b.trbuf, b.tr) } if len(t...
[ "func", "(", "b", "*", "TimeRangeIterator", ")", "HasData", "(", ")", "bool", "{", "if", "b", ".", "Err", "(", ")", "!=", "nil", "{", "return", "false", "\n", "}", "\n\n", "e", ":=", "excludeEntries", "(", "b", ".", "iter", ".", "Entries", "(", "...
// HasData reports true if the current key has data for the time range.
[ "HasData", "reports", "true", "if", "the", "current", "key", "has", "data", "for", "the", "time", "range", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/reader_range_iterator.go#L57-L107
124,138
influxdata/influxdb
tsdb/tsm1/reader_range_iterator.go
readBlock
func (b *TimeRangeIterator) readBlock(e *IndexEntry) bool { _, b.buf, b.err = b.r.ReadBytes(e, b.buf) if b.err != nil { return false } b.err = DecodeTimestampArrayBlock(b.buf, &b.a) if b.err != nil { return false } b.stats.ScannedBytes += b.a.Len() * 8 // sizeof Timestamp (int64) b.stats.ScannedValues += ...
go
func (b *TimeRangeIterator) readBlock(e *IndexEntry) bool { _, b.buf, b.err = b.r.ReadBytes(e, b.buf) if b.err != nil { return false } b.err = DecodeTimestampArrayBlock(b.buf, &b.a) if b.err != nil { return false } b.stats.ScannedBytes += b.a.Len() * 8 // sizeof Timestamp (int64) b.stats.ScannedValues += ...
[ "func", "(", "b", "*", "TimeRangeIterator", ")", "readBlock", "(", "e", "*", "IndexEntry", ")", "bool", "{", "_", ",", "b", ".", "buf", ",", "b", ".", "err", "=", "b", ".", "r", ".", "ReadBytes", "(", "e", ",", "b", ".", "buf", ")", "\n", "if...
// readBlock reads the block identified by IndexEntry e and accumulates // statistics. readBlock returns true on success.
[ "readBlock", "reads", "the", "block", "identified", "by", "IndexEntry", "e", "and", "accumulates", "statistics", ".", "readBlock", "returns", "true", "on", "success", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/reader_range_iterator.go#L111-L125
124,139
influxdata/influxdb
tsdb/tsm1/reader_range_iterator.go
excludeEntries
func excludeEntries(e []IndexEntry, tr TimeRange) []IndexEntry { for i := range e { if e[i].OverlapsTimeRange(tr.Min, tr.Max) { e = e[i:] break } } for i := range e { if !e[i].OverlapsTimeRange(tr.Min, tr.Max) { e = e[:i] break } } return e }
go
func excludeEntries(e []IndexEntry, tr TimeRange) []IndexEntry { for i := range e { if e[i].OverlapsTimeRange(tr.Min, tr.Max) { e = e[i:] break } } for i := range e { if !e[i].OverlapsTimeRange(tr.Min, tr.Max) { e = e[:i] break } } return e }
[ "func", "excludeEntries", "(", "e", "[", "]", "IndexEntry", ",", "tr", "TimeRange", ")", "[", "]", "IndexEntry", "{", "for", "i", ":=", "range", "e", "{", "if", "e", "[", "i", "]", ".", "OverlapsTimeRange", "(", "tr", ".", "Min", ",", "tr", ".", ...
// excludeEntries returns a slice which excludes leading and trailing // elements of e that are outside the time range specified by tr.
[ "excludeEntries", "returns", "a", "slice", "which", "excludes", "leading", "and", "trailing", "elements", "of", "e", "that", "are", "outside", "the", "time", "range", "specified", "by", "tr", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/reader_range_iterator.go#L163-L179
124,140
influxdata/influxdb
tsdb/tsm1/reader_range_iterator.go
excludeTimeRanges
func excludeTimeRanges(e []TimeRange, tr TimeRange) []TimeRange { for i := range e { if e[i].Overlaps(tr.Min, tr.Max) { e = e[i:] break } } for i := range e { if !e[i].Overlaps(tr.Min, tr.Max) { e = e[:i] break } } return e }
go
func excludeTimeRanges(e []TimeRange, tr TimeRange) []TimeRange { for i := range e { if e[i].Overlaps(tr.Min, tr.Max) { e = e[i:] break } } for i := range e { if !e[i].Overlaps(tr.Min, tr.Max) { e = e[:i] break } } return e }
[ "func", "excludeTimeRanges", "(", "e", "[", "]", "TimeRange", ",", "tr", "TimeRange", ")", "[", "]", "TimeRange", "{", "for", "i", ":=", "range", "e", "{", "if", "e", "[", "i", "]", ".", "Overlaps", "(", "tr", ".", "Min", ",", "tr", ".", "Max", ...
// excludeTimeRanges returns a slice which excludes leading and trailing // elements of e that are outside the time range specified by tr.
[ "excludeTimeRanges", "returns", "a", "slice", "which", "excludes", "leading", "and", "trailing", "elements", "of", "e", "that", "are", "outside", "the", "time", "range", "specified", "by", "tr", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/reader_range_iterator.go#L183-L199
124,141
influxdata/influxdb
http/errors.go
CheckError
func CheckError(resp *http.Response) (err error) { switch resp.StatusCode / 100 { case 4, 5: // We will attempt to parse this error outside of this block. case 2: return nil default: // TODO(jsternberg): Figure out what to do here? return &platform.Error{ Code: platform.EInternal, Msg: fmt.Sprintf("u...
go
func CheckError(resp *http.Response) (err error) { switch resp.StatusCode / 100 { case 4, 5: // We will attempt to parse this error outside of this block. case 2: return nil default: // TODO(jsternberg): Figure out what to do here? return &platform.Error{ Code: platform.EInternal, Msg: fmt.Sprintf("u...
[ "func", "CheckError", "(", "resp", "*", "http", ".", "Response", ")", "(", "err", "error", ")", "{", "switch", "resp", ".", "StatusCode", "/", "100", "{", "case", "4", ",", "5", ":", "// We will attempt to parse this error outside of this block.", "case", "2",...
// CheckError reads the http.Response and returns an error if one exists. // It will automatically recognize the errors returned by Influx services // and decode the error into an internal error type. If the error cannot // be determined in that way, it will create a generic error message. // // If there is no error, t...
[ "CheckError", "reads", "the", "http", ".", "Response", "and", "returns", "an", "error", "if", "one", "exists", ".", "It", "will", "automatically", "recognize", "the", "errors", "returned", "by", "Influx", "services", "and", "decode", "the", "error", "into", ...
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/http/errors.go#L46-L65
124,142
influxdata/influxdb
http/errors.go
UnauthorizedError
func UnauthorizedError(ctx context.Context, w http.ResponseWriter) { EncodeError(ctx, &platform.Error{ Code: platform.EUnauthorized, Msg: "unauthorized access", }, w) }
go
func UnauthorizedError(ctx context.Context, w http.ResponseWriter) { EncodeError(ctx, &platform.Error{ Code: platform.EUnauthorized, Msg: "unauthorized access", }, w) }
[ "func", "UnauthorizedError", "(", "ctx", "context", ".", "Context", ",", "w", "http", ".", "ResponseWriter", ")", "{", "EncodeError", "(", "ctx", ",", "&", "platform", ".", "Error", "{", "Code", ":", "platform", ".", "EUnauthorized", ",", "Msg", ":", "\"...
// UnauthorizedError encodes a error message and status code for unauthorized access.
[ "UnauthorizedError", "encodes", "a", "error", "message", "and", "status", "code", "for", "unauthorized", "access", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/http/errors.go#L103-L108
124,143
influxdata/influxdb
chronograf/server/organizations.go
Organizations
func (s *Service) Organizations(w http.ResponseWriter, r *http.Request) { ctx := r.Context() orgs, err := s.Store.Organizations(ctx).All(ctx) if err != nil { Error(w, http.StatusBadRequest, err.Error(), s.Logger) return } res := newOrganizationsResponse(orgs) encodeJSON(w, http.StatusOK, res, s.Logger) }
go
func (s *Service) Organizations(w http.ResponseWriter, r *http.Request) { ctx := r.Context() orgs, err := s.Store.Organizations(ctx).All(ctx) if err != nil { Error(w, http.StatusBadRequest, err.Error(), s.Logger) return } res := newOrganizationsResponse(orgs) encodeJSON(w, http.StatusOK, res, s.Logger) }
[ "func", "(", "s", "*", "Service", ")", "Organizations", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "ctx", ":=", "r", ".", "Context", "(", ")", "\n\n", "orgs", ",", "err", ":=", "s", ".", "Store", "."...
// Organizations retrieves all organizations from store
[ "Organizations", "retrieves", "all", "organizations", "from", "store" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/organizations.go#L89-L100
124,144
influxdata/influxdb
chronograf/server/organizations.go
NewOrganization
func (s *Service) NewOrganization(w http.ResponseWriter, r *http.Request) { var req organizationRequest if err := json.NewDecoder(r.Body).Decode(&req); err != nil { invalidJSON(w, s.Logger) return } if err := req.ValidCreate(); err != nil { invalidData(w, err, s.Logger) return } ctx := r.Context() org ...
go
func (s *Service) NewOrganization(w http.ResponseWriter, r *http.Request) { var req organizationRequest if err := json.NewDecoder(r.Body).Decode(&req); err != nil { invalidJSON(w, s.Logger) return } if err := req.ValidCreate(); err != nil { invalidData(w, err, s.Logger) return } ctx := r.Context() org ...
[ "func", "(", "s", "*", "Service", ")", "NewOrganization", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "var", "req", "organizationRequest", "\n", "if", "err", ":=", "json", ".", "NewDecoder", "(", "r", ".", ...
// NewOrganization adds a new organization to store
[ "NewOrganization", "adds", "a", "new", "organization", "to", "store" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/organizations.go#L103-L157
124,145
influxdata/influxdb
chronograf/server/organizations.go
OrganizationID
func (s *Service) OrganizationID(w http.ResponseWriter, r *http.Request) { ctx := r.Context() id := httprouter.GetParamFromContext(ctx, "oid") org, err := s.Store.Organizations(ctx).Get(ctx, chronograf.OrganizationQuery{ID: &id}) if err != nil { Error(w, http.StatusBadRequest, err.Error(), s.Logger) return }...
go
func (s *Service) OrganizationID(w http.ResponseWriter, r *http.Request) { ctx := r.Context() id := httprouter.GetParamFromContext(ctx, "oid") org, err := s.Store.Organizations(ctx).Get(ctx, chronograf.OrganizationQuery{ID: &id}) if err != nil { Error(w, http.StatusBadRequest, err.Error(), s.Logger) return }...
[ "func", "(", "s", "*", "Service", ")", "OrganizationID", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "ctx", ":=", "r", ".", "Context", "(", ")", "\n\n", "id", ":=", "httprouter", ".", "GetParamFromContext",...
// OrganizationID retrieves a organization with ID from store
[ "OrganizationID", "retrieves", "a", "organization", "with", "ID", "from", "store" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/organizations.go#L160-L173
124,146
influxdata/influxdb
chronograf/server/organizations.go
UpdateOrganization
func (s *Service) UpdateOrganization(w http.ResponseWriter, r *http.Request) { var req organizationRequest if err := json.NewDecoder(r.Body).Decode(&req); err != nil { invalidJSON(w, s.Logger) return } if err := req.ValidUpdate(); err != nil { invalidData(w, err, s.Logger) return } ctx := r.Context() i...
go
func (s *Service) UpdateOrganization(w http.ResponseWriter, r *http.Request) { var req organizationRequest if err := json.NewDecoder(r.Body).Decode(&req); err != nil { invalidJSON(w, s.Logger) return } if err := req.ValidUpdate(); err != nil { invalidData(w, err, s.Logger) return } ctx := r.Context() i...
[ "func", "(", "s", "*", "Service", ")", "UpdateOrganization", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "var", "req", "organizationRequest", "\n", "if", "err", ":=", "json", ".", "NewDecoder", "(", "r", "....
// UpdateOrganization updates an organization in the organizations store
[ "UpdateOrganization", "updates", "an", "organization", "in", "the", "organizations", "store" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/organizations.go#L176-L215
124,147
influxdata/influxdb
chronograf/server/organizations.go
RemoveOrganization
func (s *Service) RemoveOrganization(w http.ResponseWriter, r *http.Request) { ctx := r.Context() id := httprouter.GetParamFromContext(ctx, "oid") org, err := s.Store.Organizations(ctx).Get(ctx, chronograf.OrganizationQuery{ID: &id}) if err != nil { Error(w, http.StatusNotFound, err.Error(), s.Logger) return ...
go
func (s *Service) RemoveOrganization(w http.ResponseWriter, r *http.Request) { ctx := r.Context() id := httprouter.GetParamFromContext(ctx, "oid") org, err := s.Store.Organizations(ctx).Get(ctx, chronograf.OrganizationQuery{ID: &id}) if err != nil { Error(w, http.StatusNotFound, err.Error(), s.Logger) return ...
[ "func", "(", "s", "*", "Service", ")", "RemoveOrganization", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "ctx", ":=", "r", ".", "Context", "(", ")", "\n", "id", ":=", "httprouter", ".", "GetParamFromContext...
// RemoveOrganization removes an organization in the organizations store
[ "RemoveOrganization", "removes", "an", "organization", "in", "the", "organizations", "store" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/organizations.go#L218-L232
124,148
influxdata/influxdb
chronograf/filestore/dashboards.go
NewDashboards
func NewDashboards(dir string, ids chronograf.ID, logger chronograf.Logger) chronograf.DashboardsStore { return &Dashboards{ Dir: dir, Load: load, Create: create, ReadDir: ioutil.ReadDir, Remove: os.Remove, IDs: ids, Logger: logger, } }
go
func NewDashboards(dir string, ids chronograf.ID, logger chronograf.Logger) chronograf.DashboardsStore { return &Dashboards{ Dir: dir, Load: load, Create: create, ReadDir: ioutil.ReadDir, Remove: os.Remove, IDs: ids, Logger: logger, } }
[ "func", "NewDashboards", "(", "dir", "string", ",", "ids", "chronograf", ".", "ID", ",", "logger", "chronograf", ".", "Logger", ")", "chronograf", ".", "DashboardsStore", "{", "return", "&", "Dashboards", "{", "Dir", ":", "dir", ",", "Load", ":", "load", ...
// NewDashboards constructs a dashboard store wrapping a file system directory
[ "NewDashboards", "constructs", "a", "dashboard", "store", "wrapping", "a", "file", "system", "directory" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/filestore/dashboards.go#L32-L42
124,149
influxdata/influxdb
chronograf/filestore/dashboards.go
All
func (d *Dashboards) All(ctx context.Context) ([]chronograf.Dashboard, error) { files, err := d.ReadDir(d.Dir) if err != nil { return nil, err } dashboards := []chronograf.Dashboard{} for _, file := range files { if path.Ext(file.Name()) != DashExt { continue } var dashboard chronograf.Dashboard if e...
go
func (d *Dashboards) All(ctx context.Context) ([]chronograf.Dashboard, error) { files, err := d.ReadDir(d.Dir) if err != nil { return nil, err } dashboards := []chronograf.Dashboard{} for _, file := range files { if path.Ext(file.Name()) != DashExt { continue } var dashboard chronograf.Dashboard if e...
[ "func", "(", "d", "*", "Dashboards", ")", "All", "(", "ctx", "context", ".", "Context", ")", "(", "[", "]", "chronograf", ".", "Dashboard", ",", "error", ")", "{", "files", ",", "err", ":=", "d", ".", "ReadDir", "(", "d", ".", "Dir", ")", "\n", ...
// All returns all dashboards from the directory
[ "All", "returns", "all", "dashboards", "from", "the", "directory" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/filestore/dashboards.go#L75-L94
124,150
influxdata/influxdb
chronograf/filestore/dashboards.go
Add
func (d *Dashboards) Add(ctx context.Context, dashboard chronograf.Dashboard) (chronograf.Dashboard, error) { genID, err := d.IDs.Generate() if err != nil { d.Logger. WithField("component", "dashboard"). Error("Unable to generate ID") return chronograf.Dashboard{}, err } id, err := strconv.Atoi(genID) i...
go
func (d *Dashboards) Add(ctx context.Context, dashboard chronograf.Dashboard) (chronograf.Dashboard, error) { genID, err := d.IDs.Generate() if err != nil { d.Logger. WithField("component", "dashboard"). Error("Unable to generate ID") return chronograf.Dashboard{}, err } id, err := strconv.Atoi(genID) i...
[ "func", "(", "d", "*", "Dashboards", ")", "Add", "(", "ctx", "context", ".", "Context", ",", "dashboard", "chronograf", ".", "Dashboard", ")", "(", "chronograf", ".", "Dashboard", ",", "error", ")", "{", "genID", ",", "err", ":=", "d", ".", "IDs", "....
// Add creates a new dashboard within the directory
[ "Add", "creates", "a", "new", "dashboard", "within", "the", "directory" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/filestore/dashboards.go#L97-L132
124,151
influxdata/influxdb
chronograf/filestore/dashboards.go
Delete
func (d *Dashboards) Delete(ctx context.Context, dashboard chronograf.Dashboard) error { _, file, err := d.idToFile(dashboard.ID) if err != nil { return err } if err := d.Remove(file); err != nil { d.Logger. WithField("component", "dashboard"). WithField("name", file). Error("Unable to remove dashboar...
go
func (d *Dashboards) Delete(ctx context.Context, dashboard chronograf.Dashboard) error { _, file, err := d.idToFile(dashboard.ID) if err != nil { return err } if err := d.Remove(file); err != nil { d.Logger. WithField("component", "dashboard"). WithField("name", file). Error("Unable to remove dashboar...
[ "func", "(", "d", "*", "Dashboards", ")", "Delete", "(", "ctx", "context", ".", "Context", ",", "dashboard", "chronograf", ".", "Dashboard", ")", "error", "{", "_", ",", "file", ",", "err", ":=", "d", ".", "idToFile", "(", "dashboard", ".", "ID", ")"...
// Delete removes a dashboard file from the directory
[ "Delete", "removes", "a", "dashboard", "file", "from", "the", "directory" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/filestore/dashboards.go#L135-L149
124,152
influxdata/influxdb
chronograf/filestore/dashboards.go
Get
func (d *Dashboards) Get(ctx context.Context, id chronograf.DashboardID) (chronograf.Dashboard, error) { board, file, err := d.idToFile(id) if err != nil { if err == chronograf.ErrDashboardNotFound { d.Logger. WithField("component", "dashboard"). WithField("name", file). Error("Unable to read file") ...
go
func (d *Dashboards) Get(ctx context.Context, id chronograf.DashboardID) (chronograf.Dashboard, error) { board, file, err := d.idToFile(id) if err != nil { if err == chronograf.ErrDashboardNotFound { d.Logger. WithField("component", "dashboard"). WithField("name", file). Error("Unable to read file") ...
[ "func", "(", "d", "*", "Dashboards", ")", "Get", "(", "ctx", "context", ".", "Context", ",", "id", "chronograf", ".", "DashboardID", ")", "(", "chronograf", ".", "Dashboard", ",", "error", ")", "{", "board", ",", "file", ",", "err", ":=", "d", ".", ...
// Get returns a dashboard file from the dashboard directory
[ "Get", "returns", "a", "dashboard", "file", "from", "the", "dashboard", "directory" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/filestore/dashboards.go#L152-L169
124,153
influxdata/influxdb
chronograf/filestore/dashboards.go
Update
func (d *Dashboards) Update(ctx context.Context, dashboard chronograf.Dashboard) error { board, _, err := d.idToFile(dashboard.ID) if err != nil { return err } if err := d.Delete(ctx, board); err != nil { return err } file := dashboardFile(d.Dir, dashboard) return d.Create(file, dashboard) }
go
func (d *Dashboards) Update(ctx context.Context, dashboard chronograf.Dashboard) error { board, _, err := d.idToFile(dashboard.ID) if err != nil { return err } if err := d.Delete(ctx, board); err != nil { return err } file := dashboardFile(d.Dir, dashboard) return d.Create(file, dashboard) }
[ "func", "(", "d", "*", "Dashboards", ")", "Update", "(", "ctx", "context", ".", "Context", ",", "dashboard", "chronograf", ".", "Dashboard", ")", "error", "{", "board", ",", "_", ",", "err", ":=", "d", ".", "idToFile", "(", "dashboard", ".", "ID", ")...
// Update replaces a dashboard from the file system directory
[ "Update", "replaces", "a", "dashboard", "from", "the", "file", "system", "directory" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/filestore/dashboards.go#L172-L183
124,154
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalBuild
func UnmarshalBuild(data []byte, b *chronograf.BuildInfo) error { var pb BuildInfo if err := proto.Unmarshal(data, &pb); err != nil { return err } b.Version = pb.Version b.Commit = pb.Commit return nil }
go
func UnmarshalBuild(data []byte, b *chronograf.BuildInfo) error { var pb BuildInfo if err := proto.Unmarshal(data, &pb); err != nil { return err } b.Version = pb.Version b.Commit = pb.Commit return nil }
[ "func", "UnmarshalBuild", "(", "data", "[", "]", "byte", ",", "b", "*", "chronograf", ".", "BuildInfo", ")", "error", "{", "var", "pb", "BuildInfo", "\n", "if", "err", ":=", "proto", ".", "Unmarshal", "(", "data", ",", "&", "pb", ")", ";", "err", "...
// UnmarshalBuild decodes a build from binary protobuf data.
[ "UnmarshalBuild", "decodes", "a", "build", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L22-L31
124,155
influxdata/influxdb
chronograf/bolt/internal/internal.go
MarshalSource
func MarshalSource(s chronograf.Source) ([]byte, error) { return proto.Marshal(&Source{ ID: int64(s.ID), Name: s.Name, Type: s.Type, Username: s.Username, Password: s.Password, SharedSecret: s.SharedSecret, URL: s.URL, ...
go
func MarshalSource(s chronograf.Source) ([]byte, error) { return proto.Marshal(&Source{ ID: int64(s.ID), Name: s.Name, Type: s.Type, Username: s.Username, Password: s.Password, SharedSecret: s.SharedSecret, URL: s.URL, ...
[ "func", "MarshalSource", "(", "s", "chronograf", ".", "Source", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "return", "proto", ".", "Marshal", "(", "&", "Source", "{", "ID", ":", "int64", "(", "s", ".", "ID", ")", ",", "Name", ":", "s", ...
// MarshalSource encodes a source to binary protobuf format.
[ "MarshalSource", "encodes", "a", "source", "to", "binary", "protobuf", "format", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L34-L51
124,156
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalSource
func UnmarshalSource(data []byte, s *chronograf.Source) error { var pb Source if err := proto.Unmarshal(data, &pb); err != nil { return err } s.ID = int(pb.ID) s.Name = pb.Name s.Type = pb.Type s.Username = pb.Username s.Password = pb.Password s.SharedSecret = pb.SharedSecret s.URL = pb.URL s.MetaURL = pb...
go
func UnmarshalSource(data []byte, s *chronograf.Source) error { var pb Source if err := proto.Unmarshal(data, &pb); err != nil { return err } s.ID = int(pb.ID) s.Name = pb.Name s.Type = pb.Type s.Username = pb.Username s.Password = pb.Password s.SharedSecret = pb.SharedSecret s.URL = pb.URL s.MetaURL = pb...
[ "func", "UnmarshalSource", "(", "data", "[", "]", "byte", ",", "s", "*", "chronograf", ".", "Source", ")", "error", "{", "var", "pb", "Source", "\n", "if", "err", ":=", "proto", ".", "Unmarshal", "(", "data", ",", "&", "pb", ")", ";", "err", "!=", ...
// UnmarshalSource decodes a source from binary protobuf data.
[ "UnmarshalSource", "decodes", "a", "source", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L54-L75
124,157
influxdata/influxdb
chronograf/bolt/internal/internal.go
MarshalServer
func MarshalServer(s chronograf.Server) ([]byte, error) { var ( metadata []byte err error ) metadata, err = json.Marshal(s.Metadata) if err != nil { return nil, err } return proto.Marshal(&Server{ ID: int64(s.ID), SrcID: int64(s.SrcID), Name: s.Name, U...
go
func MarshalServer(s chronograf.Server) ([]byte, error) { var ( metadata []byte err error ) metadata, err = json.Marshal(s.Metadata) if err != nil { return nil, err } return proto.Marshal(&Server{ ID: int64(s.ID), SrcID: int64(s.SrcID), Name: s.Name, U...
[ "func", "MarshalServer", "(", "s", "chronograf", ".", "Server", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "var", "(", "metadata", "[", "]", "byte", "\n", "err", "error", "\n", ")", "\n", "metadata", ",", "err", "=", "json", ".", "Marshal"...
// MarshalServer encodes a server to binary protobuf format.
[ "MarshalServer", "encodes", "a", "server", "to", "binary", "protobuf", "format", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L78-L100
124,158
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalServer
func UnmarshalServer(data []byte, s *chronograf.Server) error { var pb Server if err := proto.Unmarshal(data, &pb); err != nil { return err } s.Metadata = make(map[string]interface{}) if len(pb.MetadataJSON) > 0 { if err := json.Unmarshal([]byte(pb.MetadataJSON), &s.Metadata); err != nil { return err } ...
go
func UnmarshalServer(data []byte, s *chronograf.Server) error { var pb Server if err := proto.Unmarshal(data, &pb); err != nil { return err } s.Metadata = make(map[string]interface{}) if len(pb.MetadataJSON) > 0 { if err := json.Unmarshal([]byte(pb.MetadataJSON), &s.Metadata); err != nil { return err } ...
[ "func", "UnmarshalServer", "(", "data", "[", "]", "byte", ",", "s", "*", "chronograf", ".", "Server", ")", "error", "{", "var", "pb", "Server", "\n", "if", "err", ":=", "proto", ".", "Unmarshal", "(", "data", ",", "&", "pb", ")", ";", "err", "!=", ...
// UnmarshalServer decodes a server from binary protobuf data.
[ "UnmarshalServer", "decodes", "a", "server", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L103-L127
124,159
influxdata/influxdb
chronograf/bolt/internal/internal.go
MarshalLayout
func MarshalLayout(l chronograf.Layout) ([]byte, error) { cells := make([]*Cell, len(l.Cells)) for i, c := range l.Cells { queries := make([]*Query, len(c.Queries)) for j, q := range c.Queries { r := new(Range) if q.Range != nil { r.Upper, r.Lower = q.Range.Upper, q.Range.Lower } queries[j] = &Que...
go
func MarshalLayout(l chronograf.Layout) ([]byte, error) { cells := make([]*Cell, len(l.Cells)) for i, c := range l.Cells { queries := make([]*Query, len(c.Queries)) for j, q := range c.Queries { r := new(Range) if q.Range != nil { r.Upper, r.Lower = q.Range.Upper, q.Range.Lower } queries[j] = &Que...
[ "func", "MarshalLayout", "(", "l", "chronograf", ".", "Layout", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "cells", ":=", "make", "(", "[", "]", "*", "Cell", ",", "len", "(", "l", ".", "Cells", ")", ")", "\n", "for", "i", ",", "c", "...
// MarshalLayout encodes a layout to binary protobuf format.
[ "MarshalLayout", "encodes", "a", "layout", "to", "binary", "protobuf", "format", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L130-L177
124,160
influxdata/influxdb
chronograf/bolt/internal/internal.go
MarshalAlertRule
func MarshalAlertRule(r *ScopedAlert) ([]byte, error) { j, err := json.Marshal(r.AlertRule) if err != nil { return nil, err } return proto.Marshal(&AlertRule{ ID: r.ID, SrcID: int64(r.SrcID), KapaID: int64(r.KapaID), JSON: string(j), }) }
go
func MarshalAlertRule(r *ScopedAlert) ([]byte, error) { j, err := json.Marshal(r.AlertRule) if err != nil { return nil, err } return proto.Marshal(&AlertRule{ ID: r.ID, SrcID: int64(r.SrcID), KapaID: int64(r.KapaID), JSON: string(j), }) }
[ "func", "MarshalAlertRule", "(", "r", "*", "ScopedAlert", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "j", ",", "err", ":=", "json", ".", "Marshal", "(", "r", ".", "AlertRule", ")", "\n", "if", "err", "!=", "nil", "{", "return", "nil", ",...
// MarshalAlertRule encodes an alert rule to binary protobuf format.
[ "MarshalAlertRule", "encodes", "an", "alert", "rule", "to", "binary", "protobuf", "format", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L569-L580
124,161
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalAlertRule
func UnmarshalAlertRule(data []byte, r *ScopedAlert) error { var pb AlertRule if err := proto.Unmarshal(data, &pb); err != nil { return err } err := json.Unmarshal([]byte(pb.JSON), &r.AlertRule) if err != nil { return err } r.SrcID = int(pb.SrcID) r.KapaID = int(pb.KapaID) return nil }
go
func UnmarshalAlertRule(data []byte, r *ScopedAlert) error { var pb AlertRule if err := proto.Unmarshal(data, &pb); err != nil { return err } err := json.Unmarshal([]byte(pb.JSON), &r.AlertRule) if err != nil { return err } r.SrcID = int(pb.SrcID) r.KapaID = int(pb.KapaID) return nil }
[ "func", "UnmarshalAlertRule", "(", "data", "[", "]", "byte", ",", "r", "*", "ScopedAlert", ")", "error", "{", "var", "pb", "AlertRule", "\n", "if", "err", ":=", "proto", ".", "Unmarshal", "(", "data", ",", "&", "pb", ")", ";", "err", "!=", "nil", "...
// UnmarshalAlertRule decodes an alert rule from binary protobuf data.
[ "UnmarshalAlertRule", "decodes", "an", "alert", "rule", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L583-L596
124,162
influxdata/influxdb
chronograf/bolt/internal/internal.go
MarshalUser
func MarshalUser(u *chronograf.User) ([]byte, error) { roles := make([]*Role, len(u.Roles)) for i, role := range u.Roles { roles[i] = &Role{ Organization: role.Organization, Name: role.Name, } } return MarshalUserPB(&User{ ID: u.ID, Name: u.Name, Provider: u.Provider, Schem...
go
func MarshalUser(u *chronograf.User) ([]byte, error) { roles := make([]*Role, len(u.Roles)) for i, role := range u.Roles { roles[i] = &Role{ Organization: role.Organization, Name: role.Name, } } return MarshalUserPB(&User{ ID: u.ID, Name: u.Name, Provider: u.Provider, Schem...
[ "func", "MarshalUser", "(", "u", "*", "chronograf", ".", "User", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "roles", ":=", "make", "(", "[", "]", "*", "Role", ",", "len", "(", "u", ".", "Roles", ")", ")", "\n", "for", "i", ",", "role...
// MarshalUser encodes a user to binary protobuf format. // We are ignoring the password for now.
[ "MarshalUser", "encodes", "a", "user", "to", "binary", "protobuf", "format", ".", "We", "are", "ignoring", "the", "password", "for", "now", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L600-L616
124,163
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalUser
func UnmarshalUser(data []byte, u *chronograf.User) error { var pb User if err := UnmarshalUserPB(data, &pb); err != nil { return err } roles := make([]chronograf.Role, len(pb.Roles)) for i, role := range pb.Roles { roles[i] = chronograf.Role{ Organization: role.Organization, Name: role.Name, }...
go
func UnmarshalUser(data []byte, u *chronograf.User) error { var pb User if err := UnmarshalUserPB(data, &pb); err != nil { return err } roles := make([]chronograf.Role, len(pb.Roles)) for i, role := range pb.Roles { roles[i] = chronograf.Role{ Organization: role.Organization, Name: role.Name, }...
[ "func", "UnmarshalUser", "(", "data", "[", "]", "byte", ",", "u", "*", "chronograf", ".", "User", ")", "error", "{", "var", "pb", "User", "\n", "if", "err", ":=", "UnmarshalUserPB", "(", "data", ",", "&", "pb", ")", ";", "err", "!=", "nil", "{", ...
// UnmarshalUser decodes a user from binary protobuf data. // We are ignoring the password for now.
[ "UnmarshalUser", "decodes", "a", "user", "from", "binary", "protobuf", "data", ".", "We", "are", "ignoring", "the", "password", "for", "now", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L626-L646
124,164
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalUserPB
func UnmarshalUserPB(data []byte, u *User) error { return proto.Unmarshal(data, u) }
go
func UnmarshalUserPB(data []byte, u *User) error { return proto.Unmarshal(data, u) }
[ "func", "UnmarshalUserPB", "(", "data", "[", "]", "byte", ",", "u", "*", "User", ")", "error", "{", "return", "proto", ".", "Unmarshal", "(", "data", ",", "u", ")", "\n", "}" ]
// UnmarshalUserPB decodes a user from binary protobuf data. // We are ignoring the password for now.
[ "UnmarshalUserPB", "decodes", "a", "user", "from", "binary", "protobuf", "data", ".", "We", "are", "ignoring", "the", "password", "for", "now", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L650-L652
124,165
influxdata/influxdb
chronograf/bolt/internal/internal.go
MarshalRole
func MarshalRole(r *chronograf.Role) ([]byte, error) { return MarshalRolePB(&Role{ Organization: r.Organization, Name: r.Name, }) }
go
func MarshalRole(r *chronograf.Role) ([]byte, error) { return MarshalRolePB(&Role{ Organization: r.Organization, Name: r.Name, }) }
[ "func", "MarshalRole", "(", "r", "*", "chronograf", ".", "Role", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "return", "MarshalRolePB", "(", "&", "Role", "{", "Organization", ":", "r", ".", "Organization", ",", "Name", ":", "r", ".", "Name", ...
// MarshalRole encodes a role to binary protobuf format.
[ "MarshalRole", "encodes", "a", "role", "to", "binary", "protobuf", "format", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L655-L660
124,166
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalRole
func UnmarshalRole(data []byte, r *chronograf.Role) error { var pb Role if err := UnmarshalRolePB(data, &pb); err != nil { return err } r.Organization = pb.Organization r.Name = pb.Name return nil }
go
func UnmarshalRole(data []byte, r *chronograf.Role) error { var pb Role if err := UnmarshalRolePB(data, &pb); err != nil { return err } r.Organization = pb.Organization r.Name = pb.Name return nil }
[ "func", "UnmarshalRole", "(", "data", "[", "]", "byte", ",", "r", "*", "chronograf", ".", "Role", ")", "error", "{", "var", "pb", "Role", "\n", "if", "err", ":=", "UnmarshalRolePB", "(", "data", ",", "&", "pb", ")", ";", "err", "!=", "nil", "{", ...
// UnmarshalRole decodes a role from binary protobuf data.
[ "UnmarshalRole", "decodes", "a", "role", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L668-L677
124,167
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalRolePB
func UnmarshalRolePB(data []byte, r *Role) error { return proto.Unmarshal(data, r) }
go
func UnmarshalRolePB(data []byte, r *Role) error { return proto.Unmarshal(data, r) }
[ "func", "UnmarshalRolePB", "(", "data", "[", "]", "byte", ",", "r", "*", "Role", ")", "error", "{", "return", "proto", ".", "Unmarshal", "(", "data", ",", "r", ")", "\n", "}" ]
// UnmarshalRolePB decodes a role from binary protobuf data.
[ "UnmarshalRolePB", "decodes", "a", "role", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L680-L682
124,168
influxdata/influxdb
chronograf/bolt/internal/internal.go
MarshalOrganization
func MarshalOrganization(o *chronograf.Organization) ([]byte, error) { return MarshalOrganizationPB(&Organization{ ID: o.ID, Name: o.Name, DefaultRole: o.DefaultRole, }) }
go
func MarshalOrganization(o *chronograf.Organization) ([]byte, error) { return MarshalOrganizationPB(&Organization{ ID: o.ID, Name: o.Name, DefaultRole: o.DefaultRole, }) }
[ "func", "MarshalOrganization", "(", "o", "*", "chronograf", ".", "Organization", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "return", "MarshalOrganizationPB", "(", "&", "Organization", "{", "ID", ":", "o", ".", "ID", ",", "Name", ":", "o", "."...
// MarshalOrganization encodes a organization to binary protobuf format.
[ "MarshalOrganization", "encodes", "a", "organization", "to", "binary", "protobuf", "format", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L685-L692
124,169
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalOrganization
func UnmarshalOrganization(data []byte, o *chronograf.Organization) error { var pb Organization if err := UnmarshalOrganizationPB(data, &pb); err != nil { return err } o.ID = pb.ID o.Name = pb.Name o.DefaultRole = pb.DefaultRole return nil }
go
func UnmarshalOrganization(data []byte, o *chronograf.Organization) error { var pb Organization if err := UnmarshalOrganizationPB(data, &pb); err != nil { return err } o.ID = pb.ID o.Name = pb.Name o.DefaultRole = pb.DefaultRole return nil }
[ "func", "UnmarshalOrganization", "(", "data", "[", "]", "byte", ",", "o", "*", "chronograf", ".", "Organization", ")", "error", "{", "var", "pb", "Organization", "\n", "if", "err", ":=", "UnmarshalOrganizationPB", "(", "data", ",", "&", "pb", ")", ";", "...
// UnmarshalOrganization decodes a organization from binary protobuf data.
[ "UnmarshalOrganization", "decodes", "a", "organization", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L700-L710
124,170
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalOrganizationPB
func UnmarshalOrganizationPB(data []byte, o *Organization) error { return proto.Unmarshal(data, o) }
go
func UnmarshalOrganizationPB(data []byte, o *Organization) error { return proto.Unmarshal(data, o) }
[ "func", "UnmarshalOrganizationPB", "(", "data", "[", "]", "byte", ",", "o", "*", "Organization", ")", "error", "{", "return", "proto", ".", "Unmarshal", "(", "data", ",", "o", ")", "\n", "}" ]
// UnmarshalOrganizationPB decodes a organization from binary protobuf data.
[ "UnmarshalOrganizationPB", "decodes", "a", "organization", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L713-L715
124,171
influxdata/influxdb
chronograf/bolt/internal/internal.go
MarshalConfig
func MarshalConfig(c *chronograf.Config) ([]byte, error) { return MarshalConfigPB(&Config{ Auth: &AuthConfig{ SuperAdminNewUsers: c.Auth.SuperAdminNewUsers, }, }) }
go
func MarshalConfig(c *chronograf.Config) ([]byte, error) { return MarshalConfigPB(&Config{ Auth: &AuthConfig{ SuperAdminNewUsers: c.Auth.SuperAdminNewUsers, }, }) }
[ "func", "MarshalConfig", "(", "c", "*", "chronograf", ".", "Config", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "return", "MarshalConfigPB", "(", "&", "Config", "{", "Auth", ":", "&", "AuthConfig", "{", "SuperAdminNewUsers", ":", "c", ".", "Au...
// MarshalConfig encodes a config to binary protobuf format.
[ "MarshalConfig", "encodes", "a", "config", "to", "binary", "protobuf", "format", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L718-L724
124,172
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalConfig
func UnmarshalConfig(data []byte, c *chronograf.Config) error { var pb Config if err := UnmarshalConfigPB(data, &pb); err != nil { return err } if pb.Auth == nil { return fmt.Errorf("auth config is nil") } c.Auth.SuperAdminNewUsers = pb.Auth.SuperAdminNewUsers return nil }
go
func UnmarshalConfig(data []byte, c *chronograf.Config) error { var pb Config if err := UnmarshalConfigPB(data, &pb); err != nil { return err } if pb.Auth == nil { return fmt.Errorf("auth config is nil") } c.Auth.SuperAdminNewUsers = pb.Auth.SuperAdminNewUsers return nil }
[ "func", "UnmarshalConfig", "(", "data", "[", "]", "byte", ",", "c", "*", "chronograf", ".", "Config", ")", "error", "{", "var", "pb", "Config", "\n", "if", "err", ":=", "UnmarshalConfigPB", "(", "data", ",", "&", "pb", ")", ";", "err", "!=", "nil", ...
// UnmarshalConfig decodes a config from binary protobuf data.
[ "UnmarshalConfig", "decodes", "a", "config", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L732-L743
124,173
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalConfigPB
func UnmarshalConfigPB(data []byte, c *Config) error { return proto.Unmarshal(data, c) }
go
func UnmarshalConfigPB(data []byte, c *Config) error { return proto.Unmarshal(data, c) }
[ "func", "UnmarshalConfigPB", "(", "data", "[", "]", "byte", ",", "c", "*", "Config", ")", "error", "{", "return", "proto", ".", "Unmarshal", "(", "data", ",", "c", ")", "\n", "}" ]
// UnmarshalConfigPB decodes a config from binary protobuf data.
[ "UnmarshalConfigPB", "decodes", "a", "config", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L746-L748
124,174
influxdata/influxdb
chronograf/bolt/internal/internal.go
MarshalOrganizationConfig
func MarshalOrganizationConfig(c *chronograf.OrganizationConfig) ([]byte, error) { columns := make([]*LogViewerColumn, len(c.LogViewer.Columns)) for i, column := range c.LogViewer.Columns { encodings := make([]*ColumnEncoding, len(column.Encodings)) for j, e := range column.Encodings { encodings[j] = &Column...
go
func MarshalOrganizationConfig(c *chronograf.OrganizationConfig) ([]byte, error) { columns := make([]*LogViewerColumn, len(c.LogViewer.Columns)) for i, column := range c.LogViewer.Columns { encodings := make([]*ColumnEncoding, len(column.Encodings)) for j, e := range column.Encodings { encodings[j] = &Column...
[ "func", "MarshalOrganizationConfig", "(", "c", "*", "chronograf", ".", "OrganizationConfig", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "columns", ":=", "make", "(", "[", "]", "*", "LogViewerColumn", ",", "len", "(", "c", ".", "LogViewer", ".", ...
// MarshalOrganizationConfig encodes a config to binary protobuf format.
[ "MarshalOrganizationConfig", "encodes", "a", "config", "to", "binary", "protobuf", "format", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L751-L778
124,175
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalOrganizationConfig
func UnmarshalOrganizationConfig(data []byte, c *chronograf.OrganizationConfig) error { var pb OrganizationConfig if err := UnmarshalOrganizationConfigPB(data, &pb); err != nil { return err } if pb.LogViewer == nil { return fmt.Errorf("log Viewer config is nil") } c.OrganizationID = pb.OrganizationID col...
go
func UnmarshalOrganizationConfig(data []byte, c *chronograf.OrganizationConfig) error { var pb OrganizationConfig if err := UnmarshalOrganizationConfigPB(data, &pb); err != nil { return err } if pb.LogViewer == nil { return fmt.Errorf("log Viewer config is nil") } c.OrganizationID = pb.OrganizationID col...
[ "func", "UnmarshalOrganizationConfig", "(", "data", "[", "]", "byte", ",", "c", "*", "chronograf", ".", "OrganizationConfig", ")", "error", "{", "var", "pb", "OrganizationConfig", "\n\n", "if", "err", ":=", "UnmarshalOrganizationConfigPB", "(", "data", ",", "&",...
// UnmarshalOrganizationConfig decodes a config from binary protobuf data.
[ "UnmarshalOrganizationConfig", "decodes", "a", "config", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L786-L818
124,176
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalOrganizationConfigPB
func UnmarshalOrganizationConfigPB(data []byte, c *OrganizationConfig) error { return proto.Unmarshal(data, c) }
go
func UnmarshalOrganizationConfigPB(data []byte, c *OrganizationConfig) error { return proto.Unmarshal(data, c) }
[ "func", "UnmarshalOrganizationConfigPB", "(", "data", "[", "]", "byte", ",", "c", "*", "OrganizationConfig", ")", "error", "{", "return", "proto", ".", "Unmarshal", "(", "data", ",", "c", ")", "\n", "}" ]
// UnmarshalOrganizationConfigPB decodes a config from binary protobuf data.
[ "UnmarshalOrganizationConfigPB", "decodes", "a", "config", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L821-L823
124,177
influxdata/influxdb
chronograf/bolt/internal/internal.go
MarshalMapping
func MarshalMapping(m *chronograf.Mapping) ([]byte, error) { return MarshalMappingPB(&Mapping{ Provider: m.Provider, Scheme: m.Scheme, ProviderOrganization: m.ProviderOrganization, ID: m.ID, Organization: m.Organization, }) }
go
func MarshalMapping(m *chronograf.Mapping) ([]byte, error) { return MarshalMappingPB(&Mapping{ Provider: m.Provider, Scheme: m.Scheme, ProviderOrganization: m.ProviderOrganization, ID: m.ID, Organization: m.Organization, }) }
[ "func", "MarshalMapping", "(", "m", "*", "chronograf", ".", "Mapping", ")", "(", "[", "]", "byte", ",", "error", ")", "{", "return", "MarshalMappingPB", "(", "&", "Mapping", "{", "Provider", ":", "m", ".", "Provider", ",", "Scheme", ":", "m", ".", "S...
// MarshalMapping encodes a mapping to binary protobuf format.
[ "MarshalMapping", "encodes", "a", "mapping", "to", "binary", "protobuf", "format", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L826-L835
124,178
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalMapping
func UnmarshalMapping(data []byte, m *chronograf.Mapping) error { var pb Mapping if err := UnmarshalMappingPB(data, &pb); err != nil { return err } m.Provider = pb.Provider m.Scheme = pb.Scheme m.ProviderOrganization = pb.ProviderOrganization m.Organization = pb.Organization m.ID = pb.ID return nil }
go
func UnmarshalMapping(data []byte, m *chronograf.Mapping) error { var pb Mapping if err := UnmarshalMappingPB(data, &pb); err != nil { return err } m.Provider = pb.Provider m.Scheme = pb.Scheme m.ProviderOrganization = pb.ProviderOrganization m.Organization = pb.Organization m.ID = pb.ID return nil }
[ "func", "UnmarshalMapping", "(", "data", "[", "]", "byte", ",", "m", "*", "chronograf", ".", "Mapping", ")", "error", "{", "var", "pb", "Mapping", "\n", "if", "err", ":=", "UnmarshalMappingPB", "(", "data", ",", "&", "pb", ")", ";", "err", "!=", "nil...
// UnmarshalMapping decodes a mapping from binary protobuf data.
[ "UnmarshalMapping", "decodes", "a", "mapping", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L843-L856
124,179
influxdata/influxdb
chronograf/bolt/internal/internal.go
UnmarshalMappingPB
func UnmarshalMappingPB(data []byte, m *Mapping) error { return proto.Unmarshal(data, m) }
go
func UnmarshalMappingPB(data []byte, m *Mapping) error { return proto.Unmarshal(data, m) }
[ "func", "UnmarshalMappingPB", "(", "data", "[", "]", "byte", ",", "m", "*", "Mapping", ")", "error", "{", "return", "proto", ".", "Unmarshal", "(", "data", ",", "m", ")", "\n", "}" ]
// UnmarshalMappingPB decodes a mapping from binary protobuf data.
[ "UnmarshalMappingPB", "decodes", "a", "mapping", "from", "binary", "protobuf", "data", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/bolt/internal/internal.go#L859-L861
124,180
influxdata/influxdb
http/router.go
NewRouter
func NewRouter() *httprouter.Router { router := httprouter.New() router.NotFound = http.HandlerFunc(notFoundHandler) router.MethodNotAllowed = http.HandlerFunc(methodNotAllowedHandler) router.PanicHandler = panicHandler return router }
go
func NewRouter() *httprouter.Router { router := httprouter.New() router.NotFound = http.HandlerFunc(notFoundHandler) router.MethodNotAllowed = http.HandlerFunc(methodNotAllowedHandler) router.PanicHandler = panicHandler return router }
[ "func", "NewRouter", "(", ")", "*", "httprouter", ".", "Router", "{", "router", ":=", "httprouter", ".", "New", "(", ")", "\n", "router", ".", "NotFound", "=", "http", ".", "HandlerFunc", "(", "notFoundHandler", ")", "\n", "router", ".", "MethodNotAllowed"...
// NewRouter returns a new router with a 404 handler, a 405 handler, and a panic handler.
[ "NewRouter", "returns", "a", "new", "router", "with", "a", "404", "handler", "a", "405", "handler", "and", "a", "panic", "handler", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/http/router.go#L18-L24
124,181
influxdata/influxdb
http/router.go
notFoundHandler
func notFoundHandler(w http.ResponseWriter, r *http.Request) { ctx := r.Context() pe := &platform.Error{ Code: platform.ENotFound, Msg: "path not found", } EncodeError(ctx, pe, w) }
go
func notFoundHandler(w http.ResponseWriter, r *http.Request) { ctx := r.Context() pe := &platform.Error{ Code: platform.ENotFound, Msg: "path not found", } EncodeError(ctx, pe, w) }
[ "func", "notFoundHandler", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "ctx", ":=", "r", ".", "Context", "(", ")", "\n", "pe", ":=", "&", "platform", ".", "Error", "{", "Code", ":", "platform", ".", "EN...
// notFoundHandler represents a 404 handler that return a JSON response.
[ "notFoundHandler", "represents", "a", "404", "handler", "that", "return", "a", "JSON", "response", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/http/router.go#L27-L35
124,182
influxdata/influxdb
http/router.go
methodNotAllowedHandler
func methodNotAllowedHandler(w http.ResponseWriter, r *http.Request) { ctx := r.Context() allow := w.Header().Get("Allow") pe := &platform.Error{ Code: platform.EMethodNotAllowed, Msg: fmt.Sprintf("allow: %s", allow), } EncodeError(ctx, pe, w) }
go
func methodNotAllowedHandler(w http.ResponseWriter, r *http.Request) { ctx := r.Context() allow := w.Header().Get("Allow") pe := &platform.Error{ Code: platform.EMethodNotAllowed, Msg: fmt.Sprintf("allow: %s", allow), } EncodeError(ctx, pe, w) }
[ "func", "methodNotAllowedHandler", "(", "w", "http", ".", "ResponseWriter", ",", "r", "*", "http", ".", "Request", ")", "{", "ctx", ":=", "r", ".", "Context", "(", ")", "\n", "allow", ":=", "w", ".", "Header", "(", ")", ".", "Get", "(", "\"", "\"",...
// methodNotAllowedHandler represents a 405 handler that return a JSON response.
[ "methodNotAllowedHandler", "represents", "a", "405", "handler", "that", "return", "a", "JSON", "response", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/http/router.go#L38-L47
124,183
influxdata/influxdb
http/router.go
getPanicLogger
func getPanicLogger() *zap.Logger { panicLoggerOnce.Do(func() { panicLogger = influxlogger.New(os.Stderr) panicLogger = panicLogger.With(zap.String("handler", "panic")) }) return panicLogger }
go
func getPanicLogger() *zap.Logger { panicLoggerOnce.Do(func() { panicLogger = influxlogger.New(os.Stderr) panicLogger = panicLogger.With(zap.String("handler", "panic")) }) return panicLogger }
[ "func", "getPanicLogger", "(", ")", "*", "zap", ".", "Logger", "{", "panicLoggerOnce", ".", "Do", "(", "func", "(", ")", "{", "panicLogger", "=", "influxlogger", ".", "New", "(", "os", ".", "Stderr", ")", "\n", "panicLogger", "=", "panicLogger", ".", "...
// getPanicLogger returns a logger for panicHandler.
[ "getPanicLogger", "returns", "a", "logger", "for", "panicHandler", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/http/router.go#L72-L79
124,184
influxdata/influxdb
chronograf/organizations/dashboards.go
NewDashboardsStore
func NewDashboardsStore(s chronograf.DashboardsStore, org string) *DashboardsStore { return &DashboardsStore{ store: s, organization: org, } }
go
func NewDashboardsStore(s chronograf.DashboardsStore, org string) *DashboardsStore { return &DashboardsStore{ store: s, organization: org, } }
[ "func", "NewDashboardsStore", "(", "s", "chronograf", ".", "DashboardsStore", ",", "org", "string", ")", "*", "DashboardsStore", "{", "return", "&", "DashboardsStore", "{", "store", ":", "s", ",", "organization", ":", "org", ",", "}", "\n", "}" ]
// NewDashboardsStore creates a new DashboardsStore from an existing // chronograf.DashboardStore and an organization string
[ "NewDashboardsStore", "creates", "a", "new", "DashboardsStore", "from", "an", "existing", "chronograf", ".", "DashboardStore", "and", "an", "organization", "string" ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/organizations/dashboards.go#L21-L26
124,185
influxdata/influxdb
chronograf/organizations/dashboards.go
All
func (s *DashboardsStore) All(ctx context.Context) ([]chronograf.Dashboard, error) { err := validOrganization(ctx) if err != nil { return nil, err } ds, err := s.store.All(ctx) if err != nil { return nil, err } // This filters dashboards without allocating // https://github.com/golang/go/wiki/SliceTricks#...
go
func (s *DashboardsStore) All(ctx context.Context) ([]chronograf.Dashboard, error) { err := validOrganization(ctx) if err != nil { return nil, err } ds, err := s.store.All(ctx) if err != nil { return nil, err } // This filters dashboards without allocating // https://github.com/golang/go/wiki/SliceTricks#...
[ "func", "(", "s", "*", "DashboardsStore", ")", "All", "(", "ctx", "context", ".", "Context", ")", "(", "[", "]", "chronograf", ".", "Dashboard", ",", "error", ")", "{", "err", ":=", "validOrganization", "(", "ctx", ")", "\n", "if", "err", "!=", "nil"...
// All retrieves all dashboards from the underlying DashboardStore and filters them // by organization.
[ "All", "retrieves", "all", "dashboards", "from", "the", "underlying", "DashboardStore", "and", "filters", "them", "by", "organization", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/organizations/dashboards.go#L30-L51
124,186
influxdata/influxdb
chronograf/organizations/dashboards.go
Add
func (s *DashboardsStore) Add(ctx context.Context, d chronograf.Dashboard) (chronograf.Dashboard, error) { err := validOrganization(ctx) if err != nil { return chronograf.Dashboard{}, err } d.Organization = s.organization return s.store.Add(ctx, d) }
go
func (s *DashboardsStore) Add(ctx context.Context, d chronograf.Dashboard) (chronograf.Dashboard, error) { err := validOrganization(ctx) if err != nil { return chronograf.Dashboard{}, err } d.Organization = s.organization return s.store.Add(ctx, d) }
[ "func", "(", "s", "*", "DashboardsStore", ")", "Add", "(", "ctx", "context", ".", "Context", ",", "d", "chronograf", ".", "Dashboard", ")", "(", "chronograf", ".", "Dashboard", ",", "error", ")", "{", "err", ":=", "validOrganization", "(", "ctx", ")", ...
// Add creates a new Dashboard in the DashboardsStore with dashboard.Organization set to be the // organization from the dashboard store.
[ "Add", "creates", "a", "new", "Dashboard", "in", "the", "DashboardsStore", "with", "dashboard", ".", "Organization", "set", "to", "be", "the", "organization", "from", "the", "dashboard", "store", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/organizations/dashboards.go#L55-L63
124,187
influxdata/influxdb
chronograf/organizations/dashboards.go
Get
func (s *DashboardsStore) Get(ctx context.Context, id chronograf.DashboardID) (chronograf.Dashboard, error) { err := validOrganization(ctx) if err != nil { return chronograf.Dashboard{}, err } d, err := s.store.Get(ctx, id) if err != nil { return chronograf.Dashboard{}, err } if d.Organization != s.organiz...
go
func (s *DashboardsStore) Get(ctx context.Context, id chronograf.DashboardID) (chronograf.Dashboard, error) { err := validOrganization(ctx) if err != nil { return chronograf.Dashboard{}, err } d, err := s.store.Get(ctx, id) if err != nil { return chronograf.Dashboard{}, err } if d.Organization != s.organiz...
[ "func", "(", "s", "*", "DashboardsStore", ")", "Get", "(", "ctx", "context", ".", "Context", ",", "id", "chronograf", ".", "DashboardID", ")", "(", "chronograf", ".", "Dashboard", ",", "error", ")", "{", "err", ":=", "validOrganization", "(", "ctx", ")",...
// Get returns a Dashboard if the id exists and belongs to the organization that is set.
[ "Get", "returns", "a", "Dashboard", "if", "the", "id", "exists", "and", "belongs", "to", "the", "organization", "that", "is", "set", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/organizations/dashboards.go#L81-L97
124,188
influxdata/influxdb
tsdb/tsi1/cache.go
NewTagValueSeriesIDCache
func NewTagValueSeriesIDCache(c uint64) *TagValueSeriesIDCache { return &TagValueSeriesIDCache{ cache: map[string]map[string]map[string]*list.Element{}, evictor: list.New(), tracker: newCacheTracker(newCacheMetrics(nil), nil), capacity: c, } }
go
func NewTagValueSeriesIDCache(c uint64) *TagValueSeriesIDCache { return &TagValueSeriesIDCache{ cache: map[string]map[string]map[string]*list.Element{}, evictor: list.New(), tracker: newCacheTracker(newCacheMetrics(nil), nil), capacity: c, } }
[ "func", "NewTagValueSeriesIDCache", "(", "c", "uint64", ")", "*", "TagValueSeriesIDCache", "{", "return", "&", "TagValueSeriesIDCache", "{", "cache", ":", "map", "[", "string", "]", "map", "[", "string", "]", "map", "[", "string", "]", "*", "list", ".", "E...
// NewTagValueSeriesIDCache returns a TagValueSeriesIDCache with capacity c.
[ "NewTagValueSeriesIDCache", "returns", "a", "TagValueSeriesIDCache", "with", "capacity", "c", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/cache.go#L33-L40
124,189
influxdata/influxdb
tsdb/tsi1/cache.go
measurementContainsSets
func (c *TagValueSeriesIDCache) measurementContainsSets(name []byte) bool { _, ok := c.cache[string(name)] return ok }
go
func (c *TagValueSeriesIDCache) measurementContainsSets(name []byte) bool { _, ok := c.cache[string(name)] return ok }
[ "func", "(", "c", "*", "TagValueSeriesIDCache", ")", "measurementContainsSets", "(", "name", "[", "]", "byte", ")", "bool", "{", "_", ",", "ok", ":=", "c", ".", "cache", "[", "string", "(", "name", ")", "]", "\n", "return", "ok", "\n", "}" ]
// measurementContainsSets returns true if there are sets cached for the provided measurement.
[ "measurementContainsSets", "returns", "true", "if", "there", "are", "sets", "cached", "for", "the", "provided", "measurement", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/cache.go#L96-L99
124,190
influxdata/influxdb
tsdb/tsi1/cache.go
DeleteMeasurement
func (c *TagValueSeriesIDCache) DeleteMeasurement(name []byte) { c.Lock() delete(c.cache, string(name)) c.Unlock() }
go
func (c *TagValueSeriesIDCache) DeleteMeasurement(name []byte) { c.Lock() delete(c.cache, string(name)) c.Unlock() }
[ "func", "(", "c", "*", "TagValueSeriesIDCache", ")", "DeleteMeasurement", "(", "name", "[", "]", "byte", ")", "{", "c", ".", "Lock", "(", ")", "\n", "delete", "(", "c", ".", "cache", ",", "string", "(", "name", ")", ")", "\n", "c", ".", "Unlock", ...
// DeleteMeasurement removes all cached entries for the provided measurement name.
[ "DeleteMeasurement", "removes", "all", "cached", "entries", "for", "the", "provided", "measurement", "name", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/cache.go#L162-L166
124,191
influxdata/influxdb
tsdb/tsi1/cache.go
checkEviction
func (c *TagValueSeriesIDCache) checkEviction() { l := uint64(c.evictor.Len()) c.tracker.SetSize(l) if l <= c.capacity { return } e := c.evictor.Back() // Least recently used item. listElement := e.Value.(*seriesIDCacheElement) name := listElement.name key := listElement.key value := listElement.value c.e...
go
func (c *TagValueSeriesIDCache) checkEviction() { l := uint64(c.evictor.Len()) c.tracker.SetSize(l) if l <= c.capacity { return } e := c.evictor.Back() // Least recently used item. listElement := e.Value.(*seriesIDCacheElement) name := listElement.name key := listElement.key value := listElement.value c.e...
[ "func", "(", "c", "*", "TagValueSeriesIDCache", ")", "checkEviction", "(", ")", "{", "l", ":=", "uint64", "(", "c", ".", "evictor", ".", "Len", "(", ")", ")", "\n", "c", ".", "tracker", ".", "SetSize", "(", "l", ")", "\n", "if", "l", "<=", "c", ...
// checkEviction checks if the cache is too big, and evicts the least recently used // item if it is.
[ "checkEviction", "checks", "if", "the", "cache", "is", "too", "big", "and", "evicts", "the", "least", "recently", "used", "item", "if", "it", "is", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/cache.go#L186-L212
124,192
influxdata/influxdb
tsdb/tsi1/index_files.go
IDs
func (p IndexFiles) IDs() []int { a := make([]int, len(p)) for i, f := range p { a[i] = f.ID() } return a }
go
func (p IndexFiles) IDs() []int { a := make([]int, len(p)) for i, f := range p { a[i] = f.ID() } return a }
[ "func", "(", "p", "IndexFiles", ")", "IDs", "(", ")", "[", "]", "int", "{", "a", ":=", "make", "(", "[", "]", "int", ",", "len", "(", "p", ")", ")", "\n", "for", "i", ",", "f", ":=", "range", "p", "{", "a", "[", "i", "]", "=", "f", ".",...
// IDs returns the ids for all index files.
[ "IDs", "returns", "the", "ids", "for", "all", "index", "files", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/index_files.go#L19-L25
124,193
influxdata/influxdb
tsdb/tsi1/index_files.go
Acquire
func (p IndexFiles) Acquire() (lifecycle.References, error) { refs := make(lifecycle.References, 0, len(p)) for _, f := range p { ref, err := f.Acquire() if err != nil { for _, ref := range refs { ref.Release() } return nil, err } refs = append(refs, ref) } return refs, nil }
go
func (p IndexFiles) Acquire() (lifecycle.References, error) { refs := make(lifecycle.References, 0, len(p)) for _, f := range p { ref, err := f.Acquire() if err != nil { for _, ref := range refs { ref.Release() } return nil, err } refs = append(refs, ref) } return refs, nil }
[ "func", "(", "p", "IndexFiles", ")", "Acquire", "(", ")", "(", "lifecycle", ".", "References", ",", "error", ")", "{", "refs", ":=", "make", "(", "lifecycle", ".", "References", ",", "0", ",", "len", "(", "p", ")", ")", "\n", "for", "_", ",", "f"...
// Acquire acquires a reference to each file in the index files.
[ "Acquire", "acquires", "a", "reference", "to", "each", "file", "in", "the", "index", "files", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/index_files.go#L28-L41
124,194
influxdata/influxdb
tsdb/tsi1/index_files.go
Files
func (p IndexFiles) Files() []File { other := make([]File, len(p)) for i, f := range p { other[i] = f } return other }
go
func (p IndexFiles) Files() []File { other := make([]File, len(p)) for i, f := range p { other[i] = f } return other }
[ "func", "(", "p", "IndexFiles", ")", "Files", "(", ")", "[", "]", "File", "{", "other", ":=", "make", "(", "[", "]", "File", ",", "len", "(", "p", ")", ")", "\n", "for", "i", ",", "f", ":=", "range", "p", "{", "other", "[", "i", "]", "=", ...
// Files returns p as a list of File objects.
[ "Files", "returns", "p", "as", "a", "list", "of", "File", "objects", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/index_files.go#L44-L50
124,195
influxdata/influxdb
tsdb/tsi1/index_files.go
MeasurementNames
func (p *IndexFiles) MeasurementNames() [][]byte { itr := p.MeasurementIterator() if itr == nil { return nil } var names [][]byte for e := itr.Next(); e != nil; e = itr.Next() { names = append(names, bytesutil.Clone(e.Name())) } sort.Sort(byteSlices(names)) return names }
go
func (p *IndexFiles) MeasurementNames() [][]byte { itr := p.MeasurementIterator() if itr == nil { return nil } var names [][]byte for e := itr.Next(); e != nil; e = itr.Next() { names = append(names, bytesutil.Clone(e.Name())) } sort.Sort(byteSlices(names)) return names }
[ "func", "(", "p", "*", "IndexFiles", ")", "MeasurementNames", "(", ")", "[", "]", "[", "]", "byte", "{", "itr", ":=", "p", ".", "MeasurementIterator", "(", ")", "\n", "if", "itr", "==", "nil", "{", "return", "nil", "\n", "}", "\n\n", "var", "names"...
// MeasurementNames returns a sorted list of all measurement names for all files.
[ "MeasurementNames", "returns", "a", "sorted", "list", "of", "all", "measurement", "names", "for", "all", "files", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/index_files.go#L90-L102
124,196
influxdata/influxdb
tsdb/tsi1/index_files.go
MeasurementIterator
func (p IndexFiles) MeasurementIterator() MeasurementIterator { a := make([]MeasurementIterator, 0, len(p)) for i := range p { itr := p[i].MeasurementIterator() if itr == nil { continue } a = append(a, itr) } return MergeMeasurementIterators(a...) }
go
func (p IndexFiles) MeasurementIterator() MeasurementIterator { a := make([]MeasurementIterator, 0, len(p)) for i := range p { itr := p[i].MeasurementIterator() if itr == nil { continue } a = append(a, itr) } return MergeMeasurementIterators(a...) }
[ "func", "(", "p", "IndexFiles", ")", "MeasurementIterator", "(", ")", "MeasurementIterator", "{", "a", ":=", "make", "(", "[", "]", "MeasurementIterator", ",", "0", ",", "len", "(", "p", ")", ")", "\n", "for", "i", ":=", "range", "p", "{", "itr", ":=...
// MeasurementIterator returns an iterator that merges measurements across all files.
[ "MeasurementIterator", "returns", "an", "iterator", "that", "merges", "measurements", "across", "all", "files", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/index_files.go#L105-L115
124,197
influxdata/influxdb
tsdb/tsi1/index_files.go
TagKeyIterator
func (p *IndexFiles) TagKeyIterator(name []byte) (TagKeyIterator, error) { a := make([]TagKeyIterator, 0, len(*p)) for _, f := range *p { itr := f.TagKeyIterator(name) if itr == nil { continue } a = append(a, itr) } return MergeTagKeyIterators(a...), nil }
go
func (p *IndexFiles) TagKeyIterator(name []byte) (TagKeyIterator, error) { a := make([]TagKeyIterator, 0, len(*p)) for _, f := range *p { itr := f.TagKeyIterator(name) if itr == nil { continue } a = append(a, itr) } return MergeTagKeyIterators(a...), nil }
[ "func", "(", "p", "*", "IndexFiles", ")", "TagKeyIterator", "(", "name", "[", "]", "byte", ")", "(", "TagKeyIterator", ",", "error", ")", "{", "a", ":=", "make", "(", "[", "]", "TagKeyIterator", ",", "0", ",", "len", "(", "*", "p", ")", ")", "\n"...
// TagKeyIterator returns an iterator that merges tag keys across all files.
[ "TagKeyIterator", "returns", "an", "iterator", "that", "merges", "tag", "keys", "across", "all", "files", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/index_files.go#L118-L128
124,198
influxdata/influxdb
tsdb/tsi1/index_files.go
MeasurementSeriesIDIterator
func (p IndexFiles) MeasurementSeriesIDIterator(name []byte) tsdb.SeriesIDIterator { a := make([]tsdb.SeriesIDIterator, 0, len(p)) for _, f := range p { itr := f.MeasurementSeriesIDIterator(name) if itr == nil { continue } a = append(a, itr) } return tsdb.MergeSeriesIDIterators(a...) }
go
func (p IndexFiles) MeasurementSeriesIDIterator(name []byte) tsdb.SeriesIDIterator { a := make([]tsdb.SeriesIDIterator, 0, len(p)) for _, f := range p { itr := f.MeasurementSeriesIDIterator(name) if itr == nil { continue } a = append(a, itr) } return tsdb.MergeSeriesIDIterators(a...) }
[ "func", "(", "p", "IndexFiles", ")", "MeasurementSeriesIDIterator", "(", "name", "[", "]", "byte", ")", "tsdb", ".", "SeriesIDIterator", "{", "a", ":=", "make", "(", "[", "]", "tsdb", ".", "SeriesIDIterator", ",", "0", ",", "len", "(", "p", ")", ")", ...
// MeasurementSeriesIDIterator returns an iterator that merges series across all files.
[ "MeasurementSeriesIDIterator", "returns", "an", "iterator", "that", "merges", "series", "across", "all", "files", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/index_files.go#L131-L141
124,199
influxdata/influxdb
tsdb/tsi1/index_files.go
TagValueSeriesIDSet
func (p IndexFiles) TagValueSeriesIDSet(name, key, value []byte) (*tsdb.SeriesIDSet, error) { ss := tsdb.NewSeriesIDSet() for i := range p { if fss, err := p[i].TagValueSeriesIDSet(name, key, value); err != nil { return nil, err } else if fss != nil { ss.Merge(fss) } } return ss, nil }
go
func (p IndexFiles) TagValueSeriesIDSet(name, key, value []byte) (*tsdb.SeriesIDSet, error) { ss := tsdb.NewSeriesIDSet() for i := range p { if fss, err := p[i].TagValueSeriesIDSet(name, key, value); err != nil { return nil, err } else if fss != nil { ss.Merge(fss) } } return ss, nil }
[ "func", "(", "p", "IndexFiles", ")", "TagValueSeriesIDSet", "(", "name", ",", "key", ",", "value", "[", "]", "byte", ")", "(", "*", "tsdb", ".", "SeriesIDSet", ",", "error", ")", "{", "ss", ":=", "tsdb", ".", "NewSeriesIDSet", "(", ")", "\n", "for", ...
// TagValueSeriesIDSet returns an iterator that merges series across all files.
[ "TagValueSeriesIDSet", "returns", "an", "iterator", "that", "merges", "series", "across", "all", "files", "." ]
16d0bbb0cd468fd51f412021a76ae5c4b450dea8
https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/index_files.go#L144-L154