Examples of decorateKey()


Examples of org.apache.cassandra.dht.IPartitioner.decorateKey()

    }

    public static void validateKeyRange(String start_key, String end_key, int row_count) throws InvalidRequestException
    {
        IPartitioner p = StorageService.getPartitioner();
        Token startToken = p.decorateKey(start_key).token;
        Token endToken = p.decorateKey(end_key).token;
        if (startToken.compareTo(endToken) > 0 && !endToken.equals(p.getMinimumToken()))
        {
            if (p instanceof RandomPartitioner)
                throw new InvalidRequestException("start key's md5 sorts after end key's md5.  this is not allowed; you probably should not specify end key at all, under RandomPartitioner");
View Full Code Here

Examples of org.apache.cassandra.dht.IPartitioner.decorateKey()

    public static void validateKeyRange(String start_key, String end_key, int row_count) throws InvalidRequestException
    {
        IPartitioner p = StorageService.getPartitioner();
        Token startToken = p.decorateKey(start_key).token;
        Token endToken = p.decorateKey(end_key).token;
        if (startToken.compareTo(endToken) > 0 && !endToken.equals(p.getMinimumToken()))
        {
            if (p instanceof RandomPartitioner)
                throw new InvalidRequestException("start key's md5 sorts after end key's md5.  this is not allowed; you probably should not specify end key at all, under RandomPartitioner");
            else
View Full Code Here

Examples of org.apache.cassandra.dht.IPartitioner.decorateKey()

        }

        if (range.start_key != null)
        {
            IPartitioner p = StorageService.getPartitioner();
            Token startToken = p.decorateKey(range.start_key).token;
            Token endToken = p.decorateKey(range.end_key).token;
            if (startToken.compareTo(endToken) > 0 && !endToken.equals(p.getMinimumToken()))
            {
                if (p instanceof RandomPartitioner)
                    throw new InvalidRequestException("start key's md5 sorts after end key's md5.  this is not allowed; you probably should not specify end key at all, under RandomPartitioner");
View Full Code Here

Examples of org.apache.cassandra.dht.IPartitioner.decorateKey()

        if (range.start_key != null)
        {
            IPartitioner p = StorageService.getPartitioner();
            Token startToken = p.decorateKey(range.start_key).token;
            Token endToken = p.decorateKey(range.end_key).token;
            if (startToken.compareTo(endToken) > 0 && !endToken.equals(p.getMinimumToken()))
            {
                if (p instanceof RandomPartitioner)
                    throw new InvalidRequestException("start key's md5 sorts after end key's md5.  this is not allowed; you probably should not specify end key at all, under RandomPartitioner");
                else
View Full Code Here

Examples of org.apache.cassandra.dht.IPartitioner.decorateKey()

            assert rows.size() >= 3;

            for (int i = 0; i < 3; i++)
            {
                String expectedKey = "data-" + cf + "-" + (i + 1);
                assertEquals(p.decorateKey(ByteBufferUtil.bytes(expectedKey)), rows.get(i).key);
            }
        }
    }
}
View Full Code Here

Examples of org.apache.cassandra.dht.IPartitioner.decorateKey()

        ArrayList<String> orderedKeys = new ArrayList<String>(columnFamilies_.keySet());
        Collections.sort(orderedKeys, new Comparator<String>()
        {
            public int compare(String o1, String o2)
            {
                return dc.compare(partitioner.decorateKey(o1), partitioner.decorateKey(o2));
            }
        });
        DataOutputBuffer buffer = new DataOutputBuffer();
        for (String key : orderedKeys)
        {
View Full Code Here

Examples of org.apache.cassandra.dht.IPartitioner.decorateKey()

        ArrayList<String> orderedKeys = new ArrayList<String>(columnFamilies_.keySet());
        Collections.sort(orderedKeys, new Comparator<String>()
        {
            public int compare(String o1, String o2)
            {
                return dc.compare(partitioner.decorateKey(o1), partitioner.decorateKey(o2));
            }
        });
        DataOutputBuffer buffer = new DataOutputBuffer();
        for (String key : orderedKeys)
        {
View Full Code Here

Examples of org.apache.cassandra.dht.IPartitioner.decorateKey()

            if (columnFamily != null)
            {
                /* serialize the cf with column indexes */
                ColumnFamily.serializer().serializeWithIndexes(columnFamily, buffer);
                /* Now write the key and value to disk */
                writer.append(partitioner.decorateKey(key), buffer);
            }
        }
        SSTableReader ssTable = writer.closeAndOpenReader(DatabaseDescriptor.getKeysCachedFraction(table_));
        cfStore.onMemtableFlush(cLogCtx);
        cfStore.storeLocation(ssTable);
View Full Code Here

Examples of org.apache.cassandra.dht.IPartitioner.decorateKey()

            assert rows.size() >= 3;

            for (int i = 0; i < 3; i++)
            {
                String expectedKey = "data-" + cf + "-" + (i + 1);
                assertEquals(p.decorateKey(ByteBufferUtil.bytes(expectedKey)), rows.get(i).key);
            }
        }
    }
}
View Full Code Here

Examples of org.apache.cassandra.dht.IPartitioner.decorateKey()

            assert rows.size() >= 3;

            for (int i = 0; i < 3; i++)
            {
                String expectedKey = "data-" + cf + "-" + (i + 1);
                assertEquals(p.decorateKey(ByteBufferUtil.bytes(expectedKey)), rows.get(i).key);
            }
        }
    }
}
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.