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 byTestStreamand 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.Acceptaccepts(java.net.URI uri)Check if this factory can create accessors for given URI.DataAccessorcreateAccessor(BeamDataOperator operator, AttributeFamilyDescriptor familyDescriptor)Create the accessor for giveAttributeFamilyDescriptor.static voidputStream(Repository repo, AttributeFamilyDescriptor family, org.apache.beam.sdk.testing.TestStream<StreamElement> stream)Put givenTestStreamfor givenAttributeFamilyDescriptor.static cz.o2.proxima.typesafe.config.ConfigreplaceStorages(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.ConfigreplaceStorages(cz.o2.proxima.typesafe.config.Config config, UnaryPredicate<java.lang.String> familyFilter)Replace all storages in all attribute families in given config withtest-stream.voidsetup(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 givenTestStreamfor givenAttributeFamilyDescriptor.- Parameters:
repo- repositoryfamily- attribute family descriptorstream- the stream to use as data source
-
setup
public void setup(Repository repo)
Description copied from interface:AbstractDataAccessorFactorySetup the factory for using givenRepository.- Specified by:
setupin 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:AbstractDataAccessorFactoryCheck if this factory can create accessors for given URI.- Specified by:
acceptsin 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:AbstractDataAccessorFactoryCreate the accessor for giveAttributeFamilyDescriptor.- Specified by:
createAccessorin interfaceAbstractDataAccessorFactory<BeamDataOperator,DataAccessor>- Parameters:
operator- operator to create the accessor forfamilyDescriptor- attribute family descriptor- Returns:
AbstractDataAccessorfor given operator and family
-
-