提交 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
To simplify continuous development, one can use a *standalone proxy server*, together with automatic
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.
3. Start the proxy server via `node server.js`
4. Access the dashboard at [`http://localhost:3000`](http://localhost:3000)
......@@ -22,7 +22,7 @@ angular.module('flinkApp')
@loadConfig = ->
deferred = $q.defer()
$http.get "config"
$http.get flinkConfig.jobServer + "config"
.success (data, status, headers, config) ->
deferred.resolve(data)
......
......@@ -29,6 +29,8 @@ angular.module('flinkApp', ['ui.router', 'angularMoment'])
# --------------------------------------
.value 'flinkConfig', {
jobServer: ''
# jobServer: 'http://localhost:8081/'
"refresh-interval": 10000
}
......
......@@ -24,7 +24,7 @@ angular.module('flinkApp')
@loadConfig = ->
deferred = $q.defer()
$http.get("jobmanager/config")
$http.get(flinkConfig.jobServer + "jobmanager/config")
.success (data, status, headers, config) ->
config = data
deferred.resolve(data)
......@@ -39,7 +39,7 @@ angular.module('flinkApp')
@loadLogs = ->
deferred = $q.defer()
$http.get("jobmanager/log")
$http.get(flinkConfig.jobServer + "jobmanager/log")
.success (data, status, headers, config) ->
logs = data
deferred.resolve(data)
......@@ -54,7 +54,7 @@ angular.module('flinkApp')
@loadStdout = ->
deferred = $q.defer()
$http.get("jobmanager/stdout")
$http.get(flinkConfig.jobServer + "jobmanager/stdout")
.success (data, status, headers, config) ->
stdout = data
deferred.resolve(data)
......
......@@ -86,7 +86,7 @@ angular.module('flinkApp')
@listJobs = ->
deferred = $q.defer()
$http.get "joboverview"
$http.get flinkConfig.jobServer + "joboverview"
.success (data, status, headers, config) =>
angular.forEach data, (list, listKey) =>
switch listKey
......@@ -110,12 +110,12 @@ angular.module('flinkApp')
currentJob = null
deferreds.job = $q.defer()
$http.get "jobs/" + jobid
$http.get flinkConfig.jobServer + "jobs/" + jobid
.success (data, status, headers, config) =>
@setEndTimes(data.vertices)
@processVertices(data)
$http.get "jobs/" + jobid + "/config"
$http.get flinkConfig.jobServer + "jobs/" + jobid + "/config"
.success (jobConfig) ->
data = angular.extend(data, jobConfig)
......@@ -157,7 +157,7 @@ angular.module('flinkApp')
deferreds.job.promise.then (data) =>
vertex = @seekVertex(vertexid)
$http.get "jobs/" + currentJob.jid + "/vertices/" + vertexid + "/subtasktimes"
$http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/vertices/" + vertexid + "/subtasktimes"
.success (data) =>
# TODO: change to subtasktimes
vertex.subtasks = data.subtasks
......@@ -172,7 +172,7 @@ angular.module('flinkApp')
deferreds.job.promise.then (data) =>
# vertex = @seekVertex(vertexid)
$http.get "jobs/" + currentJob.jid + "/vertices/" + vertexid
$http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/vertices/" + vertexid
.success (data) ->
subtasks = data.subtasks
......@@ -186,11 +186,11 @@ angular.module('flinkApp')
deferreds.job.promise.then (data) =>
# vertex = @seekVertex(vertexid)
$http.get "jobs/" + currentJob.jid + "/vertices/" + vertexid + "/accumulators"
$http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/vertices/" + vertexid + "/accumulators"
.success (data) ->
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) ->
subtaskAccumulators = data.subtasks
......@@ -203,7 +203,7 @@ angular.module('flinkApp')
deferreds.job.promise.then (data) =>
$http.get "jobs/" + currentJob.jid + "/exceptions"
$http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/exceptions"
.success (exceptions) ->
currentJob.exceptions = exceptions
......@@ -214,6 +214,6 @@ angular.module('flinkApp')
@cancelJob = (jobid) ->
# uses the non REST-compliant GET yarn-cancel handler which is available in addition to the
# 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')
@loadOverview = ->
deferred = $q.defer()
$http.get("overview")
$http.get(flinkConfig.jobServer + "overview")
.success (data, status, headers, config) ->
overview = data
deferred.resolve(data)
......
......@@ -22,7 +22,7 @@ angular.module('flinkApp')
@loadManagers = () ->
deferred = $q.defer()
$http.get("taskmanagers")
$http.get(flinkConfig.jobServer + "taskmanagers")
.success (data, status, headers, config) ->
deferred.resolve(data['taskmanagers'])
......@@ -34,7 +34,7 @@ angular.module('flinkApp')
@loadMetrics = (taskmanagerid) ->
deferred = $q.defer()
$http.get("taskmanagers/" + taskmanagerid)
$http.get(flinkConfig.jobServer + "taskmanagers/" + taskmanagerid)
.success (data, status, headers, config) ->
deferred.resolve(data['taskmanagers'])
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册