提交 44eb58e0 编写于 作者: U Ufuk Celebi

[FLINK-2769] [runtime-web] Add configurable job manager address to HTTP requests

This was removed in 3b8b4f0f. The
issue was fixed by this, but it disabled local testing as well.

This change re-introduces the variable and sets it to the empty
string by default. This way, we can still use the proxy server for
local testing.

This closes #1449
上级 7d2394d4
...@@ -103,8 +103,7 @@ mvn -DskipTests clean package ...@@ -103,8 +103,7 @@ mvn -DskipTests clean package
To simplify continuous development, one can use a *standalone proxy server*, together with automatic To simplify continuous development, one can use a *standalone proxy server*, together with automatic
re-compilation: re-compilation:
1. Edit the file `app/scripts/index.coffee`. Comment/uncomment the lines that define the `webServer`, and `jobServer` URLs. 1. Edit the file `app/scripts/index.coffee`. Comment/uncomment the lines that define the `jobServer` URL.
2. Re-compile the files via `gulp`. By calling `gulp watch`, the build-tool autocompiles future changes. 2. Re-compile the files via `gulp`. By calling `gulp watch`, the build-tool autocompiles future changes.
3. Start the proxy server via `node server.js` 3. Start the proxy server via `node server.js`
4. Access the dashboard at [`http://localhost:3000`](http://localhost:3000) 4. Access the dashboard at [`http://localhost:3000`](http://localhost:3000)
...@@ -22,7 +22,7 @@ angular.module('flinkApp') ...@@ -22,7 +22,7 @@ angular.module('flinkApp')
@loadConfig = -> @loadConfig = ->
deferred = $q.defer() deferred = $q.defer()
$http.get "config" $http.get flinkConfig.jobServer + "config"
.success (data, status, headers, config) -> .success (data, status, headers, config) ->
deferred.resolve(data) deferred.resolve(data)
......
...@@ -29,6 +29,8 @@ angular.module('flinkApp', ['ui.router', 'angularMoment']) ...@@ -29,6 +29,8 @@ angular.module('flinkApp', ['ui.router', 'angularMoment'])
# -------------------------------------- # --------------------------------------
.value 'flinkConfig', { .value 'flinkConfig', {
jobServer: ''
# jobServer: 'http://localhost:8081/'
"refresh-interval": 10000 "refresh-interval": 10000
} }
......
...@@ -24,7 +24,7 @@ angular.module('flinkApp') ...@@ -24,7 +24,7 @@ angular.module('flinkApp')
@loadConfig = -> @loadConfig = ->
deferred = $q.defer() deferred = $q.defer()
$http.get("jobmanager/config") $http.get(flinkConfig.jobServer + "jobmanager/config")
.success (data, status, headers, config) -> .success (data, status, headers, config) ->
config = data config = data
deferred.resolve(data) deferred.resolve(data)
...@@ -39,7 +39,7 @@ angular.module('flinkApp') ...@@ -39,7 +39,7 @@ angular.module('flinkApp')
@loadLogs = -> @loadLogs = ->
deferred = $q.defer() deferred = $q.defer()
$http.get("jobmanager/log") $http.get(flinkConfig.jobServer + "jobmanager/log")
.success (data, status, headers, config) -> .success (data, status, headers, config) ->
logs = data logs = data
deferred.resolve(data) deferred.resolve(data)
...@@ -54,7 +54,7 @@ angular.module('flinkApp') ...@@ -54,7 +54,7 @@ angular.module('flinkApp')
@loadStdout = -> @loadStdout = ->
deferred = $q.defer() deferred = $q.defer()
$http.get("jobmanager/stdout") $http.get(flinkConfig.jobServer + "jobmanager/stdout")
.success (data, status, headers, config) -> .success (data, status, headers, config) ->
stdout = data stdout = data
deferred.resolve(data) deferred.resolve(data)
......
...@@ -86,7 +86,7 @@ angular.module('flinkApp') ...@@ -86,7 +86,7 @@ angular.module('flinkApp')
@listJobs = -> @listJobs = ->
deferred = $q.defer() deferred = $q.defer()
$http.get "joboverview" $http.get flinkConfig.jobServer + "joboverview"
.success (data, status, headers, config) => .success (data, status, headers, config) =>
angular.forEach data, (list, listKey) => angular.forEach data, (list, listKey) =>
switch listKey switch listKey
...@@ -110,12 +110,12 @@ angular.module('flinkApp') ...@@ -110,12 +110,12 @@ angular.module('flinkApp')
currentJob = null currentJob = null
deferreds.job = $q.defer() deferreds.job = $q.defer()
$http.get "jobs/" + jobid $http.get flinkConfig.jobServer + "jobs/" + jobid
.success (data, status, headers, config) => .success (data, status, headers, config) =>
@setEndTimes(data.vertices) @setEndTimes(data.vertices)
@processVertices(data) @processVertices(data)
$http.get "jobs/" + jobid + "/config" $http.get flinkConfig.jobServer + "jobs/" + jobid + "/config"
.success (jobConfig) -> .success (jobConfig) ->
data = angular.extend(data, jobConfig) data = angular.extend(data, jobConfig)
...@@ -157,7 +157,7 @@ angular.module('flinkApp') ...@@ -157,7 +157,7 @@ angular.module('flinkApp')
deferreds.job.promise.then (data) => deferreds.job.promise.then (data) =>
vertex = @seekVertex(vertexid) vertex = @seekVertex(vertexid)
$http.get "jobs/" + currentJob.jid + "/vertices/" + vertexid + "/subtasktimes" $http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/vertices/" + vertexid + "/subtasktimes"
.success (data) => .success (data) =>
# TODO: change to subtasktimes # TODO: change to subtasktimes
vertex.subtasks = data.subtasks vertex.subtasks = data.subtasks
...@@ -172,7 +172,7 @@ angular.module('flinkApp') ...@@ -172,7 +172,7 @@ angular.module('flinkApp')
deferreds.job.promise.then (data) => deferreds.job.promise.then (data) =>
# vertex = @seekVertex(vertexid) # vertex = @seekVertex(vertexid)
$http.get "jobs/" + currentJob.jid + "/vertices/" + vertexid $http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/vertices/" + vertexid
.success (data) -> .success (data) ->
subtasks = data.subtasks subtasks = data.subtasks
...@@ -186,11 +186,11 @@ angular.module('flinkApp') ...@@ -186,11 +186,11 @@ angular.module('flinkApp')
deferreds.job.promise.then (data) => deferreds.job.promise.then (data) =>
# vertex = @seekVertex(vertexid) # vertex = @seekVertex(vertexid)
$http.get "jobs/" + currentJob.jid + "/vertices/" + vertexid + "/accumulators" $http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/vertices/" + vertexid + "/accumulators"
.success (data) -> .success (data) ->
accumulators = data['user-accumulators'] accumulators = data['user-accumulators']
$http.get "jobs/" + currentJob.jid + "/vertices/" + vertexid + "/subtasks/accumulators" $http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/vertices/" + vertexid + "/subtasks/accumulators"
.success (data) -> .success (data) ->
subtaskAccumulators = data.subtasks subtaskAccumulators = data.subtasks
...@@ -203,7 +203,7 @@ angular.module('flinkApp') ...@@ -203,7 +203,7 @@ angular.module('flinkApp')
deferreds.job.promise.then (data) => deferreds.job.promise.then (data) =>
$http.get "jobs/" + currentJob.jid + "/exceptions" $http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/exceptions"
.success (exceptions) -> .success (exceptions) ->
currentJob.exceptions = exceptions currentJob.exceptions = exceptions
...@@ -214,6 +214,6 @@ angular.module('flinkApp') ...@@ -214,6 +214,6 @@ angular.module('flinkApp')
@cancelJob = (jobid) -> @cancelJob = (jobid) ->
# uses the non REST-compliant GET yarn-cancel handler which is available in addition to the # uses the non REST-compliant GET yarn-cancel handler which is available in addition to the
# proper "DELETE jobs/<jobid>/" # proper "DELETE jobs/<jobid>/"
$http.get "jobs/" + jobid + "/yarn-cancel" $http.get flinkConfig.jobServer + "jobs/" + jobid + "/yarn-cancel"
@ @
...@@ -24,7 +24,7 @@ angular.module('flinkApp') ...@@ -24,7 +24,7 @@ angular.module('flinkApp')
@loadOverview = -> @loadOverview = ->
deferred = $q.defer() deferred = $q.defer()
$http.get("overview") $http.get(flinkConfig.jobServer + "overview")
.success (data, status, headers, config) -> .success (data, status, headers, config) ->
overview = data overview = data
deferred.resolve(data) deferred.resolve(data)
......
...@@ -22,7 +22,7 @@ angular.module('flinkApp') ...@@ -22,7 +22,7 @@ angular.module('flinkApp')
@loadManagers = () -> @loadManagers = () ->
deferred = $q.defer() deferred = $q.defer()
$http.get("taskmanagers") $http.get(flinkConfig.jobServer + "taskmanagers")
.success (data, status, headers, config) -> .success (data, status, headers, config) ->
deferred.resolve(data['taskmanagers']) deferred.resolve(data['taskmanagers'])
...@@ -34,7 +34,7 @@ angular.module('flinkApp') ...@@ -34,7 +34,7 @@ angular.module('flinkApp')
@loadMetrics = (taskmanagerid) -> @loadMetrics = (taskmanagerid) ->
deferred = $q.defer() deferred = $q.defer()
$http.get("taskmanagers/" + taskmanagerid) $http.get(flinkConfig.jobServer + "taskmanagers/" + taskmanagerid)
.success (data, status, headers, config) -> .success (data, status, headers, config) ->
deferred.resolve(data['taskmanagers']) deferred.resolve(data['taskmanagers'])
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册