rantav/hector — Issue #405: Inconsistent index type handling
Author: quorg
Created: 2012-01-30 10:25:01+00:00
State: open

There seems to be a mismatch with the handling of column definition index types as written in the examples and the backend storing / reading them.

Example extract from com.riptano.cassandra.hector.example.SchemaManipulation:
```java
BasicColumnDefinition columnDefinition = new BasicColumnDefinition();
columnDefinition.setName(stringSerializer.toByteBuffer("birthdate"));
columnDefinition.setIndexType(ColumnIndexType.KEYS);
columnDefinition.setValidationClass(ComparatorType.LONGTYPE.getClassName());
```

When storing this definition to cassandra, at some point `me.prettyprint.cassandra.service.ThriftColumnDef.toThrift()` will be called.

Extract from `toThrift()`:
```java
ColumnDef d = new ColumnDef();
if ( indexName != null ) {
d.setIndex_name(indexName);
d.setIndex_type(indexTypeToThrift(indexType));
}
```

-> When creating a column definition as in the example above, the index type will not be stored, as no index name has been given.

I can't judge what's wrong: Example or `toThrift()`?