當前位置: 首頁>>代碼示例>>Java>>正文


Java StreamOutput.writeInt方法代碼示例

本文整理匯總了Java中org.elasticsearch.common.io.stream.StreamOutput.writeInt方法的典型用法代碼示例。如果您正苦於以下問題:Java StreamOutput.writeInt方法的具體用法?Java StreamOutput.writeInt怎麽用?Java StreamOutput.writeInt使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.elasticsearch.common.io.stream.StreamOutput的用法示例。


在下文中一共展示了StreamOutput.writeInt方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    if (out.getVersion().before(Version.V_6_0_0_alpha1_UNRELEASED)) {
        out.writeShort((short)1); // this maps to InetSocketTransportAddress in 5.x
    }
    byte[] bytes = address.getAddress().getAddress();  // 4 bytes (IPv4) or 16 bytes (IPv6)
    out.writeByte((byte) bytes.length); // 1 byte
    out.write(bytes, 0, bytes.length);
    if (out.getVersion().onOrAfter(Version.V_5_0_3_UNRELEASED)) {
        out.writeString(address.getHostString());
    }
    // don't serialize scope ids over the network!!!!
    // these only make sense with respect to the local machine, and will only formulate
    // the address incorrectly remotely.
    out.writeInt(address.getPort());
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:17,代碼來源:TransportAddress.java

示例2: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(name);
    out.writeBoolean(committed);
    out.writeBoolean(search);
    out.writeInt(docCount);
    out.writeInt(delDocCount);
    out.writeLong(sizeInBytes);
    out.writeOptionalString(version.toString());
    out.writeOptionalBoolean(compound);
    out.writeOptionalString(mergeId);
    out.writeLong(memoryInBytes);
    
    boolean verbose = ramTree != null;
    out.writeBoolean(verbose);
    if (verbose) {
        writeRamTree(out, ramTree);
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:20,代碼來源:Segment.java

示例3: writeOperations

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
/**
 * Writes all operations in the given iterable to the given output stream including the size of the array
 * use {@link #readOperations(StreamInput)} to read it back.
 */
public static void writeOperations(StreamOutput outStream, List<Operation> toWrite) throws IOException {
    final ReleasableBytesStreamOutput out = new ReleasableBytesStreamOutput(BigArrays.NON_RECYCLING_INSTANCE);
    try {
        outStream.writeInt(toWrite.size());
        final BufferedChecksumStreamOutput checksumStreamOutput = new BufferedChecksumStreamOutput(out);
        for (Operation op : toWrite) {
            out.reset();
            final long start = out.position();
            out.skip(RamUsageEstimator.NUM_BYTES_INT);
            writeOperationNoSize(checksumStreamOutput, op);
            long end = out.position();
            int operationSize = (int) (out.position() - RamUsageEstimator.NUM_BYTES_INT - start);
            out.seek(start);
            out.writeInt(operationSize);
            out.seek(end);
            ReleasablePagedBytesReference bytes = out.bytes();
            bytes.writeTo(outStream);
        }
    } finally {
        Releasables.close(out.bytes());
    }

}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:28,代碼來源:Translog.java

示例4: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeNullableString(nodeIp);
    out.writeInt(nodePort);
    out.writeNullableString(tenantName);
    out.writeInt(operation.getValue());
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:9,代碼來源:ModifyTenantNodesRequest.java

示例5: 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.writeInt(((Number) v).intValue());
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:8,代碼來源:IntegerType.java

示例6: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeInt(maxNumSegments);
    out.writeBoolean(onlyExpungeDeletes);
    out.writeBoolean(flush);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:8,代碼來源:ForceMergeRequest.java

示例7: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeInt(threads);
    out.writeBoolean(ignoreIdleThreads);
    out.writeString(type);
    interval.writeTo(out);
    out.writeInt(snapshots);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:10,代碼來源:NodesHotThreadsRequest.java

示例8: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeInt(id);
    out.writeVInt(pingResponses.length);
    for (PingResponse pingResponse : pingResponses) {
        pingResponse.writeTo(out);
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:10,代碼來源:UnicastZenPing.java

示例9: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    shardCounts.writeTo(out);
    out.writeInt(shardsResultPerIndex.size());
    for (Map.Entry<String, List<ShardsSyncedFlushResult>> entry : shardsResultPerIndex.entrySet()) {
        out.writeString(entry.getKey());
        out.writeInt(entry.getValue().size());
        for (ShardsSyncedFlushResult shardsSyncedFlushResult : entry.getValue()) {
            shardsSyncedFlushResult.writeTo(out);
        }
    }
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:14,代碼來源:SyncedFlushResponse.java

示例10: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(name);
    out.writeInt(threads);
    out.writeInt(queue);
    out.writeInt(active);
    out.writeLong(rejected);
    out.writeInt(largest);
    out.writeLong(completed);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:11,代碼來源:ThreadPoolStats.java

示例11: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeNullableString(tenantName);
    int indexNum = indices == null ? 0 : indices.length;
    out.writeInt(indexNum);
    for (int i = 0; i < indexNum; ++i) {
        out.writeString(indices[i]);
    }
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:11,代碼來源:MigrateIndexTenantRequest.java

示例12: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(index);
    out.writeInt(shardId);
    timeout.writeTo(out);
    out.writeOptionalString(concreteIndex);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:9,代碼來源:InstanceShardOperationRequest.java

示例13: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    out.writeString(type);
    out.writeInt(minChildren);
    out.writeInt(maxChildren);
    out.writeVInt(scoreMode.ordinal());
    out.writeNamedWriteable(query);
    out.writeOptionalWriteable(innerHitBuilder);
    out.writeBoolean(ignoreUnmapped);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:11,代碼來源:HasChildQueryBuilder.java

示例14: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeOptionalString(info);
    out.writeInt(resendCount);
}
 
開發者ID:justor,項目名稱:elasticsearch_my,代碼行數:7,代碼來源:AbstractSimpleTransportTestCase.java

示例15: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //導入方法依賴的package包/類
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeInt(phase);
}
 
開發者ID:baidu,項目名稱:Elasticsearch,代碼行數:6,代碼來源:RecoveryEngineException.java


注:本文中的org.elasticsearch.common.io.stream.StreamOutput.writeInt方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。