Search in sources :

Example 1 with EntityDescriptor

use of cz.o2.proxima.repository.EntityDescriptor in project proxima-platform by O2-Czech-Republic.

the class HadoopStorageTest method testHashCodeAndEquals.

@Test
public void testHashCodeAndEquals() {
    TestUtils.assertHashCodeAndEquals(new HadoopStorage(), new HadoopStorage());
    EntityDescriptor entity = EntityDescriptor.newBuilder().setName("dummy").build();
    final AttributeFamilyDescriptor family = TestUtils.createTestFamily(entity, URI.create("hdfs://host:9000/path"));
    TestUtils.assertHashCodeAndEquals(new HadoopDataAccessor(family), new HadoopDataAccessor(family));
}
Also used : EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) AttributeFamilyDescriptor(cz.o2.proxima.repository.AttributeFamilyDescriptor) Test(org.junit.Test)

Example 2 with EntityDescriptor

use of cz.o2.proxima.repository.EntityDescriptor in project proxima-platform by O2-Czech-Republic.

the class WebsocketReader method asFactory.

@Override
public Factory<?> asFactory() {
    final EntityDescriptor entity = getEntityDescriptor();
    final URI uri = getUri();
    final Map<String, Object> cfg = this.cfg;
    return repo -> new WebsocketReader(entity, uri, cfg);
}
Also used : ObserverUtils.asOnNextContext(cz.o2.proxima.direct.commitlog.ObserverUtils.asOnNextContext) ServerHandshake(org.java_websocket.handshake.ServerHandshake) Iterables(com.google.common.collect.Iterables) Arrays(java.util.Arrays) WebSocketClient(org.java_websocket.client.WebSocketClient) Partition(cz.o2.proxima.storage.Partition) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) StreamElement(cz.o2.proxima.storage.StreamElement) UnaryFunction(cz.o2.proxima.functional.UnaryFunction) Map(java.util.Map) URI(java.net.URI) CommitLogReader(cz.o2.proxima.direct.commitlog.CommitLogReader) AbstractStorage(cz.o2.proxima.storage.AbstractStorage) Collection(java.util.Collection) AttributeDescriptor(cz.o2.proxima.repository.AttributeDescriptor) CommitLogObserver(cz.o2.proxima.direct.commitlog.CommitLogObserver) ObserveHandle(cz.o2.proxima.direct.commitlog.ObserveHandle) UUID(java.util.UUID) StandardCharsets(java.nio.charset.StandardCharsets) Offset(cz.o2.proxima.direct.commitlog.Offset) Objects(java.util.Objects) Consumer(java.util.function.Consumer) List(java.util.List) OnNextContext(cz.o2.proxima.direct.commitlog.CommitLogObserver.OnNextContext) Optional(java.util.Optional) Position(cz.o2.proxima.storage.commitlog.Position) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) URI(java.net.URI)

Example 3 with EntityDescriptor

use of cz.o2.proxima.repository.EntityDescriptor in project proxima-platform by O2-Czech-Republic.

the class OpenTsdbWriter method asFactory.

@Override
public Factory<?> asFactory() {
    final EntityDescriptor entity = getEntityDescriptor();
    final URI uri = getUri();
    final Map<String, Object> cfg = getCfg();
    return repo -> new OpenTsdbWriter(entity, uri, cfg);
}
Also used : HttpWriter(cz.o2.proxima.direct.http.HttpWriter) Map(java.util.Map) Evolving(cz.o2.proxima.annotations.Evolving) ConnFactory(cz.o2.proxima.direct.http.ConnFactory) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) URI(java.net.URI) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) URI(java.net.URI)

Example 4 with EntityDescriptor

use of cz.o2.proxima.repository.EntityDescriptor in project proxima-platform by O2-Czech-Republic.

the class HBaseLogReader method asFactory.

@Override
public Factory<?> asFactory() {
    final URI uri = getUri();
    final EntityDescriptor entity = this.entity;
    final cz.o2.proxima.functional.Factory<ExecutorService> executorFactory = this.executorFactory;
    final byte[] serializedConf = this.serializedConf;
    return repo -> new HBaseLogReader(uri, deserialize(serializedConf, new Configuration()), entity, executorFactory);
}
Also used : BatchLogReader(cz.o2.proxima.direct.batch.BatchLogReader) Partition(cz.o2.proxima.storage.Partition) Result(org.apache.hadoop.hbase.client.Result) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) FilterList(org.apache.hadoop.hbase.filter.FilterList) TerminationContext(cz.o2.proxima.direct.batch.TerminationContext) BatchLogObservers(cz.o2.proxima.direct.batch.BatchLogObservers) ArrayList(java.util.ArrayList) ColumnPrefixFilter(org.apache.hadoop.hbase.filter.ColumnPrefixFilter) ExceptionUtils(cz.o2.proxima.util.ExceptionUtils) StreamElement(cz.o2.proxima.storage.StreamElement) BinaryComparator(org.apache.hadoop.hbase.filter.BinaryComparator) Configuration(org.apache.hadoop.conf.Configuration) URI(java.net.URI) CompareFilter(org.apache.hadoop.hbase.filter.CompareFilter) ObserveHandle(cz.o2.proxima.direct.batch.ObserveHandle) ExecutorService(java.util.concurrent.ExecutorService) Cell(org.apache.hadoop.hbase.Cell) AttributeDescriptor(cz.o2.proxima.repository.AttributeDescriptor) BatchLogObserver(cz.o2.proxima.direct.batch.BatchLogObserver) IOException(java.io.IOException) StandardCharsets(java.nio.charset.StandardCharsets) Scan(org.apache.hadoop.hbase.client.Scan) CellScanner(org.apache.hadoop.hbase.CellScanner) List(java.util.List) Slf4j(lombok.extern.slf4j.Slf4j) ResultScanner(org.apache.hadoop.hbase.client.ResultScanner) QualifierFilter(org.apache.hadoop.hbase.filter.QualifierFilter) Filter(org.apache.hadoop.hbase.filter.Filter) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) Configuration(org.apache.hadoop.conf.Configuration) ExecutorService(java.util.concurrent.ExecutorService) URI(java.net.URI)

Example 5 with EntityDescriptor

use of cz.o2.proxima.repository.EntityDescriptor in project proxima-platform by O2-Czech-Republic.

the class HttpWriter method asFactory.

@Override
public Factory<?> asFactory() {
    final EntityDescriptor entity = getEntityDescriptor();
    final URI uri = getUri();
    final Map<String, Object> cfg = this.cfg;
    return repo -> new HttpWriter(entity, uri, cfg);
}
Also used : Context(cz.o2.proxima.direct.core.Context) HttpURLConnection(java.net.HttpURLConnection) Classpath(cz.o2.proxima.util.Classpath) AttributeWriterBase(cz.o2.proxima.direct.core.AttributeWriterBase) AbstractStorage(cz.o2.proxima.storage.AbstractStorage) Getter(lombok.Getter) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) OnlineAttributeWriter(cz.o2.proxima.direct.core.OnlineAttributeWriter) CommitCallback(cz.o2.proxima.direct.core.CommitCallback) StreamElement(cz.o2.proxima.storage.StreamElement) DataAccessor(cz.o2.proxima.direct.core.DataAccessor) Map(java.util.Map) Optional(java.util.Optional) URI(java.net.URI) EntityDescriptor(cz.o2.proxima.repository.EntityDescriptor) URI(java.net.URI)

Aggregations

EntityDescriptor (cz.o2.proxima.repository.EntityDescriptor)84 Test (org.junit.Test)63 ArrayList (java.util.ArrayList)39 StreamElement (cz.o2.proxima.storage.StreamElement)37 CountDownLatch (java.util.concurrent.CountDownLatch)28 AttributeDescriptor (cz.o2.proxima.repository.AttributeDescriptor)26 URI (java.net.URI)24 CommitLogObserver (cz.o2.proxima.direct.commitlog.CommitLogObserver)22 List (java.util.List)22 Map (java.util.Map)22 Optional (java.util.Optional)22 KeyValue (cz.o2.proxima.direct.randomaccess.KeyValue)21 Slf4j (lombok.extern.slf4j.Slf4j)21 CommitLogReader (cz.o2.proxima.direct.commitlog.CommitLogReader)20 AttributeFamilyDescriptor (cz.o2.proxima.repository.AttributeFamilyDescriptor)20 RandomAccessReader (cz.o2.proxima.direct.randomaccess.RandomAccessReader)19 IOException (java.io.IOException)19 Collections (java.util.Collections)19 Objects (java.util.Objects)19 AtomicReference (java.util.concurrent.atomic.AtomicReference)19