hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apurt...@apache.org
Subject svn commit: r892720 - in /hadoop/hbase/branches/0.20_on_hadoop-0.18.3: ./ bin/ src/java/org/apache/hadoop/hbase/ src/java/org/apache/hadoop/hbase/client/ src/java/org/apache/hadoop/hbase/regionserver/ src/java/org/apache/hadoop/hbase/zookeeper/
Date Mon, 21 Dec 2009 08:09:06 GMT
Author: apurtell
Date: Mon Dec 21 08:09:05 2009
New Revision: 892720

URL: http://svn.apache.org/viewvc?rev=892720&view=rev
Log:
pull up to latest 0.20 branch

Modified:
    hadoop/hbase/branches/0.20_on_hadoop-0.18.3/CHANGES.txt
    hadoop/hbase/branches/0.20_on_hadoop-0.18.3/bin/HBase.rb
    hadoop/hbase/branches/0.20_on_hadoop-0.18.3/bin/hirb.rb
    hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/HTableDescriptor.java
    hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java
    hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
    hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java

Modified: hadoop/hbase/branches/0.20_on_hadoop-0.18.3/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_on_hadoop-0.18.3/CHANGES.txt?rev=892720&r1=892719&r2=892720&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_on_hadoop-0.18.3/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.20_on_hadoop-0.18.3/CHANGES.txt Mon Dec 21 08:09:05 2009
@@ -22,6 +22,8 @@
                (Benoit Sigoure via JD)
    HBASE-1960  Master should wait for DFS to come up when creating 
                hbase.version
+   HBASE-2054  memstore size 0 is >= than blocking -2.0g size
+   HBASE-2057  Cluster won't stop 
 
   IMPROVEMENTS
    HBASE-1961  HBase EC2 scripts
@@ -46,6 +48,10 @@
    HBASE-2052  Make hbase more 'live' when comes to noticing table creation, 
                splits, etc., for 0.20.3
    HBASE-2049  Cleanup HLog binary log output (Dave Latham via Stack)
+   HBASE-2060  Missing closing tag in mapreduce package info (Lars George via
+               Andrew Purtell)
+   HBASE-2028  Add HTable.incrementColumnValue support to shell (Lars George
+               via Andrew Purtell)
 
 Release 0.20.2 - November 18th, 2009
   INCOMPATIBLE CHANGES

Modified: hadoop/hbase/branches/0.20_on_hadoop-0.18.3/bin/HBase.rb
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_on_hadoop-0.18.3/bin/HBase.rb?rev=892720&r1=892719&r2=892720&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_on_hadoop-0.18.3/bin/HBase.rb (original)
+++ hadoop/hbase/branches/0.20_on_hadoop-0.18.3/bin/HBase.rb Mon Dec 21 08:09:05 2009
@@ -462,6 +462,22 @@
       @formatter.footer(now)
     end
 
+    def incr(row, column, value = nil)
+      now = Time.now 
+      split = KeyValue.parseColumn(column.to_java_bytes)
+      family = split[0]
+      qualifier = nil
+      if split.length > 1
+        qualifier = split[1]
+      end
+      if value == nil
+        value = 1
+      end
+      @table.incrementColumnValue(row.to_java_bytes, family, qualifier, value)
+      @formatter.header()
+      @formatter.footer(now)
+    end
+
     def isMetaTable()
       tn = @table.getTableName()
       return Bytes.equals(tn, HConstants::META_TABLE_NAME) ||
@@ -619,6 +635,12 @@
     if formatter.rowCount() != 3
       raise IOError.new("Failed endrow test")
     end
+    # Verify that incr works
+    table.incr('incr1', 'c:1');
+    table.scan({COLUMNS => ['c:1']})
+    if formatter.rowCount() != 1
+      raise IOError.new("Failed incr test")
+    end
     # Verify that delete works
     table.delete('x1', 'x:1');
     table.scan(['x:1'])

Modified: hadoop/hbase/branches/0.20_on_hadoop-0.18.3/bin/hirb.rb
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_on_hadoop-0.18.3/bin/hirb.rb?rev=892720&r1=892719&r2=892720&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_on_hadoop-0.18.3/bin/hirb.rb (original)
+++ hadoop/hbase/branches/0.20_on_hadoop-0.18.3/bin/hirb.rb Mon Dec 21 08:09:05 2009
@@ -234,6 +234,14 @@
            hbase> get 't1', 'r1', {COLUMN => 'c1', TIMESTAMP => ts1, \\
              VERSIONS => 4}
 
+ incr      Increments a cell 'value' at specified table/row/column coordinates.
+           To increment a cell value in table 't1' at row 'r1' under column
+           'c1' by 1 (can be omitted) or 10 do:
+
+           hbase> incr 't1', 'r1', 'c1'
+           hbase> incr 't1', 'r1', 'c1', 1
+           hbase> incr 't1', 'r1', 'c1', 10
+
  list      List all tables in hbase
 
  put       Put a cell 'value' at specified table/row/column and optionally
@@ -401,6 +409,10 @@
   table(table).put(row, column, value, timestamp)
 end
   
+def incr(table, row, column, value = nil)
+  table(table).incr(row, column, value)
+end
+
 def scan(table, args = {})
   table(table).scan(args)
 end

Modified: hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/HTableDescriptor.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/HTableDescriptor.java?rev=892720&r1=892719&r2=892720&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/HTableDescriptor.java
(original)
+++ hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/HTableDescriptor.java
Mon Dec 21 08:09:05 2009
@@ -92,9 +92,9 @@
 
   public static final boolean DEFAULT_READONLY = false;
 
-  public static final int DEFAULT_MEMSTORE_FLUSH_SIZE = 1024*1024*64;
+  public static final long DEFAULT_MEMSTORE_FLUSH_SIZE = 1024*1024*64L;
   
-  public static final int DEFAULT_MAX_FILESIZE = 1024*1024*256;
+  public static final long DEFAULT_MAX_FILESIZE = 1024*1024*256L;
     
   private volatile Boolean meta = null;
   private volatile Boolean root = null;
@@ -402,19 +402,19 @@
   /**
    * @return memory cache flush size for each hregion
    */
-  public int getMemStoreFlushSize() {
+  public long getMemStoreFlushSize() {
     byte [] value = getValue(MEMSTORE_FLUSHSIZE_KEY);
     if (value != null)
-      return Integer.valueOf(Bytes.toString(value)).intValue();
+      return Long.valueOf(Bytes.toString(value)).longValue();
     return DEFAULT_MEMSTORE_FLUSH_SIZE;
   }
   
   /**
    * @param memstoreFlushSize memory cache flush size for each hregion
    */
-  public void setMemStoreFlushSize(int memstoreFlushSize) {
+  public void setMemStoreFlushSize(long memstoreFlushSize) {
     setValue(MEMSTORE_FLUSHSIZE_KEY,
-      Bytes.toBytes(Integer.toString(memstoreFlushSize)));
+      Bytes.toBytes(Long.toString(memstoreFlushSize)));
   }
 
   /**

Modified: hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java?rev=892720&r1=892719&r2=892720&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java
(original)
+++ hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/client/UnmodifyableHTableDescriptor.java
Mon Dec 21 08:09:05 2009
@@ -108,10 +108,10 @@
   }
 
   /**
-   * @see org.apache.hadoop.hbase.HTableDescriptor#setMemStoreFlushSize(int)
+   * @see org.apache.hadoop.hbase.HTableDescriptor#setMemStoreFlushSize(long)
    */
   @Override
-  public void setMemStoreFlushSize(int memstoreFlushSize) {
+  public void setMemStoreFlushSize(long memstoreFlushSize) {
     throw new UnsupportedOperationException("HTableDescriptor is read-only");
   }
 

Modified: hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=892720&r1=892719&r2=892720&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
(original)
+++ hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/regionserver/HRegion.java
Mon Dec 21 08:09:05 2009
@@ -181,10 +181,10 @@
 
   private volatile WriteState writestate = new WriteState();
 
-  final int memstoreFlushSize;
+  final long memstoreFlushSize;
   private volatile long lastFlushTime;
   final FlushRequester flushListener;
-  private final int blockingMemStoreSize;
+  private final long blockingMemStoreSize;
   final long threadWakeFrequency;
   // Used to guard splits and closes
   private final ReentrantReadWriteLock splitsAndClosesLock =
@@ -215,11 +215,11 @@
    */
   public HRegion(){
     this.basedir = null;
-    this.blockingMemStoreSize = 0;
+    this.blockingMemStoreSize = 0L;
     this.conf = null;
     this.flushListener = null;
     this.fs = null;
-    this.memstoreFlushSize = 0;
+    this.memstoreFlushSize = 0L;
     this.log = null;
     this.regionCompactionDir = null;
     this.regiondir = null;
@@ -266,14 +266,14 @@
     }
     this.regionCompactionDir =
       new Path(getCompactionDir(basedir), encodedNameStr);
-    int flushSize = regionInfo.getTableDesc().getMemStoreFlushSize();
+    long flushSize = regionInfo.getTableDesc().getMemStoreFlushSize();
     if (flushSize == HTableDescriptor.DEFAULT_MEMSTORE_FLUSH_SIZE) {
-      flushSize = conf.getInt("hbase.hregion.memstore.flush.size",
+      flushSize = conf.getLong("hbase.hregion.memstore.flush.size",
                       HTableDescriptor.DEFAULT_MEMSTORE_FLUSH_SIZE);
     }
     this.memstoreFlushSize = flushSize;
     this.blockingMemStoreSize = this.memstoreFlushSize *
-      conf.getInt("hbase.hregion.memstore.block.multiplier", 1);
+      conf.getLong("hbase.hregion.memstore.block.multiplier", 2);
   }
 
   /**
@@ -2385,7 +2385,7 @@
   }
 
   public static final long FIXED_OVERHEAD = ClassSize.align(
-      (3 * Bytes.SIZEOF_LONG) + (2 * Bytes.SIZEOF_INT) + Bytes.SIZEOF_BOOLEAN +
+      (5 * Bytes.SIZEOF_LONG) + Bytes.SIZEOF_BOOLEAN +
       (19 * ClassSize.REFERENCE) + ClassSize.OBJECT);
   
   public static final long DEEP_OVERHEAD = ClassSize.align(FIXED_OVERHEAD +

Modified: hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java?rev=892720&r1=892719&r2=892720&view=diff
==============================================================================
--- hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
(original)
+++ hadoop/hbase/branches/0.20_on_hadoop-0.18.3/src/java/org/apache/hadoop/hbase/zookeeper/ZooKeeperWrapper.java
Mon Dec 21 08:09:05 2009
@@ -345,7 +345,11 @@
     } catch (InterruptedException e) {
       LOG.warn("Failed to set state node in ZooKeeper", e);
     } catch (KeeperException e) {
-      LOG.warn("Failed to set state node in ZooKeeper", e);
+      if(e.code() == KeeperException.Code.NODEEXISTS) {
+        LOG.debug("State node exists.");
+      } else {
+        LOG.warn("Failed to set state node in ZooKeeper", e);
+      }
     }
 
     return false;



Mime
View raw message