[ 
https://issues.apache.org/jira/browse/FLINK-2579?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14716855#comment-14716855
 ] 

Arnaud Linz commented on FLINK-2579:
------------------------------------

I understand, it may not be such a good idea. 

What I had in mind was :

// Batch
public ExecutionConfig getConfig()
public int getParallelism()
public void setParallelism(int parallelism)
public void setNumberOfExecutionRetries(int numberOfExecutionRetries)
public int getNumberOfExecutionRetries()
public void addDefaultKryoSerializer(Class<?> type, Serializer<?> serializer)
public void addDefaultKryoSerializer(Class<?> type, Class<? extends 
Serializer<?>> serializerClass)
public void registerTypeWithKryoSerializer(Class<?> type, Serializer<?> 
serializer)
public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends 
Serializer<?>> serializerClass)
public void registerType(Class<?> type)
public JobExecutionResult execute()
public JobExecutionResult execute(String paramString)

// And maybe
public String getExecutionPlan()
public static LocalEnvironment createLocalEnvironment()
public static LocalEnvironment createLocalEnvironment(int parallelism)
public static void setDefaultLocalParallelism(int parallelism)

// Stream
public ExecutionConfig getConfig()
public int getParallelism()
public StreamExecutionEnvironment setParallelism(int parallelism)
public void setNumberOfExecutionRetries(int numberOfExecutionRetries)
public int getNumberOfExecutionRetries()
public void addDefaultKryoSerializer(Class<?> type, Serializer<?> serializer)
public void addDefaultKryoSerializer(Class<?> type, Class<? extends 
Serializer<?>> serializerClass)
public void registerTypeWithKryoSerializer(Class<?> type, Serializer<?> 
serializer)
public void registerTypeWithKryoSerializer(Class<?> type, Class<? extends 
Serializer<?>> serializerClass)
public void registerType(Class<?> type)
public JobExecutionResult execute()
public JobExecutionResult execute(String paramString) 
public String getExecutionPlan()

// And maybe
public static LocalStreamEnvironment createLocalEnvironment()
public static LocalStreamEnvironment createLocalEnvironment(int parallelism)
public static void setDefaultLocalParallelism(int parallelism)

but it's a small set of API that thus it may not worth the effort. However, one 
should try to make a few rules on API syntax to help users, for instance decide 
whether "setXXX" returns void or this, it seems that "this" is the exception on 
the StreamExecutionEnvironment :-)

> StreamExecutionEnvironment & ExecutionEnvironment do not share interface but 
> have a lot in common
> -------------------------------------------------------------------------------------------------
>
>                 Key: FLINK-2579
>                 URL: https://issues.apache.org/jira/browse/FLINK-2579
>             Project: Flink
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Arnaud Linz
>            Priority: Minor
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Both classes 
> org.apache.flink.streaming.api.environment.StreamExecutionEnvironment and 
> org.apache.flink.api.java.ExecutionEnvironment have a lot in common (same 
> methods for kryo registration, fromCollection, etc) but are not related by a 
> java contract.
> That leads to annoying differences, for instance : 
> StreamExecutionEnvironment.setParallelism() returns 'this' where as 
> ExecutionEnvironment.setParallelism() has not return value.
> They have specificities, but maybe they should both implement a common 
> Interface to make sure that the common signatures are coherent?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to