当前位置: 首页>>代码示例>>Java>>正文


Java StreamOutput.writeBoolean方法代码示例

本文整理汇总了Java中org.elasticsearch.common.io.stream.StreamOutput.writeBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java StreamOutput.writeBoolean方法的具体用法?Java StreamOutput.writeBoolean怎么用?Java StreamOutput.writeBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.elasticsearch.common.io.stream.StreamOutput的用法示例。


在下文中一共展示了StreamOutput.writeBoolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@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);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:24,代码来源:OsStats.java

示例2: writeOrder

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
public static void writeOrder(Terms.Order order, StreamOutput out) throws IOException {
    if (order instanceof Aggregation) {
        out.writeByte(order.id());
        Aggregation aggregationOrder = (Aggregation) order;
        out.writeBoolean(((MultiBucketsAggregation.Bucket.SubAggregationComparator) aggregationOrder.comparator).asc());
        AggregationPath path = ((Aggregation) order).path();
        out.writeString(path.toString());
    } else if (order instanceof CompoundOrder) {
        CompoundOrder compoundOrder = (CompoundOrder) order;
            out.writeByte(order.id());
            out.writeVInt(compoundOrder.orderElements.size());
            for (Terms.Order innerOrder : compoundOrder.orderElements) {
                Streams.writeOrder(innerOrder, out);
            }
    } else {
        out.writeByte(order.id());
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:19,代码来源:InternalOrder.java

示例3: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(id);
    out.writeString(opType);

    if (response == null) {
        out.writeByte((byte) 2);
    } else {
        if (response instanceof IndexResponse) {
            out.writeByte((byte) 0);
        } else if (response instanceof DeleteResponse) {
            out.writeByte((byte) 1);
        } else if (response instanceof UpdateResponse) {
            out.writeByte((byte) 3); // make 3 instead of 2, because 2 is already in use for 'no responses'
        }
        response.writeTo(out);
    }
    if (failure == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        failure.writeTo(out);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:25,代码来源:BulkItemResponse.java

示例4: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeLong(jobId.getMostSignificantBits());
    out.writeLong(jobId.getLeastSignificantBits());
    out.writeVInt(executionPhaseId);
    out.writeVInt(bucketIdx);
    out.writeBoolean(isLast);
    out.writeByte(inputId);

    boolean failure = throwable != null;
    out.writeBoolean(failure);
    if (failure) {
        out.writeThrowable(throwable);
    } else {
        // TODO: we should not rely on another bucket in this class and instead write to the stream directly
        StreamBucket.writeBucket(out, streamers, rows);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:20,代码来源:DistributedResultRequest.java

示例5: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    out.writeString(fieldName);
    boolean hasShape = shape != null;
    out.writeBoolean(hasShape);
    if (hasShape) {
        out.writeNamedWriteable(shape);
    } else {
        out.writeOptionalString(indexedShapeId);
        out.writeOptionalString(indexedShapeType);
        out.writeOptionalString(indexedShapeIndex);
        out.writeOptionalString(indexedShapePath);
    }
    relation.writeTo(out);
    out.writeOptionalWriteable(strategy);
    out.writeBoolean(ignoreUnmapped);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:18,代码来源:GeoShapeQueryBuilder.java

示例6: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    node.writeTo(out);
    out.writeLong(taskId.getId());
    out.writeString(type);
    out.writeString(action);
    out.writeOptionalString(description);
    if (status != null) {
        out.writeBoolean(true);
        out.writeTaskStatus(status);
    } else {
        out.writeBoolean(false);
    }
    out.writeLong(startTime);
    out.writeLong(runningTimeNanos);
    parentTaskId.writeTo(out);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:TaskInfo.java

示例7: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(requestName);
    out.writeString(nodeId);
    out.writeBoolean(shouldBlock);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:TestTaskPlugin.java

示例8: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeShort(percent);
    if (loadAverage == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        out.writeDoubleArray(loadAverage);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:OsStats.java

示例9: innerWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void innerWriteTo(StreamOutput out) throws IOException {
    out.writeVInt(ranges.size());
    for (Range range : ranges) {
        range.writeTo(out);
    }
    out.writeBoolean(keyed);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:IpRangeAggregationBuilder.java

示例10: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeBoolean(routingTable);
    out.writeBoolean(nodes);
    out.writeBoolean(metaData);
    out.writeBoolean(blocks);
    out.writeBoolean(customs);
    out.writeStringArray(indices);
    indicesOptions.writeIndicesOptions(out);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:ClusterStateRequest.java

示例11: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(index);
    out.writeString(type);
    out.writeString(id);
    out.writeLong(version);
    out.writeBoolean(created);
    if (getResult == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        getResult.writeTo(out);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:16,代码来源:UpdateResponse.java

示例12: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    out.writeString(queryText);
    out.writeInt(fieldsAndWeights.size());
    for (Map.Entry<String, Float> entry : fieldsAndWeights.entrySet()) {
        out.writeString(entry.getKey());
        out.writeFloat(entry.getValue());
    }
    out.writeInt(flags);
    out.writeOptionalString(analyzer);
    defaultOperator.writeTo(out);
    if (out.getVersion().before(Version.V_5_1_1_UNRELEASED)) {
        out.writeBoolean(true); // lowercase_expanded_terms
    }
    out.writeBoolean(settings.lenient());
    if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
        out.writeBoolean(lenientSet);
    }
    out.writeBoolean(settings.analyzeWildcard());
    if (out.getVersion().before(Version.V_5_1_1_UNRELEASED)) {
        out.writeString(Locale.ROOT.toLanguageTag()); // locale
    }
    out.writeOptionalString(minimumShouldMatch);
    if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
        out.writeOptionalString(settings.quoteFieldSuffix());
        out.writeOptionalBoolean(useAllFields);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:29,代码来源:SimpleQueryStringBuilder.java

示例13: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    taskId.writeTo(out);
    out.writeOptionalWriteable(timeout);
    out.writeBoolean(waitForCompletion);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:GetTaskRequest.java

示例14: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(name);
    out.writeString(description);
    out.writeBoolean(site);
    out.writeBoolean(jvm);
    out.writeString(version);
    out.writeString(classname);
    out.writeBoolean(isolated);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:PluginInfo.java

示例15: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVLong(indexCount);
    out.writeVLong(indexTimeInMillis);
    out.writeVLong(indexCurrent);
    out.writeVLong(indexFailedCount);
    out.writeVLong(deleteCount);
    out.writeVLong(deleteTimeInMillis);
    out.writeVLong(deleteCurrent);
    out.writeVLong(noopUpdateCount);
    out.writeBoolean(isThrottled);
    out.writeLong(throttleTimeInMillis);

}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:IndexingStats.java


注:本文中的org.elasticsearch.common.io.stream.StreamOutput.writeBoolean方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。