Skip to content

Commit

Permalink
Spotless fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <kalsac@amazon.com>
  • Loading branch information
Sachin Kale committed Jul 20, 2023
1 parent 93dbc51 commit b2485fc
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,9 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RestoreRemoteStoreRequest that = (RestoreRemoteStoreRequest) o;
return waitForCompletion == that.waitForCompletion && restoreAllShards == that.restoreAllShards && Arrays.equals(indices, that.indices);
return waitForCompletion == that.waitForCompletion
&& restoreAllShards == that.restoreAllShards
&& Arrays.equals(indices, that.indices);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,11 @@ public Builder initializeAsRestore(IndexMetadata indexMetadata, SnapshotRecovery
/**
* Initializes an existing index, to be restored from remote store
*/
public Builder initializeAsRemoteStoreRestore(IndexMetadata indexMetadata, RemoteStoreRecoverySource recoverySource, Map<ShardId, ShardRouting> activeShards) {
public Builder initializeAsRemoteStoreRestore(
IndexMetadata indexMetadata,
RemoteStoreRecoverySource recoverySource,
Map<ShardId, ShardRouting> activeShards
) {
final UnassignedInfo unassignedInfo = new UnassignedInfo(
UnassignedInfo.Reason.EXISTING_INDEX_RESTORED,
"restore_source[remote_store]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,11 @@ public Builder addAsFromOpenToClose(IndexMetadata indexMetadata) {
return add(indexRoutingBuilder);
}

public Builder addAsRemoteStoreRestore(IndexMetadata indexMetadata, RemoteStoreRecoverySource recoverySource, Map<ShardId, ShardRouting> activeShards) {
public Builder addAsRemoteStoreRestore(
IndexMetadata indexMetadata,
RemoteStoreRecoverySource recoverySource,
Map<ShardId, ShardRouting> activeShards
) {
IndexRoutingTable.Builder indexRoutingBuilder = new IndexRoutingTable.Builder(indexMetadata.getIndex())
.initializeAsRemoteStoreRestore(indexMetadata, recoverySource, activeShards);
add(indexRoutingBuilder);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,12 @@ public ClusterState execute(ClusterState currentState) {
updatedIndexMetadata.getCreationVersion(),
indexId
);
Map<ShardId, ShardRouting> activeShards = currentState.routingTable().index(index).randomAllActiveShardsIt().getShardRoutings().stream().collect(Collectors.toMap(ShardRouting::shardId, Function.identity()));
Map<ShardId, ShardRouting> activeShards = currentState.routingTable()
.index(index)
.randomAllActiveShardsIt()
.getShardRoutings()
.stream()
.collect(Collectors.toMap(ShardRouting::shardId, Function.identity()));
rtBuilder.addAsRemoteStoreRestore(updatedIndexMetadata, recoverySource, activeShards);
blocks.updateBlocks(updatedIndexMetadata);
mdBuilder.put(updatedIndexMetadata, true);
Expand Down

0 comments on commit b2485fc

Please sign in to comment.