use of org.opensearch.action.support.replication.PendingReplicationActions in project OpenSearch by opensearch-project.
the class TransportVerifyShardBeforeCloseActionTests method createPrimary.
private static ReplicationOperation.Primary<TransportVerifyShardBeforeCloseAction.ShardRequest, TransportVerifyShardBeforeCloseAction.ShardRequest, PrimaryResult> createPrimary(final ShardRouting primary, final ReplicationGroup replicationGroup) {
final PendingReplicationActions replicationActions = new PendingReplicationActions(primary.shardId(), threadPool);
replicationActions.accept(replicationGroup);
return new ReplicationOperation.Primary<TransportVerifyShardBeforeCloseAction.ShardRequest, TransportVerifyShardBeforeCloseAction.ShardRequest, PrimaryResult>() {
@Override
public ShardRouting routingEntry() {
return primary;
}
@Override
public PendingReplicationActions getPendingReplicationActions() {
return replicationActions;
}
@Override
public ReplicationGroup getReplicationGroup() {
return replicationGroup;
}
@Override
public void perform(TransportVerifyShardBeforeCloseAction.ShardRequest request, ActionListener<PrimaryResult> listener) {
listener.onResponse(new PrimaryResult(request));
}
@Override
public void failShard(String message, Exception exception) {
}
@Override
public void updateLocalCheckpointForShard(String allocationId, long checkpoint) {
}
@Override
public void updateGlobalCheckpointForShard(String allocationId, long globalCheckpoint) {
}
@Override
public long localCheckpoint() {
return 0;
}
@Override
public long computedGlobalCheckpoint() {
return 0;
}
@Override
public long globalCheckpoint() {
return 0;
}
@Override
public long maxSeqNoOfUpdatesOrDeletes() {
return 0;
}
};
}
Aggregations