@VisibleForTesting public void injectApplicationState(InetAddress endpoint, ApplicationState state, VersionedValue value) { EndpointState localState = endpointStateMap.get(endpoint); localState.addApplicationState(state, value); }
@VisibleForTesting public void injectApplicationState(InetAddress endpoint, ApplicationState state, VersionedValue value) { EndpointState localState = endpointStateMap.get(endpoint); localState.addApplicationState(state, value); }
@VisibleForTesting public void injectApplicationState(InetAddress endpoint, ApplicationState state, VersionedValue value) { EndpointState localState = endpointStateMap.get(endpoint); localState.addApplicationState(state, value); }
@VisibleForTesting public void injectApplicationState(InetAddress endpoint, ApplicationState state, VersionedValue value) { EndpointState localState = endpointStateMap.get(endpoint); localState.addApplicationState(state, value); }
/** * This method is used to mark a node as shutdown; that is it gracefully exited on its own and told us about it * @param endpoint endpoint that has shut itself down */ protected void markAsShutdown(InetAddress endpoint) { EndpointState epState = endpointStateMap.get(endpoint); if (epState == null) return; epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.shutdown(true)); epState.addApplicationState(ApplicationState.RPC_READY, StorageService.instance.valueFactory.rpcReady(false)); epState.getHeartBeatState().forceHighestPossibleVersionUnsafe(); markDead(endpoint, epState); FailureDetector.instance.forceConviction(endpoint); }
/** * This method is used to mark a node as shutdown; that is it gracefully exited on its own and told us about it * @param endpoint endpoint that has shut itself down */ protected void markAsShutdown(InetAddress endpoint) { EndpointState epState = endpointStateMap.get(endpoint); if (epState == null) return; epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.shutdown(true)); epState.addApplicationState(ApplicationState.RPC_READY, StorageService.instance.valueFactory.rpcReady(false)); epState.getHeartBeatState().forceHighestPossibleVersionUnsafe(); markDead(endpoint, epState); FailureDetector.instance.forceConviction(endpoint); }
/** * This method is used to mark a node as shutdown; that is it gracefully exited on its own and told us about it * @param endpoint endpoint that has shut itself down */ protected void markAsShutdown(InetAddress endpoint) { EndpointState epState = endpointStateMap.get(endpoint); if (epState == null) return; epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.shutdown(true)); epState.addApplicationState(ApplicationState.RPC_READY, StorageService.instance.valueFactory.rpcReady(false)); epState.getHeartBeatState().forceHighestPossibleVersionUnsafe(); markDead(endpoint, epState); FailureDetector.instance.forceConviction(endpoint); }
/** * Handles switching the endpoint's state from REMOVING_TOKEN to REMOVED_TOKEN * This should only be called after advertiseRemoving * * @param endpoint * @param hostId */ public void advertiseTokenRemoved(InetAddress endpoint, UUID hostId) { EndpointState epState = endpointStateMap.get(endpoint); epState.updateTimestamp(); // make sure we don't evict it too soon epState.getHeartBeatState().forceNewerGenerationUnsafe(); long expireTime = computeExpireTime(); epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.removedNonlocal(hostId, expireTime)); logger.info("Completing removal of {}", endpoint); addExpireTimeForEndpoint(endpoint, expireTime); endpointStateMap.put(endpoint, epState); // ensure at least one gossip round occurs before returning Uninterruptibles.sleepUninterruptibly(intervalInMillis * 2, TimeUnit.MILLISECONDS); }
private void addLocalApplicationStateInternal(ApplicationState state, VersionedValue value) { assert taskLock.isHeldByCurrentThread(); EndpointState epState = endpointStateMap.get(FBUtilities.getBroadcastAddress()); InetAddress epAddr = FBUtilities.getBroadcastAddress(); assert epState != null; // Fire "before change" notifications: doBeforeChangeNotifications(epAddr, epState, state, value); // Notifications may have taken some time, so preventively raise the version // of the new value, otherwise it could be ignored by the remote node // if another value with a newer version was received in the meantime: value = StorageService.instance.valueFactory.cloneWithHigherVersion(value); // Add to local application state and fire "on change" notifications: epState.addApplicationState(state, value); doOnChangeNotifications(epAddr, state, value); }
private void addLocalApplicationStateInternal(ApplicationState state, VersionedValue value) { assert taskLock.isHeldByCurrentThread(); EndpointState epState = endpointStateMap.get(FBUtilities.getBroadcastAddress()); InetAddress epAddr = FBUtilities.getBroadcastAddress(); assert epState != null; // Fire "before change" notifications: doBeforeChangeNotifications(epAddr, epState, state, value); // Notifications may have taken some time, so preventively raise the version // of the new value, otherwise it could be ignored by the remote node // if another value with a newer version was received in the meantime: value = StorageService.instance.valueFactory.cloneWithHigherVersion(value); // Add to local application state and fire "on change" notifications: epState.addApplicationState(state, value); doOnChangeNotifications(epAddr, state, value); }
private void addLocalApplicationStateInternal(ApplicationState state, VersionedValue value) { assert taskLock.isHeldByCurrentThread(); EndpointState epState = endpointStateMap.get(FBUtilities.getBroadcastAddress()); InetAddress epAddr = FBUtilities.getBroadcastAddress(); assert epState != null; // Fire "before change" notifications: doBeforeChangeNotifications(epAddr, epState, state, value); // Notifications may have taken some time, so preventively raise the version // of the new value, otherwise it could be ignored by the remote node // if another value with a newer version was received in the meantime: value = StorageService.instance.valueFactory.cloneWithHigherVersion(value); // Add to local application state and fire "on change" notifications: epState.addApplicationState(state, value); doOnChangeNotifications(epAddr, state, value); }
private void addLocalApplicationStateInternal(ApplicationState state, VersionedValue value) { assert taskLock.isHeldByCurrentThread(); EndpointState epState = endpointStateMap.get(FBUtilities.getBroadcastAddress()); InetAddress epAddr = FBUtilities.getBroadcastAddress(); assert epState != null; // Fire "before change" notifications: doBeforeChangeNotifications(epAddr, epState, state, value); // Notifications may have taken some time, so preventively raise the version // of the new value, otherwise it could be ignored by the remote node // if another value with a newer version was received in the meantime: value = StorageService.instance.valueFactory.cloneWithHigherVersion(value); // Add to local application state and fire "on change" notifications: epState.addApplicationState(state, value); doOnChangeNotifications(epAddr, state, value); }
/** * Handles switching the endpoint's state from REMOVING_TOKEN to REMOVED_TOKEN * This should only be called after advertiseRemoving * * @param endpoint * @param hostId */ public void advertiseTokenRemoved(InetAddress endpoint, UUID hostId) { EndpointState epState = endpointStateMap.get(endpoint); epState.updateTimestamp(); // make sure we don't evict it too soon epState.getHeartBeatState().forceNewerGenerationUnsafe(); long expireTime = computeExpireTime(); epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.removedNonlocal(hostId, expireTime)); logger.info("Completing removal of {}", endpoint); addExpireTimeForEndpoint(endpoint, expireTime); endpointStateMap.put(endpoint, epState); // ensure at least one gossip round occurs before returning Uninterruptibles.sleepUninterruptibly(intervalInMillis * 2, TimeUnit.MILLISECONDS); }
/** * This method is used to mark a node as shutdown; that is it gracefully exited on its own and told us about it * @param endpoint endpoint that has shut itself down */ protected void markAsShutdown(InetAddress endpoint) { EndpointState epState = endpointStateMap.get(endpoint); if (epState == null) return; epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.shutdown(true)); epState.getHeartBeatState().forceHighestPossibleVersionUnsafe(); markDead(endpoint, epState); FailureDetector.instance.forceConviction(endpoint); }
/** * Handles switching the endpoint's state from REMOVING_TOKEN to REMOVED_TOKEN * This should only be called after advertiseRemoving * * @param endpoint * @param hostId */ public void advertiseTokenRemoved(InetAddress endpoint, UUID hostId) { EndpointState epState = endpointStateMap.get(endpoint); epState.updateTimestamp(); // make sure we don't evict it too soon epState.getHeartBeatState().forceNewerGenerationUnsafe(); long expireTime = computeExpireTime(); epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.removedNonlocal(hostId, expireTime)); logger.info("Completing removal of {}", endpoint); addExpireTimeForEndpoint(endpoint, expireTime); endpointStateMap.put(endpoint, epState); // ensure at least one gossip round occurs before returning Uninterruptibles.sleepUninterruptibly(intervalInMillis * 2, TimeUnit.MILLISECONDS); }
/** * Handles switching the endpoint's state from REMOVING_TOKEN to REMOVED_TOKEN * This should only be called after advertiseRemoving * * @param endpoint * @param hostId */ public void advertiseTokenRemoved(InetAddress endpoint, UUID hostId) { EndpointState epState = endpointStateMap.get(endpoint); epState.updateTimestamp(); // make sure we don't evict it too soon epState.getHeartBeatState().forceNewerGenerationUnsafe(); long expireTime = computeExpireTime(); epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.removedNonlocal(hostId, expireTime)); logger.info("Completing removal of {}", endpoint); addExpireTimeForEndpoint(endpoint, expireTime); endpointStateMap.put(endpoint, epState); // ensure at least one gossip round occurs before returning Uninterruptibles.sleepUninterruptibly(intervalInMillis * 2, TimeUnit.MILLISECONDS); }
epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.left(tokens, computeExpireTime())); handleMajorStateChange(endpoint, epState); Uninterruptibles.sleepUninterruptibly(intervalInMillis * 4, TimeUnit.MILLISECONDS);
epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.left(tokens, computeExpireTime())); handleMajorStateChange(endpoint, epState); Uninterruptibles.sleepUninterruptibly(intervalInMillis * 4, TimeUnit.MILLISECONDS);
epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.left(tokens, computeExpireTime())); handleMajorStateChange(endpoint, epState); Uninterruptibles.sleepUninterruptibly(intervalInMillis * 4, TimeUnit.MILLISECONDS);
epState.addApplicationState(ApplicationState.STATUS, StorageService.instance.valueFactory.left(tokens, computeExpireTime())); handleMajorStateChange(endpoint, epState); Uninterruptibles.sleepUninterruptibly(intervalInMillis * 4, TimeUnit.MILLISECONDS);