Package cz.o2.proxima.beam.core
Class AttributeFamilyProxyDataAccessor
- java.lang.Object
-
- cz.o2.proxima.beam.core.AttributeFamilyProxyDataAccessor
-
- All Implemented Interfaces:
DataAccessor,AbstractDataAccessor,java.io.Serializable
public class AttributeFamilyProxyDataAccessor extends java.lang.Object implements DataAccessor
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<AttributeProxyDescriptor<?>,AttributeDescriptor<?>>lookupProxyprivate java.util.Map<AttributeDescriptor<?>,AttributeProxyDescriptor<?>>lookupTargetprivate AttributeFamilyProxyDescriptorproxyprivate DataAccessorreadAccessorprivate static longserialVersionUIDprivate DataAccessorwriteAccessor
-
Constructor Summary
Constructors Modifier Constructor Description privateAttributeFamilyProxyDataAccessor(AttributeFamilyProxyDescriptor proxy, DataAccessor readAccessor, DataAccessor writeAccessor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private org.apache.beam.sdk.values.PCollection<StreamElement>applyTransform(org.apache.beam.sdk.values.PCollection<StreamElement> in)private java.util.Optional<BeamProxyTransform>asBeamTransform(java.util.Collection<? extends AttributeDescriptor<?>> attrs)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.java.net.URIgetUri()static AttributeFamilyProxyDataAccessorof(AttributeFamilyProxyDescriptor proxy, DataAccessor readAccessor, DataAccessor writeAccessor)(package private) java.util.List<AttributeDescriptor<?>>transformAttrs(java.util.List<AttributeDescriptor<?>> attrs)private StreamElementtransformSingleRead(StreamElement input)
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
proxy
private final AttributeFamilyProxyDescriptor proxy
-
readAccessor
private final DataAccessor readAccessor
-
writeAccessor
private final DataAccessor writeAccessor
-
lookupTarget
private final java.util.Map<AttributeDescriptor<?>,AttributeProxyDescriptor<?>> lookupTarget
-
lookupProxy
private final java.util.Map<AttributeProxyDescriptor<?>,AttributeDescriptor<?>> lookupProxy
-
-
Constructor Detail
-
AttributeFamilyProxyDataAccessor
private AttributeFamilyProxyDataAccessor(AttributeFamilyProxyDescriptor proxy, DataAccessor readAccessor, DataAccessor writeAccessor)
-
-
Method Detail
-
of
public static AttributeFamilyProxyDataAccessor of(AttributeFamilyProxyDescriptor proxy, DataAccessor readAccessor, DataAccessor writeAccessor)
-
getUri
public java.net.URI getUri()
- Specified by:
getUriin interfaceAbstractDataAccessor
-
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
-
transformAttrs
java.util.List<AttributeDescriptor<?>> transformAttrs(java.util.List<AttributeDescriptor<?>> attrs)
-
applyTransform
private org.apache.beam.sdk.values.PCollection<StreamElement> applyTransform(org.apache.beam.sdk.values.PCollection<StreamElement> in)
-
transformSingleRead
private StreamElement transformSingleRead(StreamElement input)
-
asBeamTransform
private final java.util.Optional<BeamProxyTransform> asBeamTransform(java.util.Collection<? extends AttributeDescriptor<?>> attrs)
-
-