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 CC618971C for ; Thu, 22 Mar 2012 15:54:18 +0000 (UTC) Received: (qmail 14008 invoked by uid 500); 22 Mar 2012 15:54:18 -0000 Delivered-To: apmail-jackrabbit-oak-dev-archive@jackrabbit.apache.org Received: (qmail 13985 invoked by uid 500); 22 Mar 2012 15:54:18 -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 13977 invoked by uid 99); 22 Mar 2012 15:54:18 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2012 15:54:18 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of stefan.guggisberg@gmail.com designates 74.125.82.170 as permitted sender) Received: from [74.125.82.170] (HELO mail-we0-f170.google.com) (74.125.82.170) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Mar 2012 15:54:10 +0000 Received: by werh12 with SMTP id h12so4111250wer.1 for ; Thu, 22 Mar 2012 08:53:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=SQj7UudiHs5vXO5kyP99ekxVKzUYIKR/SVCg5KZHwMA=; b=gb96oN08Mph31NQ7+nIunmBbN4/TJGzAVeG21+39mfpR8m/kbEIzTYFgnOlMWwgRGk 16Yz58f3YbFRA1Tns+MXoWD5EkjAO+A9Vbkqraf9pjcixY7K78K36Ig6S04pP7taG2T4 e2ClBcCCIEDmNlhImlf3PlQ3QrSUFAKImsqW7YaWdkOi6biuU5NZ9MgLpSTxl+12NmUj ThjEnfrzsiBWEfbLCAjnERpYj2HtbrvmpmlPNUg6EMaAZiT6S7KydEC/xWMG8VZBSlIi pYvejYCE6ctnrOu12F10zI68lBmKwBlI61u5xLoV/orGGCH5gr+pVQgafYo9FjynozWz 2l4Q== MIME-Version: 1.0 Received: by 10.50.197.132 with SMTP id iu4mr2526356igc.74.1332431629737; Thu, 22 Mar 2012 08:53:49 -0700 (PDT) Received: by 10.42.174.1 with HTTP; Thu, 22 Mar 2012 08:53:49 -0700 (PDT) In-Reply-To: References: Date: Thu, 22 Mar 2012 16:53:49 +0100 Message-ID: Subject: Re: Value types supported by the MicroKernel From: Stefan Guggisberg To: oak-dev@jackrabbit.apache.org Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org On Thu, Mar 22, 2012 at 4:22 PM, Jukka Zitting wrote: > Hi, > > On Thu, Mar 22, 2012 at 3:04 PM, Stefan Guggisberg > wrote: >> On Wed, Mar 21, 2012 at 8:26 PM, Jukka Zitting wrote: >>> For oak-core (see OAK-33 [1]) we'd need a bit more detailed definition >>> of the supported value types. A few questions: >> >> the microkernel as currently implemented does not interpret property >> value types, it just stores the value token. > > Can we turn that into a harder API contract, i.e. one that should hold > true for any MK implementation? If not, we need to define the > boundaries of what oak-core can expect the MK to store reliably. We > don't need the answers right away, but ultimately this needs to be > defined for us to properly resolve OAK-33. ack and agreed. i am fine with specifying a harder api contract something along the lines of 'values are treated as opaque character sequences'. > > A related question, will a value like "\u0058" be considered equal to > "X" for example when merging concurrent changes? What about [ ] vs. [] > (i.e. extra whitespace within an empty array)? hmm, now it gets tricky... if the mk treats values as opaque character sequences it would consider the above examples non-equal. we'll have to see whether that's an issue. if it turns out to be an issue we'll have to provide for smarter merge-logic and perhaps some basic normalization (e.g. removing ws within arrays). > >>> 2) Are null values (the "null" keyword) supported? It would be nice if not. >> >> setting a property to null (e.g. ^"foo":null ) removes it (as in JCR). >> >> however, adding a node with null valued properties is currently possible. >> that should probably be fixed. > > OK, sounds good. So oak-core can treat a case like {"foo":null} being > returned from MicroKernel.getNodes() as an unexpected error, probably > caused by an administrator directly accessing the MicroKernel. > >>> 3) Are arrays (i.e. "[" ... "]") supported? If yes, are there >>> constraints on element types? It would be nice if arrays indeed were >>> supported. With the restriction that all elements are scalar values of >>> the same type. >> >> it does support arrays but doesn't enforce restrictions. >> >> the microkernel should IMO just support the basic json model. >> restrictions should be handled on a higher level. > > OK, cool. > >>> 4) Are there limits on number values? Most notably, can a number >>> that's larger than Long.MAX_VALUE be stored reliably (as a number)? >>> Larger than Double.MAX_VALUE? What about things like Double.NaN? Or >>> weirder, the other 2^51 NaN values allowed by IEEE754? >> >> whatever you pass in the commit is stored and returned as-is. >> as already mentioned, the value is (currently) not interpreted. > > OK. Can we get rid of the "(currently)" qualifier? Also, the "not > interpreted" part needs to be qualified in terms of things like > conflict merging. I'd be fine with "store and used as an opaque, > unparsed character sequence". i agree with that wording. cheers stefan > > Basically this means that in oak-core or -jcr we need to either a) not > support all possible Java double values or b) use some custom string > encoding for such values. I suppose a) is the better alternative, but > we need to check whether that will cause problems down the line. > >>> 6) Presumably strings are in Unicode. Are characters beyond the BMP >>> supported? Is it possible for a string value to contain a Unicode >>> non-character, for example U+FFFF? >> >> erm, haven't thought about that. do you think that there could be a problem? > > Like with the Double.NaN case, unless the underlying MicroKernel > supports the full range of characters, we need to consider adding some > extra level of encoding (possibly simply the \uNNNN escapes) on the > oak-core or -jcr level. But it sounds like this won't be needed. > > BR, > > Jukka Zitting