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


Java StreamOutput.writeByte方法代码示例

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


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

示例1: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    timer.writeTo(out);
    out.writeByte(type.id());
    out.writeByte(stage.id());
    shardId.writeTo(out);
    out.writeOptionalStreamable(restoreSource);
    targetNode.writeTo(out);
    out.writeBoolean(sourceNode != null);
    if (sourceNode != null) {
        sourceNode.writeTo(out);
    }
    index.writeTo(out);
    translog.writeTo(out);
    verifyIndex.writeTo(out);
    out.writeBoolean(primary);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:RecoveryState.java

示例2: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeLong(id);
    out.writeVInt(size);
    for (int i = 0; i < size; i++) {
        out.writeVInt(docIds[i]);
    }
    if (lastEmittedDoc == null) {
        out.writeByte((byte) 0);
    } else if (lastEmittedDoc instanceof FieldDoc) {
        out.writeByte((byte) 1);
        Lucene.writeFieldDoc(out, (FieldDoc) lastEmittedDoc);
    } else {
        out.writeByte((byte) 2);
        Lucene.writeScoreDoc(out, lastEmittedDoc);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:19,代码来源:ShardFetchRequest.java

示例3: 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:justor,项目名称:elasticsearch_my,代码行数:19,代码来源:InternalOrder.java

示例4: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(SERIALIZATION_FORMAT);
    out.writeString(id);
    out.writeString(type);
    out.writeBytesReference(source);
    if (routing == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        out.writeString(routing);
    }
    if (parent == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        out.writeString(parent);
    }
    out.writeLong(version);
    out.writeLong(timestamp);
    out.writeLong(ttl);
    out.writeByte(versionType.getValue());
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:24,代码来源:Translog.java

示例5: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(index);
    out.writeOptionalString(type);
    out.writeString(id);
    out.writeOptionalString(routing);
    if (fields == null) {
        out.writeVInt(0);
    } else {
        out.writeVInt(fields.length);
        for (String field : fields) {
            out.writeString(field);
        }
    }

    out.writeLong(version);
    out.writeByte(versionType.getValue());

    FetchSourceContext.optionalWriteToStream(fetchSourceContext, out);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:21,代码来源:MultiGetRequest.java

示例6: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(entries.size());
    for (Entry entry : entries) {
        entry.snapshotId().writeTo(out);
        out.writeByte(entry.state().value());
        out.writeVInt(entry.indices().size());
        for (String index : entry.indices()) {
            out.writeString(index);
        }
        out.writeVInt(entry.shards().size());
        for (Map.Entry<ShardId, ShardRestoreStatus> shardEntry : entry.shards().entrySet()) {
            shardEntry.getKey().writeTo(out);
            shardEntry.getValue().writeTo(out);
        }
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:21,代码来源:RestoreInProgress.java

示例7: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(final StreamOutput out) throws IOException {
    out.writeVInt(activePrimaryShards);
    out.writeVInt(activeShards);
    out.writeVInt(relocatingShards);
    out.writeVInt(initializingShards);
    out.writeVInt(unassignedShards);
    out.writeVInt(numberOfNodes);
    out.writeVInt(numberOfDataNodes);
    out.writeByte(status.value());
    out.writeVInt(indices.size());
    for (ClusterIndexHealth indexHealth : this) {
        indexHealth.writeTo(out);
    }
    out.writeDouble(activeShardsPercent);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:ClusterStateHealth.java

示例8: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    timer.writeTo(out);
    out.writeByte(stage.id());
    shardId.writeTo(out);
    recoverySource.writeTo(out);
    targetNode.writeTo(out);
    out.writeOptionalWriteable(sourceNode);
    index.writeTo(out);
    translog.writeTo(out);
    verifyIndex.writeTo(out);
    out.writeBoolean(primary);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:14,代码来源:RecoveryState.java

示例9: writeTo

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

    out.writeBoolean(refresh);
    if (fields == null) {
        out.writeInt(-1);
    } else {
        out.writeInt(fields.length);
        for (String field : fields) {
            out.writeString(field);
        }
    }
    if (realtime == null) {
        out.writeByte((byte) -1);
    } else if (!realtime) {
        out.writeByte((byte) 0);
    } else {
        out.writeByte((byte) 1);
    }
    out.writeBoolean(ignoreErrorsOnGeneratedFields);
    out.writeByte(versionType.getValue());
    out.writeLong(version);

    FetchSourceContext.optionalWriteToStream(fetchSourceContext, out);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:31,代码来源:GetRequest.java

示例10: writeOrder

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
/**
 * Writes the given order to the given output (based on the id of the order).
 */
public static void writeOrder(InternalOrder order, StreamOutput out) throws IOException {
    out.writeByte(order.id());
    if (order instanceof InternalOrder.Aggregation) {
        out.writeBoolean(order.asc());
        out.writeString(order.key());
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:InternalOrder.java

示例11: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(sortValues.length);
    for (Object sortValue : sortValues) {
        if (sortValue == null) {
            out.writeByte((byte) 0);
        } else {
            Class type = sortValue.getClass();
            if (type == String.class) {
                out.writeByte((byte) 1);
                out.writeString((String) sortValue);
            } else if (type == Integer.class) {
                out.writeByte((byte) 2);
                out.writeInt((Integer) sortValue);
            } else if (type == Long.class) {
                out.writeByte((byte) 3);
                out.writeLong((Long) sortValue);
            } else if (type == Float.class) {
                out.writeByte((byte) 4);
                out.writeFloat((Float) sortValue);
            } else if (type == Double.class) {
                out.writeByte((byte) 5);
                out.writeDouble((Double) sortValue);
            } else if (type == Byte.class) {
                out.writeByte((byte) 6);
                out.writeByte((Byte) sortValue);
            } else if (type == Short.class) {
                out.writeByte((byte) 7);
                out.writeShort((Short) sortValue);
            } else if (type == Boolean.class) {
                out.writeByte((byte) 8);
                out.writeBoolean((Boolean) sortValue);
            } else {
                throw new IOException("Can't handle sort field value of type [" + type + "]");
            }
        }
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:39,代码来源:SearchSortValues.java

示例12: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    ExecutionPhases.toStream(out, executionPhase);
    out.writeVInt(downstreamExecutionPhaseId);
    out.writeByte(downstreamExecutionPhaseInputId);

    out.writeVInt(downstreamNodes.size());
    for (String executionNode : downstreamNodes) {
        out.writeString(executionNode);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:12,代码来源:NodeOperation.java

示例13: writeHeader

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
public static void writeHeader(StreamOutput output, long requestId, byte status, Version version, int messageSize) throws IOException {
    output.writeByte((byte)'E');
    output.writeByte((byte)'S');
    // write the size, the size indicates the remaining message size, not including the size int
    output.writeInt(messageSize + REQUEST_ID_SIZE + STATUS_SIZE + VERSION_ID_SIZE);
    output.writeLong(requestId);
    output.writeByte(status);
    output.writeInt(version.id);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:TcpHeader.java

示例14: writeTo

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

    out.writeVInt(indices.length);
    for (String index : indices) {
        out.writeString(index);
    }

    out.writeOptionalString(routing);
    out.writeOptionalString(preference);

    if (scroll == null) {
        out.writeBoolean(false);
    } else {
        out.writeBoolean(true);
        scroll.writeTo(out);
    }
    out.writeBytesReference(source);
    out.writeBytesReference(extraSource);
    out.writeStringArray(types);
    indicesOptions.writeIndicesOptions(out);

    out.writeBytesReference(templateSource);
    boolean hasTemplate = template != null;
    out.writeBoolean(hasTemplate);
    if (hasTemplate) {
        template.writeTo(out);
    }

    out.writeOptionalBoolean(requestCache);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:34,代码来源:SearchRequest.java

示例15: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入方法依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeString(scriptLang);
    out.writeOptionalString(id);
    out.writeBytesReference(source);
    out.writeByte(opType.id());
    out.writeLong(version);
    out.writeByte(versionType.getValue());
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:PutIndexedScriptRequest.java


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