Documentation
¶
Overview ¶
Create a follower. Create a cross-cluster replication follower index that follows a specific leader index. When the API returns, the follower index exists and cross-cluster replication starts replicating operations from the leader index to the follower index.
Index ¶
- Variables
- type Follow
- func (r *Follow) DataStreamName(datastreamname string) *Follow
- func (r Follow) Do(providedCtx context.Context) (*Response, error)
- func (r *Follow) ErrorTrace(errortrace bool) *Follow
- func (r *Follow) FilterPath(filterpaths ...string) *Follow
- func (r *Follow) Header(key, value string) *Follow
- func (r *Follow) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Follow) Human(human bool) *Follow
- func (r *Follow) LeaderIndex(indexname string) *Follow
- func (r *Follow) MasterTimeout(duration string) *Follow
- func (r *Follow) MaxOutstandingReadRequests(maxoutstandingreadrequests int64) *Follow
- func (r *Follow) MaxOutstandingWriteRequests(maxoutstandingwriterequests int) *Follow
- func (r *Follow) MaxReadRequestOperationCount(maxreadrequestoperationcount int) *Follow
- func (r *Follow) MaxReadRequestSize(bytesize types.ByteSizeVariant) *Follow
- func (r *Follow) MaxRetryDelay(duration types.DurationVariant) *Follow
- func (r *Follow) MaxWriteBufferCount(maxwritebuffercount int) *Follow
- func (r *Follow) MaxWriteBufferSize(bytesize types.ByteSizeVariant) *Follow
- func (r *Follow) MaxWriteRequestOperationCount(maxwriterequestoperationcount int) *Follow
- func (r *Follow) MaxWriteRequestSize(bytesize types.ByteSizeVariant) *Follow
- func (r Follow) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *Follow) Pretty(pretty bool) *Follow
- func (r *Follow) Raw(raw io.Reader) *Follow
- func (r *Follow) ReadPollTimeout(duration types.DurationVariant) *Follow
- func (r *Follow) RemoteCluster(remotecluster string) *Follow
- func (r *Follow) Request(req *Request) *Follow
- func (r *Follow) Settings(settings types.IndexSettingsVariant) *Follow
- func (r *Follow) WaitForActiveShards(waitforactiveshards string) *Follow
- type NewFollow
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
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 Follow ¶
type Follow struct {
// contains filtered or unexported fields
}
func New ¶
func New(tp elastictransport.Interface) *Follow
Create a follower. Create a cross-cluster replication follower index that follows a specific leader index. When the API returns, the follower index exists and cross-cluster replication starts replicating operations from the leader index to the follower index.
https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ccr-follow
func (*Follow) DataStreamName ¶
If the leader index is part of a data stream, the name to which the local data stream for the followed index should be renamed. API name: data_stream_name
func (Follow) Do ¶
Do runs the request through the transport, handle the response and returns a follow.Response
func (*Follow) ErrorTrace ¶
ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace
func (*Follow) FilterPath ¶
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*Follow) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*Follow) Human ¶
Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"exists_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 (*Follow) LeaderIndex ¶
The name of the index in the leader cluster to follow. API name: leader_index
func (*Follow) MasterTimeout ¶
MasterTimeout Period to wait for a connection to the master node. API name: master_timeout
func (*Follow) MaxOutstandingReadRequests ¶
The maximum number of outstanding reads requests from the remote cluster. API name: max_outstanding_read_requests
func (*Follow) MaxOutstandingWriteRequests ¶
The maximum number of outstanding write requests on the follower. API name: max_outstanding_write_requests
func (*Follow) MaxReadRequestOperationCount ¶
The maximum number of operations to pull per read from the remote cluster. API name: max_read_request_operation_count
func (*Follow) MaxReadRequestSize ¶
func (r *Follow) MaxReadRequestSize(bytesize types.ByteSizeVariant) *Follow
The maximum size in bytes of per read of a batch of operations pulled from the remote cluster. API name: max_read_request_size
func (*Follow) MaxRetryDelay ¶
func (r *Follow) MaxRetryDelay(duration types.DurationVariant) *Follow
The maximum time to wait before retrying an operation that failed exceptionally. An exponential backoff strategy is employed when retrying. API name: max_retry_delay
func (*Follow) MaxWriteBufferCount ¶
The maximum number of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the number of queued operations goes below the limit. API name: max_write_buffer_count
func (*Follow) MaxWriteBufferSize ¶
func (r *Follow) MaxWriteBufferSize(bytesize types.ByteSizeVariant) *Follow
The maximum total bytes of operations that can be queued for writing. When this limit is reached, reads from the remote cluster will be deferred until the total bytes of queued operations goes below the limit. API name: max_write_buffer_size
func (*Follow) MaxWriteRequestOperationCount ¶
The maximum number of operations per bulk write request executed on the follower. API name: max_write_request_operation_count
func (*Follow) MaxWriteRequestSize ¶
func (r *Follow) MaxWriteRequestSize(bytesize types.ByteSizeVariant) *Follow
The maximum total bytes of operations per bulk write request executed on the follower. API name: max_write_request_size
func (Follow) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Follow) Pretty ¶
Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty
func (*Follow) Raw ¶
Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.
func (*Follow) ReadPollTimeout ¶
func (r *Follow) ReadPollTimeout(duration types.DurationVariant) *Follow
The maximum time to wait for new operations on the remote cluster when the follower index is synchronized with the leader index. When the timeout has elapsed, the poll for operations will return to the follower so that it can update some statistics. Then the follower will immediately attempt to read from the leader again. API name: read_poll_timeout
func (*Follow) RemoteCluster ¶
The remote cluster containing the leader index. API name: remote_cluster
func (*Follow) Settings ¶
func (r *Follow) Settings(settings types.IndexSettingsVariant) *Follow
Settings to override from the leader index. API name: settings
func (*Follow) WaitForActiveShards ¶
WaitForActiveShards Specifies the number of shards to wait on being active before responding. This defaults to waiting on none of the shards to be active. A shard must be restored from the leader index before being active. Restoring a follower shard requires transferring all the remote Lucene segment files to the follower index. API name: wait_for_active_shards
type NewFollow ¶
NewFollow type alias for index.
func NewFollowFunc ¶
func NewFollowFunc(tp elastictransport.Interface) NewFollow
NewFollowFunc returns a new instance of Follow 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 { // DataStreamName If the leader index is part of a data stream, the name to which the local // data stream for the followed index should be renamed. DataStreamName *string `json:"data_stream_name,omitempty"` // LeaderIndex The name of the index in the leader cluster to follow. LeaderIndex string `json:"leader_index"` // MaxOutstandingReadRequests The maximum number of outstanding reads requests from the remote cluster. MaxOutstandingReadRequests *int64 `json:"max_outstanding_read_requests,omitempty"` // MaxOutstandingWriteRequests The maximum number of outstanding write requests on the follower. MaxOutstandingWriteRequests *int `json:"max_outstanding_write_requests,omitempty"` // MaxReadRequestOperationCount The maximum number of operations to pull per read from the remote cluster. MaxReadRequestOperationCount *int `json:"max_read_request_operation_count,omitempty"` // MaxReadRequestSize The maximum size in bytes of per read of a batch of operations pulled from // the remote cluster. MaxReadRequestSize types.ByteSize `json:"max_read_request_size,omitempty"` // MaxRetryDelay The maximum time to wait before retrying an operation that failed // exceptionally. An exponential backoff strategy is employed when // retrying. MaxRetryDelay types.Duration `json:"max_retry_delay,omitempty"` // MaxWriteBufferCount The maximum number of operations that can be queued for writing. When this // limit is reached, reads from the remote cluster will be // deferred until the number of queued operations goes below the limit. MaxWriteBufferCount *int `json:"max_write_buffer_count,omitempty"` // MaxWriteBufferSize The maximum total bytes of operations that can be queued for writing. When // this limit is reached, reads from the remote cluster will // be deferred until the total bytes of queued operations goes below the limit. MaxWriteBufferSize types.ByteSize `json:"max_write_buffer_size,omitempty"` // MaxWriteRequestOperationCount The maximum number of operations per bulk write request executed on the // follower. MaxWriteRequestOperationCount *int `json:"max_write_request_operation_count,omitempty"` // MaxWriteRequestSize The maximum total bytes of operations per bulk write request executed on the // follower. MaxWriteRequestSize types.ByteSize `json:"max_write_request_size,omitempty"` // ReadPollTimeout The maximum time to wait for new operations on the remote cluster when the // follower index is synchronized with the leader index. // When the timeout has elapsed, the poll for operations will return to the // follower so that it can update some statistics. // Then the follower will immediately attempt to read from the leader again. ReadPollTimeout types.Duration `json:"read_poll_timeout,omitempty"` // RemoteCluster The remote cluster containing the leader index. RemoteCluster string `json:"remote_cluster"` // Settings Settings to override from the leader index. Settings *types.IndexSettings `json:"settings,omitempty"` }
Request holds the request body struct for the package follow