當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。