Source:
<code>public StoreInfo get(List<? extends StoreKey> ids, EnumSet<StoreGetOptions> storeGetOptions) throws StoreException { checkStarted(); final Timer.Context context = metrics.getResponse.time(); <START> if (ids.size() != new HashSet<>(ids).size()) { <END> throw new IllegalArgumentException("The list of IDs provided contains duplicates"); } try { List<BlobReadOptions> readOptions = new ArrayList<BlobReadOptions>(ids.size()); Map<StoreKey, MessageInfo> indexMessages = new HashMap<StoreKey, MessageInfo>(ids.size()); for (StoreKey key : ids) { BlobReadOptions readInfo = index.getBlobReadInfo(key, storeGetOptions); readOptions.add(readInfo); indexMessages.put(key, readInfo.getMessageInfo()); if (!key.isAccountContainerMatch(readInfo.getMessageInfo().getAccountId(), readInfo.getMessageInfo().getContainerId())) { if (config.storeValidateAuthorization) { throw new StoreException( "GET authorization failure. Key: " + key.getID() + " Actually accountId: " + readInfo.getMessageInfo() .getAccountId() + " Actually containerId: " + readInfo.getMessageInfo().getContainerId(), StoreErrorCodes.Authorization_Failure); } else { logger.warn("GET authorization failure. Key: Actually accountId: Actually containerId: {}", key.getID(), readInfo.getMessageInfo().getAccountId(), readInfo.getMessageInfo().getContainerId()); metrics.getAuthorizationFailureCount.inc(); } } } MessageReadSet readSet = new StoreMessageReadSet(readOptions); List<MessageInfo> messageInfoList = new ArrayList<MessageInfo>(readSet.count()); for (int i = 0; i < readSet.count(); i++) { messageInfoList.add(indexMessages.get(readSet.getKeyAt(i))); } return new StoreInfo(readSet, messageInfoList); } catch (StoreException e) { throw e; } catch (Exception e) { throw new StoreException("Unknown exception while trying to fetch blobs from store " + dataDir, e, StoreErrorCodes.Unknown_Error); } finally { context.stop(); } }</code><technical_language>Do new HashSet creation if ids.size() > 1</technical_language>

Target:
public StoreInfo get(List<? extends StoreKey> ids, EnumSet<StoreGetOptions> storeGetOptions) throws StoreException { checkStarted(); final Timer.Context context = metrics.getResponse.time(); if (ids.size() > 1 && ids.size() != new HashSet<>(ids).size()) { metrics.duplicateKeysInBatch.inc(); throw new IllegalArgumentException("The list of IDs provided contains duplicates"); } try { List<BlobReadOptions> readOptions = new ArrayList<BlobReadOptions>(ids.size()); Map<StoreKey, MessageInfo> indexMessages = new HashMap<StoreKey, MessageInfo>(ids.size()); for (StoreKey key : ids) { BlobReadOptions readInfo = index.getBlobReadInfo(key, storeGetOptions); readOptions.add(readInfo); indexMessages.put(key, readInfo.getMessageInfo()); if (!key.isAccountContainerMatch(readInfo.getMessageInfo().getAccountId(), readInfo.getMessageInfo().getContainerId())) { if (config.storeValidateAuthorization) { throw new StoreException( "GET authorization failure. Key: " + key.getID() + " Actually accountId: " + readInfo.getMessageInfo() .getAccountId() + " Actually containerId: " + readInfo.getMessageInfo().getContainerId(), StoreErrorCodes.Authorization_Failure); } else { logger.warn("GET authorization failure. Key: Actually accountId: Actually containerId: {}", key.getID(), readInfo.getMessageInfo().getAccountId(), readInfo.getMessageInfo().getContainerId()); metrics.getAuthorizationFailureCount.inc(); } } } MessageReadSet readSet = new StoreMessageReadSet(readOptions); List<MessageInfo> messageInfoList = new ArrayList<MessageInfo>(readSet.count()); for (int i = 0; i < readSet.count(); i++) { messageInfoList.add(indexMessages.get(readSet.getKeyAt(i))); } return new StoreInfo(readSet, messageInfoList); } catch (StoreException e) { throw e; } catch (Exception e) { throw new StoreException("Unknown exception while trying to fetch blobs from store " + dataDir, e, StoreErrorCodes.Unknown_Error); } finally { context.stop(); } }