本文整理匯總了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);
}