本文整理汇总了Java中org.elasticsearch.action.support.replication.ReplicationRequest类的典型用法代码示例。如果您正苦于以下问题:Java ReplicationRequest类的具体用法?Java ReplicationRequest怎么用?Java ReplicationRequest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ReplicationRequest类属于org.elasticsearch.action.support.replication包,在下文中一共展示了ReplicationRequest类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setRandomTimeout
import org.elasticsearch.action.support.replication.ReplicationRequest; //导入依赖的package包/类
private static void setRandomTimeout(ReplicationRequest<?> request, Map<String, String> expectedParams) {
if (randomBoolean()) {
String timeout = randomTimeValue();
request.timeout(timeout);
expectedParams.put("timeout", timeout);
} else {
expectedParams.put("timeout", ReplicationRequest.DEFAULT_TIMEOUT.getStringRep());
}
}
示例2: onRetry
import org.elasticsearch.action.support.replication.ReplicationRequest; //导入依赖的package包/类
@Override
public void onRetry() {
for (BulkItemRequest item : items) {
if (item.request() instanceof ReplicationRequest) {
// all replication requests need to be notified here as well to ie. make sure that internal optimizations are
// disabled see IndexRequest#canHaveDuplicates()
((ReplicationRequest) item.request()).onRetry();
}
}
}
示例3: TransportShardRefreshAction
import org.elasticsearch.action.support.replication.ReplicationRequest; //导入依赖的package包/类
@Inject
public TransportShardRefreshAction(Settings settings, TransportService transportService, ClusterService clusterService,
IndicesService indicesService, ThreadPool threadPool, ShardStateAction shardStateAction,
MappingUpdatedAction mappingUpdatedAction, ActionFilters actionFilters,
IndexNameExpressionResolver indexNameExpressionResolver) {
super(settings, NAME, transportService, clusterService, indicesService, threadPool, shardStateAction, mappingUpdatedAction,
actionFilters, indexNameExpressionResolver, ReplicationRequest.class, ReplicationRequest.class, ThreadPool.Names.REFRESH);
}
示例4: shardOperationOnPrimary
import org.elasticsearch.action.support.replication.ReplicationRequest; //导入依赖的package包/类
@Override
protected Tuple<ActionWriteResponse, ReplicationRequest> shardOperationOnPrimary(MetaData metaData, ReplicationRequest shardRequest) throws Throwable {
IndexShard indexShard = indicesService.indexServiceSafe(shardRequest.shardId().getIndex()).shardSafe(shardRequest.shardId().id());
indexShard.refresh("api");
logger.trace("{} refresh request executed on primary", indexShard.shardId());
return new Tuple<>(new ActionWriteResponse(), shardRequest);
}
示例5: shardOperationOnReplica
import org.elasticsearch.action.support.replication.ReplicationRequest; //导入依赖的package包/类
@Override
protected void shardOperationOnReplica(ReplicationRequest request) {
IndexShard indexShard = indicesService.indexServiceSafe(request.shardId().getIndex()).shardSafe(request.shardId().id());
indexShard.refresh("api");
logger.trace("{} refresh request executed on replica", indexShard.shardId());
}
示例6: newShardRequest
import org.elasticsearch.action.support.replication.ReplicationRequest; //导入依赖的package包/类
@Override
protected ReplicationRequest newShardRequest(RefreshRequest request, ShardId shardId) {
return new ReplicationRequest(request, shardId);
}