You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by "cbertu81@libero.it" <cb...@libero.it> on 2010/10/18 18:25:28 UTC
TimeUUID makes me crazy
I am getting crazy using TimeUUID in cassandra via Java. I've read the FAQ but
it didn't help.
Can I use a TimeUUID as ROW identifier? (if converted to string)
I have a CF like this and SCF like these:
<ColumnFamily Name="Opecs" CompareWith="TimeUUIDType"/>
TIMEUUID OPECID (ROW) {
phone: 123
address: street xyz
}
<ColumnFamily Name="UserOpecs" ColumnType="Super" CompareWith="TimeUUIDType"
CompareSubcolumnsWith="BytesType" />
String USERID (ROW) {
TIMEUUID OPECID (SuperColumnName) {
collection of columns;
}
}
In one situation the TimeUUID is a ROW identifier while in another is the
SuperColumn name. I get many "UUID must be a 16 byte" when I try to read a data
that did not give any exception during his save.
at a Time T0 this one works: mutator.writeColumns(UuidHelper.timeUuidFromBytes
(OpecID).toString(), opecfamily, notNull); // (notnull contains a list of
columns also opecstatus)
Immediately after this one raise an exception: selector.getColumnFromRow
(UuidHelper.timeUuidFromBytes(OpecID).toString(), opecfamily, "opecstatus",
ConsistencyLevel.ONE)
I hope that someone help me understanding it ...
Re: TimeUUID makes me crazy
Posted by Sylvain Lebresne <sy...@yakaz.com>.
In you first column family, you are using a UUID as a row key (your column
names are strings apparently (phone, addres)). The CompareWith directive
specify the comparator for *column names*. So you are providing strings where
you indicated Cassandra you'll provide UUID, hence the exceptions.
The sorting of rows is determined by the partitioner (and there is no
support for
TimeUUID sorting of rows).
--
Sylvain
On Mon, Oct 18, 2010 at 6:25 PM, cbertu81@libero.it <cb...@libero.it> wrote:
> I am getting crazy using TimeUUID in cassandra via Java. I've read the FAQ but
> it didn't help.
> Can I use a TimeUUID as ROW identifier? (if converted to string)
>
> I have a CF like this and SCF like these:
>
> <ColumnFamily Name="Opecs" CompareWith="TimeUUIDType"/>
> TIMEUUID OPECID (ROW) {
> phone: 123
> address: street xyz
> }
>
> <ColumnFamily Name="UserOpecs" ColumnType="Super" CompareWith="TimeUUIDType"
> CompareSubcolumnsWith="BytesType" />
> String USERID (ROW) {
> TIMEUUID OPECID (SuperColumnName) {
> collection of columns;
> }
> }
>
> In one situation the TimeUUID is a ROW identifier while in another is the
> SuperColumn name. I get many "UUID must be a 16 byte" when I try to read a data
> that did not give any exception during his save.
>
> at a Time T0 this one works: mutator.writeColumns(UuidHelper.timeUuidFromBytes
> (OpecID).toString(), opecfamily, notNull); // (notnull contains a list of
> columns also opecstatus)
>
> Immediately after this one raise an exception: selector.getColumnFromRow
> (UuidHelper.timeUuidFromBytes(OpecID).toString(), opecfamily, "opecstatus",
> ConsistencyLevel.ONE)
>
> I hope that someone help me understanding it ...
>
>
Re: TimeUUID makes me crazy
Posted by Aaron Morton <aa...@thelastpickle.com>.
Whats the call stack for the error and what client you using ?
Is the error client side or server side? Is there an error in the server side log?
My guess is there is something wrong in the way your are creating the UUID for the colum and super column names, rather than for the key. You can use UUID for the key as a string (or byte array in 0.7) so a badly formatted value will not matter.
Aaron
On 19 Oct, 2010,at 05:25 AM, "cbertu81@libero.it" <cb...@libero.it> wrote:
I am getting crazy using TimeUUID in cassandra via Java. I've read the FAQ but
it didn't help.
Can I use a TimeUUID as ROW identifier? (if converted to string)
I have a CF like this and SCF like these:
<ColumnFamily Name="Opecs" CompareWith="TimeUUIDType"/>
TIMEUUID OPECID (ROW) {
phone: 123
address: street xyz
}
<ColumnFamily Name="UserOpecs" ColumnType="Super" CompareWith="TimeUUIDType"
CompareSubcolumnsWith="BytesType" />
String USERID (ROW) {
TIMEUUID OPECID (SuperColumnName) {
collection of columns;
}
}
In one situation the TimeUUID is a ROW identifier while in another is the
SuperColumn name. I get many "UUID must be a 16 byte" when I try to read a data
that did not give any exception during his save.
at a Time T0 this one works: mutator.writeColumns(UuidHelper.timeUuidFromBytes
(OpecID).toString(), opecfamily, notNull); // (notnull contains a list of
columns also opecstatus)
Immediately after this one raise an exception: selector.getColumnFromRow
(UuidHelper.timeUuidFromBytes(OpecID).toString(), opecfamily, "opecstatus",
ConsistencyLevel.ONE)
I hope that someone help me understanding it ..