hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdcry...@apache.org
Subject svn commit: r917783 - in /hadoop/hbase/trunk: ./ core/src/main/java/org/apache/hadoop/hbase/client/ core/src/main/java/org/apache/hadoop/hbase/regionserver/ core/src/test/java/org/apache/hadoop/hbase/client/
Date Mon, 01 Mar 2010 23:00:55 GMT
Author: jdcryans
Date: Mon Mar  1 23:00:55 2010
New Revision: 917783

URL: http://svn.apache.org/viewvc?rev=917783&view=rev
Log:
HBASE-2245  Unnecessary call to syncWal(region); in HRegionServer 
            (Benoit Sigoure via JD)
HBASE-2246  Add a getConfiguration method to HTableInterface
            (Benoit Sigoure via JD)

Modified:
    hadoop/hbase/trunk/CHANGES.txt
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/client/HTable.java
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java
    hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
    hadoop/hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java

Modified: hadoop/hbase/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/CHANGES.txt?rev=917783&r1=917782&r2=917783&view=diff
==============================================================================
--- hadoop/hbase/trunk/CHANGES.txt (original)
+++ hadoop/hbase/trunk/CHANGES.txt Mon Mar  1 23:00:55 2010
@@ -395,6 +395,10 @@
    HBASE-2262  ZKW.ensureExists should check for existence
    HBASE-2264  Adjust the contrib apps to the Maven project layout 
                (Lars Francke via Lars George)
+   HBASE-2245  Unnecessary call to syncWal(region); in HRegionServer 
+               (Benoit Sigoure via JD)
+   HBASE-2246  Add a getConfiguration method to HTableInterface
+               (Benoit Sigoure via JD)
 
   NEW FEATURES
    HBASE-1961  HBase EC2 scripts

Modified: hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/client/HTable.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/client/HTable.java?rev=917783&r1=917782&r2=917783&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/client/HTable.java (original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/client/HTable.java Mon Mar
 1 23:00:55 2010
@@ -155,6 +155,10 @@
         new DaemonThreadFactory());
   }
 
+  public Configuration getConfiguration() {
+    return configuration;
+  }
+
   /**
    * TODO Might want to change this to public, would be nice if the number
    * of threads would automatically change when servers were added and removed

Modified: hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java?rev=917783&r1=917782&r2=917783&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java
(original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/client/HTableInterface.java
Mon Mar  1 23:00:55 2010
@@ -22,6 +22,7 @@
 import java.io.IOException;
 import java.util.List;
 
+import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.HTableDescriptor;
 
 /**
@@ -38,6 +39,13 @@
   byte[] getTableName();
 
   /**
+   * Gets the configuration of this instance.
+   *
+   * @return The configuration.
+   */
+  Configuration getConfiguration();
+
+  /**
    * Gets the table descriptor for this table.
    *
    * @return table metadata

Modified: hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java?rev=917783&r1=917782&r2=917783&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
(original)
+++ hadoop/hbase/trunk/core/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Mon Mar  1 23:00:55 2010
@@ -1684,9 +1684,12 @@
       if (!region.getRegionInfo().isMetaTable()) {
         this.cacheFlusher.reclaimMemStoreMemory();
       }
-      region.put(put, getLockFromId(put.getLockId()));
+      boolean writeToWAL = put.getWriteToWAL();
+      region.put(put, getLockFromId(put.getLockId()), writeToWAL);
 
-      this.syncWal(region);
+      if (writeToWAL) {
+        this.syncWal(region);
+      }
     } catch (Throwable t) {
       throw convertThrowableToIOE(cleanup(t));
     }
@@ -1698,6 +1701,7 @@
     int i = 0;
     checkOpen();
     HRegion region = null;
+    boolean writeToWAL = true;
     try {
       region = getRegion(regionName);
       if (!region.getRegionInfo().isMetaTable()) {
@@ -1706,6 +1710,7 @@
       for (i = 0; i < puts.length; i++) {
         this.requestCount.incrementAndGet();
         Integer lock = getLockFromId(puts[i].getLockId());
+        writeToWAL &= puts[i].getWriteToWAL();
         region.put(puts[i], lock);
       }
 
@@ -1720,7 +1725,9 @@
     }
     // All have been processed successfully.
 
-    this.syncWal(region);
+    if (writeToWAL) {
+      this.syncWal(region);
+    }
     return -1;
   }
 
@@ -2378,7 +2385,9 @@
       long retval = region.incrementColumnValue(row, family, qualifier, amount,
           writeToWAL);
 
-      syncWal(region);
+      if (writeToWAL) {
+        syncWal(region);
+      }
 
       return retval;
     } catch (IOException e) {

Modified: hadoop/hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java?rev=917783&r1=917782&r2=917783&view=diff
==============================================================================
--- hadoop/hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
(original)
+++ hadoop/hbase/trunk/core/src/test/java/org/apache/hadoop/hbase/client/TestFromClientSide.java
Mon Mar  1 23:00:55 2010
@@ -21,6 +21,7 @@
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertSame;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 
@@ -107,6 +108,19 @@
   }
 
   /**
+   * Verifies that getConfiguration returns the same Configuration object used
+   * to create the HTable instance.
+   */
+  @Test
+  public void testGetConfiguration() throws Exception {
+    byte[] TABLE = Bytes.toBytes("testGetConfiguration");
+    byte[][] FAMILIES = new byte[][] { Bytes.toBytes("foo") };
+    Configuration conf = TEST_UTIL.getConfiguration();
+    HTable table = TEST_UTIL.createTable(TABLE, FAMILIES);
+    assertSame(conf, table.getConfiguration());
+  }
+
+  /**
    * Test from client side of an involved filter against a multi family that
    * involves deletes.
    * 



Mime
View raw message