NodeInfo implements Comparable<NodeInfo> { public boolean recentlyObservedUnstableDuringInit() { return recentlyObservedUnstableDuringInit; } NodeInfo(ContentCluster cluster, Node n, boolean configuredRetired, String rpcAddress, Distribution distribution); void setRpcAddress(String rpcAddress); long getWentDownWithStartTime(); long getStartTimestamp(); void setStartTimestamp(long ts); void setTransitionTime(long time); long getTransitionTime(); void setInitProgressTime(long time); long getInitProgressTime(); long getUpStableStateTime(); long getDownStableStateTime(); int getConnectionAttemptCount(); boolean recentlyObservedUnstableDuringInit(); void setRecentlyObservedUnstableDuringInit(boolean unstable); void setPrematureCrashCount(int count); int getPrematureCrashCount(); boolean isPendingGetNodeStateRequest(GetNodeStateRequest r); void setConfiguredRetired(boolean retired); void setNextGetStateAttemptTime(long timeInMillis); @Override int compareTo(NodeInfo info); @Override int hashCode(); @Override String toString(); void setGroup(Distribution distribution); Group getGroup(); int getLatestVersion(); String getSlobrokAddress(); void markRpcAddressOutdated(Timer timer); void markRpcAddressLive(); Node getNode(); boolean isDistributor(); boolean isStorage(); int getNodeIndex(); ContentCluster getCluster(); boolean isRpcAddressOutdated(); Long getRpcAddressOutdatedTimestamp(); void abortCurrentNodeStateRequests(); void setCurrentNodeStateRequest(GetNodeStateRequest r, long timeInMS); String getRpcAddress(); NodeState getReportedState(); NodeState getWantedState(); NodeState getUserWantedState(); long getTimeOfFirstFailingConnectionAttempt(); Long getLatestNodeStateRequestTime(); void setTimeOfFirstFailingConnectionAttempt(long timeInMS); void removePendingGetNodeStateRequest(GetNodeStateRequest request); void setReportedState(NodeState state, long time); void setWantedState(NodeState state); long getTimeForNextStateRequestAttempt(); boolean notifyNoSuchMethodError(String methodName, Timer timer); Target getConnection(); Target setConnection(Target t); int getVersion(); ClusterState getNewestSystemStateSent(); int getNewestSystemStateVersionSent(); int getClusterStateVersionBundleAcknowledged(); void setClusterStateVersionBundleSent(ClusterStateBundle stateBundle); void setClusterStateBundleVersionAcknowledged(Integer version, boolean success); void setClusterStateVersionActivationSent(int version); int getClusterStateVersionActivationSent(); int getClusterStateVersionActivationAcked(); void setSystemStateVersionActivationAcked(Integer version, boolean success); void setHostInfo(HostInfo hostInfo); HostInfo getHostInfo(); String getVtag(); static Logger log; public Target lastRequestInfoConnection; }
@Test public void unstable_init_flag_is_initially_clear() { ClusterFixture fixture = ClusterFixture.forFlatCluster(3); final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 1)); assertFalse(nodeInfo.recentlyObservedUnstableDuringInit()); }
@Test public void down_edge_during_init_state_marks_as_unstable_init() { ClusterFixture fixture = fixtureWithNodeMarkedAsUnstableInit(1); final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 1)); assertTrue(nodeInfo.recentlyObservedUnstableDuringInit()); }
@Test public void stopping_edge_during_init_does_not_mark_as_unstable_init() { ClusterFixture fixture = ClusterFixture.forFlatCluster(3).reportStorageNodeState(0, State.INITIALIZING); fixture.reportStorageNodeState(0, State.STOPPING); final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 0)); assertFalse(nodeInfo.recentlyObservedUnstableDuringInit()); }