[ 
https://issues.apache.org/jira/browse/FLINK-36466?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Wenjun Ruan updated FLINK-36466:
--------------------------------
    Description: 
Hi team,

I debug with WordCount locally, and find 
StreamGraphGenerator#shouldExecuteInBatchMode will return false due to we get 
the  default value of `execution.runtime-mode`.
 
The logic seems incorrect here.
{code:java}
private boolean shouldExecuteInBatchMode() {
    final RuntimeExecutionMode configuredMode =
            configuration.get(ExecutionOptions.RUNTIME_MODE);

    final boolean existsUnboundedSource = existsUnboundedSource();

    checkState(
            configuredMode != RuntimeExecutionMode.BATCH || 
!existsUnboundedSource,
            "Detected an UNBOUNDED source with the '"
                    + ExecutionOptions.RUNTIME_MODE.key()
                    + "' set to 'BATCH'. "
                    + "This combination is not allowed, please set the '"
                    + ExecutionOptions.RUNTIME_MODE.key()
                    + "' to STREAMING or AUTOMATIC");

    if (checkNotNull(configuredMode) != RuntimeExecutionMode.AUTOMATIC) {
        return configuredMode == RuntimeExecutionMode.BATCH;
    }
    return !existsUnboundedSource;
} {code}
If we don't set `execution.runtime-mode` then this method will always return 
false, although we use boundedSource.
 
Why we didn't choose to use AUTOMATIC as the default value, this should be work 
in most cases? Is there any other reason?
 
 
 

  was:
Hi team,

I debug with WordCount locally, and find 
StreamGraphGenerator#shouldExecuteInBatchMode will return false due to we get 
the  default value of `execution.runtime-mode`.
 
The logic seems incorrect here.
{code:java}
// code placeholder
private boolean shouldExecuteInBatchMode() {
    final RuntimeExecutionMode configuredMode =
            configuration.get(ExecutionOptions.RUNTIME_MODE);

    final boolean existsUnboundedSource = existsUnboundedSource();

    checkState(
            configuredMode != RuntimeExecutionMode.BATCH || 
!existsUnboundedSource,
            "Detected an UNBOUNDED source with the '"
                    + ExecutionOptions.RUNTIME_MODE.key()
                    + "' set to 'BATCH'. "
                    + "This combination is not allowed, please set the '"
                    + ExecutionOptions.RUNTIME_MODE.key()
                    + "' to STREAMING or AUTOMATIC");

    if (checkNotNull(configuredMode) != RuntimeExecutionMode.AUTOMATIC) {
        return configuredMode == RuntimeExecutionMode.BATCH;
    }
    return !existsUnboundedSource;
} {code}
If we don't set `execution.runtime-mode` then this method will always return 
false, although we use boundedSource.
 
Why we didn't choose to use AUTOMATIC as the default value, this should be work 
in most cases?
 
 
 


> Change default value of execution.runtime-mode from STREAMING to AUTOMATIC 
> ---------------------------------------------------------------------------
>
>                 Key: FLINK-36466
>                 URL: https://issues.apache.org/jira/browse/FLINK-36466
>             Project: Flink
>          Issue Type: Improvement
>          Components: API / Core
>            Reporter: Wenjun Ruan
>            Priority: Major
>
> Hi team,
> I debug with WordCount locally, and find 
> StreamGraphGenerator#shouldExecuteInBatchMode will return false due to we get 
> the  default value of `execution.runtime-mode`.
>  
> The logic seems incorrect here.
> {code:java}
> private boolean shouldExecuteInBatchMode() {
>     final RuntimeExecutionMode configuredMode =
>             configuration.get(ExecutionOptions.RUNTIME_MODE);
>     final boolean existsUnboundedSource = existsUnboundedSource();
>     checkState(
>             configuredMode != RuntimeExecutionMode.BATCH || 
> !existsUnboundedSource,
>             "Detected an UNBOUNDED source with the '"
>                     + ExecutionOptions.RUNTIME_MODE.key()
>                     + "' set to 'BATCH'. "
>                     + "This combination is not allowed, please set the '"
>                     + ExecutionOptions.RUNTIME_MODE.key()
>                     + "' to STREAMING or AUTOMATIC");
>     if (checkNotNull(configuredMode) != RuntimeExecutionMode.AUTOMATIC) {
>         return configuredMode == RuntimeExecutionMode.BATCH;
>     }
>     return !existsUnboundedSource;
> } {code}
> If we don't set `execution.runtime-mode` then this method will always return 
> false, although we use boundedSource.
>  
> Why we didn't choose to use AUTOMATIC as the default value, this should be 
> work in most cases? Is there any other reason?
>  
>  
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to