Package org.apache.beam.runners.spark
Interface SparkContextOptions
- All Superinterfaces:
ApplicationNameOptions,FileStagingOptions,HasDisplayData,PipelineOptions,SparkCommonPipelineOptions,SparkPipelineOptions,StreamingOptions
A custom
PipelineOptions to work with properties related to JavaSparkContext.
This can only be used programmatically (as opposed to passing command line arguments), since the properties here are context-aware and should not be propagated to workers.
Separating this from SparkPipelineOptions is needed so the context-aware properties,
which link to Spark dependencies, won't be scanned by PipelineOptions reflective
instantiation. Note that SparkContextOptions is not registered with SparkRunnerRegistrar.
Note: It's recommended to use SparkContextFactory.setProvidedSparkContext(JavaSparkContext)
instead of setProvidedSparkContext(JavaSparkContext) for testing.
When using @TestPipeline any provided JavaSparkContext via SparkContextOptions is dropped.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic classReturns an empty list, to avoid handling null.Nested classes/interfaces inherited from interface org.apache.beam.sdk.options.PipelineOptions
PipelineOptions.AtomicLongFactory, PipelineOptions.CheckEnabled, PipelineOptions.DirectRunner, PipelineOptions.JobNameFactory, PipelineOptions.UserAgentFactoryNested classes/interfaces inherited from interface org.apache.beam.runners.spark.SparkCommonPipelineOptions
SparkCommonPipelineOptions.StorageLevelFactory, SparkCommonPipelineOptions.TmpCheckpointDirFactory -
Field Summary
Fields inherited from interface org.apache.beam.runners.spark.SparkCommonPipelineOptions
DEFAULT_MASTER_URL -
Method Summary
Modifier and TypeMethodDescriptionList<org.apache.spark.streaming.api.java.JavaStreamingListener> org.apache.spark.api.java.JavaSparkContextvoidsetListeners(List<org.apache.spark.streaming.api.java.JavaStreamingListener> listeners) voidsetProvidedSparkContext(org.apache.spark.api.java.JavaSparkContext jsc) Methods inherited from interface org.apache.beam.sdk.options.ApplicationNameOptions
getAppName, setAppNameMethods inherited from interface org.apache.beam.sdk.options.FileStagingOptions
getFilesToStage, setFilesToStageMethods inherited from interface org.apache.beam.sdk.transforms.display.HasDisplayData
populateDisplayDataMethods inherited from interface org.apache.beam.sdk.options.PipelineOptions
as, getGbek, getJobName, getOptionsId, getRunner, getStableUniqueNames, getTempLocation, getUserAgent, outputRuntimeOptions, revision, setGbek, setJobName, setOptionsId, setRunner, setStableUniqueNames, setTempLocation, setUserAgentMethods inherited from interface org.apache.beam.runners.spark.SparkCommonPipelineOptions
getCheckpointDir, getEnableSparkMetricSinks, getPreferGroupByKeyToHandleHugeValues, getSparkMaster, getStorageLevel, setCheckpointDir, setEnableSparkMetricSinks, setPreferGroupByKeyToHandleHugeValues, setSparkMaster, setStorageLevelMethods inherited from interface org.apache.beam.runners.spark.SparkPipelineOptions
getBatchIntervalMillis, getBundleSize, getCheckpointDurationMillis, getMaxRecordsPerBatch, getMinReadTimeMillis, getReadTimePercentage, getUsesProvidedSparkContext, isCacheDisabled, setBatchIntervalMillis, setBundleSize, setCacheDisabled, setCheckpointDurationMillis, setMaxRecordsPerBatch, setMinReadTimeMillis, setReadTimePercentage, setUsesProvidedSparkContextMethods inherited from interface org.apache.beam.sdk.options.StreamingOptions
getUpdateCompatibilityVersion, isStreaming, setStreaming, setUpdateCompatibilityVersion
-
Method Details
-
getProvidedSparkContext
org.apache.spark.api.java.JavaSparkContext getProvidedSparkContext() -
setProvidedSparkContext
void setProvidedSparkContext(org.apache.spark.api.java.JavaSparkContext jsc) -
getListeners
@InstanceFactory(EmptyListenersList.class) List<org.apache.spark.streaming.api.java.JavaStreamingListener> getListeners() -
setListeners
-