flushjob

package
v8.15.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Overview

Forces any buffered data to be processed by the job. The flush jobs API is only applicable when sending data for analysis using the post data API. Depending on the content of the buffer, then it might additionally calculate new results. Both flush and close operations are similar, however the flush is more efficient if you are expecting to send more data for analysis. When flushing, the job remains open and is available to continue analyzing data. A close operation additionally prunes and persists the model state to disk and the job must be opened again before analyzing further data.

Index

Constants

This section is empty.

Variables

View Source
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")

ErrBuildPath is returned in case of missing parameters within the build of the request.

Functions

This section is empty.

Types

type FlushJob

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

func New

Forces any buffered data to be processed by the job. The flush jobs API is only applicable when sending data for analysis using the post data API. Depending on the content of the buffer, then it might additionally calculate new results. Both flush and close operations are similar, however the flush is more efficient if you are expecting to send more data for analysis. When flushing, the job remains open and is available to continue analyzing data. A close operation additionally prunes and persists the model state to disk and the job must be opened again before analyzing further data.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ml-flush-job.html

func (*FlushJob) AdvanceTime

func (r *FlushJob) AdvanceTime(datetime types.DateTime) *FlushJob

AdvanceTime Refer to the description for the `advance_time` query parameter. API name: advance_time

func (*FlushJob) CalcInterim

func (r *FlushJob) CalcInterim(calcinterim bool) *FlushJob

CalcInterim Refer to the description for the `calc_interim` query parameter. API name: calc_interim

func (FlushJob) Do

func (r FlushJob) Do(providedCtx context.Context) (*Response, error)

Do runs the request through the transport, handle the response and returns a flushjob.Response

func (*FlushJob) End

func (r *FlushJob) End(datetime types.DateTime) *FlushJob

End Refer to the description for the `end` query parameter. API name: end

func (*FlushJob) ErrorTrace added in v8.14.0

func (r *FlushJob) ErrorTrace(errortrace bool) *FlushJob

ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace

func (*FlushJob) FilterPath added in v8.14.0

func (r *FlushJob) FilterPath(filterpaths ...string) *FlushJob

FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path

func (*FlushJob) Header

func (r *FlushJob) Header(key, value string) *FlushJob

Header set a key, value pair in the FlushJob headers map.

func (*FlushJob) HttpRequest

func (r *FlushJob) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*FlushJob) Human added in v8.14.0

func (r *FlushJob) Human(human bool) *FlushJob

Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human

func (FlushJob) Perform added in v8.7.0

func (r FlushJob) Perform(providedCtx context.Context) (*http.Response, error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*FlushJob) Pretty added in v8.14.0

func (r *FlushJob) Pretty(pretty bool) *FlushJob

Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty

func (*FlushJob) Raw

func (r *FlushJob) Raw(raw io.Reader) *FlushJob

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*FlushJob) Request

func (r *FlushJob) Request(req *Request) *FlushJob

Request allows to set the request property with the appropriate payload.

func (*FlushJob) SkipTime

func (r *FlushJob) SkipTime(datetime types.DateTime) *FlushJob

SkipTime Refer to the description for the `skip_time` query parameter. API name: skip_time

func (*FlushJob) Start

func (r *FlushJob) Start(datetime types.DateTime) *FlushJob

Start Refer to the description for the `start` query parameter. API name: start

type NewFlushJob

type NewFlushJob func(jobid string) *FlushJob

NewFlushJob type alias for index.

func NewFlushJobFunc

func NewFlushJobFunc(tp elastictransport.Interface) NewFlushJob

NewFlushJobFunc returns a new instance of FlushJob with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type Request

type Request struct {

	// AdvanceTime Refer to the description for the `advance_time` query parameter.
	AdvanceTime types.DateTime `json:"advance_time,omitempty"`
	// CalcInterim Refer to the description for the `calc_interim` query parameter.
	CalcInterim *bool `json:"calc_interim,omitempty"`
	// End Refer to the description for the `end` query parameter.
	End types.DateTime `json:"end,omitempty"`
	// SkipTime Refer to the description for the `skip_time` query parameter.
	SkipTime types.DateTime `json:"skip_time,omitempty"`
	// Start Refer to the description for the `start` query parameter.
	Start types.DateTime `json:"start,omitempty"`
}

Request holds the request body struct for the package flushjob

https://github.com/elastic/elasticsearch-specification/blob/19027dbdd366978ccae41842a040a636730e7c10/specification/ml/flush_job/MlFlushJobRequest.ts#L24-L99

func NewRequest added in v8.5.0

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON added in v8.5.0

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

func (*Request) UnmarshalJSON added in v8.12.1

func (s *Request) UnmarshalJSON(data []byte) error

type Response added in v8.7.0

type Response struct {
	Flushed bool `json:"flushed"`
	// LastFinalizedBucketEnd Provides the timestamp (in milliseconds since the epoch) of the end of
	// the last bucket that was processed.
	LastFinalizedBucketEnd *int `json:"last_finalized_bucket_end,omitempty"`
}

Response holds the response body struct for the package flushjob

https://github.com/elastic/elasticsearch-specification/blob/19027dbdd366978ccae41842a040a636730e7c10/specification/ml/flush_job/MlFlushJobResponse.ts#L22-L31

func NewResponse added in v8.7.0

func NewResponse() *Response

NewResponse returns a Response

Jump to

Keyboard shortcuts

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