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


Java StreamOutput类代码示例

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


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

示例1: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    searchRequest.writeTo(out);
    out.writeBoolean(abortOnVersionConflict);
    out.writeVInt(size);
    out.writeBoolean(refresh);
    timeout.writeTo(out);
    activeShardCount.writeTo(out);
    retryBackoffInitialTime.writeTo(out);
    out.writeVInt(maxRetries);
    out.writeFloat(requestsPerSecond);
    if (out.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
        out.writeVInt(slices);
    } else {
        if (slices > 1) {
            throw new IllegalArgumentException("Attempting to send sliced reindex-style request to a node that doesn't support "
                    + "it. Version is [" + out.getVersion() + "] but must be [" + Version.V_5_1_1_UNRELEASED + "]");
        }
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:22,代码来源:AbstractBulkByScrollRequest.java

示例2: 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

示例3: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeString(index);
    out.writeString(type);
    out.writeString(id);
    out.writeVLong(docVersion);
    final boolean docExists = isExists();
    out.writeBoolean(docExists);
    out.writeBoolean(artificial);
    out.writeVLong(tookInMillis);
    out.writeBoolean(hasTermVectors());
    if (hasTermVectors()) {
        out.writeBytesReference(headerRef);
        out.writeBytesReference(termVectors);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:TermVectorsResponse.java

示例4: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    // Stream References
    if (updateColumns != null) {
        out.writeVInt(updateColumns.length);
        for (String column : updateColumns) {
            out.writeString(column);
        }
    } else {
        out.writeVInt(0);
    }
    if (insertColumns != null) {
        out.writeVInt(insertColumns.length);
        for (Reference reference : insertColumns) {
            Reference.toStream(reference, out);
        }
    } else {
        out.writeVInt(0);
    }
    out.writeBoolean(continueOnError);
    out.writeBoolean(overwriteDuplicates);
    out.writeBoolean(validateGeneratedColumns);
    writeItems(out);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:26,代码来源:ShardUpsertRequest.java

示例5: writeTo

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

    out.writeVInt(types.length);
    for (String type : types) {
        out.writeString(type);
    }
    if (filteringAliases != null) {
        out.writeVInt(filteringAliases.length);
        for (String alias : filteringAliases) {
            out.writeString(alias);
        }
    } else {
        out.writeVInt(0);
    }

    out.writeBoolean(explain);
    out.writeBoolean(rewrite);
    out.writeVLong(nowInMillis);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:23,代码来源:ShardValidateQueryRequest.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包/类
/**
 * {@inheritDoc}
 */
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeVInt(entries.size());
    for (Entry entry : entries) {
        entry.snapshot().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 (ObjectObjectCursor<ShardId, ShardRestoreStatus> shardEntry : entry.shards()) {
            shardEntry.key.writeTo(out);
            shardEntry.value.writeTo(out);
        }
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:21,代码来源:RestoreInProgress.java

示例8: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    node.writeTo(out);
    if (out.getVersion().before(Version.V_6_0_0_alpha1_UNRELEASED)) {
        // legacy version
        out.writeLong(-1L);
    }
    out.writeOptionalString(allocationId);
    allocationStatus.writeTo(out);
    if (storeException != null) {
        out.writeBoolean(true);
        out.writeException(storeException);
    } else {
        out.writeBoolean(false);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:IndicesShardStoresResponse.java

示例9: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入依赖的package包/类
@Override
public void writeTo(final StreamOutput out) throws IOException {
    out.writeString(index);
    out.writeVInt(numberOfShards);
    out.writeVInt(numberOfReplicas);
    out.writeVInt(activePrimaryShards);
    out.writeVInt(activeShards);
    out.writeVInt(relocatingShards);
    out.writeVInt(initializingShards);
    out.writeVInt(unassignedShards);
    out.writeByte(status.value());

    out.writeVInt(shards.size());
    for (ClusterShardHealth shardHealth : this) {
        shardHealth.writeTo(out);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:18,代码来源:ClusterIndexHealth.java

示例10: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    out.writeOptionalStreamable(docs);
    out.writeOptionalStreamable(store);
    out.writeOptionalStreamable(indexing);
    out.writeOptionalStreamable(get);
    out.writeOptionalStreamable(search);
    out.writeOptionalStreamable(merge);
    out.writeOptionalStreamable(refresh);
    out.writeOptionalStreamable(flush);
    out.writeOptionalStreamable(warmer);
    out.writeOptionalStreamable(queryCache);
    out.writeOptionalStreamable(fieldData);
    out.writeOptionalStreamable(completion);
    out.writeOptionalStreamable(segments);
    out.writeOptionalStreamable(translog);
    out.writeOptionalStreamable(requestCache);
    out.writeOptionalStreamable(recoveryStats);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:20,代码来源:CommonStats.java

示例11: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入依赖的package包/类
@Override
public final void writeTo(StreamOutput out) throws IOException {
    out.writeByte(type);
    out.writeLong(maxDoc);
    out.writeLong(docCount);
    out.writeLong(sumDocFreq);
    out.writeLong(sumTotalTermFreq);
    out.writeBoolean(isSearchable);
    out.writeBoolean(isAggregatable);
    if (out.getVersion().onOrAfter(Version.V_5_2_0_UNRELEASED)) {
        out.writeBoolean(hasMinMax);
        if (hasMinMax) {
            writeMinMax(out);
        }
    } else {
        assert hasMinMax : "cannot serialize null min/max fieldstats in a mixed-cluster " +
                "with pre-" + Version.V_5_2_0_UNRELEASED + " nodes, remote version [" + out.getVersion() + "]";
        writeMinMax(out);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:21,代码来源:FieldStats.java

示例12: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    out.writeBoolean(settings);
    out.writeBoolean(os);
    out.writeBoolean(process);
    out.writeBoolean(jvm);
    out.writeBoolean(threadPool);
    out.writeBoolean(transport);
    out.writeBoolean(http);
    out.writeBoolean(plugins);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:13,代码来源:NodesInfoRequest.java

示例13: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    out.writeNamedWriteable(format);
    out.writeDoubleArray(keys);
    TDigestState.write(state, out);
    out.writeBoolean(keyed);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:AbstractInternalTDigestPercentiles.java

示例14: writeTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入依赖的package包/类
@Override
public void writeTo(StreamOutput out) throws IOException {
    super.writeTo(out);
    flags.writeTo(out);
    out.writeString(indexName);
    out.writeInt(shardId);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:IndexShardStatsRequest.java

示例15: doWriteTo

import org.elasticsearch.common.io.stream.StreamOutput; //导入依赖的package包/类
@Override
protected void doWriteTo(StreamOutput out) throws IOException {
    out.writeBoolean(explain);
    out.writeOptionalWriteable(fetchSourceContext);
    boolean hasFieldDataFields = fieldDataFields != null;
    out.writeBoolean(hasFieldDataFields);
    if (hasFieldDataFields) {
        out.writeVInt(fieldDataFields.size());
        for (String fieldName : fieldDataFields) {
            out.writeString(fieldName);
        }
    }
    out.writeOptionalWriteable(storedFieldsContext);
    out.writeVInt(from);
    out.writeOptionalWriteable(highlightBuilder);
    boolean hasScriptFields = scriptFields != null;
    out.writeBoolean(hasScriptFields);
    if (hasScriptFields) {
        out.writeVInt(scriptFields.size());
        for (ScriptField scriptField : scriptFields) {
            scriptField.writeTo(out);
        }
    }
    out.writeVInt(size);
    boolean hasSorts = sorts != null;
    out.writeBoolean(hasSorts);
    if (hasSorts) {
        out.writeVInt(sorts.size());
        for (SortBuilder<?> sort : sorts) {
            out.writeNamedWriteable(sort);
        }
    }
    out.writeBoolean(trackScores);
    out.writeBoolean(version);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:36,代码来源:TopHitsAggregationBuilder.java


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