use of io.atomix.core.map.impl.TranscodingAsyncAtomicMap in project atomix by atomix.
the class CorePrimitiveRegistry method start.
@Override
@SuppressWarnings("unchecked")
public CompletableFuture<PrimitiveRegistry> start() {
ProxyProtocol protocol = partitionService.getSystemPartitionGroup().newProtocol();
ProxyClient proxy = protocol.newProxy("primitives", AtomicMapType.instance(), AtomicMapService.class, new ServiceConfig(), partitionService);
return proxy.connect().thenApply(v -> {
AtomicMapProxy mapProxy = new AtomicMapProxy(proxy, this);
primitives = new TranscodingAsyncAtomicMap<>(mapProxy, key -> key, key -> key, value -> value != null ? SERIALIZER.encode(value) : null, value -> value != null ? SERIALIZER.decode(value) : null);
started.set(true);
return this;
});
}
Aggregations