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

The following examples show how to use org.elasticsearch.common.io.stream.StreamOutput#writeDouble() . 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: ClusterStateHealth.java    From Elasticsearch with Apache License 2.0 6 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(activePrimaryShards);
    out.writeVInt(activeShards);
    out.writeVInt(relocatingShards);
    out.writeVInt(initializingShards);
    out.writeVInt(unassignedShards);
    out.writeVInt(numberOfNodes);
    out.writeVInt(numberOfDataNodes);
    out.writeByte(status.value());
    out.writeVInt(indices.size());
    for (ClusterIndexHealth indexHealth : this) {
        indexHealth.writeTo(out);
    }
    out.writeVInt(validationFailures.size());
    for (String failure : validationFailures) {
        out.writeString(failure);
    }
    out.writeDouble(activeShardsPercent);
}
 
Example 2
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 3
Source File: SignificantLongTerms.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(subsetDf);
    out.writeVLong(supersetDf);
    out.writeLong(term);
    out.writeDouble(getSignificanceScore());
    aggregations.writeTo(out);
}
 
Example 4
Source File: TDigestState.java    From crate with Apache License 2.0 5 votes vote down vote up
public static void write(TDigestState state, StreamOutput out) throws IOException {
    out.writeDouble(state.compression);
    out.writeDoubleArray(state.fractions);
    out.writeVInt(state.centroidCount());
    for (Centroid centroid : state.centroids()) {
        out.writeDouble(centroid.mean());
        out.writeVLong(centroid.count());
    }
}
 
Example 5
Source File: ClusterHealthResponse.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(clusterName);
    out.writeVInt(clusterStateHealth.getActivePrimaryShards());
    out.writeVInt(clusterStateHealth.getActiveShards());
    out.writeVInt(clusterStateHealth.getRelocatingShards());
    out.writeVInt(clusterStateHealth.getInitializingShards());
    out.writeVInt(clusterStateHealth.getUnassignedShards());
    out.writeVInt(clusterStateHealth.getNumberOfNodes());
    out.writeVInt(clusterStateHealth.getNumberOfDataNodes());
    out.writeInt(numberOfPendingTasks);
    out.writeByte(clusterStateHealth.getStatus().value());
    out.writeVInt(clusterStateHealth.getIndices().size());
    for (ClusterIndexHealth indexHealth : clusterStateHealth) {
        indexHealth.writeTo(out);
    }
    out.writeBoolean(timedOut);

    out.writeVInt(clusterStateHealth.getValidationFailures().size());
    for (String failure : clusterStateHealth.getValidationFailures()) {
        out.writeString(failure);
    }

    out.writeInt(numberOfInFlightFetch);
    if (out.getVersion().onOrAfter(Version.V_1_7_0)) {
        out.writeInt(delayedUnassignedShards);
    }
    out.writeDouble(clusterStateHealth.getActiveShardsPercent());
    taskMaxWaitingTime.writeTo(out);
}
 
Example 6
Source File: SignificantStringTerms.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeBytesRef(termBytes);
    out.writeVLong(subsetDf);
    out.writeVLong(supersetDf);
    out.writeDouble(getSignificanceScore());
    aggregations.writeTo(out);
}
 
Example 7
Source File: GeoPointType.java    From crate with Apache License 2.0 5 votes vote down vote up
@Override
public void writeValueTo(StreamOutput out, Point point) throws IOException {
    if (point == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        out.writeDouble(point.getX());
        out.writeDouble(point.getY());
    }
}
 
Example 8
Source File: AbstractInternalHDRPercentiles.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    ValueFormatterStreams.writeOptional(valueFormatter, out);
    out.writeInt(keys.length);
    for (int i = 0 ; i < keys.length; ++i) {
        out.writeDouble(keys[i]);
    }
    out.writeLong(state.getHighestToLowestValueRatio());
    ByteBuffer stateBuffer = ByteBuffer.allocate(state.getNeededByteBufferCapacity());
    final int serializedLen = state.encodeIntoCompressedByteBuffer(stateBuffer);
    out.writeVInt(serializedLen);
    out.writeBytes(stateBuffer.array(), 0, serializedLen);
    out.writeBoolean(keyed);
}
 
Example 9
Source File: CircuitBreakerStats.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeLong(limit);
    out.writeLong(estimated);
    out.writeDouble(overhead);
    out.writeLong(trippedCount);
    out.writeString(name);
}
 
Example 10
Source File: GeoReferenceInfo.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(geoTree);
    out.writeOptionalString(precision);
    out.writeBoolean(treeLevels == null);
    if (treeLevels != null) {
        out.writeVInt(treeLevels);
    }
    out.writeBoolean(distanceErrorPct == null);
    if (distanceErrorPct != null) {
        out.writeDouble(distanceErrorPct);
    }
}
 
Example 11
Source File: GeoPointType.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void writeValueTo(StreamOutput out, Object v) throws IOException {
    if (v == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        Double[] point = (Double[]) v;
        out.writeDouble(point[0]);
        out.writeDouble(point[1]);
    }
}
 
Example 12
Source File: InternalGeoShape.java    From elasticsearch-plugin-geoshape with MIT License 5 votes vote down vote up
/**
 * Write to a stream.
 */
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeBytesRef(wkb);
    out.writeString(wkbHash);
    out.writeString(realType);
    out.writeDouble(area);
    out.writeLong(docCount);
    aggregations.writeTo(out);
}
 
Example 13
Source File: DerivativePipelineAggregator.java    From Elasticsearch with Apache License 2.0 5 votes vote down vote up
@Override
public void doWriteTo(StreamOutput out) throws IOException {
    ValueFormatterStreams.writeOptional(formatter, out);
    gapPolicy.writeTo(out);
    boolean hasXAxisUnitsValue = xAxisUnits != null;
    out.writeBoolean(hasXAxisUnitsValue);
    if (hasXAxisUnitsValue) {
        out.writeDouble(xAxisUnits);
    }
}
 
Example 14
Source File: DocumentGroup.java    From elasticsearch-carrot2 with Apache License 2.0 5 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(id);
    out.writeDouble(score);
    out.writeStringArray(phrases);
    out.writeBoolean(ungroupedDocuments);
    out.writeStringArray(documentReferences);
    
    out.writeVInt(subgroups.length);
    for (DocumentGroup group : subgroups) {
        group.writeTo(out);
    }
}
 
Example 15
Source File: PredictionResults.java    From elasticsearch-linear-regression with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(final StreamOutput out) throws IOException {
  super.writeTo(out);
  out.writeDouble(this.predictedValue);
}
 
Example 16
Source File: InternalMin.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    ValueFormatterStreams.writeOptional(valueFormatter, out);
    out.writeDouble(min);
}
 
Example 17
Source File: GeometricMeanAggregation.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(n);
    out.writeDouble(value);
}
 
Example 18
Source File: RCFResultResponse.java    From anomaly-detection with Apache License 2.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeDouble(rcfScore);
    out.writeDouble(confidence);
    out.writeVInt(forestSize);
}
 
Example 19
Source File: Language.java    From elasticsearch-plugin-bundle with GNU Affero General Public License v3.0 4 votes vote down vote up
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(lang);
    out.writeDouble(prob);
}
 
Example 20
Source File: InternalSimpleValue.java    From Elasticsearch with Apache License 2.0 4 votes vote down vote up
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    ValueFormatterStreams.writeOptional(valueFormatter, out);
    out.writeDouble(value);
}