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

The following examples show how to use org.elasticsearch.common.io.stream.StreamOutput#writeVLong() . 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: OsStats.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(timestamp);
    if (out.getVersion().onOrAfter(Version.V_2_2_0)) {
        out.writeBoolean(cpuPercent != null);
        if (cpuPercent != null) {
            out.writeShort(cpuPercent);
        }
    }
    out.writeDouble(loadAverage);
    if (mem == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        mem.writeTo(out);
    }
    if (swap == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        swap.writeTo(out);
    }
}
 
Example 2
Source File: IngestResponse.java    From elasticsearch-helper with Apache License 2.0 6 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeLong(ingestId);
    out.writeVInt(successSize);
    out.writeVInt(failures.size());
    for (IngestActionFailure f : failures) {
        f.writeTo(out);
    }
    out.writeVLong(tookInMillis);
    leaderResponse.writeTo(out);
    out.writeVInt(replicaResponses.size());
    for (IngestReplicaShardResponse r : replicaResponses) {
        r.writeTo(out);
    }
}
 
Example 3
Source File: ProcessStats.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(timestamp);
    out.writeLong(openFileDescriptors);
    out.writeLong(maxFileDescriptors);
    if (cpu == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        cpu.writeTo(out);
    }
    if (mem == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        mem.writeTo(out);
    }
}
 
Example 4
Source File: SignificantStringTerms.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    writeSize(requiredSize, out);
    out.writeVLong(minDocCount);
    out.writeVLong(subsetSize);
    out.writeVLong(supersetSize);
    significanceHeuristic.writeTo(out);
    out.writeVInt(buckets.size());
    for (InternalSignificantTerms.Bucket bucket : buckets) {
        bucket.writeTo(out);
    }
}
 
Example 5
Source File: StoreFileMetaData.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(name);
    out.writeVLong(length);
    out.writeString(checksum);
    out.writeString(writtenBy.toString());
    out.writeBytesRef(hash);
}
 
Example 6
Source File: MergeStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(total);
    out.writeVLong(totalTimeInMillis);
    out.writeVLong(totalNumDocs);
    out.writeVLong(totalSizeInBytes);
    out.writeVLong(current);
    out.writeVLong(currentNumDocs);
    out.writeVLong(currentSizeInBytes);
    // Added in 2.0:
    out.writeVLong(totalStoppedTimeInMillis);
    out.writeVLong(totalThrottledTimeInMillis);
    out.writeVLong(totalBytesPerSecAutoThrottle);
}
 
Example 7
Source File: OsStats.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);
    cpu.writeTo(out);
    mem.writeTo(out);
    swap.writeTo(out);
    out.writeOptionalWriteable(cgroup);
}
 
Example 8
Source File: InternalGeoPointClustering.java    From elasticsearch-aggregation-geoclustering with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeLong(geohashAsLong);
    out.writeVLong(docCount);
    out.writeLong(encodeLatLon(centroid.lat(), centroid.lon()));
    out.writeBoolean(visited);
    aggregations.writeTo(out);
}
 
Example 9
Source File: DateHierarchyAggregationBuilder.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.writeVLong(minDocCount);
    out.writeString(interval);
    order.writeTo(out);
    boolean hasTimeZone = timeZone != null;
    out.writeBoolean(hasTimeZone);
    out.writeOptionalZoneId(timeZone);
}
 
Example 10
Source File: BlobRecoveryChunkRequest.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.writeVLong(transferId);
    out.writeBytesReference(content);
    out.writeBoolean(isLast);
}
 
Example 11
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 12
Source File: DLStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(latestTxid);
    out.writeByteArray(latestDlsn.serializeBytes());
    out.writeVLong(commitTxid);
    out.writeByteArray(commitDlsn.serializeBytes());
}
 
Example 13
Source File: AllocateUnassignedDecision.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.writeOptionalWriteable(allocationStatus);
    out.writeOptionalString(allocationId);
    out.writeBoolean(reuseStore);
    out.writeVLong(remainingDelayInMillis);
    out.writeVLong(configuredDelayInMillis);
}
 
Example 14
Source File: TransportReplicationAction.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(targetAllocationID);
    out.writeVLong(primaryTerm);
    request.writeTo(out);
}
 
Example 15
Source File: WarmerStats.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(current);
    out.writeVLong(total);
    out.writeVLong(totalTimeInMillis);
}
 
Example 16
Source File: ConnectionStats.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(open);
    out.writeVLong(total);
}
 
Example 17
Source File: BlobStats.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(count);
    out.writeVLong(totalUsage);
    out.writeString(location);
}
 
Example 18
Source File: ByteSizeValue.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(bytes());
}
 
Example 19
Source File: GarbageCollector.java    From elasticsearch-helper with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(name);
    out.writeVLong(collectionCount);
    out.writeVLong(collectionTime);
}
 
Example 20
Source File: DocsStats.java    From crate with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(count);
    out.writeVLong(deleted);
    out.writeVLong(totalSizeInBytes);
}