You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/12/13 05:32:40 UTC
[GitHub] [flink] Samrat002 opened a new pull request, #21497: [FLINK-30377][table-planner] applySinkProvider use ClientWrapperClassLoader while extracting Type from KeyedStream
Samrat002 opened a new pull request, #21497:
URL: https://github.com/apache/flink/pull/21497
## What is the purpose of the change
*(For example: This pull request makes task deployment go through the blob server, rather than through RPC. That way we avoid re-transferring them on each deployment (during recovery).)*
## Brief change log
*(for example:)*
- *The TaskInfo is stored in the blob store on job creation time as a persistent artifact*
- *Deployments RPC transmits only the blob storage reference*
- *TaskManagers retrieve the TaskInfo from the blob cache*
## Verifying this change
Please make sure both new and modified tests in this PR follows the conventions defined in our code quality guide: https://flink.apache.org/contributing/code-style-and-quality-common.html#testing
*(Please pick either of the following options)*
This change is a trivial rework / code cleanup without any test coverage.
*(or)*
This change is already covered by existing tests, such as *(please describe tests)*.
*(or)*
This change added tests and can be verified as follows:
*(example:)*
- *Added integration tests for end-to-end deployment with large payloads (100MB)*
- *Extended integration test for recovery after master (JobManager) failure*
- *Added test that validates that TaskInfo is transferred only once across recoveries*
- *Manually verified the change by running a 4 node cluster with 2 JobManagers and 4 TaskManagers, a stateful streaming program, and killing one JobManager and two TaskManagers during the execution, verifying that recovery happens correctly.*
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (yes / no)
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (yes / no)
- The serializers: (yes / no / don't know)
- The runtime per-record code paths (performance sensitive): (yes / no / don't know)
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / no / don't know)
- The S3 file system connector: (yes / no / don't know)
## Documentation
- Does this pull request introduce a new feature? (yes / no)
- If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] dannycranmer merged pull request #21497: [FLINK-30377][table-planner] applySinkProvider use ClientWrapperClassLoader while extracting Type from KeyedStream
Posted by "dannycranmer (via GitHub)" <gi...@apache.org>.
dannycranmer merged PR #21497:
URL: https://github.com/apache/flink/pull/21497
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] dannycranmer commented on a diff in pull request #21497: [FLINK-30377][table-planner] applySinkProvider use ClientWrapperClassLoader while extracting Type from KeyedStream
Posted by "dannycranmer (via GitHub)" <gi...@apache.org>.
dannycranmer commented on code in PR #21497:
URL: https://github.com/apache/flink/pull/21497#discussion_r1086767065
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/common/CommonExecSink.java:
##########
@@ -460,87 +461,95 @@ private Transformation<?> applySinkProvider(
SinkRuntimeProvider runtimeProvider,
int rowtimeFieldIndex,
int sinkParallelism,
- ExecNodeConfig config) {
- TransformationMetadata sinkMeta = createTransformationMeta(SINK_TRANSFORMATION, config);
- if (runtimeProvider instanceof DataStreamSinkProvider) {
- Transformation<RowData> sinkTransformation =
- applyRowtimeTransformation(
- inputTransform, rowtimeFieldIndex, sinkParallelism, config);
- final DataStream<RowData> dataStream = new DataStream<>(env, sinkTransformation);
- final DataStreamSinkProvider provider = (DataStreamSinkProvider) runtimeProvider;
- return provider.consumeDataStream(createProviderContext(config), dataStream)
- .getTransformation();
- } else if (runtimeProvider instanceof TransformationSinkProvider) {
- final TransformationSinkProvider provider =
- (TransformationSinkProvider) runtimeProvider;
- return provider.createTransformation(
- new TransformationSinkProvider.Context() {
- @Override
- public Transformation<RowData> getInputTransformation() {
- return inputTransform;
- }
-
- @Override
- public int getRowtimeIndex() {
- return rowtimeFieldIndex;
- }
-
- @Override
- public Optional<String> generateUid(String name) {
- return createProviderContext(config).generateUid(name);
- }
- });
- } else if (runtimeProvider instanceof SinkFunctionProvider) {
- final SinkFunction<RowData> sinkFunction =
- ((SinkFunctionProvider) runtimeProvider).createSinkFunction();
- return createSinkFunctionTransformation(
- sinkFunction,
- env,
- inputTransform,
- rowtimeFieldIndex,
- sinkMeta,
- sinkParallelism);
- } else if (runtimeProvider instanceof OutputFormatProvider) {
- OutputFormat<RowData> outputFormat =
- ((OutputFormatProvider) runtimeProvider).createOutputFormat();
- final SinkFunction<RowData> sinkFunction = new OutputFormatSinkFunction<>(outputFormat);
- return createSinkFunctionTransformation(
- sinkFunction,
- env,
- inputTransform,
- rowtimeFieldIndex,
- sinkMeta,
- sinkParallelism);
- } else if (runtimeProvider instanceof SinkProvider) {
- Transformation<RowData> sinkTransformation =
- applyRowtimeTransformation(
- inputTransform, rowtimeFieldIndex, sinkParallelism, config);
- final DataStream<RowData> dataStream = new DataStream<>(env, sinkTransformation);
- final Transformation<?> transformation =
- DataStreamSink.forSinkV1(
- dataStream,
- ((SinkProvider) runtimeProvider).createSink(),
- CustomSinkOperatorUidHashes.DEFAULT)
- .getTransformation();
- transformation.setParallelism(sinkParallelism);
- sinkMeta.fill(transformation);
- return transformation;
- } else if (runtimeProvider instanceof SinkV2Provider) {
- Transformation<RowData> sinkTransformation =
- applyRowtimeTransformation(
- inputTransform, rowtimeFieldIndex, sinkParallelism, config);
- final DataStream<RowData> dataStream = new DataStream<>(env, sinkTransformation);
- final Transformation<?> transformation =
- DataStreamSink.forSink(
- dataStream,
- ((SinkV2Provider) runtimeProvider).createSink(),
- CustomSinkOperatorUidHashes.DEFAULT)
- .getTransformation();
- transformation.setParallelism(sinkParallelism);
- sinkMeta.fill(transformation);
- return transformation;
- } else {
- throw new TableException("Unsupported sink runtime provider.");
+ ExecNodeConfig config,
+ ClassLoader classLoader) {
+ final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
Review Comment:
Can we use [TemporaryClassLoaderContext](https://github.com/apache/flink/blob/master/flink-core/src/main/java/org/apache/flink/util/TemporaryClassLoaderContext.java) since this seems to be the standard way to flip out the classloader?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] dannycranmer commented on pull request #21497: [FLINK-30377][table-planner] applySinkProvider use ClientWrapperClassLoader while extracting Type from KeyedStream
Posted by "dannycranmer (via GitHub)" <gi...@apache.org>.
dannycranmer commented on PR #21497:
URL: https://github.com/apache/flink/pull/21497#issuecomment-1406612497
LGTM, thanks @Samrat002
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] Samrat002 commented on pull request #21497: [FLINK-30377][table-planner] applySinkProvider use ClientWrapperClassLoader while extracting Type from KeyedStream
Posted by "Samrat002 (via GitHub)" <gi...@apache.org>.
Samrat002 commented on PR #21497:
URL: https://github.com/apache/flink/pull/21497#issuecomment-1406260505
@dannycranmer please review the updated changes ^
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #21497: [FLINK-30377][table-planner] applySinkProvider use ClientWrapperClassLoader while extracting Type from KeyedStream
Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #21497:
URL: https://github.com/apache/flink/pull/21497#issuecomment-1347775653
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "e4b1f9b8078d9904f2b92f55de472a4fe6089d62",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "e4b1f9b8078d9904f2b92f55de472a4fe6089d62",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* e4b1f9b8078d9904f2b92f55de472a4fe6089d62 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] Samrat002 commented on a diff in pull request #21497: [FLINK-30377][table-planner] applySinkProvider use ClientWrapperClassLoader while extracting Type from KeyedStream
Posted by "Samrat002 (via GitHub)" <gi...@apache.org>.
Samrat002 commented on code in PR #21497:
URL: https://github.com/apache/flink/pull/21497#discussion_r1088697439
##########
flink-table/flink-table-planner/src/main/java/org/apache/flink/table/planner/plan/nodes/exec/common/CommonExecSink.java:
##########
@@ -460,87 +461,95 @@ private Transformation<?> applySinkProvider(
SinkRuntimeProvider runtimeProvider,
int rowtimeFieldIndex,
int sinkParallelism,
- ExecNodeConfig config) {
- TransformationMetadata sinkMeta = createTransformationMeta(SINK_TRANSFORMATION, config);
- if (runtimeProvider instanceof DataStreamSinkProvider) {
- Transformation<RowData> sinkTransformation =
- applyRowtimeTransformation(
- inputTransform, rowtimeFieldIndex, sinkParallelism, config);
- final DataStream<RowData> dataStream = new DataStream<>(env, sinkTransformation);
- final DataStreamSinkProvider provider = (DataStreamSinkProvider) runtimeProvider;
- return provider.consumeDataStream(createProviderContext(config), dataStream)
- .getTransformation();
- } else if (runtimeProvider instanceof TransformationSinkProvider) {
- final TransformationSinkProvider provider =
- (TransformationSinkProvider) runtimeProvider;
- return provider.createTransformation(
- new TransformationSinkProvider.Context() {
- @Override
- public Transformation<RowData> getInputTransformation() {
- return inputTransform;
- }
-
- @Override
- public int getRowtimeIndex() {
- return rowtimeFieldIndex;
- }
-
- @Override
- public Optional<String> generateUid(String name) {
- return createProviderContext(config).generateUid(name);
- }
- });
- } else if (runtimeProvider instanceof SinkFunctionProvider) {
- final SinkFunction<RowData> sinkFunction =
- ((SinkFunctionProvider) runtimeProvider).createSinkFunction();
- return createSinkFunctionTransformation(
- sinkFunction,
- env,
- inputTransform,
- rowtimeFieldIndex,
- sinkMeta,
- sinkParallelism);
- } else if (runtimeProvider instanceof OutputFormatProvider) {
- OutputFormat<RowData> outputFormat =
- ((OutputFormatProvider) runtimeProvider).createOutputFormat();
- final SinkFunction<RowData> sinkFunction = new OutputFormatSinkFunction<>(outputFormat);
- return createSinkFunctionTransformation(
- sinkFunction,
- env,
- inputTransform,
- rowtimeFieldIndex,
- sinkMeta,
- sinkParallelism);
- } else if (runtimeProvider instanceof SinkProvider) {
- Transformation<RowData> sinkTransformation =
- applyRowtimeTransformation(
- inputTransform, rowtimeFieldIndex, sinkParallelism, config);
- final DataStream<RowData> dataStream = new DataStream<>(env, sinkTransformation);
- final Transformation<?> transformation =
- DataStreamSink.forSinkV1(
- dataStream,
- ((SinkProvider) runtimeProvider).createSink(),
- CustomSinkOperatorUidHashes.DEFAULT)
- .getTransformation();
- transformation.setParallelism(sinkParallelism);
- sinkMeta.fill(transformation);
- return transformation;
- } else if (runtimeProvider instanceof SinkV2Provider) {
- Transformation<RowData> sinkTransformation =
- applyRowtimeTransformation(
- inputTransform, rowtimeFieldIndex, sinkParallelism, config);
- final DataStream<RowData> dataStream = new DataStream<>(env, sinkTransformation);
- final Transformation<?> transformation =
- DataStreamSink.forSink(
- dataStream,
- ((SinkV2Provider) runtimeProvider).createSink(),
- CustomSinkOperatorUidHashes.DEFAULT)
- .getTransformation();
- transformation.setParallelism(sinkParallelism);
- sinkMeta.fill(transformation);
- return transformation;
- } else {
- throw new TableException("Unsupported sink runtime provider.");
+ ExecNodeConfig config,
+ ClassLoader classLoader) {
+ final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
Review Comment:
yes ! made changes accordingly
Please review the updated changes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] Samrat002 commented on pull request #21497: [FLINK-30377][table-planner] applySinkProvider use ClientWrapperClassLoader while extracting Type from KeyedStream
Posted by GitBox <gi...@apache.org>.
Samrat002 commented on PR #21497:
URL: https://github.com/apache/flink/pull/21497#issuecomment-1350378538
@twalthr , please help reviewing the small change in free time
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org