Class ReadSpannerSchema
java.lang.Object
org.apache.beam.sdk.transforms.DoFn<Void,SpannerSchema>
org.apache.beam.sdk.io.gcp.spanner.ReadSpannerSchema
- All Implemented Interfaces:
Serializable
,HasDisplayData
This
DoFn
reads Cloud Spanner 'information_schema.*' tables to build the SpannerSchema
.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.beam.sdk.transforms.DoFn
DoFn.AlwaysFetched, DoFn.BoundedPerElement, DoFn.BundleFinalizer, DoFn.Element, DoFn.FieldAccess, DoFn.FinishBundle, DoFn.FinishBundleContext, DoFn.GetInitialRestriction, DoFn.GetInitialWatermarkEstimatorState, DoFn.GetRestrictionCoder, DoFn.GetSize, DoFn.GetWatermarkEstimatorStateCoder, DoFn.Key, DoFn.MultiOutputReceiver, DoFn.NewTracker, DoFn.NewWatermarkEstimator, DoFn.OnTimer, DoFn.OnTimerContext, DoFn.OnTimerFamily, DoFn.OnWindowExpiration, DoFn.OnWindowExpirationContext, DoFn.OutputReceiver<T>, DoFn.ProcessContext, DoFn.ProcessContinuation, DoFn.ProcessElement, DoFn.RequiresStableInput, DoFn.RequiresTimeSortedInput, DoFn.Restriction, DoFn.Setup, DoFn.SideInput, DoFn.SplitRestriction, DoFn.StartBundle, DoFn.StartBundleContext, DoFn.StateId, DoFn.Teardown, DoFn.TimerFamily, DoFn.TimerId, DoFn.Timestamp, DoFn.TruncateRestriction, DoFn.UnboundedPerElement, DoFn.WatermarkEstimatorState, DoFn.WindowedContext
-
Constructor Summary
ConstructorsConstructorDescriptionReadSpannerSchema
(SpannerConfig config, PCollectionView<Dialect> dialectView) Constructor for creating an instance of the ReadSpannerSchema class.ReadSpannerSchema
(SpannerConfig config, PCollectionView<Dialect> dialectView, Set<String> allowedTableNames) Constructor for creating an instance of the ReadSpannerSchema class. -
Method Summary
Methods inherited from class org.apache.beam.sdk.transforms.DoFn
getAllowedTimestampSkew, getInputTypeDescriptor, getOutputTypeDescriptor, populateDisplayData, prepareForProcessing
-
Constructor Details
-
ReadSpannerSchema
Constructor for creating an instance of the ReadSpannerSchema class. If no is passed, every single table is allowed.- Parameters:
config
- The SpannerConfig object that contains the configuration for accessing the Spanner database.dialectView
- A PCollectionView object that holds a Dialect object for the database dialect to use for reading the Spanner schema.
-
ReadSpannerSchema
public ReadSpannerSchema(SpannerConfig config, PCollectionView<Dialect> dialectView, Set<String> allowedTableNames) Constructor for creating an instance of the ReadSpannerSchema class.- Parameters:
config
- The SpannerConfig object that contains the configuration for accessing the Spanner database.dialectView
- A PCollectionView object that holds a Dialect object for the database dialect to use for reading the Spanner schema.allowedTableNames
- A set of allowed table names to be used when reading the Spanner schema.
-
-
Method Details
-
setup
- Throws:
Exception
-
teardown
- Throws:
Exception
-
processElement
@ProcessElement public void processElement(DoFn<Void, SpannerSchema>.ProcessContext c) throws Exception- Throws:
Exception
-