Java Code Examples for org.elasticsearch.common.io.stream.StreamOutput#writeOptionalVInt()

The following examples show how to use org.elasticsearch.common.io.stream.StreamOutput#writeOptionalVInt() . 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: PutIndexTemplateRequest.java    From crate with Apache License 2.0 6 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(cause);
    out.writeString(name);
    out.writeStringCollection(indexPatterns);
    out.writeInt(order);
    out.writeBoolean(create);
    writeSettingsToStream(settings, out);
    out.writeVInt(mappings.size());
    for (Map.Entry<String, String> entry : mappings.entrySet()) {
        out.writeString(entry.getKey());
        out.writeString(entry.getValue());
    }
    out.writeVInt(aliases.size());
    for (Alias alias : aliases) {
        alias.writeTo(out);
    }
    out.writeOptionalVInt(version);
}
 
Example 2
Source File: Reference.java    From crate with Apache License 2.0 6 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    ident.writeTo(out);
    out.writeOptionalVInt(position);
    DataTypes.toStream(type, out);
    RowGranularity.toStream(granularity, out);

    out.writeVInt(columnPolicy.ordinal());
    out.writeVInt(indexType.ordinal());
    out.writeBoolean(nullable);
    out.writeBoolean(columnStoreDisabled);
    final boolean hasDefaultExpression = defaultExpression != null;
    out.writeBoolean(hasDefaultExpression);
    if (hasDefaultExpression) {
        Symbols.toStream(defaultExpression, out);
    }
}
 
Example 3
Source File: TermVectorsRequest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
public void writeTo(StreamOutput out) throws IOException {
    out.writeOptionalVInt(maxNumTerms);
    out.writeOptionalVInt(minTermFreq);
    out.writeOptionalVInt(maxTermFreq);
    out.writeOptionalVInt(minDocFreq);
    out.writeOptionalVInt(maxDocFreq);
    out.writeOptionalVInt(minWordLength);
    out.writeOptionalVInt(maxWordLength);
}
 
Example 4
Source File: LoggingSearchExtBuilder.java    From elasticsearch-learning-to-rank with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeOptionalString(loggerName);
    out.writeOptionalString(namedQuery);
    out.writeOptionalVInt(rescoreIndex);
    out.writeBoolean(missingAsZero);
}
 
Example 5
Source File: PathHierarchyAggregationBuilder.java    From elasticsearch-aggregation-pathhierarchy with MIT License 5 votes vote down vote up
/**
 * Write to a stream
 */
@Override
protected void innerWriteTo(StreamOutput out) throws IOException {
    bucketCountThresholds.writeTo(out);
    out.writeString(separator);
    out.writeVLong(minDocCount);
    out.writeOptionalVInt(minDepth);
    out.writeOptionalVInt(maxDepth);
    out.writeOptionalBoolean(keepBlankPath);
    out.writeOptionalVInt(depth);
    order.writeTo(out);
}
 
Example 6
Source File: RoutedCollectPhase.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);

    distributionInfo.writeTo(out);

    Symbols.toStream(toCollect, out);
    RowGranularity.toStream(maxRowGranularity, out);

    routing.writeTo(out);
    Symbols.toStream(where, out);

    out.writeOptionalVInt(nodePageSizeHint);
    out.writeOptionalWriteable(orderBy);
}
 
Example 7
Source File: NodeStatsContext.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    DataTypes.STRING.writeValueTo(out, id);
    DataTypes.STRING.writeValueTo(out, name);
    DataTypes.STRING.writeValueTo(out, hostname);
    out.writeLong(timestamp);
    out.writeBoolean(version != null);
    if (version != null) {
        Version.writeVersion(version, out);
    }
    out.writeBoolean(build != null);
    if (build != null) {
        Build.writeBuildTo(build, out);
    }
    DataTypes.STRING.writeValueTo(out, restUrl);
    out.writeOptionalVInt(pgPort);
    out.writeOptionalVInt(httpPort);
    out.writeOptionalVInt(transportPort);
    out.writeOptionalWriteable(jvmStats);
    out.writeOptionalWriteable(osInfo);
    out.writeOptionalWriteable(processStats);
    out.writeOptionalWriteable(osStats);
    out.writeOptionalWriteable(fsInfo);
    out.writeOptionalWriteable(extendedOsStats);
    out.writeOptionalWriteable(threadPools);
    out.writeOptionalWriteable(httpStats);
    out.writeOptionalWriteable(psqlStats);
    out.writeLong(openTransportConnections);
    out.writeLong(clusterStateVersion);

    DataTypes.STRING.writeValueTo(out, osName);
    DataTypes.STRING.writeValueTo(out, osArch);
    DataTypes.STRING.writeValueTo(out, osVersion);
    DataTypes.STRING.writeValueTo(out, javaVersion);
    DataTypes.STRING.writeValueTo(out, jvmName);
    DataTypes.STRING.writeValueTo(out, jvmVendor);
    DataTypes.STRING.writeValueTo(out, jvmVersion);
}