CE-20 moved the map lookup by name from engine to the map code ( but its a bit of a hack and requires implementing properly, but for the moment this demonstrates the API )

This commit is contained in:
Rob Austin
2015-04-09 13:09:25 +01:00
parent e0363defe5
commit 6037bd27e4
8 changed files with 161 additions and 108 deletions
@@ -25,6 +25,7 @@ import net.openhft.chronicle.wire.WireKey;
import org.jetbrains.annotations.NotNull;
import java.util.List;
import java.util.Map;
import java.util.function.Supplier;
/**
@@ -34,12 +35,22 @@ public class MapWireHandlerBuilder {
public static <K, V> WireHandler of(
@NotNull Supplier<ChronicleHashInstanceBuilder<ChronicleMap<K, V>>> mapFactory,
@NotNull ReplicationHub hub, byte localIdentifier, @NotNull List<Replica> channels) {
return new MapWireHandler<>(mapFactory, hub, localIdentifier, channels);
@NotNull Supplier<ChronicleHashInstanceBuilder<ChronicleMap<String, Integer>>>
channelNameToIdFactory,
@NotNull ReplicationHub hub,
byte localIdentifier,
@NotNull Map<Integer,Replica> channels) {
return new MapWireHandler<>(
mapFactory,
channelNameToIdFactory,
hub,
localIdentifier,
channels);
}
// note : peter has asked for these to be in camel case
public static enum Fields implements WireKey {
public enum Fields implements WireKey {
hasNext,
timeStamp,
channelId,