You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ak...@apache.org on 2019/01/11 10:39:44 UTC

[ignite] branch master updated: IGNITE-10076 Web Console: Use slow 'json-bigint' parser only for queries.

This is an automated email from the ASF dual-hosted git repository.

akuznetsov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git


The following commit(s) were added to refs/heads/master by this push:
     new 9ba0052  IGNITE-10076 Web Console: Use slow 'json-bigint' parser only for queries.
9ba0052 is described below

commit 9ba0052e4b8b793ff9d2093293e33eaf1f206fca
Author: Alexey Kuznetsov <ak...@apache.org>
AuthorDate: Fri Jan 11 17:38:55 2019 +0700

    IGNITE-10076 Web Console: Use slow 'json-bigint' parser only for queries.
---
 .../frontend/app/modules/agent/AgentManager.service.js           | 9 +++++++--
 .../web-console/frontend/app/modules/agent/decompress.worker.js  | 6 ++++--
 2 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/modules/web-console/frontend/app/modules/agent/AgentManager.service.js b/modules/web-console/frontend/app/modules/agent/AgentManager.service.js
index 0c0d9b6..faf0672 100644
--- a/modules/web-console/frontend/app/modules/agent/AgentManager.service.js
+++ b/modules/web-console/frontend/app/modules/agent/AgentManager.service.js
@@ -487,8 +487,13 @@ export default class AgentManager {
                         if (cluster.secured)
                             this.clustersSecrets.get(cluster.id).sessionToken = res.sessionToken;
 
-                        if (res.zipped)
-                            return this.pool.postMessage(res.data);
+                        if (res.zipped) {
+                            const taskId = _.get(params, 'taskId', '');
+
+                            const useBigIntJson = taskId.startsWith('query');
+
+                            return this.pool.postMessage({payload: res.data, useBigIntJson});
+                        }
 
                         return res;
 
diff --git a/modules/web-console/frontend/app/modules/agent/decompress.worker.js b/modules/web-console/frontend/app/modules/agent/decompress.worker.js
index 2fd294d..deffca3 100644
--- a/modules/web-console/frontend/app/modules/agent/decompress.worker.js
+++ b/modules/web-console/frontend/app/modules/agent/decompress.worker.js
@@ -24,11 +24,13 @@ import bigIntJSON from 'json-bigint';
 onmessage = function(e) {
     const data = e.data;
 
-    const binaryString = atob(data); // Decode from BASE64
+    const binaryString = atob(data.payload); // Decode from BASE64
 
     const unzipped = pako.inflate(binaryString, {to: 'string'});
 
-    const res = bigIntJSON({storeAsString: true}).parse(unzipped);
+    const res = data.useBigIntJson
+        ? bigIntJSON({storeAsString: true}).parse(unzipped)
+        : JSON.parse(unzipped);
 
     postMessage(_.get(res, 'result', res));
 };