use of io.atomix.core.map.AtomicCounterMap in project atomix by atomix.
the class AtomicCounterMapProxyBuilder method buildAsync.
@Override
@SuppressWarnings("unchecked")
public CompletableFuture<AtomicCounterMap<K>> buildAsync() {
PrimitiveProtocol protocol = protocol();
return managementService.getPartitionService().getPartitionGroup(protocol).getPartition(name()).getPrimitiveClient().newProxy(name(), primitiveType(), protocol).connect().thenApply(proxy -> {
AtomicCounterMapProxy rawMap = new AtomicCounterMapProxy(proxy);
Serializer serializer = serializer();
return new TranscodingAsyncAtomicCounterMap<K, String>(rawMap, key -> BaseEncoding.base16().encode(serializer.encode(key)), string -> serializer.decode(BaseEncoding.base16().decode(string))).sync();
});
}
Aggregations