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


Java IndexRequest.readFrom方法代码示例

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


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

示例1: readFrom

import org.elasticsearch.action.index.IndexRequest; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    destination = new IndexRequest();
    destination.readFrom(in);
    remoteInfo = in.readOptionalWriteable(RemoteInfo::new);
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:8,代码来源:ReindexRequest.java

示例2: readDocumentRequest

import org.elasticsearch.action.index.IndexRequest; //导入方法依赖的package包/类
/** read a document write (index/delete/update) request */
static DocWriteRequest readDocumentRequest(StreamInput in) throws IOException {
    byte type = in.readByte();
    DocWriteRequest docWriteRequest;
    if (type == 0) {
        IndexRequest indexRequest = new IndexRequest();
        indexRequest.readFrom(in);
        docWriteRequest = indexRequest;
    } else if (type == 1) {
        DeleteRequest deleteRequest = new DeleteRequest();
        deleteRequest.readFrom(in);
        docWriteRequest = deleteRequest;
    } else if (type == 2) {
        UpdateRequest updateRequest = new UpdateRequest();
        updateRequest.readFrom(in);
        docWriteRequest = updateRequest;
    } else {
        throw new IllegalStateException("invalid request type [" + type+ " ]");
    }
    return docWriteRequest;
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:22,代码来源:DocWriteRequest.java

示例3: readFrom

import org.elasticsearch.action.index.IndexRequest; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    waitForActiveShards = ActiveShardCount.readFrom(in);
    type = in.readString();
    id = in.readString();
    routing = in.readOptionalString();
    parent = in.readOptionalString();
    if (in.readBoolean()) {
        script = new Script(in);
    }
    retryOnConflict = in.readVInt();
    refreshPolicy = RefreshPolicy.readFrom(in);
    if (in.readBoolean()) {
        doc = new IndexRequest();
        doc.readFrom(in);
    }
    fields = in.readOptionalStringArray();
    fetchSourceContext = in.readOptionalWriteable(FetchSourceContext::new);
    if (in.readBoolean()) {
        upsertRequest = new IndexRequest();
        upsertRequest.readFrom(in);
    }
    docAsUpsert = in.readBoolean();
    version = in.readLong();
    versionType = VersionType.fromValue(in.readByte());
    detectNoop = in.readBoolean();
    scriptedUpsert = in.readBoolean();
}
 
开发者ID:justor,项目名称:elasticsearch_my,代码行数:30,代码来源:UpdateRequest.java

示例4: createIndexRequest

import org.elasticsearch.action.index.IndexRequest; //导入方法依赖的package包/类
public static IndexRequestBuilder createIndexRequest(final Client client, final StreamInput streamInput, final String index)
        throws IOException {
    final IndexRequestBuilder builder = client.prepareIndex();
    final IndexRequest request = builder.request();
    request.readFrom(streamInput);
    if (index != null) {
        request.index(index);
    }
    return builder;
}
 
开发者ID:codelibs,项目名称:elasticsearch-indexing-proxy,代码行数:11,代码来源:RequestUtils.java

示例5: readFrom

import org.elasticsearch.action.index.IndexRequest; //导入方法依赖的package包/类
@Override
public void readFrom(StreamInput in) throws IOException {
    super.readFrom(in);
    consistencyLevel = WriteConsistencyLevel.fromId(in.readByte());
    type = in.readString();
    id = in.readString();
    routing = in.readOptionalString();
    parent = in.readOptionalString();
    if (in.readBoolean()) {
        script = Script.readScript(in);
    }
    retryOnConflict = in.readVInt();
    refresh = in.readBoolean();
    if (in.readBoolean()) {
        doc = new IndexRequest();
        doc.readFrom(in);
    }
    int size = in.readInt();
    if (size >= 0) {
        fields = new String[size];
        for (int i = 0; i < size; i++) {
            fields[i] = in.readString();
        }
    }
    if (in.readBoolean()) {
        upsertRequest = new IndexRequest();
        upsertRequest.readFrom(in);
    }
    docAsUpsert = in.readBoolean();
    version = in.readLong();
    versionType = VersionType.fromValue(in.readByte());
    detectNoop = in.readBoolean();
    scriptedUpsert = in.readBoolean();
}
 
开发者ID:baidu,项目名称:Elasticsearch,代码行数:35,代码来源:UpdateRequest.java


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