private boolean waitForGroupTableOnline() { while (isMasterRunning(masterServices)) { try { TableStateManager tsm = masterServices.getTableStateManager(); if (!tsm.isTablePresent(RSGROUP_TABLE_NAME)) { createRSGroupTable(); } // try reading from the table try (Table table = conn.getTable(RSGROUP_TABLE_NAME)) { table.get(new Get(ROW_KEY)); } LOG.info( "RSGroup table=" + RSGROUP_TABLE_NAME + " is online, refreshing cached information"); RSGroupInfoManagerImpl.this.refresh(true); online = true; // flush any inconsistencies between ZK and HTable RSGroupInfoManagerImpl.this.flushConfig(); return true; } catch (Exception e) { LOG.warn("Failed to perform check", e); // 100ms is short so let's just ignore the interrupt Threads.sleepWithoutInterrupt(100); } } return false; }
RSGroupStartupWorker() { super(RSGroupStartupWorker.class.getName() + "-" + masterServices.getServerName()); setDaemon(true); }
@Override public void run() { if (waitForGroupTableOnline()) { LOG.info("GroupBasedLoadBalancer is now online"); } else { LOG.warn("Quit without making region group table online"); } }
createRSGroupTable(); createSent = true;
createRSGroupTable(); createSent = true;
RSGroupStartupWorker() { setDaemon(true); }
public void start(){ // create system table of rsgroup rsGroupStartupWorker.start(); }
@Override public boolean isOnline() { return rsGroupStartupWorker.isOnline(); }
@Override public boolean isOnline() { return rsGroupStartupWorker.isOnline(); }
RSGroupStartupWorker() { setDaemon(true); }
public void start(){ // create system table of rsgroup rsGroupStartupWorker.start(); }
@Override public void run() { setName(RSGroupStartupWorker.class.getName() + "-" + masterServices.getServerName()); if (waitForGroupTableOnline()) { LOG.info("GroupBasedLoadBalancer is now online"); } }
@Override public void run() { setName(RSGroupStartupWorker.class.getName() + "-" + masterServices.getServerName()); if (waitForGroupTableOnline()) { LOG.info("GroupBasedLoadBalancer is now online"); } }
@Override public boolean isOnline() { return rsGroupStartupWorker.isOnline(); }
public void start() { // create system table of rsgroup rsGroupStartupWorker.start(); }
private RSGroupInfoManagerImpl(MasterServices masterServices) throws IOException { this.masterServices = masterServices; this.watcher = masterServices.getZooKeeper(); this.conn = masterServices.getConnection(); this.rsGroupStartupWorker = new RSGroupStartupWorker(); }