hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From st...@apache.org
Subject svn commit: r1582553 - /hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
Date Thu, 27 Mar 2014 23:53:47 GMT
Author: stack
Date: Thu Mar 27 23:53:46 2014
New Revision: 1582553

URL: http://svn.apache.org/r1582553
Log:
HBASE-10853 NPE in RSRpcServices.get on trunk

Modified:
    hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java

Modified: hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
URL: http://svn.apache.org/viewvc/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java?rev=1582553&r1=1582552&r2=1582553&view=diff
==============================================================================
--- hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
(original)
+++ hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/RSRpcServices.java
Thu Mar 27 23:53:46 2014
@@ -404,8 +404,10 @@ public class RSRpcServices implements HB
         region.getCoprocessorHost().postAppend(append, r);
       }
     }
-    regionServer.metricsRegionServer.updateAppend(
-      EnvironmentEdgeManager.currentTimeMillis() - before);
+    if (regionServer.metricsRegionServer != null) {
+      regionServer.metricsRegionServer.updateAppend(
+        EnvironmentEdgeManager.currentTimeMillis() - before);
+    }
     return r;
   }
 
@@ -438,8 +440,10 @@ public class RSRpcServices implements HB
         r = region.getCoprocessorHost().postIncrement(increment, r);
       }
     }
-    regionServer.metricsRegionServer.updateIncrement(
-      EnvironmentEdgeManager.currentTimeMillis() - before);
+    if (regionServer.metricsRegionServer != null) {
+      regionServer.metricsRegionServer.updateIncrement(
+        EnvironmentEdgeManager.currentTimeMillis() - before);
+    }
     return r;
   }
 
@@ -609,12 +613,14 @@ public class RSRpcServices implements HB
         builder.addResultOrException(getResultOrException(ie, mutations.get(i).getIndex()));
       }
     }
-    long after = EnvironmentEdgeManager.currentTimeMillis();
-    if (batchContainsPuts) {
-      regionServer.metricsRegionServer.updatePut(after - before);
-    }
-    if (batchContainsDelete) {
-      regionServer.metricsRegionServer.updateDelete(after - before);
+    if (regionServer.metricsRegionServer != null) {
+      long after = EnvironmentEdgeManager.currentTimeMillis();
+      if (batchContainsPuts) {
+        regionServer.metricsRegionServer.updatePut(after - before);
+      }
+      if (batchContainsDelete) {
+        regionServer.metricsRegionServer.updateDelete(after - before);
+      }
     }
   }
 
@@ -649,12 +655,14 @@ public class RSRpcServices implements HB
       }
       return region.batchReplay(mArray);
     } finally {
-      long after = EnvironmentEdgeManager.currentTimeMillis();
-      if (batchContainsPuts) {
-        regionServer.metricsRegionServer.updatePut(after - before);
-      }
-      if (batchContainsDelete) {
-        regionServer.metricsRegionServer.updateDelete(after - before);
+      if (regionServer.metricsRegionServer != null) {
+        long after = EnvironmentEdgeManager.currentTimeMillis();
+          if (batchContainsPuts) {
+          regionServer.metricsRegionServer.updatePut(after - before);
+        }
+        if (batchContainsDelete) {
+          regionServer.metricsRegionServer.updateDelete(after - before);
+        }
       }
     }
   }
@@ -1334,8 +1342,10 @@ public class RSRpcServices implements HB
     } catch (IOException ie) {
       throw new ServiceException(ie);
     } finally {
-      regionServer.metricsRegionServer.updateReplay(
-        EnvironmentEdgeManager.currentTimeMillis() - before);
+      if (regionServer.metricsRegionServer != null) {
+        regionServer.metricsRegionServer.updateReplay(
+          EnvironmentEdgeManager.currentTimeMillis() - before);
+      }
     }
   }
 
@@ -1574,8 +1584,10 @@ public class RSRpcServices implements HB
     } catch (IOException ie) {
       throw new ServiceException(ie);
     } finally {
-      regionServer.metricsRegionServer.updateGet(
-        EnvironmentEdgeManager.currentTimeMillis() - before);
+      if (regionServer.metricsRegionServer != null) {
+        regionServer.metricsRegionServer.updateGet(
+          EnvironmentEdgeManager.currentTimeMillis() - before);
+      }
     }
   }
 



Mime
View raw message