Package com.netflix.astyanax.connectionpool

Examples of com.netflix.astyanax.connectionpool.TokenRange


        for (int i = 0; i < nHosts; i++) {
            String startToken = TokenGenerator.initialToken(nHosts, i,   minInitialToken, maxInitialToken);
            String endToken   = TokenGenerator.initialToken(nHosts, i+1, minInitialToken, maxInitialToken);
            if (endToken.equals(maxInitialToken.toString()))
                endToken = minInitialToken.toString();
            TokenRange range = new TokenRangeImpl(startToken, endToken, null);
           
            for (int j = 0; j < replication_factor; j++) {
                hosts.get((i+j)%nHosts).getTokenRanges().add(range);
            }
        }
View Full Code Here


//        assertEquals(NODE3,endpoints.get(0).getIpAddress());
    }

    private List<TokenRange> createTokenRange() {
       List<TokenRange> tokenRanges = new ArrayList<TokenRange>();
       TokenRange node1Range = new TestTokenRange(RANGE_3_END_TOKEN, RANGE_1_END_TOKEN, Arrays.asList(NODE1));
       TokenRange node2Range = new TestTokenRange(RANGE_1_END_TOKEN, RANGE_2_END_TOKEN, Arrays.asList(NODE2));
       TokenRange node3Range = new TestTokenRange(RANGE_2_END_TOKEN, RANGE_3_END_TOKEN, Arrays.asList(NODE3));
       tokenRanges.addAll(Arrays.asList(node1Range, node2Range, node3Range));
       return tokenRanges;
    }
View Full Code Here

TOP

Related Classes of com.netflix.astyanax.connectionpool.TokenRange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.