Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 992D618B15 for ; Tue, 21 Jul 2015 03:18:06 +0000 (UTC) Received: (qmail 1530 invoked by uid 500); 21 Jul 2015 03:18:05 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 1448 invoked by uid 500); 21 Jul 2015 03:18:05 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 1086 invoked by uid 99); 21 Jul 2015 03:18:05 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 21 Jul 2015 03:18:05 +0000 Date: Tue, 21 Jul 2015 03:18:05 +0000 (UTC) From: "Walter Su (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HDFS-8779) WebUI can't display randomly generated block ID MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-8779?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Walter Su updated HDFS-8779: ---------------------------- Attachment: HDFS-8779.04.patch patch-to-json-parse.txt Thanks [~wheat9] for the idea. json-bigint doesn't have a front-end version. The author gives a browserify version in [here|http://stackoverflow.com/questions/18755125/node-js-is-there-any-proper-way-to-parse-json-with-large-numbers-long-bigint] The file is up to 79kb. Since both [BigNumber|https://github.com/MikeMcl/bignumber.js] and [JSON-js|https://github.com/douglascrockford/JSON-js] have a front-end version. I re-create the file using the idea of json-bigint: I simply add 2 lines to JSON-js library ( that's how json-bigint does): {code} + if (string.length > 15) + return new BigNumber(string); {code} {{patch-to-json-parse.txt}} shows that. I didn't change anything to {{BigNumber}}. Uploaded 04 patch, tested in chrome/ie11/firefox. I still prefer 03 patch because it's simple. Both works for me. > WebUI can't display randomly generated block ID > ----------------------------------------------- > > Key: HDFS-8779 > URL: https://issues.apache.org/jira/browse/HDFS-8779 > Project: Hadoop HDFS > Issue Type: Bug > Components: webhdfs > Reporter: Walter Su > Assignee: Walter Su > Priority: Minor > Attachments: HDFS-8779.01.patch, HDFS-8779.02.patch, HDFS-8779.03.patch, HDFS-8779.04.patch, after-02-patch.png, before.png, patch-to-json-parse.txt > > > Old release use randomly generated block ID(HDFS-4645). > max value of Long in Java is 2^63-1 > max value of number in Javascript is 2^53-1. ( See [Link|https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER]) > Which means almost every randomly generated block ID exceeds MAX_SAFE_INTEGER. > A integer which exceeds MAX_SAFE_INTEGER cannot be represented in Javascript. -- This message was sent by Atlassian JIRA (v6.3.4#6332)