Class FlushRequest

All Implemented Interfaces:
IndicesRequest, IndicesRequest.Replaceable, Writeable, org.elasticsearch.common.util.concurrent.RefCounted, TaskAwareRequest

public class FlushRequest
extends BroadcastRequest<FlushRequest>
A flush request to flush one or more indices. The flush process of an index basically frees memory from the index by flushing data to the index storage and clearing the internal transaction log. By default, Elasticsearch uses memory heuristics in order to automatically trigger flush operations as required in order to clear memory.

Best created with Requests.flushRequest(String...).

See Also:
Requests.flushRequest(String...), IndicesAdminClient.flush(FlushRequest), FlushResponse
  • Constructor Details

    • FlushRequest

      public FlushRequest​(java.lang.String... indices)
      Constructs a new flush request against one or more indices. If nothing is provided, all indices will be flushed.
    • FlushRequest

      public FlushRequest​(StreamInput in) throws java.io.IOException
      Throws:
      java.io.IOException
  • Method Details

    • waitIfOngoing

      public boolean waitIfOngoing()
      Returns true iff a flush should block if a another flush operation is already running. Otherwise false
    • waitIfOngoing

      public FlushRequest waitIfOngoing​(boolean waitIfOngoing)
      if set to true the flush will block if a another flush operation is already running until the flush can be performed. The default is true
    • force

      public boolean force()
      Force flushing, even if one is possibly not needed.
    • force

      public FlushRequest force​(boolean force)
      Force flushing, even if one is possibly not needed.
    • validate

      Overrides:
      validate in class BroadcastRequest<FlushRequest>
    • writeTo

      public void writeTo​(StreamOutput out) throws java.io.IOException
      Description copied from interface: Writeable
      Write this into the StreamOutput.
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class BroadcastRequest<FlushRequest>
      Throws:
      java.io.IOException
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object