protected void putAllInternal(final Map<? extends Object, ? extends Object> entries) {
final NodeEngine nodeEngine = getNodeEngine();
final MapService mapService = getService();
int factor = 3;
InternalPartitionService partitionService = nodeEngine.getPartitionService();
OperationService operationService = nodeEngine.getOperationService();
int partitionCount = partitionService.getPartitionCount();
boolean tooManyEntries = entries.size() > (partitionCount * factor);
try {
if (tooManyEntries) {
List<Future> futures = new LinkedList<Future>();
Map<Integer, MapEntrySet> entryMap = new HashMap<Integer, MapEntrySet>(nodeEngine.getPartitionService().getPartitionCount());
for (Entry entry : entries.entrySet()) {
if (entry.getKey() == null) {
throw new NullPointerException(NULL_KEY_IS_NOT_ALLOWED);
}
if (entry.getValue() == null) {
throw new NullPointerException(NULL_VALUE_IS_NOT_ALLOWED);
}
int partitionId = partitionService.getPartitionId(entry.getKey());
if (!entryMap.containsKey(partitionId)) {
entryMap.put(partitionId, new MapEntrySet());
}
entryMap.get(partitionId).add(new AbstractMap.SimpleImmutableEntry<Data, Data>(mapService.toData(
entry.getKey(),