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


Java StreamInput.readFloat方法代码示例

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


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

示例1: innerReadFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
protected void innerReadFrom(StreamInput in) throws IOException {
    shardId = ShardId.readShardId(in);
    searchType = SearchType.fromId(in.readByte());
    numberOfShards = in.readVInt();
    scroll = in.readOptionalWriteable(Scroll::new);
    source = in.readOptionalWriteable(SearchSourceBuilder::new);
    types = in.readStringArray();
    aliasFilter = new AliasFilter(in);
    if (in.getVersion().onOrAfter(Version.V_5_2_0_UNRELEASED)) {
        indexBoost = in.readFloat();
    } else {
        // Nodes < 5.2.0 doesn't send index boost. Read it from source.
        if (source != null) {
            Optional<SearchSourceBuilder.IndexBoost> boost = source.indexBoosts()
                .stream()
                .filter(ib -> ib.getIndex().equals(shardId.getIndexName()))
                .findFirst();
            indexBoost = boost.isPresent() ? boost.get().getBoost() : 1.0f;
        } else {
            indexBoost = 1.0f;
        }
    }
    nowInMillis = in.readVLong();
    requestCache = in.readOptionalBoolean();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:26,代码来源:ShardSearchLocalRequest.java

示例2: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    searchRequest = new SearchRequest();
    searchRequest.readFrom(in);
    abortOnVersionConflict = in.readBoolean();
    size = in.readVInt();
    refresh = in.readBoolean();
    timeout = new TimeValue(in);
    activeShardCount = ActiveShardCount.readFrom(in);
    retryBackoffInitialTime = new TimeValue(in);
    maxRetries = in.readVInt();
    requestsPerSecond = in.readFloat();
    if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
        slices = in.readVInt();
    } else {
        slices = 1;
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:20,代码来源:AbstractBulkByScrollRequest.java

示例3: Status

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
public Status(StreamInput in) throws IOException {
    if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
        sliceId = in.readOptionalVInt();
    } else {
        sliceId = null;
    }
    total = in.readVLong();
    updated = in.readVLong();
    created = in.readVLong();
    deleted = in.readVLong();
    batches = in.readVInt();
    versionConflicts = in.readVLong();
    noops = in.readVLong();
    bulkRetries = in.readVLong();
    searchRetries = in.readVLong();
    throttled = new TimeValue(in);
    requestsPerSecond = in.readFloat();
    reasonCancelled = in.readOptionalString();
    throttledUntil = new TimeValue(in);
    if (in.getVersion().onOrAfter(Version.V_5_1_1_UNRELEASED)) {
        sliceStatuses = in.readList(stream -> stream.readOptionalWriteable(StatusOrException::new));
    } else {
        sliceStatuses = emptyList();
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:26,代码来源:BulkByScrollTask.java

示例4: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
public void readFrom(StreamInput in, StreamContext context) throws IOException {
    totalHits = in.readVLong();
    maxScore = in.readFloat();
    int size = in.readVInt();
    if (size == 0) {
        hits = EMPTY;
    } else {
        if (context.streamShardTarget() == StreamContext.ShardTargetType.LOOKUP) {
            // read the lookup table first
            int lookupSize = in.readVInt();
            for (int i = 0; i < lookupSize; i++) {
                context.handleShardLookup().put(in.readVInt(), readSearchShardTarget(in));
            }
        }

        hits = new InternalSearchHit[size];
        for (int i = 0; i < hits.length; i++) {
            hits[i] = readSearchHit(in, context);
        }
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:22,代码来源:InternalSearchHits.java

示例5: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    cols = in.readStringArray();
    includeTypes = in.readBoolean();
    duration = in.readFloat();
    if (includeTypes) {
        int numColTypes = in.readVInt();
        colTypes = new DataType[numColTypes];
        for (int i = 0; i < numColTypes; i++) {
            colTypes[i] = DataTypes.fromStream(in);
        }
    } else {
        colTypes = EMPTY_TYPES;
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:17,代码来源:SQLBaseResponse.java

示例6: readFrom

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

    querySource = in.readBytesReference();

    int typesSize = in.readVInt();
    if (typesSize > 0) {
        types = new String[typesSize];
        for (int i = 0; i < typesSize; i++) {
            types[i] = in.readString();
        }
    }
    int aliasesSize = in.readVInt();
    if (aliasesSize > 0) {
        filteringAliases = new String[aliasesSize];
        for (int i = 0; i < aliasesSize; i++) {
            filteringAliases[i] = in.readString();
        }
    }
    nowInMillis = in.readVLong();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:24,代码来源:ShardExistsRequest.java

示例7: readSortValue

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

示例8: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    totalHits = in.readVLong();
    maxScore = in.readFloat();
    int size = in.readVInt();
    if (size == 0) {
        hits = EMPTY;
    } else {
        hits = new SearchHit[size];
        for (int i = 0; i < hits.length; i++) {
            hits[i] = SearchHit.readSearchHit(in);
        }
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:15,代码来源:SearchHits.java

示例9: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    text = in.readText();
    score = in.readFloat();
    highlighted = in.readOptionalText();
    collateMatch = in.readOptionalBoolean();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:8,代码来源:Suggest.java

示例10: TermSuggestionBuilder

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
/**
 * Read from a stream.
 */
public TermSuggestionBuilder(StreamInput in) throws IOException {
    super(in);
    suggestMode = SuggestMode.readFromStream(in);
    accuracy = in.readFloat();
    sort = SortBy.readFromStream(in);
    stringDistance = StringDistanceImpl.readFromStream(in);
    maxEdits = in.readVInt();
    maxInspections = in.readVInt();
    maxTermFreq = in.readFloat();
    prefixLength = in.readVInt();
    minWordLength = in.readVInt();
    minDocFreq = in.readFloat();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:17,代码来源:TermSuggestionBuilder.java

示例11: PhraseSuggestionBuilder

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
/**
 * Read from a stream.
 */
public PhraseSuggestionBuilder(StreamInput in) throws IOException {
    super(in);
    maxErrors = in.readFloat();
    realWordErrorLikelihood = in.readFloat();
    confidence = in.readFloat();
    gramSize = in.readOptionalVInt();
    model = in.readOptionalNamedWriteable(SmoothingModel.class);
    forceUnigrams = in.readBoolean();
    tokenLimit = in.readVInt();
    preTag = in.readOptionalString();
    postTag = in.readOptionalString();
    separator = in.readString();
    if (in.readBoolean()) {
        collateQuery = new Script(in);
    }
    collateParams = in.readMap();
    collatePrune = in.readOptionalBoolean();
    int generatorsEntries = in.readVInt();
    for (int i = 0; i < generatorsEntries; i++) {
        String type = in.readString();
        int numberOfGenerators = in.readVInt();
        List<CandidateGenerator> generatorsList = new ArrayList<>(numberOfGenerators);
        for (int g = 0; g < numberOfGenerators; g++) {
            DirectCandidateGeneratorBuilder generator = new DirectCandidateGeneratorBuilder(in);
            generatorsList.add(generator);
        }
        generators.put(type, generatorsList);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:33,代码来源:PhraseSuggestionBuilder.java

示例12: SearchSortValues

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

示例13: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    id = in.readText();
    index = in.readText();
    score = in.readFloat();
    int size = in.readVInt();
    if (size > 0) {
        hl = new HashMap<>(size);
        for (int j = 0; j < size; j++) {
            hl.put(in.readString(), HighlightField.readHighlightField(in));
        }
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:14,代码来源:PercolateResponse.java

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

示例15: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    requestsPerSecond = in.readFloat();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:6,代码来源:RethrottleRequest.java


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