private TokenMap( Token.Factory factory, List<Token> ring, Set<TokenRange> tokenRanges, Map<Token, Host> tokenToPrimary, Map<Host, Set<Token>> primaryToTokens, Map<String, Map<Token, Set<Host>>> tokenToHostsByKeyspace, Map<String, Map<Host, Set<TokenRange>>> hostsToRangesByKeyspace) { this.factory = factory; this.ring = ring; this.tokenRanges = tokenRanges; this.tokenToPrimary = tokenToPrimary; this.primaryToTokens = primaryToTokens; this.tokenToHostsByKeyspace = tokenToHostsByKeyspace; this.hostsToRangesByKeyspace = hostsToRangesByKeyspace; for (Map.Entry<Host, Set<Token>> entry : primaryToTokens.entrySet()) { Host host = entry.getKey(); host.setTokens(ImmutableSet.copyOf(entry.getValue())); } }
private TokenMap(Token.Factory factory, List<Token> ring, Set<TokenRange> tokenRanges, Map<Token, Host> tokenToPrimary, Map<Host, Set<Token>> primaryToTokens, Map<String, Map<Token, Set<Host>>> tokenToHostsByKeyspace, Map<String, Map<Host, Set<TokenRange>>> hostsToRangesByKeyspace) { this.factory = factory; this.ring = ring; this.tokenRanges = tokenRanges; this.tokenToPrimary = tokenToPrimary; this.primaryToTokens = primaryToTokens; this.tokenToHostsByKeyspace = tokenToHostsByKeyspace; this.hostsToRangesByKeyspace = hostsToRangesByKeyspace; for (Map.Entry<Host, Set<Token>> entry : primaryToTokens.entrySet()) { Host host = entry.getKey(); host.setTokens(ImmutableSet.copyOf(entry.getValue())); } }
private TokenMap(Token.Factory factory, List<Token> ring, Set<TokenRange> tokenRanges, Map<Token, Host> tokenToPrimary, Map<Host, Set<Token>> primaryToTokens, Map<String, Map<Token, Set<Host>>> tokenToHostsByKeyspace, Map<String, Map<Host, Set<TokenRange>>> hostsToRangesByKeyspace) { this.factory = factory; this.ring = ring; this.tokenRanges = tokenRanges; this.tokenToPrimary = tokenToPrimary; this.primaryToTokens = primaryToTokens; this.tokenToHostsByKeyspace = tokenToHostsByKeyspace; this.hostsToRangesByKeyspace = hostsToRangesByKeyspace; for (Map.Entry<Host, Set<Token>> entry : primaryToTokens.entrySet()) { Host host = entry.getKey(); host.setTokens(ImmutableSet.copyOf(entry.getValue())); } }
private TokenMap(Token.Factory factory, List<Token> ring, Set<TokenRange> tokenRanges, Map<Token, Host> tokenToPrimary, Map<Host, Set<Token>> primaryToTokens, Map<String, Map<Token, Set<Host>>> tokenToHostsByKeyspace, Map<String, Map<Host, Set<TokenRange>>> hostsToRangesByKeyspace) { this.factory = factory; this.ring = ring; this.tokenRanges = tokenRanges; this.tokenToPrimary = tokenToPrimary; this.primaryToTokens = primaryToTokens; this.tokenToHostsByKeyspace = tokenToHostsByKeyspace; this.hostsToRangesByKeyspace = hostsToRangesByKeyspace; for (Map.Entry<Host, Set<Token>> entry : primaryToTokens.entrySet()) { Host host = entry.getKey(); host.setTokens(ImmutableSet.copyOf(entry.getValue())); } }