cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dave Brosius <dbros...@baybroadband.net>
Subject Re: Composite column/key creation via Hector
Date Thu, 12 Jul 2012 22:42:33 GMT
BTW, an issue was just fixed with dynamic columns in hector, you might 
want to try trunk.

https://github.com/hector-client/hector/commit/2910b484629add683f61f392553e824c291fb6eb



On 07/12/2012 06:25 PM, aaron morton wrote:
> You may have better luck on the Hector Mailing list… 
> https://groups.google.com/forum/?fromgroups#!forum/hector-users 
> <https://groups.google.com/forum/?fromgroups#%21forum/hector-users>
>
>
> Here is something I found in the docs though 
> http://hector-client.github.com/hector/build/html/content/composite_with_templates.html
>
> Cheers
>
> -----------------
> Aaron Morton
> Freelance Developer
> @aaronmorton
> http://www.thelastpickle.com
>
> On 12/07/2012, at 9:04 AM, Michael Cherkasov wrote:
>
>> Hi all,
>>
>> What is the right way to create CF with dynamic composite column and 
>> composite key?
>>
>> Now I use code like this:
>>
>>  private static final String DEFAULT_DYNAMIC_COMPOSITE_ALIAES =
>>             
>> "(a=>AsciiType,b=>BytesType,i=>IntegerType,x=>LexicalUUIDType,l=>LongType,t=>TimeUUIDType,s=>UTF8Type,u=>UUIDType,A=>AsciiType(reversed=true),B=>BytesType(reversed=true),I=>IntegerType(reversed=true),X=>LexicalUUIDType(reversed=true),L=>LongType(reversed=true),T=>TimeUUIDType(reversed=true),S=>UTF8Type(reversed=true),U=>UUIDType(reversed=true))";
>>
>> for composite columns:
>>  BasicColumnFamilyDefinition columnFamilyDefinition = new 
>> BasicColumnFamilyDefinition();
>>         columnFamilyDefinition.setComparatorType( 
>> ComparatorType.DYNAMICCOMPOSITETYPE );
>>         columnFamilyDefinition.setComparatorTypeAlias( 
>> DEFAULT_DYNAMIC_COMPOSITE_ALIAES );
>>         columnFamilyDefinition.setKeyspaceName( keyspaceName );
>>         columnFamilyDefinition.setName( "TestCase" );
>>         columnFamilyDefinition.setColumnType( ColumnType.STANDARD );
>>         ColumnFamilyDefinition cfDefStandard = new ThriftCfDef( 
>> columnFamilyDefinition );
>>         cfDefStandard.setKeyValidationClass( 
>> ComparatorType.UTF8TYPE.getClassName() );
>>         cfDefStandard.setDefaultValidationClass( 
>> ComparatorType.UTF8TYPE.getClassName() );
>>
>> for keys:
>> columnFamilyDefinition = new BasicColumnFamilyDefinition();
>>         columnFamilyDefinition.setComparatorType( 
>> ComparatorType.UTF8TYPE );
>>         columnFamilyDefinition.setKeyspaceName( keyspaceName );
>>         columnFamilyDefinition.setName( "Parameter" );
>>         columnFamilyDefinition.setColumnType( ColumnType.STANDARD );
>>         cfDefStandard = new ThriftCfDef( columnFamilyDefinition );
>>         cfDefStandard.setKeyValidationClass( 
>> ComparatorType.DYNAMICCOMPOSITETYPE.getClassName() + 
>> DEFAULT_DYNAMIC_COMPOSITE_ALIAES );
>>         cfDefStandard.setDefaultValidationClass( 
>> ComparatorType.UTF8TYPE.getClassName() );
>>
>> Does it correct code? Do I really need 
>> so terrible DEFAULT_DYNAMIC_COMPOSITE_ALIAES ?
>


Mime
View raw message