accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bil...@apache.org
Subject svn commit: r1366053 - in /accumulo/trunk: core/src/main/java/org/apache/accumulo/core/client/mapreduce/ core/src/main/java/org/apache/accumulo/core/data/ core/src/main/java/org/apache/accumulo/core/iterators/user/ core/src/test/java/org/apache/accumul...
Date Thu, 26 Jul 2012 15:45:31 GMT
Author: billie
Date: Thu Jul 26 15:45:31 2012
New Revision: 1366053

URL: http://svn.apache.org/viewvc?rev=1366053&view=rev
Log:
ACCUMULO-653 switched some comparisons to equals

Modified:
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/Range.java
    accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/ClientSideIteratorTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
    accumulo/trunk/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
    accumulo/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/BooleanLogicIterator.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/MultiReader.java
    accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/randomwalk/shard/VerifyIndex.java

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java?rev=1366053&r1=1366052&r2=1366053&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/client/mapreduce/InputFormatBase.java
Thu Jul 26 15:45:31 2012
@@ -1078,13 +1078,13 @@ public abstract class InputFormatBase<K,
       if (currentKey == null)
         return 0f;
       if (range.getStartKey() != null && range.getEndKey() != null) {
-        if (range.getStartKey().compareTo(range.getEndKey(), PartialKey.ROW) != 0) {
+        if (!range.getStartKey().equals(range.getEndKey(), PartialKey.ROW)) {
           // just look at the row progress
           return getProgress(range.getStartKey().getRowData(), range.getEndKey().getRowData(),
currentKey.getRowData());
-        } else if (range.getStartKey().compareTo(range.getEndKey(), PartialKey.ROW_COLFAM)
!= 0) {
+        } else if (!range.getStartKey().equals(range.getEndKey(), PartialKey.ROW_COLFAM))
{
           // just look at the column family progress
           return getProgress(range.getStartKey().getColumnFamilyData(), range.getEndKey().getColumnFamilyData(),
currentKey.getColumnFamilyData());
-        } else if (range.getStartKey().compareTo(range.getEndKey(), PartialKey.ROW_COLFAM_COLQUAL)
!= 0) {
+        } else if (!range.getStartKey().equals(range.getEndKey(), PartialKey.ROW_COLFAM_COLQUAL))
{
           // just look at the column qualifier progress
           return getProgress(range.getStartKey().getColumnQualifierData(), range.getEndKey().getColumnQualifierData(),
currentKey.getColumnQualifierData());
         }

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/Range.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/Range.java?rev=1366053&r1=1366052&r2=1366053&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/Range.java (original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/data/Range.java Thu Jul 26
15:45:31 2012
@@ -364,7 +364,7 @@ public class Range implements WritableCo
         startKeysEqual = true;
       } else if (currentRange.infiniteStartKey) {
         startKeysEqual = false;
-      } else if (currentRange.start.compareTo(range.start) == 0) {
+      } else if (currentRange.start.equals(range.start)) {
         startKeysEqual = true;
       } else {
         startKeysEqual = false;

Modified: accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java?rev=1366053&r1=1366052&r2=1366053&view=diff
==============================================================================
--- accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java
(original)
+++ accumulo/trunk/core/src/main/java/org/apache/accumulo/core/iterators/user/IndexedDocIterator.java
Thu Jul 26 15:45:31 2012
@@ -31,7 +31,6 @@ import org.apache.accumulo.core.data.Ran
 import org.apache.accumulo.core.data.Value;
 import org.apache.accumulo.core.iterators.IteratorEnvironment;
 import org.apache.accumulo.core.iterators.SortedKeyValueIterator;
-import org.apache.accumulo.core.iterators.user.IntersectingIterator.TermSource;
 import org.apache.hadoop.io.Text;
 
 /**
@@ -162,7 +161,7 @@ public class IndexedDocIterator extends 
     Key docKey = buildDocKey();
     docSource.seek(new Range(docKey, true, null, false), docColfSet, true);
     log.debug("got doc key: " + docSource.getTopKey().toString());
-    if (docSource.hasTop() && docKey.compareTo(docSource.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL)
== 0) {
+    if (docSource.hasTop() && docKey.equals(docSource.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL))
{
       value = docSource.getTopValue();
     }
     log.debug("got doc value: " + value.toString());

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/ClientSideIteratorTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/ClientSideIteratorTest.java?rev=1366053&r1=1366052&r2=1366053&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/ClientSideIteratorTest.java
(original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/client/ClientSideIteratorTest.java
Thu Jul 26 15:45:31 2012
@@ -56,7 +56,7 @@ public class ClientSideIteratorTest {
   public void checkResults(Iterable<Entry<Key,Value>> scanner, List<Key>
results, PartialKey pk) {
     int i = 0;
     for (Entry<Key,Value> entry : scanner) {
-      assertTrue(0 == entry.getKey().compareTo(results.get(i++), pk));
+      assertTrue(entry.getKey().equals(results.get(i++), pk));
     }
     assertEquals(i, results.size());
   }

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java?rev=1366053&r1=1366052&r2=1366053&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java (original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/data/KeyTest.java Thu Jul 26
15:45:31 2012
@@ -27,8 +27,8 @@ public class KeyTest extends TestCase {
     Key k3 = new Key("r1".getBytes(), "cf".getBytes(), "cq".getBytes(), new byte[0], 0, true);
     Key k4 = new Key("r1".getBytes(), "cf".getBytes(), "cq".getBytes(), new byte[0], 0, true);
     
-    assertTrue(k1.compareTo(k2) == 0);
-    assertTrue(k3.compareTo(k4) == 0);
+    assertTrue(k1.equals(k2));
+    assertTrue(k3.equals(k4));
     assertTrue(k1.compareTo(k3) > 0);
     assertTrue(k3.compareTo(k1) < 0);
   }

Modified: accumulo/trunk/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java?rev=1366053&r1=1366052&r2=1366053&view=diff
==============================================================================
--- accumulo/trunk/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java (original)
+++ accumulo/trunk/core/src/test/java/org/apache/accumulo/core/file/rfile/RFileTest.java Thu
Jul 26 15:45:31 2012
@@ -138,7 +138,7 @@ public class RFileTest extends TestCase 
         
       }
       
-      if (reader.getLastKey().compareTo(lastKey) != 0) {
+      if (!reader.getLastKey().equals(lastKey)) {
         throw new RuntimeException("Last key out of order " + reader.getLastKey() + " " +
lastKey);
       }
     }

Modified: accumulo/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/BooleanLogicIterator.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/BooleanLogicIterator.java?rev=1366053&r1=1366052&r2=1366053&view=diff
==============================================================================
--- accumulo/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/BooleanLogicIterator.java
(original)
+++ accumulo/trunk/examples/wikisearch/query/src/main/java/org/apache/accumulo/examples/wikisearch/iterator/BooleanLogicIterator.java
Thu Jul 26 15:45:31 2012
@@ -1654,7 +1654,7 @@ public class BooleanLogicIterator implem
           node.setValid(false);
           if (testTreeState()) {
             // it's valid set nextKey and make sure it's not the same as topKey.
-            if (topKey.compareTo(this.root.getTopKey()) != 0) {
+            if (!topKey.equals(this.root.getTopKey())) {
               // topKey = this.root.getTopKey();
               if (this.overallRange != null) {
                 if (this.overallRange.contains(root.getTopKey())) {

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/MultiReader.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/MultiReader.java?rev=1366053&r1=1366052&r2=1366053&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/MultiReader.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/tabletserver/log/MultiReader.java
Thu Jul 26 15:45:31 2012
@@ -26,9 +26,9 @@ import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.io.DataInputBuffer;
 import org.apache.hadoop.io.DataOutputBuffer;
+import org.apache.hadoop.io.MapFile.Reader;
 import org.apache.hadoop.io.Writable;
 import org.apache.hadoop.io.WritableComparable;
-import org.apache.hadoop.io.MapFile.Reader;
 
 /**
  * Provide simple Map.Reader methods over multiple Maps.
@@ -135,7 +135,7 @@ public class MultiReader {
       Index index = (Index) obj;
       try {
         WritableComparable found = index.reader.getClosest(key, index.value, true);
-        if (found != null && found.compareTo(key) == 0) {
+        if (found != null && found.equals(key)) {
           result = true;
         }
       } catch (EOFException ex) {

Modified: accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/randomwalk/shard/VerifyIndex.java
URL: http://svn.apache.org/viewvc/accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/randomwalk/shard/VerifyIndex.java?rev=1366053&r1=1366052&r2=1366053&view=diff
==============================================================================
--- accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/randomwalk/shard/VerifyIndex.java
(original)
+++ accumulo/trunk/server/src/main/java/org/apache/accumulo/server/test/randomwalk/shard/VerifyIndex.java
Thu Jul 26 15:45:31 2012
@@ -51,7 +51,7 @@ public class VerifyIndex extends Test {
       Key key1 = entry.getKey();
       Key key2 = iter.next().getKey();
       
-      if (key1.compareTo(key2, PartialKey.ROW_COLFAM_COLQUAL) != 0)
+      if (!key1.equals(key2, PartialKey.ROW_COLFAM_COLQUAL))
         throw new Exception("index rebuild mismatch " + key1 + " " + key2 + " " + indexTableName
+ " " + tmpIndexTableName);
       count++;
       if (count % 1000 == 0)



Mime
View raw message