Package cz.o2.proxima.beam.storage
Class TestStreamStorage
- java.lang.Object
-
- cz.o2.proxima.beam.storage.TestStreamStorage
-
- All Implemented Interfaces:
DataAccessorFactory
,AbstractDataAccessorFactory<BeamDataOperator,DataAccessor>
,java.io.Serializable
@AutoService(DataAccessorFactory.class) public class TestStreamStorage extends java.lang.Object implements DataAccessorFactory
Storage with URI schemetest-stream://
. This storage is backed byTestStream
and enables fine-tuning with regard to watermark and other stream aspects.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cz.o2.proxima.core.storage.internal.AbstractDataAccessorFactory
AbstractDataAccessorFactory.Accept
-
-
Constructor Summary
Constructors Constructor Description TestStreamStorage()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractDataAccessorFactory.Accept
accepts(java.net.URI uri)
Check if this factory can create accessors for given URI.DataAccessor
createAccessor(BeamDataOperator operator, AttributeFamilyDescriptor familyDescriptor)
Create the accessor for giveAttributeFamilyDescriptor
.static void
putStream(Repository repo, AttributeFamilyDescriptor family, org.apache.beam.sdk.testing.TestStream<StreamElement> stream)
Put givenTestStream
for givenAttributeFamilyDescriptor
.static cz.o2.proxima.typesafe.config.Config
replaceStorages(cz.o2.proxima.typesafe.config.Config config)
Replace all storages in all attribute families in given config withtest-stream
.static cz.o2.proxima.typesafe.config.Config
replaceStorages(cz.o2.proxima.typesafe.config.Config config, UnaryPredicate<java.lang.String> familyFilter)
Replace all storages in all attribute families in given config withtest-stream
.void
setup(Repository repo)
Setup the factory for using givenRepository
.
-
-
-
Method Detail
-
replaceStorages
public static cz.o2.proxima.typesafe.config.Config replaceStorages(cz.o2.proxima.typesafe.config.Config config)
Replace all storages in all attribute families in given config withtest-stream
.- Parameters:
config
- the configuration to replace- Returns:
- replaced config
-
replaceStorages
public static cz.o2.proxima.typesafe.config.Config replaceStorages(cz.o2.proxima.typesafe.config.Config config, UnaryPredicate<java.lang.String> familyFilter)
Replace all storages in all attribute families in given config withtest-stream
.- Parameters:
config
- the configuration to replacefamilyFilter
- filter for families to replace storage in- Returns:
- replaced config
-
putStream
public static void putStream(Repository repo, AttributeFamilyDescriptor family, org.apache.beam.sdk.testing.TestStream<StreamElement> stream)
Put givenTestStream
for givenAttributeFamilyDescriptor
.- Parameters:
repo
- repositoryfamily
- attribute family descriptorstream
- the stream to use as data source
-
setup
public void setup(Repository repo)
Description copied from interface:AbstractDataAccessorFactory
Setup the factory for using givenRepository
.- Specified by:
setup
in interfaceAbstractDataAccessorFactory<BeamDataOperator,DataAccessor>
- Parameters:
repo
- the repository that will be used with the factory
-
accepts
public AbstractDataAccessorFactory.Accept accepts(java.net.URI uri)
Description copied from interface:AbstractDataAccessorFactory
Check if this factory can create accessors for given URI.- Specified by:
accepts
in interfaceAbstractDataAccessorFactory<BeamDataOperator,DataAccessor>
- Parameters:
uri
- the URI to create accessor for- Returns:
- acception mark
-
createAccessor
public DataAccessor createAccessor(BeamDataOperator operator, AttributeFamilyDescriptor familyDescriptor)
Description copied from interface:AbstractDataAccessorFactory
Create the accessor for giveAttributeFamilyDescriptor
.- Specified by:
createAccessor
in interfaceAbstractDataAccessorFactory<BeamDataOperator,DataAccessor>
- Parameters:
operator
- operator to create the accessor forfamilyDescriptor
- attribute family descriptor- Returns:
AbstractDataAccessor
for given operator and family
-
-