Return-Path: Delivered-To: apmail-incubator-cassandra-commits-archive@minotaur.apache.org Received: (qmail 40365 invoked from network); 9 May 2009 01:40:39 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 9 May 2009 01:40:39 -0000 Received: (qmail 86533 invoked by uid 500); 9 May 2009 01:40:39 -0000 Delivered-To: apmail-incubator-cassandra-commits-archive@incubator.apache.org Received: (qmail 86505 invoked by uid 500); 9 May 2009 01:40:39 -0000 Mailing-List: contact cassandra-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-dev@incubator.apache.org Delivered-To: mailing list cassandra-commits@incubator.apache.org Received: (qmail 86495 invoked by uid 99); 9 May 2009 01:40:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 May 2009 01:40:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 09 May 2009 01:40:37 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6DAF22388C22; Sat, 9 May 2009 01:40:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r773152 - in /incubator/cassandra/trunk/src/java/org/apache/cassandra: db/Memtable.java db/Table.java service/RangeVerbHandler.java Date: Sat, 09 May 2009 01:40:17 -0000 To: cassandra-commits@incubator.apache.org From: jbellis@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090509014017.6DAF22388C22@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jbellis Date: Sat May 9 01:40:16 2009 New Revision: 773152 URL: http://svn.apache.org/viewvc?rev=773152&view=rev Log: fix CME during range queries -- keyset call needs to go on the memtable exector. patch by jbellis; tested by Tv for CASSANDRA-153 Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java incubator/cassandra/trunk/src/java/org/apache/cassandra/service/RangeVerbHandler.java Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java?rev=773152&r1=773151&r2=773152&view=diff ============================================================================== --- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java (original) +++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Memtable.java Sat May 9 01:40:16 2009 @@ -399,9 +399,16 @@ } } - public Iterator sortedKeyIterator() + public Iterator sortedKeyIterator() throws ExecutionException, InterruptedException { - Set keys = columnFamilies_.keySet(); + Callable> callable = new Callable>() + { + public Set call() throws Exception + { + return columnFamilies_.keySet(); + } + }; + Set keys = executor_.submit(callable).get(); if (keys.size() == 0) { // cannot create a PQ of size zero (wtf?) Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java?rev=773152&r1=773151&r2=773152&view=diff ============================================================================== --- incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java (original) +++ incubator/cassandra/trunk/src/java/org/apache/cassandra/db/Table.java Sat May 9 01:40:16 2009 @@ -26,6 +26,7 @@ import java.io.FileNotFoundException; import java.util.concurrent.locks.Lock; import java.util.concurrent.locks.ReentrantLock; +import java.util.concurrent.ExecutionException; import org.apache.commons.collections.IteratorUtils; import org.apache.commons.collections.Predicate; @@ -870,7 +871,7 @@ * @param maxResults * @return list of keys between startWith and stopAt */ - public List getKeyRange(final String startWith, final String stopAt, int maxResults) throws IOException + public List getKeyRange(final String startWith, final String stopAt, int maxResults) throws IOException, ExecutionException, InterruptedException { // (OPP key decoration is a no-op so using the "decorated" comparator against raw keys is fine) final Comparator comparator = StorageService.getPartitioner().getDecoratedKeyComparator(); Modified: incubator/cassandra/trunk/src/java/org/apache/cassandra/service/RangeVerbHandler.java URL: http://svn.apache.org/viewvc/incubator/cassandra/trunk/src/java/org/apache/cassandra/service/RangeVerbHandler.java?rev=773152&r1=773151&r2=773152&view=diff ============================================================================== --- incubator/cassandra/trunk/src/java/org/apache/cassandra/service/RangeVerbHandler.java (original) +++ incubator/cassandra/trunk/src/java/org/apache/cassandra/service/RangeVerbHandler.java Sat May 9 01:40:16 2009 @@ -22,7 +22,7 @@ Table table = Table.open(command.table); keys = table.getKeyRange(command.startWith, command.stopAt, command.maxResults); } - catch (IOException e) + catch (Exception e) { throw new RuntimeException(e); }