예제 #1
0
 public HBaseTcpServer(HRegionServer regionServer) {
   ZooKeeperAdmin.createBaseZNodes();
   initConf(regionServer.getConfiguration());
   tcpPort = getRegionServerTcpPort(regionServer.getConfiguration());
   serverName = regionServer.getServerName();
   this.regionServer = regionServer;
   init(regionServer.getConfiguration());
 }
예제 #2
0
 public HBaseTcpServer(HMaster master) {
   ZooKeeperAdmin.createBaseZNodes();
   initConf(master.getConfiguration());
   tcpPort = getMasterTcpPort(master.getConfiguration());
   serverName = master.getServerName();
   this.master = master;
   init(master.getConfiguration());
 }
예제 #3
0
  @Override
  public void start() {
    try {
      super.start();
      TcpPortTracker.createTcpPortEphemeralNode(serverName, tcpPort, master != null);
      ZooKeeperAdmin.getTcpPortTracker(); // 初始化TcpPortTracker

      String name = getName() + " (" + getURL() + ")";
      Thread t = new Thread(this, name);
      t.setDaemon(isDaemon());
      t.start();

      log.info("Started lealone tcp server at port " + tcpPort);
    } catch (SQLException e) {
      throw new RuntimeException(e);
    }
  }