Module org.elasticsearch.xcore
Class AsyncStatusResponse
java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportResponse
org.elasticsearch.action.ActionResponse
org.elasticsearch.xpack.core.search.action.AsyncStatusResponse
- All Implemented Interfaces:
Writeable,org.elasticsearch.core.RefCounted,org.elasticsearch.xcontent.ToXContent,org.elasticsearch.xcontent.ToXContentObject,SearchStatusResponse
public class AsyncStatusResponse
extends ActionResponse
implements SearchStatusResponse, org.elasticsearch.xcontent.ToXContentObject
A response of an async search status request.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.elasticsearch.action.ActionResponse
ActionResponse.EmptyNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCEDFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionAsyncStatusResponse(String id, boolean isRunning, boolean isPartial, long startTimeMillis, long expirationTimeMillis, Long completionTimeMillis, int totalShards, int successfulShards, int skippedShards, int failedShards, RestStatus completionStatus, SearchResponse.Clusters clusters) -
Method Summary
Modifier and TypeMethodDescriptionbooleanFor a completed async search returns the completion status.longReturns a timestamp when the search will be expired, in milliseconds since epoch.intReturns the number of failed shards the search was executed on.getId()Returns the id of the async search status request.intReturns the number of skipped shards due to pre-filtering.longReturns a timestamp when the search tasks started, in milliseconds since epoch.static AsyncStatusResponsegetStatusFromStoredSearch(AsyncSearchResponse asyncSearchResponse, long expirationTimeMillis, String id) Get status from the stored async search responseintReturns the number of successful shards the search was executed on.intReturns the total number of shards the search is executed on.inthashCode()booleanReturnstrueif the search results are partial.booleanReturnstrueif the search is still running in the cluster, orfalseif the search has been completed.org.elasticsearch.xcontent.XContentBuildertoXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) voidwriteTo(StreamOutput out) Methods inherited from class org.elasticsearch.transport.TransportMessage
decRef, hasReferences, incRef, remoteAddress, remoteAddress, tryIncRefMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.elasticsearch.core.RefCounted
mustIncRefMethods inherited from interface org.elasticsearch.xcontent.ToXContentObject
isFragment
-
Constructor Details
-
AsyncStatusResponse
public AsyncStatusResponse(String id, boolean isRunning, boolean isPartial, long startTimeMillis, long expirationTimeMillis, Long completionTimeMillis, int totalShards, int successfulShards, int skippedShards, int failedShards, RestStatus completionStatus, SearchResponse.Clusters clusters) -
AsyncStatusResponse
- Throws:
IOException
-
-
Method Details
-
getStatusFromStoredSearch
public static AsyncStatusResponse getStatusFromStoredSearch(AsyncSearchResponse asyncSearchResponse, long expirationTimeMillis, String id) Get status from the stored async search response- Parameters:
asyncSearchResponse- stored async search responseexpirationTimeMillis- – expiration time in millisecondsid- – encoded async search id- Returns:
- status response
-
writeTo
- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public org.elasticsearch.xcontent.XContentBuilder toXContent(org.elasticsearch.xcontent.XContentBuilder builder, org.elasticsearch.xcontent.ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceorg.elasticsearch.xcontent.ToXContent- Throws:
IOException
-
equals
-
hashCode
public int hashCode() -
getId
Returns the id of the async search status request. -
isRunning
public boolean isRunning()Returnstrueif the search is still running in the cluster, orfalseif the search has been completed. -
isPartial
public boolean isPartial()Returnstrueif the search results are partial. This could be either because async search hasn't finished yet, or if it finished and some shards have failed. -
getStartTime
public long getStartTime()Returns a timestamp when the search tasks started, in milliseconds since epoch. -
getExpirationTime
public long getExpirationTime()Returns a timestamp when the search will be expired, in milliseconds since epoch.- Specified by:
getExpirationTimein interfaceSearchStatusResponse
-
getCompletionTime
- Returns:
- completion_time_in_millis if set, otherwise null
-
getTotalShards
public int getTotalShards()Returns the total number of shards the search is executed on. -
getSuccessfulShards
public int getSuccessfulShards()Returns the number of successful shards the search was executed on. -
getSkippedShards
public int getSkippedShards()Returns the number of skipped shards due to pre-filtering. -
getFailedShards
public int getFailedShards()Returns the number of failed shards the search was executed on. -
getCompletionStatus
For a completed async search returns the completion status. For a still running async search returnsnull. -
getClusters
- Returns:
- For CCS, clusters object that has information about the clustes being searched, such as total count successful count and skipped. Will be null for local-only searches.
-