hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r942184 [2/15] - in /hadoop/hbase/branches/0.20: ./ src/java/org/apache/hadoop/hbase/ src/java/org/apache/hadoop/hbase/client/ src/java/org/apache/hadoop/hbase/filter/ src/java/org/apache/hadoop/hbase/io/ src/java/org/apache/hadoop/hbase/io...
Date Fri, 07 May 2010 19:17:55 GMT
Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/KeyValue.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/KeyValue.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/KeyValue.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/KeyValue.java Fri May  7 19:17:48 2010
@@ -35,19 +35,19 @@ import org.apache.hadoop.io.Writable;
 
 /**
  * An HBase Key/Value.
- * 
+ *
  * <p>If being used client-side, the primary methods to access individual fields
- * are {@link #getRow()}, {@link #getFamily()}, {@link #getQualifier()}, 
+ * are {@link #getRow()}, {@link #getFamily()}, {@link #getQualifier()},
  * {@link #getTimestamp()}, and {@link #getValue()}.  These methods allocate new
  * byte arrays and return copies so they should be avoided server-side.
- * 
+ *
  * <p>Instances of this class are immutable.  They are not
  * comparable but Comparators are provided.  Comparators change with context,
  * whether user table or a catalog table comparison context.  Its
  * important that you use the appropriate comparator comparing rows in
  * particular.  There are Comparators for KeyValue instances and then for
  * just the Key portion of a KeyValue used mostly in {@link HFile}.
- * 
+ *
  * <p>KeyValue wraps a byte array and has offset and length for passed array
  * at where to start interpreting the content as a KeyValue blob.  The KeyValue
  * blob format inside the byte array is:
@@ -57,7 +57,7 @@ import org.apache.hadoop.io.Writable;
  * Rowlength maximum is Short.MAX_SIZE, column family length maximum is
  * Byte.MAX_SIZE, and column qualifier + key length must be < Integer.MAX_SIZE.
  * The column does not contain the family/qualifier delimiter.
- * 
+ *
  * <p>TODO: Group Key-only comparators and operations into a Key class, just
  * for neatness sake, if can figure what to call it.
  */
@@ -71,7 +71,7 @@ public class KeyValue implements Writabl
 
   public static final byte[] COLUMN_FAMILY_DELIM_ARRAY =
     new byte[]{COLUMN_FAMILY_DELIMITER};
-  
+
   /**
    * Comparator for plain key/values; i.e. non-catalog table key/values.
    */
@@ -109,10 +109,10 @@ public class KeyValue implements Writabl
 
   /**
    * Get the appropriate row comparator for the specified table.
-   * 
+   *
    * Hopefully we can get rid of this, I added this here because it's replacing
    * something in HSK.  We should move completely off of that.
-   * 
+   *
    * @param tableName  The table name.
    * @return The comparator.
    */
@@ -161,13 +161,13 @@ public class KeyValue implements Writabl
 
     // Maximum is used when searching; you look from maximum on down.
     Maximum((byte)255);
-    
+
     private final byte code;
-    
+
     Type(final byte c) {
       this.code = c;
     }
-    
+
     public byte getCode() {
       return this.code;
     }
@@ -193,9 +193,9 @@ public class KeyValue implements Writabl
    * Makes a Key with highest possible Timestamp, empty row and column.  No
    * key can be equal or lower than this one in memstore or in store file.
    */
-  public static final KeyValue LOWESTKEY = 
+  public static final KeyValue LOWESTKEY =
     new KeyValue(HConstants.EMPTY_BYTE_ARRAY, HConstants.LATEST_TIMESTAMP);
-  
+
   private byte [] bytes = null;
   private int offset = 0;
   private int length = 0;
@@ -216,7 +216,7 @@ public class KeyValue implements Writabl
 
   /** Dragon time over, return to normal business */
 
-  
+
   /** Writable Constructor -- DO NOT USE */
   public KeyValue() {}
 
@@ -254,23 +254,23 @@ public class KeyValue implements Writabl
   }
 
   /** Temporary constructors until 880/1249 is committed to remove deps */
-  
+
   /**
    * Temporary.
    */
   public KeyValue(final byte [] row, final byte [] column) {
     this(row, column, HConstants.LATEST_TIMESTAMP, null);
   }
-  
+
   public KeyValue(final byte [] row, final byte [] column, long ts) {
     this(row, column, ts, null);
   }
-  
+
   public KeyValue(final byte [] row, final byte [] column, long ts,
       byte [] value) {
     this(row, column, ts, Type.Put, value);
   }
-  
+
   public KeyValue(final byte [] row, final byte [] column, long ts, Type type,
       byte [] value) {
     int rlength = row == null ? 0 : row.length;
@@ -281,9 +281,9 @@ public class KeyValue implements Writabl
     this.length = this.bytes.length;
     this.offset = 0;
   }
-  
+
   /** Constructors that build a new backing byte array from fields */
-  
+
   /**
    * Constructs KeyValue structure filled with null value.
    * Sets type to {@link KeyValue.Type#Maximum}
@@ -310,7 +310,7 @@ public class KeyValue implements Writabl
    * @param family family name
    * @param qualifier column qualifier
    */
-  public KeyValue(final byte [] row, final byte [] family, 
+  public KeyValue(final byte [] row, final byte [] family,
       final byte [] qualifier) {
     this(row, family, qualifier, HConstants.LATEST_TIMESTAMP, Type.Maximum);
   }
@@ -321,7 +321,7 @@ public class KeyValue implements Writabl
    * @param family family name
    * @param qualifier column qualifier
    */
-  public KeyValue(final byte [] row, final byte [] family, 
+  public KeyValue(final byte [] row, final byte [] family,
       final byte [] qualifier, final byte [] value) {
     this(row, family, qualifier, HConstants.LATEST_TIMESTAMP, Type.Put, value);
   }
@@ -339,7 +339,7 @@ public class KeyValue implements Writabl
       final byte[] qualifier, final long timestamp, Type type) {
     this(row, family, qualifier, timestamp, type, null);
   }
-  
+
   /**
    * Constructs KeyValue structure filled with specified values.
    * @param row row key
@@ -353,7 +353,7 @@ public class KeyValue implements Writabl
       final byte[] qualifier, final long timestamp, final byte[] value) {
     this(row, family, qualifier, timestamp, Type.Put, value);
   }
-  
+
   /**
    * Constructs KeyValue structure filled with specified values.
    * @param row row key
@@ -367,9 +367,9 @@ public class KeyValue implements Writabl
   public KeyValue(final byte[] row, final byte[] family,
       final byte[] qualifier, final long timestamp, Type type,
       final byte[] value) {
-    this(row, family, qualifier, 0, qualifier==null ? 0 : qualifier.length, 
+    this(row, family, qualifier, 0, qualifier==null ? 0 : qualifier.length,
         timestamp, type, value, 0, value==null ? 0 : value.length);
-  } 
+  }
 
   /**
    * Constructs KeyValue structure filled with specified values.
@@ -385,12 +385,12 @@ public class KeyValue implements Writabl
    * @param vlength value length
    * @throws IllegalArgumentException
    */
-  public KeyValue(byte [] row, byte [] family, 
-      byte [] qualifier, int qoffset, int qlength, long timestamp, Type type, 
+  public KeyValue(byte [] row, byte [] family,
+      byte [] qualifier, int qoffset, int qlength, long timestamp, Type type,
       byte [] value, int voffset, int vlength) {
-    this(row, 0, row==null ? 0 : row.length, 
+    this(row, 0, row==null ? 0 : row.length,
         family, 0, family==null ? 0 : family.length,
-        qualifier, qoffset, qlength, timestamp, type, 
+        qualifier, qoffset, qlength, timestamp, type,
         value, voffset, vlength);
   }
 
@@ -419,7 +419,7 @@ public class KeyValue implements Writabl
       final byte [] qualifier, final int qoffset, final int qlength,
       final long timestamp, final Type type,
       final byte [] value, final int voffset, final int vlength) {
-    this.bytes = createByteArray(row, roffset, rlength, 
+    this.bytes = createByteArray(row, roffset, rlength,
         family, foffset, flength, qualifier, qoffset, qlength,
         timestamp, type, value, voffset, vlength);
     this.length = bytes.length;
@@ -428,7 +428,7 @@ public class KeyValue implements Writabl
 
   /**
    * Write KeyValue format into a byte array.
-   * 
+   *
    * @param row row key
    * @param roffset row offset
    * @param rlength row length
@@ -443,7 +443,7 @@ public class KeyValue implements Writabl
    * @param value column value
    * @param voffset value offset
    * @param vlength value length
-   * @return The newly created byte array. 
+   * @return The newly created byte array.
    */
   static byte [] createByteArray(final byte [] row, final int roffset,
       final int rlength, final byte [] family, final int foffset, int flength,
@@ -476,10 +476,10 @@ public class KeyValue implements Writabl
     // Value length
     vlength = value == null? 0 : vlength;
     if (vlength > HConstants.MAXIMUM_VALUE_LENGTH) {
-      throw new IllegalArgumentException("Valuer > " + 
+      throw new IllegalArgumentException("Valuer > " +
           HConstants.MAXIMUM_VALUE_LENGTH);
     }
-    
+
     // Allocate right-sized byte array.
     byte [] bytes = new byte[KEYVALUE_INFRASTRUCTURE_SIZE + keylength + vlength];
     // Write key, value and key row length.
@@ -502,7 +502,7 @@ public class KeyValue implements Writabl
     }
     return bytes;
   }
-  
+
   /**
    * Write KeyValue format into a byte array.
    * <p>
@@ -518,7 +518,7 @@ public class KeyValue implements Writabl
    * @param value
    * @param voffset
    * @param vlength
-   * @return The newly created byte array. 
+   * @return The newly created byte array.
    */
   static byte [] createByteArray(final byte [] row, final int roffset,
         final int rlength,
@@ -560,7 +560,7 @@ public class KeyValue implements Writabl
   //  KeyValue cloning
   //
   //---------------------------------------------------------------------------
-  
+
   /**
    * Clones a KeyValue.  This creates a copy, re-allocating the buffer.
    * @return Fully copied clone of this KeyValue
@@ -576,7 +576,7 @@ public class KeyValue implements Writabl
   //  String representation
   //
   //---------------------------------------------------------------------------
-  
+
   public String toString() {
     if (this.bytes == null || this.bytes.length == 0) {
       return "empty";
@@ -627,7 +627,7 @@ public class KeyValue implements Writabl
   //  Public Member Accessors
   //
   //---------------------------------------------------------------------------
-  
+
   /**
    * @return The byte array backing this KeyValue.
    */
@@ -654,7 +654,7 @@ public class KeyValue implements Writabl
   //  Length and Offset Calculators
   //
   //---------------------------------------------------------------------------
-  
+
   /**
    * Determines the total length of the KeyValue stored in the specified
    * byte array and offset.  Includes all headers.
@@ -663,7 +663,7 @@ public class KeyValue implements Writabl
    * @return length of entire KeyValue, in bytes
    */
   private static int getLength(byte [] bytes, int offset) {
-    return (2 * Bytes.SIZEOF_INT) + 
+    return (2 * Bytes.SIZEOF_INT) +
         Bytes.toInt(bytes, offset) +
         Bytes.toInt(bytes, offset + Bytes.SIZEOF_INT);
   }
@@ -692,7 +692,7 @@ public class KeyValue implements Writabl
   public int getValueOffset() {
     return getKeyOffset() + getKeyLength();
   }
-  
+
   /**
    * @return Value length
    */
@@ -706,7 +706,7 @@ public class KeyValue implements Writabl
   public int getRowOffset() {
     return getKeyOffset() + Bytes.SIZEOF_SHORT;
   }
-  
+
   /**
    * @return Row length
    */
@@ -720,21 +720,21 @@ public class KeyValue implements Writabl
   public int getFamilyOffset() {
     return getFamilyOffset(getRowLength());
   }
-  
+
   /**
    * @return Family offset
    */
   public int getFamilyOffset(int rlength) {
     return this.offset + ROW_OFFSET + Bytes.SIZEOF_SHORT + rlength + Bytes.SIZEOF_BYTE;
   }
-  
+
   /**
    * @return Family length
    */
   public byte getFamilyLength() {
     return getFamilyLength(getFamilyOffset());
   }
-  
+
   /**
    * @return Family length
    */
@@ -748,29 +748,29 @@ public class KeyValue implements Writabl
   public int getQualifierOffset() {
     return getQualifierOffset(getFamilyOffset());
   }
-  
+
   /**
    * @return Qualifier offset
    */
   public int getQualifierOffset(int foffset) {
     return foffset + getFamilyLength(foffset);
   }
-  
+
   /**
    * @return Qualifier length
    */
   public int getQualifierLength() {
     return getQualifierLength(getRowLength(),getFamilyLength());
   }
-  
+
   /**
    * @return Qualifier length
    */
   public int getQualifierLength(int rlength, int flength) {
-    return getKeyLength() - 
+    return getKeyLength() -
       (KEY_INFRASTRUCTURE_SIZE + rlength + flength);
   }
-  
+
   /**
    * @return Column (family + qualifier) length
    */
@@ -779,7 +779,7 @@ public class KeyValue implements Writabl
     int foffset = getFamilyOffset(rlength);
     return getTotalColumnLength(rlength,foffset);
   }
-  
+
   /**
    * @return Column (family + qualifier) length
    */
@@ -788,14 +788,14 @@ public class KeyValue implements Writabl
     int qlength = getQualifierLength(rlength,flength);
     return flength + qlength;
   }
-  
+
   /**
    * @return Timestamp offset
    */
   public int getTimestampOffset() {
     return getTimestampOffset(getKeyLength());
   }
-  
+
   /**
    * @param keylength Pass if you have it to save on a int creation.
    * @return Timestamp offset
@@ -808,7 +808,7 @@ public class KeyValue implements Writabl
    * @return True if this KeyValue has a LATEST_TIMESTAMP timestamp.
    */
   public boolean isLatestTimestamp() {
-    return  Bytes.compareTo(getBuffer(), getTimestampOffset(), Bytes.SIZEOF_LONG, 
+    return  Bytes.compareTo(getBuffer(), getTimestampOffset(), Bytes.SIZEOF_LONG,
       HConstants.LATEST_TIMESTAMP_BYTES, 0, Bytes.SIZEOF_LONG) == 0;
   }
 
@@ -820,17 +820,17 @@ public class KeyValue implements Writabl
     }
     return false;
   }
-  
+
   //---------------------------------------------------------------------------
   //
   //  Methods that return copies of fields
   //
   //---------------------------------------------------------------------------
-  
+
   /**
    * Do not use unless you have to.  Used internally for compacting and testing.
-   * 
-   * Use {@link #getRow()}, {@link #getFamily()}, {@link #getQualifier()}, and 
+   *
+   * Use {@link #getRow()}, {@link #getFamily()}, {@link #getQualifier()}, and
    * {@link #getValue()} if accessing a KeyValue client-side.
    * @return Copy of the key portion only.
    */
@@ -840,7 +840,7 @@ public class KeyValue implements Writabl
     System.arraycopy(getBuffer(), getKeyOffset(), key, 0, keylength);
     return key;
   }
-  
+
   /**
    * Returns value in a new byte array.
    * Primarily for use client-side. If server-side, use
@@ -855,12 +855,12 @@ public class KeyValue implements Writabl
     System.arraycopy(getBuffer(), o, result, 0, l);
     return result;
   }
-  
+
   /**
    * Primarily for use client-side.  Returns the row of this KeyValue in a new
    * byte array.<p>
-   * 
-   * If server-side, use {@link #getBuffer()} with appropriate offsets and 
+   *
+   * If server-side, use {@link #getBuffer()} with appropriate offsets and
    * lengths instead.
    * @return Row in a new byte array.
    */
@@ -873,7 +873,7 @@ public class KeyValue implements Writabl
   }
 
   /**
-   * 
+   *
    * @return Timestamp
    */
   public long getTimestamp() {
@@ -931,8 +931,8 @@ public class KeyValue implements Writabl
   /**
    * Primarily for use client-side.  Returns the column of this KeyValue in the
    * deprecated format: <i>family:qualifier</i>, and in a new byte array.<p>
-   * 
-   * If server-side, use {@link #getBuffer()} with appropriate offsets and 
+   *
+   * If server-side, use {@link #getBuffer()} with appropriate offsets and
    * lengths instead.
    * @return Returns column. Makes a copy.  Inserts delimiter.
    */
@@ -948,10 +948,10 @@ public class KeyValue implements Writabl
   }
 
   /**
-   * Primarily for use client-side.  Returns the family of this KeyValue in a 
+   * Primarily for use client-side.  Returns the family of this KeyValue in a
    * new byte array.<p>
-   * 
-   * If server-side, use {@link #getBuffer()} with appropriate offsets and 
+   *
+   * If server-side, use {@link #getBuffer()} with appropriate offsets and
    * lengths instead.
    * @return Returns family. Makes a copy.
    */
@@ -964,10 +964,10 @@ public class KeyValue implements Writabl
   }
 
   /**
-   * Primarily for use client-side.  Returns the column qualifier of this 
+   * Primarily for use client-side.  Returns the column qualifier of this
    * KeyValue in a new byte array.<p>
-   * 
-   * If server-side, use {@link #getBuffer()} with appropriate offsets and 
+   *
+   * If server-side, use {@link #getBuffer()} with appropriate offsets and
    * lengths instead.
    * Use {@link #getBuffer()} with appropriate offsets and lengths instead.
    * @return Returns qualifier. Makes a copy.
@@ -985,7 +985,7 @@ public class KeyValue implements Writabl
   //  KeyValue splitter
   //
   //---------------------------------------------------------------------------
-  
+
   /**
    * Utility class that splits a KeyValue buffer into separate byte arrays.
    * <p>
@@ -1009,7 +1009,7 @@ public class KeyValue implements Writabl
     public byte [] getType() { return this.split[4]; }
     public byte [] getValue() { return this.split[5]; }
   }
-  
+
   public SplitKeyValue split() {
     SplitKeyValue split = new SplitKeyValue();
     int splitOffset = this.offset;
@@ -1049,13 +1049,13 @@ public class KeyValue implements Writabl
     split.setValue(value);
     return split;
   }
-  
+
   //---------------------------------------------------------------------------
   //
-  //  Compare specified fields against those contained in this KeyValue 
+  //  Compare specified fields against those contained in this KeyValue
   //
   //---------------------------------------------------------------------------
-  
+
   /**
    * @param family
    * @return True if matching families.
@@ -1076,7 +1076,7 @@ public class KeyValue implements Writabl
   public boolean matchingQualifier(final byte [] qualifier) {
     int o = getQualifierOffset();
     int l = getQualifierLength();
-    return Bytes.compareTo(qualifier, 0, qualifier.length, 
+    return Bytes.compareTo(qualifier, 0, qualifier.length,
         this.bytes, o, l) == 0;
   }
 
@@ -1178,7 +1178,7 @@ public class KeyValue implements Writabl
 
   /**
    * Splits a column in family:qualifier form into separate byte arrays.
-   * 
+   *
    * @param c  The column.
    * @return The parsed column.
    */
@@ -1199,7 +1199,7 @@ public class KeyValue implements Writabl
       len);
     return result;
   }
-  
+
   /**
    * @param b
    * @return Index of the family-qualifier colon delimiter character in passed
@@ -1278,7 +1278,7 @@ public class KeyValue implements Writabl
    */
   public static class RootComparator extends MetaComparator {
     private final KeyComparator rawcomparator = new RootKeyComparator();
-    
+
     public KeyComparator getRawComparator() {
       return this.rawcomparator;
     }
@@ -1349,7 +1349,7 @@ public class KeyValue implements Writabl
      * @return Result comparing rows.
      */
     public int compareRows(final KeyValue left, final KeyValue right) {
-      return compareRows(left, left.getRowLength(), right, 
+      return compareRows(left, left.getRowLength(), right,
           right.getRowLength());
     }
 
@@ -1382,7 +1382,7 @@ public class KeyValue implements Writabl
       return getRawComparator().compareRows(left, loffset, llength,
         right, roffset, rlength);
     }
-    
+
     public int compareColumns(final KeyValue left, final byte [] right,
         final int roffset, final int rlength, final int rfamilyoffset) {
       int offset = left.getFamilyOffset();
@@ -1460,7 +1460,7 @@ public class KeyValue implements Writabl
     public boolean matchingRows(final byte [] left, final int loffset,
         final int llength,
         final byte [] right, final int roffset, final int rlength) {
-      int compare = compareRows(left, loffset, llength, 
+      int compare = compareRows(left, loffset, llength,
           right, roffset, rlength);
       if (compare != 0) {
         return false;
@@ -1489,7 +1489,7 @@ public class KeyValue implements Writabl
     protected Object clone() throws CloneNotSupportedException {
       return new KVComparator();
     }
- 
+
     /**
      * @return Comparator that ignores timestamps; useful counting versions.
      */
@@ -1534,7 +1534,7 @@ public class KeyValue implements Writabl
    * Create a KeyValue that is smaller than all other possible KeyValues
    * for the given row. That is any (valid) KeyValue on 'row' would sort
    * _after_ the result.
-   * 
+   *
    * @param row - row key (arbitrary byte array)
    * @return First possible KeyValue on passed <code>row</code>
    */
@@ -1593,7 +1593,7 @@ public class KeyValue implements Writabl
       final byte [] q, final long ts) {
     return new KeyValue(row, f, q, ts, Type.Maximum);
   }
-  
+
   /**
    * @param b
    * @param o
@@ -1622,7 +1622,7 @@ public class KeyValue implements Writabl
       //          "---" + Bytes.toString(right, roffset, rlength));
       final int metalength = 7; // '.META.' length
       int lmetaOffsetPlusDelimiter = loffset + metalength;
-      int leftFarDelimiter = getDelimiterInReverse(left, 
+      int leftFarDelimiter = getDelimiterInReverse(left,
           lmetaOffsetPlusDelimiter,
           llength - metalength, HRegionInfo.DELIMITER);
       int rmetaOffsetPlusDelimiter = roffset + metalength;
@@ -1756,7 +1756,7 @@ public class KeyValue implements Writabl
 
       // if row matches, and no column in the 'left' AND put type is 'minimum',
       // then return that left is larger than right.
-      
+
       // This supports 'last key on a row' - the magic is if there is no column in the
       // left operand, and the left operand has a type of '0' - magical value,
       // then we say the left is bigger.  This will let us seek to the last key in
@@ -1778,7 +1778,7 @@ public class KeyValue implements Writabl
       if (compare != 0) {
         return compare;
       }
-      
+
       if (!this.ignoreTimestamp) {
         // Get timestamps.
         long ltimestamp = Bytes.toLong(left,
@@ -1828,15 +1828,15 @@ public class KeyValue implements Writabl
       return 0;
     }
   }
-  
+
   // HeapSize
   public long heapSize() {
-    return ClassSize.align(ClassSize.OBJECT + ClassSize.REFERENCE + 
-        ClassSize.align(ClassSize.ARRAY + length) + 
+    return ClassSize.align(ClassSize.OBJECT + ClassSize.REFERENCE +
+        ClassSize.align(ClassSize.ARRAY + length) +
         (2 * Bytes.SIZEOF_INT) +
         Bytes.SIZEOF_LONG);
   }
-  
+
   // this overload assumes that the length bytes have already been read,
   // and it expects the length of the KeyValue to be explicitly passed
   // to it.
@@ -1846,13 +1846,13 @@ public class KeyValue implements Writabl
     this.bytes = new byte[this.length];
     in.readFully(this.bytes, 0, this.length);
   }
-  
+
   // Writable
   public void readFields(final DataInput in) throws IOException {
     int length = in.readInt();
     readFields(length, in);
   }
-  
+
   public void write(final DataOutput out) throws IOException {
     out.writeInt(this.length);
     out.write(this.bytes, this.offset, this.length);

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/LeaseListener.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/LeaseListener.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/LeaseListener.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/LeaseListener.java Fri May  7 19:17:48 2010
@@ -21,11 +21,11 @@ package org.apache.hadoop.hbase;
 
 
 /**
- * LeaseListener is an interface meant to be implemented by users of the Leases 
+ * LeaseListener is an interface meant to be implemented by users of the Leases
  * class.
  *
  * It receives events from the Leases class about the status of its accompanying
- * lease.  Users of the Leases class can use a LeaseListener subclass to, for 
+ * lease.  Users of the Leases class can use a LeaseListener subclass to, for
  * example, clean up resources after a lease has expired.
  */
 public interface LeaseListener {

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/Leases.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/Leases.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/Leases.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/Leases.java Fri May  7 19:17:48 2010
@@ -36,15 +36,15 @@ import java.io.IOException;
  *
  * There are several server classes in HBase that need to track external
  * clients that occasionally send heartbeats.
- * 
+ *
  * <p>These external clients hold resources in the server class.
  * Those resources need to be released if the external client fails to send a
  * heartbeat after some interval of time passes.
  *
  * <p>The Leases class is a general reusable class for this kind of pattern.
- * An instance of the Leases class will create a thread to do its dirty work.  
+ * An instance of the Leases class will create a thread to do its dirty work.
  * You should close() the instance if you want to clean up the thread properly.
- * 
+ *
  * <p>
  * NOTE: This class extends Thread rather than Chore because the sleep time
  * can be interrupted when there is something to do, rather than the Chore
@@ -60,7 +60,7 @@ public class Leases extends Thread {
 
   /**
    * Creates a lease monitor
-   * 
+   *
    * @param leasePeriod - length of time (milliseconds) that the lease is valid
    * @param leaseCheckFrequency - how often the lease should be checked
    * (milliseconds)
@@ -114,9 +114,9 @@ public class Leases extends Thread {
   public void closeAfterLeasesExpire() {
     this.stopRequested = true;
   }
-  
+
   /**
-   * Shut down this Leases instance.  All pending leases will be destroyed, 
+   * Shut down this Leases instance.  All pending leases will be destroyed,
    * without any cancellation calls.
    */
   public void close() {
@@ -132,10 +132,10 @@ public class Leases extends Thread {
 
   /**
    * Obtain a lease
-   * 
+   *
    * @param leaseName name of the lease
    * @param listener listener that will process lease expirations
-   * @throws LeaseStillHeldException 
+   * @throws LeaseStillHeldException
    */
   public void createLease(String leaseName, final LeaseListener listener)
   throws LeaseStillHeldException {
@@ -160,25 +160,25 @@ public class Leases extends Thread {
   @SuppressWarnings("serial")
   public static class LeaseStillHeldException extends IOException {
     private final String leaseName;
-    
+
     /**
      * @param name
      */
     public LeaseStillHeldException(final String name) {
       this.leaseName = name;
     }
-    
+
     /** @return name of lease */
     public String getName() {
       return this.leaseName;
     }
   }
-  
+
   /**
    * Renew a lease
-   * 
+   *
    * @param leaseName name of lease
-   * @throws LeaseException 
+   * @throws LeaseException
    */
   public void renewLease(final String leaseName) throws LeaseException {
     synchronized (leaseQueue) {
@@ -197,9 +197,9 @@ public class Leases extends Thread {
 
   /**
    * Client explicitly cancels a lease.
-   * 
+   *
    * @param leaseName name of lease
-   * @throws LeaseException 
+   * @throws LeaseException
    */
   public void cancelLease(final String leaseName) throws LeaseException {
     synchronized (leaseQueue) {
@@ -227,7 +227,7 @@ public class Leases extends Thread {
     public String getLeaseName() {
       return leaseName;
     }
-    
+
     /** @return listener */
     public LeaseListener getListener() {
       return this.listener;
@@ -246,7 +246,7 @@ public class Leases extends Thread {
       }
       return this.hashCode() == ((Lease) obj).hashCode();
     }
-    
+
     @Override
     public int hashCode() {
       return this.leaseName.hashCode();

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/LocalHBaseCluster.java Fri May  7 19:17:48 2010
@@ -36,18 +36,18 @@ import org.apache.hadoop.hbase.util.JVMC
 /**
  * This class creates a single process HBase cluster. One thread is created for
  * a master and one per region server.
- * 
+ *
  * Call {@link #startup()} to start the cluster running and {@link #shutdown()}
  * to close it all down. {@link #join} the cluster is you want to wait on
  * shutdown completion.
- * 
+ *
  * <p>Runs master on port 60000 by default.  Because we can't just kill the
  * process -- not till HADOOP-1700 gets fixed and even then.... -- we need to
  * be able to find the master with a remote client to run shutdown.  To use a
  * port other than 60000, set the hbase.master to a value of 'local:PORT':
  * that is 'local', not 'localhost', and the port number the master should use
  * instead of 60000.
- * 
+ *
  * <p>To make 'local' mode more responsive, make values such as
  * <code>hbase.regionserver.msginterval</code>,
  * <code>hbase.master.meta.thread.rescanfrequency</code>, and

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/NotServingRegionException.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/NotServingRegionException.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/NotServingRegionException.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/NotServingRegionException.java Fri May  7 19:17:48 2010
@@ -42,7 +42,7 @@ public class NotServingRegionException e
   public NotServingRegionException(String s) {
     super(s);
   }
-  
+
   /**
    * Constructor
    * @param s message

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/RemoteExceptionHandler.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/RemoteExceptionHandler.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/RemoteExceptionHandler.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/RemoteExceptionHandler.java Fri May  7 19:17:48 2010
@@ -25,14 +25,14 @@ import java.lang.reflect.InvocationTarge
 
 import org.apache.hadoop.ipc.RemoteException;
 
-/** 
+/**
  * An immutable class which contains a static method for handling
  * org.apache.hadoop.ipc.RemoteException exceptions.
  */
 public class RemoteExceptionHandler {
   /* Not instantiable */
   private RemoteExceptionHandler() {super();}
-  
+
   /**
    * Examine passed Throwable.  See if its carrying a RemoteException. If so,
    * run {@link #decodeRemoteException(RemoteException)} on it.  Otherwise,
@@ -53,7 +53,7 @@ public class RemoteExceptionHandler {
     }
     return result;
   }
-  
+
   /**
    * Examine passed IOException.  See if its carrying a RemoteException. If so,
    * run {@link #decodeRemoteException(RemoteException)} on it.  Otherwise,
@@ -66,17 +66,17 @@ public class RemoteExceptionHandler {
     Throwable t = checkThrowable(e);
     return t instanceof IOException? (IOException)t: new IOException(t);
   }
-  
+
   /**
    * Converts org.apache.hadoop.ipc.RemoteException into original exception,
    * if possible. If the original exception is an Error or a RuntimeException,
    * throws the original exception.
-   * 
+   *
    * @param re original exception
    * @return decoded RemoteException if it is an instance of or a subclass of
    *         IOException, or the original RemoteException if it cannot be decoded.
-   * 
-   * @throws IOException indicating a server error ocurred if the decoded 
+   *
+   * @throws IOException indicating a server error ocurred if the decoded
    *         exception is not an IOException. The decoded exception is set as
    *         the cause.
    */
@@ -89,10 +89,10 @@ public class RemoteExceptionHandler {
 
       Class<?>[] parameterTypes = { String.class };
       Constructor<?> ctor = c.getConstructor(parameterTypes);
-      
+
       Object[] arguments = { re.getMessage() };
       Throwable t = (Throwable) ctor.newInstance(arguments);
-      
+
       if (t instanceof IOException) {
         i = (IOException) t;
 

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/TableExistsException.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/TableExistsException.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/TableExistsException.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/TableExistsException.java Fri May  7 19:17:48 2010
@@ -29,7 +29,7 @@ public class TableExistsException extend
 
   /**
    * Constructor
-   * 
+   *
    * @param s message
    */
   public TableExistsException(String s) {

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/ValueOverMaxLengthException.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/ValueOverMaxLengthException.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/ValueOverMaxLengthException.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/ValueOverMaxLengthException.java Fri May  7 19:17:48 2010
@@ -23,7 +23,7 @@ package org.apache.hadoop.hbase;
  * Thrown when a value is longer than the specified LENGTH
  */
 public class ValueOverMaxLengthException extends DoNotRetryIOException {
-  
+
   private static final long serialVersionUID = -5525656352372008316L;
 
   /**

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/VersionAnnotation.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/VersionAnnotation.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/VersionAnnotation.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/VersionAnnotation.java Fri May  7 19:17:48 2010
@@ -26,29 +26,29 @@ import java.lang.annotation.*;
 @Retention(RetentionPolicy.RUNTIME)
 @Target(ElementType.PACKAGE)
 public @interface VersionAnnotation {
- 
+
   /**
    * Get the Hadoop version
    * @return the version string "0.6.3-dev"
    */
   String version();
-  
+
   /**
    * Get the username that compiled Hadoop.
    */
   String user();
-  
+
   /**
    * Get the date when Hadoop was compiled.
    * @return the date in unix 'date' format
    */
   String date();
-  
+
   /**
    * Get the url for the subversion repository.
    */
   String url();
-  
+
   /**
    * Get the subversion revision.
    * @return the revision number as a string (eg. "451451")

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/Delete.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/Delete.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/Delete.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/Delete.java Fri May  7 19:17:48 2010
@@ -36,7 +36,7 @@ import org.apache.hadoop.hbase.util.Byte
 /**
  * Used to perform Delete operations on a single row.
  * <p>
- * To delete an entire row, instantiate a Delete object with the row 
+ * To delete an entire row, instantiate a Delete object with the row
  * to delete.  To further define the scope of what to delete, perform
  * additional methods as outlined below.
  * <p>
@@ -45,7 +45,7 @@ import org.apache.hadoop.hbase.util.Byte
  * <p>
  * To delete multiple versions of specific columns, execute
  * {@link #deleteColumns(byte [],byte []) deleteColumns}
- * for each column to delete.  
+ * for each column to delete.
  * <p>
  * To delete specific versions of specific columns, execute
  * {@link #deleteColumn(byte [],byte [],long) deleteColumn}
@@ -67,10 +67,10 @@ import org.apache.hadoop.hbase.util.Byte
  */
 public class Delete implements Writable, Row, Comparable<Row> {
   private byte [] row = null;
-  // This ts is only used when doing a deleteRow.  Anything less, 
+  // This ts is only used when doing a deleteRow.  Anything less,
   private long ts;
   private long lockId = -1L;
-  private final Map<byte [], List<KeyValue>> familyMap = 
+  private final Map<byte [], List<KeyValue>> familyMap =
     new TreeMap<byte [], List<KeyValue>>(Bytes.BYTES_COMPARATOR);
 
   /** Constructor for Writable.  DO NOT USE */
@@ -93,12 +93,12 @@ public class Delete implements Writable,
   /**
    * Create a Delete operation for the specified row and timestamp, using
    * an optional row lock.<p>
-   * 
+   *
    * If no further operations are done, this will delete all columns in all
-   * families of the specified row with a timestamp less than or equal to the 
+   * families of the specified row with a timestamp less than or equal to the
    * specified timestamp.<p>
-   * 
-   * This timestamp is ONLY used for a delete row operation.  If specifying 
+   *
+   * This timestamp is ONLY used for a delete row operation.  If specifying
    * families or columns, you must specify each timestamp individually.
    * @param row row key
    * @param timestamp maximum version timestamp (only for delete row)
@@ -166,7 +166,7 @@ public class Delete implements Writable,
     familyMap.put(family, list);
     return this;
   }
-  
+
   /**
    * Delete all versions of the specified column.
    * @param family family name
@@ -176,7 +176,7 @@ public class Delete implements Writable,
     this.deleteColumns(family, qualifier, HConstants.LATEST_TIMESTAMP);
     return this;
   }
-  
+
   /**
    * Delete all versions of the specified column with a timestamp less than
    * or equal to the specified timestamp.
@@ -194,20 +194,20 @@ public class Delete implements Writable,
     familyMap.put(family, list);
     return this;
   }
-  
+
   /**
-   * Delete all versions of the specified column, given in 
+   * Delete all versions of the specified column, given in
    * <code>family:qualifier</code> notation, and with a timestamp less than
-   * or equal to the specified timestamp. 
+   * or equal to the specified timestamp.
    * @param column colon-delimited family and qualifier
-   * @param timestamp maximum version timestamp 
+   * @param timestamp maximum version timestamp
    */
   public Delete deleteColumns(byte [] column, long timestamp) {
     byte [][] parts = KeyValue.parseColumn(column);
     this.deleteColumns(parts[0], parts[1], timestamp);
     return this;
   }
-  
+
   /**
    * Delete the latest version of the specified column.
    * This is an expensive call in that on the server-side, it first does a
@@ -220,7 +220,7 @@ public class Delete implements Writable,
     this.deleteColumn(family, qualifier, HConstants.LATEST_TIMESTAMP);
     return this;
   }
-  
+
   /**
    * Delete the specified version of the specified column.
    * @param family family name
@@ -242,26 +242,26 @@ public class Delete implements Writable,
     byte [][] parts = KeyValue.parseColumn(column);
     this.deleteColumns(parts[0], parts[1]);
   }
-  
+
   /**
    * Delete the latest version of the specified column, given in
    * <code>family:qualifier</code> notation.
-   * @param column colon-delimited family and qualifier 
+   * @param column colon-delimited family and qualifier
    */
   public Delete deleteColumn(byte [] column) {
     byte [][] parts = KeyValue.parseColumn(column);
     this.deleteColumn(parts[0], parts[1], HConstants.LATEST_TIMESTAMP);
     return this;
   }
-  
+
   /**
-   * Method for retrieving the delete's familyMap 
+   * Method for retrieving the delete's familyMap
    * @return familyMap
    */
   public Map<byte [], List<KeyValue>> getFamilyMap() {
     return this.familyMap;
   }
-  
+
   /**
    *  Method for retrieving the delete's row
    * @return row
@@ -269,7 +269,7 @@ public class Delete implements Writable,
   public byte [] getRow() {
     return this.row;
   }
-  
+
   /**
    * Method for retrieving the delete's RowLock
    * @return RowLock
@@ -277,16 +277,16 @@ public class Delete implements Writable,
   public RowLock getRowLock() {
     return new RowLock(this.row, this.lockId);
   }
-  
+
   /**
    * Method for retrieving the delete's lock ID.
-   * 
+   *
    * @return The lock ID.
    */
   public long getLockId() {
 	return this.lockId;
   }
-  
+
   /**
    * Method for retrieving the delete's timestamp
    * @return timestamp
@@ -294,7 +294,7 @@ public class Delete implements Writable,
   public long getTimeStamp() {
     return this.ts;
   }
-  
+
   /**
    * @return string
    */
@@ -330,7 +330,7 @@ public class Delete implements Writable,
     sb.append("}");
     return sb.toString();
   }
-  
+
   //Writable
   public void readFields(final DataInput in) throws IOException {
     this.row = Bytes.readByteArray(in);
@@ -349,8 +349,8 @@ public class Delete implements Writable,
       }
       this.familyMap.put(family, list);
     }
-  }  
-  
+  }
+
   public void write(final DataOutput out) throws IOException {
     Bytes.writeByteArray(out, this.row);
     out.writeLong(this.ts);

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/Get.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/Get.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/Get.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/Get.java Fri May  7 19:17:48 2010
@@ -41,7 +41,7 @@ import org.apache.hadoop.io.WritableFact
  * Used to perform Get operations on a single row.
  * <p>
  * To get everything for a row, instantiate a Get object with the row to get.
- * To further define the scope of what to get, perform additional methods as 
+ * To further define the scope of what to get, perform additional methods as
  * outlined below.
  * <p>
  * To get all columns from specific families, execute {@link #addFamily(byte[]) addFamily}
@@ -67,7 +67,7 @@ public class Get implements Writable {
   private int maxVersions = 1;
   private Filter filter = null;
   private TimeRange tr = new TimeRange();
-  private Map<byte [], NavigableSet<byte []>> familyMap = 
+  private Map<byte [], NavigableSet<byte []>> familyMap =
     new TreeMap<byte [], NavigableSet<byte []>>(Bytes.BYTES_COMPARATOR);
 
   /** Constructor for Writable.  DO NOT USE */
@@ -176,7 +176,7 @@ public class Get implements Writable {
 
   /**
    * Get versions of columns with the specified timestamp.
-   * @param timestamp version timestamp  
+   * @param timestamp version timestamp
    */
   public Get setTimeStamp(long timestamp) {
     try {
@@ -230,7 +230,7 @@ public class Get implements Writable {
 
   /**
    * Method for retrieving the get's row
-   * @return row 
+   * @return row
    */
   public byte [] getRow() {
     return this.row;
@@ -258,7 +258,7 @@ public class Get implements Writable {
    */
   public int getMaxVersions() {
     return this.maxVersions;
-  } 
+  }
 
   /**
    * Method for retrieving the get's TimeRange
@@ -318,7 +318,7 @@ public class Get implements Writable {
       return sb.toString();
     }
     boolean moreThanOne = false;
-    for(Map.Entry<byte [], NavigableSet<byte[]>> entry : 
+    for(Map.Entry<byte [], NavigableSet<byte[]>> entry :
       this.familyMap.entrySet()) {
       if(moreThanOne) {
         sb.append("), ");
@@ -363,7 +363,7 @@ public class Get implements Writable {
     this.tr = new TimeRange();
     tr.readFields(in);
     int numFamilies = in.readInt();
-    this.familyMap = 
+    this.familyMap =
       new TreeMap<byte [],NavigableSet<byte []>>(Bytes.BYTES_COMPARATOR);
     for(int i=0; i<numFamilies; i++) {
       byte [] family = Bytes.readByteArray(in);
@@ -395,7 +395,7 @@ public class Get implements Writable {
     }
     tr.write(out);
     out.writeInt(familyMap.size());
-    for(Map.Entry<byte [], NavigableSet<byte []>> entry : 
+    for(Map.Entry<byte [], NavigableSet<byte []>> entry :
       familyMap.entrySet()) {
       Bytes.writeByteArray(out, entry.getKey());
       NavigableSet<byte []> columnSet = entry.getValue();
@@ -419,6 +419,6 @@ public class Get implements Writable {
       return WritableFactories.newInstance(clazz, new Configuration());
     } catch (ClassNotFoundException e) {
       throw new RuntimeException("Can't find class " + className);
-    }    
+    }
   }
 }

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HBaseAdmin.java Fri May  7 19:17:48 2010
@@ -61,7 +61,7 @@ public class HBaseAdmin {
 
   /**
    * Constructor
-   * 
+   *
    * @param conf Configuration object
    * @throws MasterNotRunningException
    */
@@ -85,7 +85,7 @@ public class HBaseAdmin {
   public HMasterInterface getMaster() throws MasterNotRunningException{
     return this.connection.getMaster();
   }
-  
+
   /** @return - true if the master server is running */
   public boolean isMasterRunning() {
     return this.connection.isMasterRunning();
@@ -121,14 +121,14 @@ public class HBaseAdmin {
    * catalog table that just contains table names and their descriptors.
    * Right now, it only exists as part of the META table's region info.
    *
-   * @return - returns an array of HTableDescriptors 
+   * @return - returns an array of HTableDescriptors
    * @throws IOException
    */
   public HTableDescriptor[] listTables() throws IOException {
     return this.connection.listTables();
   }
 
-  
+
   /**
    * Method for getting the tableDescriptor
    * @param tableName as a byte []
@@ -139,7 +139,7 @@ public class HBaseAdmin {
   throws IOException {
     return this.connection.getHTableDescriptor(tableName);
   }
-  
+
   private long getPauseTime(int tries) {
 	int triesCount = tries;
     if (triesCount >= HConstants.RETRY_BACKOFF.length)
@@ -150,9 +150,9 @@ public class HBaseAdmin {
   /**
    * Creates a new table.
    * Synchronous operation.
-   * 
+   *
    * @param desc table descriptor for table
-   * 
+   *
    * @throws IllegalArgumentException if the table name is reserved
    * @throws MasterNotRunningException if master is not running
    * @throws TableExistsException if table already exists (If concurrent
@@ -169,19 +169,19 @@ public class HBaseAdmin {
    * Creates a new table with the specified number of regions.  The start key
    * specified will become the end key of the first region of the table, and
    * the end key specified will become the start key of the last region of the
-   * table (the first region has a null start key and the last region has a 
+   * table (the first region has a null start key and the last region has a
    * null end key).
-   * 
+   *
    * BigInteger math will be used to divide the key range specified into
    * enough segments to make the required number of total regions.
-   * 
+   *
    * Synchronous operation.
-   * 
+   *
    * @param desc table descriptor for table
    * @param startKey beginning of key range
    * @param endKey end of key range
    * @param numRegions the total number of regions to create
-   * 
+   *
    * @throws IllegalArgumentException if the table name is reserved
    * @throws MasterNotRunningException if master is not running
    * @throws TableExistsException if table already exists (If concurrent
@@ -189,7 +189,7 @@ public class HBaseAdmin {
    * and attempt-at-creation).
    * @throws IOException
    */
-  public void createTable(HTableDescriptor desc, byte [] startKey, 
+  public void createTable(HTableDescriptor desc, byte [] startKey,
       byte [] endKey, int numRegions)
   throws IOException {
     HTableDescriptor.isLegalTableName(desc.getName());
@@ -211,10 +211,10 @@ public class HBaseAdmin {
    * number of split keys plus one (the first region has a null start key and
    * the last region has a null end key).
    * Synchronous operation.
-   * 
+   *
    * @param desc table descriptor for table
    * @param splitKeys array of split keys for the initial regions of the table
-   * 
+   *
    * @throws IllegalArgumentException if the table name is reserved
    * @throws MasterNotRunningException if master is not running
    * @throws TableExistsException if table already exists (If concurrent
@@ -242,7 +242,7 @@ public class HBaseAdmin {
         // Wait for new table to come on-line
         connection.locateRegion(desc.getName(), HConstants.EMPTY_START_ROW);
         break;
-        
+
       } catch (RegionException e) {
         if (tries == numRetries - 1) {
           // Ran out of tries
@@ -256,13 +256,13 @@ public class HBaseAdmin {
       }
     }
   }
-  
+
   /**
    * Creates a new table but does not block and wait for it to come online.
    * Asynchronous operation.
-   * 
+   *
    * @param desc table descriptor for table
-   * 
+   *
    * @throws IllegalArgumentException Bad table name.
    * @throws MasterNotRunningException if master is not running
    * @throws TableExistsException if table already exists (If concurrent
@@ -286,7 +286,7 @@ public class HBaseAdmin {
   /**
    * Deletes a table.
    * Synchronous operation.
-   * 
+   *
    * @param tableName name of table to delete
    * @throws IOException
    */
@@ -297,7 +297,7 @@ public class HBaseAdmin {
   /**
    * Deletes a table.
    * Synchronous operation.
-   * 
+   *
    * @param tableName name of table to delete
    * @throws IOException
    */
@@ -376,12 +376,12 @@ public class HBaseAdmin {
     LOG.info("Deleted " + Bytes.toString(tableName));
   }
 
-  
+
 
   /**
    * Brings a table on-line (enables it).
    * Synchronous operation.
-   * 
+   *
    * @param tableName name of the table
    * @throws IOException
    */
@@ -392,7 +392,7 @@ public class HBaseAdmin {
   /**
    * Brings a table on-line (enables it).
    * Synchronous operation.
-   * 
+   *
    * @param tableName name of the table
    * @throws IOException
    */
@@ -437,7 +437,7 @@ public class HBaseAdmin {
    * Disables a table (takes it off-line) If it is being served, the master
    * will tell the servers to stop serving it.
    * Synchronous operation.
-   * 
+   *
    * @param tableName name of table
    * @throws IOException
    */
@@ -449,7 +449,7 @@ public class HBaseAdmin {
    * Disables a table (takes it off-line) If it is being served, the master
    * will tell the servers to stop serving it.
    * Synchronous operation.
-   * 
+   *
    * @param tableName name of table
    * @throws IOException
    */
@@ -489,7 +489,7 @@ public class HBaseAdmin {
     }
     LOG.info("Disabled " + Bytes.toString(tableName));
   }
-  
+
   /**
    * @param tableName name of table to check
    * @return true if table is on-line
@@ -506,7 +506,7 @@ public class HBaseAdmin {
   public boolean isTableEnabled(byte[] tableName) throws IOException {
     return connection.isTableEnabled(tableName);
   }
-  
+
   /**
    * @param tableName name of table to check
    * @return true if table is off-line
@@ -537,7 +537,7 @@ public class HBaseAdmin {
   /**
    * Add a column to an existing table.
    * Asynchronous operation.
-   * 
+   *
    * @param tableName name of the table to add column to
    * @param column column descriptor of column to be added
    * @throws IOException
@@ -550,7 +550,7 @@ public class HBaseAdmin {
   /**
    * Add a column to an existing table.
    * Asynchronous operation.
-   * 
+   *
    * @param tableName name of the table to add column to
    * @param column column descriptor of column to be added
    * @throws IOException
@@ -571,7 +571,7 @@ public class HBaseAdmin {
   /**
    * Delete a column from a table.
    * Asynchronous operation.
-   * 
+   *
    * @param tableName name of table
    * @param columnName name of column to be deleted
    * @throws IOException
@@ -584,7 +584,7 @@ public class HBaseAdmin {
   /**
    * Delete a column from a table.
    * Asynchronous operation.
-   * 
+   *
    * @param tableName name of table
    * @param columnName name of column to be deleted
    * @throws IOException
@@ -605,13 +605,13 @@ public class HBaseAdmin {
   /**
    * Modify an existing column family on a table.
    * Asynchronous operation.
-   * 
+   *
    * @param tableName name of table
    * @param columnName name of column to be modified
    * @param descriptor new column descriptor to use
    * @throws IOException
    */
-  public void modifyColumn(final String tableName, final String columnName, 
+  public void modifyColumn(final String tableName, final String columnName,
       HColumnDescriptor descriptor)
   throws IOException {
     modifyColumn(Bytes.toBytes(tableName), Bytes.toBytes(columnName),
@@ -621,13 +621,13 @@ public class HBaseAdmin {
   /**
    * Modify an existing column family on a table.
    * Asynchronous operation.
-   * 
+   *
    * @param tableName name of table
    * @param columnName name of column to be modified
    * @param descriptor new column descriptor to use
    * @throws IOException
    */
-  public void modifyColumn(final byte [] tableName, final byte [] columnName, 
+  public void modifyColumn(final byte [] tableName, final byte [] columnName,
     HColumnDescriptor descriptor)
   throws IOException {
     if (this.master == null) {
@@ -644,7 +644,7 @@ public class HBaseAdmin {
   /**
    * Close a region. For expert-admins.
    * Asynchronous operation.
-   * 
+   *
    * @param regionname
    * @param args Optional server name.  Otherwise, we'll send close to the
    * server registered in .META.
@@ -658,7 +658,7 @@ public class HBaseAdmin {
   /**
    * Close a region.  For expert-admins.
    * Asynchronous operation.
-   * 
+   *
    * @param regionname
    * @param args Optional server name.  Otherwise, we'll send close to the
    * server registered in .META.
@@ -679,11 +679,11 @@ public class HBaseAdmin {
     modifyTable(HConstants.META_TABLE_NAME, HConstants.Modify.CLOSE_REGION,
       newargs);
   }
-  
+
   /**
    * Flush a table or an individual region.
    * Asynchronous operation.
-   * 
+   *
    * @param tableNameOrRegionName
    * @throws IOException
    */
@@ -694,7 +694,7 @@ public class HBaseAdmin {
   /**
    * Flush a table or an individual region.
    * Asynchronous operation.
-   * 
+   *
    * @param tableNameOrRegionName
    * @throws IOException
    */
@@ -705,7 +705,7 @@ public class HBaseAdmin {
   /**
    * Compact a table or an individual region.
    * Asynchronous operation.
-   * 
+   *
    * @param tableNameOrRegionName
    * @throws IOException
    */
@@ -716,18 +716,18 @@ public class HBaseAdmin {
   /**
    * Compact a table or an individual region.
    * Asynchronous operation.
-   * 
+   *
    * @param tableNameOrRegionName
    * @throws IOException
    */
   public void compact(final byte [] tableNameOrRegionName) throws IOException {
     modifyTable(tableNameOrRegionName, HConstants.Modify.TABLE_COMPACT);
   }
-  
+
   /**
    * Major compact a table or an individual region.
    * Asynchronous operation.
-   * 
+   *
    * @param tableNameOrRegionName
    * @throws IOException
    */
@@ -739,7 +739,7 @@ public class HBaseAdmin {
   /**
    * Major compact a table or an individual region.
    * Asynchronous operation.
-   * 
+   *
    * @param tableNameOrRegionName
    * @throws IOException
    */
@@ -751,7 +751,7 @@ public class HBaseAdmin {
   /**
    * Split a table or an individual region.
    * Asynchronous operation.
-   * 
+   *
    * @param tableNameOrRegionName
    * @throws IOException
    */
@@ -762,7 +762,7 @@ public class HBaseAdmin {
   /**
    * Split a table or an individual region.
    * Asynchronous operation.
-   * 
+   *
    * @param tableNameOrRegionName
    * @throws IOException
    */
@@ -777,7 +777,7 @@ public class HBaseAdmin {
    * @param op
    * @throws IOException
    */
-  private void modifyTable(final byte [] tableNameOrRegionName, 
+  private void modifyTable(final byte [] tableNameOrRegionName,
       final HConstants.Modify op)
   throws IOException {
     if (tableNameOrRegionName == null) {
@@ -789,16 +789,16 @@ public class HBaseAdmin {
     Object [] args = regionName == null? null: new byte [][] {regionName};
     modifyTable(tableName == null? null: tableName, op, args);
   }
-  
+
   /**
    * Modify an existing table, more IRB friendly version.
    * Asynchronous operation.
-   * 
+   *
    * @param tableName name of table.
    * @param htd modified description of the table
    * @throws IOException
    */
-  public void modifyTable(final byte [] tableName, HTableDescriptor htd) 
+  public void modifyTable(final byte [] tableName, HTableDescriptor htd)
   throws IOException {
     modifyTable(tableName, HConstants.Modify.TABLE_SET_HTD, htd);
   }
@@ -806,14 +806,14 @@ public class HBaseAdmin {
   /**
    * Modify an existing table.
    * Asynchronous operation.
-   * 
+   *
    * @param tableName name of table.  May be null if we are operating on a
    * region.
    * @param op table modification operation
    * @param args operation specific arguments
    * @throws IOException
    */
-  public void modifyTable(final byte [] tableName, HConstants.Modify op, 
+  public void modifyTable(final byte [] tableName, HConstants.Modify op,
       Object... args)
       throws IOException {
     if (this.master == null) {
@@ -828,7 +828,7 @@ public class HBaseAdmin {
     try {
       switch (op) {
       case TABLE_SET_HTD:
-        if (args == null || args.length < 1 || 
+        if (args == null || args.length < 1 ||
             !(args[0] instanceof HTableDescriptor)) {
           throw new IllegalArgumentException("SET_HTD requires a HTableDescriptor");
         }
@@ -887,8 +887,8 @@ public class HBaseAdmin {
     }
   }
 
-  /** 
-   * Shuts down the HBase instance 
+  /**
+   * Shuts down the HBase instance
    * @throws IOException
    */
   public synchronized void shutdown() throws IOException {

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnection.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnection.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnection.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnection.java Fri May  7 19:17:48 2010
@@ -52,7 +52,7 @@ public interface HConnection {
 
   /** @return - true if the master server is running */
   public boolean isMasterRunning();
-  
+
   /**
    * Checks if <code>tableName</code> exists.
    * @param tableName Table to check.
@@ -71,7 +71,7 @@ public interface HConnection {
    * @throws IOException
    */
   public boolean isTableEnabled(byte[] tableName) throws IOException;
-  
+
   /**
    * @param tableName
    * @return true if the table is disabled, false otherwise
@@ -93,14 +93,14 @@ public interface HConnection {
    * catalog table that just contains table names and their descriptors.
    * Right now, it only exists as part of the META table's region info.
    *
-   * @return - returns an array of HTableDescriptors 
+   * @return - returns an array of HTableDescriptors
    * @throws IOException
    */
   public HTableDescriptor[] listTables() throws IOException;
-  
+
   /**
    * @param tableName
-   * @return table metadata 
+   * @return table metadata
    * @throws IOException
    */
   public HTableDescriptor getHTableDescriptor(byte[] tableName)
@@ -109,35 +109,35 @@ public interface HConnection {
   /**
    * Allows flushing the region cache.
    */
-  public void clearRegionCache(); 
+  public void clearRegionCache();
 
   /**
    * Find the location of the region of <i>tableName</i> that <i>row</i>
    * lives in.
    * @param tableName name of the table <i>row</i> is in
    * @param row row key you're trying to find the region of
-   * @return HRegionLocation that describes where to find the reigon in 
+   * @return HRegionLocation that describes where to find the reigon in
    * question
    * @throws IOException
    */
   public HRegionLocation locateRegion(final byte [] tableName,
       final byte [] row)
   throws IOException;
-  
+
   /**
    * Find the location of the region of <i>tableName</i> that <i>row</i>
    * lives in, ignoring any value that might be in the cache.
    * @param tableName name of the table <i>row</i> is in
    * @param row row key you're trying to find the region of
-   * @return HRegionLocation that describes where to find the reigon in 
+   * @return HRegionLocation that describes where to find the reigon in
    * question
    * @throws IOException
    */
   public HRegionLocation relocateRegion(final byte [] tableName,
       final byte [] row)
-  throws IOException;  
-  
-  /** 
+  throws IOException;
+
+  /**
    * Establishes a connection to the region server at the specified address.
    * @param regionServer - the server to connect to
    * @return proxy for HRegionServer
@@ -145,8 +145,8 @@ public interface HConnection {
    */
   public HRegionInterface getHRegionConnection(HServerAddress regionServer)
   throws IOException;
-  
-  /** 
+
+  /**
    * Establishes a connection to the region server at the specified address.
    * @param regionServer - the server to connect to
    * @param getMaster - do we check if master is alive
@@ -156,7 +156,7 @@ public interface HConnection {
   public HRegionInterface getHRegionConnection(
       HServerAddress regionServer, boolean getMaster)
   throws IOException;
-  
+
   /**
    * Find region location hosting passed row
    * @param tableName
@@ -170,8 +170,8 @@ public interface HConnection {
   throws IOException;
 
   /**
-   * Pass in a ServerCallable with your particular bit of logic defined and 
-   * this method will manage the process of doing retries with timed waits 
+   * Pass in a ServerCallable with your particular bit of logic defined and
+   * this method will manage the process of doing retries with timed waits
    * and refinds of missing regions.
    *
    * @param <T> the type of the return value
@@ -180,9 +180,9 @@ public interface HConnection {
    * @throws IOException
    * @throws RuntimeException
    */
-  public <T> T getRegionServerWithRetries(ServerCallable<T> callable) 
+  public <T> T getRegionServerWithRetries(ServerCallable<T> callable)
   throws IOException, RuntimeException;
-  
+
   /**
    * Pass in a ServerCallable with your particular bit of logic defined and
    * this method will pass it to the defined region server.
@@ -194,8 +194,8 @@ public interface HConnection {
    */
   public <T> T getRegionServerWithoutRetries(ServerCallable<T> callable)
   throws IOException, RuntimeException;
-  
-    
+
+
   /**
    * Process a batch of Puts. Does the retries.
    * @param list A batch of Puts to process.
@@ -215,7 +215,7 @@ public interface HConnection {
    */
   public int processBatchOfDeletes(List<Delete> list, byte[] tableName)
   throws IOException;
-  
+
   public void processBatchOfPuts(List<Put> list,
                                  final byte[] tableName, ExecutorService pool) throws IOException;
 

Modified: hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java?rev=942184&r1=942183&r2=942184&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java (original)
+++ hadoop/hbase/branches/0.20/src/java/org/apache/hadoop/hbase/client/HConnectionManager.java Fri May  7 19:17:48 2010
@@ -66,7 +66,7 @@ import org.apache.zookeeper.Watcher.Even
 /**
  * A non-instantiable class that manages connections to multiple tables in
  * multiple HBase instances.
- * 
+ *
  * Used by {@link HTable} and {@link HBaseAdmin}
  */
 public class HConnectionManager implements HConstants {
@@ -89,13 +89,13 @@ public class HConnectionManager implemen
   protected HConnectionManager() {
     super();
   }
-  
+
   private static final int MAX_CACHED_HBASE_INSTANCES=31;
-  // A LRU Map of master HBaseConfiguration -> connection information for that 
+  // A LRU Map of master HBaseConfiguration -> connection information for that
   // instance. The objects it contains are mutable and hence require
   // synchronized access to them.  We set instances to 31.  The zk default max
   // connections is 30 so should run into zk issues before hit this value of 31.
-  private static 
+  private static
   final Map<HBaseConfiguration, TableServers> HBASE_INSTANCES =
     new LinkedHashMap<HBaseConfiguration, TableServers>
       ((int) (MAX_CACHED_HBASE_INSTANCES/0.75F)+1, 0.75F, true) {
@@ -104,10 +104,10 @@ public class HConnectionManager implemen
         return size() > MAX_CACHED_HBASE_INSTANCES;
       }
   };
-  
-  private static final Map<String, ClientZKWatcher> ZK_WRAPPERS = 
+
+  private static final Map<String, ClientZKWatcher> ZK_WRAPPERS =
     new HashMap<String, ClientZKWatcher>();
-  
+
   /**
    * Get the connection object for the instance specified by the configuration
    * If no current connection exists, create a new connection for that instance
@@ -125,7 +125,7 @@ public class HConnectionManager implemen
     }
     return connection;
   }
-  
+
   /**
    * Delete connection information for the instance specified by configuration
    * @param conf
@@ -176,7 +176,7 @@ public class HConnectionManager implemen
     }
     return ZK_WRAPPERS.get(conf.get(HConstants.ZOOKEEPER_QUORUM));
   }
-  
+
   /**
    * This class is responsible to handle connection and reconnection
    * to a zookeeper quorum.
@@ -217,7 +217,7 @@ public class HConnectionManager implemen
         resetZooKeeper();
       }
     }
-    
+
     /**
      * Get this watcher's ZKW, instanciate it if necessary.
      * @return ZKW
@@ -225,10 +225,10 @@ public class HConnectionManager implemen
     public synchronized ZooKeeperWrapper getZooKeeperWrapper() throws IOException {
       if(zooKeeperWrapper == null) {
         zooKeeperWrapper = new ZooKeeperWrapper(conf, this);
-      } 
+      }
       return zooKeeperWrapper;
     }
-    
+
     /**
      * Clear this connection to zookeeper.
      */
@@ -253,25 +253,25 @@ public class HConnectionManager implemen
     private volatile boolean closed;
     private volatile HMasterInterface master;
     private volatile boolean masterChecked;
-    
+
     private final Object rootRegionLock = new Object();
     private final Object metaRegionLock = new Object();
     private final Object userRegionLock = new Object();
-        
+
     private volatile HBaseConfiguration conf;
-    
-    // Known region HServerAddress.toString() -> HRegionInterface 
+
+    // Known region HServerAddress.toString() -> HRegionInterface
     private final Map<String, HRegionInterface> servers =
       new ConcurrentHashMap<String, HRegionInterface>();
 
     // Used by master and region servers during safe mode only
-    private volatile HRegionLocation rootRegionLocation; 
-    
-    private final Map<Integer, SoftValueSortedMap<byte [], HRegionLocation>> 
+    private volatile HRegionLocation rootRegionLocation;
+
+    private final Map<Integer, SoftValueSortedMap<byte [], HRegionLocation>>
       cachedRegionLocations =
         new HashMap<Integer, SoftValueSortedMap<byte [], HRegionLocation>>();
 
-    /** 
+    /**
      * constructor
      * @param conf Configuration object
      */
@@ -283,11 +283,11 @@ public class HConnectionManager implemen
         conf.get(REGION_SERVER_CLASS, DEFAULT_REGION_SERVER_CLASS);
 
       this.closed = false;
-      
+
       try {
         this.serverInterfaceClass =
           (Class<? extends HRegionInterface>) Class.forName(serverClassName);
-        
+
       } catch (ClassNotFoundException e) {
         throw new UnsupportedOperationException(
             "Unable to find region server interface " + serverClassName, e);
@@ -297,7 +297,7 @@ public class HConnectionManager implemen
       this.numRetries = conf.getInt("hbase.client.retries.number", 10);
       this.maxRPCAttempts = conf.getInt("hbase.client.rpc.maxattempts", 1);
       this.rpcTimeout = conf.getLong("hbase.regionserver.lease.period", 60000);
-      
+
       this.master = null;
       this.masterChecked = false;
     }
@@ -313,7 +313,7 @@ public class HConnectionManager implemen
     public void unsetRootRegionLocation() {
       this.rootRegionLocation = null;
     }
-    
+
     // Used by master and region servers during safe mode only
     public void setRootRegionLocation(HRegionLocation rootRegion) {
       if (rootRegion == null) {
@@ -322,7 +322,7 @@ public class HConnectionManager implemen
       }
       this.rootRegionLocation = rootRegion;
     }
-    
+
     public HMasterInterface getMaster() throws MasterNotRunningException {
       ZooKeeperWrapper zk = null;
       try {
@@ -343,15 +343,15 @@ public class HConnectionManager implemen
             masterLocation = zk.readMasterAddressOrThrow();
 
             HMasterInterface tryMaster = (HMasterInterface)HBaseRPC.getProxy(
-                HMasterInterface.class, HBaseRPCProtocolVersion.versionID, 
+                HMasterInterface.class, HBaseRPCProtocolVersion.versionID,
                 masterLocation.getInetSocketAddress(), this.conf);
-            
+
             if (tryMaster.isMasterRunning()) {
               this.master = tryMaster;
               this.masterLock.notifyAll();
               break;
             }
-            
+
           } catch (IOException e) {
             if (tries == numRetries - 1) {
               // This was our last chance - don't bother sleeping
@@ -386,7 +386,7 @@ public class HConnectionManager implemen
       if (this.master == null) {
         try {
           getMaster();
-          
+
         } catch (MasterNotRunningException e) {
           return false;
         }
@@ -416,7 +416,7 @@ public class HConnectionManager implemen
       }
       return exists;
     }
-    
+
     /*
      * @param n
      * @return Truen if passed tablename <code>n</code> is equal to the name
@@ -459,11 +459,11 @@ public class HConnectionManager implemen
 
       return uniqueTables.toArray(new HTableDescriptor[uniqueTables.size()]);
     }
-    
+
     public boolean isTableEnabled(byte[] tableName) throws IOException {
       return testTableOnlineState(tableName, true);
     }
-    
+
     public boolean isTableDisabled(byte[] tableName) throws IOException {
       return testTableOnlineState(tableName, false);
     }
@@ -485,7 +485,7 @@ public class HConnectionManager implemen
             }
           }
           return true;
-        }        
+        }
       };
       MetaScanner.metaScan(conf, visitor);
       return available.get();
@@ -518,7 +518,7 @@ public class HConnectionManager implemen
       scan.addColumn(CATALOG_FAMILY, REGIONINFO_QUALIFIER);
       int rows = this.conf.getInt("hbase.meta.scanner.caching", 100);
       scan.setCaching(rows);
-      ScannerCallable s = new ScannerCallable(this, 
+      ScannerCallable s = new ScannerCallable(this,
           (Bytes.equals(tableName, HConstants.META_TABLE_NAME) ?
               HConstants.ROOT_TABLE_NAME : HConstants.META_TABLE_NAME), scan);
       try {
@@ -560,7 +560,7 @@ public class HConnectionManager implemen
       return rowsScanned > 0 && onOffLine;
     }
 
-    private static class HTableDescriptorFinder 
+    private static class HTableDescriptorFinder
     implements MetaScanner.MetaScannerVisitor {
         byte[] tableName;
         HTableDescriptor result;
@@ -618,18 +618,18 @@ public class HConnectionManager implemen
         throw new IllegalArgumentException(
             "table name cannot be null or zero length");
       }
-            
+
       if (Bytes.equals(tableName, ROOT_TABLE_NAME)) {
         synchronized (rootRegionLock) {
           // This block guards against two threads trying to find the root
-          // region at the same time. One will go do the find while the 
+          // region at the same time. One will go do the find while the
           // second waits. The second thread will not do find.
-          
+
           if (!useCache || rootRegionLocation == null) {
             this.rootRegionLocation = locateRootRegion();
           }
           return this.rootRegionLocation;
-        }        
+        }
       } else if (Bytes.equals(tableName, META_TABLE_NAME)) {
         return locateRegionInMeta(ROOT_TABLE_NAME, tableName, row, useCache,
                                   metaRegionLock);
@@ -659,7 +659,7 @@ public class HConnectionManager implemen
       } else {
         deleteCachedLocation(tableName, row);
       }
-      
+
       // build the key of the meta region we should be looking for.
       // the extra 9's on the end are necessary to allow "exact" matches
       // without knowing the precise region names.
@@ -667,7 +667,7 @@ public class HConnectionManager implemen
         HConstants.NINES);
       for (int tries = 0; true; tries++) {
         if (tries >= numRetries) {
-          throw new NoServerForRegionException("Unable to find region for " 
+          throw new NoServerForRegionException("Unable to find region for "
             + Bytes.toStringBinary(row) + " after " + numRetries + " tries.");
         }
 
@@ -704,10 +704,10 @@ public class HConnectionManager implemen
             throw new TableNotFoundException(Bytes.toString(tableName));
           }
 
-          byte [] value = regionInfoRow.getValue(CATALOG_FAMILY, 
+          byte [] value = regionInfoRow.getValue(CATALOG_FAMILY,
               REGIONINFO_QUALIFIER);
           if (value == null || value.length == 0) {
-            throw new IOException("HRegionInfo was null or empty in " + 
+            throw new IOException("HRegionInfo was null or empty in " +
               Bytes.toString(parentTable));
           }
           // convert the row result into the HRegionLocation we need!
@@ -719,21 +719,21 @@ public class HConnectionManager implemen
               "Table '" + Bytes.toString(tableName) + "' was not found.");
           }
           if (regionInfo.isOffline()) {
-            throw new RegionOfflineException("region offline: " + 
+            throw new RegionOfflineException("region offline: " +
               regionInfo.getRegionNameAsString());
           }
-          
+
           value = regionInfoRow.getValue(CATALOG_FAMILY, SERVER_QUALIFIER);
           String serverAddress = "";
           if(value != null) {
             serverAddress = Bytes.toString(value);
           }
-          if (serverAddress.equals("")) { 
+          if (serverAddress.equals("")) {
             throw new NoServerForRegionException("No server address listed " +
               "in " + Bytes.toString(parentTable) + " for region " +
               regionInfo.getRegionNameAsString());
           }
-        
+
           // instantiate the location
           location = new HRegionLocation(regionInfo,
             new HServerAddress(serverAddress));
@@ -765,7 +765,7 @@ public class HConnectionManager implemen
           }
         }
         try{
-          Thread.sleep(getPauseTime(tries));              
+          Thread.sleep(getPauseTime(tries));
         } catch (InterruptedException e){
           // continue
         }
@@ -775,10 +775,10 @@ public class HConnectionManager implemen
     /*
      * Search the cache for a location that fits our table and row key.
      * Return null if no suitable region is located. TODO: synchronization note
-     * 
+     *
      * <p>TODO: This method during writing consumes 15% of CPU doing lookup
      * into the Soft Reference SortedMap.  Improve.
-     * 
+     *
      * @param tableName
      * @param row
      * @return Null or region location found in cache.
@@ -846,7 +846,7 @@ public class HConnectionManager implemen
      * Allows flushing the region cache.
      */
     public void clearRegionCache() {
-     this.cachedRegionLocations.clear();  
+     this.cachedRegionLocations.clear();
     }
 
     /*
@@ -893,7 +893,7 @@ public class HConnectionManager implemen
         }
       }
     }
-    
+
     /*
      * @param tableName
      * @return Map of cached locations for passed <code>tableName</code>
@@ -931,7 +931,7 @@ public class HConnectionManager implemen
     }
 
     public HRegionInterface getHRegionConnection(
-        HServerAddress regionServer, boolean getMaster) 
+        HServerAddress regionServer, boolean getMaster)
     throws IOException {
       if (getMaster) {
         getMaster();
@@ -944,7 +944,7 @@ public class HConnectionManager implemen
           try {
             server = (HRegionInterface)HBaseRPC.waitForProxy(
                 serverInterfaceClass, HBaseRPCProtocolVersion.versionID,
-                regionServer.getInetSocketAddress(), this.conf, 
+                regionServer.getInetSocketAddress(), this.conf,
                 this.maxRPCAttempts, this.rpcTimeout);
           } catch (RemoteException e) {
             throw RemoteExceptionHandler.decodeRemoteException(e);
@@ -954,9 +954,9 @@ public class HConnectionManager implemen
       }
       return server;
     }
-    
+
     public HRegionInterface getHRegionConnection(
-        HServerAddress regionServer) 
+        HServerAddress regionServer)
     throws IOException {
       return getHRegionConnection(regionServer, false);
     }
@@ -972,7 +972,7 @@ public class HConnectionManager implemen
      * @return HRegionLocation for root region if found
      * @throws NoServerForRegionException - if the root region can not be
      * located after retrying
-     * @throws IOException 
+     * @throws IOException
      */
     private HRegionLocation locateRootRegion()
     throws IOException {
@@ -1028,7 +1028,7 @@ public class HConnectionManager implemen
             throw new NoServerForRegionException("Timed out trying to locate "+
                 "root region because: " + t.getMessage());
           }
-          
+
           // Sleep and retry finding root region.
           try {
             if (LOG.isDebugEnabled()) {
@@ -1042,23 +1042,23 @@ public class HConnectionManager implemen
             // continue
           }
         }
-        
+
         rootRegionAddress = null;
       }
-      
+
       // if the address is null by this point, then the retries have failed,
       // and we're sort of sunk
       if (rootRegionAddress == null) {
         throw new NoServerForRegionException(
           "unable to locate root region server");
       }
-      
+
       // return the region location
       return new HRegionLocation(
         HRegionInfo.ROOT_REGIONINFO, rootRegionAddress);
     }
 
-    public <T> T getRegionServerWithRetries(ServerCallable<T> callable) 
+    public <T> T getRegionServerWithRetries(ServerCallable<T> callable)
     throws IOException, RuntimeException {
       List<Throwable> exceptions = new ArrayList<Throwable>();
       for(int tries = 0; tries < numRetries; tries++) {
@@ -1079,9 +1079,9 @@ public class HConnectionManager implemen
           // continue
         }
       }
-      return null;    
+      return null;
     }
-    
+
     public <T> T getRegionServerWithoutRetries(ServerCallable<T> callable)
         throws IOException, RuntimeException {
       try {



Mime
View raw message