private static Set<String> tokensAsSet(Collection<Token> tokens) { if (tokens.isEmpty()) return Collections.emptySet(); Token.TokenFactory factory = StorageService.instance.getTokenFactory(); Set<String> s = new HashSet<>(tokens.size()); for (Token tk : tokens) s.add(factory.toString(tk)); return s; }
private static Set<String> tokensAsSet(Collection<Token> tokens) { if (tokens.isEmpty()) return Collections.emptySet(); Token.TokenFactory factory = StorageService.instance.getTokenFactory(); Set<String> s = new HashSet<>(tokens.size()); for (Token tk : tokens) s.add(factory.toString(tk)); return s; }
private static Collection<Token> deserializeTokens(Collection<String> tokensStrings) { Token.TokenFactory factory = StorageService.instance.getTokenFactory(); List<Token> tokens = new ArrayList<>(tokensStrings.size()); for (String tk : tokensStrings) tokens.add(factory.fromString(tk)); return tokens; }
private static Collection<Token> deserializeTokens(Collection<String> tokensStrings) { Token.TokenFactory factory = StorageService.instance.getTokenFactory(); List<Token> tokens = new ArrayList<>(tokensStrings.size()); for (String tk : tokensStrings) tokens.add(factory.fromString(tk)); return tokens; }
private static Collection<Token> deserializeTokens(Collection<String> tokensStrings) { Token.TokenFactory factory = StorageService.instance.getTokenFactory(); List<Token> tokens = new ArrayList<>(tokensStrings.size()); for (String tk : tokensStrings) tokens.add(factory.fromString(tk)); return tokens; }
private static Set<String> tokensAsSet(Collection<Token> tokens) { if (tokens.isEmpty()) return Collections.emptySet(); Token.TokenFactory factory = StorageService.instance.getTokenFactory(); Set<String> s = new HashSet<>(tokens.size()); for (Token tk : tokens) s.add(factory.toString(tk)); return s; }
public void move(String newToken) throws IOException { try { getTokenFactory().validate(newToken); } catch (ConfigurationException e) { throw new IOException(e.getMessage()); } move(getTokenFactory().fromString(newToken)); }
public void move(String newToken) throws IOException { try { getTokenFactory().validate(newToken); } catch (ConfigurationException e) { throw new IOException(e.getMessage()); } move(getTokenFactory().fromString(newToken)); }
public void move(String newToken) throws IOException { try { getTokenFactory().validate(newToken); } catch (ConfigurationException e) { throw new IOException(e.getMessage()); } move(getTokenFactory().fromString(newToken)); }
Collection<Range<Token>> createRepairRangeFrom(String beginToken, String endToken) Token parsedBeginToken = getTokenFactory().fromString(beginToken); Token parsedEndToken = getTokenFactory().fromString(endToken);
Collection<Range<Token>> createRepairRangeFrom(String beginToken, String endToken) Token parsedBeginToken = getTokenFactory().fromString(beginToken); Token parsedEndToken = getTokenFactory().fromString(endToken);
Collection<Range<Token>> createRepairRangeFrom(String beginToken, String endToken) Token parsedBeginToken = getTokenFactory().fromString(beginToken); Token parsedEndToken = getTokenFactory().fromString(endToken);
/** * Handle node moving inside the ring. * * @param endpoint moving endpoint address * @param pieces STATE_MOVING, token */ private void handleStateMoving(InetAddress endpoint, String[] pieces) { assert pieces.length >= 2; Token token = getTokenFactory().fromString(pieces[1]); if (logger.isDebugEnabled()) logger.debug("Node {} state moving, new token {}", endpoint, token); tokenMetadata.addMovingEndpoint(token, endpoint); PendingRangeCalculatorService.instance.update(); }
/** * Handle node moving inside the ring. * * @param endpoint moving endpoint address * @param pieces STATE_MOVING, token */ private void handleStateMoving(InetAddress endpoint, String[] pieces) { assert pieces.length >= 2; Token token = getTokenFactory().fromString(pieces[1]); if (logger.isDebugEnabled()) logger.debug("Node {} state moving, new token {}", endpoint, token); tokenMetadata.addMovingEndpoint(token, endpoint); PendingRangeCalculatorService.instance.update(); }
/** * Handle node moving inside the ring. * * @param endpoint moving endpoint address * @param pieces STATE_MOVING, token */ private void handleStateMoving(InetAddress endpoint, String[] pieces) { assert pieces.length >= 2; Token token = getTokenFactory().fromString(pieces[1]); if (logger.isDebugEnabled()) logger.debug("Node {} state moving, new token {}", endpoint, token); tokenMetadata.addMovingEndpoint(token, endpoint); PendingRangeCalculatorService.instance.update(); }
public List<CfSplit> describe_splits_ex(String cfName, String start_token, String end_token, int keys_per_split) throws InvalidRequestException, TException { try { Token.TokenFactory tf = StorageService.instance.getTokenFactory(); Range<Token> tr = new Range<Token>(tf.fromString(start_token), tf.fromString(end_token)); List<Pair<Range<Token>, Long>> splits = StorageService.instance.getSplits(state().getKeyspace(), cfName, tr, keys_per_split); List<CfSplit> result = new ArrayList<>(splits.size()); for (Pair<Range<Token>, Long> split : splits) result.add(new CfSplit(split.left.left.toString(), split.left.right.toString(), split.right)); return result; } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } }
public List<CfSplit> describe_splits_ex(String cfName, String start_token, String end_token, int keys_per_split) throws InvalidRequestException, TException { try { Token.TokenFactory tf = StorageService.instance.getTokenFactory(); Range<Token> tr = new Range<Token>(tf.fromString(start_token), tf.fromString(end_token)); List<Pair<Range<Token>, Long>> splits = StorageService.instance.getSplits(state().getKeyspace(), cfName, tr, keys_per_split); List<CfSplit> result = new ArrayList<>(splits.size()); for (Pair<Range<Token>, Long> split : splits) result.add(new CfSplit(split.left.left.toString(), split.left.right.toString(), split.right)); return result; } catch (RequestValidationException e) { throw ThriftConversion.toThrift(e); } }
Token.TokenFactory tf = getTokenFactory();
Token.TokenFactory tf = getTokenFactory();
Token.TokenFactory tf = getTokenFactory();