hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r652431 - in /hadoop/hbase/branches/0.1: ./ src/java/org/apache/hadoop/hbase/ src/test/org/apache/hadoop/hbase/
Date Thu, 01 May 2008 05:39:14 GMT
Author: stack
Date: Wed Apr 30 22:39:14 2008
New Revision: 652431

URL: http://svn.apache.org/viewvc?rev=652431&view=rev
Log:
HBASE-609 Master doesn't see regionserver edits because of clock skew

Modified:
    hadoop/hbase/branches/0.1/CHANGES.txt
    hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HBaseAdmin.java
    hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMaster.java
    hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMerge.java
    hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegion.java
    hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionInterface.java
    hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionServer.java
    hadoop/hbase/branches/0.1/src/test/org/apache/hadoop/hbase/MultiRegionTable.java

Modified: hadoop/hbase/branches/0.1/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/CHANGES.txt?rev=652431&r1=652430&r2=652431&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/CHANGES.txt (original)
+++ hadoop/hbase/branches/0.1/CHANGES.txt Wed Apr 30 22:39:14 2008
@@ -27,6 +27,7 @@
    HBASE-604   Don't allow CLASSPATH from environment pollute the hbase CLASSPATH
    HBASE-608   HRegionServer::getThisIP() checks hadoop config var for dns interface name
                (Jim R. Wilson via Stack)
+   HBASE-609   Master doesn't see regionserver edits because of clock skew
 
   IMPROVEMENTS
    HBASE-559   MR example job to count table rows

Modified: hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HBaseAdmin.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HBaseAdmin.java?rev=652431&r1=652430&r2=652431&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HBaseAdmin.java (original)
+++ hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HBaseAdmin.java Wed Apr 30
22:39:14 2008
@@ -188,7 +188,7 @@
       try {
         scannerId =
           server.openScanner(firstMetaServer.getRegionInfo().getRegionName(),
-            COL_REGIONINFO_ARRAY, tableName, System.currentTimeMillis(), null);
+            COL_REGIONINFO_ARRAY, tableName, HConstants.LATEST_TIMESTAMP, null);
         HbaseMapWritable values = server.next(scannerId);
         if (values == null || values.size() == 0) {
           break;
@@ -269,7 +269,7 @@
       try {
         scannerId =
           server.openScanner(firstMetaServer.getRegionInfo().getRegionName(),
-            COL_REGIONINFO_ARRAY, tableName, System.currentTimeMillis(), null);
+            COL_REGIONINFO_ARRAY, tableName, HConstants.LATEST_TIMESTAMP, null);
         boolean isenabled = false;
         
         while (true) {
@@ -370,7 +370,7 @@
       try {
         scannerId =
           server.openScanner(firstMetaServer.getRegionInfo().getRegionName(),
-            COL_REGIONINFO_ARRAY, tableName, System.currentTimeMillis(), null);
+            COL_REGIONINFO_ARRAY, tableName, HConstants.LATEST_TIMESTAMP, null);
         
         boolean disabled = false;
         while (true) {

Modified: hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMaster.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMaster.java?rev=652431&r1=652430&r2=652431&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMaster.java (original)
+++ hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMaster.java Wed Apr 30 22:39:14
2008
@@ -226,7 +226,7 @@
         regionServer = connection.getHRegionConnection(region.getServer());
         scannerId =
           regionServer.openScanner(region.getRegionName(), COLUMN_FAMILY_ARRAY,
-              EMPTY_START_ROW, System.currentTimeMillis(), null);
+              EMPTY_START_ROW, HConstants.LATEST_TIMESTAMP, null);
 
         int numberOfRegionsFound = 0;
         while (true) {
@@ -420,7 +420,7 @@
       BatchUpdate b = new BatchUpdate(rand.nextLong());
       long lockid = b.startUpdate(parent);
       b.delete(lockid, splitColumn);
-      srvr.batchUpdate(metaRegionName, System.currentTimeMillis(), b);
+      srvr.batchUpdate(metaRegionName, b);
         
       return result;
     }
@@ -2222,7 +2222,7 @@
             scannerId =
               server.openScanner(HRegionInfo.rootRegionInfo.getRegionName(),
                   COLUMN_FAMILY_ARRAY, EMPTY_START_ROW,
-                  System.currentTimeMillis(), null);
+                  HConstants.LATEST_TIMESTAMP, null);
             
             scanMetaRegion(server, scannerId,
                 HRegionInfo.rootRegionInfo.getRegionName());
@@ -2272,7 +2272,7 @@
 
             scannerId =
               server.openScanner(r.getRegionName(), COLUMN_FAMILY_ARRAY,
-                  EMPTY_START_ROW, System.currentTimeMillis(), null);
+                  EMPTY_START_ROW, HConstants.LATEST_TIMESTAMP, null);
 
             scanMetaRegion(server, scannerId, r.getRegionName());
 
@@ -2506,7 +2506,7 @@
           b.put(lockid, COL_SERVER,
             Writables.stringToBytes(serverAddress.toString()));
           b.put(lockid, COL_STARTCODE, startCode);
-          server.batchUpdate(metaRegionName, System.currentTimeMillis(), b);
+          server.batchUpdate(metaRegionName, b);
           if (isMetaTable) {
             // It's a meta region.
             MetaRegion m = new MetaRegion(this.serverAddress,
@@ -2611,7 +2611,7 @@
       Text metaRegionName = m.getRegionName();
       HRegionInterface server = connection.getHRegionConnection(m.getServer());
       long scannerid = server.openScanner(metaRegionName, COL_REGIONINFO_ARRAY,
-          tableName, System.currentTimeMillis(), null);
+          tableName, HConstants.LATEST_TIMESTAMP, null);
       try {
         HbaseMapWritable data = server.next(scannerid);
             
@@ -2647,7 +2647,7 @@
       BatchUpdate b = new BatchUpdate(rand.nextLong());
       long lockid = b.startUpdate(regionName);
       b.put(lockid, COL_REGIONINFO, Writables.getBytes(info));
-      server.batchUpdate(metaRegionName, System.currentTimeMillis(), b);
+      server.batchUpdate(metaRegionName, b);
 
       // 4. Close the new region to flush it to disk.  Close its log file too.
       
@@ -2760,7 +2760,7 @@
 
               long scannerId =
                 server.openScanner(m.getRegionName(), COLUMN_FAMILY_ARRAY,
-                    tableName, System.currentTimeMillis(), null);
+                    tableName, HConstants.LATEST_TIMESTAMP, null);
 
               List<Text> emptyRows = new ArrayList<Text>();
               try {
@@ -2911,7 +2911,7 @@
         updateRegionInfo(b, i);
         b.delete(lockid, COL_SERVER);
         b.delete(lockid, COL_STARTCODE);
-        server.batchUpdate(m.getRegionName(), System.currentTimeMillis(), b);
+        server.batchUpdate(m.getRegionName(), b);
         if (LOG.isDebugEnabled()) {
           LOG.debug("updated columns in row: " + i.getRegionName());
         }
@@ -3047,7 +3047,7 @@
       BatchUpdate b = new BatchUpdate(rand.nextLong());
       long lockid = b.startUpdate(i.getRegionName());
       b.put(lockid, COL_REGIONINFO, Writables.getBytes(i));
-      server.batchUpdate(regionName, System.currentTimeMillis(), b);
+      server.batchUpdate(regionName, b);
       if (LOG.isDebugEnabled()) {
         LOG.debug("updated columns in row: " + i.getRegionName());
       }

Modified: hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMerge.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMerge.java?rev=652431&r1=652430&r2=652431&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMerge.java (original)
+++ hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HMerge.java Wed Apr 30 22:39:14
2008
@@ -346,7 +346,7 @@
           HRegionInfo.rootRegionInfo, null, null);
 
       HScannerInterface rootScanner = root.getScanner(COL_REGIONINFO_ARRAY,
-          new Text(), System.currentTimeMillis(), null);
+          new Text(), HConstants.LATEST_TIMESTAMP, null);
       
       try {
         HStoreKey key = new HStoreKey();
@@ -397,7 +397,7 @@
         b.delete(lockid, COL_STARTCODE);
         b.delete(lockid, COL_SPLITA);
         b.delete(lockid, COL_SPLITB);
-        root.batchUpdate(System.currentTimeMillis(), b);
+        root.batchUpdate(HConstants.LATEST_TIMESTAMP, b);
         lockid = -1L;
 
         if(LOG.isDebugEnabled()) {

Modified: hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegion.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegion.java?rev=652431&r1=652430&r2=652431&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegion.java (original)
+++ hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegion.java Wed Apr 30 22:39:14
2008
@@ -2027,7 +2027,8 @@
    *
    * @throws IOException
    */
-  public static void addRegionToMETA(HRegion meta, HRegion r) throws IOException {
+  public static void addRegionToMETA(HRegion meta, HRegion r)
+  throws IOException {
     meta.checkResources();
     // The row key is the region name
     Text row = r.getRegionName();
@@ -2038,7 +2039,6 @@
       TreeMap<HStoreKey, byte[]> edits = new TreeMap<HStoreKey, byte[]>();
       edits.put(key, Writables.getBytes(r.getRegionInfo()));
       meta.update(edits);
-    
     } finally {
       meta.releaseRowLock(row);
     }
@@ -2079,7 +2079,7 @@
     b.delete(lockid, COL_STARTCODE);
     // If carrying splits, they'll be in place when we show up on new
     // server.
-    srvr.batchUpdate(metaRegionName, System.currentTimeMillis(), b);
+    srvr.batchUpdate(metaRegionName, b);
   }
 
   /**

Modified: hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionInterface.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionInterface.java?rev=652431&r1=652430&r2=652431&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionInterface.java (original)
+++ hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionInterface.java Wed Apr
30 22:39:14 2008
@@ -132,7 +132,17 @@
    */
   public void batchUpdate(Text regionName, long timestamp, BatchUpdate b)
   throws IOException;
-  
+
+  /**
+   * Applies a batch of updates via one RPC
+   * 
+   * @param regionName name of the region to update
+   * @param b BatchUpdate
+   * @throws IOException
+   */
+  public void batchUpdate(Text regionName, BatchUpdate b)
+  throws IOException;
+
   /**
    * Delete all cells that match the passed row and column and whose
    * timestamp is equal-to or older than the passed timestamp.
@@ -212,4 +222,4 @@
    * @throws IOException
    */
   public void close(long scannerId) throws IOException;
-}
+}
\ No newline at end of file

Modified: hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionServer.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionServer.java?rev=652431&r1=652430&r2=652431&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionServer.java (original)
+++ hadoop/hbase/branches/0.1/src/java/org/apache/hadoop/hbase/HRegionServer.java Wed Apr
30 22:39:14 2008
@@ -1533,6 +1533,16 @@
     }
   }
 
+  /**
+   * Used by master so it can add an update with the current time of this
+   * server rather than current time on master
+   * {@inheritDoc}
+   */
+  public void batchUpdate(Text regionName, BatchUpdate b)
+  throws IOException {
+    batchUpdate(regionName, System.currentTimeMillis(), b);
+  }
+
   /** {@inheritDoc} */
   public void batchUpdate(Text regionName, long timestamp, BatchUpdate b)
     throws IOException {

Modified: hadoop/hbase/branches/0.1/src/test/org/apache/hadoop/hbase/MultiRegionTable.java
URL: http://svn.apache.org/viewvc/hadoop/hbase/branches/0.1/src/test/org/apache/hadoop/hbase/MultiRegionTable.java?rev=652431&r1=652430&r2=652431&view=diff
==============================================================================
--- hadoop/hbase/branches/0.1/src/test/org/apache/hadoop/hbase/MultiRegionTable.java (original)
+++ hadoop/hbase/branches/0.1/src/test/org/apache/hadoop/hbase/MultiRegionTable.java Wed Apr
30 22:39:14 2008
@@ -223,7 +223,7 @@
     int size = 0;
     Text [] cols = new Text[] {HConstants.COLUMN_FAMILY};
     HScannerInterface s = t.obtainScanner(cols, HConstants.EMPTY_START_ROW,
-      System.currentTimeMillis(), null);
+      HConstants.LATEST_TIMESTAMP, null);
     try {
       HStoreKey curKey = new HStoreKey();
       TreeMap<Text, byte []> curVals = new TreeMap<Text, byte []>();
@@ -249,7 +249,7 @@
       final HRegionInfo parent)
   throws IOException {  
     HScannerInterface s = t.obtainScanner(HConstants.COLUMN_FAMILY_ARRAY,
-        HConstants.EMPTY_START_ROW, System.currentTimeMillis(), null);
+        HConstants.EMPTY_START_ROW, HConstants.LATEST_TIMESTAMP, null);
     try {
       HStoreKey curKey = new HStoreKey();
       TreeMap<Text, byte []> curVals = new TreeMap<Text, byte []>();



Mime
View raw message