Examples of BytesToken


Examples of org.apache.cassandra.dht.BytesToken

        // So to make sure cleanup erase everything here, we give the localhost the tiniest possible range.
        TokenMetadata tmd = StorageService.instance.getTokenMetadata();
        byte[] tk1 = new byte[1], tk2 = new byte[1];
        tk1[0] = 2;
        tk2[0] = 1;
        tmd.updateNormalToken(new BytesToken(tk1), InetAddress.getByName("127.0.0.1"));
        tmd.updateNormalToken(new BytesToken(tk2), InetAddress.getByName("127.0.0.2"));

        CompactionManager.instance.performCleanup(cfs, new CounterId.OneShotRenewer());

        // row data should be gone
        rows = Util.getRangeSlice(cfs);
View Full Code Here

Examples of org.apache.cassandra.dht.BytesToken

        // So to make sure cleanup erase everything here, we give the localhost the tiniest possible range.
        TokenMetadata tmd = StorageService.instance.getTokenMetadata();
        byte[] tk1 = new byte[1], tk2 = new byte[1];
        tk1[0] = 2;
        tk2[0] = 1;
        tmd.updateNormalToken(new BytesToken(tk1), InetAddress.getByName("127.0.0.1"));
        tmd.updateNormalToken(new BytesToken(tk2), InetAddress.getByName("127.0.0.2"));

        CompactionManager.instance.performCleanup(cfs, new NodeId.OneShotRenewer());

        // row data should be gone
        rows = cfs.getRangeSlice(null, Util.range("", ""), 1000, new IdentityQueryFilter());
View Full Code Here

Examples of org.apache.cassandra.dht.BytesToken

        return String.format("%03d", key);
    }

    private static Bounds<RowPosition> boundsFor(int start, int end)
    {
        return new Bounds<RowPosition>(new BytesToken(toKey(start).getBytes()).minKeyBound(),
                                       new BytesToken(toKey(end).getBytes()).maxKeyBound());
    }
View Full Code Here

Examples of org.apache.cassandra.dht.BytesToken

    }


    private static Range<Token> rangeFor(int start, int end)
    {
        return new Range<Token>(new BytesToken(toKey(start).getBytes()),
                                new BytesToken(toKey(end).getBytes()));
    }
View Full Code Here

Examples of org.apache.cassandra.dht.BytesToken

        // So to make sure cleanup erase everything here, we give the localhost the tiniest possible range.
        TokenMetadata tmd = StorageService.instance.getTokenMetadata();
        byte[] tk1 = new byte[1], tk2 = new byte[1];
        tk1[0] = 2;
        tk2[0] = 1;
        tmd.updateNormalToken(new BytesToken(tk1), InetAddress.getByName("127.0.0.1"));
        tmd.updateNormalToken(new BytesToken(tk2), InetAddress.getByName("127.0.0.2"));

        CompactionManager.instance.performCleanup(cfs);

        // row data should be gone
        rows = Util.getRangeSlice(cfs);
View Full Code Here

Examples of org.apache.cassandra.dht.BytesToken

        assert cf == null || cf.getColumnCount() == 0 : "should be empty: " + cf;
    }

    private static Range<Token> rangeFor(int start, int end)
    {
        return new Range<Token>(new BytesToken(String.format("%03d", start).getBytes()),
                                new BytesToken(String.format("%03d", end).getBytes()));
    }
View Full Code Here

Examples of org.apache.cassandra.dht.BytesToken

        assertEquals(CacheService.instance.rowCache.getKeySet().size(), 100);
        TokenMetadata tmd = StorageService.instance.getTokenMetadata();
        byte[] tk1, tk2;
        tk1 = "key1000".getBytes();
        tk2 = "key1050".getBytes();
        tmd.updateNormalToken(new BytesToken(tk1), InetAddress.getByName("127.0.0.1"));
        tmd.updateNormalToken(new BytesToken(tk2), InetAddress.getByName("127.0.0.2"));
        store.cleanupCache();
        assertEquals(CacheService.instance.rowCache.getKeySet().size(), 50);
        CacheService.instance.setRowCacheCapacityInMB(0);
    }
View Full Code Here

Examples of org.apache.cassandra.dht.BytesToken

            rm.apply();
        }
        store.forceBlockingFlush();
        Collection<SSTableReader> sstables = store.getUnrepairedSSTables();
        assertEquals(store.getSSTables().size(), sstables.size());
        Range<Token> range = new Range<Token>(new BytesToken("0".getBytes()), new BytesToken("4".getBytes()));
        List<Range<Token>> ranges = Arrays.asList(range);

        SSTableReader.acquireReferences(sstables);
        long repairedAt = 1000;
        CompactionManager.instance.performAnticompaction(store, ranges, sstables, repairedAt);
View Full Code Here

Examples of org.apache.cassandra.dht.BytesToken

        assertTrue("should be empty: " + cf, cf == null || !cf.hasColumns());
    }

    private static Range<Token> rangeFor(int start, int end)
    {
        return new Range<Token>(new BytesToken(String.format("%03d", start).getBytes()),
                                new BytesToken(String.format("%03d", end).getBytes()));
    }
View Full Code Here

Examples of org.apache.cassandra.dht.BytesToken

        assertTrue("should be empty: " + cf, cf == null || !cf.hasColumns());
    }

    private static Range<Token> rangeFor(int start, int end)
    {
        return new Range<Token>(new BytesToken(String.format("%03d", start).getBytes()),
                                new BytesToken(String.format("%03d", end).getBytes()));
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.