Review Board 1.7.22


HBASE-4820 Distributed log splitting coding enhancement to make it easier to understand, no semantics change

Review Request #2895 - Created Nov. 21, 2011 and submitted

Jimmy Xiang
git://git.apache.org/hbase.git
HBASE-4820
Reviewers
hbase
jonathan, tlipcon
hbase-git
Distributed log splitting coding enhancement to make it easier to understand, no semantics change.
It is some issue raised during the code review in back porting this feature to CDH.
Ran unit tests. Non-flaky tests are green. Two client tests didn't pass, which are not related to this change.
src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
Revision f7ef653 New Change
[20] 59 lines
[+20]
60
import org.apache.hadoop.hbase.client.Result;
60
import org.apache.hadoop.hbase.client.Result;
61
import org.apache.hadoop.hbase.executor.EventHandler.EventType;
61
import org.apache.hadoop.hbase.executor.EventHandler.EventType;
62
import org.apache.hadoop.hbase.executor.ExecutorService;
62
import org.apache.hadoop.hbase.executor.ExecutorService;
63
import org.apache.hadoop.hbase.executor.RegionTransitionData;
63
import org.apache.hadoop.hbase.executor.RegionTransitionData;
64
import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException;
64
import org.apache.hadoop.hbase.ipc.ServerNotRunningYetException;
65
import org.apache.hadoop.hbase.master.AssignmentManager.RegionState;

   
66
import org.apache.hadoop.hbase.master.handler.ClosedRegionHandler;
65
import org.apache.hadoop.hbase.master.handler.ClosedRegionHandler;
67
import org.apache.hadoop.hbase.master.handler.DisableTableHandler;
66
import org.apache.hadoop.hbase.master.handler.DisableTableHandler;
68
import org.apache.hadoop.hbase.master.handler.EnableTableHandler;
67
import org.apache.hadoop.hbase.master.handler.EnableTableHandler;
69
import org.apache.hadoop.hbase.master.handler.OpenedRegionHandler;
68
import org.apache.hadoop.hbase.master.handler.OpenedRegionHandler;
70
import org.apache.hadoop.hbase.master.handler.ServerShutdownHandler;
69
import org.apache.hadoop.hbase.master.handler.ServerShutdownHandler;
[+20] [20] 91 lines
[+20] [+] public class AssignmentManager extends ZooKeeperListener {
162

    
   
161

   
163
  private final ExecutorService executorService;
162
  private final ExecutorService executorService;
164

    
   
163

   
165
  //Thread pool executor service for timeout monitor
164
  //Thread pool executor service for timeout monitor
166
  private java.util.concurrent.ExecutorService threadPoolExecutorService;
165
  private java.util.concurrent.ExecutorService threadPoolExecutorService;
167
  
166

   
168
  private List<EventType> ignoreStatesRSOffline = Arrays.asList(new EventType[]{
167
  private List<EventType> ignoreStatesRSOffline = Arrays.asList(new EventType[]{
169
      EventType.RS_ZK_REGION_FAILED_OPEN, EventType.RS_ZK_REGION_CLOSED });
168
      EventType.RS_ZK_REGION_FAILED_OPEN, EventType.RS_ZK_REGION_CLOSED });
170
  

   
171

    
   
169

   

    
   
170

   
172
  /**
171
  /**
173
   * Constructs a new assignment manager.
172
   * Constructs a new assignment manager.
174
   *
173
   *
175
   * @param master
174
   * @param master
176
   * @param serverManager
175
   * @param serverManager
177
   * @param catalogTracker
176
   * @param catalogTracker
178
   * @param service
177
   * @param service
179
   * @throws KeeperException
178
   * @throws KeeperException
180
   * @throws IOException 
179
   * @throws IOException
181
   */
180
   */
182
  public AssignmentManager(Server master, ServerManager serverManager,
181
  public AssignmentManager(Server master, ServerManager serverManager,
183
      CatalogTracker catalogTracker, final ExecutorService service)
182
      CatalogTracker catalogTracker, final ExecutorService service)
184
  throws KeeperException, IOException {
183
  throws KeeperException, IOException {
185
    super(master.getZooKeeper());
184
    super(master.getZooKeeper());
[+20] [20] 84 lines
[+20] [+] public void setRegionsToReopen(List <HRegionInfo> regions) {
270
   * Used by the client to identify if all regions have the schema updates
269
   * Used by the client to identify if all regions have the schema updates
271
   *
270
   *
272
   * @param tableName
271
   * @param tableName
273
   * @return Pair indicating the status of the alter command
272
   * @return Pair indicating the status of the alter command
274
   * @throws IOException
273
   * @throws IOException
275
   * @throws InterruptedException 
274
   * @throws InterruptedException
276
   */
275
   */
277
  public Pair<Integer, Integer> getReopenStatus(byte[] tableName)
276
  public Pair<Integer, Integer> getReopenStatus(byte[] tableName)
278
  throws IOException, InterruptedException {
277
  throws IOException, InterruptedException {
279
    List <HRegionInfo> hris =
278
    List <HRegionInfo> hris =
280
      MetaReader.getTableRegions(this.master.getCatalogTracker(), tableName);
279
      MetaReader.getTableRegions(this.master.getCatalogTracker(), tableName);
[+20] [20] 60 lines
[+20] public void setRegionsToReopen(List <HRegionInfo> regions) {
341
    processDeadServersAndRegionsInTransition(null);
340
    processDeadServersAndRegionsInTransition(null);
342
  }
341
  }
343

    
   
342

   
344
  /**
343
  /**
345
   * Process all regions that are in transition in zookeeper and also
344
   * Process all regions that are in transition in zookeeper and also
346
   * processes the list of dead servers by scanning the META. 
345
   * processes the list of dead servers by scanning the META.
347
   * Used by master joining an cluster.
346
   * Used by master joining an cluster.
348
   * @param deadServers
347
   * @param deadServers
349
   *          Map of dead servers and their regions. Can be null.
348
   *          Map of dead servers and their regions. Can be null.
350
   * @throws KeeperException
349
   * @throws KeeperException
351
   * @throws IOException
350
   * @throws IOException
[+20] [20] 67 lines
[+20] public void setRegionsToReopen(List <HRegionInfo> regions) {
419
  /**
418
  /**
420
   * Process failover of new master for region <code>encodedRegionName</code>
419
   * Process failover of new master for region <code>encodedRegionName</code>
421
   * up in zookeeper.
420
   * up in zookeeper.
422
   * @param encodedRegionName Region to process failover for.
421
   * @param encodedRegionName Region to process failover for.
423
   * @param regionInfo If null we'll go get it from meta table.
422
   * @param regionInfo If null we'll go get it from meta table.
424
   * @param deadServers Can be null 
423
   * @param deadServers Can be null
425
   * @return True if we processed <code>regionInfo</code> as a RIT.
424
   * @return True if we processed <code>regionInfo</code> as a RIT.
426
   * @throws KeeperException
425
   * @throws KeeperException
427
   * @throws IOException
426
   * @throws IOException
428
   */
427
   */
429
  boolean processRegionInTransition(final String encodedRegionName,
428
  boolean processRegionInTransition(final String encodedRegionName,
[+20] [20] 284 lines
[+20] [+] private void handleRegion(final RegionTransitionData data, int expectedVersion) {
714
              data.getStamp(), data.getOrigin());
713
              data.getStamp(), data.getOrigin());
715
        removeClosedRegion(regionState.getRegion());
714
        removeClosedRegion(regionState.getRegion());
716
          this.executorService.submit(new ClosedRegionHandler(master,
715
          this.executorService.submit(new ClosedRegionHandler(master,
717
            this, regionState.getRegion()));
716
            this, regionState.getRegion()));
718
          break;
717
          break;
719
          
718

   
720
        case RS_ZK_REGION_FAILED_OPEN:
719
        case RS_ZK_REGION_FAILED_OPEN:
721
          if (regionState == null ||
720
          if (regionState == null ||
722
              (!regionState.isPendingOpen() && !regionState.isOpening())) {
721
              (!regionState.isPendingOpen() && !regionState.isOpening())) {
723
            LOG.warn("Received FAILED_OPEN for region " + prettyPrintedRegionName +
722
            LOG.warn("Received FAILED_OPEN for region " + prettyPrintedRegionName +
724
                " from server " + data.getOrigin() + " but region was in " +
723
                " from server " + data.getOrigin() + " but region was in " +
[+20] [20] 296 lines
[+20] [+] public void regionOnline(HRegionInfo regionInfo, ServerName sn) {
1021
    synchronized (this.regions) {
1020
    synchronized (this.regions) {
1022
      // Add check
1021
      // Add check
1023
      ServerName oldSn = this.regions.get(regionInfo);
1022
      ServerName oldSn = this.regions.get(regionInfo);
1024
      if (oldSn != null) LOG.warn("Overwriting " + regionInfo.getEncodedName() +
1023
      if (oldSn != null) LOG.warn("Overwriting " + regionInfo.getEncodedName() +
1025
        " on " + oldSn + " with " + sn);
1024
        " on " + oldSn + " with " + sn);
1026
      
1025

   
1027
      if (isServerOnline(sn)) {
1026
      if (isServerOnline(sn)) {
1028
        this.regions.put(regionInfo, sn);
1027
        this.regions.put(regionInfo, sn);
1029
        addToServers(sn, regionInfo);
1028
        addToServers(sn, regionInfo);
1030
        this.regions.notifyAll();
1029
        this.regions.notifyAll();
1031
      } else {
1030
      } else {
1032
        LOG.info("The server is not in online servers, ServerName=" + 
1031
        LOG.info("The server is not in online servers, ServerName=" +
1033
          sn.getServerName() + ", region=" + regionInfo.getEncodedName());
1032
          sn.getServerName() + ", region=" + regionInfo.getEncodedName());
1034
      }
1033
      }
1035
    }
1034
    }
1036
    // Remove plan if one.
1035
    // Remove plan if one.
1037
    clearRegionPlan(regionInfo);
1036
    clearRegionPlan(regionInfo);
[+20] [20] 126 lines
[+20] [+] public void assign(HRegionInfo region, boolean setOfflineInZK,
1164
   * @param hijack
1163
   * @param hijack
1165
   *          - true new assignment is needed, false otherwise
1164
   *          - true new assignment is needed, false otherwise
1166
   */
1165
   */
1167
  public void assign(HRegionInfo region, boolean setOfflineInZK,
1166
  public void assign(HRegionInfo region, boolean setOfflineInZK,
1168
      boolean forceNewPlan, boolean hijack) {
1167
      boolean forceNewPlan, boolean hijack) {
1169
    //If hijack is true do not call disableRegionIfInRIT as 
1168
    //If hijack is true do not call disableRegionIfInRIT as
1170
    // we have not yet moved the znode to OFFLINE state.
1169
    // we have not yet moved the znode to OFFLINE state.
1171
    if (!hijack && isDisabledorDisablingRegionInRIT(region)) {
1170
    if (!hijack && isDisabledorDisablingRegionInRIT(region)) {
1172
      return;
1171
      return;
1173
    }
1172
    }
1174
    if (this.serverManager.isClusterShutdown()) {
1173
    if (this.serverManager.isClusterShutdown()) {
[+20] [20] 233 lines
[+20] [+] private void assign(final HRegionInfo region, final RegionState state,
1408
          if (isDisabledorDisablingRegionInRIT(region)) {
1407
          if (isDisabledorDisablingRegionInRIT(region)) {
1409
            return;
1408
            return;
1410
          }
1409
          }
1411
        }
1410
        }
1412
      }
1411
      }
1413
      
1412

   
1414
      if (setOfflineInZK && versionOfOfflineNode == -1) {
1413
      if (setOfflineInZK && versionOfOfflineNode == -1) {
1415
        return;
1414
        return;
1416
      }
1415
      }
1417
      
1416

   
1418
      if (this.master.isStopped()) {
1417
      if (this.master.isStopped()) {
1419
        LOG.debug("Server stopped; skipping assign of " + state);
1418
        LOG.debug("Server stopped; skipping assign of " + state);
1420
        return;
1419
        return;
1421
      }
1420
      }
1422
      RegionPlan plan = getRegionPlan(state, forceNewPlan);
1421
      RegionPlan plan = getRegionPlan(state, forceNewPlan);
[+20] [20] 90 lines
[+20] [+] private boolean isDisabledorDisablingRegionInRIT(final HRegionInfo region) {
1513
    return false;
1512
    return false;
1514
  }
1513
  }
1515

    
   
1514

   
1516
  /**
1515
  /**
1517
   * Set region as OFFLINED up in zookeeper
1516
   * Set region as OFFLINED up in zookeeper
1518
   * 
1517
   *
1519
   * @param state
1518
   * @param state
1520
   * @param hijack
1519
   * @param hijack
1521
   *          - true if needs to be hijacked and reassigned, false otherwise.
1520
   *          - true if needs to be hijacked and reassigned, false otherwise.
1522
   * @return the version of the offline node if setting of the OFFLINE node was
1521
   * @return the version of the offline node if setting of the OFFLINE node was
1523
   *         successful, -1 otherwise.
1522
   *         successful, -1 otherwise.
1524
   */
1523
   */
1525
  int setOfflineInZooKeeper(final RegionState state,
1524
  int setOfflineInZooKeeper(final RegionState state,
1526
      boolean hijack) {
1525
      boolean hijack) {
1527
    // In case of reassignment the current state in memory need not be
1526
    // In case of reassignment the current state in memory need not be
1528
    // OFFLINE. 
1527
    // OFFLINE.
1529
    if (!hijack && !state.isClosed() && !state.isOffline()) {
1528
    if (!hijack && !state.isClosed() && !state.isOffline()) {
1530
      this.master.abort("Unexpected state trying to OFFLINE; " + state,
1529
      String msg = "Unexpected region state: " + state + ", cannot transit it to OFFLINE.";
1531
          new IllegalStateException());
1530
      this.master.abort(msg, new IllegalStateException(msg));
1532
      return -1;
1531
      return -1;
1533
    }
1532
    }
1534
    boolean allowZNodeCreation = false;
1533
    boolean allowZNodeCreation = false;
1535
    // Under reassignment if the current state is PENDING_OPEN
1534
    // Under reassignment if the current state is PENDING_OPEN
1536
    // or OPENING then refresh the in-memory state to PENDING_OPEN. This is
1535
    // or OPENING then refresh the in-memory state to PENDING_OPEN. This is
1537
    // important because if the region was in 
1536
    // important because if the region was in
1538
    // RS_OPENING state for a long time the master will try to force the znode
1537
    // RS_OPENING state for a long time the master will try to force the znode
1539
    // to OFFLINE state meanwhile the RS could have opened the corresponding
1538
    // to OFFLINE state meanwhile the RS could have opened the corresponding
1540
    // region and the state in znode will be RS_ZK_REGION_OPENED.
1539
    // region and the state in znode will be RS_ZK_REGION_OPENED.
1541
    // For all other cases we can change the in-memory state to OFFLINE.
1540
    // For all other cases we can change the in-memory state to OFFLINE.
1542
    if (hijack &&
1541
    if (hijack &&
1543
        (state.getState().equals(RegionState.State.PENDING_OPEN) || 
1542
        (state.getState().equals(RegionState.State.PENDING_OPEN) ||
1544
            state.getState().equals(RegionState.State.OPENING))) {
1543
            state.getState().equals(RegionState.State.OPENING))) {
1545
      state.update(RegionState.State.PENDING_OPEN);
1544
      state.update(RegionState.State.PENDING_OPEN);
1546
      allowZNodeCreation = false;
1545
      allowZNodeCreation = false;
1547
    } else {
1546
    } else {
1548
      state.update(RegionState.State.OFFLINE);
1547
      state.update(RegionState.State.OFFLINE);
1549
      allowZNodeCreation = true;
1548
      allowZNodeCreation = true;
1550
    }
1549
    }
1551
    int versionOfOfflineNode = -1;
1550
    int versionOfOfflineNode = -1;
1552
    try {
1551
    try {
1553
      // get the version after setting the znode to OFFLINE
1552
      // get the version after setting the znode to OFFLINE
1554
      versionOfOfflineNode = ZKAssign.createOrForceNodeOffline(master.getZooKeeper(), 
1553
      versionOfOfflineNode = ZKAssign.createOrForceNodeOffline(master.getZooKeeper(),
1555
          state.getRegion(), this.master.getServerName(),
1554
          state.getRegion(), this.master.getServerName(),
1556
          hijack, allowZNodeCreation);
1555
          hijack, allowZNodeCreation);
1557
      if (versionOfOfflineNode == -1) {
1556
      if (versionOfOfflineNode == -1) {
1558
        LOG.warn("Attempted to create/force node into OFFLINE state before "
1557
        LOG.warn("Attempted to create/force node into OFFLINE state before "
1559
            + "completing assignment but failed to do so for " + state);
1558
            + "completing assignment but failed to do so for " + state);
[+20] [20] 298 lines
[+20] [+] public void assignMeta() {
1858
    assign(HRegionInfo.FIRST_META_REGIONINFO, true);
1857
    assign(HRegionInfo.FIRST_META_REGIONINFO, true);
1859
  }
1858
  }
1860

    
   
1859

   
1861
  /**
1860
  /**
1862
   * Assigns all user regions to online servers. Use round-robin assignment.
1861
   * Assigns all user regions to online servers. Use round-robin assignment.
1863
   * 
1862
   *
1864
   * @param regions
1863
   * @param regions
1865
   * @throws IOException
1864
   * @throws IOException
1866
   * @throws InterruptedException
1865
   * @throws InterruptedException
1867
   */
1866
   */
1868
  public void assignUserRegionsToOnlineServers(List<HRegionInfo> regions)
1867
  public void assignUserRegionsToOnlineServers(List<HRegionInfo> regions)
[+20] [20] 314 lines
[+20] [+] private void addTheTablesInPartialState(Set<String> disablingTables,
2183
  }
2182
  }
2184

    
   
2183

   
2185
  /**
2184
  /**
2186
   * Recover the tables that were not fully moved to DISABLED state. These
2185
   * Recover the tables that were not fully moved to DISABLED state. These
2187
   * tables are in DISABLING state when the master restarted/switched.
2186
   * tables are in DISABLING state when the master restarted/switched.
2188
   * 
2187
   *
2189
   * @param disablingTables
2188
   * @param disablingTables
2190
   * @return
2189
   * @return
2191
   * @throws KeeperException
2190
   * @throws KeeperException
2192
   * @throws TableNotFoundException
2191
   * @throws TableNotFoundException
2193
   * @throws IOException
2192
   * @throws IOException
[+20] [20] 19 lines
[+20] [+] private boolean recoverTableInDisablingState(Set<String> disablingTables)
2213
  }
2212
  }
2214

    
   
2213

   
2215
  /**
2214
  /**
2216
   * Recover the tables that are not fully moved to ENABLED state. These tables
2215
   * Recover the tables that are not fully moved to ENABLED state. These tables
2217
   * are in ENABLING state when the master restarted/switched
2216
   * are in ENABLING state when the master restarted/switched
2218
   * 
2217
   *
2219
   * @param enablingTables
2218
   * @param enablingTables
2220
   * @param isWatcherCreated
2219
   * @param isWatcherCreated
2221
   * @throws KeeperException
2220
   * @throws KeeperException
2222
   * @throws TableNotFoundException
2221
   * @throws TableNotFoundException
2223
   * @throws IOException
2222
   * @throws IOException
[+20] [20] 36 lines
[+20] [+] private boolean checkIfRegionBelongsToDisabling(HRegionInfo regionInfo) {
2260

    
   
2259

   
2261
  /**
2260
  /**
2262
   * Processes list of dead servers from result of META scan and regions in RIT
2261
   * Processes list of dead servers from result of META scan and regions in RIT
2263
   * <p>
2262
   * <p>
2264
   * This is used for failover to recover the lost regions that belonged to
2263
   * This is used for failover to recover the lost regions that belonged to
2265
   * RegionServers which failed while there was no active master or regions 
2264
   * RegionServers which failed while there was no active master or regions
2266
   * that were in RIT.
2265
   * that were in RIT.
2267
   * <p>
2266
   * <p>
2268
   * 
2267
   *
2269
   * @param deadServers
2268
   * @param deadServers
2270
   *          The list of dead servers which failed while there was no active
2269
   *          The list of dead servers which failed while there was no active
2271
   *          master. Can be null.
2270
   *          master. Can be null.
2272
   * @param nodes
2271
   * @param nodes
2273
   *          The regions in RIT
2272
   *          The regions in RIT
2274
   * @throws IOException
2273
   * @throws IOException
2275
   * @throws KeeperException
2274
   * @throws KeeperException
2276
   */
2275
   */
2277
  private void processDeadServersAndRecoverLostRegions(
2276
  private void processDeadServersAndRecoverLostRegions(
2278
      Map<ServerName, List<Pair<HRegionInfo, Result>>> deadServers,
2277
      Map<ServerName, List<Pair<HRegionInfo, Result>>> deadServers,
2279
      List<String> nodes) throws IOException, KeeperException {
2278
      List<String> nodes) throws IOException, KeeperException {
2280
    if (null != deadServers) {
2279
    if (null != deadServers) {
2281
      for (Map.Entry<ServerName, List<Pair<HRegionInfo, Result>>> deadServer : 
2280
      for (Map.Entry<ServerName, List<Pair<HRegionInfo, Result>>> deadServer :
2282
        deadServers.entrySet()) {
2281
        deadServers.entrySet()) {
2283
        List<Pair<HRegionInfo, Result>> regions = deadServer.getValue();
2282
        List<Pair<HRegionInfo, Result>> regions = deadServer.getValue();
2284
        for (Pair<HRegionInfo, Result> region : regions) {
2283
        for (Pair<HRegionInfo, Result> region : regions) {
2285
          HRegionInfo regionInfo = region.getFirst();
2284
          HRegionInfo regionInfo = region.getFirst();
2286
          Result result = region.getSecond();
2285
          Result result = region.getSecond();
[+20] [20] 5 lines
[+20] private void processDeadServersAndRecoverLostRegions(
2292

    
   
2291

   
2293
            // If zk node of this region has been updated by a live server,
2292
            // If zk node of this region has been updated by a live server,
2294
            // we consider that this region is being handled.
2293
            // we consider that this region is being handled.
2295
            // So we should skip it and process it in
2294
            // So we should skip it and process it in
2296
            // processRegionsInTransition.
2295
            // processRegionsInTransition.
2297
            if (data != null && data.getOrigin() != null && 
2296
            if (data != null && data.getOrigin() != null &&
2298
                serverManager.isServerOnline(data.getOrigin())) {
2297
                serverManager.isServerOnline(data.getOrigin())) {
2299
              LOG.info("The region " + regionInfo.getEncodedName()
2298
              LOG.info("The region " + regionInfo.getEncodedName()
2300
                  + "is being handled on " + data.getOrigin());
2299
                  + "is being handled on " + data.getOrigin());
2301
              continue;
2300
              continue;
2302
            }
2301
            }
[+20] [20] 225 lines
[+20] [+] private void actOnTimeOut(RegionState regionState) {
2528
            + "long, running forced unassign again on region="
2527
            + "long, running forced unassign again on region="
2529
            + regionInfo.getRegionNameAsString());
2528
            + regionInfo.getRegionNameAsString());
2530
        try {
2529
        try {
2531
          // If the server got the RPC, it will transition the node
2530
          // If the server got the RPC, it will transition the node
2532
          // to CLOSING, so only do something here if no node exists
2531
          // to CLOSING, so only do something here if no node exists
2533
          if (!ZKUtil.watchAndCheckExists(watcher, 
2532
          if (!ZKUtil.watchAndCheckExists(watcher,
2534
              ZKAssign.getNodeName(watcher, regionInfo.getEncodedName()))) {
2533
              ZKAssign.getNodeName(watcher, regionInfo.getEncodedName()))) {
2535
            // Queue running of an unassign -- do actual unassign
2534
            // Queue running of an unassign -- do actual unassign
2536
            // outside of the regionsInTransition lock.
2535
            // outside of the regionsInTransition lock.
2537
            invokeUnassign(regionInfo);
2536
            invokeUnassign(regionInfo);
2538
          }
2537
          }
[+20] [20] 10 lines
[+20] private void actOnTimeOut(RegionState regionState) {
2549
          "expire, doing nothing");
2548
          "expire, doing nothing");
2550
        break;
2549
        break;
2551
      }
2550
      }
2552
    }
2551
    }
2553
  }
2552
  }
2554
  
2553

   
2555
  private void processOpeningState(HRegionInfo regionInfo) {
2554
  private void processOpeningState(HRegionInfo regionInfo) {
2556
    LOG.info("Region has been OPENING for too " + "long, reassigning region="
2555
    LOG.info("Region has been OPENING for too " + "long, reassigning region="
2557
        + regionInfo.getRegionNameAsString());
2556
        + regionInfo.getRegionNameAsString());
2558
    // Should have a ZK node in OPENING state
2557
    // Should have a ZK node in OPENING state
2559
    try {
2558
    try {
[+20] [20] 315 lines
[+20] [+] public boolean isOffline() {
2875
    }
2874
    }
2876

    
   
2875

   
2877
    public boolean isSplitting() {
2876
    public boolean isSplitting() {
2878
      return state == State.SPLITTING;
2877
      return state == State.SPLITTING;
2879
    }
2878
    }
2880
 
2879

   
2881
    public boolean isSplit() {
2880
    public boolean isSplit() {
2882
      return state == State.SPLIT;
2881
      return state == State.SPLIT;
2883
    }
2882
    }
2884

    
   
2883

   
2885
    @Override
2884
    @Override
2886
    public String toString() {
2885
    public String toString() {
2887
      return region.getRegionNameAsString()
2886
      return region.getRegionNameAsString()
2888
        + " state=" + state
2887
        + " state=" + state
2889
        + ", ts=" + stamp
2888
        + ", ts=" + stamp
2890
        + ", server=" + serverName;
2889
        + ", server=" + serverName;
2891
    }
2890
    }
2892

    
   
2891

   
2893
    /**
2892
    /**
2894
     * A slower (but more easy-to-read) stringification 
2893
     * A slower (but more easy-to-read) stringification
2895
     */
2894
     */
2896
    public String toDescriptiveString() {
2895
    public String toDescriptiveString() {
2897
      long lstamp = stamp.get();
2896
      long lstamp = stamp.get();
2898
      long relTime = System.currentTimeMillis() - lstamp;
2897
      long relTime = System.currentTimeMillis() - lstamp;
2899
      
2898

   
2900
      return region.getRegionNameAsString()
2899
      return region.getRegionNameAsString()
2901
        + " state=" + state
2900
        + " state=" + state
2902
        + ", ts=" + new Date(lstamp) + " (" + (relTime/1000) + "s ago)"
2901
        + ", ts=" + new Date(lstamp) + " (" + (relTime/1000) + "s ago)"
2903
        + ", server=" + serverName;
2902
        + ", server=" + serverName;
2904
    }
2903
    }
[+20] [20] 15 lines
[+20] [+] public void write(DataOutput out) throws IOException {
2920
  }
2919
  }
2921

    
   
2920

   
2922
  public void stop() {
2921
  public void stop() {
2923
    this.timeoutMonitor.interrupt();
2922
    this.timeoutMonitor.interrupt();
2924
  }
2923
  }
2925
  
2924

   
2926
  /**
2925
  /**
2927
   * Check whether the RegionServer is online.
2926
   * Check whether the RegionServer is online.
2928
   */
2927
   */
2929
  public boolean isServerOnline(ServerName serverName) {
2928
  public boolean isServerOnline(ServerName serverName) {
2930
    return this.serverManager.isServerOnline(serverName);
2929
    return this.serverManager.isServerOnline(serverName);
[+20] [20] 10 lines
src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java
Revision b9a3a2c New Change
 
src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java
Revision 7dd67e9 New Change
 
src/main/java/org/apache/hadoop/hbase/regionserver/SplitLogWorker.java
Revision 1d329b0 New Change
 
src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogSplitter.java
Revision 21747b1 New Change
 
src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java
Revision 51daa1f New Change
 
src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java
Revision c8684ec New Change
 
src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java
Revision 84d76e8 New Change
 
  1. src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java: Loading...
  2. src/main/java/org/apache/hadoop/hbase/master/MasterFileSystem.java: Loading...
  3. src/main/java/org/apache/hadoop/hbase/master/SplitLogManager.java: Loading...
  4. src/main/java/org/apache/hadoop/hbase/regionserver/SplitLogWorker.java: Loading...
  5. src/main/java/org/apache/hadoop/hbase/regionserver/wal/HLogSplitter.java: Loading...
  6. src/test/java/org/apache/hadoop/hbase/master/TestDistributedLogSplitting.java: Loading...
  7. src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java: Loading...
  8. src/test/java/org/apache/hadoop/hbase/regionserver/TestSplitLogWorker.java: Loading...