当前位置: 首页>>代码示例>>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;未经允许,请勿转载。