First post and apologies in advanced as I'm fairly new to Cassandra
and Pelops. So this is not really a Pelops issue but more a question
to the people in this list to see if anyone can spot what I am doing
wrong.
Basically, I do create my Cassandra schema from my Java app using
pelops. To simplify, I am showing just one of the snippets:
CfDef cfNode = new CfDef("rayo", "node")
.setColumn_type(ColumnFamilyManager.CFDEF_TYPE_SUPER)
.setComparator_type(ColumnFamilyManager.CFDEF_COMPARATOR_BYTES)
.setSubcomparator_type(ColumnFamilyManager.CFDEF_COMPARATOR_BYTES)
.setDefault_validation_class("UTF8Type")
.setColumn_metadata(Arrays.asList(
new ColumnDef(Bytes.fromUTF8("hostname").getBytes(),
ColumnFamilyManager.CFDEF_COMPARATOR_UTF8),
new ColumnDef(Bytes.fromUTF8("priority").getBytes(),
ColumnFamilyManager.CFDEF_COMPARATOR_UTF8),
new ColumnDef(Bytes.fromUTF8("weight").getBytes(),
ColumnFamilyManager.CFDEF_COMPARATOR_UTF8)
));
ksDef.addToCf_defs(cfNode);
cfManager.addColumnFamily(cfNode);
I insert an entry with this code: (assume all the undefined variables
are strings)
mutator.writeSubColumns("node", node.getJid(), platform,
mutator.newColumnList(
mutator.newColumn("hostname", node.getHostname()),
mutator.newColumn("priority", "100"),
mutator.newColumn("weight","1")
)
);
And finally when I go to the Cassandra CLI and query for that entry I
get the following output:
[default@rayo] list node;
Using default limit of 100
-------------------
RowKey: 7573657262406c6f63616c686f7374
=> (super_column=73746167696e67,
(column=686f73746e616d65, value=localhost,
timestamp=1324034080195000)
(column=7072696f72697479, value=100, timestamp=1324034080195000)
(column=776569676874, value=1, timestamp=1324034080195000))
1 Row Returned.
Elapsed time: 7 msec(s).
So the issue is very simple. I am getting the hex representation of
the rows and column names instead of an actual String representation.
I am sure this is some misconfiguration on the schema that I create.
Does anyone know what I need to change in the schema creation code to
get proper strings on the cli?