Source:
<code>private Set<StoreKey> getMissingStoreKeys(ReplicaMetadataResponseInfo replicaMetadataResponseInfo, DataNodeId remoteNode, RemoteReplicaInfo remoteReplicaInfo) throws Exception { long startTime = SystemTime.getInstance().milliseconds(); List<MessageInfo> messageInfoList = replicaMetadataResponseInfo.getMessageInfoList(); List<StoreKey> storeKeysToCheck = new ArrayList<>(messageInfoList.size()); for (MessageInfo messageInfo : messageInfoList) { storeKeysToCheck.add(messageInfo.getStoreKey()); logger.trace("Remote node: Thread name: Remote replica: Key from remote: {}", remoteNode, threadName, remoteReplicaInfo.getReplicaId(), messageInfo.getStoreKey()); } Map<StoreKey, StoreKey> originalToConverted = new HashMap<>(); for (StoreKey storeKey : storeKeysToCheck) { <START> originalToConverted.put(storeKey, storeKeyConverter.getConverted(storeKey)); <END> } List<StoreKey> convertedKeys = new ArrayList<>(); for (StoreKey val : originalToConverted.values()) { if (val != null) { convertedKeys.add(val); } } Set<StoreKey> convertedMissingStoreKeys = remoteReplicaInfo.getLocalStore().findMissingKeys(convertedKeys); Set<StoreKey> originalStoreKeys = new HashSet<>(); for (Map.Entry<StoreKey, StoreKey> entry : originalToConverted.entrySet()) { if (convertedMissingStoreKeys.contains(entry.getValue())) { logger.trace("Remote node: Thread name: Remote replica: Key missing id (converted): Key missing id (original): {}", remoteNode, threadName, remoteReplicaInfo.getReplicaId(), entry.getValue(), entry.getKey()); originalStoreKeys.add(entry.getKey()); } } replicationMetrics.updateCheckMissingKeysTime(SystemTime.getInstance().milliseconds() - startTime, replicatingFromRemoteColo, datacenterName); return originalStoreKeys; }</code><technical_language>ignore return null right originalToConverted.values() create list need</technical_language>

Target:
private Set<StoreKey> getMissingStoreKeys(ReplicaMetadataResponseInfo replicaMetadataResponseInfo, DataNodeId remoteNode, RemoteReplicaInfo remoteReplicaInfo) throws Exception { long startTime = SystemTime.getInstance().milliseconds(); List<MessageInfo> messageInfoList = replicaMetadataResponseInfo.getMessageInfoList(); Map<StoreKey, StoreKey> remoteToConvertedNonNull = new HashMap<>(); for (MessageInfo messageInfo : messageInfoList) { StoreKey storeKey = messageInfo.getStoreKey(); logger.trace("Remote node: Thread name: Remote replica: Key from remote: {}", remoteNode, threadName, remoteReplicaInfo.getReplicaId(), storeKey); StoreKey convertedKey = storeKeyConverter.getConverted(storeKey); if (convertedKey != null) { remoteToConvertedNonNull.put(storeKey, convertedKey); } } Set<StoreKey> convertedMissingStoreKeys = remoteReplicaInfo.getLocalStore().findMissingKeys(new ArrayList<>(remoteToConvertedNonNull.values())); Set<StoreKey> missingRemoteStoreKeys = new HashSet<>(); remoteToConvertedNonNull.forEach((remoteKey, convertedKey) -> { if (convertedMissingStoreKeys.contains(convertedKey)) { logger.trace( "Remote node: Thread name: Remote replica: Key missing id (converted): Key missing id (remote): {}", remoteNode, threadName, remoteReplicaInfo.getReplicaId(), convertedKey, remoteKey); missingRemoteStoreKeys.add(remoteKey); } }); replicationMetrics.updateCheckMissingKeysTime(SystemTime.getInstance().milliseconds() - startTime, replicatingFromRemoteColo, datacenterName); return missingRemoteStoreKeys; }