< Docs
  • Java


MilvusClient interface. This method tests whether specified segments are flushed.

R<GetFlushStateResponse> getFlushState(GetFlushStateParam requestParam);


Use the GetFlushStateParam.Builder to construct a GetFlushStateParam object.

import io.milvus.param.GetFlushStateParam;
GetFlushStateParam.Builder builder = GetFlushStateParam.newBuilder();

Methods of GetFlushStateParam.Builder:

Method Description Parameters
withSegmentIDs(List\ segmentIDs) Set an ID list of segments to be tested. Typically the ID is returned by flush() method. segmentIDs: An ID list of segments.
addSegmentID(Long segmentID) Add a segment ID to be tested. Typically the ID is returned by flush() method. segmentID: A segment ID
build() Construct a GetFlushStateParam object. N/A

The can throw the following exceptions:

  • ParamException: error if the parameter is invalid.


This method catches all the exceptions and returns an R<GetFlushStateResponse> object.

  • If the API fails on the server side, it returns the error code and message from the server.

  • If the API fails by RPC exception, it returns R.Status.Unknown and error message of the exception.

  • If the API succeeds, it returns a valid GetFlushStateResponse held by the R template.


import io.milvus.param.*;
import io.milvus.grpc.GetFlushStateResponse;

GetFlushStateParam param = GetFlushStateParam.newBuilder()
R<GetFlushStateResponse> response = client.getFlushState(param);
if (response.getStatus() != R.Status.Success.getCode()) {

System.out.println("Flushed: " + response.getData().getFlushed());