use of org.infinispan.client.hotrod.impl.ClientStatistics in project infinispan by infinispan.
the class PutAllParallelOperation method mapOperations.
@Override
protected List<PutAllOperation> mapOperations() {
Map<SocketAddress, Map<byte[], byte[]>> splittedMaps = new HashMap<>();
for (Map.Entry<byte[], byte[]> entry : map.entrySet()) {
SocketAddress socketAddress = channelFactory.getHashAwareServer(entry.getKey(), cacheName);
Map<byte[], byte[]> keyValueMap = splittedMaps.get(socketAddress);
if (keyValueMap == null) {
keyValueMap = new HashMap<>();
splittedMaps.put(socketAddress, keyValueMap);
}
keyValueMap.put(entry.getKey(), entry.getValue());
}
return splittedMaps.values().stream().map(mapSubset -> new PutAllOperation(codec, channelFactory, mapSubset, cacheName, header.topologyId(), flags, cfg, lifespan, lifespanTimeUnit, maxIdle, maxIdleTimeUnit, dataFormat, clientStatistics)).collect(Collectors.toList());
}
use of org.infinispan.client.hotrod.impl.ClientStatistics in project infinispan by infinispan.
the class GetAllParallelOperation method mapOperations.
@Override
protected List<GetAllOperation<K, V>> mapOperations() {
Map<SocketAddress, Set<byte[]>> splittedKeys = new HashMap<>();
for (byte[] key : keys) {
SocketAddress socketAddress = channelFactory.getHashAwareServer(key, cacheName);
Set<byte[]> keys = splittedKeys.computeIfAbsent(socketAddress, k -> new HashSet<>());
keys.add(key);
}
return splittedKeys.values().stream().map(keysSubset -> new GetAllOperation<K, V>(codec, channelFactory, keysSubset, cacheName, header.topologyId(), flags, cfg, dataFormat, clientStatistics)).collect(Collectors.toList());
}
use of org.infinispan.client.hotrod.impl.ClientStatistics in project infinispan by infinispan.
the class RemoteCacheManager method isTransactional.
@Override
public boolean isTransactional(String cacheName) {
ClientStatistics stats = ClientStatistics.dummyClientStatistics(timeService);
OperationsFactory factory = createOperationFactory(cacheName, false, codec, stats);
return checkTransactionSupport(cacheName, factory, log);
}
Aggregations