Source:
<code>public void onPartitionBecomeInactiveFromStandby(String partitionName) { ReplicaId replica = partitionNameToReplicaId.get(partitionName); if (replica != null) { Store localStore = getStore(replica.getPartitionId(), true); if (localStore == null) { throw new StateTransitionException("Store " + partitionName + " is not found on current node", ReplicaNotFound); } if (localStore.disabledOnError()) { throw new StateTransitionException("Store " + partitionName + " is disabled due to I/O error", ReplicaOperationFailure); <START> } else { <END> File decommissionFile = new File(replica.getReplicaPath(), BlobStore.DECOMMISSION_FILE_NAME); try { if (!decommissionFile.exists()) { decommissionFile.createNewFile(); logger.info("Decommission file is created for replica {}", replica.getReplicaPath()); } } catch (IOException e) { logger.error("IOException occurs when creating decommission file for replica " + partitionName, e); throw new StateTransitionException( "Couldn't create decommission file for replica " + replica.getReplicaPath(), ReplicaOperationFailure); } if (localStore.isStarted()) { localStore.setCurrentState(ReplicaState.INACTIVE); logger.info("Store is set to INACTIVE", partitionName); if (!controlCompactionForBlobStore(replica.getPartitionId(), false)) { logger.error("Failed to disable compaction on store {}", partitionName); throw new StateTransitionException("Couldn't disable compaction on replica " + replica.getReplicaPath(), ReplicaNotFound); } logger.info("Compaction is successfully disabled on store {}", partitionName); } else { throw new StateTransitionException("Store " + partitionName + " is not started", StoreNotStarted); } } } else { throw new StateTransitionException("Replica " + partitionName + " is not found on current node", ReplicaNotFound); } }</code><technical_language>minor: added if throws, this code need in else clause. This shorten diff a bit match existing style of this method a bit better</technical_language>

Target:
public void onPartitionBecomeInactiveFromStandby(String partitionName) { ReplicaId replica = partitionNameToReplicaId.get(partitionName); if (replica != null) { Store localStore = getStore(replica.getPartitionId(), true); if (localStore == null) { throw new StateTransitionException("Store " + partitionName + " is not found on current node", ReplicaNotFound); } if (localStore.disabledOnError()) { throw new StateTransitionException("Store " + partitionName + " is disabled due to I/O error", ReplicaOperationFailure); } File decommissionFile = new File(replica.getReplicaPath(), BlobStore.DECOMMISSION_FILE_NAME); try { if (!decommissionFile.exists()) { decommissionFile.createNewFile(); logger.info("Decommission file is created for replica {}", replica.getReplicaPath()); } } catch (IOException e) { logger.error("IOException occurs when creating decommission file for replica " + partitionName, e); throw new StateTransitionException( "Couldn't create decommission file for replica " + replica.getReplicaPath(), ReplicaOperationFailure); } if (localStore.isStarted()) { localStore.setCurrentState(ReplicaState.INACTIVE); logger.info("Store is set to INACTIVE", partitionName); if (!controlCompactionForBlobStore(replica.getPartitionId(), false)) { logger.error("Failed to disable compaction on store {}", partitionName); throw new StateTransitionException("Couldn't disable compaction on replica " + replica.getReplicaPath(), ReplicaNotFound); } logger.info("Compaction is successfully disabled on store {}", partitionName); } else { throw new StateTransitionException("Store " + partitionName + " is not started", StoreNotStarted); } } else { throw new StateTransitionException("Replica " + partitionName + " is not found on current node", ReplicaNotFound); } }