Package cz.o2.proxima.beam.core
Class BeamDataOperator
- java.lang.Object
-
- cz.o2.proxima.beam.core.BeamDataOperator
-
- All Implemented Interfaces:
DataOperator,java.lang.AutoCloseable
public class BeamDataOperator extends java.lang.Object implements DataOperator
ADataOperatorfor Apache Beam transformations.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()DataAccessorgetAccessorFor(AttributeFamilyDescriptor family)GetDataAccessorfor givenAttributeFamilyDescriptor.org.apache.beam.sdk.values.PCollection<StreamElement>getBatchSnapshot(org.apache.beam.sdk.Pipeline pipeline, long fromStamp, long untilStamp, AttributeDescriptor<?>... attrs)CreatePCollectionfrom snapshot of given attributes.org.apache.beam.sdk.values.PCollection<StreamElement>getBatchSnapshot(org.apache.beam.sdk.Pipeline pipeline, AttributeDescriptor<?>... attrs)CreatePCollectionfrom snapshot of given attributes.org.apache.beam.sdk.values.PCollection<StreamElement>getBatchUpdates(org.apache.beam.sdk.Pipeline pipeline, long startStamp, long endStamp, boolean asStream, AttributeDescriptor<?>... attrs)CreatePCollectionfrom updates to given attributes with given time range.org.apache.beam.sdk.values.PCollection<StreamElement>getBatchUpdates(org.apache.beam.sdk.Pipeline pipeline, long startStamp, long endStamp, AttributeDescriptor<?>... attrs)CreatePCollectionfrom updates to given attributes with given time range.org.apache.beam.sdk.values.PCollection<StreamElement>getBatchUpdates(org.apache.beam.sdk.Pipeline pipeline, AttributeDescriptor<?>... attrs)CreatePCollectionfrom updates to given attributes.DirectDataOperatorgetDirect()RepositorygetRepository()Retrieve repository associated with the operator.org.apache.beam.sdk.values.PCollection<StreamElement>getStream(java.lang.String name, org.apache.beam.sdk.Pipeline pipeline, Position position, boolean stopAtCurrent, boolean useEventTime, AttributeDescriptor<?>... attrs)CreatePCollectionin givenPipelinefrom commit log for given attributes.org.apache.beam.sdk.values.PCollection<StreamElement>getStream(org.apache.beam.sdk.Pipeline pipeline, Position position, boolean stopAtCurrent, boolean useEventTime, AttributeDescriptor<?>... attrs)CreatePCollectionin givenPipelinefrom commit log for given attributes.booleanhasDirect()voidreload()Reload the operator afterRepositoryhas been changed.
-
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfaceDataOperator
-
reload
public void reload()
Description copied from interface:DataOperatorReload the operator afterRepositoryhas been changed.This method is called automatically, when
ConfigRepository.reloadConfig(boolean, cz.o2.proxima.typesafe.config.Config)is called.- Specified by:
reloadin interfaceDataOperator
-
getStream
@SafeVarargs public final org.apache.beam.sdk.values.PCollection<StreamElement> getStream(org.apache.beam.sdk.Pipeline pipeline, Position position, boolean stopAtCurrent, boolean useEventTime, AttributeDescriptor<?>... attrs)
CreatePCollectionin givenPipelinefrom commit log for given attributes.- Parameters:
pipeline- thePipelineto createPCollectionin.position- position in commit log to read fromstopAtCurrent-trueto stop at recent datauseEventTime-trueto use event timeattrs- the attributes to createPCollectionfor- Returns:
- the
PCollection
-
getStream
@SafeVarargs public final org.apache.beam.sdk.values.PCollection<StreamElement> getStream(@Nullable java.lang.String name, org.apache.beam.sdk.Pipeline pipeline, Position position, boolean stopAtCurrent, boolean useEventTime, AttributeDescriptor<?>... attrs)
CreatePCollectionin givenPipelinefrom commit log for given attributes.- Parameters:
name- name of the consumerpipeline- thePipelineto createPCollectionin.position- position in commit log to read fromstopAtCurrent-trueto stop at recent datauseEventTime-trueto use event timeattrs- the attributes to createPCollectionfor- Returns:
- the
PCollection
-
getBatchUpdates
@SafeVarargs public final org.apache.beam.sdk.values.PCollection<StreamElement> getBatchUpdates(org.apache.beam.sdk.Pipeline pipeline, AttributeDescriptor<?>... attrs)
CreatePCollectionfrom updates to given attributes.- Parameters:
pipeline-Pipelineto create thePCollectioninattrs- attributes to read updates for- Returns:
- the
PCollection
-
getBatchUpdates
@SafeVarargs public final org.apache.beam.sdk.values.PCollection<StreamElement> getBatchUpdates(org.apache.beam.sdk.Pipeline pipeline, long startStamp, long endStamp, AttributeDescriptor<?>... attrs)
CreatePCollectionfrom updates to given attributes with given time range.- Parameters:
pipeline-Pipelineto create thePCollectioninstartStamp- timestamp (inclusive) of first update taken into accountendStamp- timestamp (exclusive) of last update taken into accountattrs- attributes to read updates for- Returns:
- the
PCollection
-
getBatchUpdates
@SafeVarargs public final org.apache.beam.sdk.values.PCollection<StreamElement> getBatchUpdates(org.apache.beam.sdk.Pipeline pipeline, long startStamp, long endStamp, boolean asStream, AttributeDescriptor<?>... attrs)
CreatePCollectionfrom updates to given attributes with given time range.- Parameters:
pipeline-Pipelineto create thePCollectioninstartStamp- timestamp (inclusive) of first update taken into accountendStamp- timestamp (exclusive) of last update taken into accountasStream- create PCollection that is suitable for streaming processing (i.e. can update watermarks before end of input)attrs- attributes to read updates for- Returns:
- the
PCollection
-
getBatchSnapshot
public final org.apache.beam.sdk.values.PCollection<StreamElement> getBatchSnapshot(org.apache.beam.sdk.Pipeline pipeline, AttributeDescriptor<?>... attrs)
CreatePCollectionfrom snapshot of given attributes. The snapshot is either read from available storage or created by reduction of updates.- Parameters:
pipeline-Pipelineto create thePCollectioninattrs- attributes to read snapshot for- Returns:
- the
PCollection
-
getBatchSnapshot
public final org.apache.beam.sdk.values.PCollection<StreamElement> getBatchSnapshot(org.apache.beam.sdk.Pipeline pipeline, long fromStamp, long untilStamp, AttributeDescriptor<?>... attrs)
CreatePCollectionfrom snapshot of given attributes. The snapshot is either read from available storage or created by reduction of updates.- Parameters:
pipeline-Pipelineto create thePCollectioninfromStamp- ignore updates older than this stampuntilStamp- read only updates older than this timestamp (i.e. if this method was called at the given timestamp)attrs- attributes to read snapshot for- Returns:
- the
PCollection
-
getAccessorFor
public DataAccessor getAccessorFor(AttributeFamilyDescriptor family)
- Parameters:
family- descriptor of family to retrieve accessor for- Returns:
DataAccessorfor given family
-
getRepository
public Repository getRepository()
Description copied from interface:DataOperatorRetrieve repository associated with the operator.- Specified by:
getRepositoryin interfaceDataOperator- Returns:
Repositoryassociated with the operator
-
getDirect
public DirectDataOperator getDirect()
-
hasDirect
public boolean hasDirect()
-
-