Search in sources :

Example 1 with TargetCaller

use of org.neo4j.com.TargetCaller in project neo4j by neo4j.

the class BackupProtocolTest method shouldHandleNoForensicsSpecifiedInFullBackupRequest.

@Test
public void shouldHandleNoForensicsSpecifiedInFullBackupRequest() throws Exception {
    TheBackupInterface backup = mock(TheBackupInterface.class);
    RequestContext ctx = new RequestContext(0, 1, 0, -1, 12);
    @SuppressWarnings("unchecked") TargetCaller<TheBackupInterface, Void> targetCaller = (TargetCaller<TheBackupInterface, Void>) BackupRequestType.FULL_BACKUP.getTargetCaller();
    targetCaller.call(backup, ctx, EMPTY_BUFFER, null);
    verify(backup).fullBackup(any(StoreWriter.class), eq(false));
}
Also used : StoreWriter(org.neo4j.com.storecopy.StoreWriter) TargetCaller(org.neo4j.com.TargetCaller) RequestContext(org.neo4j.com.RequestContext) Test(org.junit.Test)

Example 2 with TargetCaller

use of org.neo4j.com.TargetCaller in project neo4j by neo4j.

the class HaRequestType210 method registerCopyStore.

private void registerCopyStore() {
    TargetCaller<Master, Void> copyStoreTarget = (master, context, input, target) -> master.copyStore(context, new ToNetworkStoreWriter(target, new Monitors()));
    register(Type.COPY_STORE, copyStoreTarget, VOID_SERIALIZER, false);
}
Also used : Response(org.neo4j.com.Response) IdAllocation(org.neo4j.kernel.ha.id.IdAllocation) LockResult(org.neo4j.kernel.ha.lock.LockResult) ObjectSerializer(org.neo4j.com.ObjectSerializer) Protocol(org.neo4j.com.Protocol) TransactionRepresentation(org.neo4j.kernel.impl.transaction.TransactionRepresentation) VOID_SERIALIZER(org.neo4j.com.Protocol.VOID_SERIALIZER) ResourceType(org.neo4j.storageengine.api.lock.ResourceType) LogEntryReader(org.neo4j.kernel.impl.transaction.log.entry.LogEntryReader) Monitors(org.neo4j.kernel.monitoring.Monitors) IOException(java.io.IOException) HandshakeResult(org.neo4j.kernel.ha.com.master.HandshakeResult) IdRange(org.neo4j.kernel.impl.store.id.IdRange) RequestContext(org.neo4j.com.RequestContext) ReadableClosablePositionAwareChannel(org.neo4j.kernel.impl.transaction.log.ReadableClosablePositionAwareChannel) INTEGER_SERIALIZER(org.neo4j.com.Protocol.INTEGER_SERIALIZER) Protocol.readBoolean(org.neo4j.com.Protocol.readBoolean) IdType(org.neo4j.kernel.impl.store.id.IdType) LONG_SERIALIZER(org.neo4j.com.Protocol.LONG_SERIALIZER) TargetCaller(org.neo4j.com.TargetCaller) ToNetworkStoreWriter(org.neo4j.com.storecopy.ToNetworkStoreWriter) Protocol.readString(org.neo4j.com.Protocol.readString) Deserializer(org.neo4j.com.Deserializer) Master(org.neo4j.kernel.ha.com.master.Master) Master(org.neo4j.kernel.ha.com.master.Master) Monitors(org.neo4j.kernel.monitoring.Monitors) ToNetworkStoreWriter(org.neo4j.com.storecopy.ToNetworkStoreWriter)

Aggregations

RequestContext (org.neo4j.com.RequestContext)2 TargetCaller (org.neo4j.com.TargetCaller)2 IOException (java.io.IOException)1 Test (org.junit.Test)1 Deserializer (org.neo4j.com.Deserializer)1 ObjectSerializer (org.neo4j.com.ObjectSerializer)1 Protocol (org.neo4j.com.Protocol)1 INTEGER_SERIALIZER (org.neo4j.com.Protocol.INTEGER_SERIALIZER)1 LONG_SERIALIZER (org.neo4j.com.Protocol.LONG_SERIALIZER)1 VOID_SERIALIZER (org.neo4j.com.Protocol.VOID_SERIALIZER)1 Protocol.readBoolean (org.neo4j.com.Protocol.readBoolean)1 Protocol.readString (org.neo4j.com.Protocol.readString)1 Response (org.neo4j.com.Response)1 StoreWriter (org.neo4j.com.storecopy.StoreWriter)1 ToNetworkStoreWriter (org.neo4j.com.storecopy.ToNetworkStoreWriter)1 HandshakeResult (org.neo4j.kernel.ha.com.master.HandshakeResult)1 Master (org.neo4j.kernel.ha.com.master.Master)1 IdAllocation (org.neo4j.kernel.ha.id.IdAllocation)1 LockResult (org.neo4j.kernel.ha.lock.LockResult)1 IdRange (org.neo4j.kernel.impl.store.id.IdRange)1