Esempio n. 1
0
 public HBaseTcpServer(HRegionServer regionServer) {
   ZooKeeperAdmin.createBaseZNodes();
   initConf(regionServer.getConfiguration());
   tcpPort = getRegionServerTcpPort(regionServer.getConfiguration());
   serverName = regionServer.getServerName();
   this.regionServer = regionServer;
   init(regionServer.getConfiguration());
 }
Esempio n. 2
0
 public HBaseTcpServer(HMaster master) {
   ZooKeeperAdmin.createBaseZNodes();
   initConf(master.getConfiguration());
   tcpPort = getMasterTcpPort(master.getConfiguration());
   serverName = master.getServerName();
   this.master = master;
   init(master.getConfiguration());
 }
Esempio n. 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);
    }
  }