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 96AD6200CDF for ; Thu, 17 Aug 2017 20:19:46 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 93A6D16B6F4; Thu, 17 Aug 2017 18:19:46 +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 D816516B6F2 for ; Thu, 17 Aug 2017 20:19:45 +0200 (CEST) Received: (qmail 46199 invoked by uid 500); 17 Aug 2017 18:19:43 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 46187 invoked by uid 99); 17 Aug 2017 18:19:43 -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; Thu, 17 Aug 2017 18:19:43 +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 99B001806B7 for ; Thu, 17 Aug 2017 18:19:42 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.174 X-Spam-Level: ** X-Spam-Status: No, score=2.174 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_NONE=-0.0001, SPF_SOFTFAIL=0.972, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-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 mkDV51jjDHfY for ; Thu, 17 Aug 2017 18:19:41 +0000 (UTC) Received: from mwork.nabble.com (mwork.nabble.com [162.253.133.43]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 6D4F05FB51 for ; Thu, 17 Aug 2017 18:19:41 +0000 (UTC) Received: from static.162.255.23.37.macminivault.com (unknown [162.255.23.37]) by mwork.nabble.com (Postfix) with ESMTP id BAB605D092F6A for ; Thu, 17 Aug 2017 11:19:40 -0700 (MST) Date: Thu, 17 Aug 2017 11:19:40 -0700 (MST) From: Chris Berry To: user@ignite.apache.org Message-ID: <1502993980758-16259.post@n6.nabble.com> In-Reply-To: <1502985345267-16255.post@n6.nabble.com> References: <1502925783272-16242.post@n6.nabble.com> <1502985345267-16255.post@n6.nabble.com> Subject: Re: getAsMap ?? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable archived-at: Thu, 17 Aug 2017 18:19:46 -0000 Thank you for the speedy reply. I found that same information when I dug deeper last night. And after working thru the annoying IncompatibleClassChangeError issue and mismatched H2 classes, I got it working. For posterity, I ended up with this: public Set getCacheKeys() { String tableName =3D valueClass.getSimpleName(); SqlFieldsQuery qry =3D new SqlFieldsQuery("select _key from " + tableName); Collection> res =3D igniteCacheHandle.query(qry).getAll= (); Set keys =3D new HashSet<>(); for(List row : res) { keys.add((TKey)row.get(0)); } return keys; } Using a SqlFieldsQuery. And I use it like this: public List findMatches(SearchTerms searchTerms) { Map map =3D cache.getAll(cache.getCacheKeys()); return matchingStrategy.match(map, searchTerms); } Which is pretty inefficient I think. But I wanted to get something working= =E2=80=A6. I have a few questions. 1) I have only one REPLICATED cache =E2=80=93 out of many caches -- that I = need to do a Query against. The rest are all used as simple KV stores. Have I introduced an inefficiency by introducing the ignite-indexing module?? Is there a way to use it ONLY for 1 cache?? Or is indexing always present, and I have just now become aware of it?? (This seems unlikely since the H2 DB issue should have bitten me sooner??) 2) Would it be more efficient to use a ScanQuery?? Or is the SqlFieldsQuery roughly equivalent?? NOTE: I assume to do this whole thing more efficiently I would use a ScanQuery with a Filter?? Which would eliminate the need for the interim copies. 3) I am using: igniteConfig.setMarshaller(new BinaryMarshaller()) -- paired with: cache.withKeepBinary() Do I need to do anything special in this case?? Presently it seems not??=20 I am using only this: igniteCacheConfig.setIndexedTypes(keyClass, valueClass); And it all is working as expected. Still. If I used IgniteBiPredictae would it be more efficient ?? Thanks agaian for your help. Cheers,=20 -- Chris=20 -- View this message in context: http://apache-ignite-users.70518.x6.nabble.co= m/getAsMap-tp16242p16259.html Sent from the Apache Ignite Users mailing list archive at Nabble.com.