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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
123,500 | influxdata/influxdb | storage/engine.go | SeriesCardinality | func (e *Engine) SeriesCardinality() int64 {
e.mu.RLock()
defer e.mu.RUnlock()
if e.closing == nil {
return 0
}
return e.index.SeriesN()
} | go | func (e *Engine) SeriesCardinality() int64 {
e.mu.RLock()
defer e.mu.RUnlock()
if e.closing == nil {
return 0
}
return e.index.SeriesN()
} | [
"func",
"(",
"e",
"*",
"Engine",
")",
"SeriesCardinality",
"(",
")",
"int64",
"{",
"e",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"e",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n",
"if",
"e",
".",
"closing",
"==",
"nil",
"{",
"return",
"0"... | // SeriesCardinality returns the number of series in the engine. | [
"SeriesCardinality",
"returns",
"the",
"number",
"of",
"series",
"in",
"the",
"engine",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/storage/engine.go#L542-L549 |
123,501 | influxdata/influxdb | storage/engine.go | ApplyFnToSeriesIDSet | func (e *Engine) ApplyFnToSeriesIDSet(fn func(*tsdb.SeriesIDSet)) {
e.mu.RLock()
defer e.mu.RUnlock()
if e.closing == nil {
return
}
fn(e.index.SeriesIDSet())
} | go | func (e *Engine) ApplyFnToSeriesIDSet(fn func(*tsdb.SeriesIDSet)) {
e.mu.RLock()
defer e.mu.RUnlock()
if e.closing == nil {
return
}
fn(e.index.SeriesIDSet())
} | [
"func",
"(",
"e",
"*",
"Engine",
")",
"ApplyFnToSeriesIDSet",
"(",
"fn",
"func",
"(",
"*",
"tsdb",
".",
"SeriesIDSet",
")",
")",
"{",
"e",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"e",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n",
"if",
"... | // ApplyFnToSeriesIDSet allows the caller to apply fn to the SeriesIDSet held
// within the engine's index. | [
"ApplyFnToSeriesIDSet",
"allows",
"the",
"caller",
"to",
"apply",
"fn",
"to",
"the",
"SeriesIDSet",
"held",
"within",
"the",
"engine",
"s",
"index",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/storage/engine.go#L558-L565 |
123,502 | influxdata/influxdb | variable.go | QueryParams | func (f VariableFilter) QueryParams() map[string][]string {
qp := url.Values{}
if f.ID != nil {
qp.Add("id", f.ID.String())
}
if f.OrganizationID != nil {
qp.Add("orgID", f.OrganizationID.String())
}
if f.Organization != nil {
qp.Add("org", *f.Organization)
}
return qp
} | go | func (f VariableFilter) QueryParams() map[string][]string {
qp := url.Values{}
if f.ID != nil {
qp.Add("id", f.ID.String())
}
if f.OrganizationID != nil {
qp.Add("orgID", f.OrganizationID.String())
}
if f.Organization != nil {
qp.Add("org", *f.Organization)
}
return qp
} | [
"func",
"(",
"f",
"VariableFilter",
")",
"QueryParams",
"(",
")",
"map",
"[",
"string",
"]",
"[",
"]",
"string",
"{",
"qp",
":=",
"url",
".",
"Values",
"{",
"}",
"\n",
"if",
"f",
".",
"ID",
"!=",
"nil",
"{",
"qp",
".",
"Add",
"(",
"\"",
"\"",
... | // QueryParams implements PagingFilter.
//
// It converts VariableFilter fields to url query params. | [
"QueryParams",
"implements",
"PagingFilter",
".",
"It",
"converts",
"VariableFilter",
"fields",
"to",
"url",
"query",
"params",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/variable.go#L68-L83 |
123,503 | influxdata/influxdb | variable.go | Valid | func (m *Variable) Valid() error {
// todo(leodido) > check it org ID validity?
if m.Name == "" {
return fmt.Errorf("missing variable name")
}
validTypes := map[string]bool{
"constant": true,
"map": true,
"query": true,
}
if _, prs := validTypes[m.Arguments.Type]; !prs {
return fmt.Errorf("in... | go | func (m *Variable) Valid() error {
// todo(leodido) > check it org ID validity?
if m.Name == "" {
return fmt.Errorf("missing variable name")
}
validTypes := map[string]bool{
"constant": true,
"map": true,
"query": true,
}
if _, prs := validTypes[m.Arguments.Type]; !prs {
return fmt.Errorf("in... | [
"func",
"(",
"m",
"*",
"Variable",
")",
"Valid",
"(",
")",
"error",
"{",
"// todo(leodido) > check it org ID validity?",
"if",
"m",
".",
"Name",
"==",
"\"",
"\"",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n\n",
"validTypes",... | // Valid returns an error if a Variable contains invalid data | [
"Valid",
"returns",
"an",
"error",
"if",
"a",
"Variable",
"contains",
"invalid",
"data"
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/variable.go#L112-L130 |
123,504 | influxdata/influxdb | variable.go | Valid | func (u *VariableUpdate) Valid() error {
if u.Name == "" && u.Description == "" && u.Selected == nil && u.Arguments == nil {
return fmt.Errorf("no fields supplied in update")
}
return nil
} | go | func (u *VariableUpdate) Valid() error {
if u.Name == "" && u.Description == "" && u.Selected == nil && u.Arguments == nil {
return fmt.Errorf("no fields supplied in update")
}
return nil
} | [
"func",
"(",
"u",
"*",
"VariableUpdate",
")",
"Valid",
"(",
")",
"error",
"{",
"if",
"u",
".",
"Name",
"==",
"\"",
"\"",
"&&",
"u",
".",
"Description",
"==",
"\"",
"\"",
"&&",
"u",
".",
"Selected",
"==",
"nil",
"&&",
"u",
".",
"Arguments",
"==",
... | // Valid returns an error if a Variable changeset is not valid | [
"Valid",
"returns",
"an",
"error",
"if",
"a",
"Variable",
"changeset",
"is",
"not",
"valid"
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/variable.go#L133-L139 |
123,505 | influxdata/influxdb | variable.go | Apply | func (u *VariableUpdate) Apply(m *Variable) error {
if u.Name != "" {
m.Name = u.Name
}
if u.Selected != nil {
m.Selected = u.Selected
}
if u.Arguments != nil {
m.Arguments = u.Arguments
}
if u.Description != "" {
m.Description = u.Description
}
return nil
} | go | func (u *VariableUpdate) Apply(m *Variable) error {
if u.Name != "" {
m.Name = u.Name
}
if u.Selected != nil {
m.Selected = u.Selected
}
if u.Arguments != nil {
m.Arguments = u.Arguments
}
if u.Description != "" {
m.Description = u.Description
}
return nil
} | [
"func",
"(",
"u",
"*",
"VariableUpdate",
")",
"Apply",
"(",
"m",
"*",
"Variable",
")",
"error",
"{",
"if",
"u",
".",
"Name",
"!=",
"\"",
"\"",
"{",
"m",
".",
"Name",
"=",
"u",
".",
"Name",
"\n",
"}",
"\n\n",
"if",
"u",
".",
"Selected",
"!=",
... | // Apply applies non-zero fields from a VariableUpdate to a Variable | [
"Apply",
"applies",
"non",
"-",
"zero",
"fields",
"from",
"a",
"VariableUpdate",
"to",
"a",
"Variable"
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/variable.go#L142-L160 |
123,506 | influxdata/influxdb | variable.go | UnmarshalJSON | func (a *VariableArguments) UnmarshalJSON(data []byte) error {
type Alias VariableArguments
aux := struct{ *Alias }{Alias: (*Alias)(a)}
err := json.Unmarshal(data, &aux)
if err != nil {
return err
}
// Decode the polymorphic VariableArguments.Values field into the approriate struct
switch aux.Type {
case "c... | go | func (a *VariableArguments) UnmarshalJSON(data []byte) error {
type Alias VariableArguments
aux := struct{ *Alias }{Alias: (*Alias)(a)}
err := json.Unmarshal(data, &aux)
if err != nil {
return err
}
// Decode the polymorphic VariableArguments.Values field into the approriate struct
switch aux.Type {
case "c... | [
"func",
"(",
"a",
"*",
"VariableArguments",
")",
"UnmarshalJSON",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"type",
"Alias",
"VariableArguments",
"\n",
"aux",
":=",
"struct",
"{",
"*",
"Alias",
"}",
"{",
"Alias",
":",
"(",
"*",
"Alias",
")",
... | // UnmarshalJSON unmarshals json into a VariableArguments struct, using the `Type`
// field to assign the approriate struct to the `Values` field | [
"UnmarshalJSON",
"unmarshals",
"json",
"into",
"a",
"VariableArguments",
"struct",
"using",
"the",
"Type",
"field",
"to",
"assign",
"the",
"approriate",
"struct",
"to",
"the",
"Values",
"field"
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/variable.go#L164-L237 |
123,507 | influxdata/influxdb | chronograf/server/services.go | NewService | func (s *Service) NewService(w http.ResponseWriter, r *http.Request) {
srcID, err := paramID("id", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
return
}
ctx := r.Context()
_, err = s.Store.Sources(ctx).Get(ctx, srcID)
if err != nil {
notFound(w, srcID, s.Logger)
retu... | go | func (s *Service) NewService(w http.ResponseWriter, r *http.Request) {
srcID, err := paramID("id", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
return
}
ctx := r.Context()
_, err = s.Store.Sources(ctx).Get(ctx, srcID)
if err != nil {
notFound(w, srcID, s.Logger)
retu... | [
"func",
"(",
"s",
"*",
"Service",
")",
"NewService",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
")",
"{",
"srcID",
",",
"err",
":=",
"paramID",
"(",
"\"",
"\"",
",",
"r",
")",
"\n",
"if",
"err",
"!=",
"nil",
... | // NewService adds valid service store store. | [
"NewService",
"adds",
"valid",
"service",
"store",
"store",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/services.go#L95-L156 |
123,508 | influxdata/influxdb | chronograf/server/services.go | Services | func (s *Service) Services(w http.ResponseWriter, r *http.Request) {
srcID, err := paramID("id", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
return
}
ctx := r.Context()
mrSrvs, err := s.Store.Servers(ctx).All(ctx)
if err != nil {
Error(w, http.StatusInternalServerErro... | go | func (s *Service) Services(w http.ResponseWriter, r *http.Request) {
srcID, err := paramID("id", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
return
}
ctx := r.Context()
mrSrvs, err := s.Store.Servers(ctx).All(ctx)
if err != nil {
Error(w, http.StatusInternalServerErro... | [
"func",
"(",
"s",
"*",
"Service",
")",
"Services",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
")",
"{",
"srcID",
",",
"err",
":=",
"paramID",
"(",
"\"",
"\"",
",",
"r",
")",
"\n",
"if",
"err",
"!=",
"nil",
"... | // Services retrieves all services from store. | [
"Services",
"retrieves",
"all",
"services",
"from",
"store",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/services.go#L159-L185 |
123,509 | influxdata/influxdb | chronograf/server/services.go | ServiceID | func (s *Service) ServiceID(w http.ResponseWriter, r *http.Request) {
id, err := paramID("kid", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
return
}
srcID, err := paramID("id", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
return
... | go | func (s *Service) ServiceID(w http.ResponseWriter, r *http.Request) {
id, err := paramID("kid", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
return
}
srcID, err := paramID("id", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
return
... | [
"func",
"(",
"s",
"*",
"Service",
")",
"ServiceID",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
")",
"{",
"id",
",",
"err",
":=",
"paramID",
"(",
"\"",
"\"",
",",
"r",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{"... | // ServiceID retrieves a service with ID from store. | [
"ServiceID",
"retrieves",
"a",
"service",
"with",
"ID",
"from",
"store",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/services.go#L188-L210 |
123,510 | influxdata/influxdb | chronograf/server/services.go | RemoveService | func (s *Service) RemoveService(w http.ResponseWriter, r *http.Request) {
id, err := paramID("kid", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
return
}
srcID, err := paramID("id", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
ret... | go | func (s *Service) RemoveService(w http.ResponseWriter, r *http.Request) {
id, err := paramID("kid", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
return
}
srcID, err := paramID("id", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
ret... | [
"func",
"(",
"s",
"*",
"Service",
")",
"RemoveService",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
")",
"{",
"id",
",",
"err",
":=",
"paramID",
"(",
"\"",
"\"",
",",
"r",
")",
"\n",
"if",
"err",
"!=",
"nil",
... | // RemoveService deletes service from store. | [
"RemoveService",
"deletes",
"service",
"from",
"store",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/services.go#L213-L239 |
123,511 | influxdata/influxdb | chronograf/server/services.go | UpdateService | func (s *Service) UpdateService(w http.ResponseWriter, r *http.Request) {
id, err := paramID("kid", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
return
}
srcID, err := paramID("id", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
ret... | go | func (s *Service) UpdateService(w http.ResponseWriter, r *http.Request) {
id, err := paramID("kid", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
return
}
srcID, err := paramID("id", r)
if err != nil {
Error(w, http.StatusUnprocessableEntity, err.Error(), s.Logger)
ret... | [
"func",
"(",
"s",
"*",
"Service",
")",
"UpdateService",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
")",
"{",
"id",
",",
"err",
":=",
"paramID",
"(",
"\"",
"\"",
",",
"r",
")",
"\n",
"if",
"err",
"!=",
"nil",
... | // UpdateService incrementally updates a service definition in the store | [
"UpdateService",
"incrementally",
"updates",
"a",
"service",
"definition",
"in",
"the",
"store"
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/services.go#L270-L340 |
123,512 | influxdata/influxdb | chronograf/server/mapping.go | Valid | func (m *mappingsRequest) Valid() error {
if m.Provider == "" {
return fmt.Errorf("mapping must specify provider")
}
if m.Scheme == "" {
return fmt.Errorf("mapping must specify scheme")
}
if m.ProviderOrganization == "" {
return fmt.Errorf("mapping must specify group")
}
return nil
} | go | func (m *mappingsRequest) Valid() error {
if m.Provider == "" {
return fmt.Errorf("mapping must specify provider")
}
if m.Scheme == "" {
return fmt.Errorf("mapping must specify scheme")
}
if m.ProviderOrganization == "" {
return fmt.Errorf("mapping must specify group")
}
return nil
} | [
"func",
"(",
"m",
"*",
"mappingsRequest",
")",
"Valid",
"(",
")",
"error",
"{",
"if",
"m",
".",
"Provider",
"==",
"\"",
"\"",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
")",
"\n",
"}",
"\n",
"if",
"m",
".",
"Scheme",
"==",
"\"",
"\""... | // Valid determines if a mapping request is valid | [
"Valid",
"determines",
"if",
"a",
"mapping",
"request",
"is",
"valid"
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/mapping.go#L93-L105 |
123,513 | influxdata/influxdb | chronograf/server/mapping.go | Mappings | func (s *Service) Mappings(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
mappings, err := s.Store.Mappings(ctx).All(ctx)
if err != nil {
Error(w, http.StatusInternalServerError, "failed to retrieve mappings from database", s.Logger)
return
}
res := newMappingsResponse(mappings)
encodeJSON(w,... | go | func (s *Service) Mappings(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
mappings, err := s.Store.Mappings(ctx).All(ctx)
if err != nil {
Error(w, http.StatusInternalServerError, "failed to retrieve mappings from database", s.Logger)
return
}
res := newMappingsResponse(mappings)
encodeJSON(w,... | [
"func",
"(",
"s",
"*",
"Service",
")",
"Mappings",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
")",
"{",
"ctx",
":=",
"r",
".",
"Context",
"(",
")",
"\n\n",
"mappings",
",",
"err",
":=",
"s",
".",
"Store",
".",... | // Mappings retrives all mappings | [
"Mappings",
"retrives",
"all",
"mappings"
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/mapping.go#L141-L153 |
123,514 | influxdata/influxdb | chronograf/server/mapping.go | NewMapping | func (s *Service) NewMapping(w http.ResponseWriter, r *http.Request) {
var req mappingsRequest
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
invalidJSON(w, s.Logger)
return
}
if err := req.Valid(); err != nil {
invalidData(w, err, s.Logger)
return
}
ctx := r.Context()
// validate that t... | go | func (s *Service) NewMapping(w http.ResponseWriter, r *http.Request) {
var req mappingsRequest
if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
invalidJSON(w, s.Logger)
return
}
if err := req.Valid(); err != nil {
invalidData(w, err, s.Logger)
return
}
ctx := r.Context()
// validate that t... | [
"func",
"(",
"s",
"*",
"Service",
")",
"NewMapping",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
")",
"{",
"var",
"req",
"mappingsRequest",
"\n",
"if",
"err",
":=",
"json",
".",
"NewDecoder",
"(",
"r",
".",
"Body",... | // NewMapping adds a new mapping | [
"NewMapping",
"adds",
"a",
"new",
"mapping"
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/mapping.go#L156-L192 |
123,515 | influxdata/influxdb | chronograf/server/mapping.go | RemoveMapping | func (s *Service) RemoveMapping(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
id := httprouter.GetParamFromContext(ctx, "id")
m, err := s.Store.Mappings(ctx).Get(ctx, id)
if err == chronograf.ErrMappingNotFound {
Error(w, http.StatusNotFound, err.Error(), s.Logger)
return
}
if err != nil {
... | go | func (s *Service) RemoveMapping(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
id := httprouter.GetParamFromContext(ctx, "id")
m, err := s.Store.Mappings(ctx).Get(ctx, id)
if err == chronograf.ErrMappingNotFound {
Error(w, http.StatusNotFound, err.Error(), s.Logger)
return
}
if err != nil {
... | [
"func",
"(",
"s",
"*",
"Service",
")",
"RemoveMapping",
"(",
"w",
"http",
".",
"ResponseWriter",
",",
"r",
"*",
"http",
".",
"Request",
")",
"{",
"ctx",
":=",
"r",
".",
"Context",
"(",
")",
"\n",
"id",
":=",
"httprouter",
".",
"GetParamFromContext",
... | // RemoveMapping removes a mapping | [
"RemoveMapping",
"removes",
"a",
"mapping"
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/chronograf/server/mapping.go#L235-L256 |
123,516 | influxdata/influxdb | tsdb/tsm1/writer.go | UnmarshalBinary | func (e *IndexEntry) UnmarshalBinary(b []byte) error {
if len(b) < indexEntrySize {
return fmt.Errorf("unmarshalBinary: short buf: %v < %v", len(b), indexEntrySize)
}
e.MinTime = int64(binary.BigEndian.Uint64(b[:8]))
e.MaxTime = int64(binary.BigEndian.Uint64(b[8:16]))
e.Offset = int64(binary.BigEndian.Uint64(b[1... | go | func (e *IndexEntry) UnmarshalBinary(b []byte) error {
if len(b) < indexEntrySize {
return fmt.Errorf("unmarshalBinary: short buf: %v < %v", len(b), indexEntrySize)
}
e.MinTime = int64(binary.BigEndian.Uint64(b[:8]))
e.MaxTime = int64(binary.BigEndian.Uint64(b[8:16]))
e.Offset = int64(binary.BigEndian.Uint64(b[1... | [
"func",
"(",
"e",
"*",
"IndexEntry",
")",
"UnmarshalBinary",
"(",
"b",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"len",
"(",
"b",
")",
"<",
"indexEntrySize",
"{",
"return",
"fmt",
".",
"Errorf",
"(",
"\"",
"\"",
",",
"len",
"(",
"b",
")",
",",
... | // UnmarshalBinary decodes an IndexEntry from a byte slice. | [
"UnmarshalBinary",
"decodes",
"an",
"IndexEntry",
"from",
"a",
"byte",
"slice",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/writer.go#L196-L205 |
123,517 | influxdata/influxdb | tsdb/tsm1/writer.go | AppendTo | func (e *IndexEntry) AppendTo(b []byte) []byte {
if len(b) < indexEntrySize {
if cap(b) < indexEntrySize {
b = make([]byte, indexEntrySize)
} else {
b = b[:indexEntrySize]
}
}
binary.BigEndian.PutUint64(b[:8], uint64(e.MinTime))
binary.BigEndian.PutUint64(b[8:16], uint64(e.MaxTime))
binary.BigEndian.P... | go | func (e *IndexEntry) AppendTo(b []byte) []byte {
if len(b) < indexEntrySize {
if cap(b) < indexEntrySize {
b = make([]byte, indexEntrySize)
} else {
b = b[:indexEntrySize]
}
}
binary.BigEndian.PutUint64(b[:8], uint64(e.MinTime))
binary.BigEndian.PutUint64(b[8:16], uint64(e.MaxTime))
binary.BigEndian.P... | [
"func",
"(",
"e",
"*",
"IndexEntry",
")",
"AppendTo",
"(",
"b",
"[",
"]",
"byte",
")",
"[",
"]",
"byte",
"{",
"if",
"len",
"(",
"b",
")",
"<",
"indexEntrySize",
"{",
"if",
"cap",
"(",
"b",
")",
"<",
"indexEntrySize",
"{",
"b",
"=",
"make",
"(",... | // AppendTo writes a binary-encoded version of IndexEntry to b, allocating
// and returning a new slice, if necessary. | [
"AppendTo",
"writes",
"a",
"binary",
"-",
"encoded",
"version",
"of",
"IndexEntry",
"to",
"b",
"allocating",
"and",
"returning",
"a",
"new",
"slice",
"if",
"necessary",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/writer.go#L209-L224 |
123,518 | influxdata/influxdb | tsdb/tsm1/writer.go | Contains | func (e *IndexEntry) Contains(t int64) bool {
return e.MinTime <= t && e.MaxTime >= t
} | go | func (e *IndexEntry) Contains(t int64) bool {
return e.MinTime <= t && e.MaxTime >= t
} | [
"func",
"(",
"e",
"*",
"IndexEntry",
")",
"Contains",
"(",
"t",
"int64",
")",
"bool",
"{",
"return",
"e",
".",
"MinTime",
"<=",
"t",
"&&",
"e",
".",
"MaxTime",
">=",
"t",
"\n",
"}"
] | // Contains returns true if this IndexEntry may contain values for the given time.
// The min and max times are inclusive. | [
"Contains",
"returns",
"true",
"if",
"this",
"IndexEntry",
"may",
"contain",
"values",
"for",
"the",
"given",
"time",
".",
"The",
"min",
"and",
"max",
"times",
"are",
"inclusive",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/writer.go#L228-L230 |
123,519 | influxdata/influxdb | tsdb/tsm1/writer.go | OverlapsTimeRange | func (e *IndexEntry) OverlapsTimeRange(min, max int64) bool {
return e.MinTime <= max && e.MaxTime >= min
} | go | func (e *IndexEntry) OverlapsTimeRange(min, max int64) bool {
return e.MinTime <= max && e.MaxTime >= min
} | [
"func",
"(",
"e",
"*",
"IndexEntry",
")",
"OverlapsTimeRange",
"(",
"min",
",",
"max",
"int64",
")",
"bool",
"{",
"return",
"e",
".",
"MinTime",
"<=",
"max",
"&&",
"e",
".",
"MaxTime",
">=",
"min",
"\n",
"}"
] | // OverlapsTimeRange returns true if the given time ranges are completely within the entry's time bounds. | [
"OverlapsTimeRange",
"returns",
"true",
"if",
"the",
"given",
"time",
"ranges",
"are",
"completely",
"within",
"the",
"entry",
"s",
"time",
"bounds",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/writer.go#L233-L235 |
123,520 | influxdata/influxdb | tsdb/tsm1/writer.go | String | func (e *IndexEntry) String() string {
return fmt.Sprintf("min=%s max=%s ofs=%d siz=%d",
time.Unix(0, e.MinTime).UTC(), time.Unix(0, e.MaxTime).UTC(), e.Offset, e.Size)
} | go | func (e *IndexEntry) String() string {
return fmt.Sprintf("min=%s max=%s ofs=%d siz=%d",
time.Unix(0, e.MinTime).UTC(), time.Unix(0, e.MaxTime).UTC(), e.Offset, e.Size)
} | [
"func",
"(",
"e",
"*",
"IndexEntry",
")",
"String",
"(",
")",
"string",
"{",
"return",
"fmt",
".",
"Sprintf",
"(",
"\"",
"\"",
",",
"time",
".",
"Unix",
"(",
"0",
",",
"e",
".",
"MinTime",
")",
".",
"UTC",
"(",
")",
",",
"time",
".",
"Unix",
... | // String returns a string representation of the entry. | [
"String",
"returns",
"a",
"string",
"representation",
"of",
"the",
"entry",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/writer.go#L238-L241 |
123,521 | influxdata/influxdb | tsdb/tsm1/writer.go | copyBuffer | func copyBuffer(f syncer, dst io.Writer, src io.Reader, buf []byte) (written int64, err error) {
if buf == nil {
buf = make([]byte, 32*1024)
}
var lastSync int64
for {
nr, er := src.Read(buf)
if nr > 0 {
nw, ew := dst.Write(buf[0:nr])
if nw > 0 {
written += int64(nw)
}
if f != nil && written-... | go | func copyBuffer(f syncer, dst io.Writer, src io.Reader, buf []byte) (written int64, err error) {
if buf == nil {
buf = make([]byte, 32*1024)
}
var lastSync int64
for {
nr, er := src.Read(buf)
if nr > 0 {
nw, ew := dst.Write(buf[0:nr])
if nw > 0 {
written += int64(nw)
}
if f != nil && written-... | [
"func",
"copyBuffer",
"(",
"f",
"syncer",
",",
"dst",
"io",
".",
"Writer",
",",
"src",
"io",
".",
"Reader",
",",
"buf",
"[",
"]",
"byte",
")",
"(",
"written",
"int64",
",",
"err",
"error",
")",
"{",
"if",
"buf",
"==",
"nil",
"{",
"buf",
"=",
"m... | // copyBuffer is the actual implementation of Copy and CopyBuffer.
// if buf is nil, one is allocated. This is copied from the Go stdlib
// in order to remove the fast path WriteTo calls which circumvent any
// IO throttling as well as to add periodic fsyncs to avoid long stalls. | [
"copyBuffer",
"is",
"the",
"actual",
"implementation",
"of",
"Copy",
"and",
"CopyBuffer",
".",
"if",
"buf",
"is",
"nil",
"one",
"is",
"allocated",
".",
"This",
"is",
"copied",
"from",
"the",
"Go",
"stdlib",
"in",
"order",
"to",
"remove",
"the",
"fast",
"... | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/writer.go#L417-L453 |
123,522 | influxdata/influxdb | tsdb/tsm1/writer.go | Remove | func (d *directIndex) Remove() error {
if d.fd == nil {
return nil
}
// Close the file handle to prevent leaking. We ignore the error because
// we just want to cleanup and remove the file.
_ = d.fd.Close()
return os.Remove(d.fd.Name())
} | go | func (d *directIndex) Remove() error {
if d.fd == nil {
return nil
}
// Close the file handle to prevent leaking. We ignore the error because
// we just want to cleanup and remove the file.
_ = d.fd.Close()
return os.Remove(d.fd.Name())
} | [
"func",
"(",
"d",
"*",
"directIndex",
")",
"Remove",
"(",
")",
"error",
"{",
"if",
"d",
".",
"fd",
"==",
"nil",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"// Close the file handle to prevent leaking. We ignore the error because",
"// we just want to cleanup and remove... | // Remove removes the index from any tempory storage | [
"Remove",
"removes",
"the",
"index",
"from",
"any",
"tempory",
"storage"
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/writer.go#L572-L582 |
123,523 | influxdata/influxdb | tsdb/tsm1/writer.go | NewTSMWriter | func NewTSMWriter(w io.Writer) (TSMWriter, error) {
index := NewIndexWriter()
return &tsmWriter{
wrapped: w,
w: bufio.NewWriterSize(w, 1024*1024),
index: index,
stats: NewMeasurementStats(),
}, nil
} | go | func NewTSMWriter(w io.Writer) (TSMWriter, error) {
index := NewIndexWriter()
return &tsmWriter{
wrapped: w,
w: bufio.NewWriterSize(w, 1024*1024),
index: index,
stats: NewMeasurementStats(),
}, nil
} | [
"func",
"NewTSMWriter",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"TSMWriter",
",",
"error",
")",
"{",
"index",
":=",
"NewIndexWriter",
"(",
")",
"\n",
"return",
"&",
"tsmWriter",
"{",
"wrapped",
":",
"w",
",",
"w",
":",
"bufio",
".",
"NewWriterSize",
... | // NewTSMWriter returns a new TSMWriter writing to w. | [
"NewTSMWriter",
"returns",
"a",
"new",
"TSMWriter",
"writing",
"to",
"w",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/writer.go#L598-L606 |
123,524 | influxdata/influxdb | tsdb/tsm1/writer.go | NewTSMWriterWithDiskBuffer | func NewTSMWriterWithDiskBuffer(w io.Writer) (TSMWriter, error) {
var index IndexWriter
// Make sure is a File so we can write the temp index alongside it.
if fw, ok := w.(syncer); ok {
f, err := os.OpenFile(strings.TrimSuffix(fw.Name(), ".tsm.tmp")+".idx.tmp", os.O_CREATE|os.O_RDWR|os.O_EXCL, 0666)
if err != ni... | go | func NewTSMWriterWithDiskBuffer(w io.Writer) (TSMWriter, error) {
var index IndexWriter
// Make sure is a File so we can write the temp index alongside it.
if fw, ok := w.(syncer); ok {
f, err := os.OpenFile(strings.TrimSuffix(fw.Name(), ".tsm.tmp")+".idx.tmp", os.O_CREATE|os.O_RDWR|os.O_EXCL, 0666)
if err != ni... | [
"func",
"NewTSMWriterWithDiskBuffer",
"(",
"w",
"io",
".",
"Writer",
")",
"(",
"TSMWriter",
",",
"error",
")",
"{",
"var",
"index",
"IndexWriter",
"\n",
"// Make sure is a File so we can write the temp index alongside it.",
"if",
"fw",
",",
"ok",
":=",
"w",
".",
"... | // NewTSMWriterWithDiskBuffer returns a new TSMWriter writing to w and will use a disk
// based buffer for the TSM index if possible. | [
"NewTSMWriterWithDiskBuffer",
"returns",
"a",
"new",
"TSMWriter",
"writing",
"to",
"w",
"and",
"will",
"use",
"a",
"disk",
"based",
"buffer",
"for",
"the",
"TSM",
"index",
"if",
"possible",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/writer.go#L610-L630 |
123,525 | influxdata/influxdb | tsdb/tsm1/writer.go | Write | func (t *tsmWriter) Write(key []byte, values Values) error {
if len(key) > maxKeyLength {
return ErrMaxKeyLengthExceeded
}
// Nothing to write
if len(values) == 0 {
return nil
}
// Write header only after we have some data to write.
if t.n == 0 {
if err := t.writeHeader(); err != nil {
return err
}
... | go | func (t *tsmWriter) Write(key []byte, values Values) error {
if len(key) > maxKeyLength {
return ErrMaxKeyLengthExceeded
}
// Nothing to write
if len(values) == 0 {
return nil
}
// Write header only after we have some data to write.
if t.n == 0 {
if err := t.writeHeader(); err != nil {
return err
}
... | [
"func",
"(",
"t",
"*",
"tsmWriter",
")",
"Write",
"(",
"key",
"[",
"]",
"byte",
",",
"values",
"Values",
")",
"error",
"{",
"if",
"len",
"(",
"key",
")",
">",
"maxKeyLength",
"{",
"return",
"ErrMaxKeyLengthExceeded",
"\n",
"}",
"\n\n",
"// Nothing to wri... | // Write writes a new block containing key and values. | [
"Write",
"writes",
"a",
"new",
"block",
"containing",
"key",
"and",
"values",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/writer.go#L649-L705 |
123,526 | influxdata/influxdb | tsdb/tsm1/writer.go | WriteBlock | func (t *tsmWriter) WriteBlock(key []byte, minTime, maxTime int64, block []byte) error {
if len(key) > maxKeyLength {
return ErrMaxKeyLengthExceeded
}
// Nothing to write
if len(block) == 0 {
return nil
}
blockType, err := BlockType(block)
if err != nil {
return err
}
// Write header only after we hav... | go | func (t *tsmWriter) WriteBlock(key []byte, minTime, maxTime int64, block []byte) error {
if len(key) > maxKeyLength {
return ErrMaxKeyLengthExceeded
}
// Nothing to write
if len(block) == 0 {
return nil
}
blockType, err := BlockType(block)
if err != nil {
return err
}
// Write header only after we hav... | [
"func",
"(",
"t",
"*",
"tsmWriter",
")",
"WriteBlock",
"(",
"key",
"[",
"]",
"byte",
",",
"minTime",
",",
"maxTime",
"int64",
",",
"block",
"[",
"]",
"byte",
")",
"error",
"{",
"if",
"len",
"(",
"key",
")",
">",
"maxKeyLength",
"{",
"return",
"ErrM... | // WriteBlock writes block for the given key and time range to the TSM file. If the write
// exceeds max entries for a given key, ErrMaxBlocksExceeded is returned. This indicates
// that the index is now full for this key and no future writes to this key will succeed. | [
"WriteBlock",
"writes",
"block",
"for",
"the",
"given",
"key",
"and",
"time",
"range",
"to",
"the",
"TSM",
"file",
".",
"If",
"the",
"write",
"exceeds",
"max",
"entries",
"for",
"a",
"given",
"key",
"ErrMaxBlocksExceeded",
"is",
"returned",
".",
"This",
"i... | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/writer.go#L710-L769 |
123,527 | influxdata/influxdb | tsdb/tsm1/writer.go | WriteIndex | func (t *tsmWriter) WriteIndex() error {
indexPos := t.n
if t.index.KeyCount() == 0 {
return ErrNoValues
}
// Set the destination file on the index so we can periodically
// fsync while writing the index.
if f, ok := t.wrapped.(syncer); ok {
t.index.(*directIndex).f = f
}
// Write the index
if _, err :=... | go | func (t *tsmWriter) WriteIndex() error {
indexPos := t.n
if t.index.KeyCount() == 0 {
return ErrNoValues
}
// Set the destination file on the index so we can periodically
// fsync while writing the index.
if f, ok := t.wrapped.(syncer); ok {
t.index.(*directIndex).f = f
}
// Write the index
if _, err :=... | [
"func",
"(",
"t",
"*",
"tsmWriter",
")",
"WriteIndex",
"(",
")",
"error",
"{",
"indexPos",
":=",
"t",
".",
"n",
"\n\n",
"if",
"t",
".",
"index",
".",
"KeyCount",
"(",
")",
"==",
"0",
"{",
"return",
"ErrNoValues",
"\n",
"}",
"\n\n",
"// Set the destin... | // WriteIndex writes the index section of the file. If there are no index entries to write,
// this returns ErrNoValues. | [
"WriteIndex",
"writes",
"the",
"index",
"section",
"of",
"the",
"file",
".",
"If",
"there",
"are",
"no",
"index",
"entries",
"to",
"write",
"this",
"returns",
"ErrNoValues",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/writer.go#L773-L797 |
123,528 | influxdata/influxdb | tsdb/tsm1/writer.go | Remove | func (t *tsmWriter) Remove() error {
if err := t.index.Remove(); err != nil {
return err
}
// nameCloser is the most permissive interface we can close the wrapped
// value with.
type nameCloser interface {
io.Closer
Name() string
}
if f, ok := t.wrapped.(nameCloser); ok {
// Close the file handle to pr... | go | func (t *tsmWriter) Remove() error {
if err := t.index.Remove(); err != nil {
return err
}
// nameCloser is the most permissive interface we can close the wrapped
// value with.
type nameCloser interface {
io.Closer
Name() string
}
if f, ok := t.wrapped.(nameCloser); ok {
// Close the file handle to pr... | [
"func",
"(",
"t",
"*",
"tsmWriter",
")",
"Remove",
"(",
")",
"error",
"{",
"if",
"err",
":=",
"t",
".",
"index",
".",
"Remove",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"\n\n",
"// nameCloser is the most permissive interface we... | // Remove removes any temporary storage used by the writer. | [
"Remove",
"removes",
"any",
"temporary",
"storage",
"used",
"by",
"the",
"writer",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsm1/writer.go#L864-L888 |
123,529 | influxdata/influxdb | tsdb/tsi1/log_file.go | NewLogFile | func NewLogFile(sfile *tsdb.SeriesFile, path string) *LogFile {
return &LogFile{
sfile: sfile,
path: path,
mms: make(logMeasurements),
stats: make(MeasurementCardinalityStats),
seriesIDSet: tsdb.NewSeriesIDSet(),
tombstoneSeriesIDSet: tsdb.NewSeriesIDSet(),
}
} | go | func NewLogFile(sfile *tsdb.SeriesFile, path string) *LogFile {
return &LogFile{
sfile: sfile,
path: path,
mms: make(logMeasurements),
stats: make(MeasurementCardinalityStats),
seriesIDSet: tsdb.NewSeriesIDSet(),
tombstoneSeriesIDSet: tsdb.NewSeriesIDSet(),
}
} | [
"func",
"NewLogFile",
"(",
"sfile",
"*",
"tsdb",
".",
"SeriesFile",
",",
"path",
"string",
")",
"*",
"LogFile",
"{",
"return",
"&",
"LogFile",
"{",
"sfile",
":",
"sfile",
",",
"path",
":",
"path",
",",
"mms",
":",
"make",
"(",
"logMeasurements",
")",
... | // NewLogFile returns a new instance of LogFile. | [
"NewLogFile",
"returns",
"a",
"new",
"instance",
"of",
"LogFile",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L80-L90 |
123,530 | influxdata/influxdb | tsdb/tsi1/log_file.go | Open | func (f *LogFile) Open() error {
if err := f.open(); err != nil {
f.Close()
return err
}
return nil
} | go | func (f *LogFile) Open() error {
if err := f.open(); err != nil {
f.Close()
return err
}
return nil
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"Open",
"(",
")",
"error",
"{",
"if",
"err",
":=",
"f",
".",
"open",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"f",
".",
"Close",
"(",
")",
"\n",
"return",
"err",
"\n",
"}",
"\n",
"return",
"nil",
"\n",
... | // Open reads the log from a file and validates all the checksums. | [
"Open",
"reads",
"the",
"log",
"from",
"a",
"file",
"and",
"validates",
"all",
"the",
"checksums",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L121-L127 |
123,531 | influxdata/influxdb | tsdb/tsi1/log_file.go | FlushAndSync | func (f *LogFile) FlushAndSync() error {
if f.nosync {
return nil
}
if f.w != nil {
if err := f.w.Flush(); err != nil {
return err
}
}
if f.file == nil {
return nil
}
return f.file.Sync()
} | go | func (f *LogFile) FlushAndSync() error {
if f.nosync {
return nil
}
if f.w != nil {
if err := f.w.Flush(); err != nil {
return err
}
}
if f.file == nil {
return nil
}
return f.file.Sync()
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"FlushAndSync",
"(",
")",
"error",
"{",
"if",
"f",
".",
"nosync",
"{",
"return",
"nil",
"\n",
"}",
"\n\n",
"if",
"f",
".",
"w",
"!=",
"nil",
"{",
"if",
"err",
":=",
"f",
".",
"w",
".",
"Flush",
"(",
")",... | // FlushAndSync flushes buffered data to disk and then fsyncs the underlying file.
// If the LogFile has disabled flushing and syncing then FlushAndSync is a no-op. | [
"FlushAndSync",
"flushes",
"buffered",
"data",
"to",
"disk",
"and",
"then",
"fsyncs",
"the",
"underlying",
"file",
".",
"If",
"the",
"LogFile",
"has",
"disabled",
"flushing",
"and",
"syncing",
"then",
"FlushAndSync",
"is",
"a",
"no",
"-",
"op",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L230-L245 |
123,532 | influxdata/influxdb | tsdb/tsi1/log_file.go | Stat | func (f *LogFile) Stat() (int64, time.Time) {
f.mu.RLock()
size, modTime := f.size, f.modTime
f.mu.RUnlock()
return size, modTime
} | go | func (f *LogFile) Stat() (int64, time.Time) {
f.mu.RLock()
size, modTime := f.size, f.modTime
f.mu.RUnlock()
return size, modTime
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"Stat",
"(",
")",
"(",
"int64",
",",
"time",
".",
"Time",
")",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"size",
",",
"modTime",
":=",
"f",
".",
"size",
",",
"f",
".",
"modTime",
"\n",
"f",
".... | // Stat returns size and last modification time of the file. | [
"Stat",
"returns",
"size",
"and",
"last",
"modification",
"time",
"of",
"the",
"file",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L268-L273 |
123,533 | influxdata/influxdb | tsdb/tsi1/log_file.go | Size | func (f *LogFile) Size() int64 {
f.mu.RLock()
v := f.size
f.mu.RUnlock()
return v
} | go | func (f *LogFile) Size() int64 {
f.mu.RLock()
v := f.size
f.mu.RUnlock()
return v
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"Size",
"(",
")",
"int64",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"v",
":=",
"f",
".",
"size",
"\n",
"f",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"v",
"\n",
"}"
] | // Size returns the size of the file, in bytes. | [
"Size",
"returns",
"the",
"size",
"of",
"the",
"file",
"in",
"bytes",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L286-L291 |
123,534 | influxdata/influxdb | tsdb/tsi1/log_file.go | MeasurementNames | func (f *LogFile) MeasurementNames() []string {
f.mu.RLock()
defer f.mu.RUnlock()
return f.measurementNames()
} | go | func (f *LogFile) MeasurementNames() []string {
f.mu.RLock()
defer f.mu.RUnlock()
return f.measurementNames()
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"MeasurementNames",
"(",
")",
"[",
"]",
"string",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"f",
".",
"measurementNames",
"(",
")",... | // MeasurementNames returns an ordered list of measurement names. | [
"MeasurementNames",
"returns",
"an",
"ordered",
"list",
"of",
"measurement",
"names",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L325-L329 |
123,535 | influxdata/influxdb | tsdb/tsi1/log_file.go | DeleteMeasurement | func (f *LogFile) DeleteMeasurement(name []byte) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntryMeasurementTombstoneFlag, Name: name}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
// Flush buffer and sync to disk.
return f.FlushAndSync()
} | go | func (f *LogFile) DeleteMeasurement(name []byte) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntryMeasurementTombstoneFlag, Name: name}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
// Flush buffer and sync to disk.
return f.FlushAndSync()
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"DeleteMeasurement",
"(",
"name",
"[",
"]",
"byte",
")",
"error",
"{",
"f",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n\n",
"e",
":=",
"LogEntry",
"{",
"Fl... | // DeleteMeasurement adds a tombstone for a measurement to the log file. | [
"DeleteMeasurement",
"adds",
"a",
"tombstone",
"for",
"a",
"measurement",
"to",
"the",
"log",
"file",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L341-L353 |
123,536 | influxdata/influxdb | tsdb/tsi1/log_file.go | TagKeySeriesIDIterator | func (f *LogFile) TagKeySeriesIDIterator(name, key []byte) tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
// Combine iterators across all tag keys.
itrs := make([]tsdb.SeriesIDIterator,... | go | func (f *LogFile) TagKeySeriesIDIterator(name, key []byte) tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
// Combine iterators across all tag keys.
itrs := make([]tsdb.SeriesIDIterator,... | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"TagKeySeriesIDIterator",
"(",
"name",
",",
"key",
"[",
"]",
"byte",
")",
"tsdb",
".",
"SeriesIDIterator",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"RUnlock",
"(",
")",
... | // TagKeySeriesIDIterator returns a series iterator for a tag key. | [
"TagKeySeriesIDIterator",
"returns",
"a",
"series",
"iterator",
"for",
"a",
"tag",
"key",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L356-L380 |
123,537 | influxdata/influxdb | tsdb/tsi1/log_file.go | TagKeyIterator | func (f *LogFile) TagKeyIterator(name []byte) TagKeyIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
a := make([]logTagKey, 0, len(mm.tagSet))
for _, k := range mm.tagSet {
a = append(a, k)
}
return newLogTagKeyIterator(a)
} | go | func (f *LogFile) TagKeyIterator(name []byte) TagKeyIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
a := make([]logTagKey, 0, len(mm.tagSet))
for _, k := range mm.tagSet {
a = append(a, k)
}
return newLogTagKeyIterator(a)
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"TagKeyIterator",
"(",
"name",
"[",
"]",
"byte",
")",
"TagKeyIterator",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n\n",
"mm",
",",
"ok",
":=",
... | // TagKeyIterator returns a value iterator for a measurement. | [
"TagKeyIterator",
"returns",
"a",
"value",
"iterator",
"for",
"a",
"measurement",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L383-L397 |
123,538 | influxdata/influxdb | tsdb/tsi1/log_file.go | TagValue | func (f *LogFile) TagValue(name, key, value []byte) TagValueElem {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
tv, ok := tk.tagValues[string(value)]
if !ok {
return nil
}
return &tv
} | go | func (f *LogFile) TagValue(name, key, value []byte) TagValueElem {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil
}
tv, ok := tk.tagValues[string(value)]
if !ok {
return nil
}
return &tv
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"TagValue",
"(",
"name",
",",
"key",
",",
"value",
"[",
"]",
"byte",
")",
"TagValueElem",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n\n",
"mm",... | // TagValue returns a tag value element. | [
"TagValue",
"returns",
"a",
"tag",
"value",
"element",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L418-L438 |
123,539 | influxdata/influxdb | tsdb/tsi1/log_file.go | DeleteTagKey | func (f *LogFile) DeleteTagKey(name, key []byte) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntryTagKeyTombstoneFlag, Name: name, Key: key}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
// Flush buffer and sync to disk.
return f.FlushAndSync()
} | go | func (f *LogFile) DeleteTagKey(name, key []byte) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntryTagKeyTombstoneFlag, Name: name, Key: key}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
// Flush buffer and sync to disk.
return f.FlushAndSync()
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"DeleteTagKey",
"(",
"name",
",",
"key",
"[",
"]",
"byte",
")",
"error",
"{",
"f",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n\n",
"e",
":=",
"LogEntry",
... | // DeleteTagKey adds a tombstone for a tag key to the log file. | [
"DeleteTagKey",
"adds",
"a",
"tombstone",
"for",
"a",
"tag",
"key",
"to",
"the",
"log",
"file",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L459-L471 |
123,540 | influxdata/influxdb | tsdb/tsi1/log_file.go | TagValueSeriesIDSet | func (f *LogFile) TagValueSeriesIDSet(name, key, value []byte) (*tsdb.SeriesIDSet, error) {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil, nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil, nil
}
tv, ok := tk.tagValues[string(value)]
if !ok {
return nil,... | go | func (f *LogFile) TagValueSeriesIDSet(name, key, value []byte) (*tsdb.SeriesIDSet, error) {
f.mu.RLock()
defer f.mu.RUnlock()
mm, ok := f.mms[string(name)]
if !ok {
return nil, nil
}
tk, ok := mm.tagSet[string(key)]
if !ok {
return nil, nil
}
tv, ok := tk.tagValues[string(value)]
if !ok {
return nil,... | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"TagValueSeriesIDSet",
"(",
"name",
",",
"key",
",",
"value",
"[",
"]",
"byte",
")",
"(",
"*",
"tsdb",
".",
"SeriesIDSet",
",",
"error",
")",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"f",
... | // TagValueSeriesIDSet returns a series iterator for a tag value. | [
"TagValueSeriesIDSet",
"returns",
"a",
"series",
"iterator",
"for",
"a",
"tag",
"value",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L474-L496 |
123,541 | influxdata/influxdb | tsdb/tsi1/log_file.go | MeasurementN | func (f *LogFile) MeasurementN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
return uint64(len(f.mms))
} | go | func (f *LogFile) MeasurementN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
return uint64(len(f.mms))
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"MeasurementN",
"(",
")",
"(",
"n",
"uint64",
")",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"uint64",
"(",
"len",
"(",
"f",
".... | // MeasurementN returns the total number of measurements. | [
"MeasurementN",
"returns",
"the",
"total",
"number",
"of",
"measurements",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L499-L503 |
123,542 | influxdata/influxdb | tsdb/tsi1/log_file.go | TagKeyN | func (f *LogFile) TagKeyN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
for _, mm := range f.mms {
n += uint64(len(mm.tagSet))
}
return n
} | go | func (f *LogFile) TagKeyN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
for _, mm := range f.mms {
n += uint64(len(mm.tagSet))
}
return n
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"TagKeyN",
"(",
")",
"(",
"n",
"uint64",
")",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n",
"for",
"_",
",",
"mm",
":=",
"range",
"f",
".",... | // TagKeyN returns the total number of keys. | [
"TagKeyN",
"returns",
"the",
"total",
"number",
"of",
"keys",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L506-L513 |
123,543 | influxdata/influxdb | tsdb/tsi1/log_file.go | TagValueN | func (f *LogFile) TagValueN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
for _, mm := range f.mms {
for _, k := range mm.tagSet {
n += uint64(len(k.tagValues))
}
}
return n
} | go | func (f *LogFile) TagValueN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
for _, mm := range f.mms {
for _, k := range mm.tagSet {
n += uint64(len(k.tagValues))
}
}
return n
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"TagValueN",
"(",
")",
"(",
"n",
"uint64",
")",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n",
"for",
"_",
",",
"mm",
":=",
"range",
"f",
".... | // TagValueN returns the total number of values. | [
"TagValueN",
"returns",
"the",
"total",
"number",
"of",
"values",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L516-L525 |
123,544 | influxdata/influxdb | tsdb/tsi1/log_file.go | DeleteTagValue | func (f *LogFile) DeleteTagValue(name, key, value []byte) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntryTagValueTombstoneFlag, Name: name, Key: key, Value: value}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
// Flush buffer and sync to disk.
return f.FlushAndS... | go | func (f *LogFile) DeleteTagValue(name, key, value []byte) error {
f.mu.Lock()
defer f.mu.Unlock()
e := LogEntry{Flag: LogEntryTagValueTombstoneFlag, Name: name, Key: key, Value: value}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
// Flush buffer and sync to disk.
return f.FlushAndS... | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"DeleteTagValue",
"(",
"name",
",",
"key",
",",
"value",
"[",
"]",
"byte",
")",
"error",
"{",
"f",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n\n",
"e",
"... | // DeleteTagValue adds a tombstone for a tag value to the log file. | [
"DeleteTagValue",
"adds",
"a",
"tombstone",
"for",
"a",
"tag",
"value",
"to",
"the",
"log",
"file",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L528-L540 |
123,545 | influxdata/influxdb | tsdb/tsi1/log_file.go | AddSeriesList | func (f *LogFile) AddSeriesList(seriesSet *tsdb.SeriesIDSet, collection *tsdb.SeriesCollection) ([]tsdb.SeriesID, error) {
var writeRequired bool
var entries []LogEntry
var i int // Track the index of the point in the batch
seriesSet.RLock()
for iter := collection.Iterator(); iter.Next(); {
seriesID := iter.Ser... | go | func (f *LogFile) AddSeriesList(seriesSet *tsdb.SeriesIDSet, collection *tsdb.SeriesCollection) ([]tsdb.SeriesID, error) {
var writeRequired bool
var entries []LogEntry
var i int // Track the index of the point in the batch
seriesSet.RLock()
for iter := collection.Iterator(); iter.Next(); {
seriesID := iter.Ser... | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"AddSeriesList",
"(",
"seriesSet",
"*",
"tsdb",
".",
"SeriesIDSet",
",",
"collection",
"*",
"tsdb",
".",
"SeriesCollection",
")",
"(",
"[",
"]",
"tsdb",
".",
"SeriesID",
",",
"error",
")",
"{",
"var",
"writeRequired... | // AddSeriesList adds a list of series to the log file in bulk. | [
"AddSeriesList",
"adds",
"a",
"list",
"of",
"series",
"to",
"the",
"log",
"file",
"in",
"bulk",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L543-L608 |
123,546 | influxdata/influxdb | tsdb/tsi1/log_file.go | DeleteSeriesIDList | func (f *LogFile) DeleteSeriesIDList(ids []tsdb.SeriesID) error {
f.mu.Lock()
defer f.mu.Unlock()
for _, id := range ids {
e := LogEntry{Flag: LogEntrySeriesTombstoneFlag, SeriesID: id}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
}
// Flush buffer and sync to disk.
return f... | go | func (f *LogFile) DeleteSeriesIDList(ids []tsdb.SeriesID) error {
f.mu.Lock()
defer f.mu.Unlock()
for _, id := range ids {
e := LogEntry{Flag: LogEntrySeriesTombstoneFlag, SeriesID: id}
if err := f.appendEntry(&e); err != nil {
return err
}
f.execEntry(&e)
}
// Flush buffer and sync to disk.
return f... | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"DeleteSeriesIDList",
"(",
"ids",
"[",
"]",
"tsdb",
".",
"SeriesID",
")",
"error",
"{",
"f",
".",
"mu",
".",
"Lock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"Unlock",
"(",
")",
"\n\n",
"for",
"_",
",... | // DeleteSeriesIDList marks a tombstone for all the series IDs. DeleteSeriesIDList
// should be preferred to repeatedly calling DeleteSeriesID for many series ids. | [
"DeleteSeriesIDList",
"marks",
"a",
"tombstone",
"for",
"all",
"the",
"series",
"IDs",
".",
"DeleteSeriesIDList",
"should",
"be",
"preferred",
"to",
"repeatedly",
"calling",
"DeleteSeriesID",
"for",
"many",
"series",
"ids",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L627-L641 |
123,547 | influxdata/influxdb | tsdb/tsi1/log_file.go | SeriesN | func (f *LogFile) SeriesN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
for _, mm := range f.mms {
n += uint64(mm.cardinality())
}
return n
} | go | func (f *LogFile) SeriesN() (n uint64) {
f.mu.RLock()
defer f.mu.RUnlock()
for _, mm := range f.mms {
n += uint64(mm.cardinality())
}
return n
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"SeriesN",
"(",
")",
"(",
"n",
"uint64",
")",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n\n",
"for",
"_",
",",
"mm",
":=",
"range",
"f",
".... | // SeriesN returns the total number of series in the file. | [
"SeriesN",
"returns",
"the",
"total",
"number",
"of",
"series",
"in",
"the",
"file",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L644-L652 |
123,548 | influxdata/influxdb | tsdb/tsi1/log_file.go | appendEntry | func (f *LogFile) appendEntry(e *LogEntry) error {
// Marshal entry to the local buffer.
f.buf = appendLogEntry(f.buf[:0], e)
// Save the size of the record.
e.Size = len(f.buf)
// Write record to file.
n, err := f.w.Write(f.buf)
if err != nil {
// Move position backwards over partial entry.
// Log should ... | go | func (f *LogFile) appendEntry(e *LogEntry) error {
// Marshal entry to the local buffer.
f.buf = appendLogEntry(f.buf[:0], e)
// Save the size of the record.
e.Size = len(f.buf)
// Write record to file.
n, err := f.w.Write(f.buf)
if err != nil {
// Move position backwards over partial entry.
// Log should ... | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"appendEntry",
"(",
"e",
"*",
"LogEntry",
")",
"error",
"{",
"// Marshal entry to the local buffer.",
"f",
".",
"buf",
"=",
"appendLogEntry",
"(",
"f",
".",
"buf",
"[",
":",
"0",
"]",
",",
"e",
")",
"\n\n",
"// Sa... | // appendEntry adds a log entry to the end of the file. | [
"appendEntry",
"adds",
"a",
"log",
"entry",
"to",
"the",
"end",
"of",
"the",
"file",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L655-L681 |
123,549 | influxdata/influxdb | tsdb/tsi1/log_file.go | execEntry | func (f *LogFile) execEntry(e *LogEntry) {
switch e.Flag {
case LogEntryMeasurementTombstoneFlag:
f.execDeleteMeasurementEntry(e)
case LogEntryTagKeyTombstoneFlag:
f.execDeleteTagKeyEntry(e)
case LogEntryTagValueTombstoneFlag:
f.execDeleteTagValueEntry(e)
default:
f.execSeriesEntry(e)
}
} | go | func (f *LogFile) execEntry(e *LogEntry) {
switch e.Flag {
case LogEntryMeasurementTombstoneFlag:
f.execDeleteMeasurementEntry(e)
case LogEntryTagKeyTombstoneFlag:
f.execDeleteTagKeyEntry(e)
case LogEntryTagValueTombstoneFlag:
f.execDeleteTagValueEntry(e)
default:
f.execSeriesEntry(e)
}
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"execEntry",
"(",
"e",
"*",
"LogEntry",
")",
"{",
"switch",
"e",
".",
"Flag",
"{",
"case",
"LogEntryMeasurementTombstoneFlag",
":",
"f",
".",
"execDeleteMeasurementEntry",
"(",
"e",
")",
"\n",
"case",
"LogEntryTagKeyTom... | // execEntry executes a log entry against the in-memory index.
// This is done after appending and on replay of the log. | [
"execEntry",
"executes",
"a",
"log",
"entry",
"against",
"the",
"in",
"-",
"memory",
"index",
".",
"This",
"is",
"done",
"after",
"appending",
"and",
"on",
"replay",
"of",
"the",
"log",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L685-L696 |
123,550 | influxdata/influxdb | tsdb/tsi1/log_file.go | SeriesIDIterator | func (f *LogFile) SeriesIDIterator() tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
ss := tsdb.NewSeriesIDSet()
allSeriesSets := make([]*tsdb.SeriesIDSet, 0, len(f.mms))
for _, mm := range f.mms {
if mm.seriesSet != nil {
allSeriesSets = append(allSeriesSets, mm.seriesSet)
continue
}
// m... | go | func (f *LogFile) SeriesIDIterator() tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
ss := tsdb.NewSeriesIDSet()
allSeriesSets := make([]*tsdb.SeriesIDSet, 0, len(f.mms))
for _, mm := range f.mms {
if mm.seriesSet != nil {
allSeriesSets = append(allSeriesSets, mm.seriesSet)
continue
}
// m... | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"SeriesIDIterator",
"(",
")",
"tsdb",
".",
"SeriesIDIterator",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n\n",
"ss",
":=",
"tsdb",
".",
"NewSeriesI... | // SeriesIDIterator returns an iterator over all series in the log file. | [
"SeriesIDIterator",
"returns",
"an",
"iterator",
"over",
"all",
"series",
"in",
"the",
"log",
"file",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L797-L822 |
123,551 | influxdata/influxdb | tsdb/tsi1/log_file.go | createMeasurementIfNotExists | func (f *LogFile) createMeasurementIfNotExists(name []byte) *logMeasurement {
mm := f.mms[string(name)]
if mm == nil {
mm = &logMeasurement{
name: name,
tagSet: make(map[string]logTagKey),
series: make(map[tsdb.SeriesID]struct{}),
}
f.mms[string(name)] = mm
}
return mm
} | go | func (f *LogFile) createMeasurementIfNotExists(name []byte) *logMeasurement {
mm := f.mms[string(name)]
if mm == nil {
mm = &logMeasurement{
name: name,
tagSet: make(map[string]logTagKey),
series: make(map[tsdb.SeriesID]struct{}),
}
f.mms[string(name)] = mm
}
return mm
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"createMeasurementIfNotExists",
"(",
"name",
"[",
"]",
"byte",
")",
"*",
"logMeasurement",
"{",
"mm",
":=",
"f",
".",
"mms",
"[",
"string",
"(",
"name",
")",
"]",
"\n",
"if",
"mm",
"==",
"nil",
"{",
"mm",
"=",... | // createMeasurementIfNotExists returns a measurement by name. | [
"createMeasurementIfNotExists",
"returns",
"a",
"measurement",
"by",
"name",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L825-L836 |
123,552 | influxdata/influxdb | tsdb/tsi1/log_file.go | MeasurementIterator | func (f *LogFile) MeasurementIterator() MeasurementIterator {
f.mu.RLock()
defer f.mu.RUnlock()
var itr logMeasurementIterator
for _, mm := range f.mms {
itr.mms = append(itr.mms, *mm)
}
sort.Sort(logMeasurementSlice(itr.mms))
return &itr
} | go | func (f *LogFile) MeasurementIterator() MeasurementIterator {
f.mu.RLock()
defer f.mu.RUnlock()
var itr logMeasurementIterator
for _, mm := range f.mms {
itr.mms = append(itr.mms, *mm)
}
sort.Sort(logMeasurementSlice(itr.mms))
return &itr
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"MeasurementIterator",
"(",
")",
"MeasurementIterator",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n\n",
"var",
"itr",
"logMeasurementIterator",
"\n",
"... | // MeasurementIterator returns an iterator over all the measurements in the file. | [
"MeasurementIterator",
"returns",
"an",
"iterator",
"over",
"all",
"the",
"measurements",
"in",
"the",
"file",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L839-L849 |
123,553 | influxdata/influxdb | tsdb/tsi1/log_file.go | MeasurementSeriesIDIterator | func (f *LogFile) MeasurementSeriesIDIterator(name []byte) tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm := f.mms[string(name)]
if mm == nil || mm.cardinality() == 0 {
return nil
}
return tsdb.NewSeriesIDSetIterator(mm.seriesIDSet())
} | go | func (f *LogFile) MeasurementSeriesIDIterator(name []byte) tsdb.SeriesIDIterator {
f.mu.RLock()
defer f.mu.RUnlock()
mm := f.mms[string(name)]
if mm == nil || mm.cardinality() == 0 {
return nil
}
return tsdb.NewSeriesIDSetIterator(mm.seriesIDSet())
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"MeasurementSeriesIDIterator",
"(",
"name",
"[",
"]",
"byte",
")",
"tsdb",
".",
"SeriesIDIterator",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n\n",
... | // MeasurementSeriesIDIterator returns an iterator over all series for a measurement. | [
"MeasurementSeriesIDIterator",
"returns",
"an",
"iterator",
"over",
"all",
"series",
"for",
"a",
"measurement",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L852-L861 |
123,554 | influxdata/influxdb | tsdb/tsi1/log_file.go | CompactTo | func (f *LogFile) CompactTo(w io.Writer, m, k uint64, cancel <-chan struct{}) (n int64, err error) {
f.mu.RLock()
defer f.mu.RUnlock()
// Check for cancellation.
select {
case <-cancel:
return n, ErrCompactionInterrupted
default:
}
// Wrap in bufferred writer with a buffer equivalent to the LogFile size.
b... | go | func (f *LogFile) CompactTo(w io.Writer, m, k uint64, cancel <-chan struct{}) (n int64, err error) {
f.mu.RLock()
defer f.mu.RUnlock()
// Check for cancellation.
select {
case <-cancel:
return n, ErrCompactionInterrupted
default:
}
// Wrap in bufferred writer with a buffer equivalent to the LogFile size.
b... | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"CompactTo",
"(",
"w",
"io",
".",
"Writer",
",",
"m",
",",
"k",
"uint64",
",",
"cancel",
"<-",
"chan",
"struct",
"{",
"}",
")",
"(",
"n",
"int64",
",",
"err",
"error",
")",
"{",
"f",
".",
"mu",
".",
"RLo... | // CompactTo compacts the log file and writes it to w. | [
"CompactTo",
"compacts",
"the",
"log",
"file",
"and",
"writes",
"it",
"to",
"w",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L864-L937 |
123,555 | influxdata/influxdb | tsdb/tsi1/log_file.go | MeasurementCardinalityStats | func (f *LogFile) MeasurementCardinalityStats() MeasurementCardinalityStats {
f.mu.RLock()
defer f.mu.RUnlock()
return f.stats.Clone()
} | go | func (f *LogFile) MeasurementCardinalityStats() MeasurementCardinalityStats {
f.mu.RLock()
defer f.mu.RUnlock()
return f.stats.Clone()
} | [
"func",
"(",
"f",
"*",
"LogFile",
")",
"MeasurementCardinalityStats",
"(",
")",
"MeasurementCardinalityStats",
"{",
"f",
".",
"mu",
".",
"RLock",
"(",
")",
"\n",
"defer",
"f",
".",
"mu",
".",
"RUnlock",
"(",
")",
"\n",
"return",
"f",
".",
"stats",
".",... | // MeasurementCardinalityStats returns cardinality stats for this log file. | [
"MeasurementCardinalityStats",
"returns",
"cardinality",
"stats",
"for",
"this",
"log",
"file",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L1057-L1061 |
123,556 | influxdata/influxdb | tsdb/tsi1/log_file.go | appendLogEntry | func appendLogEntry(dst []byte, e *LogEntry) []byte {
var buf [binary.MaxVarintLen64]byte
start := len(dst)
// Append flag.
dst = append(dst, e.Flag)
// Append series id.
n := binary.PutUvarint(buf[:], e.SeriesID.RawID())
dst = append(dst, buf[:n]...)
// Append name.
n = binary.PutUvarint(buf[:], uint64(len... | go | func appendLogEntry(dst []byte, e *LogEntry) []byte {
var buf [binary.MaxVarintLen64]byte
start := len(dst)
// Append flag.
dst = append(dst, e.Flag)
// Append series id.
n := binary.PutUvarint(buf[:], e.SeriesID.RawID())
dst = append(dst, buf[:n]...)
// Append name.
n = binary.PutUvarint(buf[:], uint64(len... | [
"func",
"appendLogEntry",
"(",
"dst",
"[",
"]",
"byte",
",",
"e",
"*",
"LogEntry",
")",
"[",
"]",
"byte",
"{",
"var",
"buf",
"[",
"binary",
".",
"MaxVarintLen64",
"]",
"byte",
"\n",
"start",
":=",
"len",
"(",
"dst",
")",
"\n\n",
"// Append flag.",
"d... | // appendLogEntry appends to dst and returns the new buffer.
// This updates the checksum on the entry. | [
"appendLogEntry",
"appends",
"to",
"dst",
"and",
"returns",
"the",
"new",
"buffer",
".",
"This",
"updates",
"the",
"checksum",
"on",
"the",
"entry",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L1156-L1190 |
123,557 | influxdata/influxdb | tsdb/tsi1/log_file.go | bytes | func (mms *logMeasurements) bytes() int {
var b int
for k, v := range *mms {
b += len(k)
b += v.bytes()
}
b += int(unsafe.Sizeof(*mms))
return b
} | go | func (mms *logMeasurements) bytes() int {
var b int
for k, v := range *mms {
b += len(k)
b += v.bytes()
}
b += int(unsafe.Sizeof(*mms))
return b
} | [
"func",
"(",
"mms",
"*",
"logMeasurements",
")",
"bytes",
"(",
")",
"int",
"{",
"var",
"b",
"int",
"\n",
"for",
"k",
",",
"v",
":=",
"range",
"*",
"mms",
"{",
"b",
"+=",
"len",
"(",
"k",
")",
"\n",
"b",
"+=",
"v",
".",
"bytes",
"(",
")",
"\... | // bytes estimates the memory footprint of this logMeasurements, in bytes. | [
"bytes",
"estimates",
"the",
"memory",
"footprint",
"of",
"this",
"logMeasurements",
"in",
"bytes",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L1196-L1204 |
123,558 | influxdata/influxdb | tsdb/tsi1/log_file.go | bytes | func (m *logMeasurement) bytes() int {
var b int
b += len(m.name)
for k, v := range m.tagSet {
b += len(k)
b += v.bytes()
}
b += (int(m.cardinality()) * 8)
b += int(unsafe.Sizeof(*m))
return b
} | go | func (m *logMeasurement) bytes() int {
var b int
b += len(m.name)
for k, v := range m.tagSet {
b += len(k)
b += v.bytes()
}
b += (int(m.cardinality()) * 8)
b += int(unsafe.Sizeof(*m))
return b
} | [
"func",
"(",
"m",
"*",
"logMeasurement",
")",
"bytes",
"(",
")",
"int",
"{",
"var",
"b",
"int",
"\n",
"b",
"+=",
"len",
"(",
"m",
".",
"name",
")",
"\n",
"for",
"k",
",",
"v",
":=",
"range",
"m",
".",
"tagSet",
"{",
"b",
"+=",
"len",
"(",
"... | // bytes estimates the memory footprint of this logMeasurement, in bytes. | [
"bytes",
"estimates",
"the",
"memory",
"footprint",
"of",
"this",
"logMeasurement",
"in",
"bytes",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L1215-L1225 |
123,559 | influxdata/influxdb | tsdb/tsi1/log_file.go | forEach | func (m *logMeasurement) forEach(fn func(tsdb.SeriesID)) {
if m.seriesSet != nil {
m.seriesSet.ForEachNoLock(fn)
return
}
for seriesID := range m.series {
fn(seriesID)
}
} | go | func (m *logMeasurement) forEach(fn func(tsdb.SeriesID)) {
if m.seriesSet != nil {
m.seriesSet.ForEachNoLock(fn)
return
}
for seriesID := range m.series {
fn(seriesID)
}
} | [
"func",
"(",
"m",
"*",
"logMeasurement",
")",
"forEach",
"(",
"fn",
"func",
"(",
"tsdb",
".",
"SeriesID",
")",
")",
"{",
"if",
"m",
".",
"seriesSet",
"!=",
"nil",
"{",
"m",
".",
"seriesSet",
".",
"ForEachNoLock",
"(",
"fn",
")",
"\n",
"return",
"\n... | // forEach applies fn to every series ID in the logMeasurement. | [
"forEach",
"applies",
"fn",
"to",
"every",
"series",
"ID",
"in",
"the",
"logMeasurement",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L1261-L1270 |
123,560 | influxdata/influxdb | tsdb/tsi1/log_file.go | seriesIDs | func (m *logMeasurement) seriesIDs() []tsdb.SeriesID {
a := make([]tsdb.SeriesID, 0, m.cardinality())
if m.seriesSet != nil {
m.seriesSet.ForEachNoLock(func(id tsdb.SeriesID) { a = append(a, id) })
return a // IDs are already sorted.
}
for seriesID := range m.series {
a = append(a, seriesID)
}
sort.Slice(a... | go | func (m *logMeasurement) seriesIDs() []tsdb.SeriesID {
a := make([]tsdb.SeriesID, 0, m.cardinality())
if m.seriesSet != nil {
m.seriesSet.ForEachNoLock(func(id tsdb.SeriesID) { a = append(a, id) })
return a // IDs are already sorted.
}
for seriesID := range m.series {
a = append(a, seriesID)
}
sort.Slice(a... | [
"func",
"(",
"m",
"*",
"logMeasurement",
")",
"seriesIDs",
"(",
")",
"[",
"]",
"tsdb",
".",
"SeriesID",
"{",
"a",
":=",
"make",
"(",
"[",
"]",
"tsdb",
".",
"SeriesID",
",",
"0",
",",
"m",
".",
"cardinality",
"(",
")",
")",
"\n",
"if",
"m",
".",... | // seriesIDs returns a sorted set of seriesIDs. | [
"seriesIDs",
"returns",
"a",
"sorted",
"set",
"of",
"seriesIDs",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L1273-L1285 |
123,561 | influxdata/influxdb | tsdb/tsi1/log_file.go | keys | func (m *logMeasurement) keys() []string {
a := make([]string, 0, len(m.tagSet))
for k := range m.tagSet {
a = append(a, k)
}
sort.Strings(a)
return a
} | go | func (m *logMeasurement) keys() []string {
a := make([]string, 0, len(m.tagSet))
for k := range m.tagSet {
a = append(a, k)
}
sort.Strings(a)
return a
} | [
"func",
"(",
"m",
"*",
"logMeasurement",
")",
"keys",
"(",
")",
"[",
"]",
"string",
"{",
"a",
":=",
"make",
"(",
"[",
"]",
"string",
",",
"0",
",",
"len",
"(",
"m",
".",
"tagSet",
")",
")",
"\n",
"for",
"k",
":=",
"range",
"m",
".",
"tagSet",... | // keys returns a sorted list of tag keys. | [
"keys",
"returns",
"a",
"sorted",
"list",
"of",
"tag",
"keys",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L1313-L1320 |
123,562 | influxdata/influxdb | tsdb/tsi1/log_file.go | bytes | func (tk *logTagKey) bytes() int {
var b int
b += len(tk.name)
for k, v := range tk.tagValues {
b += len(k)
b += v.bytes()
}
b += int(unsafe.Sizeof(*tk))
return b
} | go | func (tk *logTagKey) bytes() int {
var b int
b += len(tk.name)
for k, v := range tk.tagValues {
b += len(k)
b += v.bytes()
}
b += int(unsafe.Sizeof(*tk))
return b
} | [
"func",
"(",
"tk",
"*",
"logTagKey",
")",
"bytes",
"(",
")",
"int",
"{",
"var",
"b",
"int",
"\n",
"b",
"+=",
"len",
"(",
"tk",
".",
"name",
")",
"\n",
"for",
"k",
",",
"v",
":=",
"range",
"tk",
".",
"tagValues",
"{",
"b",
"+=",
"len",
"(",
... | // bytes estimates the memory footprint of this logTagKey, in bytes. | [
"bytes",
"estimates",
"the",
"memory",
"footprint",
"of",
"this",
"logTagKey",
"in",
"bytes",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L1350-L1359 |
123,563 | influxdata/influxdb | tsdb/tsi1/log_file.go | bytes | func (tv *logTagValue) bytes() int {
var b int
b += len(tv.name)
b += int(unsafe.Sizeof(*tv))
b += (int(tv.cardinality()) * 8)
return b
} | go | func (tv *logTagValue) bytes() int {
var b int
b += len(tv.name)
b += int(unsafe.Sizeof(*tv))
b += (int(tv.cardinality()) * 8)
return b
} | [
"func",
"(",
"tv",
"*",
"logTagValue",
")",
"bytes",
"(",
")",
"int",
"{",
"var",
"b",
"int",
"\n",
"b",
"+=",
"len",
"(",
"tv",
".",
"name",
")",
"\n",
"b",
"+=",
"int",
"(",
"unsafe",
".",
"Sizeof",
"(",
"*",
"tv",
")",
")",
"\n",
"b",
"+... | // bytes estimates the memory footprint of this logTagValue, in bytes. | [
"bytes",
"estimates",
"the",
"memory",
"footprint",
"of",
"this",
"logTagValue",
"in",
"bytes",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L1395-L1401 |
123,564 | influxdata/influxdb | tsdb/tsi1/log_file.go | newLogTagKeyIterator | func newLogTagKeyIterator(a []logTagKey) *logTagKeyIterator {
sort.Sort(logTagKeySlice(a))
return &logTagKeyIterator{a: a}
} | go | func newLogTagKeyIterator(a []logTagKey) *logTagKeyIterator {
sort.Sort(logTagKeySlice(a))
return &logTagKeyIterator{a: a}
} | [
"func",
"newLogTagKeyIterator",
"(",
"a",
"[",
"]",
"logTagKey",
")",
"*",
"logTagKeyIterator",
"{",
"sort",
".",
"Sort",
"(",
"logTagKeySlice",
"(",
"a",
")",
")",
"\n",
"return",
"&",
"logTagKeyIterator",
"{",
"a",
":",
"a",
"}",
"\n",
"}"
] | // newLogTagKeyIterator returns a new instance of logTagKeyIterator. | [
"newLogTagKeyIterator",
"returns",
"a",
"new",
"instance",
"of",
"logTagKeyIterator",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L1466-L1469 |
123,565 | influxdata/influxdb | tsdb/tsi1/log_file.go | newLogTagValueIterator | func newLogTagValueIterator(a []logTagValue) *logTagValueIterator {
sort.Sort(logTagValueSlice(a))
return &logTagValueIterator{a: a}
} | go | func newLogTagValueIterator(a []logTagValue) *logTagValueIterator {
sort.Sort(logTagValueSlice(a))
return &logTagValueIterator{a: a}
} | [
"func",
"newLogTagValueIterator",
"(",
"a",
"[",
"]",
"logTagValue",
")",
"*",
"logTagValueIterator",
"{",
"sort",
".",
"Sort",
"(",
"logTagValueSlice",
"(",
"a",
")",
")",
"\n",
"return",
"&",
"logTagValueIterator",
"{",
"a",
":",
"a",
"}",
"\n",
"}"
] | // newLogTagValueIterator returns a new instance of logTagValueIterator. | [
"newLogTagValueIterator",
"returns",
"a",
"new",
"instance",
"of",
"logTagValueIterator",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/log_file.go#L1486-L1489 |
123,566 | influxdata/influxdb | inmem/dashboard.go | CreateDashboard | func (s *Service) CreateDashboard(ctx context.Context, d *platform.Dashboard) error {
d.ID = s.IDGenerator.ID()
d.Meta.CreatedAt = s.time()
err := s.PutDashboardWithMeta(ctx, d)
if err != nil {
return &platform.Error{
Err: err,
Op: platform.OpCreateDashboard,
}
}
return nil
} | go | func (s *Service) CreateDashboard(ctx context.Context, d *platform.Dashboard) error {
d.ID = s.IDGenerator.ID()
d.Meta.CreatedAt = s.time()
err := s.PutDashboardWithMeta(ctx, d)
if err != nil {
return &platform.Error{
Err: err,
Op: platform.OpCreateDashboard,
}
}
return nil
} | [
"func",
"(",
"s",
"*",
"Service",
")",
"CreateDashboard",
"(",
"ctx",
"context",
".",
"Context",
",",
"d",
"*",
"platform",
".",
"Dashboard",
")",
"error",
"{",
"d",
".",
"ID",
"=",
"s",
".",
"IDGenerator",
".",
"ID",
"(",
")",
"\n",
"d",
".",
"M... | // CreateDashboard implements platform.DashboardService interface. | [
"CreateDashboard",
"implements",
"platform",
".",
"DashboardService",
"interface",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/inmem/dashboard.go#L130-L141 |
123,567 | influxdata/influxdb | inmem/dashboard.go | PutDashboard | func (s *Service) PutDashboard(ctx context.Context, d *platform.Dashboard) error {
for _, cell := range d.Cells {
if err := s.PutCellView(ctx, cell); err != nil {
return err
}
}
s.dashboardKV.Store(d.ID.String(), d)
return nil
} | go | func (s *Service) PutDashboard(ctx context.Context, d *platform.Dashboard) error {
for _, cell := range d.Cells {
if err := s.PutCellView(ctx, cell); err != nil {
return err
}
}
s.dashboardKV.Store(d.ID.String(), d)
return nil
} | [
"func",
"(",
"s",
"*",
"Service",
")",
"PutDashboard",
"(",
"ctx",
"context",
".",
"Context",
",",
"d",
"*",
"platform",
".",
"Dashboard",
")",
"error",
"{",
"for",
"_",
",",
"cell",
":=",
"range",
"d",
".",
"Cells",
"{",
"if",
"err",
":=",
"s",
... | // PutDashboard implements platform.DashboardService interface. | [
"PutDashboard",
"implements",
"platform",
".",
"DashboardService",
"interface",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/inmem/dashboard.go#L144-L152 |
123,568 | influxdata/influxdb | inmem/dashboard.go | PutCellView | func (s *Service) PutCellView(ctx context.Context, cell *platform.Cell) error {
v := &platform.View{}
v.ID = cell.ID
return s.PutView(ctx, v)
} | go | func (s *Service) PutCellView(ctx context.Context, cell *platform.Cell) error {
v := &platform.View{}
v.ID = cell.ID
return s.PutView(ctx, v)
} | [
"func",
"(",
"s",
"*",
"Service",
")",
"PutCellView",
"(",
"ctx",
"context",
".",
"Context",
",",
"cell",
"*",
"platform",
".",
"Cell",
")",
"error",
"{",
"v",
":=",
"&",
"platform",
".",
"View",
"{",
"}",
"\n",
"v",
".",
"ID",
"=",
"cell",
".",
... | // PutCellView puts the view for a cell. | [
"PutCellView",
"puts",
"the",
"view",
"for",
"a",
"cell",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/inmem/dashboard.go#L155-L159 |
123,569 | influxdata/influxdb | inmem/dashboard.go | PutDashboardWithMeta | func (s *Service) PutDashboardWithMeta(ctx context.Context, d *platform.Dashboard) error {
d.Meta.UpdatedAt = s.time()
return s.PutDashboard(ctx, d)
} | go | func (s *Service) PutDashboardWithMeta(ctx context.Context, d *platform.Dashboard) error {
d.Meta.UpdatedAt = s.time()
return s.PutDashboard(ctx, d)
} | [
"func",
"(",
"s",
"*",
"Service",
")",
"PutDashboardWithMeta",
"(",
"ctx",
"context",
".",
"Context",
",",
"d",
"*",
"platform",
".",
"Dashboard",
")",
"error",
"{",
"d",
".",
"Meta",
".",
"UpdatedAt",
"=",
"s",
".",
"time",
"(",
")",
"\n",
"return",... | // PutDashboardWithMeta sets a dashboard while updating the meta field of a dashboard. | [
"PutDashboardWithMeta",
"sets",
"a",
"dashboard",
"while",
"updating",
"the",
"meta",
"field",
"of",
"a",
"dashboard",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/inmem/dashboard.go#L162-L165 |
123,570 | influxdata/influxdb | inmem/dashboard.go | UpdateDashboard | func (s *Service) UpdateDashboard(ctx context.Context, id platform.ID, upd platform.DashboardUpdate) (*platform.Dashboard, error) {
op := OpPrefix + platform.OpUpdateDashboard
if err := upd.Valid(); err != nil {
return nil, &platform.Error{
Err: err,
Op: op,
}
}
d, err := s.FindDashboardByID(ctx, id)
i... | go | func (s *Service) UpdateDashboard(ctx context.Context, id platform.ID, upd platform.DashboardUpdate) (*platform.Dashboard, error) {
op := OpPrefix + platform.OpUpdateDashboard
if err := upd.Valid(); err != nil {
return nil, &platform.Error{
Err: err,
Op: op,
}
}
d, err := s.FindDashboardByID(ctx, id)
i... | [
"func",
"(",
"s",
"*",
"Service",
")",
"UpdateDashboard",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"platform",
".",
"ID",
",",
"upd",
"platform",
".",
"DashboardUpdate",
")",
"(",
"*",
"platform",
".",
"Dashboard",
",",
"error",
")",
"{",
"op"... | // UpdateDashboard implements platform.DashboardService interface. | [
"UpdateDashboard",
"implements",
"platform",
".",
"DashboardService",
"interface",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/inmem/dashboard.go#L168-L200 |
123,571 | influxdata/influxdb | inmem/dashboard.go | AddDashboardCell | func (s *Service) AddDashboardCell(ctx context.Context, id platform.ID, cell *platform.Cell, opts platform.AddDashboardCellOptions) error {
op := OpPrefix + platform.OpAddDashboardCell
d, err := s.FindDashboardByID(ctx, id)
if err != nil {
return &platform.Error{
Err: err,
Op: op,
}
}
cell.ID = s.IDGene... | go | func (s *Service) AddDashboardCell(ctx context.Context, id platform.ID, cell *platform.Cell, opts platform.AddDashboardCellOptions) error {
op := OpPrefix + platform.OpAddDashboardCell
d, err := s.FindDashboardByID(ctx, id)
if err != nil {
return &platform.Error{
Err: err,
Op: op,
}
}
cell.ID = s.IDGene... | [
"func",
"(",
"s",
"*",
"Service",
")",
"AddDashboardCell",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"platform",
".",
"ID",
",",
"cell",
"*",
"platform",
".",
"Cell",
",",
"opts",
"platform",
".",
"AddDashboardCellOptions",
")",
"error",
"{",
"op... | // AddDashboardCell adds a new cell to the dashboard. | [
"AddDashboardCell",
"adds",
"a",
"new",
"cell",
"to",
"the",
"dashboard",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/inmem/dashboard.go#L223-L248 |
123,572 | influxdata/influxdb | inmem/dashboard.go | PutDashboardCell | func (s *Service) PutDashboardCell(ctx context.Context, id platform.ID, cell *platform.Cell) error {
d, err := s.FindDashboardByID(ctx, id)
if err != nil {
return err
}
view := &platform.View{}
view.ID = cell.ID
if err := s.PutView(ctx, view); err != nil {
return err
}
d.Cells = append(d.Cells, cell)
retu... | go | func (s *Service) PutDashboardCell(ctx context.Context, id platform.ID, cell *platform.Cell) error {
d, err := s.FindDashboardByID(ctx, id)
if err != nil {
return err
}
view := &platform.View{}
view.ID = cell.ID
if err := s.PutView(ctx, view); err != nil {
return err
}
d.Cells = append(d.Cells, cell)
retu... | [
"func",
"(",
"s",
"*",
"Service",
")",
"PutDashboardCell",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"platform",
".",
"ID",
",",
"cell",
"*",
"platform",
".",
"Cell",
")",
"error",
"{",
"d",
",",
"err",
":=",
"s",
".",
"FindDashboardByID",
"(... | // PutDashboardCell replaces a dashboard cell with the cell contents. | [
"PutDashboardCell",
"replaces",
"a",
"dashboard",
"cell",
"with",
"the",
"cell",
"contents",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/inmem/dashboard.go#L264-L277 |
123,573 | influxdata/influxdb | inmem/dashboard.go | RemoveDashboardCell | func (s *Service) RemoveDashboardCell(ctx context.Context, dashboardID platform.ID, cellID platform.ID) error {
op := OpPrefix + platform.OpRemoveDashboardCell
d, err := s.FindDashboardByID(ctx, dashboardID)
if err != nil {
return &platform.Error{
Err: err,
Op: op,
}
}
idx := -1
for i, cell := range d... | go | func (s *Service) RemoveDashboardCell(ctx context.Context, dashboardID platform.ID, cellID platform.ID) error {
op := OpPrefix + platform.OpRemoveDashboardCell
d, err := s.FindDashboardByID(ctx, dashboardID)
if err != nil {
return &platform.Error{
Err: err,
Op: op,
}
}
idx := -1
for i, cell := range d... | [
"func",
"(",
"s",
"*",
"Service",
")",
"RemoveDashboardCell",
"(",
"ctx",
"context",
".",
"Context",
",",
"dashboardID",
"platform",
".",
"ID",
",",
"cellID",
"platform",
".",
"ID",
")",
"error",
"{",
"op",
":=",
"OpPrefix",
"+",
"platform",
".",
"OpRemo... | // RemoveDashboardCell removes a dashboard cell from the dashboard. | [
"RemoveDashboardCell",
"removes",
"a",
"dashboard",
"cell",
"from",
"the",
"dashboard",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/inmem/dashboard.go#L280-L315 |
123,574 | influxdata/influxdb | inmem/dashboard.go | UpdateDashboardCell | func (s *Service) UpdateDashboardCell(ctx context.Context, dashboardID platform.ID, cellID platform.ID, upd platform.CellUpdate) (*platform.Cell, error) {
op := OpPrefix + platform.OpUpdateDashboardCell
if err := upd.Valid(); err != nil {
return nil, &platform.Error{
Err: err,
Op: op,
}
}
d, err := s.Fin... | go | func (s *Service) UpdateDashboardCell(ctx context.Context, dashboardID platform.ID, cellID platform.ID, upd platform.CellUpdate) (*platform.Cell, error) {
op := OpPrefix + platform.OpUpdateDashboardCell
if err := upd.Valid(); err != nil {
return nil, &platform.Error{
Err: err,
Op: op,
}
}
d, err := s.Fin... | [
"func",
"(",
"s",
"*",
"Service",
")",
"UpdateDashboardCell",
"(",
"ctx",
"context",
".",
"Context",
",",
"dashboardID",
"platform",
".",
"ID",
",",
"cellID",
"platform",
".",
"ID",
",",
"upd",
"platform",
".",
"CellUpdate",
")",
"(",
"*",
"platform",
".... | // UpdateDashboardCell will remove a cell from a dashboard. | [
"UpdateDashboardCell",
"will",
"remove",
"a",
"cell",
"from",
"a",
"dashboard",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/inmem/dashboard.go#L318-L366 |
123,575 | influxdata/influxdb | inmem/dashboard.go | ReplaceDashboardCells | func (s *Service) ReplaceDashboardCells(ctx context.Context, id platform.ID, cs []*platform.Cell) error {
op := OpPrefix + platform.OpReplaceDashboardCells
d, err := s.FindDashboardByID(ctx, id)
if err != nil {
return &platform.Error{
Err: err,
Op: op,
}
}
ids := map[string]*platform.Cell{}
for _, cel... | go | func (s *Service) ReplaceDashboardCells(ctx context.Context, id platform.ID, cs []*platform.Cell) error {
op := OpPrefix + platform.OpReplaceDashboardCells
d, err := s.FindDashboardByID(ctx, id)
if err != nil {
return &platform.Error{
Err: err,
Op: op,
}
}
ids := map[string]*platform.Cell{}
for _, cel... | [
"func",
"(",
"s",
"*",
"Service",
")",
"ReplaceDashboardCells",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"platform",
".",
"ID",
",",
"cs",
"[",
"]",
"*",
"platform",
".",
"Cell",
")",
"error",
"{",
"op",
":=",
"OpPrefix",
"+",
"platform",
".... | // ReplaceDashboardCells replaces many dashboard cells. | [
"ReplaceDashboardCells",
"replaces",
"many",
"dashboard",
"cells",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/inmem/dashboard.go#L369-L405 |
123,576 | influxdata/influxdb | inmem/dashboard.go | PutView | func (s *Service) PutView(ctx context.Context, c *platform.View) error {
if c.Properties == nil {
c.Properties = platform.EmptyViewProperties{}
}
s.viewKV.Store(c.ID.String(), c)
return nil
} | go | func (s *Service) PutView(ctx context.Context, c *platform.View) error {
if c.Properties == nil {
c.Properties = platform.EmptyViewProperties{}
}
s.viewKV.Store(c.ID.String(), c)
return nil
} | [
"func",
"(",
"s",
"*",
"Service",
")",
"PutView",
"(",
"ctx",
"context",
".",
"Context",
",",
"c",
"*",
"platform",
".",
"View",
")",
"error",
"{",
"if",
"c",
".",
"Properties",
"==",
"nil",
"{",
"c",
".",
"Properties",
"=",
"platform",
".",
"Empty... | // PutView sets view with the current ID. | [
"PutView",
"sets",
"view",
"with",
"the",
"current",
"ID",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/inmem/dashboard.go#L478-L484 |
123,577 | influxdata/influxdb | inmem/dashboard.go | DeleteView | func (s *Service) DeleteView(ctx context.Context, id platform.ID) error {
if _, err := s.FindViewByID(ctx, id); err != nil {
return err
}
s.viewKV.Delete(id.String())
return nil
} | go | func (s *Service) DeleteView(ctx context.Context, id platform.ID) error {
if _, err := s.FindViewByID(ctx, id); err != nil {
return err
}
s.viewKV.Delete(id.String())
return nil
} | [
"func",
"(",
"s",
"*",
"Service",
")",
"DeleteView",
"(",
"ctx",
"context",
".",
"Context",
",",
"id",
"platform",
".",
"ID",
")",
"error",
"{",
"if",
"_",
",",
"err",
":=",
"s",
".",
"FindViewByID",
"(",
"ctx",
",",
"id",
")",
";",
"err",
"!=",
... | // DeleteView removes a view by ID. | [
"DeleteView",
"removes",
"a",
"view",
"by",
"ID",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/inmem/dashboard.go#L487-L494 |
123,578 | influxdata/influxdb | tsdb/tsi1/tag_block.go | UnmarshalBinary | func (blk *TagBlock) UnmarshalBinary(data []byte) error {
// Read trailer.
t, err := ReadTagBlockTrailer(data)
if err != nil {
return err
}
// Verify data size is correct.
if int64(len(data)) != t.Size {
return ErrTagBlockSizeMismatch
}
// Save data section.
blk.valueData = data[t.ValueData.Offset:]
blk... | go | func (blk *TagBlock) UnmarshalBinary(data []byte) error {
// Read trailer.
t, err := ReadTagBlockTrailer(data)
if err != nil {
return err
}
// Verify data size is correct.
if int64(len(data)) != t.Size {
return ErrTagBlockSizeMismatch
}
// Save data section.
blk.valueData = data[t.ValueData.Offset:]
blk... | [
"func",
"(",
"blk",
"*",
"TagBlock",
")",
"UnmarshalBinary",
"(",
"data",
"[",
"]",
"byte",
")",
"error",
"{",
"// Read trailer.",
"t",
",",
"err",
":=",
"ReadTagBlockTrailer",
"(",
"data",
")",
"\n",
"if",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n... | // UnmarshalBinary unpacks data into the tag block. Tag block is not copied so data
// should be retained and unchanged after being passed into this function. | [
"UnmarshalBinary",
"unpacks",
"data",
"into",
"the",
"tag",
"block",
".",
"Tag",
"block",
"is",
"not",
"copied",
"so",
"data",
"should",
"be",
"retained",
"and",
"unchanged",
"after",
"being",
"passed",
"into",
"this",
"function",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L62-L90 |
123,579 | influxdata/influxdb | tsdb/tsi1/tag_block.go | TagKeyElem | func (blk *TagBlock) TagKeyElem(key []byte) TagKeyElem {
var elem TagBlockKeyElem
if !blk.DecodeTagKeyElem(key, &elem) {
return nil
}
return &elem
} | go | func (blk *TagBlock) TagKeyElem(key []byte) TagKeyElem {
var elem TagBlockKeyElem
if !blk.DecodeTagKeyElem(key, &elem) {
return nil
}
return &elem
} | [
"func",
"(",
"blk",
"*",
"TagBlock",
")",
"TagKeyElem",
"(",
"key",
"[",
"]",
"byte",
")",
"TagKeyElem",
"{",
"var",
"elem",
"TagBlockKeyElem",
"\n",
"if",
"!",
"blk",
".",
"DecodeTagKeyElem",
"(",
"key",
",",
"&",
"elem",
")",
"{",
"return",
"nil",
... | // TagKeyElem returns an element for a tag key.
// Returns an element with a nil key if not found. | [
"TagKeyElem",
"returns",
"an",
"element",
"for",
"a",
"tag",
"key",
".",
"Returns",
"an",
"element",
"with",
"a",
"nil",
"key",
"if",
"not",
"found",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L94-L100 |
123,580 | influxdata/influxdb | tsdb/tsi1/tag_block.go | TagValueElem | func (blk *TagBlock) TagValueElem(key, value []byte) TagValueElem {
var valueElem TagBlockValueElem
if !blk.DecodeTagValueElem(key, value, &valueElem) {
return nil
}
return &valueElem
} | go | func (blk *TagBlock) TagValueElem(key, value []byte) TagValueElem {
var valueElem TagBlockValueElem
if !blk.DecodeTagValueElem(key, value, &valueElem) {
return nil
}
return &valueElem
} | [
"func",
"(",
"blk",
"*",
"TagBlock",
")",
"TagValueElem",
"(",
"key",
",",
"value",
"[",
"]",
"byte",
")",
"TagValueElem",
"{",
"var",
"valueElem",
"TagBlockValueElem",
"\n",
"if",
"!",
"blk",
".",
"DecodeTagValueElem",
"(",
"key",
",",
"value",
",",
"&"... | // TagValueElem returns an element for a tag value. | [
"TagValueElem",
"returns",
"an",
"element",
"for",
"a",
"tag",
"value",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L140-L146 |
123,581 | influxdata/influxdb | tsdb/tsi1/tag_block.go | DecodeTagValueElem | func (blk *TagBlock) DecodeTagValueElem(key, value []byte, valueElem *TagBlockValueElem) bool {
// Find key element, exit if not found.
var keyElem TagBlockKeyElem
if !blk.DecodeTagKeyElem(key, &keyElem) {
return false
}
// Slice hash index data.
hashData := keyElem.hashIndex.buf
valueN := int64(binary.BigEn... | go | func (blk *TagBlock) DecodeTagValueElem(key, value []byte, valueElem *TagBlockValueElem) bool {
// Find key element, exit if not found.
var keyElem TagBlockKeyElem
if !blk.DecodeTagKeyElem(key, &keyElem) {
return false
}
// Slice hash index data.
hashData := keyElem.hashIndex.buf
valueN := int64(binary.BigEn... | [
"func",
"(",
"blk",
"*",
"TagBlock",
")",
"DecodeTagValueElem",
"(",
"key",
",",
"value",
"[",
"]",
"byte",
",",
"valueElem",
"*",
"TagBlockValueElem",
")",
"bool",
"{",
"// Find key element, exit if not found.",
"var",
"keyElem",
"TagBlockKeyElem",
"\n",
"if",
... | // DecodeTagValueElem returns an element for a tag value. | [
"DecodeTagValueElem",
"returns",
"an",
"element",
"for",
"a",
"tag",
"value",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L149-L194 |
123,582 | influxdata/influxdb | tsdb/tsi1/tag_block.go | TagKeyIterator | func (blk *TagBlock) TagKeyIterator() TagKeyIterator {
return &tagBlockKeyIterator{
blk: blk,
keyData: blk.keyData,
}
} | go | func (blk *TagBlock) TagKeyIterator() TagKeyIterator {
return &tagBlockKeyIterator{
blk: blk,
keyData: blk.keyData,
}
} | [
"func",
"(",
"blk",
"*",
"TagBlock",
")",
"TagKeyIterator",
"(",
")",
"TagKeyIterator",
"{",
"return",
"&",
"tagBlockKeyIterator",
"{",
"blk",
":",
"blk",
",",
"keyData",
":",
"blk",
".",
"keyData",
",",
"}",
"\n",
"}"
] | // TagKeyIterator returns an iterator over all the keys in the block. | [
"TagKeyIterator",
"returns",
"an",
"iterator",
"over",
"all",
"the",
"keys",
"in",
"the",
"block",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L197-L202 |
123,583 | influxdata/influxdb | tsdb/tsi1/tag_block.go | unmarshal | func (e *TagBlockKeyElem) unmarshal(buf, data []byte) {
start := len(buf)
// Parse flag data.
e.flag, buf = buf[0], buf[1:]
// Parse data offset/size.
e.data.offset, buf = binary.BigEndian.Uint64(buf), buf[8:]
e.data.size, buf = binary.BigEndian.Uint64(buf), buf[8:]
// Slice data.
e.data.buf = data[e.data.of... | go | func (e *TagBlockKeyElem) unmarshal(buf, data []byte) {
start := len(buf)
// Parse flag data.
e.flag, buf = buf[0], buf[1:]
// Parse data offset/size.
e.data.offset, buf = binary.BigEndian.Uint64(buf), buf[8:]
e.data.size, buf = binary.BigEndian.Uint64(buf), buf[8:]
// Slice data.
e.data.buf = data[e.data.of... | [
"func",
"(",
"e",
"*",
"TagBlockKeyElem",
")",
"unmarshal",
"(",
"buf",
",",
"data",
"[",
"]",
"byte",
")",
"{",
"start",
":=",
"len",
"(",
"buf",
")",
"\n\n",
"// Parse flag data.",
"e",
".",
"flag",
",",
"buf",
"=",
"buf",
"[",
"0",
"]",
",",
"... | // unmarshal unmarshals buf into e.
// The data argument represents the entire block data. | [
"unmarshal",
"unmarshals",
"buf",
"into",
"e",
".",
"The",
"data",
"argument",
"represents",
"the",
"entire",
"block",
"data",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L282-L310 |
123,584 | influxdata/influxdb | tsdb/tsi1/tag_block.go | SeriesID | func (e *TagBlockValueElem) SeriesID(i int) uint64 {
return binary.BigEndian.Uint64(e.series.data[i*SeriesIDSize:])
} | go | func (e *TagBlockValueElem) SeriesID(i int) uint64 {
return binary.BigEndian.Uint64(e.series.data[i*SeriesIDSize:])
} | [
"func",
"(",
"e",
"*",
"TagBlockValueElem",
")",
"SeriesID",
"(",
"i",
"int",
")",
"uint64",
"{",
"return",
"binary",
".",
"BigEndian",
".",
"Uint64",
"(",
"e",
".",
"series",
".",
"data",
"[",
"i",
"*",
"SeriesIDSize",
":",
"]",
")",
"\n",
"}"
] | // SeriesID returns series ID at an index. | [
"SeriesID",
"returns",
"series",
"ID",
"at",
"an",
"index",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L344-L346 |
123,585 | influxdata/influxdb | tsdb/tsi1/tag_block.go | SeriesIDs | func (e *TagBlockValueElem) SeriesIDs() ([]uint64, error) {
if e.seriesIDSetData != nil {
ss, err := e.SeriesIDSet()
if err != nil {
return nil, err
}
return ss.Slice(), nil
}
a := make([]uint64, 0, e.series.n)
var prev uint64
for data := e.series.data; len(data) > 0; {
delta, n, err := uvarint(data)... | go | func (e *TagBlockValueElem) SeriesIDs() ([]uint64, error) {
if e.seriesIDSetData != nil {
ss, err := e.SeriesIDSet()
if err != nil {
return nil, err
}
return ss.Slice(), nil
}
a := make([]uint64, 0, e.series.n)
var prev uint64
for data := e.series.data; len(data) > 0; {
delta, n, err := uvarint(data)... | [
"func",
"(",
"e",
"*",
"TagBlockValueElem",
")",
"SeriesIDs",
"(",
")",
"(",
"[",
"]",
"uint64",
",",
"error",
")",
"{",
"if",
"e",
".",
"seriesIDSetData",
"!=",
"nil",
"{",
"ss",
",",
"err",
":=",
"e",
".",
"SeriesIDSet",
"(",
")",
"\n",
"if",
"... | // SeriesIDs returns a list decoded series ids. | [
"SeriesIDs",
"returns",
"a",
"list",
"decoded",
"series",
"ids",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L349-L372 |
123,586 | influxdata/influxdb | tsdb/tsi1/tag_block.go | SeriesIDSet | func (e *TagBlockValueElem) SeriesIDSet() (*tsdb.SeriesIDSet, error) {
ss := tsdb.NewSeriesIDSet()
// Read bitmap data directly from mmap, if available.
if e.seriesIDSetData != nil {
if err := ss.UnmarshalBinaryUnsafe(e.seriesIDSetData); err != nil {
return nil, err
}
return ss, nil
}
// Otherwise decod... | go | func (e *TagBlockValueElem) SeriesIDSet() (*tsdb.SeriesIDSet, error) {
ss := tsdb.NewSeriesIDSet()
// Read bitmap data directly from mmap, if available.
if e.seriesIDSetData != nil {
if err := ss.UnmarshalBinaryUnsafe(e.seriesIDSetData); err != nil {
return nil, err
}
return ss, nil
}
// Otherwise decod... | [
"func",
"(",
"e",
"*",
"TagBlockValueElem",
")",
"SeriesIDSet",
"(",
")",
"(",
"*",
"tsdb",
".",
"SeriesIDSet",
",",
"error",
")",
"{",
"ss",
":=",
"tsdb",
".",
"NewSeriesIDSet",
"(",
")",
"\n\n",
"// Read bitmap data directly from mmap, if available.",
"if",
... | // SeriesIDSet returns a set of series ids. | [
"SeriesIDSet",
"returns",
"a",
"set",
"of",
"series",
"ids",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L375-L400 |
123,587 | influxdata/influxdb | tsdb/tsi1/tag_block.go | unmarshal | func (e *TagBlockValueElem) unmarshal(buf []byte) {
start := len(buf)
// Parse flag data.
e.flag, buf = buf[0], buf[1:]
// Parse value.
sz, n := binary.Uvarint(buf)
e.value, buf = buf[n:n+int(sz)], buf[n+int(sz):]
// Parse series count.
v, n := binary.Uvarint(buf)
e.series.n = uint64(v)
buf = buf[n:]
// ... | go | func (e *TagBlockValueElem) unmarshal(buf []byte) {
start := len(buf)
// Parse flag data.
e.flag, buf = buf[0], buf[1:]
// Parse value.
sz, n := binary.Uvarint(buf)
e.value, buf = buf[n:n+int(sz)], buf[n+int(sz):]
// Parse series count.
v, n := binary.Uvarint(buf)
e.series.n = uint64(v)
buf = buf[n:]
// ... | [
"func",
"(",
"e",
"*",
"TagBlockValueElem",
")",
"unmarshal",
"(",
"buf",
"[",
"]",
"byte",
")",
"{",
"start",
":=",
"len",
"(",
"buf",
")",
"\n\n",
"// Parse flag data.",
"e",
".",
"flag",
",",
"buf",
"=",
"buf",
"[",
"0",
"]",
",",
"buf",
"[",
... | // unmarshal unmarshals buf into e. | [
"unmarshal",
"unmarshals",
"buf",
"into",
"e",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L406-L435 |
123,588 | influxdata/influxdb | tsdb/tsi1/tag_block.go | ReadTagBlockTrailer | func ReadTagBlockTrailer(data []byte) (TagBlockTrailer, error) {
var t TagBlockTrailer
// Read version.
t.Version = int(binary.BigEndian.Uint16(data[len(data)-2:]))
if t.Version != TagBlockVersion {
return t, ErrUnsupportedTagBlockVersion
}
// Slice trailer data.
buf := data[len(data)-TagBlockTrailerSize:]
... | go | func ReadTagBlockTrailer(data []byte) (TagBlockTrailer, error) {
var t TagBlockTrailer
// Read version.
t.Version = int(binary.BigEndian.Uint16(data[len(data)-2:]))
if t.Version != TagBlockVersion {
return t, ErrUnsupportedTagBlockVersion
}
// Slice trailer data.
buf := data[len(data)-TagBlockTrailerSize:]
... | [
"func",
"ReadTagBlockTrailer",
"(",
"data",
"[",
"]",
"byte",
")",
"(",
"TagBlockTrailer",
",",
"error",
")",
"{",
"var",
"t",
"TagBlockTrailer",
"\n\n",
"// Read version.",
"t",
".",
"Version",
"=",
"int",
"(",
"binary",
".",
"BigEndian",
".",
"Uint16",
"... | // ReadTagBlockTrailer returns the tag block trailer from data. | [
"ReadTagBlockTrailer",
"returns",
"the",
"tag",
"block",
"trailer",
"from",
"data",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L503-L531 |
123,589 | influxdata/influxdb | tsdb/tsi1/tag_block.go | NewTagBlockEncoder | func NewTagBlockEncoder(w io.Writer) *TagBlockEncoder {
return &TagBlockEncoder{
w: w,
offsets: rhh.NewHashMap(rhh.Options{LoadFactor: LoadFactor}),
trailer: TagBlockTrailer{
Version: TagBlockVersion,
},
}
} | go | func NewTagBlockEncoder(w io.Writer) *TagBlockEncoder {
return &TagBlockEncoder{
w: w,
offsets: rhh.NewHashMap(rhh.Options{LoadFactor: LoadFactor}),
trailer: TagBlockTrailer{
Version: TagBlockVersion,
},
}
} | [
"func",
"NewTagBlockEncoder",
"(",
"w",
"io",
".",
"Writer",
")",
"*",
"TagBlockEncoder",
"{",
"return",
"&",
"TagBlockEncoder",
"{",
"w",
":",
"w",
",",
"offsets",
":",
"rhh",
".",
"NewHashMap",
"(",
"rhh",
".",
"Options",
"{",
"LoadFactor",
":",
"LoadF... | // NewTagBlockEncoder returns a new TagBlockEncoder. | [
"NewTagBlockEncoder",
"returns",
"a",
"new",
"TagBlockEncoder",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L551-L559 |
123,590 | influxdata/influxdb | tsdb/tsi1/tag_block.go | EncodeKey | func (enc *TagBlockEncoder) EncodeKey(key []byte, deleted bool) error {
// An initial empty byte must be written.
if err := enc.ensureHeaderWritten(); err != nil {
return err
}
// Verify key is lexicographically after previous key.
if len(enc.keys) > 0 {
prev := enc.keys[len(enc.keys)-1].key
if cmp := bytes... | go | func (enc *TagBlockEncoder) EncodeKey(key []byte, deleted bool) error {
// An initial empty byte must be written.
if err := enc.ensureHeaderWritten(); err != nil {
return err
}
// Verify key is lexicographically after previous key.
if len(enc.keys) > 0 {
prev := enc.keys[len(enc.keys)-1].key
if cmp := bytes... | [
"func",
"(",
"enc",
"*",
"TagBlockEncoder",
")",
"EncodeKey",
"(",
"key",
"[",
"]",
"byte",
",",
"deleted",
"bool",
")",
"error",
"{",
"// An initial empty byte must be written.",
"if",
"err",
":=",
"enc",
".",
"ensureHeaderWritten",
"(",
")",
";",
"err",
"!... | // EncodeKey writes a tag key to the underlying writer. | [
"EncodeKey",
"writes",
"a",
"tag",
"key",
"to",
"the",
"underlying",
"writer",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L565-L599 |
123,591 | influxdata/influxdb | tsdb/tsi1/tag_block.go | EncodeValue | func (enc *TagBlockEncoder) EncodeValue(value []byte, deleted bool, ss *tsdb.SeriesIDSet) error {
if len(enc.keys) == 0 {
return fmt.Errorf("tag key must be encoded before encoding values")
} else if len(value) == 0 {
return fmt.Errorf("zero length tag value not allowed")
}
// Validate that keys are in-order.
... | go | func (enc *TagBlockEncoder) EncodeValue(value []byte, deleted bool, ss *tsdb.SeriesIDSet) error {
if len(enc.keys) == 0 {
return fmt.Errorf("tag key must be encoded before encoding values")
} else if len(value) == 0 {
return fmt.Errorf("zero length tag value not allowed")
}
// Validate that keys are in-order.
... | [
"func",
"(",
"enc",
"*",
"TagBlockEncoder",
")",
"EncodeValue",
"(",
"value",
"[",
"]",
"byte",
",",
"deleted",
"bool",
",",
"ss",
"*",
"tsdb",
".",
"SeriesIDSet",
")",
"error",
"{",
"if",
"len",
"(",
"enc",
".",
"keys",
")",
"==",
"0",
"{",
"retur... | // EncodeValue writes a tag value to the underlying writer.
// The tag key must be lexicographical sorted after the previous encoded tag key. | [
"EncodeValue",
"writes",
"a",
"tag",
"value",
"to",
"the",
"underlying",
"writer",
".",
"The",
"tag",
"key",
"must",
"be",
"lexicographical",
"sorted",
"after",
"the",
"previous",
"encoded",
"tag",
"key",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L603-L664 |
123,592 | influxdata/influxdb | tsdb/tsi1/tag_block.go | Close | func (enc *TagBlockEncoder) Close() error {
// Flush last value set.
if err := enc.ensureHeaderWritten(); err != nil {
return err
} else if err := enc.flushValueHashIndex(); err != nil {
return err
}
// Save ending position of entire data block.
enc.trailer.ValueData.Size = enc.n - enc.trailer.ValueData.Offs... | go | func (enc *TagBlockEncoder) Close() error {
// Flush last value set.
if err := enc.ensureHeaderWritten(); err != nil {
return err
} else if err := enc.flushValueHashIndex(); err != nil {
return err
}
// Save ending position of entire data block.
enc.trailer.ValueData.Size = enc.n - enc.trailer.ValueData.Offs... | [
"func",
"(",
"enc",
"*",
"TagBlockEncoder",
")",
"Close",
"(",
")",
"error",
"{",
"// Flush last value set.",
"if",
"err",
":=",
"enc",
".",
"ensureHeaderWritten",
"(",
")",
";",
"err",
"!=",
"nil",
"{",
"return",
"err",
"\n",
"}",
"else",
"if",
"err",
... | // Close flushes the trailer of the encoder to the writer. | [
"Close",
"flushes",
"the",
"trailer",
"of",
"the",
"encoder",
"to",
"the",
"writer",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L667-L690 |
123,593 | influxdata/influxdb | tsdb/tsi1/tag_block.go | ensureHeaderWritten | func (enc *TagBlockEncoder) ensureHeaderWritten() error {
if enc.n > 0 {
return nil
} else if _, err := enc.w.Write([]byte{0}); err != nil {
return err
}
enc.n++
enc.trailer.ValueData.Offset = enc.n
return nil
} | go | func (enc *TagBlockEncoder) ensureHeaderWritten() error {
if enc.n > 0 {
return nil
} else if _, err := enc.w.Write([]byte{0}); err != nil {
return err
}
enc.n++
enc.trailer.ValueData.Offset = enc.n
return nil
} | [
"func",
"(",
"enc",
"*",
"TagBlockEncoder",
")",
"ensureHeaderWritten",
"(",
")",
"error",
"{",
"if",
"enc",
".",
"n",
">",
"0",
"{",
"return",
"nil",
"\n",
"}",
"else",
"if",
"_",
",",
"err",
":=",
"enc",
".",
"w",
".",
"Write",
"(",
"[",
"]",
... | // ensureHeaderWritten writes a single byte to offset the rest of the block. | [
"ensureHeaderWritten",
"writes",
"a",
"single",
"byte",
"to",
"offset",
"the",
"rest",
"of",
"the",
"block",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L693-L704 |
123,594 | influxdata/influxdb | tsdb/tsi1/tag_block.go | flushValueHashIndex | func (enc *TagBlockEncoder) flushValueHashIndex() error {
// Ignore if no keys have been written.
if len(enc.keys) == 0 {
return nil
}
key := &enc.keys[len(enc.keys)-1]
// Save size of data section.
key.data.size = enc.n - key.data.offset
// Encode hash map length.
key.hashIndex.offset = enc.n
if err := wr... | go | func (enc *TagBlockEncoder) flushValueHashIndex() error {
// Ignore if no keys have been written.
if len(enc.keys) == 0 {
return nil
}
key := &enc.keys[len(enc.keys)-1]
// Save size of data section.
key.data.size = enc.n - key.data.offset
// Encode hash map length.
key.hashIndex.offset = enc.n
if err := wr... | [
"func",
"(",
"enc",
"*",
"TagBlockEncoder",
")",
"flushValueHashIndex",
"(",
")",
"error",
"{",
"// Ignore if no keys have been written.",
"if",
"len",
"(",
"enc",
".",
"keys",
")",
"==",
"0",
"{",
"return",
"nil",
"\n",
"}",
"\n",
"key",
":=",
"&",
"enc",... | // flushValueHashIndex builds writes the hash map at the end of a value set. | [
"flushValueHashIndex",
"builds",
"writes",
"the",
"hash",
"map",
"at",
"the",
"end",
"of",
"a",
"value",
"set",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L707-L737 |
123,595 | influxdata/influxdb | tsdb/tsi1/tag_block.go | encodeTagKeyBlock | func (enc *TagBlockEncoder) encodeTagKeyBlock() error {
offsets := rhh.NewHashMap(rhh.Options{Capacity: int64(len(enc.keys)), LoadFactor: LoadFactor})
// Encode key list in sorted order.
enc.trailer.KeyData.Offset = enc.n
for i := range enc.keys {
entry := &enc.keys[i]
// Save current offset so we can use it ... | go | func (enc *TagBlockEncoder) encodeTagKeyBlock() error {
offsets := rhh.NewHashMap(rhh.Options{Capacity: int64(len(enc.keys)), LoadFactor: LoadFactor})
// Encode key list in sorted order.
enc.trailer.KeyData.Offset = enc.n
for i := range enc.keys {
entry := &enc.keys[i]
// Save current offset so we can use it ... | [
"func",
"(",
"enc",
"*",
"TagBlockEncoder",
")",
"encodeTagKeyBlock",
"(",
")",
"error",
"{",
"offsets",
":=",
"rhh",
".",
"NewHashMap",
"(",
"rhh",
".",
"Options",
"{",
"Capacity",
":",
"int64",
"(",
"len",
"(",
"enc",
".",
"keys",
")",
")",
",",
"L... | // encodeTagKeyBlock encodes the keys section to the writer. | [
"encodeTagKeyBlock",
"encodes",
"the",
"keys",
"section",
"to",
"the",
"writer",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/tag_block.go#L740-L795 |
123,596 | influxdata/influxdb | tsdb/tsi1/file_set.go | Duplicate | func (fs *FileSet) Duplicate() (*FileSet, error) {
return NewFileSet(fs.sfile, fs.files)
} | go | func (fs *FileSet) Duplicate() (*FileSet, error) {
return NewFileSet(fs.sfile, fs.files)
} | [
"func",
"(",
"fs",
"*",
"FileSet",
")",
"Duplicate",
"(",
")",
"(",
"*",
"FileSet",
",",
"error",
")",
"{",
"return",
"NewFileSet",
"(",
"fs",
".",
"sfile",
",",
"fs",
".",
"files",
")",
"\n",
"}"
] | // Duplicate returns a copy of the FileSet, acquiring another resource to the
// files and series file for the file set. | [
"Duplicate",
"returns",
"a",
"copy",
"of",
"the",
"FileSet",
"acquiring",
"another",
"resource",
"to",
"the",
"files",
"and",
"series",
"file",
"for",
"the",
"file",
"set",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/file_set.go#L73-L75 |
123,597 | influxdata/influxdb | tsdb/tsi1/file_set.go | Size | func (fs *FileSet) Size() int64 {
var total int64
for _, f := range fs.files {
total += f.Size()
}
return total + int64(fs.manifestSize)
} | go | func (fs *FileSet) Size() int64 {
var total int64
for _, f := range fs.files {
total += f.Size()
}
return total + int64(fs.manifestSize)
} | [
"func",
"(",
"fs",
"*",
"FileSet",
")",
"Size",
"(",
")",
"int64",
"{",
"var",
"total",
"int64",
"\n",
"for",
"_",
",",
"f",
":=",
"range",
"fs",
".",
"files",
"{",
"total",
"+=",
"f",
".",
"Size",
"(",
")",
"\n",
"}",
"\n",
"return",
"total",
... | // Size returns the on-disk size of the FileSet. | [
"Size",
"returns",
"the",
"on",
"-",
"disk",
"size",
"of",
"the",
"FileSet",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/file_set.go#L84-L90 |
123,598 | influxdata/influxdb | tsdb/tsi1/file_set.go | MaxID | func (fs *FileSet) MaxID() int {
var max int
for _, f := range fs.files {
if i := f.ID(); i > max {
max = i
}
}
return max
} | go | func (fs *FileSet) MaxID() int {
var max int
for _, f := range fs.files {
if i := f.ID(); i > max {
max = i
}
}
return max
} | [
"func",
"(",
"fs",
"*",
"FileSet",
")",
"MaxID",
"(",
")",
"int",
"{",
"var",
"max",
"int",
"\n",
"for",
"_",
",",
"f",
":=",
"range",
"fs",
".",
"files",
"{",
"if",
"i",
":=",
"f",
".",
"ID",
"(",
")",
";",
"i",
">",
"max",
"{",
"max",
"... | // MaxID returns the highest file identifier. | [
"MaxID",
"returns",
"the",
"highest",
"file",
"identifier",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/file_set.go#L125-L133 |
123,599 | influxdata/influxdb | tsdb/tsi1/file_set.go | LogFiles | func (fs *FileSet) LogFiles() []*LogFile {
var a []*LogFile
for _, f := range fs.files {
if f, ok := f.(*LogFile); ok {
a = append(a, f)
}
}
return a
} | go | func (fs *FileSet) LogFiles() []*LogFile {
var a []*LogFile
for _, f := range fs.files {
if f, ok := f.(*LogFile); ok {
a = append(a, f)
}
}
return a
} | [
"func",
"(",
"fs",
"*",
"FileSet",
")",
"LogFiles",
"(",
")",
"[",
"]",
"*",
"LogFile",
"{",
"var",
"a",
"[",
"]",
"*",
"LogFile",
"\n",
"for",
"_",
",",
"f",
":=",
"range",
"fs",
".",
"files",
"{",
"if",
"f",
",",
"ok",
":=",
"f",
".",
"("... | // LogFiles returns all log files from the file set. | [
"LogFiles",
"returns",
"all",
"log",
"files",
"from",
"the",
"file",
"set",
"."
] | 16d0bbb0cd468fd51f412021a76ae5c4b450dea8 | https://github.com/influxdata/influxdb/blob/16d0bbb0cd468fd51f412021a76ae5c4b450dea8/tsdb/tsi1/file_set.go#L141-L149 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.