Return-Path: X-Original-To: apmail-tez-commits-archive@minotaur.apache.org Delivered-To: apmail-tez-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6BEB918164 for ; Mon, 4 Jan 2016 18:37:29 +0000 (UTC) Received: (qmail 57936 invoked by uid 500); 4 Jan 2016 18:37:29 -0000 Delivered-To: apmail-tez-commits-archive@tez.apache.org Received: (qmail 57903 invoked by uid 500); 4 Jan 2016 18:37:29 -0000 Mailing-List: contact commits-help@tez.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@tez.apache.org Delivered-To: mailing list commits@tez.apache.org Received: (qmail 57889 invoked by uid 99); 4 Jan 2016 18:37:29 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 Jan 2016 18:37:29 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id CFFD0E048C; Mon, 4 Jan 2016 18:37:28 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: sree@apache.org To: commits@tez.apache.org Message-Id: <69b996d54cf041f3839ce2d2da74ff4c@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: tez git commit: TEZ-3022. Tez UI 2: Add serializer & adapter for timeline server (sree) Date: Mon, 4 Jan 2016 18:37:28 +0000 (UTC) Repository: tez Updated Branches: refs/heads/TEZ-2980 50fc1b2a6 -> 525ee51b1 TEZ-3022. Tez UI 2: Add serializer & adapter for timeline server (sree) Project: http://git-wip-us.apache.org/repos/asf/tez/repo Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/525ee51b Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/525ee51b Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/525ee51b Branch: refs/heads/TEZ-2980 Commit: 525ee51b120e719d963af3a1f723c7fd62e1b742 Parents: 50fc1b2 Author: Sreenath Somarajapuram Authored: Tue Jan 5 00:07:05 2016 +0530 Committer: Sreenath Somarajapuram Committed: Tue Jan 5 00:07:05 2016 +0530 ---------------------------------------------------------------------- TEZ-2980-CHANGES.txt | 1 + .../src/main/webapp/app/adapters/timeline.js | 23 +++++++++++ tez-ui2/src/main/webapp/app/routes/abstract.js | 1 + .../src/main/webapp/app/serializers/timeline.js | 25 ++++++++++++ .../src/main/webapp/config/default-app-conf.js | 12 ++++++ .../webapp/tests/unit/adapters/timeline-test.js | 31 +++++++++++++++ .../tests/unit/serializers/timeline-test.js | 40 ++++++++++++++++++++ 7 files changed, 133 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tez/blob/525ee51b/TEZ-2980-CHANGES.txt ---------------------------------------------------------------------- diff --git a/TEZ-2980-CHANGES.txt b/TEZ-2980-CHANGES.txt index 0eb31bf..c8f9d0f 100644 --- a/TEZ-2980-CHANGES.txt +++ b/TEZ-2980-CHANGES.txt @@ -9,3 +9,4 @@ ALL CHANGES: TEZ-2985. Tez UI 2: Create loader and entity classes TEZ-3021. Tez UI 2: Add env service & initializer TEZ-3023. Tez UI 2: Abstract adapter and route + TEZ-3022. Tez UI 2: Add serializer & adapter for timeline server http://git-wip-us.apache.org/repos/asf/tez/blob/525ee51b/tez-ui2/src/main/webapp/app/adapters/timeline.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/adapters/timeline.js b/tez-ui2/src/main/webapp/app/adapters/timeline.js new file mode 100644 index 0000000..aba7e1e --- /dev/null +++ b/tez-ui2/src/main/webapp/app/adapters/timeline.js @@ -0,0 +1,23 @@ +/** + * 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 AbstractAdapter from './abstract'; + +export default AbstractAdapter.extend({ + serverName: "timeline", +}); http://git-wip-us.apache.org/repos/asf/tez/blob/525ee51b/tez-ui2/src/main/webapp/app/routes/abstract.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/routes/abstract.js b/tez-ui2/src/main/webapp/app/routes/abstract.js index d0f3c3d..3191762 100644 --- a/tez-ui2/src/main/webapp/app/routes/abstract.js +++ b/tez-ui2/src/main/webapp/app/routes/abstract.js @@ -80,6 +80,7 @@ export default Ember.Route.extend({ setValue: function (value) { this.set('loadedValue', value); this.set('isLoading', false); + return value; }, _setControllerModel: Ember.observer("_controller", "loadedValue", function () { http://git-wip-us.apache.org/repos/asf/tez/blob/525ee51b/tez-ui2/src/main/webapp/app/serializers/timeline.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/app/serializers/timeline.js b/tez-ui2/src/main/webapp/app/serializers/timeline.js new file mode 100644 index 0000000..8963dc2 --- /dev/null +++ b/tez-ui2/src/main/webapp/app/serializers/timeline.js @@ -0,0 +1,25 @@ +/** + * 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 LoaderSerializer from './loader'; + +export default LoaderSerializer.extend({ + extractArrayPayload: function (payload) { + return payload.entities; + } +}); http://git-wip-us.apache.org/repos/asf/tez/blob/525ee51b/tez-ui2/src/main/webapp/config/default-app-conf.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/config/default-app-conf.js b/tez-ui2/src/main/webapp/config/default-app-conf.js index c8f6dd9..51a2e81 100644 --- a/tez-ui2/src/main/webapp/config/default-app-conf.js +++ b/tez-ui2/src/main/webapp/config/default-app-conf.js @@ -35,4 +35,16 @@ module.exports = { // Tez App configurations cluster: 'cluster' }, }, + paths: { + timeline: { + dag: 'TEZ_DAG_ID', + vertex: 'TEZ_VERTEX_ID', + task: 'TEZ_TASK_ID', + taskAttempt: 'TEZ_TASK_ATTEMPT_ID', + + hiveQuery: 'HIVE_QUERY_ID', + + tezApp: 'TEZ_APPLICATION' + } + } }; http://git-wip-us.apache.org/repos/asf/tez/blob/525ee51b/tez-ui2/src/main/webapp/tests/unit/adapters/timeline-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/adapters/timeline-test.js b/tez-ui2/src/main/webapp/tests/unit/adapters/timeline-test.js new file mode 100644 index 0000000..9b1a8de --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/adapters/timeline-test.js @@ -0,0 +1,31 @@ +/** + * 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 { moduleFor, test } from 'ember-qunit'; + +moduleFor('adapter:timeline', 'Unit | Adapter | timeline', { + // Specify the other units that are required for this test. + // needs: ['serializer:foo'] +}); + +test('Basic creation test', function(assert) { + let adapter = this.subject(); + + assert.ok(adapter); + assert.equal(adapter.serverName, "timeline"); +}); http://git-wip-us.apache.org/repos/asf/tez/blob/525ee51b/tez-ui2/src/main/webapp/tests/unit/serializers/timeline-test.js ---------------------------------------------------------------------- diff --git a/tez-ui2/src/main/webapp/tests/unit/serializers/timeline-test.js b/tez-ui2/src/main/webapp/tests/unit/serializers/timeline-test.js new file mode 100644 index 0000000..53f0b06 --- /dev/null +++ b/tez-ui2/src/main/webapp/tests/unit/serializers/timeline-test.js @@ -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 { moduleFor, test } from 'ember-qunit'; + +moduleFor('serializer:timeline', 'Unit | Serializer | timeline', { + // Specify the other units that are required for this test. + // needs: ['serializer:timeline'] +}); + +test('Basic creation test', function(assert) { + let serializer = this.subject(); + + assert.ok(serializer); + assert.ok(serializer.extractArrayPayload); +}); + +test('extractArrayPayload test', function(assert) { + let serializer = this.subject(), + testPayload = { + entities: [] + }; + + assert.equal(serializer.extractArrayPayload(testPayload), testPayload.entities); +});