Return-Path: X-Original-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Delivered-To: apmail-jackrabbit-oak-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DC7DD9B72 for ; Fri, 13 Apr 2012 15:25:55 +0000 (UTC) Received: (qmail 422 invoked by uid 500); 13 Apr 2012 15:25:55 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 389 invoked by uid 500); 13 Apr 2012 15:25:55 -0000 Mailing-List: contact oak-dev-help@jackrabbit.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: oak-dev@jackrabbit.apache.org Delivered-To: mailing list oak-dev@jackrabbit.apache.org Received: (qmail 378 invoked by uid 99); 13 Apr 2012 15:25:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Apr 2012 15:25:55 +0000 X-ASF-Spam-Status: No, hits=-1.6 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [64.18.1.187] (HELO exprod6og104.obsmtp.com) (64.18.1.187) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Apr 2012 15:25:48 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob104.postini.com ([64.18.5.12]) with SMTP ID DSNKT4hFZruucY6gIV1PJYhGX4yPB3GVw47i@postini.com; Fri, 13 Apr 2012 08:25:27 PDT Received: from inner-relay-4.eur.adobe.com (inner-relay-4b [10.128.4.237]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id q3DFPPaW016129 for ; Fri, 13 Apr 2012 08:25:25 -0700 (PDT) Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99]) by inner-relay-4.eur.adobe.com (8.12.10/8.12.9) with ESMTP id q3DFPKYu008173 for ; Fri, 13 Apr 2012 08:25:24 -0700 (PDT) Received: from eurcas01.eur.adobe.com (10.128.4.27) by nacas01.corp.adobe.com (10.8.189.99) with Microsoft SMTP Server (TLS) id 8.3.192.1; Fri, 13 Apr 2012 08:25:23 -0700 Received: from susi.local (10.136.134.179) by eurcas01.eur.adobe.com (10.128.4.111) with Microsoft SMTP Server id 8.3.192.1; Fri, 13 Apr 2012 16:25:20 +0100 Message-ID: <4F884560.4090507@apache.org> Date: Fri, 13 Apr 2012 16:25:20 +0100 From: =?ISO-8859-1?Q?Michael_D=FCrig?= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:11.0) Gecko/20120327 Thunderbird/11.0.1 MIME-Version: 1.0 To: Subject: Re: Encoding of JCR values in json References: In-Reply-To: Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit On 13.4.12 14:40, Thomas Mueller wrote: > Hi, > >>> An alternative might be: numbers with an "e" are double ("10e0"), numbers >>> with a dot are decimal ("10.0"), all other numbers are long ("10"). But >>> that would require the MicroKernel stores the *exact* JSON >>> representation. >>> I don't think that's a good idea either. >> >> The underlying storage mechanism must not be of concern to the user of >> the Microkernel API. The Microkernel API uses JSON to transport values. >> So the Microkernel implementation is in charge of serializing these into >> a format suitable for the underlying storage mechanism. Even if I put a >> number with 10 Million digits into a JSON property. > > I think we should not rely on the MicroKernel implementation to support > unlimited precision numbers. For example MongoDB only supports IEEE 754 > floating point numbers, as defined by the BSON spec: > http://en.wikipedia.org/wiki/BSON - so we can't store BigDecimal as a JSON > number, because we would risk losing precision. > > Also, I would not rely on the MicroKernel implementation to preserve the > exact JSON representation. If we store the number as 100.00, we should not > rely on getting 100.00 back. We might as well get 100.0 or 100 back. > > We should document this in the MicroKernel specification. The JSON > specification itself doesn't define such details. And this should be done rather sooner than later. > >> How could the GC possible know whether a >> binary is still in use or not? >> String blobId = mk.write(inStream); >> >> and write the returned blobId on a piece of paper. According to the >> current Microkernel contract I could come back after a couple of years >> and would still be able to retrieve that blob. > > Yes, we need to narrow the contract. Again, we'd rather be quick here. Michael > > Regards, > Thomas > >