Search in sources :

Example 71 with MockConnectionFactoryImpl

use of io.pravega.client.stream.mock.MockConnectionFactoryImpl in project pravega by pravega.

the class SegmentOutputStreamTest method testFailureWhileRetransmittingInflight.

@Test(timeout = 10000)
public void testFailureWhileRetransmittingInflight() throws ConnectionFailedException {
    UUID cid = UUID.randomUUID();
    PravegaNodeUri uri = new PravegaNodeUri("endpoint", SERVICE_PORT);
    MockConnectionFactoryImpl cf = new MockConnectionFactoryImpl();
    ScheduledExecutorService executor = mock(ScheduledExecutorService.class);
    // Ensure task submitted to executor is run inline.
    implementAsDirectExecutor(executor);
    cf.setExecutor(executor);
    MockController controller = new MockController(uri.getEndpoint(), uri.getPort(), cf, true);
    ClientConnection connection = mock(ClientConnection.class);
    InOrder inOrder = inOrder(connection);
    cf.provideConnection(uri, connection);
    @SuppressWarnings("resource") SegmentOutputStreamImpl output = new SegmentOutputStreamImpl(SEGMENT, true, controller, cf, cid, segmentSealedCallback, RETRY_SCHEDULE, DelegationTokenProviderFactory.createWithEmptyToken());
    output.reconnect();
    cf.getProcessor(uri).appendSetup(new AppendSetup(output.getRequestId(), SEGMENT, cid, 0));
    output.write(PendingEvent.withoutHeader(null, getBuffer("test1"), new CompletableFuture<>()));
    output.write(PendingEvent.withoutHeader(null, getBuffer("test2"), new CompletableFuture<>()));
    doAnswer(new Answer<Void>() {

        boolean failed = false;

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            CompletedCallback callback = (CompletedCallback) invocation.getArgument(1);
            if (failed) {
                callback.complete(null);
            } else {
                failed = true;
                callback.complete(new ConnectionFailedException("Injected"));
            }
            return null;
        }
    }).when(connection).sendAsync(ArgumentMatchers.<List<Append>>any(), Mockito.any(CompletedCallback.class));
    doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            cf.getProcessor(uri).appendSetup(new AppendSetup(output.getRequestId(), SEGMENT, cid, 0));
            return null;
        }
    }).doNothing().when(connection).send(new SetupAppend(output.getRequestId(), cid, SEGMENT, ""));
    cf.getProcessor(uri).connectionDropped();
    AssertExtensions.assertBlocks(() -> output.write(PendingEvent.withoutHeader(null, getBuffer("test3"), new CompletableFuture<>())), () -> {
        // the write should be blocked until the appendSetup is returned by the Segment stores.
        cf.getProcessor(uri).appendSetup(new AppendSetup(output.getRequestId(), SEGMENT, cid, 0));
    });
    output.write(PendingEvent.withoutHeader(null, getBuffer("test4"), new CompletableFuture<>()));
    Append append1 = new Append(SEGMENT, cid, 1, 1, Unpooled.wrappedBuffer(getBuffer("test1")), null, output.getRequestId());
    Append append2 = new Append(SEGMENT, cid, 2, 1, Unpooled.wrappedBuffer(getBuffer("test2")), null, output.getRequestId());
    Append append3 = new Append(SEGMENT, cid, 3, 1, Unpooled.wrappedBuffer(getBuffer("test3")), null, output.getRequestId());
    Append append4 = new Append(SEGMENT, cid, 4, 1, Unpooled.wrappedBuffer(getBuffer("test4")), null, output.getRequestId());
    inOrder.verify(connection).send(new SetupAppend(output.getRequestId(), cid, SEGMENT, ""));
    inOrder.verify(connection).send(append1);
    inOrder.verify(connection).send(append2);
    inOrder.verify(connection).close();
    inOrder.verify(connection).send(new SetupAppend(output.getRequestId(), cid, SEGMENT, ""));
    inOrder.verify(connection).sendAsync(eq(ImmutableList.of(append1, append2)), any());
    inOrder.verify(connection).close();
    inOrder.verify(connection).send(new SetupAppend(output.getRequestId(), cid, SEGMENT, ""));
    inOrder.verify(connection).sendAsync(eq(ImmutableList.of(append1, append2)), any());
    inOrder.verify(connection).send(append3);
    inOrder.verify(connection).send(append4);
    verifyNoMoreInteractions(connection);
}
Also used : ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) CompletedCallback(io.pravega.client.connection.impl.ClientConnection.CompletedCallback) InOrder(org.mockito.InOrder) AppendSetup(io.pravega.shared.protocol.netty.WireCommands.AppendSetup) Mockito.doAnswer(org.mockito.Mockito.doAnswer) Answer(org.mockito.stubbing.Answer) CompletableFuture(java.util.concurrent.CompletableFuture) Append(io.pravega.shared.protocol.netty.Append) SetupAppend(io.pravega.shared.protocol.netty.WireCommands.SetupAppend) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) InvocationOnMock(org.mockito.invocation.InvocationOnMock) MockConnectionFactoryImpl(io.pravega.client.stream.mock.MockConnectionFactoryImpl) SetupAppend(io.pravega.shared.protocol.netty.WireCommands.SetupAppend) MockController(io.pravega.client.stream.mock.MockController) ClientConnection(io.pravega.client.connection.impl.ClientConnection) UUID(java.util.UUID) ConnectionFailedException(io.pravega.shared.protocol.netty.ConnectionFailedException) Test(org.junit.Test)

Example 72 with MockConnectionFactoryImpl

use of io.pravega.client.stream.mock.MockConnectionFactoryImpl in project pravega by pravega.

the class SegmentOutputStreamTest method testExceptionSealedCallback.

@Test(timeout = 10000)
public void testExceptionSealedCallback() throws Exception {
    UUID cid = UUID.randomUUID();
    PravegaNodeUri uri = new PravegaNodeUri("endpoint", SERVICE_PORT);
    MockConnectionFactoryImpl cf = new MockConnectionFactoryImpl();
    ScheduledExecutorService executor = mock(ScheduledExecutorService.class);
    // Ensure task submitted to executor is run inline.
    implementAsDirectExecutor(executor);
    cf.setExecutor(executor);
    MockController controller = new MockController(uri.getEndpoint(), uri.getPort(), cf, true);
    ClientConnection connection = mock(ClientConnection.class);
    cf.provideConnection(uri, connection);
    AtomicBoolean shouldThrow = new AtomicBoolean(true);
    // call back which throws an exception.
    Consumer<Segment> exceptionCallback = s -> {
        if (shouldThrow.getAndSet(false)) {
            throw new IllegalStateException();
        }
    };
    @SuppressWarnings("resource") SegmentOutputStreamImpl output = new SegmentOutputStreamImpl(SEGMENT, true, controller, cf, cid, exceptionCallback, RETRY_SCHEDULE, DelegationTokenProviderFactory.createWithEmptyToken());
    output.reconnect();
    verify(connection).send(new SetupAppend(output.getRequestId(), cid, SEGMENT, ""));
    cf.getProcessor(uri).appendSetup(new AppendSetup(output.getRequestId(), SEGMENT, cid, 0));
    ByteBuffer data = getBuffer("test");
    CompletableFuture<Void> ack = new CompletableFuture<>();
    output.write(PendingEvent.withoutHeader(null, data, ack));
    assertEquals(false, ack.isDone());
    Mockito.doAnswer(new Answer<Void>() {

        @Override
        public Void answer(InvocationOnMock invocation) throws Throwable {
            cf.getProcessor(uri).appendSetup(new AppendSetup(output.getRequestId(), SEGMENT, cid, 0));
            return null;
        }
    }).when(connection).send(new SetupAppend(3, cid, SEGMENT, ""));
    AssertExtensions.assertBlocks(() -> {
        AssertExtensions.assertThrows(SegmentSealedException.class, () -> output.flush());
    }, () -> {
        cf.getProcessor(uri).segmentIsSealed(new WireCommands.SegmentIsSealed(output.getRequestId(), SEGMENT, "SomeException", 1));
        output.getUnackedEventsOnSeal();
    });
    verify(connection).send(new WireCommands.KeepAlive());
    verify(connection).send(new Append(SEGMENT, cid, 1, 1, Unpooled.wrappedBuffer(data), null, output.getRequestId()));
    assertEquals(false, ack.isDone());
}
Also used : ArgumentMatchers(org.mockito.ArgumentMatchers) Retry(io.pravega.common.util.Retry) AssertExtensions(io.pravega.test.common.AssertExtensions) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Cleanup(lombok.Cleanup) ByteBuffer(java.nio.ByteBuffer) Unpooled(io.netty.buffer.Unpooled) Mockito.doThrow(org.mockito.Mockito.doThrow) MockController(io.pravega.client.stream.mock.MockController) ClientConnection(io.pravega.client.connection.impl.ClientConnection) Mockito.verifyNoMoreInteractions(org.mockito.Mockito.verifyNoMoreInteractions) AccessOperation(io.pravega.shared.security.auth.AccessOperation) Mockito.doAnswer(org.mockito.Mockito.doAnswer) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) Assert.fail(org.junit.Assert.fail) LeakDetectorTestSuite(io.pravega.test.common.LeakDetectorTestSuite) AppendSetup(io.pravega.shared.protocol.netty.WireCommands.AppendSetup) AssertExtensions.assertThrows(io.pravega.test.common.AssertExtensions.assertThrows) DelegationTokenProviderFactory(io.pravega.client.security.auth.DelegationTokenProviderFactory) UUID(java.util.UUID) RetriesExhaustedException(io.pravega.common.util.RetriesExhaustedException) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Assert.assertFalse(org.junit.Assert.assertFalse) Mockito.inOrder(org.mockito.Mockito.inOrder) Futures(io.pravega.common.concurrent.Futures) ReplyProcessor(io.pravega.shared.protocol.netty.ReplyProcessor) Mockito.mock(org.mockito.Mockito.mock) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) ConnectionFailedException(io.pravega.shared.protocol.netty.ConnectionFailedException) Exceptions(io.pravega.common.Exceptions) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Callable(java.util.concurrent.Callable) CompletableFuture(java.util.concurrent.CompletableFuture) Mockito.spy(org.mockito.Mockito.spy) PendingEvent(io.pravega.client.stream.impl.PendingEvent) Append(io.pravega.shared.protocol.netty.Append) Answer(org.mockito.stubbing.Answer) SetupAppend(io.pravega.shared.protocol.netty.WireCommands.SetupAppend) InvocationOnMock(org.mockito.invocation.InvocationOnMock) ImmutableList(com.google.common.collect.ImmutableList) CompletedCallback(io.pravega.client.connection.impl.ClientConnection.CompletedCallback) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ReusableLatch(io.pravega.common.util.ReusableLatch) RetryWithBackoff(io.pravega.common.util.Retry.RetryWithBackoff) InOrder(org.mockito.InOrder) ConnectionPool(io.pravega.client.connection.impl.ConnectionPool) MockConnectionFactoryImpl(io.pravega.client.stream.mock.MockConnectionFactoryImpl) lombok.val(lombok.val) Assert.assertTrue(org.junit.Assert.assertTrue) IOException(java.io.IOException) Test(org.junit.Test) Mockito.times(org.mockito.Mockito.times) WireCommands(io.pravega.shared.protocol.netty.WireCommands) Mockito.verify(org.mockito.Mockito.verify) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) Mockito(org.mockito.Mockito) Mockito.never(org.mockito.Mockito.never) InlineExecutor(io.pravega.test.common.InlineExecutor) ExecutorServiceHelpers(io.pravega.common.concurrent.ExecutorServiceHelpers) Collections(java.util.Collections) Mockito.reset(org.mockito.Mockito.reset) Assert.assertEquals(org.junit.Assert.assertEquals) CompletableFuture(java.util.concurrent.CompletableFuture) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) MockConnectionFactoryImpl(io.pravega.client.stream.mock.MockConnectionFactoryImpl) SetupAppend(io.pravega.shared.protocol.netty.WireCommands.SetupAppend) ClientConnection(io.pravega.client.connection.impl.ClientConnection) UUID(java.util.UUID) WireCommands(io.pravega.shared.protocol.netty.WireCommands) ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) ByteBuffer(java.nio.ByteBuffer) AppendSetup(io.pravega.shared.protocol.netty.WireCommands.AppendSetup) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) Append(io.pravega.shared.protocol.netty.Append) SetupAppend(io.pravega.shared.protocol.netty.WireCommands.SetupAppend) InvocationOnMock(org.mockito.invocation.InvocationOnMock) MockController(io.pravega.client.stream.mock.MockController) Test(org.junit.Test)

Example 73 with MockConnectionFactoryImpl

use of io.pravega.client.stream.mock.MockConnectionFactoryImpl in project pravega by pravega.

the class SegmentOutputStreamTest method testNewEventsGoAfterInflight.

@Test(timeout = 20000)
public void testNewEventsGoAfterInflight() throws ConnectionFailedException {
    UUID cid = UUID.randomUUID();
    PravegaNodeUri uri = new PravegaNodeUri("endpoint", SERVICE_PORT);
    MockConnectionFactoryImpl cf = new MockConnectionFactoryImpl();
    cf.setExecutor(executorService());
    MockController controller = new MockController(uri.getEndpoint(), uri.getPort(), cf, true);
    ClientConnection connection = mock(ClientConnection.class);
    InOrder inOrder = inOrder(connection);
    cf.provideConnection(uri, connection);
    @SuppressWarnings("resource") SegmentOutputStreamImpl output = new SegmentOutputStreamImpl(SEGMENT, true, controller, cf, cid, segmentSealedCallback, RETRY_SCHEDULE, DelegationTokenProviderFactory.createWithEmptyToken());
    output.reconnect();
    cf.getProcessor(uri).appendSetup(new AppendSetup(1, SEGMENT, cid, 0));
    output.write(PendingEvent.withoutHeader(null, getBuffer("test1"), new CompletableFuture<>()));
    output.write(PendingEvent.withoutHeader(null, getBuffer("test2"), new CompletableFuture<>()));
    answerSuccess(connection);
    cf.getProcessor(uri).connectionDropped();
    AssertExtensions.assertBlocks(() -> output.write(PendingEvent.withoutHeader(null, getBuffer("test3"), new CompletableFuture<>())), () -> cf.getProcessor(uri).appendSetup(new AppendSetup(1, SEGMENT, cid, 0)));
    output.write(PendingEvent.withoutHeader(null, getBuffer("test4"), new CompletableFuture<>()));
    Append append1 = new Append(SEGMENT, cid, 1, 1, Unpooled.wrappedBuffer(getBuffer("test1")), null, output.getRequestId());
    Append append2 = new Append(SEGMENT, cid, 2, 1, Unpooled.wrappedBuffer(getBuffer("test2")), null, output.getRequestId());
    Append append3 = new Append(SEGMENT, cid, 3, 1, Unpooled.wrappedBuffer(getBuffer("test3")), null, output.getRequestId());
    Append append4 = new Append(SEGMENT, cid, 4, 1, Unpooled.wrappedBuffer(getBuffer("test4")), null, output.getRequestId());
    inOrder.verify(connection).send(new SetupAppend(output.getRequestId(), cid, SEGMENT, ""));
    inOrder.verify(connection).send(append1);
    inOrder.verify(connection).send(append2);
    inOrder.verify(connection).close();
    inOrder.verify(connection).send(new SetupAppend(output.getRequestId(), cid, SEGMENT, ""));
    inOrder.verify(connection).sendAsync(eq(ImmutableList.of(append1, append2)), any());
    inOrder.verify(connection).send(append3);
    inOrder.verify(connection).send(append4);
    verifyNoMoreInteractions(connection);
}
Also used : InOrder(org.mockito.InOrder) AppendSetup(io.pravega.shared.protocol.netty.WireCommands.AppendSetup) CompletableFuture(java.util.concurrent.CompletableFuture) Append(io.pravega.shared.protocol.netty.Append) SetupAppend(io.pravega.shared.protocol.netty.WireCommands.SetupAppend) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) MockConnectionFactoryImpl(io.pravega.client.stream.mock.MockConnectionFactoryImpl) SetupAppend(io.pravega.shared.protocol.netty.WireCommands.SetupAppend) MockController(io.pravega.client.stream.mock.MockController) ClientConnection(io.pravega.client.connection.impl.ClientConnection) UUID(java.util.UUID) Test(org.junit.Test)

Example 74 with MockConnectionFactoryImpl

use of io.pravega.client.stream.mock.MockConnectionFactoryImpl in project pravega by pravega.

the class SegmentOutputStreamTest method testInflightWithMultipleConnectFailures.

@Test(timeout = 10000)
public void testInflightWithMultipleConnectFailures() throws Exception {
    UUID cid = UUID.randomUUID();
    PravegaNodeUri uri = new PravegaNodeUri("endpoint", SERVICE_PORT);
    RetryWithBackoff retryConfig = Retry.withExpBackoff(1, 1, 1);
    MockConnectionFactoryImpl cf = new MockConnectionFactoryImpl();
    ScheduledExecutorService executor = mock(ScheduledExecutorService.class);
    // Ensure task submitted to executor is run inline.
    implementAsDirectExecutor(executor);
    cf.setExecutor(executor);
    MockController controller = new MockController(uri.getEndpoint(), uri.getPort(), cf, true);
    ClientConnection connection = mock(ClientConnection.class);
    cf.provideConnection(uri, connection);
    SegmentOutputStreamImpl output = new SegmentOutputStreamImpl(SEGMENT, true, controller, cf, cid, segmentSealedCallback, retryConfig, DelegationTokenProviderFactory.createWithEmptyToken());
    try {
        output.reconnect();
        verify(connection).send(new SetupAppend(output.getRequestId(), cid, SEGMENT, ""));
        // Simulate a successful connection setup.
        cf.getProcessor(uri).appendSetup(new AppendSetup(output.getRequestId(), SEGMENT, cid, 0));
        // try sending an event.
        byte[] eventData = "test data".getBytes();
        CompletableFuture<Void> ack1 = new CompletableFuture<>();
        output.write(PendingEvent.withoutHeader(null, ByteBuffer.wrap(eventData), ack1));
        verify(connection).send(new Append(SEGMENT, cid, 1, 1, Unpooled.wrappedBuffer(eventData), null, output.getRequestId()));
        reset(connection);
        // simulate a connection drop and verify if the writer tries to establish a new connection.
        cf.getProcessor(uri).connectionDropped();
        verify(connection).send(new SetupAppend(output.getRequestId(), cid, SEGMENT, ""));
        reset(connection);
        // Simulate a connection drop again.
        cf.getProcessor(uri).connectionDropped();
        // Since we have exceeded the retry attempts verify we do not try to establish a connection.
        verify(connection, never()).send(new SetupAppend(output.getRequestId(), cid, SEGMENT, ""));
        assertTrue("Connection is  exceptionally closed with RetriesExhaustedException", output.getConnection().isCompletedExceptionally());
        AssertExtensions.assertThrows(RetriesExhaustedException.class, () -> Futures.getThrowingException(output.getConnection()));
        // Verify that the inflight event future is completed exceptionally.
        AssertExtensions.assertThrows(RetriesExhaustedException.class, () -> Futures.getThrowingException(ack1));
        // Write an additional event to a writer that has failed with RetriesExhaustedException.
        CompletableFuture<Void> ack2 = new CompletableFuture<>();
        output.write(PendingEvent.withoutHeader(null, ByteBuffer.wrap(eventData), ack2));
        verify(connection, never()).send(new SetupAppend(output.getRequestId(), cid, SEGMENT, ""));
        AssertExtensions.assertThrows(RetriesExhaustedException.class, () -> Futures.getThrowingException(ack2));
        // Verify that a flush on the SegmentOutputStream does throw a RetriesExhaustedException.
        AssertExtensions.assertThrows(RetriesExhaustedException.class, output::flush);
    } finally {
        // Verify that a close on the SegmentOutputStream does throw a RetriesExhaustedException.
        AssertExtensions.assertThrows(RetriesExhaustedException.class, output::close);
    }
}
Also used : ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) RetryWithBackoff(io.pravega.common.util.Retry.RetryWithBackoff) AppendSetup(io.pravega.shared.protocol.netty.WireCommands.AppendSetup) CompletableFuture(java.util.concurrent.CompletableFuture) Append(io.pravega.shared.protocol.netty.Append) SetupAppend(io.pravega.shared.protocol.netty.WireCommands.SetupAppend) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) MockConnectionFactoryImpl(io.pravega.client.stream.mock.MockConnectionFactoryImpl) SetupAppend(io.pravega.shared.protocol.netty.WireCommands.SetupAppend) MockController(io.pravega.client.stream.mock.MockController) ClientConnection(io.pravega.client.connection.impl.ClientConnection) UUID(java.util.UUID) Test(org.junit.Test)

Example 75 with MockConnectionFactoryImpl

use of io.pravega.client.stream.mock.MockConnectionFactoryImpl in project pravega by pravega.

the class SegmentOutputStreamTest method testReconnectOnMissedAcks.

@Test(timeout = 10000)
public void testReconnectOnMissedAcks() throws ConnectionFailedException {
    UUID cid = UUID.randomUUID();
    PravegaNodeUri uri = new PravegaNodeUri("endpoint", SERVICE_PORT);
    MockConnectionFactoryImpl cf = spy(new MockConnectionFactoryImpl());
    ScheduledExecutorService executor = mock(ScheduledExecutorService.class);
    // Ensure task submitted to executor is run inline.
    implementAsDirectExecutor(executor);
    cf.setExecutor(executor);
    MockController controller = new MockController(uri.getEndpoint(), uri.getPort(), cf, true);
    ClientConnection connection = mock(ClientConnection.class);
    cf.provideConnection(uri, connection);
    InOrder order = Mockito.inOrder(connection);
    @SuppressWarnings("resource") SegmentOutputStreamImpl output = new SegmentOutputStreamImpl(SEGMENT, true, controller, cf, cid, segmentSealedCallback, RETRY_SCHEDULE, DelegationTokenProviderFactory.createWithEmptyToken());
    output.reconnect();
    order.verify(connection).send(new SetupAppend(output.getRequestId(), cid, SEGMENT, ""));
    cf.getProcessor(uri).appendSetup(new AppendSetup(1, SEGMENT, cid, 0));
    ByteBuffer data = getBuffer("test");
    CompletableFuture<Void> acked1 = new CompletableFuture<>();
    output.write(PendingEvent.withoutHeader(null, data, acked1));
    order.verify(connection).send(new Append(SEGMENT, cid, 1, 1, Unpooled.wrappedBuffer(data), null, output.getRequestId()));
    assertEquals(false, acked1.isDone());
    AssertExtensions.assertBlocks(() -> output.flush(), () -> cf.getProcessor(uri).dataAppended(new WireCommands.DataAppended(output.getRequestId(), cid, 1, 0, -1)));
    assertEquals(false, acked1.isCompletedExceptionally());
    assertEquals(true, acked1.isDone());
    order.verify(connection).send(new WireCommands.KeepAlive());
    // simulate missed ack
    CompletableFuture<Void> acked2 = new CompletableFuture<>();
    output.write(PendingEvent.withoutHeader(null, data, acked2));
    order.verify(connection).send(new Append(SEGMENT, cid, 2, 1, Unpooled.wrappedBuffer(data), null, output.getRequestId()));
    assertEquals(false, acked2.isDone());
    cf.getProcessor(uri).dataAppended(new WireCommands.DataAppended(output.getRequestId(), cid, 3, 2L, -1));
    // check that client reconnected
    verify(cf, times(2)).establishConnection(any(), any());
}
Also used : ScheduledExecutorService(java.util.concurrent.ScheduledExecutorService) InOrder(org.mockito.InOrder) ByteBuffer(java.nio.ByteBuffer) AppendSetup(io.pravega.shared.protocol.netty.WireCommands.AppendSetup) CompletableFuture(java.util.concurrent.CompletableFuture) Append(io.pravega.shared.protocol.netty.Append) SetupAppend(io.pravega.shared.protocol.netty.WireCommands.SetupAppend) PravegaNodeUri(io.pravega.shared.protocol.netty.PravegaNodeUri) MockConnectionFactoryImpl(io.pravega.client.stream.mock.MockConnectionFactoryImpl) SetupAppend(io.pravega.shared.protocol.netty.WireCommands.SetupAppend) MockController(io.pravega.client.stream.mock.MockController) ClientConnection(io.pravega.client.connection.impl.ClientConnection) UUID(java.util.UUID) WireCommands(io.pravega.shared.protocol.netty.WireCommands) Test(org.junit.Test)

Aggregations

MockConnectionFactoryImpl (io.pravega.client.stream.mock.MockConnectionFactoryImpl)121 MockController (io.pravega.client.stream.mock.MockController)118 PravegaNodeUri (io.pravega.shared.protocol.netty.PravegaNodeUri)114 Test (org.junit.Test)114 Cleanup (lombok.Cleanup)86 ClientConnection (io.pravega.client.connection.impl.ClientConnection)73 Segment (io.pravega.client.segment.impl.Segment)41 WireCommands (io.pravega.shared.protocol.netty.WireCommands)37 UUID (java.util.UUID)37 InvocationOnMock (org.mockito.invocation.InvocationOnMock)37 ReplyProcessor (io.pravega.shared.protocol.netty.ReplyProcessor)36 AppendSetup (io.pravega.shared.protocol.netty.WireCommands.AppendSetup)34 SetupAppend (io.pravega.shared.protocol.netty.WireCommands.SetupAppend)34 ByteBuffer (java.nio.ByteBuffer)32 MockSegmentStreamFactory (io.pravega.client.stream.mock.MockSegmentStreamFactory)31 AtomicLong (java.util.concurrent.atomic.AtomicLong)29 CompletableFuture (java.util.concurrent.CompletableFuture)27 InOrder (org.mockito.InOrder)27 SynchronizerClientFactory (io.pravega.client.SynchronizerClientFactory)26 SynchronizerConfig (io.pravega.client.state.SynchronizerConfig)22