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

The following examples show how to use org.elasticsearch.common.io.stream.StreamOutput#writeString() . 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: JvmInfo.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeLong(pid);
    out.writeString(version);
    out.writeString(vmName);
    out.writeString(vmVersion);
    out.writeString(vmVendor);
    out.writeLong(startTime);
    out.writeInt(inputArguments.length);
    for (String inputArgument : inputArguments) {
        out.writeString(inputArgument);
    }
    out.writeString(bootClassPath);
    out.writeString(classPath);
    out.writeInt(systemProperties.size());
    for (Map.Entry<String, String> entry : systemProperties.entrySet()) {
        out.writeString(entry.getKey());
        out.writeString(entry.getValue());
    }
    mem.writeTo(out);
    out.writeStringArray(gcCollectors);
    out.writeStringArray(memoryPools);
    if (out.getVersion().onOrAfter(Version.V_2_2_0)) {
        out.writeOptionalString(useCompressedOops);
    }
}
 
Example 2
Source File: TransportBroadcastByNodeAction.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(nodeId);
    out.writeVInt(totalShards);
    out.writeVInt(results.size());
    for (ShardOperationResult result : results) {
        out.writeOptionalStreamable(result);
    }
    out.writeBoolean(exceptions != null);
    if (exceptions != null) {
        int failureShards = exceptions.size();
        out.writeVInt(failureShards);
        for (int i = 0; i < failureShards; i++) {
            exceptions.get(i).writeTo(out);
        }
    }
}
 
Example 3
Source File: JobRequest.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.writeLong(jobId.getMostSignificantBits());
    out.writeLong(jobId.getLeastSignificantBits());
    out.writeString(coordinatorNodeId);

    out.writeVInt(nodeOperations.size());
    for (NodeOperation nodeOperation : nodeOperations) {
        nodeOperation.writeTo(out);
    }

    out.writeBoolean(enableProfiling);

    sessionSettings.writeTo(out);
}
 
Example 4
Source File: MappingMetaData.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(type());
    source().writeTo(out);
    // id
    if (id().hasPath()) {
        out.writeBoolean(true);
        out.writeString(id().path());
    } else {
        out.writeBoolean(false);
    }
    // routing
    out.writeBoolean(routing().required());
    if (routing().hasPath()) {
        out.writeBoolean(true);
        out.writeString(routing().path());
    } else {
        out.writeBoolean(false);
    }
    // timestamp
    out.writeBoolean(timestamp().enabled());
    out.writeOptionalString(timestamp().path());
    out.writeString(timestamp().format());
    out.writeOptionalString(timestamp().defaultTimestamp());
    out.writeOptionalBoolean(timestamp().ignoreMissing());
    out.writeBoolean(hasParentField());
    // mappingVersion
    out.writeLong(mappingVersion());

    if (version().hasPath()) {
        out.writeBoolean(true);
        out.writeString(version().path());
        out.writeByte(version().versionType().getValue());
    } else {
        out.writeBoolean(false);
    }
}
 
Example 5
Source File: GetRequest.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(type);
    out.writeString(id);
    out.writeOptionalString(routing);
    out.writeOptionalString(preference);

    out.writeBoolean(refresh);
    if (fields == null) {
        out.writeInt(-1);
    } else {
        out.writeInt(fields.length);
        for (String field : fields) {
            out.writeString(field);
        }
    }
    if (realtime == null) {
        out.writeByte((byte) -1);
    } else if (!realtime) {
        out.writeByte((byte) 0);
    } else {
        out.writeByte((byte) 1);
    }
    out.writeBoolean(ignoreErrorsOnGeneratedFields);
    out.writeByte(versionType.getValue());
    out.writeLong(version);

    FetchSourceContext.optionalWriteToStream(fetchSourceContext, out);
}
 
Example 6
Source File: Store.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(this.metadata.size());
    for (StoreFileMetaData meta : this) {
        meta.writeTo(out);
    }
    out.writeVInt(commitUserData.size());
    for (Map.Entry<String, String> entry : commitUserData.entrySet()) {
        out.writeString(entry.getKey());
        out.writeString(entry.getValue());
    }
    out.writeLong(numDocs);
}
 
Example 7
Source File: CreatePartitionsRequest.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);
    out.writeLong(jobId.getMostSignificantBits());
    out.writeLong(jobId.getLeastSignificantBits());
    out.writeVInt(indices.size());
    for (String index : indices) {
        out.writeString(index);
    }
}
 
Example 8
Source File: SourceIndexWriterProjection.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);

    out.writeBoolean(overwriteDuplicates);
    Reference.toStream(rawSourceReference, out);
    Symbol.toStream(rawSourceSymbol, out);

    if (includes == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        out.writeVInt(includes.length);
        for (String include : includes) {
            out.writeString(include);
        }
    }
    if (excludes == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        out.writeVInt(excludes.length);
        for (String exclude : excludes) {
            out.writeString(exclude);
        }
    }
}
 
Example 9
Source File: ReplicaOperationRequest.java    From elasticsearch-helper with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeLong(startTime);
    out.writeString(index);
    out.writeVInt(shardId);
    out.writeVInt(replicaId);
    request.writeTo(out);
}
 
Example 10
Source File: GetSettingsResponse.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeVInt(indexToSettings.size());
    for (ObjectObjectCursor<String, Settings> cursor : indexToSettings) {
        out.writeString(cursor.key);
        Settings.writeSettingsToStream(cursor.value, out);
    }
}
 
Example 11
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 12
Source File: IndexWarmersMetaData.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(entries().size());
    for (Entry entry : entries()) {
        out.writeString(entry.name());
        out.writeStringArray(entry.types());
        if (entry.source() == null) {
            out.writeBoolean(false);
        } else {
            out.writeBoolean(true);
            out.writeBytesReference(entry.source());
        }
        out.writeOptionalBoolean(entry.requestCache());
    }
}
 
Example 13
Source File: DeleteRepositoryRequest.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(name);
    writeTimeout(out);
}
 
Example 14
Source File: ShardResponse.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(id);
    out.writeString(message);
    out.writeBoolean(versionConflict);
}
 
Example 15
Source File: ChiSquare.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(STREAM.getName());
    super.writeTo(out);
}
 
Example 16
Source File: TestCustomMetaData.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(getData());
}
 
Example 17
Source File: ClusterName.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(value);
}
 
Example 18
Source File: SimpleShardIdentifier.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(indexName);
    out.writeString(indexUUID);
    out.writeInt(shardId);
}
 
Example 19
Source File: ParameterTypeSignature.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(parameterName);
}
 
Example 20
Source File: BlobTransferInfoResponse.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(digest);
    out.writeString(index);
}