Search in sources :

Example 41 with OnNextContext

use of cz.o2.proxima.direct.commitlog.CommitLogObserver.OnNextContext in project proxima-platform by O2-Czech-Republic.

the class DirectDataOperatorTest method testProxyObserveWithAttributeName.

private void testProxyObserveWithAttributeName(String name) throws InterruptedException {
    EntityDescriptor proxied = repo.getEntity("proxied");
    AttributeDescriptor<?> source = proxied.getAttribute("event.*");
    CommitLogReader reader = direct.getFamiliesForAttribute(source).stream().filter(af -> af.getDesc().getAccess().canReadCommitLog()).findAny().flatMap(DirectAttributeFamilyDescriptor::getCommitLogReader).get();
    List<StreamElement> read = new ArrayList<>();
    reader.observe("dummy", new CommitLogObserver() {

        @Override
        public boolean onNext(StreamElement ingest, OnNextContext context) {
            read.add(ingest);
            context.confirm();
            return true;
        }

        @Override
        public boolean onError(Throwable error) {
            throw new RuntimeException(error);
        }
    }).waitUntilReady();
    direct.getWriter(source).get().write(StreamElement.upsert(proxied, source, UUID.randomUUID().toString(), "key", name, System.currentTimeMillis(), "test".getBytes(StandardCharsets.UTF_8)), (s, exc) -> {
        assertTrue(s);
    });
    assertTrue(direct.getWriter(source).isPresent());
    direct.getWriter(source).get().write(StreamElement.upsert(proxied, source, UUID.randomUUID().toString(), "key", "event.def", System.currentTimeMillis(), "test2".getBytes(StandardCharsets.UTF_8)), (s, exc) -> {
        assertTrue(s);
    });
    assertEquals(2, read.size());
    assertEquals("test", new String((byte[]) read.get(0).getValue()));
    assertEquals(source, read.get(0).getAttributeDescriptor());
    assertEquals("event.abc", read.get(0).getAttribute());
    assertEquals("key", read.get(0).getKey());
    assertEquals("test2", new String((byte[]) read.get(1).getValue()));
    assertEquals(source, read.get(1).getAttributeDescriptor());
    assertEquals("event.def", read.get(1).getAttribute());
    assertEquals("key", read.get(1).getKey());
}
Also used : Arrays(java.util.Arrays) TestTracker(cz.o2.proxima.storage.watermark.GlobalWatermarkThroughputLimiterTest.TestTracker) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) StorageType(cz.o2.proxima.storage.StorageType) DummyFilter(cz.o2.proxima.util.DummyFilter) EventDataToDummy(cz.o2.proxima.transform.EventDataToDummy) CachedView(cz.o2.proxima.direct.view.CachedView) StreamElement(cz.o2.proxima.storage.StreamElement) TransformationRunner(cz.o2.proxima.util.TransformationRunner) Map(java.util.Map) AttributeFamilyProxyDescriptor(cz.o2.proxima.repository.AttributeFamilyProxyDescriptor) Assert.fail(org.junit.Assert.fail) URI(java.net.URI) TransformationDescriptor(cz.o2.proxima.repository.TransformationDescriptor) Optionals(cz.o2.proxima.util.Optionals) TestUtils(cz.o2.proxima.util.TestUtils) Set(java.util.Set) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) GlobalWatermarkThroughputLimiter(cz.o2.proxima.storage.watermark.GlobalWatermarkThroughputLimiter) Objects(java.util.Objects) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) ConfigRepository(cz.o2.proxima.repository.ConfigRepository) KeyValue(cz.o2.proxima.direct.randomaccess.KeyValue) Assert.assertFalse(org.junit.Assert.assertFalse) Accept(cz.o2.proxima.storage.internal.AbstractDataAccessorFactory.Accept) Optional(java.util.Optional) ElementWiseTransformation(cz.o2.proxima.transform.ElementWiseTransformation) UnsupportedEncodingException(java.io.UnsupportedEncodingException) ThroughputLimiter(cz.o2.proxima.storage.ThroughputLimiter) AttributeProxyDescriptor(cz.o2.proxima.repository.AttributeProxyDescriptor) Iterables(com.google.common.collect.Iterables) LimitedCommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReaders.LimitedCommitLogReader) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArrayList(java.util.ArrayList) ConfigFactory(com.typesafe.config.ConfigFactory) CommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReader) RandomAccessReader(cz.o2.proxima.direct.randomaccess.RandomAccessReader) PassthroughFilter(cz.o2.proxima.storage.PassthroughFilter) Config(com.typesafe.config.Config) Assert.assertNotNull(org.junit.Assert.assertNotNull) AttributeDescriptor(cz.o2.proxima.repository.AttributeDescriptor) Assert.assertTrue(org.junit.Assert.assertTrue) CommitLogObserver(cz.o2.proxima.direct.commitlog.CommitLogObserver) IOException(java.io.IOException) Test(org.junit.Test) AttributeFamilyDescriptor(cz.o2.proxima.repository.AttributeFamilyDescriptor) NotSerializableException(java.io.NotSerializableException) ReplicationRunner.runAttributeReplicas(cz.o2.proxima.util.ReplicationRunner.runAttributeReplicas) TimeUnit(java.util.concurrent.TimeUnit) GlobalWatermarkTracker(cz.o2.proxima.storage.watermark.GlobalWatermarkTracker) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) CommitLogObserver(cz.o2.proxima.direct.commitlog.CommitLogObserver) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) LimitedCommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReaders.LimitedCommitLogReader) CommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReader) ArrayList(java.util.ArrayList) StreamElement(cz.o2.proxima.storage.StreamElement)

Example 42 with OnNextContext

use of cz.o2.proxima.direct.commitlog.CommitLogObserver.OnNextContext in project proxima-platform by O2-Czech-Republic.

the class DirectDataOperatorTest method testReplicationWriteObserveInternal.

private void testReplicationWriteObserveInternal(Config config, boolean localWrite, boolean expectNonEmpty) throws InterruptedException {
    repo.reloadConfig(true, config);
    EntityDescriptor gateway = repo.getEntity("gateway");
    AttributeDescriptor<Object> armed = gateway.getAttribute("armed");
    AttributeDescriptor<Object> armedWrite = gateway.getAttribute(localWrite ? "_gatewayReplication_write$armed" : "_gatewayReplication_replicated$armed", true);
    // observe stream
    CommitLogReader reader = direct.getFamiliesForAttribute(armed).stream().filter(af -> af.getDesc().getAccess().canReadCommitLog()).findAny().flatMap(DirectAttributeFamilyDescriptor::getCommitLogReader).orElseThrow(() -> new IllegalStateException("Missing commit log reader for armed"));
    List<StreamElement> observed = new ArrayList<>();
    reader.observe("dummy", new CommitLogObserver() {

        @Override
        public boolean onNext(StreamElement ingest, OnNextContext context) {
            if (!expectNonEmpty) {
                fail("No input was expected.");
            }
            observed.add(ingest);
            return true;
        }

        @Override
        public boolean onError(Throwable error) {
            throw new RuntimeException(error);
        }
    });
    // start replications
    TransformationRunner.runTransformations(repo, direct);
    assertTrue(direct.getWriter(armedWrite).isPresent());
    OnlineAttributeWriter writer = direct.getWriter(armedWrite).get();
    writer.write(StreamElement.upsert(gateway, armedWrite, "uuid", "gw", armedWrite.getName(), System.currentTimeMillis(), new byte[] { 1, 2 }), (succ, exc) -> {
        assertTrue(succ);
    });
    // wait till write propagates
    TimeUnit.MILLISECONDS.sleep(300);
    if (expectNonEmpty) {
        assertEquals(1, observed.size());
        assertEquals(armed, observed.get(0).getAttributeDescriptor());
    }
}
Also used : Arrays(java.util.Arrays) TestTracker(cz.o2.proxima.storage.watermark.GlobalWatermarkThroughputLimiterTest.TestTracker) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) StorageType(cz.o2.proxima.storage.StorageType) DummyFilter(cz.o2.proxima.util.DummyFilter) EventDataToDummy(cz.o2.proxima.transform.EventDataToDummy) CachedView(cz.o2.proxima.direct.view.CachedView) StreamElement(cz.o2.proxima.storage.StreamElement) TransformationRunner(cz.o2.proxima.util.TransformationRunner) Map(java.util.Map) AttributeFamilyProxyDescriptor(cz.o2.proxima.repository.AttributeFamilyProxyDescriptor) Assert.fail(org.junit.Assert.fail) URI(java.net.URI) TransformationDescriptor(cz.o2.proxima.repository.TransformationDescriptor) Optionals(cz.o2.proxima.util.Optionals) TestUtils(cz.o2.proxima.util.TestUtils) Set(java.util.Set) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) GlobalWatermarkThroughputLimiter(cz.o2.proxima.storage.watermark.GlobalWatermarkThroughputLimiter) Objects(java.util.Objects) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) ConfigRepository(cz.o2.proxima.repository.ConfigRepository) KeyValue(cz.o2.proxima.direct.randomaccess.KeyValue) Assert.assertFalse(org.junit.Assert.assertFalse) Accept(cz.o2.proxima.storage.internal.AbstractDataAccessorFactory.Accept) Optional(java.util.Optional) ElementWiseTransformation(cz.o2.proxima.transform.ElementWiseTransformation) UnsupportedEncodingException(java.io.UnsupportedEncodingException) ThroughputLimiter(cz.o2.proxima.storage.ThroughputLimiter) AttributeProxyDescriptor(cz.o2.proxima.repository.AttributeProxyDescriptor) Iterables(com.google.common.collect.Iterables) LimitedCommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReaders.LimitedCommitLogReader) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArrayList(java.util.ArrayList) ConfigFactory(com.typesafe.config.ConfigFactory) CommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReader) RandomAccessReader(cz.o2.proxima.direct.randomaccess.RandomAccessReader) PassthroughFilter(cz.o2.proxima.storage.PassthroughFilter) Config(com.typesafe.config.Config) Assert.assertNotNull(org.junit.Assert.assertNotNull) AttributeDescriptor(cz.o2.proxima.repository.AttributeDescriptor) Assert.assertTrue(org.junit.Assert.assertTrue) CommitLogObserver(cz.o2.proxima.direct.commitlog.CommitLogObserver) IOException(java.io.IOException) Test(org.junit.Test) AttributeFamilyDescriptor(cz.o2.proxima.repository.AttributeFamilyDescriptor) NotSerializableException(java.io.NotSerializableException) ReplicationRunner.runAttributeReplicas(cz.o2.proxima.util.ReplicationRunner.runAttributeReplicas) TimeUnit(java.util.concurrent.TimeUnit) GlobalWatermarkTracker(cz.o2.proxima.storage.watermark.GlobalWatermarkTracker) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) LimitedCommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReaders.LimitedCommitLogReader) CommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReader) ArrayList(java.util.ArrayList) StreamElement(cz.o2.proxima.storage.StreamElement) CommitLogObserver(cz.o2.proxima.direct.commitlog.CommitLogObserver) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor)

Example 43 with OnNextContext

use of cz.o2.proxima.direct.commitlog.CommitLogObserver.OnNextContext in project proxima-platform by O2-Czech-Republic.

the class DirectDataOperatorTest method testIncomingReplicationDoesntCycle.

@Test(timeout = 10000)
public void testIncomingReplicationDoesntCycle() throws InterruptedException {
    repo.reloadConfig(true, ConfigFactory.load().withFallback(ConfigFactory.load("test-replication.conf")).withFallback(ConfigFactory.load("test-reference.conf")).resolve());
    final EntityDescriptor gateway = repo.getEntity("gateway");
    final AttributeDescriptor<Object> status = gateway.getAttribute("status");
    final AttributeDescriptor<Object> statusRead = gateway.getAttribute("_gatewayReplication_read$status", true);
    final AttributeDescriptor<Object> statusWrite = gateway.getAttribute("_gatewayReplication_write$status", true);
    TransformationRunner.runTransformations(repo, direct);
    CommitLogReader reader = direct.getCommitLogReader(status).orElseThrow(() -> new IllegalStateException("Missing random access reader for " + status.getName()));
    CountDownLatch latch = new CountDownLatch(1);
    reader.observe("dummy", new CommitLogObserver() {

        @Override
        public boolean onNext(StreamElement ingest, OnNextContext context) {
            assertEquals(ingest.getAttributeDescriptor(), status);
            latch.countDown();
            context.confirm();
            return true;
        }

        @Override
        public boolean onError(Throwable error) {
            throw new RuntimeException(error);
        }
    });
    assertTrue(direct.getWriter(statusRead).isPresent());
    OnlineAttributeWriter writer = direct.getWriter(statusRead).get();
    writer.write(StreamElement.upsert(gateway, status, "uuid", "gw", status.getName(), System.currentTimeMillis(), new byte[] { 1, 2 }), (succ, exc) -> {
        assertTrue(succ);
    });
    latch.await();
    RandomAccessReader localReader = direct.getFamiliesForAttribute(statusWrite).stream().filter(af -> af.getDesc().getType() == StorageType.PRIMARY).findAny().flatMap(DirectAttributeFamilyDescriptor::getRandomAccessReader).orElseThrow(() -> new IllegalStateException("Missing primary random access family for status write"));
    assertFalse(localReader.get("gw", statusWrite).isPresent());
}
Also used : Arrays(java.util.Arrays) TestTracker(cz.o2.proxima.storage.watermark.GlobalWatermarkThroughputLimiterTest.TestTracker) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) StorageType(cz.o2.proxima.storage.StorageType) DummyFilter(cz.o2.proxima.util.DummyFilter) EventDataToDummy(cz.o2.proxima.transform.EventDataToDummy) CachedView(cz.o2.proxima.direct.view.CachedView) StreamElement(cz.o2.proxima.storage.StreamElement) TransformationRunner(cz.o2.proxima.util.TransformationRunner) Map(java.util.Map) AttributeFamilyProxyDescriptor(cz.o2.proxima.repository.AttributeFamilyProxyDescriptor) Assert.fail(org.junit.Assert.fail) URI(java.net.URI) TransformationDescriptor(cz.o2.proxima.repository.TransformationDescriptor) Optionals(cz.o2.proxima.util.Optionals) TestUtils(cz.o2.proxima.util.TestUtils) Set(java.util.Set) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) GlobalWatermarkThroughputLimiter(cz.o2.proxima.storage.watermark.GlobalWatermarkThroughputLimiter) Objects(java.util.Objects) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) ConfigRepository(cz.o2.proxima.repository.ConfigRepository) KeyValue(cz.o2.proxima.direct.randomaccess.KeyValue) Assert.assertFalse(org.junit.Assert.assertFalse) Accept(cz.o2.proxima.storage.internal.AbstractDataAccessorFactory.Accept) Optional(java.util.Optional) ElementWiseTransformation(cz.o2.proxima.transform.ElementWiseTransformation) UnsupportedEncodingException(java.io.UnsupportedEncodingException) ThroughputLimiter(cz.o2.proxima.storage.ThroughputLimiter) AttributeProxyDescriptor(cz.o2.proxima.repository.AttributeProxyDescriptor) Iterables(com.google.common.collect.Iterables) LimitedCommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReaders.LimitedCommitLogReader) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArrayList(java.util.ArrayList) ConfigFactory(com.typesafe.config.ConfigFactory) CommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReader) RandomAccessReader(cz.o2.proxima.direct.randomaccess.RandomAccessReader) PassthroughFilter(cz.o2.proxima.storage.PassthroughFilter) Config(com.typesafe.config.Config) Assert.assertNotNull(org.junit.Assert.assertNotNull) AttributeDescriptor(cz.o2.proxima.repository.AttributeDescriptor) Assert.assertTrue(org.junit.Assert.assertTrue) CommitLogObserver(cz.o2.proxima.direct.commitlog.CommitLogObserver) IOException(java.io.IOException) Test(org.junit.Test) AttributeFamilyDescriptor(cz.o2.proxima.repository.AttributeFamilyDescriptor) NotSerializableException(java.io.NotSerializableException) ReplicationRunner.runAttributeReplicas(cz.o2.proxima.util.ReplicationRunner.runAttributeReplicas) TimeUnit(java.util.concurrent.TimeUnit) GlobalWatermarkTracker(cz.o2.proxima.storage.watermark.GlobalWatermarkTracker) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) LimitedCommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReaders.LimitedCommitLogReader) CommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReader) StreamElement(cz.o2.proxima.storage.StreamElement) CountDownLatch(java.util.concurrent.CountDownLatch) CommitLogObserver(cz.o2.proxima.direct.commitlog.CommitLogObserver) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) RandomAccessReader(cz.o2.proxima.direct.randomaccess.RandomAccessReader) Test(org.junit.Test)

Example 44 with OnNextContext

use of cz.o2.proxima.direct.commitlog.CommitLogObserver.OnNextContext in project proxima-platform by O2-Czech-Republic.

the class DirectDataOperatorTest method testObserveReplicatedWithProxy.

@Test(timeout = 10000)
public void testObserveReplicatedWithProxy() throws InterruptedException {
    repo.reloadConfig(true, ConfigFactory.load().withFallback(ConfigFactory.load("test-replication.conf")).withFallback(ConfigFactory.load("test-reference.conf")).resolve());
    final EntityDescriptor dummy = repo.getEntity("dummy");
    final AttributeDescriptor<Object> data = dummy.getAttribute("data");
    final AttributeDescriptor<Object> dataRead = dummy.getAttribute("_dummyReplicationProxiedSlave_read$data", true);
    final AttributeDescriptor<Object> dataWrite = dummy.getAttribute("_dummyReplicationProxiedSlave_write$_d", true);
    TransformationRunner.runTransformations(repo, direct);
    CommitLogReader reader = direct.getCommitLogReader(data).orElseThrow(() -> new IllegalStateException("Missing commit log reader for " + data.getName()));
    CountDownLatch latch = new CountDownLatch(1);
    reader.observe("dummy", new CommitLogObserver() {

        @Override
        public boolean onNext(StreamElement ingest, OnNextContext context) {
            assertEquals(ingest.getAttributeDescriptor(), data);
            latch.countDown();
            context.confirm();
            return true;
        }

        @Override
        public boolean onError(Throwable error) {
            throw new RuntimeException(error);
        }
    });
    OnlineAttributeWriter writer = direct.getWriter(dataRead).get();
    writer.write(StreamElement.upsert(dummy, data, "uuid", "gw", data.getName(), System.currentTimeMillis(), new byte[] { 1, 2 }), (succ, exc) -> {
        assertTrue(succ);
    });
    latch.await();
    assertFalse(direct.getFamiliesForAttribute(dataWrite).stream().filter(af -> af.getDesc().getType() == StorageType.PRIMARY).findAny().flatMap(DirectAttributeFamilyDescriptor::getRandomAccessReader).orElseThrow(() -> new IllegalStateException("Missing random access for " + dataWrite)).get("gw", dataWrite).isPresent());
}
Also used : LimitedCommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReaders.LimitedCommitLogReader) CommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReader) StreamElement(cz.o2.proxima.storage.StreamElement) CountDownLatch(java.util.concurrent.CountDownLatch) CommitLogObserver(cz.o2.proxima.direct.commitlog.CommitLogObserver) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) Test(org.junit.Test)

Example 45 with OnNextContext

use of cz.o2.proxima.direct.commitlog.CommitLogObserver.OnNextContext in project proxima-platform by O2-Czech-Republic.

the class DirectDataOperatorTest method testProxyObserveBulk.

@Test
public void testProxyObserveBulk() throws InterruptedException {
    EntityDescriptor proxied = repo.getEntity("proxied");
    AttributeDescriptor<?> source = proxied.getAttribute("event.*");
    CommitLogReader reader = direct.getFamiliesForAttribute(source).stream().filter(af -> af.getDesc().getAccess().canReadCommitLog()).findAny().flatMap(DirectAttributeFamilyDescriptor::getCommitLogReader).get();
    List<StreamElement> read = new ArrayList<>();
    reader.observeBulk("dummy", new CommitLogObserver() {

        @Override
        public boolean onNext(StreamElement ingest, OnNextContext context) {
            read.add(ingest);
            context.confirm();
            return true;
        }

        @Override
        public boolean onError(Throwable error) {
            throw new RuntimeException(error);
        }
    }).waitUntilReady();
    assertTrue(direct.getWriter(source).isPresent());
    direct.getWriter(source).get().write(StreamElement.upsert(proxied, source, UUID.randomUUID().toString(), "key", "event.abc", System.currentTimeMillis(), "test".getBytes(StandardCharsets.UTF_8)), (s, exc) -> {
        assertTrue(s);
    });
    direct.getWriter(source).get().write(StreamElement.upsert(proxied, source, UUID.randomUUID().toString(), "key", "event.def", System.currentTimeMillis(), "test2".getBytes(StandardCharsets.UTF_8)), (s, exc) -> {
        assertTrue(s);
    });
    assertEquals(2, read.size());
    assertEquals("test", new String((byte[]) read.get(0).getValue()));
    assertEquals(source, read.get(0).getAttributeDescriptor());
    assertEquals("event.abc", read.get(0).getAttribute());
    assertEquals("key", read.get(0).getKey());
    assertEquals("test2", new String((byte[]) read.get(1).getValue()));
    assertEquals(source, read.get(1).getAttributeDescriptor());
    assertEquals("event.def", read.get(1).getAttribute());
    assertEquals("key", read.get(1).getKey());
}
Also used : Arrays(java.util.Arrays) TestTracker(cz.o2.proxima.storage.watermark.GlobalWatermarkThroughputLimiterTest.TestTracker) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) StorageType(cz.o2.proxima.storage.StorageType) DummyFilter(cz.o2.proxima.util.DummyFilter) EventDataToDummy(cz.o2.proxima.transform.EventDataToDummy) CachedView(cz.o2.proxima.direct.view.CachedView) StreamElement(cz.o2.proxima.storage.StreamElement) TransformationRunner(cz.o2.proxima.util.TransformationRunner) Map(java.util.Map) AttributeFamilyProxyDescriptor(cz.o2.proxima.repository.AttributeFamilyProxyDescriptor) Assert.fail(org.junit.Assert.fail) URI(java.net.URI) TransformationDescriptor(cz.o2.proxima.repository.TransformationDescriptor) Optionals(cz.o2.proxima.util.Optionals) TestUtils(cz.o2.proxima.util.TestUtils) Set(java.util.Set) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) StandardCharsets(java.nio.charset.StandardCharsets) GlobalWatermarkThroughputLimiter(cz.o2.proxima.storage.watermark.GlobalWatermarkThroughputLimiter) Objects(java.util.Objects) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) ConfigRepository(cz.o2.proxima.repository.ConfigRepository) KeyValue(cz.o2.proxima.direct.randomaccess.KeyValue) Assert.assertFalse(org.junit.Assert.assertFalse) Accept(cz.o2.proxima.storage.internal.AbstractDataAccessorFactory.Accept) Optional(java.util.Optional) ElementWiseTransformation(cz.o2.proxima.transform.ElementWiseTransformation) UnsupportedEncodingException(java.io.UnsupportedEncodingException) ThroughputLimiter(cz.o2.proxima.storage.ThroughputLimiter) AttributeProxyDescriptor(cz.o2.proxima.repository.AttributeProxyDescriptor) Iterables(com.google.common.collect.Iterables) LimitedCommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReaders.LimitedCommitLogReader) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArrayList(java.util.ArrayList) ConfigFactory(com.typesafe.config.ConfigFactory) CommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReader) RandomAccessReader(cz.o2.proxima.direct.randomaccess.RandomAccessReader) PassthroughFilter(cz.o2.proxima.storage.PassthroughFilter) Config(com.typesafe.config.Config) Assert.assertNotNull(org.junit.Assert.assertNotNull) AttributeDescriptor(cz.o2.proxima.repository.AttributeDescriptor) Assert.assertTrue(org.junit.Assert.assertTrue) CommitLogObserver(cz.o2.proxima.direct.commitlog.CommitLogObserver) IOException(java.io.IOException) Test(org.junit.Test) AttributeFamilyDescriptor(cz.o2.proxima.repository.AttributeFamilyDescriptor) NotSerializableException(java.io.NotSerializableException) ReplicationRunner.runAttributeReplicas(cz.o2.proxima.util.ReplicationRunner.runAttributeReplicas) TimeUnit(java.util.concurrent.TimeUnit) GlobalWatermarkTracker(cz.o2.proxima.storage.watermark.GlobalWatermarkTracker) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) CommitLogObserver(cz.o2.proxima.direct.commitlog.CommitLogObserver) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) LimitedCommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReaders.LimitedCommitLogReader) CommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReader) ArrayList(java.util.ArrayList) StreamElement(cz.o2.proxima.storage.StreamElement) Test(org.junit.Test)

Aggregations

StreamElement (cz.o2.proxima.storage.StreamElement)83 Test (org.junit.Test)73 CountDownLatch (java.util.concurrent.CountDownLatch)67 CommitLogObserver (cz.o2.proxima.direct.commitlog.CommitLogObserver)64 CommitLogReader (cz.o2.proxima.direct.commitlog.CommitLogReader)50 OnNextContext (cz.o2.proxima.direct.commitlog.CommitLogObserver.OnNextContext)40 ArrayList (java.util.ArrayList)39 ObserveHandle (cz.o2.proxima.direct.commitlog.ObserveHandle)35 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)30 AtomicReference (java.util.concurrent.atomic.AtomicReference)29 EntityDescriptor (cz.o2.proxima.repository.EntityDescriptor)28 Accessor (cz.o2.proxima.direct.kafka.LocalKafkaCommitLogDescriptor.Accessor)26 List (java.util.List)26 UUID (java.util.UUID)25 AtomicLong (java.util.concurrent.atomic.AtomicLong)24 ConfigFactory (com.typesafe.config.ConfigFactory)23 AttributeDescriptor (cz.o2.proxima.repository.AttributeDescriptor)23 Collections (java.util.Collections)23 Offset (cz.o2.proxima.direct.commitlog.Offset)22 DirectDataOperator (cz.o2.proxima.direct.core.DirectDataOperator)22