Search in sources :

Example 21 with JobClient

use of org.apache.flink.core.execution.JobClient in project flink by apache.

the class SinkMetricsITCase method testMetrics.

@Test
public void testMetrics() throws Exception {
    StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
    int numSplits = Math.max(1, env.getParallelism() - 2);
    int numRecordsPerSplit = 10;
    // make sure all parallel instances have processed the same amount of records before
    // validating metrics
    SharedReference<CyclicBarrier> beforeBarrier = sharedObjects.add(new CyclicBarrier(numSplits + 1));
    SharedReference<CyclicBarrier> afterBarrier = sharedObjects.add(new CyclicBarrier(numSplits + 1));
    int stopAtRecord1 = 4;
    int stopAtRecord2 = numRecordsPerSplit - 1;
    env.fromSequence(0, numSplits - 1).<Long>flatMap((split, collector) -> LongStream.range(0, numRecordsPerSplit).forEach(collector::collect)).returns(BasicTypeInfo.LONG_TYPE_INFO).map(i -> {
        if (i % numRecordsPerSplit == stopAtRecord1 || i % numRecordsPerSplit == stopAtRecord2) {
            beforeBarrier.get().await();
            afterBarrier.get().await();
        }
        return i;
    }).sinkTo(TestSink.newBuilder().setWriter(new MetricWriter()).build()).name("MetricTestSink");
    JobClient jobClient = env.executeAsync();
    final JobID jobId = jobClient.getJobID();
    beforeBarrier.get().await();
    assertSinkMetrics(jobId, stopAtRecord1, env.getParallelism(), numSplits);
    afterBarrier.get().await();
    beforeBarrier.get().await();
    assertSinkMetrics(jobId, stopAtRecord2, env.getParallelism(), numSplits);
    afterBarrier.get().await();
    jobClient.getJobExecutionResult().get();
}
Also used : StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) JobClient(org.apache.flink.core.execution.JobClient) JobID(org.apache.flink.api.common.JobID) CyclicBarrier(java.util.concurrent.CyclicBarrier) Test(org.junit.Test)

Example 22 with JobClient

use of org.apache.flink.core.execution.JobClient in project flink by apache.

the class DataStream method executeAndCollectWithClient.

ClientAndIterator<T> executeAndCollectWithClient(String jobExecutionName) throws Exception {
    TypeSerializer<T> serializer = getType().createSerializer(getExecutionEnvironment().getConfig());
    String accumulatorName = "dataStreamCollect_" + UUID.randomUUID().toString();
    StreamExecutionEnvironment env = getExecutionEnvironment();
    CollectSinkOperatorFactory<T> factory = new CollectSinkOperatorFactory<>(serializer, accumulatorName);
    CollectSinkOperator<T> operator = (CollectSinkOperator<T>) factory.getOperator();
    CollectResultIterator<T> iterator = new CollectResultIterator<>(operator.getOperatorIdFuture(), serializer, accumulatorName, env.getCheckpointConfig());
    CollectStreamSink<T> sink = new CollectStreamSink<>(this, factory);
    sink.name("Data stream collect sink");
    env.addOperator(sink.getTransformation());
    final JobClient jobClient = env.executeAsync(jobExecutionName);
    iterator.setJobClient(jobClient);
    return new ClientAndIterator<>(jobClient, iterator);
}
Also used : ClientAndIterator(org.apache.flink.streaming.api.operators.collect.ClientAndIterator) CollectResultIterator(org.apache.flink.streaming.api.operators.collect.CollectResultIterator) CollectStreamSink(org.apache.flink.streaming.api.operators.collect.CollectStreamSink) JobClient(org.apache.flink.core.execution.JobClient) CollectSinkOperator(org.apache.flink.streaming.api.operators.collect.CollectSinkOperator) CollectSinkOperatorFactory(org.apache.flink.streaming.api.operators.collect.CollectSinkOperatorFactory) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment)

Example 23 with JobClient

use of org.apache.flink.core.execution.JobClient in project flink by apache.

the class SourceTestSuiteBase method restartFromSavepoint.

private void restartFromSavepoint(TestEnvironment testEnv, DataStreamSourceExternalContext<T> externalContext, CheckpointingMode semantic, final int splitNumber, final int beforeParallelism, final int afterParallelism) throws Exception {
    // Step 1: Preparation
    TestingSourceSettings sourceSettings = TestingSourceSettings.builder().setBoundedness(Boundedness.CONTINUOUS_UNBOUNDED).setCheckpointingMode(semantic).build();
    TestEnvironmentSettings envOptions = TestEnvironmentSettings.builder().setConnectorJarPaths(externalContext.getConnectorJarPaths()).build();
    // Step 2: Generate test data
    final List<ExternalSystemSplitDataWriter<T>> writers = new ArrayList<>();
    final List<List<T>> testRecordCollections = new ArrayList<>();
    for (int i = 0; i < splitNumber; i++) {
        writers.add(externalContext.createSourceSplitDataWriter(sourceSettings));
        testRecordCollections.add(generateTestDataForWriter(externalContext, sourceSettings, i, writers.get(i)));
    }
    // Step 3: Build and execute Flink job
    final StreamExecutionEnvironment execEnv = testEnv.createExecutionEnvironment(envOptions);
    execEnv.getCheckpointConfig().setCheckpointingMode(CheckpointingMode.EXACTLY_ONCE);
    execEnv.enableCheckpointing(50);
    execEnv.setRestartStrategy(RestartStrategies.noRestart());
    DataStreamSource<T> source = execEnv.fromSource(tryCreateSource(externalContext, sourceSettings), WatermarkStrategy.noWatermarks(), "Tested Source").setParallelism(beforeParallelism);
    CollectIteratorBuilder<T> iteratorBuilder = addCollectSink(source);
    final JobClient jobClient = execEnv.executeAsync("Restart Test");
    // Step 4: Check the result and stop Flink job with a savepoint
    CollectResultIterator<T> iterator = null;
    try {
        iterator = iteratorBuilder.build(jobClient);
        checkResultWithSemantic(iterator, testRecordCollections, semantic, getTestDataSize(testRecordCollections));
    } catch (Exception e) {
        killJob(jobClient);
        throw e;
    }
    String savepointPath = jobClient.stopWithSavepoint(true, testEnv.getCheckpointUri(), SavepointFormatType.CANONICAL).get(30, TimeUnit.SECONDS);
    waitForJobStatus(jobClient, Collections.singletonList(JobStatus.FINISHED), Deadline.fromNow(DEFAULT_JOB_STATUS_CHANGE_TIMEOUT));
    // Step 5: Generate new test data
    final List<List<T>> newTestRecordCollections = new ArrayList<>();
    for (int i = 0; i < splitNumber; i++) {
        newTestRecordCollections.add(generateTestDataForWriter(externalContext, sourceSettings, i, writers.get(i)));
    }
    // Step 6: restart the Flink job with the savepoint
    TestEnvironmentSettings restartEnvOptions = TestEnvironmentSettings.builder().setConnectorJarPaths(externalContext.getConnectorJarPaths()).setSavepointRestorePath(savepointPath).build();
    final StreamExecutionEnvironment restartEnv = testEnv.createExecutionEnvironment(restartEnvOptions);
    restartEnv.enableCheckpointing(500);
    restartEnv.getCheckpointConfig().setCheckpointingMode(CheckpointingMode.EXACTLY_ONCE);
    DataStreamSource<T> restartSource = restartEnv.fromSource(tryCreateSource(externalContext, sourceSettings), WatermarkStrategy.noWatermarks(), "Tested Source").setParallelism(afterParallelism);
    addCollectSink(restartSource);
    final JobClient restartJobClient = restartEnv.executeAsync("Restart Test");
    waitForJobStatus(restartJobClient, Collections.singletonList(JobStatus.RUNNING), Deadline.fromNow(DEFAULT_JOB_STATUS_CHANGE_TIMEOUT));
    try {
        iterator.setJobClient(restartJobClient);
        /*
             * Use the same iterator as the previous run, because the CollectStreamSink will snapshot
             * its state and recover from it.
             *
             * The fetcher in CollectResultIterator is responsible for comminicating with
             * the CollectSinkFunction, and deal the result with CheckpointedCollectResultBuffer
             * in EXACTLY_ONCE semantic.
             */
        checkResultWithSemantic(iterator, newTestRecordCollections, semantic, getTestDataSize(newTestRecordCollections));
    } finally {
        // Clean up
        killJob(restartJobClient);
        iterator.close();
    }
}
Also used : ArrayList(java.util.ArrayList) TestEnvironmentSettings(org.apache.flink.connector.testframe.environment.TestEnvironmentSettings) JobClient(org.apache.flink.core.execution.JobClient) TestAbortedException(org.opentest4j.TestAbortedException) ExternalSystemSplitDataWriter(org.apache.flink.connector.testframe.external.ExternalSystemSplitDataWriter) DEFAULT_COLLECT_DATA_TIMEOUT(org.apache.flink.connector.testframe.utils.ConnectorTestConstants.DEFAULT_COLLECT_DATA_TIMEOUT) DEFAULT_JOB_STATUS_CHANGE_TIMEOUT(org.apache.flink.connector.testframe.utils.ConnectorTestConstants.DEFAULT_JOB_STATUS_CHANGE_TIMEOUT) List(java.util.List) ArrayList(java.util.ArrayList) StreamExecutionEnvironment(org.apache.flink.streaming.api.environment.StreamExecutionEnvironment) TestingSourceSettings(org.apache.flink.connector.testframe.external.source.TestingSourceSettings)

Example 24 with JobClient

use of org.apache.flink.core.execution.JobClient in project flink by apache.

the class StreamExecutionEnvironment method execute.

/**
 * Triggers the program execution. The environment will execute all parts of the program that
 * have resulted in a "sink" operation. Sink operations are for example printing results or
 * forwarding them to a message queue.
 *
 * @param streamGraph the stream graph representing the transformations
 * @return The result of the job execution, containing elapsed time and accumulators.
 * @throws Exception which occurs during job execution.
 */
@Internal
public JobExecutionResult execute(StreamGraph streamGraph) throws Exception {
    final JobClient jobClient = executeAsync(streamGraph);
    try {
        final JobExecutionResult jobExecutionResult;
        if (configuration.getBoolean(DeploymentOptions.ATTACHED)) {
            jobExecutionResult = jobClient.getJobExecutionResult().get();
        } else {
            jobExecutionResult = new DetachedJobExecutionResult(jobClient.getJobID());
        }
        jobListeners.forEach(jobListener -> jobListener.onJobExecuted(jobExecutionResult, null));
        return jobExecutionResult;
    } catch (Throwable t) {
        // get() on the JobExecutionResult Future will throw an ExecutionException. This
        // behaviour was largely not there in Flink versions before the PipelineExecutor
        // refactoring so we should strip that exception.
        Throwable strippedException = ExceptionUtils.stripExecutionException(t);
        jobListeners.forEach(jobListener -> {
            jobListener.onJobExecuted(null, strippedException);
        });
        ExceptionUtils.rethrowException(strippedException);
        // never reached, only make javac happy
        return null;
    }
}
Also used : Arrays(java.util.Arrays) SocketTextStreamFunction(org.apache.flink.streaming.api.functions.source.SocketTextStreamFunction) Tuple3(org.apache.flink.api.java.tuple.Tuple3) Tuple2(org.apache.flink.api.java.tuple.Tuple2) FromIteratorFunction(org.apache.flink.streaming.api.functions.source.FromIteratorFunction) StreamGraphGenerator(org.apache.flink.streaming.api.graph.StreamGraphGenerator) MemorySize(org.apache.flink.configuration.MemorySize) StateBackend(org.apache.flink.runtime.state.StateBackend) WrappingRuntimeException(org.apache.flink.util.WrappingRuntimeException) SplittableIterator(org.apache.flink.util.SplittableIterator) InvalidProgramException(org.apache.flink.api.common.InvalidProgramException) StateBackendLoader(org.apache.flink.runtime.state.StateBackendLoader) Path(org.apache.flink.core.fs.Path) ResourceSpec(org.apache.flink.api.common.operators.ResourceSpec) Map(java.util.Map) StatefulSequenceSource(org.apache.flink.streaming.api.functions.source.StatefulSequenceSource) StreamGraph(org.apache.flink.streaming.api.graph.StreamGraph) FileMonitoringFunction(org.apache.flink.streaming.api.functions.source.FileMonitoringFunction) DefaultExecutorServiceLoader(org.apache.flink.core.execution.DefaultExecutorServiceLoader) ContinuousFileMonitoringFunction(org.apache.flink.streaming.api.functions.source.ContinuousFileMonitoringFunction) PipelineExecutorFactory(org.apache.flink.core.execution.PipelineExecutorFactory) FromElementsFunction(org.apache.flink.streaming.api.functions.source.FromElementsFunction) TernaryBoolean(org.apache.flink.util.TernaryBoolean) Serializable(java.io.Serializable) TypeExtractor(org.apache.flink.api.java.typeutils.TypeExtractor) ResultTypeQueryable(org.apache.flink.api.java.typeutils.ResultTypeQueryable) Source(org.apache.flink.api.connector.source.Source) Time(org.apache.flink.api.common.time.Time) Boundedness(org.apache.flink.api.connector.source.Boundedness) FlinkException(org.apache.flink.util.FlinkException) NumberSequenceSource(org.apache.flink.api.connector.source.lib.NumberSequenceSource) PipelineExecutorServiceLoader(org.apache.flink.core.execution.PipelineExecutorServiceLoader) SlotSharingGroupUtils(org.apache.flink.api.common.operators.util.SlotSharingGroupUtils) UnmodifiableConfiguration(org.apache.flink.configuration.UnmodifiableConfiguration) ArrayList(java.util.ArrayList) SourceFunction(org.apache.flink.streaming.api.functions.source.SourceFunction) ReadableConfig(org.apache.flink.configuration.ReadableConfig) JobListener(org.apache.flink.core.execution.JobListener) InvalidTypesException(org.apache.flink.api.common.functions.InvalidTypesException) RestOptions(org.apache.flink.configuration.RestOptions) ConfigOption(org.apache.flink.configuration.ConfigOption) Nullable(javax.annotation.Nullable) DetachedJobExecutionResult(org.apache.flink.core.execution.DetachedJobExecutionResult) TimeCharacteristic(org.apache.flink.streaming.api.TimeCharacteristic) Serializer(com.esotericsoftware.kryo.Serializer) SingleOutputStreamOperator(org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator) MissingTypeInfo(org.apache.flink.api.java.typeutils.MissingTypeInfo) IOException(java.io.IOException) JobClient(org.apache.flink.core.execution.JobClient) DynamicCodeLoadingException(org.apache.flink.util.DynamicCodeLoadingException) ExecutionException(java.util.concurrent.ExecutionException) TextInputFormat(org.apache.flink.api.java.io.TextInputFormat) CoreOptions(org.apache.flink.configuration.CoreOptions) Transformation(org.apache.flink.api.dag.Transformation) PojoTypeInfo(org.apache.flink.api.java.typeutils.PojoTypeInfo) FileProcessingMode(org.apache.flink.streaming.api.functions.source.FileProcessingMode) PipelineOptions(org.apache.flink.configuration.PipelineOptions) CheckpointingMode(org.apache.flink.streaming.api.CheckpointingMode) ExceptionUtils(org.apache.flink.util.ExceptionUtils) SlotSharingGroup(org.apache.flink.api.common.operators.SlotSharingGroup) FileInputFormat(org.apache.flink.api.common.io.FileInputFormat) BasicTypeInfo(org.apache.flink.api.common.typeinfo.BasicTypeInfo) InstantiationUtil(org.apache.flink.util.InstantiationUtil) InputFormat(org.apache.flink.api.common.io.InputFormat) Public(org.apache.flink.annotation.Public) URI(java.net.URI) Preconditions.checkNotNull(org.apache.flink.util.Preconditions.checkNotNull) TypeInformation(org.apache.flink.api.common.typeinfo.TypeInformation) ExecutionOptions(org.apache.flink.configuration.ExecutionOptions) TimestampedFileInputSplit(org.apache.flink.streaming.api.functions.source.TimestampedFileInputSplit) Collection(java.util.Collection) WatermarkStrategy(org.apache.flink.api.common.eventtime.WatermarkStrategy) DistributedCache(org.apache.flink.api.common.cache.DistributedCache) Preconditions(org.apache.flink.util.Preconditions) StringUtils(org.apache.flink.util.StringUtils) ResourceProfile(org.apache.flink.runtime.clusterframework.types.ResourceProfile) JobExecutionResult(org.apache.flink.api.common.JobExecutionResult) List(java.util.List) ExecutionConfig(org.apache.flink.api.common.ExecutionConfig) Experimental(org.apache.flink.annotation.Experimental) Optional(java.util.Optional) ParallelSourceFunction(org.apache.flink.streaming.api.functions.source.ParallelSourceFunction) Utils(org.apache.flink.api.java.Utils) FileReadFunction(org.apache.flink.streaming.api.functions.source.FileReadFunction) KeyGroupRangeAssignment(org.apache.flink.runtime.state.KeyGroupRangeAssignment) FilePathFilter(org.apache.flink.api.common.io.FilePathFilter) PublicEvolving(org.apache.flink.annotation.PublicEvolving) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) RestartStrategies(org.apache.flink.api.common.restartstrategy.RestartStrategies) DataStreamSource(org.apache.flink.streaming.api.datastream.DataStreamSource) PipelineExecutor(org.apache.flink.core.execution.PipelineExecutor) DeploymentOptions(org.apache.flink.configuration.DeploymentOptions) ContinuousFileReaderOperatorFactory(org.apache.flink.streaming.api.functions.source.ContinuousFileReaderOperatorFactory) Iterator(java.util.Iterator) StateChangelogOptions(org.apache.flink.configuration.StateChangelogOptions) Configuration(org.apache.flink.configuration.Configuration) InputFormatSourceFunction(org.apache.flink.streaming.api.functions.source.InputFormatSourceFunction) DataStream(org.apache.flink.streaming.api.datastream.DataStream) Internal(org.apache.flink.annotation.Internal) FromSplittableIteratorFunction(org.apache.flink.streaming.api.functions.source.FromSplittableIteratorFunction) ClosureCleaner(org.apache.flink.api.java.ClosureCleaner) RuntimeExecutionMode(org.apache.flink.api.common.RuntimeExecutionMode) StreamSource(org.apache.flink.streaming.api.operators.StreamSource) DetachedJobExecutionResult(org.apache.flink.core.execution.DetachedJobExecutionResult) JobExecutionResult(org.apache.flink.api.common.JobExecutionResult) JobClient(org.apache.flink.core.execution.JobClient) DetachedJobExecutionResult(org.apache.flink.core.execution.DetachedJobExecutionResult) Internal(org.apache.flink.annotation.Internal)

Example 25 with JobClient

use of org.apache.flink.core.execution.JobClient in project flink by apache.

the class StreamExecutionEnvironment method executeAsync.

/**
 * Triggers the program execution asynchronously. The environment will execute all parts of the
 * program that have resulted in a "sink" operation. Sink operations are for example printing
 * results or forwarding them to a message queue.
 *
 * @param streamGraph the stream graph representing the transformations
 * @return A {@link JobClient} that can be used to communicate with the submitted job, completed
 *     on submission succeeded.
 * @throws Exception which occurs during job execution.
 */
@Internal
public JobClient executeAsync(StreamGraph streamGraph) throws Exception {
    checkNotNull(streamGraph, "StreamGraph cannot be null.");
    checkNotNull(configuration.get(DeploymentOptions.TARGET), "No execution.target specified in your configuration file.");
    final PipelineExecutorFactory executorFactory = executorServiceLoader.getExecutorFactory(configuration);
    checkNotNull(executorFactory, "Cannot find compatible factory for specified execution.target (=%s)", configuration.get(DeploymentOptions.TARGET));
    CompletableFuture<JobClient> jobClientFuture = executorFactory.getExecutor(configuration).execute(streamGraph, configuration, userClassloader);
    try {
        JobClient jobClient = jobClientFuture.get();
        jobListeners.forEach(jobListener -> jobListener.onJobSubmitted(jobClient, null));
        return jobClient;
    } catch (ExecutionException executionException) {
        final Throwable strippedException = ExceptionUtils.stripExecutionException(executionException);
        jobListeners.forEach(jobListener -> jobListener.onJobSubmitted(null, strippedException));
        throw new FlinkException(String.format("Failed to execute job '%s'.", streamGraph.getJobName()), strippedException);
    }
}
Also used : Arrays(java.util.Arrays) SocketTextStreamFunction(org.apache.flink.streaming.api.functions.source.SocketTextStreamFunction) Tuple3(org.apache.flink.api.java.tuple.Tuple3) Tuple2(org.apache.flink.api.java.tuple.Tuple2) FromIteratorFunction(org.apache.flink.streaming.api.functions.source.FromIteratorFunction) StreamGraphGenerator(org.apache.flink.streaming.api.graph.StreamGraphGenerator) MemorySize(org.apache.flink.configuration.MemorySize) StateBackend(org.apache.flink.runtime.state.StateBackend) WrappingRuntimeException(org.apache.flink.util.WrappingRuntimeException) SplittableIterator(org.apache.flink.util.SplittableIterator) InvalidProgramException(org.apache.flink.api.common.InvalidProgramException) StateBackendLoader(org.apache.flink.runtime.state.StateBackendLoader) Path(org.apache.flink.core.fs.Path) ResourceSpec(org.apache.flink.api.common.operators.ResourceSpec) Map(java.util.Map) StatefulSequenceSource(org.apache.flink.streaming.api.functions.source.StatefulSequenceSource) StreamGraph(org.apache.flink.streaming.api.graph.StreamGraph) FileMonitoringFunction(org.apache.flink.streaming.api.functions.source.FileMonitoringFunction) DefaultExecutorServiceLoader(org.apache.flink.core.execution.DefaultExecutorServiceLoader) ContinuousFileMonitoringFunction(org.apache.flink.streaming.api.functions.source.ContinuousFileMonitoringFunction) PipelineExecutorFactory(org.apache.flink.core.execution.PipelineExecutorFactory) FromElementsFunction(org.apache.flink.streaming.api.functions.source.FromElementsFunction) TernaryBoolean(org.apache.flink.util.TernaryBoolean) Serializable(java.io.Serializable) TypeExtractor(org.apache.flink.api.java.typeutils.TypeExtractor) ResultTypeQueryable(org.apache.flink.api.java.typeutils.ResultTypeQueryable) Source(org.apache.flink.api.connector.source.Source) Time(org.apache.flink.api.common.time.Time) Boundedness(org.apache.flink.api.connector.source.Boundedness) FlinkException(org.apache.flink.util.FlinkException) NumberSequenceSource(org.apache.flink.api.connector.source.lib.NumberSequenceSource) PipelineExecutorServiceLoader(org.apache.flink.core.execution.PipelineExecutorServiceLoader) SlotSharingGroupUtils(org.apache.flink.api.common.operators.util.SlotSharingGroupUtils) UnmodifiableConfiguration(org.apache.flink.configuration.UnmodifiableConfiguration) ArrayList(java.util.ArrayList) SourceFunction(org.apache.flink.streaming.api.functions.source.SourceFunction) ReadableConfig(org.apache.flink.configuration.ReadableConfig) JobListener(org.apache.flink.core.execution.JobListener) InvalidTypesException(org.apache.flink.api.common.functions.InvalidTypesException) RestOptions(org.apache.flink.configuration.RestOptions) ConfigOption(org.apache.flink.configuration.ConfigOption) Nullable(javax.annotation.Nullable) DetachedJobExecutionResult(org.apache.flink.core.execution.DetachedJobExecutionResult) TimeCharacteristic(org.apache.flink.streaming.api.TimeCharacteristic) Serializer(com.esotericsoftware.kryo.Serializer) SingleOutputStreamOperator(org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator) MissingTypeInfo(org.apache.flink.api.java.typeutils.MissingTypeInfo) IOException(java.io.IOException) JobClient(org.apache.flink.core.execution.JobClient) DynamicCodeLoadingException(org.apache.flink.util.DynamicCodeLoadingException) ExecutionException(java.util.concurrent.ExecutionException) TextInputFormat(org.apache.flink.api.java.io.TextInputFormat) CoreOptions(org.apache.flink.configuration.CoreOptions) Transformation(org.apache.flink.api.dag.Transformation) PojoTypeInfo(org.apache.flink.api.java.typeutils.PojoTypeInfo) FileProcessingMode(org.apache.flink.streaming.api.functions.source.FileProcessingMode) PipelineOptions(org.apache.flink.configuration.PipelineOptions) CheckpointingMode(org.apache.flink.streaming.api.CheckpointingMode) ExceptionUtils(org.apache.flink.util.ExceptionUtils) SlotSharingGroup(org.apache.flink.api.common.operators.SlotSharingGroup) FileInputFormat(org.apache.flink.api.common.io.FileInputFormat) BasicTypeInfo(org.apache.flink.api.common.typeinfo.BasicTypeInfo) InstantiationUtil(org.apache.flink.util.InstantiationUtil) InputFormat(org.apache.flink.api.common.io.InputFormat) Public(org.apache.flink.annotation.Public) URI(java.net.URI) Preconditions.checkNotNull(org.apache.flink.util.Preconditions.checkNotNull) TypeInformation(org.apache.flink.api.common.typeinfo.TypeInformation) ExecutionOptions(org.apache.flink.configuration.ExecutionOptions) TimestampedFileInputSplit(org.apache.flink.streaming.api.functions.source.TimestampedFileInputSplit) Collection(java.util.Collection) WatermarkStrategy(org.apache.flink.api.common.eventtime.WatermarkStrategy) DistributedCache(org.apache.flink.api.common.cache.DistributedCache) Preconditions(org.apache.flink.util.Preconditions) StringUtils(org.apache.flink.util.StringUtils) ResourceProfile(org.apache.flink.runtime.clusterframework.types.ResourceProfile) JobExecutionResult(org.apache.flink.api.common.JobExecutionResult) List(java.util.List) ExecutionConfig(org.apache.flink.api.common.ExecutionConfig) Experimental(org.apache.flink.annotation.Experimental) Optional(java.util.Optional) ParallelSourceFunction(org.apache.flink.streaming.api.functions.source.ParallelSourceFunction) Utils(org.apache.flink.api.java.Utils) FileReadFunction(org.apache.flink.streaming.api.functions.source.FileReadFunction) KeyGroupRangeAssignment(org.apache.flink.runtime.state.KeyGroupRangeAssignment) FilePathFilter(org.apache.flink.api.common.io.FilePathFilter) PublicEvolving(org.apache.flink.annotation.PublicEvolving) HashMap(java.util.HashMap) CompletableFuture(java.util.concurrent.CompletableFuture) RestartStrategies(org.apache.flink.api.common.restartstrategy.RestartStrategies) DataStreamSource(org.apache.flink.streaming.api.datastream.DataStreamSource) PipelineExecutor(org.apache.flink.core.execution.PipelineExecutor) DeploymentOptions(org.apache.flink.configuration.DeploymentOptions) ContinuousFileReaderOperatorFactory(org.apache.flink.streaming.api.functions.source.ContinuousFileReaderOperatorFactory) Iterator(java.util.Iterator) StateChangelogOptions(org.apache.flink.configuration.StateChangelogOptions) Configuration(org.apache.flink.configuration.Configuration) InputFormatSourceFunction(org.apache.flink.streaming.api.functions.source.InputFormatSourceFunction) DataStream(org.apache.flink.streaming.api.datastream.DataStream) Internal(org.apache.flink.annotation.Internal) FromSplittableIteratorFunction(org.apache.flink.streaming.api.functions.source.FromSplittableIteratorFunction) ClosureCleaner(org.apache.flink.api.java.ClosureCleaner) RuntimeExecutionMode(org.apache.flink.api.common.RuntimeExecutionMode) StreamSource(org.apache.flink.streaming.api.operators.StreamSource) PipelineExecutorFactory(org.apache.flink.core.execution.PipelineExecutorFactory) ExecutionException(java.util.concurrent.ExecutionException) JobClient(org.apache.flink.core.execution.JobClient) FlinkException(org.apache.flink.util.FlinkException) Internal(org.apache.flink.annotation.Internal)

Aggregations

JobClient (org.apache.flink.core.execution.JobClient)70 StreamExecutionEnvironment (org.apache.flink.streaming.api.environment.StreamExecutionEnvironment)36 Test (org.junit.Test)32 JobExecutionResult (org.apache.flink.api.common.JobExecutionResult)16 Configuration (org.apache.flink.configuration.Configuration)16 JobListener (org.apache.flink.core.execution.JobListener)14 ArrayList (java.util.ArrayList)12 List (java.util.List)10 JobID (org.apache.flink.api.common.JobID)10 ExecutionException (java.util.concurrent.ExecutionException)9 AtomicReference (java.util.concurrent.atomic.AtomicReference)8 DEFAULT_COLLECT_DATA_TIMEOUT (org.apache.flink.connector.testframe.utils.ConnectorTestConstants.DEFAULT_COLLECT_DATA_TIMEOUT)8 DEFAULT_JOB_STATUS_CHANGE_TIMEOUT (org.apache.flink.connector.testframe.utils.ConnectorTestConstants.DEFAULT_JOB_STATUS_CHANGE_TIMEOUT)8 IOException (java.io.IOException)7 DisplayName (org.junit.jupiter.api.DisplayName)7 TestTemplate (org.junit.jupiter.api.TestTemplate)7 Iterator (java.util.Iterator)6 CompletableFuture (java.util.concurrent.CompletableFuture)6 ExecutionEnvironment (org.apache.flink.api.java.ExecutionEnvironment)6 Preconditions.checkNotNull (org.apache.flink.util.Preconditions.checkNotNull)6