-
Notifications
You must be signed in to change notification settings - Fork 8.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
YARN-4517. Add nodes page and fix bunch of license issues. (Varun Sax…
…ena via wangda)
- Loading branch information
Showing
80 changed files
with
3,840 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/app/adapters/yarn-app-attempt.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/app/adapters/yarn-app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/app/adapters/yarn-container-log.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import DS from 'ember-data'; | ||
import Ember from 'ember'; | ||
import Converter from 'yarn-ui/utils/converter'; | ||
|
||
/** | ||
* REST URL's response when fetching container logs will be | ||
* in plain text format and not JSON. | ||
*/ | ||
export default DS.RESTAdapter.extend({ | ||
headers: { | ||
Accept: 'text/plain' | ||
}, | ||
host: 'http://localhost:1337/', | ||
namespace: 'ws/v1/node', | ||
|
||
urlForFindRecord(id, modelName, snapshot) { | ||
var splits = Converter.splitForContainerLogs(id); | ||
var nodeHttpAddr = splits[0]; | ||
var containerId = splits[1]; | ||
var filename = splits[2]; | ||
this.host = this.host + nodeHttpAddr; | ||
var url = this._buildURL(); | ||
url = url + "/containerlogs/" + containerId + "/" + filename; | ||
return url; | ||
}, | ||
|
||
ajax(url, method, hash) { | ||
hash = hash || {}; | ||
hash.crossDomain = true; | ||
hash.xhrFields = {withCredentials: true}; | ||
hash.targetServer = "NM"; | ||
return this._super(url, method, hash); | ||
}, | ||
|
||
/** | ||
* Override options so that result is not expected to be JSON | ||
*/ | ||
ajaxOptions: function (url, type, options) { | ||
var hash = options || {}; | ||
hash.url = url; | ||
hash.type = type; | ||
// Make sure jQuery does not try to convert response to JSON. | ||
hash.dataType = 'text'; | ||
hash.context = this; | ||
|
||
var headers = Ember.get(this, 'headers'); | ||
if (headers != undefined) { | ||
hash.beforeSend = function (xhr) { | ||
Object.keys(headers).forEach(function (key) { | ||
return xhr.setRequestHeader(key, headers[key]); | ||
}); | ||
}; | ||
} | ||
return hash; | ||
}, | ||
}); |
5 changes: 3 additions & 2 deletions
5
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/app/adapters/yarn-container.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/app/adapters/yarn-node-app.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import DS from 'ember-data'; | ||
|
||
export default DS.JSONAPIAdapter.extend({ | ||
headers: { | ||
Accept: 'application/json' | ||
}, | ||
host: 'http://localhost:1337/', | ||
namespace: 'ws/v1/node', | ||
|
||
urlForQuery(query) { | ||
this.host = this.host + query.nodeAddr; | ||
var url = this._buildURL(); | ||
url = url + "/apps"; | ||
return url; | ||
}, | ||
|
||
urlForQueryRecord: function (query) { | ||
this.host = this.host + query.nodeAddr; | ||
var url = this._buildURL(); | ||
url = url + "/apps/" + query.appId; | ||
return url; | ||
}, | ||
|
||
query: function (store, type, query) { | ||
var url = this.urlForQuery(query); | ||
// Query params not required. | ||
query = null; | ||
return this.ajax(url, 'GET', { data: query }); | ||
}, | ||
|
||
queryRecord: function (store, type, query) { | ||
var url = this.urlForQueryRecord(query); | ||
// Query params not required. | ||
query = null; | ||
return this.ajax(url, 'GET', { data: query }); | ||
}, | ||
|
||
ajax(url, method, hash) { | ||
hash = hash || {}; | ||
hash.crossDomain = true; | ||
hash.xhrFields = {withCredentials: true}; | ||
hash.targetServer = "NM"; | ||
return this._super(url, method, hash); | ||
} | ||
}); |
64 changes: 64 additions & 0 deletions
64
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/app/adapters/yarn-node-container.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import DS from 'ember-data'; | ||
|
||
export default DS.JSONAPIAdapter.extend({ | ||
headers: { | ||
Accept: 'application/json' | ||
}, | ||
host: 'http://localhost:1337/', | ||
namespace: 'ws/v1/node', | ||
|
||
urlForQuery(query) { | ||
this.host = this.host + query.nodeHttpAddr; | ||
var url = this._buildURL(); | ||
url = url + "/containers"; | ||
return url; | ||
}, | ||
|
||
urlForQueryRecord(query) { | ||
this.host = this.host + query.nodeHttpAddr; | ||
var url = this._buildURL(); | ||
url = url + "/containers/" + query.containerId; | ||
return url; | ||
}, | ||
|
||
query: function (store, type, query) { | ||
var url = this.urlForQuery(query); | ||
// Query params not required. | ||
query = null; | ||
return this.ajax(url, 'GET', { data: query }); | ||
}, | ||
|
||
queryRecord: function (store, type, query) { | ||
var url = this.urlForQueryRecord(query); | ||
// Query params not required. | ||
query = null; | ||
console.log(url); | ||
return this.ajax(url, 'GET', { data: query }); | ||
}, | ||
|
||
ajax(url, method, hash) { | ||
hash = hash || {}; | ||
hash.crossDomain = true; | ||
hash.xhrFields = {withCredentials: true}; | ||
hash.targetServer = "NM"; | ||
return this._super(url, method, hash); | ||
} | ||
}); |
40 changes: 40 additions & 0 deletions
40
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/app/adapters/yarn-node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import DS from 'ember-data'; | ||
|
||
export default DS.JSONAPIAdapter.extend({ | ||
headers: { | ||
Accept: 'application/json' | ||
}, | ||
host: 'http://localhost:1337/', | ||
namespace: 'ws/v1/node', | ||
|
||
urlForFindRecord(id, modelName, snapshot) { | ||
this.host = this.host + id; | ||
var url = this._buildURL(); | ||
return url; | ||
}, | ||
ajax(url, method, hash) { | ||
hash = hash || {}; | ||
hash.crossDomain = true; | ||
hash.xhrFields = {withCredentials: true}; | ||
hash.targetServer = "NM"; | ||
return this._super(url, method, hash); | ||
} | ||
}); |
3 changes: 2 additions & 1 deletion
3
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/app/adapters/yarn-queue.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/app/adapters/yarn-rm-node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import DS from 'ember-data'; | ||
import Config from 'yarn-ui/config'; | ||
|
||
export default DS.JSONAPIAdapter.extend({ | ||
headers: { | ||
Accept: 'application/json' | ||
}, | ||
host: 'http://localhost:1337/' + Config.RM_HOST + ':' + Config.RM_PORT, | ||
namespace: 'ws/v1/cluster', | ||
pathForType(modelName) { | ||
return 'nodes'; | ||
}, | ||
|
||
urlForFindRecord(id, modelName, snapshot) { | ||
var url = this._buildURL(); | ||
url = url + "/nodes/" + id; | ||
return url; | ||
}, | ||
|
||
ajax(url, method, hash) { | ||
hash = hash || {}; | ||
hash.crossDomain = true; | ||
hash.xhrFields = {withCredentials: true}; | ||
hash.targetServer = "RM"; | ||
return this._super(url, method, hash); | ||
} | ||
}); |
Oops, something went wrong.