當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。