From: Vivek Mishra Sent: Friday, June 17, 2011 3:25 PM To: user@cassandra.apache.org Subject: getFieldValue()
Hi, I was looking into getFieldValue method for SuperColumn and SlicePredicate apis. It looks to me slight confusing as underlying APIs are returning Object and developer can only be aware of type of object either by looking into Cassandra code base or by ClassCastException. For example, I need to retrieve column name and it's value for a SuperColumnFamily "SuperCli" is: List<KeySlice> keySlices = cassndraClient.get_range_slices(new ColumnParent( "SuperCli"), slicePredicate, keyRange, ConsistencyLevel.ONE); System.out.println(keySlices.size() + " No. of rows exist for the column family:" + "SuperCli"); for( KeySlice slice :keySlices) { city = "noida"; System.out.println(new String((byte[]) (slice.getColumns().get(0).getSuper_column().getFieldValue(org.apache.cassandra.thrift.SuperColumn._Fields.NAME))).toString()); } Am I doing something wrong or such typecasting is must? Shouldn't we hide this complexity and handle it implicitly in CASSANDRA? Or may be introducing a Helper Class can reduce such amount of code ? Is it possible to retrieve a specific SuperColumn by specifying it's value in SliceRange query? I can't see any method with such search API and I believe it is a real time scenario. SuperCli is a super column family holding number of dynamic super columns. ________________________________ Write to us for a Free Gold Pass to the Cloud Computing Expo, NYC to attend a live session by Head of Impetus Labs on 'Secrets of Building a Cloud Vendor Agnostic PetaByte Scale Real-time Secure Web Application on the Cloud '. Looking to leverage the Cloud for your Big Data Strategy ? Attend Impetus webinar on May 27 by registering at http://www.impetus.com/webinar?eventid=42 . NOTE: This message may contain information that is confidential, proprietary, privileged or otherwise protected by law. The message is intended solely for the named addressee. If received in error, please destroy and notify the sender. Any use of this email is prohibited when received in error. Impetus does not represent, warrant and/or guarantee, that the integrity of this communication has been maintained nor that the communication is free of errors, virus, interception or interference.