private void checkForHeldServer(SortedMap<TServerInstance,TabletServerStatus> tserverStatus) { TServerInstance instance = null; int crazyHoldTime = 0; int someHoldTime = 0; final long maxWait = getConfiguration().getTimeInMillis(Property.TSERV_HOLD_TIME_SUICIDE); for (Entry<TServerInstance,TabletServerStatus> entry : tserverStatus.entrySet()) { if (entry.getValue().getHoldTime() > 0) { someHoldTime++; if (entry.getValue().getHoldTime() > maxWait) { instance = entry.getKey(); crazyHoldTime++; } } } if (crazyHoldTime == 1 && someHoldTime == 1 && tserverStatus.size() > 1) { log.warn("Tablet server {} exceeded maximum hold time: attempting to kill it", instance); try { TServerConnection connection = tserverSet.getConnection(instance); if (connection != null) connection.fastHalt(masterLock); } catch (TException e) { log.error("{}", e.getMessage(), e); } tserverSet.remove(instance); } }
return getHoldTime();
private void checkForHeldServer(SortedMap<TServerInstance,TabletServerStatus> tserverStatus) { TServerInstance instance = null; int crazyHoldTime = 0; int someHoldTime = 0; final long maxWait = getSystemConfiguration().getTimeInMillis(Property.TSERV_HOLD_TIME_SUICIDE); for (Entry<TServerInstance,TabletServerStatus> entry : tserverStatus.entrySet()) { if (entry.getValue().getHoldTime() > 0) { someHoldTime++; if (entry.getValue().getHoldTime() > maxWait) { instance = entry.getKey(); crazyHoldTime++; } } } if (crazyHoldTime == 1 && someHoldTime == 1 && tserverStatus.size() > 1) { log.warn("Tablet server " + instance + " exceeded maximum hold time: attempting to kill it"); try { TServerConnection connection = tserverSet.getConnection(instance); if (connection != null) connection.fastHalt(masterLock); } catch (TException e) { log.error(e, e); } tserverSet.remove(instance); } }
private void checkForHeldServer(SortedMap<TServerInstance,TabletServerStatus> tserverStatus) { TServerInstance instance = null; int crazyHoldTime = 0; int someHoldTime = 0; final long maxWait = getConfiguration().getTimeInMillis(Property.TSERV_HOLD_TIME_SUICIDE); for (Entry<TServerInstance,TabletServerStatus> entry : tserverStatus.entrySet()) { if (entry.getValue().getHoldTime() > 0) { someHoldTime++; if (entry.getValue().getHoldTime() > maxWait) { instance = entry.getKey(); crazyHoldTime++; } } } if (crazyHoldTime == 1 && someHoldTime == 1 && tserverStatus.size() > 1) { log.warn( "Tablet server " + instance + " exceeded maximum hold time: attempting to kill it"); try { TServerConnection connection = tserverSet.getConnection(instance); if (connection != null) connection.fastHalt(masterLock); } catch (TException e) { log.error("{}", e.getMessage(), e); } tserverSet.remove(instance); } }