Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 77BA0200AF7 for ; Tue, 14 Jun 2016 12:24:52 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 7643D160A47; Tue, 14 Jun 2016 10:24:52 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 98E0E1602C5 for ; Tue, 14 Jun 2016 12:24:51 +0200 (CEST) Received: (qmail 971 invoked by uid 500); 14 Jun 2016 10:24:50 -0000 Mailing-List: contact dev-help@zest.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zest.apache.org Delivered-To: mailing list dev@zest.apache.org Received: (qmail 957 invoked by uid 99); 14 Jun 2016 10:24:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 14 Jun 2016 10:24:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 222121805B4 for ; Tue, 14 Jun 2016 10:24:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.28 X-Spam-Level: * X-Spam-Status: No, score=1.28 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd3-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id sbHCWHNIvELG for ; Tue, 14 Jun 2016 10:24:47 +0000 (UTC) Received: from mail-oi0-f51.google.com (mail-oi0-f51.google.com [209.85.218.51]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with ESMTPS id 711235F1F7 for ; Tue, 14 Jun 2016 10:24:46 +0000 (UTC) Received: by mail-oi0-f51.google.com with SMTP id d132so145582257oig.1 for ; Tue, 14 Jun 2016 03:24:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=KAHUC6mqLT4SxAasd8xMsaB2hPng5SMoCjgHGFAIuBo=; b=Iq/r/1ys1PU60QvXtX5noFOiN4TFWOhecNzstpKyVTgleuME5vqBbWCYjdr1D9tbJ4 fi8sUwAcfp6sCpr4r8VjWRdpIOws4FkJaI6+7FZHr2qSa/BgngVDhli2hDVWeVsKBbAi IostciVSS37aku3DNh7zfPjyVu7DAf+37Z1oXG6/Gla8YuX9peqm2PzHnDg38Lgq1Ulz v8R83e67YGcp3OHIZeNOP93H3JlNnKuz+jxedfQiIGoDzGZ/a1jUzmW/fNuQAXmt2Fmk mnupNhK+GlKdWYSCU0K2R6pi72fJ6KBG7dpLAo8XBABnPdFVbzEwR9bQRlgxmeAryiSY 7knQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=KAHUC6mqLT4SxAasd8xMsaB2hPng5SMoCjgHGFAIuBo=; b=c7S07C1XL5gjw6XPFyJ7hfcFdmez/hfAT3+PMEQQ4llt3AxnJV/tvCRbVTRfWnRX9y hrq/a2WYoFJ6+i3ruonZLnV5tqD9LNd/vbI3SZ8RnkMqoqdTygkyD4VZYiO0tj+SGZiQ Xmj2uL7CO/1RPbtvZoBJZM//bOQ9fWLW2a/Tvp4FcjYYQnApumVgQMXGFWSoeZPX0bOx ouKxqQTiDqqxIoR/zlGt3I4mdHB4EtwbcVsSOh5n5fZalbvJy7B4NTM0UOKtqAG9Qajq vkLAck8DNyrg1OzlVd3KbGxAECIzMs4q8ZBXEsaU+KnS3QtAk5V4fyFcm0cm/HPDv99j Wzeg== X-Gm-Message-State: ALyK8tIHCr9RWVN92CV8a1bpwpd4StqDBwCdEp4jaN3g2dkNh4B0ALZVsRzJhPeVvjedeSGIlVHPIZ2IyfUyvg== X-Received: by 10.157.9.41 with SMTP id 38mr4490708otp.190.1465899878777; Tue, 14 Jun 2016 03:24:38 -0700 (PDT) MIME-Version: 1.0 Sender: hedhman@gmail.com Received: by 10.202.235.19 with HTTP; Tue, 14 Jun 2016 03:24:19 -0700 (PDT) In-Reply-To: References: From: Niclas Hedhman Date: Tue, 14 Jun 2016 18:24:19 +0800 X-Google-Sender-Auth: Qxf4yRKpB0Dj-y5xljr_6LnDUys Message-ID: Subject: =?UTF-8?B?UmU6IOWbnuWkje+8miBMYXJnZSBTY2FsZSBFbnRpdHkgU3RvcmUgRGF0YWJhc2U/?= To: dev Content-Type: multipart/alternative; boundary=94eb2c045bf28d0bcf05353a6942 archived-at: Tue, 14 Jun 2016 10:24:52 -0000 --94eb2c045bf28d0bcf05353a6942 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Ok, some research done... The "entity store lookup" disappeared a long time ago. The algorithm is approx. like this; 1. When UnitOfWork.get(Class type, String identity) (and other methods) the given type is searched in all visible Modules from the Module where the call is being made. 2. If found in a Module, an EntityStore is looked up from that Module's Visibility. 3. Entity is tried to be loaded. 4. If not successful, continue with next type found in search in step 1. 5. Return found entity, or NoSuchEntityException is thrown (might become different type at API level). AND since EntityStores are only looked up by Service Type (i.e. the EntityStore interface), you must ensure that only one ES is visible from each Module with different ES. Possibly do it within the Module, although that might be a bad idea (depends on where you are using this), so you might want additional layers... Cheers Niclas On Tue, Jun 14, 2016 at 6:04 PM, Niclas Hedhman wrote: > Good question.... > > I vaguely recall that there was some explicit "By Type" support, at least > somewhere in the past, but not sure if that is still the case. I would ne= ed > to look at code, and possibly mail archives to clarify that. > > But yes, Visibility is definitely possible, although can be tricky to set > that up. > > Niclas > > On Tue, Jun 14, 2016 at 5:58 PM, zhuangmz08 wrote: > >> How can I use multi-ES in my app, by setting diffrent visibility to ES >> service? >> If I want to place 3 kinds of entity into 3 ES service, I must define 3 >> diffrent zest module each expose to one ES service? >> >> >> >> >> ------------------ =E5=8E=9F=E5=A7=8B=E9=82=AE=E4=BB=B6 ----------------= -- >> =E5=8F=91=E4=BB=B6=E4=BA=BA: "Niclas Hedhman";; >> =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2016=E5=B9=B46=E6=9C=8814=E6=97=A5= (=E6=98=9F=E6=9C=9F=E4=BA=8C) =E4=B8=8B=E5=8D=885:39 >> =E6=94=B6=E4=BB=B6=E4=BA=BA: "dev"; >> >> =E4=B8=BB=E9=A2=98: Re: =E5=9B=9E=E5=A4=8D=EF=BC=9A Large Scale Entity S= tore Database? >> >> >> >> If you look at >> https://zest.apache.org/java/develop/thirty-minutes-intro.html >> >> >> QueryBuilder builder =3D queryBuilderFactory.newQueryBuilder( Ord= er. >> class ); >> >> Calendar cal =3D Calendar.getInstance(); >> cal.setTime( new Date() ); >> cal.roll( Calendar.DAY_OF_MONTH, -90 ); >> Date last90days =3D cal.getTime(); >> Order template =3D templateFor( Order.class ); >> builder.where( gt( template.createdDate(), last90days ) ); >> Query query =3D uow.newQuery(builder); >> >> for( Order order : query ) >> { >> report.addOrderToReport( order ); >> } >> >> >> As you can see, the Query will return the Order instances from the point >> of >> view of the programmer (you), but under the hood, the Query executed >> (once) >> will return an Identity collection, but disguised as the objects, and wh= en >> you access them, they will be retrieved from the entity store. >> >> A consequence I forgot to mention is that you can possibly have multiple >> Entity Stores in your application, and yet only have a single Indexer, >> query across those stores, and still get it working. Say, you have an LD= AP >> store for User and something else for Order, the query could still be >> something like; >> >> QueryBuilder builder =3D queryBuilderFactory.newQueryBuilder( Ord= er. >> class ); >> >> Order template =3D templateFor( Order.class ); >> builder.where( eq( template.enteredBy(), userOfInterest ) ); >> Query query =3D uow.newQuery(builder); >> >> for( Order order : query ) >> { >> report.addOrderToReport( order ); >> } >> >> >> where "userOfInterest" is an Entity in the LDAP store. That should work.= .. >> >> >> Cheers >> Niclas >> >> On Tue, Jun 14, 2016 at 3:33 PM, zhuangmz08 wrote: >> >> > Hi, Paul, >> > >> > >> > Thanks for your sharing. >> > >> > >> > 1. >> > I've been tesing :) >> > Mongo ES and RDF File engine. >> > It took 101 seconds to write and index 10000 quite symple entities and >> > took 6 second to read this entities. [i5-4200U, 8GB RAM, SSD on Win10] >> > I feel it's too slow.. >> > >> > >> > 2. >> > So, index/query engine just figure out the Identities accoring to my >> > query. And then ask the ES to get the extract entities accoring to the >> > Identities. >> > >> > >> > ------------------ =E5=8E=9F=E5=A7=8B=E9=82=AE=E4=BB=B6 --------------= ---- >> > =E5=8F=91=E4=BB=B6=E4=BA=BA: "Paul Merlin";; >> > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2016=E5=B9=B46=E6=9C=8814=E6=97= =A5(=E6=98=9F=E6=9C=9F=E4=BA=8C) =E4=B8=8B=E5=8D=883:17 >> > =E6=94=B6=E4=BB=B6=E4=BA=BA: "dev"; >> > >> > =E4=B8=BB=E9=A2=98: Re: =E5=9B=9E=E5=A4=8D=EF=BC=9A Large Scale Entity= Store Database? >> > >> > >> > >> > Hi, >> > >> > zhuangmz08 a =C3=A9crit : >> > > Hi, >> > > >> > > >> > > OK, writing entities and reading entities are separated both theroy >> and >> > physical implementation. >> > >> > Entities are written *and* fetched from EntityStores. >> > Entities are indexed into index/query engines. >> > Queries are resolved by index/query engines that only returns >> > identities, used to fetch the actual entities from EntityStores. >> > >> > > 1. It's acceptable to occupy large storage space (Disk is cheap). >> > > All entities are stored in a SINGLE table of the SQL database or in = a >> > SINGLE collection of the SINGLE database in Mongo. >> > > What's the key factors on writing? Which MapEntityStore is faster in >> > writing entities? I mean, which is better for production use. >> > Just like Niclas said, most of the EntityStores are based on >> > JSONMapEntityStore, so they are built as simple key/value stores >> > whichever is the underlying storage system. SQL ES use a single table, >> > Mongo ES use a single collection and so on. Which one is best for your >> > use case depends on your application and deployment constraints. I >> > successfuly used File ES, SQL ES, Mongo ES and Redis ES in production, >> > YMMV. >> > >> > > 2. Reading speed is related to the Indexer? I know something about >> > search engine (Apache Solr). Could you explain more about the querying= . >> > When the query string matched some index, how will they interact with >> the >> > entity database? Do we need to query the Entity database internally? I >> > would like to know the factors impacting read speed. >> > > Which is better for production use, OpenRDF or ElasticSearch? >> > >> > Indexing and querying speed is related to the Index/Query engine. >> > Fetching speed is related to the EntityStore. >> > >> > In any case, I'd suggest that you run speed/load tests on your >> > application. Zest strength here is that you can cheaply change your >> > EntityStore / Index/Query engines. >> > >> > HTH >> > >> > /Paul >> > >> >> >> >> -- >> Niclas Hedhman, Software Developer >> http://zest.apache.org - New Energy for Java >> > > > > -- > Niclas Hedhman, Software Developer > http://zest.apache.org - New Energy for Java > --=20 Niclas Hedhman, Software Developer http://zest.apache.org - New Energy for Java --94eb2c045bf28d0bcf05353a6942--