本文整理汇总了Java中org.elasticsearch.action.update.UpdateRequestBuilder.execute方法的典型用法代码示例。如果您正苦于以下问题:Java UpdateRequestBuilder.execute方法的具体用法?Java UpdateRequestBuilder.execute怎么用?Java UpdateRequestBuilder.execute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.elasticsearch.action.update.UpdateRequestBuilder
的用法示例。
在下文中一共展示了UpdateRequestBuilder.execute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addActionRequestBuilderForFlush
import org.elasticsearch.action.update.UpdateRequestBuilder; //导入方法依赖的package包/类
private void addActionRequestBuilderForFlush(String elementId, UpdateRequestBuilder updateRequestBuilder) {
Future future;
try {
future = updateRequestBuilder.execute();
} catch (Exception ex) {
LOGGER.debug("Could not execute update: %s", ex.getMessage());
future = SettableFuture.create();
((SettableFuture) future).setException(ex);
}
getFlushObjectQueue().add(new FlushObject(elementId, updateRequestBuilder, future));
}
示例2: executeUpdateRequest
import org.elasticsearch.action.update.UpdateRequestBuilder; //导入方法依赖的package包/类
private void executeUpdateRequest(final StreamInput streamInput, final UpdateRequestBuilder builder) {
builder.execute(wrap(res -> {
processRequests(streamInput);
// continue
}, e -> {
if (senderRequestRetryCount >= 0) {
if (requestErrorCount > senderRequestRetryCount) {
logger.error("[Sender][" + index + "][" + requestErrorCount + "] Failed to update [" + builder.request().index() + "]["
+ builder.request().type() + "][" + builder.request().id() + "]", e);
requestErrorCount = 0;
writeError(requestPosition, builder.request(), wrap(r -> processRequests(streamInput), ex -> {
logger.warn("[Sender][" + index + "] Failed to store an error request.", ex);
processRequests(streamInput);
}));
} else {
if (logger.isDebugEnabled()) {
logger.debug("[" + requestErrorCount + "] Failed to update [" + builder.request().index() + "]["
+ builder.request().type() + "][" + builder.request().id() + "]", e);
}
requestErrorCount++;
executeUpdateRequest(streamInput, builder);
}
} else {
IOUtils.closeQuietly(streamInput);
retryWithError("Failed to update (" + builder.request() + ")", e);
// retry
}
}));
}
示例3: addActionRequestBuilderForFlush
import org.elasticsearch.action.update.UpdateRequestBuilder; //导入方法依赖的package包/类
private void addActionRequestBuilderForFlush(String elementId, String rowId, UpdateRequestBuilder updateRequestBuilder) {
Future future;
try {
future = updateRequestBuilder.execute();
} catch (Exception ex) {
LOGGER.debug("Could not execute update: %s", ex.getMessage());
future = SettableFuture.create();
((SettableFuture) future).setException(ex);
}
getFlushObjectQueue().add(new FlushObject(elementId, rowId, updateRequestBuilder, future));
}