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


Java StreamInput.readVInt方法代码示例

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


在下文中一共展示了StreamInput.readVInt方法的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, List<IndexWarmersMetaData.Entry>> indexMapBuilder = ImmutableOpenMap.builder();
    for (int i = 0; i < size; i++) {
        String key = in.readString();
        int valueSize = in.readVInt();
        List<IndexWarmersMetaData.Entry> warmerEntryBuilder = new ArrayList<>();
        for (int j = 0; j < valueSize; j++) {
            String name = in.readString();
            String[] types = in.readStringArray();
            BytesReference source = in.readBytesReference();
            Boolean queryCache = null;
            queryCache = in.readOptionalBoolean();
            warmerEntryBuilder.add(new IndexWarmersMetaData.Entry(
                            name,
                            types,
                            queryCache,
                            source)
            );
        }
        indexMapBuilder.put(key, Collections.unmodifiableList(warmerEntryBuilder));
    }
    warmers = indexMapBuilder.build();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:27,代码来源:GetWarmersResponse.java

示例2: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    final int size = in.readVInt();
    indicesMergedFieldStats = new HashMap<>(size);
    for (int i = 0; i < size; i++) {
        String key = in.readString();
        int indexSize = in.readVInt();
        Map<String, FieldStats> indexFieldStats = new HashMap<>(indexSize);
        indicesMergedFieldStats.put(key, indexFieldStats);
        for (int j = 0; j < indexSize; j++) {
            key = in.readString();
            FieldStats value = FieldStats.read(in);
            indexFieldStats.put(key, value);
        }
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:FieldStatsResponse.java

示例3: MoreLikeThisQueryBuilder

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
/**
 * Read from a stream.
 */
public MoreLikeThisQueryBuilder(StreamInput in) throws IOException {
    super(in);
    fields = in.readOptionalStringArray();
    likeTexts = in.readStringArray();
    likeItems = in.readList(Item::new).toArray(new Item[0]);
    unlikeTexts = in.readStringArray();
    unlikeItems = in.readList(Item::new).toArray(new Item[0]);
    maxQueryTerms = in.readVInt();
    minTermFreq = in.readVInt();
    minDocFreq = in.readVInt();
    maxDocFreq = in.readVInt();
    minWordLength = in.readVInt();
    maxWordLength = in.readVInt();
    stopWords = in.readOptionalStringArray();
    analyzer = in.readOptionalString();
    minimumShouldMatch = in.readString();
    boostTerms = (Float) in.readGenericValue();
    include = in.readBoolean();
    failOnUnsupportedField = in.readBoolean();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:24,代码来源:MoreLikeThisQueryBuilder.java

示例4: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    routing = in.readOptionalString();
    jobId = new UUID(in.readLong(), in.readLong());

    int size = in.readVInt();
    locations = new IntArrayList(size);
    for (int i = 0; i < size; i++) {
        locations.add(in.readVInt());
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:13,代码来源:ShardRequest.java

示例5: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    indices = in.readStringArray();
    int nStatus = in.readVInt();
    statuses = EnumSet.noneOf(ClusterHealthStatus.class);
    for (int i = 0; i < nStatus; i++) {
        statuses.add(ClusterHealthStatus.fromValue(in.readByte()));
    }
    indicesOptions = IndicesOptions.readIndicesOptions(in);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:12,代码来源:IndicesShardStoresRequest.java

示例6: readBlockSet

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
private static ImmutableSet<ClusterBlock> readBlockSet(StreamInput in) throws IOException {
    ImmutableSet.Builder<ClusterBlock> builder = ImmutableSet.builder();
    int size = in.readVInt();
    for (int i = 0; i < size; i++) {
        builder.add(ClusterBlock.readClusterBlock(in));
    }
    return builder.build();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:ClusterBlocks.java

示例7: readSettingsFromStream

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
public static Settings readSettingsFromStream(StreamInput in) throws IOException {
    Builder builder = new Builder();
    int numberOfSettings = in.readVInt();
    for (int i = 0; i < numberOfSettings; i++) {
        builder.put(in.readString(), in.readString());
    }
    return builder.build();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:Settings.java

示例8: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    int size = in.readVInt();
    infos = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        ThreadPool.Info info = new ThreadPool.Info();
        info.readFrom(in);
        infos.add(info);
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:11,代码来源:ThreadPoolInfo.java

示例9: MultiLineStringBuilder

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
/**
 * Read from a stream.
 */
public MultiLineStringBuilder(StreamInput in) throws IOException {
    int size = in.readVInt();
    for (int i = 0; i < size; i++) {
        linestring(new LineStringBuilder(in));
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:MultiLineStringBuilder.java

示例10: MoveAllocationCommand

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

示例11: readFieldDoc

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
public static FieldDoc readFieldDoc(StreamInput in) throws IOException {
    Comparable[] cFields = new Comparable[in.readVInt()];
    for (int j = 0; j < cFields.length; j++) {
        byte type = in.readByte();
        if (type == 0) {
            cFields[j] = null;
        } else if (type == 1) {
            cFields[j] = in.readString();
        } else if (type == 2) {
            cFields[j] = in.readInt();
        } else if (type == 3) {
            cFields[j] = in.readLong();
        } else if (type == 4) {
            cFields[j] = in.readFloat();
        } else if (type == 5) {
            cFields[j] = in.readDouble();
        } else if (type == 6) {
            cFields[j] = in.readByte();
        } else if (type == 7) {
            cFields[j] = in.readShort();
        } else if (type == 8) {
            cFields[j] = in.readBoolean();
        } else if (type == 9) {
            cFields[j] = in.readBytesRef();
        } else {
            throw new IOException("Can't match type [" + type + "]");
        }
    }
    return new FieldDoc(in.readVInt(), in.readFloat(), cFields);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:31,代码来源:Lucene.java

示例12: BucketScriptPipelineAggregationBuilder

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
/**
 * Read from a stream.
 */
public BucketScriptPipelineAggregationBuilder(StreamInput in) throws IOException {
    super(in, NAME);
    int mapSize = in.readVInt();
    bucketsPathsMap = new HashMap<String, String>(mapSize);
    for (int i = 0; i < mapSize; i++) {
        bucketsPathsMap.put(in.readString(), in.readString());
    }
    script = new Script(in);
    format = in.readOptionalString();
    gapPolicy = GapPolicy.readFrom(in);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:BucketScriptPipelineAggregationBuilder.java

示例13: SuggestBuilder

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
/**
 * Read from a stream.
 */
public SuggestBuilder(StreamInput in) throws IOException {
    globalText = in.readOptionalString();
    final int size = in.readVInt();
    for (int i = 0; i < size; i++) {
        suggestions.put(in.readString(), in.readNamedWriteable(SuggestionBuilder.class));
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:11,代码来源:SuggestBuilder.java

示例14: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    name = in.readString();
    int size = in.readVInt();
    values = new ArrayList<>(size);
    for (int i = 0; i < size; i++) {
        values.add(in.readGenericValue());
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:10,代码来源:SearchHitField.java

示例15: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    recoveryId = in.readLong();
    shardId = ShardId.readShardId(in);
    totalTranslogOps = in.readVInt();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:RecoveryPrepareForTranslogOperationsRequest.java


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