accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject svn commit: r1229741 - in /incubator/accumulo/trunk: ./ src/core/ src/examples/src/main/java/org/apache/accumulo/examples/shard/ContinuousQuery.java src/server/
Date Tue, 10 Jan 2012 21:13:44 GMT
Author: kturner
Date: Tue Jan 10 21:13:43 2012
New Revision: 1229741

URL: http://svn.apache.org/viewvc?rev=1229741&view=rev
Log:
ACCUMULO-281 Fixed array index out of bound and batch scanner usage in shard continuous query
example (merged from 1.4)

Modified:
    incubator/accumulo/trunk/   (props changed)
    incubator/accumulo/trunk/src/core/   (props changed)
    incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/ContinuousQuery.java
    incubator/accumulo/trunk/src/server/   (props changed)

Propchange: incubator/accumulo/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 10 21:13:43 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611,1228195
 /incubator/accumulo/branches/1.3.5rc:1209938
-/incubator/accumulo/branches/1.4:1201902-1228245,1228308,1229205,1229220,1229248,1229357,1229424,1229427-1229428,1229588,1229651,1229699
+/incubator/accumulo/branches/1.4:1201902-1228245,1228308,1229205,1229220,1229248,1229357,1229424,1229427-1229428,1229588,1229651,1229699,1229738

Propchange: incubator/accumulo/trunk/src/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 10 21:13:43 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3/src/core:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215
 /incubator/accumulo/branches/1.3.5rc/src/core:1209938
-/incubator/accumulo/branches/1.4/src/core:1201902-1228245,1228308,1229205,1229220,1229248,1229357,1229424,1229427-1229428,1229588,1229651,1229699
+/incubator/accumulo/branches/1.4/src/core:1201902-1228245,1228308,1229205,1229220,1229248,1229357,1229424,1229427-1229428,1229588,1229651,1229699,1229738

Modified: incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/ContinuousQuery.java
URL: http://svn.apache.org/viewvc/incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/ContinuousQuery.java?rev=1229741&r1=1229740&r2=1229741&view=diff
==============================================================================
--- incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/ContinuousQuery.java
(original)
+++ incubator/accumulo/trunk/src/examples/src/main/java/org/apache/accumulo/examples/shard/ContinuousQuery.java
Tue Jan 10 21:13:43 2012
@@ -43,7 +43,7 @@ import org.apache.hadoop.io.Text;
 public class ContinuousQuery {
   public static void main(String[] args) throws Exception {
     
-    if (args.length < 7) {
+    if (args.length != 7 && args.length != 8) {
       System.err.println("Usage : " + ContinuousQuery.class.getName()
           + " <instance> <zoo keepers> <shard table> <doc2word table>
<user> <pass> <num query terms> [iterations]");
       System.exit(-1);
@@ -57,7 +57,7 @@ public class ContinuousQuery {
     String pass = args[5];
     int numTerms = Integer.parseInt(args[6]);
     long iterations = Long.MAX_VALUE;
-    if (args.length >= 7)
+    if (args.length > 7)
       iterations = Long.parseLong(args[7]);
     
     ZooKeeperInstance zki = new ZooKeeperInstance(instance, zooKeepers);
@@ -67,10 +67,14 @@ public class ContinuousQuery {
     
     Random rand = new Random();
     
+    BatchScanner bs = conn.createBatchScanner(table, Constants.NO_AUTHS, 20);
+
     for (long i = 0; i < iterations; i += 1) {
       Text[] columns = randTerms.get(rand.nextInt(randTerms.size()));
       
-      BatchScanner bs = conn.createBatchScanner(table, Constants.NO_AUTHS, 20);
+      bs.clearScanIterators();
+      bs.clearColumns();
+
       IteratorSetting ii = new IteratorSetting(20, "ii", IntersectingIterator.class);
       IntersectingIterator.setColumnFamilies(ii, columns);
       bs.addScanIterator(ii);
@@ -85,9 +89,10 @@ public class ContinuousQuery {
       long t2 = System.currentTimeMillis();
       
       System.out.printf("  %s %,d %6.3f\n", Arrays.asList(columns), count, (t2 - t1) / 1000.0);
-      
     }
     
+    bs.close();
+
   }
   
   private static ArrayList<Text[]> findRandomTerms(Scanner scanner, int numTerms) {

Propchange: incubator/accumulo/trunk/src/server/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jan 10 21:13:43 2012
@@ -1,3 +1,3 @@
 /incubator/accumulo/branches/1.3/src/server:1190280,1190413,1190420,1190427,1190500,1195622,1195625,1195629,1195635,1196044,1196054,1196057,1196071-1196072,1196106,1197066,1198935,1199383,1203683,1204625,1205547,1205880,1206169,1208031,1209124,1209526,1209532,1209539,1209541,1209587,1209657,1210518,1210571,1210596,1210598,1213424,1214320,1225006,1227215,1227231,1227611
 /incubator/accumulo/branches/1.3.5rc/src/server:1209938
-/incubator/accumulo/branches/1.4/src/server:1201902-1228245,1228308,1229205,1229220,1229248,1229357,1229424,1229427-1229428,1229588,1229651,1229699
+/incubator/accumulo/branches/1.4/src/server:1201902-1228245,1228308,1229205,1229220,1229248,1229357,1229424,1229427-1229428,1229588,1229651,1229699,1229738



Mime
View raw message