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

The following examples show how to use org.elasticsearch.common.io.stream.StreamOutput#writeLong() . 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: 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 2
Source File: LongType.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeValueTo(StreamOutput out, Object v) throws IOException {
    out.writeBoolean(v == null);
    if (v != null) {
        out.writeLong(((Number) v).longValue());
    }
}
 
Example 3
Source File: DoubleTerms.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeDouble(term);
    out.writeVLong(getDocCount());
    if (showDocCountError) {
        out.writeLong(docCountError);
    }
    aggregations.writeTo(out);
}
 
Example 4
Source File: Translog.java    From crate with Apache License 2.0 5 votes vote down vote up
private void write(final StreamOutput out) throws IOException {
    final int format = out.getVersion().onOrAfter(Version.V_4_0_0) ? SERIALIZATION_FORMAT : FORMAT_6_0;
    out.writeVInt(format);
    out.writeString(id);
    out.writeString(type);
    out.writeBytesReference(source);
    out.writeOptionalString(routing);
    out.writeLong(version);
    if (format < FORMAT_NO_VERSION_TYPE) {
        out.writeByte(VersionType.EXTERNAL.getValue());
    }
    out.writeLong(autoGeneratedIdTimestamp);
    out.writeLong(seqNo);
    out.writeLong(primaryTerm);
}
 
Example 5
Source File: ProcessStats.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(timestamp);
    out.writeLong(openFileDescriptors);
    out.writeLong(maxFileDescriptors);
    out.writeOptionalWriteable(cpu);
    out.writeOptionalWriteable(mem);
}
 
Example 6
Source File: RecoveryCleanFilesRequest.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.writeLong(recoveryId);
    shardId.writeTo(out);
    snapshotFiles.writeTo(out);
    out.writeVInt(totalTranslogOps);
}
 
Example 7
Source File: PutBlobHeadChunkRequest.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.writeLong(transferId.getMostSignificantBits());
    out.writeLong(transferId.getLeastSignificantBits());
    out.writeBytesReference(content);
}
 
Example 8
Source File: RecoveryCleanFilesRequest.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(recoveryId);
    shardId.writeTo(out);
    snapshotFiles.writeTo(out);
    out.writeVInt(totalTranslogOps);
}
 
Example 9
Source File: TenantProperty.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeLong(tenantId);
    out.writeString(tenantName);
    out.writeInt(desireInstanceNum);
    out.writeInt(nodes.size());
    for (AllocatedNodeInfo nodeId : nodes.values()) {
        nodeId.writeTo(out);
    }
}
 
Example 10
Source File: LoginUserContext.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeNullableString(loginUsername);
    out.writeLong(tenantId);
    out.writeNullableString(password);
    out.writeNullableString(sourceAddrs);
    out.writeNullableString(proxyAddrs);
    out.writeBoolean(authenticated);
    out.writeBoolean(authorized);
}
 
Example 11
Source File: ClusterState.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    clusterName.writeTo(out);
    out.writeString(fromUuid);
    out.writeString(toUuid);
    out.writeLong(toVersion);
    routingTable.writeTo(out);
    nodes.writeTo(out);
    metaData.writeTo(out);
    blocks.writeTo(out);
    customs.writeTo(out);
}
 
Example 12
Source File: RecoveryCheckTranslogOffsetRequest.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.writeLong(recoveryId);
    shardId.writeTo(out);
    out.writeLong(currentOffset);
}
 
Example 13
Source File: RoutingTable.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeLong(version);
    indicesRouting.writeTo(out);
}
 
Example 14
Source File: InternalGeoHashGrid.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeLong(geohashAsLong);
    out.writeVLong(docCount);
    aggregations.writeTo(out);
}
 
Example 15
Source File: RecoveryFinalizeRecoveryRequest.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.writeLong(recoveryId);
    shardId.writeTo(out);
}
 
Example 16
Source File: BlobRecoveryRequest.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.writeLong(recoveryId);
}
 
Example 17
Source File: FollowersChecker.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(final StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeLong(term);
    sender.writeTo(out);
}
 
Example 18
Source File: PublishResponse.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeLong(term);
    out.writeLong(version);
}
 
Example 19
Source File: NodeCollectProfileRequest.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.writeLong(jobId.getMostSignificantBits());
    out.writeLong(jobId.getLeastSignificantBits());
}
 
Example 20
Source File: OsStats.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeLong(total);
    out.writeLong(free);
}