Skip to content

Commit

Permalink
Apply spotless check.
Browse files Browse the repository at this point in the history
Signed-off-by: Rishikesh1159 <rishireddy1159@gmail.com>
  • Loading branch information
Rishikesh1159 committed Dec 9, 2022
1 parent 3471fcc commit 127c7a4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ public void testAddNewReplicaFailure() throws Exception {
final String replicaNode = internalCluster().startNode();

// Mock transport service to add behaviour of throwing corruption exception during segment replication process.
MockTransportService mockTransportService = ((MockTransportService) internalCluster().getInstance(TransportService.class, primaryNode));
MockTransportService mockTransportService = ((MockTransportService) internalCluster().getInstance(
TransportService.class,
primaryNode
));
mockTransportService.addSendBehavior(
internalCluster().getInstance(TransportService.class, replicaNode),
(connection, requestId, action, request, options) -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -782,9 +782,10 @@ public synchronized void handleRecoveryFailure(ShardRouting shardRouting, boolea
public void handleRecoveryDone(ReplicationState state, ShardRouting shardRouting, long primaryTerm) {
RecoveryState recoveryState = (RecoveryState) state;
AllocatedIndex<? extends Shard> indexService = indicesService.indexService(shardRouting.shardId().getIndex());
if(indexService.getIndexSettings().isSegRepEnabled()){
if (indexService.getIndexSettings().isSegRepEnabled()) {
IndexShard indexShard = (IndexShard) indexService.getShardOrNull(shardRouting.id());
// For Segment Replication enabled indices, we want replica shards to start a replication event to fetch latest segments before it
// For Segment Replication enabled indices, we want replica shards to start a replication event to fetch latest segments before
// it
// is marked as Started.
if (indexShard != null
&& shardRouting.primary() == false
Expand Down Expand Up @@ -835,11 +836,20 @@ public void onReplicationFailure(
}
);
} else {
shardStateAction.shardStarted(shardRouting, primaryTerm, "after " + recoveryState.getRecoverySource(), SHARD_STATE_ACTION_LISTENER);
shardStateAction.shardStarted(
shardRouting,
primaryTerm,
"after " + recoveryState.getRecoverySource(),
SHARD_STATE_ACTION_LISTENER
);
}
}
else{
shardStateAction.shardStarted(shardRouting, primaryTerm, "after " + recoveryState.getRecoverySource(), SHARD_STATE_ACTION_LISTENER);
} else {
shardStateAction.shardStarted(
shardRouting,
primaryTerm,
"after " + recoveryState.getRecoverySource(),
SHARD_STATE_ACTION_LISTENER
);
}
}

Expand Down

0 comments on commit 127c7a4

Please sign in to comment.