本文整理汇总了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);
}
示例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;
}
示例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();
}
示例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;
}
示例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();
}