Review Board 1.7.22


HBASE-5869 Move SplitLogManager splitlog taskstate and AssignmentManager RegionTransitionData znode datas to pb

Review Request #4926 - Created April 28, 2012 and updated

Michael Stack
HBASE-5869
Reviewers
hbase
jxiang
hbase-git
Convert two zk users to pb: distributed log splitting and regions in transition.

Refactored distributed log splitting so we only serialize/deserialize in one location.
Less changes needed to do same for regions in transition.

Moves serialization/deserialization out of the ZKAssign, ZKSplit and into
the classes themselves so can encapsulate how serialization is done into one place
(try to make the ZK* classes just deal in bytes -- about 90% done).

Moved classes used by various packages up to top level to minimize imports
that are across package (zookeeper into protobuf and/or into regionserver and/or
master packages, etc).

A src/main/java/org/apache/hadoop/hbase/DeserializationException.java
  New generic deserialization exception.
A src/main/java/org/apache/hadoop/hbase/zookeeper/EmptyWatcher.java
D  src/main/java/org/apache/hadoop/hbase/EmptyWatcher.java
  Moved under zookeeper package.
A src/main/java/org/apache/hadoop/hbase/HBaseException.java
  New base hbase exception as suggested by hbase-5796.  New DeserializationException
  inherits from this.
A src/main/java/org/apache/hadoop/hbase/RegionTransition.java
  State of a region in transition.  Top-level because used by a
  few top-level packages.  Encapsulates pb serialization/deserialization.
M src/main/java/org/apache/hadoop/hbase/ServerName.java
  Add method to deserialize a ServeName, etc.  Encapsulates pb'ing.
M src/main/java/org/apache/hadoop/hbase/SplitLogCounters.java
  Counters used by distributed log splitting.
A SplitLogTask
   Class that encapsulates log splitting state.  Also encapsulates pb'ing.
M src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java
  Implement code for state.  Added functions to go from code to state and vice
  versa.  Used serializing.
M src/main/java/org/apache/hadoop/hbase/executor/ExecutorService.java
  Remove unused imports.
D src/main/java/org/apache/hadoop/hbase/executor/RegionTransitionData.java
  Removed.  Replaced by RegionTransition moved to package top-level.
M src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java
M src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
  Use new DeserializationException. Move to using new RegionTransition
  from RegionTransitionData class.  Pass deserialized class rather than
  byte array.  Remove duplicated code.
M src/main/java/org/apache/hadoop/hbase/master/HMaster.java
  Use new ServerName parse method rather than ZKUtil one.
M src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
M src/main/java/org/apache/hadoop/hbase/regionserver/SplitLogWorker.java
  Redo to use new SplitLogTask and SplitLogCounter classes.
M src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
  expectPBMagicPrefix added
M src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java
  Use new RegionTransition in place of RegionTransitionData.
M src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogSplitter.java
  Define moved from ZKSplitLog to SplitLogManager.
M src/main/java/org/apache/hadoop/hbase/zookeeper/MasterAddressTracker.java
M src/main/java/org/apache/hadoop/hbase/zookeeper/RootRegionTracker.java
  Changed method name from getZNodeData to toByteArray to match how we've
  named it elsewhere. Use new DeserializationException
M src/main/java/org/apache/hadoop/hbase/zookeeper/ZKAssign.java
  Use new RegionTransion class
M src/main/java/org/apache/hadoop/hbase/zookeeper/ZKSplitLog.java
  Moved stuff that was in here up into SplitLogManager where better
  belongs.  Also moved serialization/deserialization up into the
  class itself: SplitLogTask.  Moved counters out to SplitLogCounter class.
M src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java
  Moved deserialization of ServerName out of here and up into ServerName.
M src/main/protobuf/ZooKeeper.proto
  Add two new classes, RegionTransition and SplitLogTask.

 
src/main/java/org/apache/hadoop/hbase/DeserializationException.java
New File

    
   
1
/**

    
   
2
 * Licensed to the Apache Software Foundation (ASF) under one

    
   
3
 * or more contributor license agreements.  See the NOTICE file

    
   
4
 * distributed with this work for additional information

    
   
5
 * regarding copyright ownership.  The ASF licenses this file

    
   
6
 * to you under the Apache License, Version 2.0 (the

    
   
7
 * "License"); you may not use this file except in compliance

    
   
8
 * with the License.  You may obtain a copy of the License at

    
   
9
 *

    
   
10
 *     http://www.apache.org/licenses/LICENSE-2.0

    
   
11
 *

    
   
12
 * Unless required by applicable law or agreed to in writing, software

    
   
13
 * distributed under the License is distributed on an "AS IS" BASIS,

    
   
14
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

    
   
15
 * See the License for the specific language governing permissions and

    
   
16
 * limitations under the License.

    
   
17
 */

    
   
18
package org.apache.hadoop.hbase;

    
   
19

   

    
   
20
import org.apache.hadoop.classification.InterfaceAudience;

    
   
21

   

    
   
22
/**

    
   
23
 * Failed deserialization.

    
   
24
 */

    
   
25
@InterfaceAudience.Private

    
   
26
@SuppressWarnings("serial")

    
   
27
public class DeserializationException extends HBaseException {

    
   
28
  public DeserializationException() {

    
   
29
    super();

    
   
30
  }

    
   
31

   

    
   
32
  public DeserializationException(final String message) {

    
   
33
    super(message);

    
   
34
  }

    
   
35

   

    
   
36
  public DeserializationException(final String message, final Throwable t) {

    
   
37
    super(message, t);

    
   
38
  }

    
   
39

   

    
   
40
  public DeserializationException(final Throwable t) {

    
   
41
    super(t);

    
   
42
  }

    
   
43
}
src/main/java/org/apache/hadoop/hbase/EmptyWatcher.java
Revision 9881ec2 New Change
 
src/main/java/org/apache/hadoop/hbase/HBaseException.java
New File
 
src/main/java/org/apache/hadoop/hbase/RegionTransition.java
New File
 
src/main/java/org/apache/hadoop/hbase/ServerName.java
Revision 8fdb624 New Change
 
src/main/java/org/apache/hadoop/hbase/SplitLogCounters.java
New File
 
src/main/java/org/apache/hadoop/hbase/SplitLogTask.java
New File
 
src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java
Revision 4121508 New Change
 
src/main/java/org/apache/hadoop/hbase/executor/ExecutorService.java
Revision 06ca377 New Change
 
src/main/java/org/apache/hadoop/hbase/executor/RegionTransitionData.java
Revision 35d7b70 New Change
 
src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java
Revision 47e3bd6 New Change
 
src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Revision f56127d New Change
 
src/main/java/org/apache/hadoop/hbase/master/HMaster.java
Revision 81e9023 New Change
 
src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
Revision 692f194 New Change
 
src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
Revision 919c65f New Change
 
src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java
Revision 994cb76 New Change
 
src/main/java/org/apache/hadoop/hbase/protobuf/generated/ZooKeeperProtos.java
Revision 8457bdc New Change
 
src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java
Revision ebffad6 New Change
 
src/main/java/org/apache/hadoop/hbase/regionserver/SplitLogWorker.java
Revision 8ea342f New Change
 
src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java
Revision ea12da4 New Change
 
  1. src/main/java/org/apache/hadoop/hbase/DeserializationException.java: Loading...
  2. src/main/java/org/apache/hadoop/hbase/EmptyWatcher.java: Loading...
  3. src/main/java/org/apache/hadoop/hbase/HBaseException.java: Loading...
  4. src/main/java/org/apache/hadoop/hbase/RegionTransition.java: Loading...
  5. src/main/java/org/apache/hadoop/hbase/ServerName.java: Loading...
  6. src/main/java/org/apache/hadoop/hbase/SplitLogCounters.java: Loading...
  7. src/main/java/org/apache/hadoop/hbase/SplitLogTask.java: Loading...
  8. src/main/java/org/apache/hadoop/hbase/executor/EventHandler.java: Loading...
  9. src/main/java/org/apache/hadoop/hbase/executor/ExecutorService.java: Loading...
  10. src/main/java/org/apache/hadoop/hbase/executor/RegionTransitionData.java: Loading...
  11. src/main/java/org/apache/hadoop/hbase/master/ActiveMasterManager.java: Loading...
  12. src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java: Loading...
  13. src/main/java/org/apache/hadoop/hbase/master/HMaster.java: Loading...
  14. src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java: Loading...
  15. src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java: Loading...
  16. src/main/java/org/apache/hadoop/hbase/protobuf/ProtobufUtil.java: Loading...
  17. src/main/java/org/apache/hadoop/hbase/protobuf/generated/ZooKeeperProtos.java: Loading...
  18. src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java: Loading...
  19. src/main/java/org/apache/hadoop/hbase/regionserver/SplitLogWorker.java: Loading...
  20. src/main/java/org/apache/hadoop/hbase/regionserver/SplitTransaction.java: Loading...
This diff has been split across 2 pages: 1 2 >