Re: Submitting jobs via Java code

2018-01-18 Thread Luigi Sgaglione
Solved. this is the corret code to deploy a Job programmatically via REST API. Thanks URL serverUrl = new URL("http://192.168.149.130:8081/jars/upload";); HttpURLConnection urlConnection = (HttpURLConnection) serverUrl.openConnection(); String boundaryString = "--Boundary"; String crlf

Re: Submitting jobs via Java code

2018-01-18 Thread Luigi Sgaglione
Hi Timo, I think that the REST API is the most suitable solution. Thanks. So, I'm trying to use the Flink REST API and I'm able to perform get request but not the post one. In particular when I issue a post to upload the jar I receive this error form the server: {"error": "Failed to upload the f

Re: Submitting jobs via Java code

2018-01-18 Thread Timo Walther
Hi Luigi, I'm also working on a solution for submitting jobs programmatically. You can look into my working branch [1]. As far as I know, the best and most stable solution is using the ClusterClient. But this is internal API and might change. You could also use Flink's REST API for submittin

Re: Submitting jobs via Java code

2018-01-18 Thread Luigi Sgaglione
Hi Timo, my objective is to create a web interface that allows me to edit and deploy jobs on Flink. To do so I'm evaluating all possibilities provided by Flink APIs. What do you think that is the best solution? Thanks 2018-01-18 9:39 GMT+01:00 Timo Walther : > Hi Luigi, > > can you try to load

Re: Submitting jobs via Java code

2018-01-18 Thread Timo Walther
Hi Luigi, can you try to load an entire configuration file via GlobalConfiguration.loadConfiguration(flinkConfigDir). Maybe you tell us a little bit what you want to achieve? Is the programmatic submission a requirement for you? Did you consider using the RemoteStreamEnvironment? Regards,

Submitting jobs via Java code

2018-01-17 Thread Luigi Sgaglione
Hi, I am a beginner in Flink and I'm trying to deploy a simple example using a java client in a remote Flink server (1.4.0). I'm using org.apache.flink.client.program.Client this is the used code: Configuration config = new Configuration(); config.setString("jobmanager.rpc.address", "192.168.14