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


Java StreamInput.readBytesReference方法代码示例

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


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

示例1: RemoteInfo

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
/**
 * Read from a stream.
 */
public RemoteInfo(StreamInput in) throws IOException {
    scheme = in.readString();
    host = in.readString();
    port = in.readVInt();
    query = in.readBytesReference();
    username = in.readOptionalString();
    password = in.readOptionalString();
    int headersLength = in.readVInt();
    Map<String, String> headers = new HashMap<>(headersLength);
    for (int i = 0; i < headersLength; i++) {
        headers.put(in.readString(), in.readString());
    }
    this.headers = unmodifiableMap(headers);
    if (in.getVersion().onOrAfter(Version.V_5_2_0_UNRELEASED)) {
        socketTimeout = new TimeValue(in);
        connectTimeout = new TimeValue(in);
    } else {
        socketTimeout = DEFAULT_SOCKET_TIMEOUT;
        connectTimeout = DEFAULT_CONNECT_TIMEOUT;
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:25,代码来源:RemoteInfo.java

示例2: readFrom

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

    source = in.readBytesReference();

    int typesSize = in.readVInt();
    if (typesSize > 0) {
        types = new String[typesSize];
        for (int i = 0; i < typesSize; i++) {
            types[i] = in.readString();
        }
    }

    explain = in.readBoolean();
    rewrite = in.readBoolean();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:18,代码来源:ValidateQueryRequest.java

示例3: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    index = in.readString();
    type = in.readOptionalString();
    id = in.readString();
    version = in.readLong();
    exists = in.readBoolean();
    if (exists) {
        source = in.readBytesReference();
        if (source.length() == 0) {
            source = null;
        }
        int size = in.readVInt();
        if (size == 0) {
            fields = emptyMap();
        } else {
            fields = new HashMap<>(size);
            for (int i = 0; i < size; i++) {
                GetField field = readGetField(in);
                fields.put(field.getName(), field);
            }
        }
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:25,代码来源:GetResult.java

示例4: readFrom

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

    lang = in.readString();

    if (lang.isEmpty()) {
        lang = null;
    }

    id = in.readOptionalString();
    content = in.readBytesReference();
    if (in.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
        xContentType = XContentType.readFrom(in);
    } else {
        xContentType = XContentFactory.xContentType(content);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:19,代码来源:PutStoredScriptRequest.java

示例5: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public IndexWarmersMetaData readFrom(StreamInput in) throws IOException {
    Entry[] entries = new Entry[in.readVInt()];
    for (int i = 0; i < entries.length; i++) {
        String name = in.readString();
        String[] types = in.readStringArray();
        BytesReference source = null;
        if (in.readBoolean()) {
            source = in.readBytesReference();
        }
        Boolean queryCache;
        queryCache = in.readOptionalBoolean();
        entries[i] = new Entry(name, types, queryCache, source);
    }
    return new IndexWarmersMetaData(entries);
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:17,代码来源:IndexWarmersMetaData.java

示例6: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    type = in.readOptionalString();
    id = in.readOptionalString();
    routing = in.readOptionalString();
    parent = in.readOptionalString();
    if (in.getVersion().before(Version.V_6_0_0_alpha1_UNRELEASED)) {
        in.readOptionalString(); // timestamp
        in.readOptionalWriteable(TimeValue::new); // ttl
    }
    source = in.readBytesReference();
    opType = OpType.fromId(in.readByte());
    version = in.readLong();
    versionType = VersionType.fromValue(in.readByte());
    pipeline = in.readOptionalString();
    isRetry = in.readBoolean();
    autoGeneratedTimestamp = in.readLong();
    if (in.getVersion().onOrAfter(Version.V_5_3_0_UNRELEASED)) {
        contentType = in.readOptionalWriteable(XContentType::readFrom);
    } else {
        contentType = XContentFactory.xContentType(source);
    }
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:25,代码来源:IndexRequest.java

示例7: 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);
    String name = in.readString();
    position = in.readVLong();
    long length = in.readVLong();
    String checksum = in.readOptionalString();
    content = in.readBytesReference();
    Version writtenBy = null;
    String versionString = in.readOptionalString();
    writtenBy = Lucene.parseVersionLenient(versionString, null);
    metaData = new StoreFileMetaData(name, length, checksum, writtenBy);
    lastChunk = in.readBoolean();
    totalTranslogOps = in.readVInt();
    sourceThrottleTimeInNanos = in.readLong();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:19,代码来源:RecoveryFileChunkRequest.java

示例8: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    source = 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();
        }
    }

    explain = in.readBoolean();
    rewrite = in.readBoolean();
    nowInMillis = in.readVLong();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:25,代码来源:ShardValidateQueryRequest.java

示例9: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    startTime = in.readVLong();
    documentType = in.readString();
    routing = in.readOptionalString();
    preference = in.readOptionalString();
    source = in.readBytesReference();
    docSource = in.readBytesReference();
    if (in.readBoolean()) {
        getRequest = new GetRequest(null);
        getRequest.readFrom(in);
    }
    onlyCount = in.readBoolean();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:16,代码来源:PercolateRequest.java

示例10: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    int size = in.readVInt();
    if (size == 0) {
        aggregations = Collections.emptyList();
        aggregationsAsMap = ImmutableMap.of();
    } else {
        aggregations = new ArrayList<>(size);
        for (int i = 0; i < size; i++) {
            BytesReference type = in.readBytesReference();
            InternalAggregation aggregation = AggregationStreams.stream(type).readResult(in);
            aggregations.add(aggregation);
        }
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:16,代码来源:InternalAggregations.java

示例11: readFrom

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

示例12: 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();
    }
    routing = 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:baidu,项目名称:Elasticsearch,代码行数:38,代码来源:TermVectorsRequest.java

示例13: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    int version = in.readVInt(); // version
    source = in.readBytesReference();
    if (version < 2) {
        // for query_parser_name, which was removed
        if (in.readBoolean()) {
            in.readString();
        }
    }
    int typesSize = in.readVInt();
    if (typesSize > 0) {
        types = new String[typesSize];
        for (int i = 0; i < typesSize; i++) {
            types[i] = in.readString();
        }
    }
    if (version >= 1) {
        int aliasesSize = in.readVInt();
        if (aliasesSize > 0) {
            filteringAliases = new String[aliasesSize];
            for (int i = 0; i < aliasesSize; i++) {
                filteringAliases[i] = in.readString();
            }
        }
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:28,代码来源:Translog.java

示例14: readFrom

import org.elasticsearch.common.io.stream.StreamInput; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    digests = new BytesReference[in.readVInt()];
    for (int i = 0; i < digests.length; i++) {
        digests[i] = in.readBytesReference();
    }
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:9,代码来源:BlobRecoveryDeleteRequest.java

示例15: readFrom

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

    indices = new String[in.readVInt()];
    for (int i = 0; i < indices.length; i++) {
        indices[i] = in.readString();
    }

    routing = in.readOptionalString();
    preference = in.readOptionalString();

    if (in.readBoolean()) {
        scroll = readScroll(in);
    }

    source = in.readBytesReference();
    extraSource = in.readBytesReference();

    types = in.readStringArray();
    indicesOptions = IndicesOptions.readIndicesOptions(in);

    templateSource = in.readBytesReference();
    if (in.readBoolean()) {
        template = Template.readTemplate(in);
    }
    requestCache = in.readOptionalBoolean();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:30,代码来源:SearchRequest.java


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