cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ertio Lew <ertio...@gmail.com>
Subject Re: Composite column names: How much space do they occupy ?
Date Mon, 02 Jan 2012 11:29:26 GMT
Sorry I forgot to tell that I'm using Hector to communicate with
Cassandra.  CS.toByteBuffer  is to convert the composite type name to
ByteBuffer.

Can anyone aware of Hector API enlighten me why am I seeing this size for
the composite type names.

On Mon, Jan 2, 2012 at 2:52 PM, aaron morton <aaron@thelastpickle.com>wrote:

> What is the definition of the composite type and what is CS.toByteBuffer ?
>
> CompositeTypes have a small overhead see
> https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/db/marshal/CompositeType.java
>
> Hope that helps.
> Aaron
>
> -----------------
> Aaron Morton
> Freelance Developer
> @aaronmorton
> http://www.thelastpickle.com
>
> On 2/01/2012, at 6:25 PM, Ertio Lew wrote:
>
> I am storing composite column names which are made up of two integer
> components. However I am shocked after seeing the storage overhead of these.
>
> I just tried out a composite name (with single integer component):
>
>           Composite composite = new Composite();
>           composite.addComponent(-165376575,is);
>
> System.out.println(CS.toByteBuffer( composite ).array().length); // the
> result is 256
>
>
> After writing & then reading back this composite column from cassandra:
>
> System.out.println(CS.toByteBuffer( readColumn.getName() ).array().length);
> // the result is 91
>
>
> How much is the storage overhead, as I am quite sure that  I'm making a
> mistake in realizing the actual values ?
>
>
>

Mime
View raw message