hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raw...@apache.org
Subject svn commit: r952486 - in /hbase/branches/0.20/src: java/org/apache/hadoop/hbase/regionserver/ test/org/apache/hadoop/hbase/regionserver/
Date Mon, 07 Jun 2010 23:41:20 GMT
Author: rawson
Date: Mon Jun  7 23:41:20 2010
New Revision: 952486

URL: http://svn.apache.org/viewvc?rev=952486&view=rev
Log:
debug code to figure out why builds fail on hudson

Modified:
    hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/DebugPrint.java
    hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
    hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/MemStore.java
    hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
    hbase/branches/0.20/src/test/org/apache/hadoop/hbase/regionserver/TestHRegion.java

Modified: hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/DebugPrint.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/DebugPrint.java?rev=952486&r1=952485&r2=952486&view=diff
==============================================================================
--- hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/DebugPrint.java (original)
+++ hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/DebugPrint.java Mon
Jun  7 23:41:20 2010
@@ -51,7 +51,7 @@ private static final AtomicBoolean enabl
 
   public static void println(String m) {
     if (!enabled.get()) {
-      System.out.println(m);
+      //System.out.println(m);
       return;
     }
     

Modified: hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=952486&r1=952485&r2=952486&view=diff
==============================================================================
--- hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java (original)
+++ hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java Mon Jun
 7 23:41:20 2010
@@ -1825,7 +1825,7 @@ public class HRegion implements HConstan
     private long readPt;
 
     RegionScanner(Scan scan, List<KeyValueScanner> additionalScanners) {
-      //DebugPrint.println("HRegionScanner.<init>");
+      DebugPrint.println("HRegionScanner.<init>");
 
       this.filter = scan.getFilter();
       // Doesn't need to be volatile, always accessed under a sync'ed method
@@ -1838,6 +1838,7 @@ public class HRegion implements HConstan
       this.isScan = scan.isGetScan() ? -1 : 0;
 
       this.readPt = ReadWriteConsistencyControl.resetThreadReadPoint(rwcc);
+      DebugPrint.println("HRegionScanner.<init>, this.readPt: " + this.readPt);
 
       List<KeyValueScanner> scanners = new ArrayList<KeyValueScanner>();
       if (additionalScanners != null) {
@@ -1887,6 +1888,7 @@ public class HRegion implements HConstan
 
       // This could be a new thread from the last time we called next().
       ReadWriteConsistencyControl.setThreadReadPoint(this.readPt);
+      DebugPrint.println("HRegionScanner.next(): this.readPt:" + this.readPt);
 
       results.clear();
       boolean returnResult = nextInternal();

Modified: hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/MemStore.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/MemStore.java?rev=952486&r1=952485&r2=952486&view=diff
==============================================================================
--- hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/MemStore.java (original)
+++ hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/MemStore.java Mon Jun
 7 23:41:20 2010
@@ -188,7 +188,7 @@ public class MemStore implements HeapSiz
     return s;
   }
 
-  /** 
+  /**
    * Write a delete
    * @param delete
    * @return approximate size of the passed key and value.
@@ -205,7 +205,7 @@ public class MemStore implements HeapSiz
     this.size.addAndGet(s);
     return s;
   }
-  
+
   /**
    * @param kv Find the row that comes after this one.  If null, we return the
    * first.
@@ -454,7 +454,7 @@ public class MemStore implements HeapSiz
   void readLockUnlock() {
     this.lock.readLock().unlock();
   }
-  
+
   /**
    *
    * @param set memstore or snapshot
@@ -485,7 +485,7 @@ public class MemStore implements HeapSiz
     }
     return false;
   }
-  
+
 
   /*
    * MemStoreScanner implements the KeyValueScanner.
@@ -530,7 +530,7 @@ public class MemStore implements HeapSiz
     protected KeyValue getNext(Iterator<KeyValue> it) {
       KeyValue ret = null;
       long readPoint = ReadWriteConsistencyControl.getThreadReadPoint();
-      //DebugPrint.println( " MS@" + hashCode() + ": threadpoint = " + readPoint);
+      DebugPrint.println( " MS@" + hashCode() + ": threadpoint = " + readPoint);
 
       while (ret == null && it.hasNext()) {
         KeyValue v = it.next();
@@ -557,12 +557,12 @@ public class MemStore implements HeapSiz
 
       kvsetNextRow = getNext(kvsetIt);
       snapshotNextRow = getNext(snapshotIt);
-      long readPoint = ReadWriteConsistencyControl.getThreadReadPoint();
 
-      //DebugPrint.println( " MS@" + hashCode() + " kvset seek: " + kvsetNextRow + " with
size = " +
-      //    kvset.size() + " threadread = " + readPoint);
-      //DebugPrint.println( " MS@" + hashCode() + " snapshot seek: " + snapshotNextRow +
" with size = " +
-      //    snapshot.size() + " threadread = " + readPoint);
+      long readPoint = ReadWriteConsistencyControl.getThreadReadPoint();
+      DebugPrint.println( " MS@" + hashCode() + " kvset seek: " + kvsetNextRow + " with size
= " +
+          kvset.size() + " threadread = " + readPoint);
+      DebugPrint.println( " MS@" + hashCode() + " snapshot seek: " + snapshotNextRow + "
with size = " +
+          snapshot.size() + " threadread = " + readPoint);
 
       KeyValue lowest = getLowest();
 
@@ -571,7 +571,7 @@ public class MemStore implements HeapSiz
     }
 
     public synchronized KeyValue peek() {
-      //DebugPrint.println(" MS@" + hashCode() + " peek = " + getLowest());
+      DebugPrint.println(" MS@" + hashCode() + " peek = " + getLowest());
       return getLowest();
     }
 
@@ -589,9 +589,9 @@ public class MemStore implements HeapSiz
       } else {
         snapshotNextRow = getNext(snapshotIt);
       }
-      //long readpoint = ReadWriteConsistencyControl.getThreadReadPoint();
-      //DebugPrint.println(" MS@" + hashCode() + " next: " + theNext + " next_next: " +
-      //    getLowest() + " threadpoint=" + readpoint);
+      long readpoint = ReadWriteConsistencyControl.getThreadReadPoint();
+      DebugPrint.println(" MS@" + hashCode() + " next: " + theNext + " next_next: " +
+          getLowest() + " threadpoint=" + readpoint);
 
       return theNext;
     }
@@ -629,7 +629,7 @@ public class MemStore implements HeapSiz
 
   public final static long FIXED_OVERHEAD = ClassSize.align(
       ClassSize.OBJECT + (7 * ClassSize.REFERENCE));
-  
+
   public final static long DEEP_OVERHEAD = ClassSize.align(FIXED_OVERHEAD +
       ClassSize.REENTRANT_LOCK + ClassSize.ATOMIC_LONG +
       ClassSize.COPYONWRITE_ARRAYSET + ClassSize.COPYONWRITE_ARRAYLIST +
@@ -643,11 +643,11 @@ public class MemStore implements HeapSiz
    * @return Size
    */
   long heapSizeChange(final KeyValue kv, final boolean notpresent) {
-    return notpresent ? 
+    return notpresent ?
         ClassSize.align(ClassSize.CONCURRENT_SKIPLISTMAP_ENTRY + kv.heapSize()):
         0;
   }
-  
+
   /**
    * Get the entire heap usage for this MemStore not including keys in the
    * snapshot.
@@ -656,7 +656,7 @@ public class MemStore implements HeapSiz
   public long heapSize() {
     return size.get();
   }
-  
+
   /**
    * Get the heap usage of KVs in this MemStore.
    */

Modified: hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java?rev=952486&r1=952485&r2=952486&view=diff
==============================================================================
--- hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java (original)
+++ hbase/branches/0.20/src/java/org/apache/hadoop/hbase/regionserver/StoreScanner.java Mon
Jun  7 23:41:20 2010
@@ -56,7 +56,7 @@ class StoreScanner implements KeyValueSc
    * @param columns which columns we are scanning
    */
   StoreScanner(Store store, Scan scan, final NavigableSet<byte[]> columns) {
-    //DebugPrint.println("SS new");
+    DebugPrint.println("SS new");
     this.store = store;
     this.cacheBlocks = scan.getCacheBlocks();
     matcher = new ScanQueryMatcher(scan, store.getFamily().getName(),
@@ -82,7 +82,7 @@ class StoreScanner implements KeyValueSc
 
   /**
    * Used for major compactions.<p>
-   * 
+   *
    * Opens a scanner across specified StoreFiles.
    * @param store who we scan
    * @param scan the spec
@@ -113,7 +113,7 @@ class StoreScanner implements KeyValueSc
     this.store = null;
     this.isGet = false;
     this.cacheBlocks = scan.getCacheBlocks();
-    this.matcher = new ScanQueryMatcher(scan, colFamily, columns, ttl, 
+    this.matcher = new ScanQueryMatcher(scan, colFamily, columns, ttl,
         comparator.getRawComparator(), scan.getMaxVersions());
 
     // Seek all scanners to the initial key
@@ -163,7 +163,7 @@ class StoreScanner implements KeyValueSc
    * @return true if there are more rows, false if scanner is done
    */
   public synchronized boolean next(List<KeyValue> outResult) throws IOException {
-    //DebugPrint.println("SS.next");
+    DebugPrint.println("SS.next");
     KeyValue peeked = this.heap.peek();
     if (peeked == null) {
       close();
@@ -174,13 +174,13 @@ class StoreScanner implements KeyValueSc
     List<KeyValue> results = new ArrayList<KeyValue>();
     while((kv = this.heap.peek()) != null) {
       QueryMatcher.MatchCode qcode = matcher.match(kv);
-      //DebugPrint.println("SS peek kv = " + kv + " with qcode = " + qcode);
+      DebugPrint.println("SS peek kv = " + kv + " with qcode = " + qcode);
       switch(qcode) {
         case INCLUDE:
           KeyValue next = this.heap.next();
           results.add(next);
           continue;
-          
+
         case DONE:
           // copy jazz
           outResult.addAll(results);
@@ -208,12 +208,12 @@ class StoreScanner implements KeyValueSc
         case SKIP:
           this.heap.next();
           break;
-          
+
         default:
           throw new RuntimeException("UNEXPECTED");
       }
     }
-    
+
     if (!results.isEmpty()) {
       // copy jazz
       outResult.addAll(results);
@@ -252,7 +252,7 @@ class StoreScanner implements KeyValueSc
     KeyValue topKey = this.peek();
     if (topKey == null) return;
 
-    //DebugPrint.println("SS updateReaders, topKey = " + topKey);
+    DebugPrint.println("SS updateReaders, topKey = " + topKey);
 
     // TODO perhaps do something more elegant than new-memstore scanner like adjust with
a seek?
 

Modified: hbase/branches/0.20/src/test/org/apache/hadoop/hbase/regionserver/TestHRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.20/src/test/org/apache/hadoop/hbase/regionserver/TestHRegion.java?rev=952486&r1=952485&r2=952486&view=diff
==============================================================================
--- hbase/branches/0.20/src/test/org/apache/hadoop/hbase/regionserver/TestHRegion.java (original)
+++ hbase/branches/0.20/src/test/org/apache/hadoop/hbase/regionserver/TestHRegion.java Mon
Jun  7 23:41:20 2010
@@ -2114,7 +2114,7 @@ public class TestHRegion extends HBaseTe
     putThread.done();
 
     region.flushcache();
-    
+
     putThread.join();
     putThread.checkNoError();
 
@@ -2221,6 +2221,8 @@ public class TestHRegion extends HBaseTe
       qualifiers[i] = Bytes.toBytes("qual" + i);
     }
 
+    DebugPrint.enable();
+
     String method = "testWritesWhileScanning";
     initHRegion(tableName, method, families);
     PutThread putThread = new PutThread(numRows, families, qualifiers);
@@ -2260,11 +2262,17 @@ public class TestHRegion extends HBaseTe
         for (KeyValue kv : result.raw()) {
           byte [] thisValue = kv.getValue();
           if (gotValue != null) {
+            // did this fail?
+            if (!Bytes.equals(gotValue, thisValue)) {
+              System.out.println(DebugPrint.out.toString());
+            }
             assertEquals(gotValue, thisValue);
           }
           gotValue = thisValue;
         }
       }
+      
+      DebugPrint.reset();
     }
 
     putThread.done();



Mime
View raw message