CE-57 adding support for engine to engine replication

This commit is contained in:
Rob Austin
2015-06-12 16:15:04 +01:00
parent ca008ad3db
commit 5c220f68b7
8 changed files with 121 additions and 22 deletions
@@ -18,6 +18,7 @@
package net.openhft.chronicle.map;
import net.openhft.chronicle.hash.replication.EngineReplicationLangBytesConsumer;
import net.openhft.chronicle.hash.replication.ReplicationHub;
import net.openhft.chronicle.hash.replication.TcpTransportAndNetworkConfig;
import net.openhft.chronicle.hash.replication.UdpTransportConfig;
@@ -58,9 +59,10 @@ final class ChannelProvider implements Closeable {
if (channelProvider != null)
return channelProvider;
channelProvider = new ChannelProvider(hub);
TcpTransportAndNetworkConfig tcpConfig = hub.tcpTransportAndNetwork();
if (tcpConfig != null) {
final TcpReplicator tcpReplicator = new TcpReplicator(
@@ -158,11 +160,26 @@ final class ChannelProvider implements Closeable {
private final byte localIdentifier;
final Replica asReplica = new Replica() {
@Override
public void put(final Bytes key, final Bytes value, final byte remoteIdentifier, final long timestamp) {
throw new UnsupportedOperationException("todo");
}
@Override
public void remove(final Bytes key, final byte remoteIdentifier, final long timestamp) {
throw new UnsupportedOperationException("todo");
}
@Override
public byte identifier() {
return localIdentifier;
}
@Override
public EngineModificationIterator acquireEngineModificationIterator(final byte remoteIdentifier) {
throw new UnsupportedOperationException("todo");
}
@Override
public ModificationIterator acquireModificationIterator(
final byte remoteIdentifier) {
@@ -472,11 +489,26 @@ final class ChannelProvider implements Closeable {
class SystemQueue {
final Replica asReplica = new Replica() {
@Override
public void put(final Bytes key, final Bytes value, final byte remoteIdentifier, final long timestamp) {
throw new UnsupportedOperationException("todo");
}
@Override
public void remove(final Bytes key, final byte remoteIdentifier, final long timestamp) {
throw new UnsupportedOperationException("todo");
}
@Override
public byte identifier() {
throw new UnsupportedOperationException();
}
@Override
public EngineModificationIterator acquireEngineModificationIterator(final byte remoteIdentifier) {
throw new UnsupportedOperationException("todo");
}
@Override
public ModificationIterator acquireModificationIterator(
final byte remoteIdentifier) {