getFlushState()
MilvusClient interface. This method tests whether specified segments are flushed.
R<GetFlushStateResponse> getFlushState(GetFlushStateParam requestParam);
GetFlushStateParam
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 |
---|---|---|
withCollectionName(collectionName) |
Set the collection name. Collection name cannot be empty or null. |
collectionName: The target collection name. |
withDatabaseName(String databaseName) |
Sets the database name. database name can be null for default database. |
databaseName: The database name. |
withSegmentIDs(List<Long> 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. |
withFlushTs(Long flushTs) |
Input a time stamp of a flush action, get its flush state(optional). |
flushTs: A time stamp returned by the flush() response. |
build() |
Construct a GetFlushStateParam object. |
N/A |
The GetFlushStateParam.Builder.build()
can throw the following exceptions:
- ParamException: error if the parameter is invalid.
Returns
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 theR
template.
Example
import io.milvus.param.*;
import io.milvus.grpc.GetFlushStateResponse;
GetFlushStateParam param = GetFlushStateParam.newBuilder()
.addSegmentID(COLLECTION_NAME)
.build();
R<GetFlushStateResponse> response = client.getFlushState(param);
if (response.getStatus() != R.Status.Success.getCode()) {
System.out.println(response.getMessage());
}
System.out.println("Flushed: " + response.getData().getFlushed());