@Test public void testGetState_Dead2() throws Exception { Set<TServerInstance> liveServers = new java.util.HashSet<>(); liveServers.add(future); tls = new TabletLocationState(keyExtent, null, current, last, null, walogs, true); assertEquals(TabletState.ASSIGNED_TO_DEAD_SERVER, tls.getState(liveServers)); }
public TabletState getState(Set<TServerInstance> liveServers) { switch ((current == null ? 0 : _HAS_CURRENT) | (future == null ? 0 : _HAS_FUTURE) | (suspend == null ? 0 : _HAS_SUSPEND)) { case 0: return TabletState.UNASSIGNED; case _HAS_SUSPEND: return TabletState.SUSPENDED; case _HAS_FUTURE: case (_HAS_FUTURE | _HAS_SUSPEND): return liveServers.contains(future) ? TabletState.ASSIGNED : TabletState.ASSIGNED_TO_DEAD_SERVER; case _HAS_CURRENT: case (_HAS_CURRENT | _HAS_SUSPEND): return liveServers.contains(current) ? TabletState.HOSTED : TabletState.ASSIGNED_TO_DEAD_SERVER; default: throw new IllegalStateException(); } }
TabletLocationState { public TabletState getState(Set<TServerInstance> liveServers) { switch ((current == null ? 0 : _HAS_CURRENT) | (future == null ? 0 : _HAS_FUTURE) | (suspend == null ? 0 : _HAS_SUSPEND)) { case 0: return TabletState.UNASSIGNED; case _HAS_SUSPEND: return TabletState.SUSPENDED; case _HAS_FUTURE: case (_HAS_FUTURE | _HAS_SUSPEND): return liveServers.contains(future) ? TabletState.ASSIGNED : TabletState.ASSIGNED_TO_DEAD_SERVER; case _HAS_CURRENT: case (_HAS_CURRENT | _HAS_SUSPEND): return liveServers.contains(current) ? TabletState.HOSTED : TabletState.ASSIGNED_TO_DEAD_SERVER; default: throw new IllegalStateException(); } } }
TabletLocationState { public TabletState getState(Set<TServerInstance> liveServers) { switch ((current == null ? 0 : _HAS_CURRENT) | (future == null ? 0 : _HAS_FUTURE) | (suspend == null ? 0 : _HAS_SUSPEND)) { case 0: return TabletState.UNASSIGNED; case _HAS_SUSPEND: return TabletState.SUSPENDED; case _HAS_FUTURE: case (_HAS_FUTURE | _HAS_SUSPEND): return liveServers.contains(future) ? TabletState.ASSIGNED : TabletState.ASSIGNED_TO_DEAD_SERVER; case _HAS_CURRENT: case (_HAS_CURRENT | _HAS_SUSPEND): return liveServers.contains(current) ? TabletState.HOSTED : TabletState.ASSIGNED_TO_DEAD_SERVER; default: throw new IllegalStateException(); } } TabletLocationState(KeyExtent extent, TServerInstance future, TServerInstance current,
      TServerInstance last, SuspendingTServer suspend, Collection<Collection<String>> walogs,
      boolean chopped); }
TabletLocationState { public TabletState getState(Set<TServerInstance> liveServers) { switch ((current == null ? 0 : _HAS_CURRENT) | (future == null ? 0 : _HAS_FUTURE) | (suspend == null ? 0 : _HAS_SUSPEND)) { case 0: return TabletState.UNASSIGNED; case _HAS_SUSPEND: return TabletState.SUSPENDED; case _HAS_FUTURE: case (_HAS_FUTURE | _HAS_SUSPEND): return liveServers.contains(future) ? TabletState.ASSIGNED : TabletState.ASSIGNED_TO_DEAD_SERVER; case _HAS_CURRENT: case (_HAS_CURRENT | _HAS_SUSPEND): return liveServers.contains(current) ? TabletState.HOSTED : TabletState.ASSIGNED_TO_DEAD_SERVER; default: throw new IllegalStateException(); } } TabletLocationState(KeyExtent extent, TServerInstance future, TServerInstance current,
      TServerInstance last, SuspendingTServer suspend, Collection<Collection<String>> walogs,
      boolean chopped); TServerInstance futureOrCurrent(); @Override String toString(); TServerInstance getServer(); TabletState getState(Set<TServerInstance> liveServers); }
TabletLocationState { public TabletState getState(Set<TServerInstance> liveServers) { switch ((current == null ? 0 : _HAS_CURRENT) | (future == null ? 0 : _HAS_FUTURE) | (suspend == null ? 0 : _HAS_SUSPEND)) { case 0: return TabletState.UNASSIGNED; case _HAS_SUSPEND: return TabletState.SUSPENDED; case _HAS_FUTURE: case (_HAS_FUTURE | _HAS_SUSPEND): return liveServers.contains(future) ? TabletState.ASSIGNED : TabletState.ASSIGNED_TO_DEAD_SERVER; case _HAS_CURRENT: case (_HAS_CURRENT | _HAS_SUSPEND): return liveServers.contains(current) ? TabletState.HOSTED : TabletState.ASSIGNED_TO_DEAD_SERVER; default: throw new IllegalStateException(); } } TabletLocationState(KeyExtent extent, TServerInstance future, TServerInstance current,
      TServerInstance last, SuspendingTServer suspend, Collection<Collection<String>> walogs,
      boolean chopped); TServerInstance futureOrCurrent(); @Override String toString(); TServerInstance getServer(); TabletState getState(Set<TServerInstance> liveServers); final KeyExtent extent; final TServerInstance future; final TServerInstance current; final TServerInstance last; final SuspendingTServer suspend; final Collection<Collection<String>> walogs; final boolean chopped; }