Java Code Examples for org.elasticsearch.common.io.stream.StreamInput#readOptionalStreamable()

The following examples show how to use org.elasticsearch.common.io.stream.StreamInput#readOptionalStreamable() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AnalyzeResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    int size = in.readVInt();
    tokens = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        tokens.add(AnalyzeToken.readAnalyzeToken(in));
    }
    if (in.getVersion().onOrAfter(Version.V_2_2_0)) {
        detail = in.readOptionalStreamable(new DetailAnalyzeResponse());
    }
}
 
Example 2
Source File: NodeStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    timestamp = in.readVLong();
    if (in.readBoolean()) {
        indices = NodeIndicesStats.readIndicesStats(in);
    }
    if (in.readBoolean()) {
        os = OsStats.readOsStats(in);
    }
    if (in.readBoolean()) {
        process = ProcessStats.readProcessStats(in);
    }
    if (in.readBoolean()) {
        jvm = JvmStats.readJvmStats(in);
    }
    if (in.readBoolean()) {
        threadPool = ThreadPoolStats.readThreadPoolStats(in);
    }
    if (in.readBoolean()) {
        fs = FsInfo.readFsInfo(in);
    }
    if (in.readBoolean()) {
        transport = TransportStats.readTransportStats(in);
    }
    if (in.readBoolean()) {
        http = HttpStats.readHttpStats(in);
    }
    breaker = AllCircuitBreakerStats.readOptionalAllCircuitBreakerStats(in);
    scriptStats = in.readOptionalStreamable(new ScriptStats());

}
 
Example 3
Source File: AllCircuitBreakerStats.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public static AllCircuitBreakerStats readOptionalAllCircuitBreakerStats(StreamInput in) throws IOException {
    AllCircuitBreakerStats stats = in.readOptionalStreamable(new AllCircuitBreakerStats());
    return stats;
}
 
Example 4
Source File: CircuitBreakerStats.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public static CircuitBreakerStats readOptionalCircuitBreakerStats(StreamInput in) throws IOException {
    CircuitBreakerStats stats = in.readOptionalStreamable(new CircuitBreakerStats());
    return stats;
}
 
Example 5
Source File: InternalAggregations.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public static InternalAggregations readOptionalAggregations(StreamInput in) throws IOException {
    return in.readOptionalStreamable(new InternalAggregations());
}
 
Example 6
Source File: InternalSearchHit.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    field = in.readOptionalText();
    offset = in.readInt();
    child = in.readOptionalStreamable(new InternalNestedIdentity());
}
 
Example 7
Source File: CommitStats.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public static CommitStats readOptionalCommitStatsFrom(StreamInput in) throws IOException {
    return in.readOptionalStreamable(new CommitStats());
}
 
Example 8
Source File: RoutingValidationException.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public RoutingValidationException(StreamInput in) throws IOException {
    super(in);
    validation = in.readOptionalStreamable(new RoutingTableValidation());
}
 
Example 9
Source File: RestoreSource.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
public static RestoreSource readOptionalRestoreSource(StreamInput in) throws IOException {
    return in.readOptionalStreamable(new RestoreSource());
}
 
Example 10
Source File: CommonStats.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void readFrom(StreamInput in) throws IOException {
    if (in.readBoolean()) {
        docs = DocsStats.readDocStats(in);
    }
    if (in.readBoolean()) {
        store = StoreStats.readStoreStats(in);
    }
    if (in.readBoolean()) {
        indexing = IndexingStats.readIndexingStats(in);
    }
    if (in.readBoolean()) {
        get = GetStats.readGetStats(in);
    }
    if (in.readBoolean()) {
        search = SearchStats.readSearchStats(in);
    }
    if (in.readBoolean()) {
        merge = MergeStats.readMergeStats(in);
    }
    if (in.readBoolean()) {
        refresh = RefreshStats.readRefreshStats(in);
    }
    if (in.readBoolean()) {
        flush = FlushStats.readFlushStats(in);
    }
    if (in.readBoolean()) {
        warmer = WarmerStats.readWarmerStats(in);
    }
    if (in.readBoolean()) {
        queryCache = QueryCacheStats.readQueryCacheStats(in);
    }
    if (in.readBoolean()) {
        fieldData = FieldDataStats.readFieldDataStats(in);
    }
    if (in.readBoolean()) {
        percolate = PercolateStats.readPercolateStats(in);
    }
    if (in.readBoolean()) {
        completion = CompletionStats.readCompletionStats(in);
    }
    if (in.readBoolean()) {
        segments = SegmentsStats.readSegmentsStats(in);
    }
    if (in.readBoolean()) {
        dlStats = DLStats.readDLStats(in);
    }
    if (in.readBoolean()) {
        reindexStats = ReindexStats.readReindexStats(in);
    }
    translog = in.readOptionalStreamable(new TranslogStats());
    suggest = in.readOptionalStreamable(new SuggestStats());
    requestCache = in.readOptionalStreamable(new RequestCacheStats());
    recoveryStats = in.readOptionalStreamable(new RecoveryStats());
}
 
Example 11
Source File: RestoreInfo.java    From Elasticsearch with Apache License 2.0 2 votes vote down vote up
/**
 * Reads optional restore info from {@link StreamInput}
 *
 * @param in stream input
 * @return restore info
 */
public static RestoreInfo readOptionalRestoreInfo(StreamInput in) throws IOException {
    return in.readOptionalStreamable(new RestoreInfo());
}
 
Example 12
Source File: SnapshotInfo.java    From Elasticsearch with Apache License 2.0 2 votes vote down vote up
/**
 * Reads optional snapshot information from stream input
 *
 * @param in stream input
 * @return deserialized snapshot info or null
 */
public static SnapshotInfo readOptionalSnapshotInfo(StreamInput in) throws IOException {
    return in.readOptionalStreamable(new SnapshotInfo());
}