flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rmetzger <...@git.apache.org>
Subject [GitHub] flink pull request #3358: [FLINK-5487] [elasticsearch] At-least-once Elastic...
Date Tue, 21 Feb 2017 11:00:41 GMT
Github user rmetzger commented on a diff in the pull request:

    --- Diff: flink-connectors/flink-connector-elasticsearch-base/src/main/java/org/apache/flink/streaming/connectors/elasticsearch/ElasticsearchSinkBase.java
    @@ -122,10 +198,19 @@ public ElasticsearchSinkBase(
     				"The object probably contains or references non serializable fields.");
    -		checkNotNull(userConfig);
    +		try {
    +			InstantiationUtil.serializeObject(failureHandler);
    +		} catch (Exception e) {
    +			throw new IllegalArgumentException(
    +				"The implementation of the provided ActionRequestFailureHandler is not serializable.
" +
    +					"The object probably contains or references non serializable fields.");
    +		}
    --- End diff --
    This looks a bit like duplicate code. I think adding a utility into the `InstantiationUtil`
that is called `isSerializable()` would be cleaner and save some LOC.

If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.

View raw message