hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zhang...@apache.org
Subject [5/5] hbase git commit: HBASE-12405 WAL accounting by Store
Date Tue, 10 Mar 2015 05:00:36 GMT
HBASE-12405 WAL accounting by Store


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/9b53a1c2
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9b53a1c2
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9b53a1c2

Branch: refs/heads/master
Commit: 9b53a1c214f87bd0a38b12e8d308e7e3bde6de84
Parents: 0654d13
Author: zhangduo <zhangduo@wandoujia.com>
Authored: Tue Mar 10 12:56:48 2015 +0800
Committer: zhangduo <zhangduo@wandoujia.com>
Committed: Tue Mar 10 13:00:02 2015 +0800

----------------------------------------------------------------------
 .../org/apache/hadoop/hbase/RegionLoad.java     |   10 +
 .../hbase/protobuf/ResponseConverter.java       |    7 +-
 .../apache/hadoop/hbase/zookeeper/ZKUtil.java   |   13 +-
 .../protobuf/generated/ClusterStatusProtos.java | 2003 +++++++++++++++++-
 .../generated/RegionServerStatusProtos.java     |  569 ++++-
 .../protobuf/generated/ZooKeeperProtos.java     | 1417 +------------
 .../src/main/protobuf/ClusterStatus.proto       |   20 +
 .../src/main/protobuf/RegionServerStatus.proto  |    5 +-
 .../src/main/protobuf/ZooKeeper.proto           |   17 -
 .../SplitLogWorkerCoordination.java             |    4 +-
 .../ZKSplitLogManagerCoordination.java          |    2 +-
 .../ZkSplitLogWorkerCoordination.java           |    6 +-
 .../hadoop/hbase/master/MasterRpcServices.java  |   11 +-
 .../hadoop/hbase/master/ServerManager.java      |   71 +-
 .../hadoop/hbase/regionserver/HRegion.java      |   35 +-
 .../hbase/regionserver/HRegionServer.java       |   33 +-
 .../hbase/regionserver/LastSequenceId.java      |   10 +-
 .../hbase/regionserver/wal/FSWALEntry.java      |   30 +-
 .../apache/hadoop/hbase/wal/WALSplitter.java    |   45 +-
 .../hadoop/hbase/zookeeper/ZKSplitLog.java      |    4 +-
 .../master/TestGetLastFlushedSequenceId.java    |   19 +-
 .../regionserver/TestPerColumnFamilyFlush.java  |   34 +-
 22 files changed, 2746 insertions(+), 1619 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/9b53a1c2/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java
index 794e8b2..a6e846e 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/RegionLoad.java
@@ -20,9 +20,12 @@
 
 package org.apache.hadoop.hbase;
 
+import java.util.List;
+
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.classification.InterfaceStability;
 import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos;
+import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.StoreSequenceId;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Strings;
 
@@ -154,6 +157,13 @@ public class RegionLoad {
   }
 
   /**
+   * @return completed sequence id per store.
+   */
+  public List<StoreSequenceId> getStoreCompleteSequenceId() {
+    return regionLoadPB.getStoreCompleteSequenceIdList();
+  }
+
+  /**
    * @return the uncompressed size of the storefiles in MB.
    */
   public int getStoreUncompressedSizeMB() {

http://git-wip-us.apache.org/repos/asf/hbase/blob/9b53a1c2/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java
b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java
index 600c515..65eadde 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/protobuf/ResponseConverter.java
@@ -44,6 +44,7 @@ import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.RegionAction;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.RegionActionResult;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ResultOrException;
 import org.apache.hadoop.hbase.protobuf.generated.ClientProtos.ScanResponse;
+import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionStoreSequenceIds;
 import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos;
 import org.apache.hadoop.hbase.protobuf.generated.HBaseProtos.NameBytesPair;
 import org.apache.hadoop.hbase.protobuf.generated.MasterProtos.EnableCatalogJanitorResponse;
@@ -300,8 +301,10 @@ public final class ResponseConverter {
    * @return A GetLastFlushedSequenceIdResponse
    */
   public static GetLastFlushedSequenceIdResponse buildGetLastFlushedSequenceIdResponse(
-      long seqId) {
-    return GetLastFlushedSequenceIdResponse.newBuilder().setLastFlushedSequenceId(seqId).build();
+      RegionStoreSequenceIds ids) {
+    return GetLastFlushedSequenceIdResponse.newBuilder()
+        .setLastFlushedSequenceId(ids.getLastFlushedSequenceId())
+        .addAllStoreLastFlushedSequenceId(ids.getStoreSequenceIdList()).build();
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/hbase/blob/9b53a1c2/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
----------------------------------------------------------------------
diff --git a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
index c3a159f..413bc98 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
@@ -45,8 +45,9 @@ import org.apache.hadoop.hbase.ServerName;
 import org.apache.hadoop.hbase.classification.InterfaceAudience;
 import org.apache.hadoop.hbase.exceptions.DeserializationException;
 import org.apache.hadoop.hbase.protobuf.ProtobufUtil;
+import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos;
+import org.apache.hadoop.hbase.protobuf.generated.ClusterStatusProtos.RegionStoreSequenceIds;
 import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos;
-import org.apache.hadoop.hbase.protobuf.generated.ZooKeeperProtos.RegionStoreSequenceIds;
 import org.apache.hadoop.hbase.util.ByteStringer;
 import org.apache.hadoop.hbase.util.Bytes;
 import org.apache.hadoop.hbase.util.Threads;
@@ -2102,10 +2103,10 @@ public class ZKUtil {
    */
   public static byte[] regionSequenceIdsToByteArray(final Long regionLastFlushedSequenceId,
       final Map<byte[], Long> storeSequenceIds) {
-    ZooKeeperProtos.RegionStoreSequenceIds.Builder regionSequenceIdsBuilder =
-        ZooKeeperProtos.RegionStoreSequenceIds.newBuilder();
-    ZooKeeperProtos.StoreSequenceId.Builder storeSequenceIdBuilder =
-        ZooKeeperProtos.StoreSequenceId.newBuilder();
+    ClusterStatusProtos.RegionStoreSequenceIds.Builder regionSequenceIdsBuilder =
+        ClusterStatusProtos.RegionStoreSequenceIds.newBuilder();
+    ClusterStatusProtos.StoreSequenceId.Builder storeSequenceIdBuilder =
+        ClusterStatusProtos.StoreSequenceId.newBuilder();
     if (storeSequenceIds != null) {
       for (Map.Entry<byte[], Long> e : storeSequenceIds.entrySet()){
         byte[] columnFamilyName = e.getKey();
@@ -2132,7 +2133,7 @@ public class ZKUtil {
       throw new DeserializationException("Unable to parse RegionStoreSequenceIds.");
     }
     RegionStoreSequenceIds.Builder regionSequenceIdsBuilder =
-        ZooKeeperProtos.RegionStoreSequenceIds.newBuilder();
+        ClusterStatusProtos.RegionStoreSequenceIds.newBuilder();
     int pblen = ProtobufUtil.lengthOfPBMagic();
     RegionStoreSequenceIds storeIds = null;
     try {


Mime
View raw message