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

The following examples show how to use org.elasticsearch.common.io.stream.StreamOutput#writeEnum() . 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: DiscoveryNode.java    From crate with Apache License 2.0 6 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(nodeName);
    out.writeString(nodeId);
    out.writeString(ephemeralId);
    out.writeString(hostName);
    out.writeString(hostAddress);
    address.writeTo(out);
    out.writeVInt(attributes.size());
    for (Map.Entry<String, String> entry : attributes.entrySet()) {
        out.writeString(entry.getKey());
        out.writeString(entry.getValue());
    }
    out.writeVInt(roles.size());
    for (Role role : roles) {
        out.writeEnum(role);
    }
    Version.writeVersion(version, out);
}
 
Example 2
Source File: ProfileRequest.java    From anomaly-detection with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVInt(profilesToBeRetrieved.size());
    for (ProfileName profile : profilesToBeRetrieved) {
        out.writeEnum(profile);
    }
    out.writeString(detectorId);
}
 
Example 3
Source File: StoredFeatureNormalizers.java    From elasticsearch-learning-to-rank with Apache License 2.0 5 votes vote down vote up
public void writeTo(StreamOutput output) throws IOException {
    output.writeInt(this.featureNormalizers.size());
    for (Map.Entry<String, FeatureNormDefinition> featureNormEntry : this.featureNormalizers.entrySet()) {
        output.writeEnum(featureNormEntry.getValue().normType());
        featureNormEntry.getValue().writeTo(output);
    }
}
 
Example 4
Source File: ClusterBlock.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(id);
    out.writeOptionalString(uuid);
    out.writeString(description);
    out.writeVInt(levels.size());
    for (ClusterBlockLevel level : levels) {
        out.writeEnum(level);
    }
    out.writeBoolean(retryable);
    out.writeBoolean(disableStatePersistence);
    RestStatus.writeTo(out, status);
    out.writeBoolean(allowReleaseResources);
}
 
Example 5
Source File: ResizeRequest.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);
    targetIndexRequest.writeTo(out);
    out.writeString(sourceIndex);
    out.writeEnum(type);
    out.writeOptionalBoolean(copySettings);
}
 
Example 6
Source File: FrameBoundDefinition.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeEnum(type);
    if (out.getVersion().onOrAfter(Version.V_4_1_0)) {
        Symbols.toStream(value, out);
    } else {
        Symbols.nullableToStream(value, out);
    }
}
 
Example 7
Source File: WindowFrameDefinition.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeEnum(mode);
    start.writeTo(out);
    out.writeOptionalWriteable(end);
}