/** This method updates the local token on disk */ public void setTokens(Collection<Token> tokens) { assert tokens != null && !tokens.isEmpty() : "Node needs at least one token."; if (logger.isDebugEnabled()) logger.debug("Setting tokens to {}", tokens); SystemKeyspace.updateTokens(tokens); Collection<Token> localTokens = getLocalTokens(); setGossipTokens(localTokens); tokenMetadata.updateNormalTokens(tokens, FBUtilities.getBroadcastAddress()); setMode(Mode.NORMAL, false); }
/** This method updates the local token on disk */ public void setTokens(Collection<Token> tokens) { assert tokens != null && !tokens.isEmpty() : "Node needs at least one token."; if (logger.isDebugEnabled()) logger.debug("Setting tokens to {}", tokens); SystemKeyspace.updateTokens(tokens); Collection<Token> localTokens = getLocalTokens(); setGossipTokens(localTokens); tokenMetadata.updateNormalTokens(tokens, FBUtilities.getBroadcastAddress()); setMode(Mode.NORMAL, false); }
/** This method updates the local token on disk */ public void setTokens(Collection<Token> tokens) { assert tokens != null && !tokens.isEmpty() : "Node needs at least one token."; if (logger.isDebugEnabled()) logger.debug("Setting tokens to {}", tokens); SystemKeyspace.updateTokens(tokens); Collection<Token> localTokens = getLocalTokens(); setGossipTokens(localTokens); tokenMetadata.updateNormalTokens(tokens, FBUtilities.getBroadcastAddress()); setMode(Mode.NORMAL, false); }
/** This method updates the local token on disk */ public void setTokens(Collection<Token> tokens) { if (logger.isDebugEnabled()) logger.debug("Setting tokens to {}", tokens); SystemKeyspace.updateTokens(tokens); tokenMetadata.updateNormalTokens(tokens, FBUtilities.getBroadcastAddress()); Collection<Token> localTokens = getLocalTokens(); setGossipTokens(localTokens); setMode(Mode.NORMAL, false); }
SystemKeyspace.updateTokens(endpoint, tokensToUpdateInSystemKeyspace, StageManager.getStage(Stage.MUTATION));
SystemKeyspace.updateTokens(endpoint, tokensToUpdateInSystemKeyspace, StageManager.getStage(Stage.MUTATION));
SystemKeyspace.updateTokens(endpoint, tokensToUpdateInSystemKeyspace, StageManager.getStage(Stage.MUTATION));
SystemKeyspace.updateTokens(endpoint, tokensToUpdateInSystemKeyspace);;
private void bootstrap(Collection<Token> tokens) { isBootstrapMode = true; SystemKeyspace.updateTokens(tokens); // DON'T use setToken, that makes us part of the ring locally which is incorrect until we are done bootstrapping if (!DatabaseDescriptor.isReplacing()) { // if not an existing token then bootstrap List<Pair<ApplicationState, VersionedValue>> states = new ArrayList<Pair<ApplicationState, VersionedValue>>(); states.add(Pair.create(ApplicationState.TOKENS, valueFactory.tokens(tokens))); states.add(Pair.create(ApplicationState.STATUS, valueFactory.bootstrapping(tokens))); Gossiper.instance.addLocalApplicationStates(states); setMode(Mode.JOINING, "sleeping " + RING_DELAY + " ms for pending range setup", true); Uninterruptibles.sleepUninterruptibly(RING_DELAY, TimeUnit.MILLISECONDS); } else { // Dont set any state for the node which is bootstrapping the existing token... tokenMetadata.updateNormalTokens(tokens, FBUtilities.getBroadcastAddress()); SystemKeyspace.removeEndpoint(DatabaseDescriptor.getReplaceAddress()); } if (!Gossiper.instance.seenAnySeed()) throw new IllegalStateException("Unable to contact any seeds!"); setMode(Mode.JOINING, "Starting to bootstrap...", true); new BootStrapper(FBUtilities.getBroadcastAddress(), tokens, tokenMetadata).bootstrap(); // handles token update logger.info("Bootstrap completed! for the tokens {}", tokens); }
SystemKeyspace.updateTokens(tokens); // DON'T use setToken, that makes us part of the ring locally which is incorrect until we are done bootstrapping
SystemKeyspace.updateTokens(tokens); // DON'T use setToken, that makes us part of the ring locally which is incorrect until we are done bootstrapping
SystemKeyspace.updateTokens(bootstrapTokens);
SystemKeyspace.updateTokens(bootstrapTokens);
SystemKeyspace.updateTokens(bootstrapTokens);
SystemKeyspace.updateTokens(tokens); // DON'T use setToken, that makes us part of the ring locally which is incorrect until we are done bootstrapping