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