本文整理汇总了Java中org.elasticsearch.common.io.stream.StreamOutput.writeDouble方法的典型用法代码示例。如果您正苦于以下问题:Java StreamOutput.writeDouble方法的具体用法?Java StreamOutput.writeDouble怎么用?Java StreamOutput.writeDouble使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.common.io.stream.StreamOutput
的用法示例。
在下文中一共展示了StreamOutput.writeDouble方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeSortValue
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
private static void writeSortValue(StreamOutput out, Object field) throws IOException {
if (field == null) {
out.writeByte((byte) 0);
} else {
Class type = field.getClass();
if (type == String.class) {
out.writeByte((byte) 1);
out.writeString((String) field);
} else if (type == Integer.class) {
out.writeByte((byte) 2);
out.writeInt((Integer) field);
} else if (type == Long.class) {
out.writeByte((byte) 3);
out.writeLong((Long) field);
} else if (type == Float.class) {
out.writeByte((byte) 4);
out.writeFloat((Float) field);
} else if (type == Double.class) {
out.writeByte((byte) 5);
out.writeDouble((Double) field);
} else if (type == Byte.class) {
out.writeByte((byte) 6);
out.writeByte((Byte) field);
} else if (type == Short.class) {
out.writeByte((byte) 7);
out.writeShort((Short) field);
} else if (type == Boolean.class) {
out.writeByte((byte) 8);
out.writeBoolean((Boolean) field);
} else if (type == BytesRef.class) {
out.writeByte((byte) 9);
out.writeBytesRef((BytesRef) field);
} else {
throw new IOException("Can't handle sort field value of type [" + type + "]");
}
}
}
示例2: writeValueTo
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeValueTo(StreamOutput out, Object v) throws IOException {
out.writeBoolean(v == null);
if (v != null) {
out.writeDouble(((Number) v).doubleValue());
}
}
示例3: doWriteTo
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
out.writeNamedWriteable(format);
out.writeBoolean(keyed);
out.writeVInt(ranges.size());
for (B bucket : ranges) {
out.writeOptionalString(((Bucket) bucket).key);
out.writeDouble(((Bucket) bucket).from);
out.writeDouble(((Bucket) bucket).to);
out.writeVLong(((Bucket) bucket).docCount);
bucket.aggregations.writeTo(out);
}
}
示例4: writeTo
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeString(STREAM.getName());
out.writeDouble(alpha);
out.writeDouble(beta);
out.writeDouble(gamma);
out.writeVInt(period);
seasonalityType.writeTo(out);
out.writeBoolean(pad);
}
示例5: writeTo
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@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);
}
}
示例6: doWriteTo
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
out.writeDouble(top);
out.writeDouble(bottom);
out.writeDouble(posLeft);
out.writeDouble(posRight);
out.writeDouble(negLeft);
out.writeDouble(negRight);
out.writeBoolean(wrapLongitude);
}
示例7: writeTo
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@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);
}
示例8: write
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
public static void write(TDigestState state, StreamOutput out) throws IOException {
out.writeDouble(state.compression);
out.writeVInt(state.centroidCount());
for (Centroid centroid : state.centroids()) {
out.writeDouble(centroid.mean());
out.writeVLong(centroid.count());
}
}
示例9: writeValueTo
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@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]);
}
}
示例10: writeTo
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
out.writeVLong(subsetDf);
out.writeVLong(supersetDf);
out.writeLong(term);
out.writeDouble(getSignificanceScore());
aggregations.writeTo(out);
}
示例11: doWriteTo
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
ValueFormatterStreams.writeOptional(valueFormatter, out);
out.writeVLong(count);
out.writeDouble(min);
out.writeDouble(max);
out.writeDouble(sum);
writeOtherStatsTo(out);
}
示例12: writeTo
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
super.writeTo(out);
out.writeDouble(minValue);
out.writeDouble(maxValue);
}
示例13: doWriteTo
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
ValueFormatterStreams.writeOptional(valueFormatter, out);
out.writeDouble(value);
out.writeStringArray(keys);
}
示例14: doWriteTo
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
ValueFormatterStreams.writeOptional(valueFormatter, out);
out.writeDouble(sum);
}
示例15: doWriteTo
import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
out.writeNamedWriteable(format);
out.writeDouble(sum);
out.writeVLong(count);
}