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


Java StreamInput.readString方法代码示例

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


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

示例1: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    int size = in.readVInt();
    ImmutableOpenMap.Builder<String, ImmutableOpenMap<String, MappingMetaData>> indexMapBuilder = ImmutableOpenMap.builder();
    for (int i = 0; i < size; i++) {
        String key = in.readString();
        int valueSize = in.readVInt();
        ImmutableOpenMap.Builder<String, MappingMetaData> typeMapBuilder = ImmutableOpenMap.builder();
        for (int j = 0; j < valueSize; j++) {
            typeMapBuilder.put(in.readString(), new MappingMetaData(in));
        }
        indexMapBuilder.put(key, typeMapBuilder.build());
    }
    mappings = indexMapBuilder.build();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:GetMappingsResponse.java

示例2: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    groups = new ClusterSearchShardsGroup[in.readVInt()];
    for (int i = 0; i < groups.length; i++) {
        groups[i] = ClusterSearchShardsGroup.readSearchShardsGroupResponse(in);
    }
    nodes = new DiscoveryNode[in.readVInt()];
    for (int i = 0; i < nodes.length; i++) {
        nodes[i] = new DiscoveryNode(in);
    }
    if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
        int size = in.readVInt();
        indicesAndFilters = new HashMap<>();
        for (int i = 0; i < size; i++) {
            String index = in.readString();
            AliasFilter aliasFilter = new AliasFilter(in);
            indicesAndFilters.put(index, aliasFilter);
        }
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:22,代码来源:ClusterSearchShardsResponse.java

示例3: readOrder

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
/**
 * Reads an order from the given input (based on the id of the order).
 *
 * @see Streams#writeOrder(InternalOrder, org.elasticsearch.common.io.stream.StreamOutput)
 */
public static InternalOrder readOrder(StreamInput in) throws IOException {
    byte id = in.readByte();
    switch (id) {
        case 1: return (InternalOrder) Histogram.Order.KEY_ASC;
        case 2: return (InternalOrder) Histogram.Order.KEY_DESC;
        case 3: return (InternalOrder) Histogram.Order.COUNT_ASC;
        case 4: return (InternalOrder) Histogram.Order.COUNT_DESC;
        case 0:
            boolean asc = in.readBoolean();
            String key = in.readString();
            return new InternalOrder.Aggregation(key, asc);
        default:
            throw new RuntimeException("unknown histogram order");
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:21,代码来源:InternalOrder.java

示例4: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    name = in.readString();
    int numTypes = in.readVInt();
    argumentTypes = new ArrayList<>(numTypes);

    for (int i = 0; i < numTypes; i++) {
        argumentTypes.add(DataTypes.fromStream(in));
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:FunctionIdent.java

示例5: CancelAllocationCommand

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
/**
 * Read from a stream.
 */
public CancelAllocationCommand(StreamInput in) throws IOException {
    index = in.readString();
    shardId = in.readVInt();
    node = in.readString();
    allowPrimary = in.readBoolean();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:CancelAllocationCommand.java

示例6: ElasticsearchException

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
public ElasticsearchException(StreamInput in) throws IOException {
    super(in.readOptionalString(), in.readThrowable());
    readStackTrace(this, in);
    int numKeys = in.readVInt();
    for (int i = 0; i < numKeys; i++) {
        final String key = in.readString();
        final int numValues = in.readVInt();
        final ArrayList<String> values = new ArrayList<>(numValues);
        for (int j = 0; j < numValues; j++) {
            values.add(in.readString());
        }
        headers.put(key, values);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:15,代码来源:ElasticsearchException.java

示例7: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    index = in.readString();
    type = in.readString();
    id = in.readString();
    exists = in.readBoolean();
    if (in.readBoolean()) {
        explanation = readExplanation(in);
    }
    if (in.readBoolean()) {
        getResult = GetResult.readGetResult(in);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:ExplainResponse.java

示例8: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    name = in.readString();
    type = in.readString();
    settings = readSettingsFromStream(in);
    readTimeout(in);
    verify = in.readBoolean();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:PutRepositoryRequest.java

示例9: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    clusterName = new ClusterName(in);
    indexUUID = in.readString();
    shardId = ShardId.readShardId(in);
    timeout = new TimeValue(in.readLong(), TimeUnit.MILLISECONDS);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:9,代码来源:IndicesStore.java

示例10: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    type = in.readString();
    id = in.readString();
    routing = in.readOptionalString();
    refresh = in.readBoolean();
    version = in.readLong();
    versionType = VersionType.fromValue(in.readByte());
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:DeleteRequest.java

示例11: CollectorResult

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
/**
 * Read from a stream.
 */
public CollectorResult(StreamInput in) throws IOException {
    this.collectorName = in.readString();
    this.reason = in.readString();
    this.time = in.readLong();
    int size = in.readVInt();
    this.children = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        CollectorResult child = new CollectorResult(in);
        this.children.add(child);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:CollectorResult.java

示例12: innerReadFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
protected void innerReadFrom(StreamInput in) throws IOException {
    name = in.readString();
    size = in.readVInt();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:5,代码来源:Suggest.java

示例13: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    type = in.readString();
    id = in.readString();

    if (in.readBoolean()) {
        doc = in.readBytesReference();
        if (in.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
            xContentType = XContentType.readFrom(in);
        } else {
            xContentType = XContentFactory.xContentType(doc);
        }
    }
    routing = in.readOptionalString();
    parent = in.readOptionalString();
    preference = in.readOptionalString();
    long flags = in.readVLong();

    flagsEnum.clear();
    for (Flag flag : Flag.values()) {
        if ((flags & (1 << flag.ordinal())) != 0) {
            flagsEnum.add(flag);
        }
    }
    int numSelectedFields = in.readVInt();
    if (numSelectedFields > 0) {
        selectedFields = new HashSet<>();
        for (int i = 0; i < numSelectedFields; i++) {
            selectedFields.add(in.readString());
        }
    }
    if (in.readBoolean()) {
        perFieldAnalyzer = readPerFieldAnalyzer(in.readMap());
    }
    if (in.readBoolean()) {
        filterSettings = new FilterSettings();
        filterSettings.readFrom(in);
    }
    realtime = in.readBoolean();
    versionType = VersionType.fromValue(in.readByte());
    version = in.readLong();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:44,代码来源:TermVectorsRequest.java

示例14: DateHistogramInterval

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
/**
 * Read from a stream.
 */
public DateHistogramInterval(StreamInput in) throws IOException {
    expression = in.readString();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:DateHistogramInterval.java

示例15: BufferPool

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
public BufferPool(StreamInput in) throws IOException {
    name = in.readString();
    count = in.readLong();
    totalCapacity = in.readLong();
    used = in.readLong();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:7,代码来源:JvmStats.java


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