Package cz.o2.proxima.beam.direct.io
Class DirectDataAccessorWrapper
- java.lang.Object
-
- cz.o2.proxima.beam.direct.io.DirectDataAccessorWrapper
-
- All Implemented Interfaces:
DataAccessor,AbstractDataAccessor,java.io.Serializable
public class DirectDataAccessorWrapper extends java.lang.Object implements DataAccessor
Wrapper of direct data accessor to beam one.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private Contextcontextprivate DataAccessordirectprivate RepositoryFactoryfactoryprivate static longserialVersionUIDprivate java.net.URIuri
-
Constructor Summary
Constructors Constructor Description DirectDataAccessorWrapper(Repository repo, DataAccessor direct, AttributeFamilyDescriptor familyDescriptor, Context context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.beam.sdk.values.PCollection<StreamElement>createBatch(org.apache.beam.sdk.Pipeline pipeline, java.util.List<AttributeDescriptor<?>> attrs, long startStamp, long endStamp)CreatePCollectionfor given attribute family's batch updates storage.org.apache.beam.sdk.values.PCollection<StreamElement>createStream(java.lang.String name, org.apache.beam.sdk.Pipeline pipeline, Position position, boolean stopAtCurrent, boolean eventTime, long limit)CreatePCollectionfor given attribute family's commit log.org.apache.beam.sdk.values.PCollection<StreamElement>createStreamFromUpdates(org.apache.beam.sdk.Pipeline pipeline, java.util.List<AttributeDescriptor<?>> attrs, long startStamp, long endStamp, long limit)CreatePCollectionfor given attribute family's batchUpdates.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cz.o2.proxima.storage.internal.AbstractDataAccessor
getUri
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
factory
private final RepositoryFactory factory
-
direct
private final DataAccessor direct
-
uri
private final java.net.URI uri
-
context
private final Context context
-
-
Constructor Detail
-
DirectDataAccessorWrapper
public DirectDataAccessorWrapper(Repository repo, DataAccessor direct, AttributeFamilyDescriptor familyDescriptor, Context context)
-
-
Method Detail
-
createStream
public org.apache.beam.sdk.values.PCollection<StreamElement> createStream(java.lang.String name, org.apache.beam.sdk.Pipeline pipeline, Position position, boolean stopAtCurrent, boolean eventTime, long limit)
Description copied from interface:DataAccessorCreatePCollectionfor given attribute family's commit log.- Specified by:
createStreamin interfaceDataAccessor- Parameters:
name- name of the consumerpipeline- pipeline to createPCollectioninposition- to read fromstopAtCurrent- stop reading at current dataeventTime-trueto use event timelimit- limit number of elements read. Note that the number of elements might be actually lower, because it is divided by number of partitions It is useful mostly for testing purposes- Returns:
PCollectionrepresenting the commit log
-
createBatch
public org.apache.beam.sdk.values.PCollection<StreamElement> createBatch(org.apache.beam.sdk.Pipeline pipeline, java.util.List<AttributeDescriptor<?>> attrs, long startStamp, long endStamp)
Description copied from interface:DataAccessorCreatePCollectionfor given attribute family's batch updates storage.- Specified by:
createBatchin interfaceDataAccessor- Parameters:
pipeline- pipeline to createPCollectioninattrs- attributes to readstartStamp- minimal update timestamp (inclusive)endStamp- maximal update timestamp (exclusive)- Returns:
PCollectionrepresenting the batch updates
-
createStreamFromUpdates
public org.apache.beam.sdk.values.PCollection<StreamElement> createStreamFromUpdates(org.apache.beam.sdk.Pipeline pipeline, java.util.List<AttributeDescriptor<?>> attrs, long startStamp, long endStamp, long limit)
Description copied from interface:DataAccessorCreatePCollectionfor given attribute family's batchUpdates. The created PCollection is purposefully treated as unbounded (although it is bounded, in fact), which gives better performance in cases when it is united with another unboundedPCollection.- Specified by:
createStreamFromUpdatesin interfaceDataAccessor- Parameters:
pipeline- pipeline to createPCollectioninattrs- attributes to read updates forstartStamp- minimal update timestamp (inclusive)endStamp- maximal update timestamp (exclusive)limit- limit number of elements read. Note that the number of elements might be actually lower, because it is divided by number of partitions It is useful mostly for testing purposes- Returns:
PCollectionrepresenting the commit log
-
-