Skip to content

Fix semantics of skip output#2468

Merged
srkukarni merged 7 commits into
apache:masterfrom
srkukarni:fix_skipoutput
Aug 31, 2018
Merged

Fix semantics of skip output#2468
srkukarni merged 7 commits into
apache:masterfrom
srkukarni:fix_skipoutput

Conversation

@srkukarni
Copy link
Copy Markdown
Contributor

Motivation

skipOutput is meant to supress any output if set to true. The current check are inaccurate in two respects

  1. If the flag is set to true, then we need to set output topic to empty(i.e. no output). This pr does it
  2. The current check does not work for void functions.

Modifications

Describe the modifications you've done.

Result

After your change, what will change.

@srkukarni srkukarni self-assigned this Aug 28, 2018
@srkukarni srkukarni added this to the 2.2.0-incubating milestone Aug 28, 2018
protected void validateFunctionConfigs(FunctionConfig functionConfig) {

if (isBlank(functionConfig.getOutput()) && !functionConfig.isSkipOutput()) {
throw new ParameterException(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought with #2261 we decided with @sijie 's feedback to "fail fast" if there is a conflict because output-topic name and skip-output are mutually exclusive and user should not use it together. so, does it make sense to give error-message to clarify role of the input skipoutput flag.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

skipOutput flag is currently very misleading. From the description it seems that you can run a function and pass this flag to suppress any output. Thus if you provide an output topic and specify skipOutput, this flag will nullify the output topic. Maybe I can print a message while nulliyfing the output topic.
Otherwise I really don't understand the need for skipOutput. One other thing that we can do that if output topic is not set, don;'t write it. That might be a cleaner/clearer way than this whole outputTopic and skipOutput combination. What do you think @sijie @rdhabalia @jerrypeng

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't we agree on #2261 to fail-fast if no output specified and if user want to skip output, they should skip-output?

@srkukarni
Copy link
Copy Markdown
Contributor Author

We might have, however the moot point of this pr is that the skipOutput flag has become confusing. What do we really want to achieve here? If users dont want to output anything, they can always set their output topic to be empty or not set it at all. Why is there a need for extra flag?

@rdhabalia
Copy link
Copy Markdown
Contributor

If users dont want to output anything, they can always set their output topic to be empty or not set it at all. Why is there a need for extra flag?

:-) that's true.. earlier motivation and change of #2261 was to not publish if output topic is empty.. but then I think you proposed to introduce flag explicitly when user doesn't want to publish in output topic.? I think then we added flag based on feedback. I am fine with removing flag but then it seems we had changed earlier PR with the feedback so, not sure if we want to add flag again in future.

srkukarni on Jul 30 Member
I would rather have this functionality gated by some kind of flag with default being output topic created that the users can turn off for optimization purposes

@srkukarni
Copy link
Copy Markdown
Contributor Author

IIRC, in 2.1, if you dont specify an output topic, a topic was created for you as the function output. I believe we wanted to change that by not doing that. So now if you dont specify an output topic, nothing gets created. Now I'm not sure how that got mixed up with the flag. Anyways I will remove this flag for now since its superflous

@srkukarni
Copy link
Copy Markdown
Contributor Author

retest this please

@srkukarni
Copy link
Copy Markdown
Contributor Author

run java8 tests

1 similar comment
@srkukarni
Copy link
Copy Markdown
Contributor Author

run java8 tests

@srkukarni
Copy link
Copy Markdown
Contributor Author

run integration tests

@srkukarni
Copy link
Copy Markdown
Contributor Author

run java8 tests

@srkukarni
Copy link
Copy Markdown
Contributor Author

run integration tests

1 similar comment
@srkukarni
Copy link
Copy Markdown
Contributor Author

run integration tests

@srkukarni
Copy link
Copy Markdown
Contributor Author

run java8 tests
run integration tests

@srkukarni
Copy link
Copy Markdown
Contributor Author

run java8 tests

1 similar comment
@srkukarni
Copy link
Copy Markdown
Contributor Author

run java8 tests

@srkukarni
Copy link
Copy Markdown
Contributor Author

run integration tests
run cpp tests

@srkukarni srkukarni merged commit 581acc6 into apache:master Aug 31, 2018
@srkukarni srkukarni deleted the fix_skipoutput branch August 31, 2018 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants