cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Schnitzius <>
Subject Re: Feeding in specific Cassandra columns into Hadoop
Date Tue, 04 May 2010 06:13:17 GMT
> You should test that getSlicePredicate(conf).equals(originalPredicate)
That's it!  The byte arrays are slightly different after setting it on the
Hadoop config.  Below is a simple test which demonstrates the bug -- it
should print "true" but instead prints "false".  Please let me know if a bug
gets raised so I can track it.


import org.apache.cassandra.hadoop.ConfigHelper;
import org.apache.cassandra.thrift.SlicePredicate;
import org.apache.hadoop.conf.Configuration;

import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.List;

 * A class which demonstrates a bug in Cassandra's ConfigHelper.
public class SlicePredicateTest {

    public static void main(String[] args) {
        long columnValue = 1271253600000l;
        byte[] columnBytes = getBytes(columnValue);
        List<byte[]> columnNames = new ArrayList<byte[]>();
        SlicePredicate originalPredicate = new SlicePredicate();
        Configuration conf = new Configuration();
        ConfigHelper.setSlicePredicate(conf, originalPredicate);


        private static byte[] getBytes(long l) {
        byte[] bytes = new byte[8];
        return bytes;

View raw message