Comments (7)
Your pojo will need to implement the Comprable interface. Columns are stored internally in maps.
from astyanax.
It seems to me that from an API perspective the comparable logic beste be done in the getColumnByName using reflection, otherwise every one using the API needs to implement a comparable.
from astyanax.
More specifically you'll need to implement hashCode, compareTo and equals. I'll modify the docs to reflect this requirement.
from astyanax.
I really think it is a better idea to try and not have the user have to do this. It will make the implementation much uglier. Can't we use the utility methods provided by Apache commons to add these methods via reflection? The Pojo would then need to extend something, but adding three methods to create a two column composite is not nice.
from astyanax.
Point taken. I'll take a look.
from astyanax.
You may want to add a generic bound to enforce Comparable implementation check at compile time (with or without reflection impl. this will add safety). Also to check if hashCode() and equals() are implemented by T AnnotatedCompositeSerializer may create two instances of T in it's constructor and compare them and their hashcodes. If they are equal - methods are implemented.
public class AnnotatedCompositeSerializer<T extends Comparable<? super T>> extends AbstractSerializer<T> {
from astyanax.
Also in documentation for that serializer you may add a link to Guava's wiki page with examples of how to simply implement compareTo/hashCode/equals methods.
from astyanax.
Related Issues (20)
- Starting an CqlKeyspace while all hosts are down results to empty session (Using JavaDriver) HOT 1
- plan to support cassandra 2.1 and on HOT 1
- java.lang.NoSuchMethodError: com.google.common.cache.CacheBuilder.build()Lcom/google/common/cache/Cache; HOT 4
- Error while Shutting down tomcat while using astyanax library
- Remove log4j.xml from astyanax-core HOT 1
- read a part of object with chunked object store
- BadRequestException: Object Chunk storeage - InvalidRequestException - Astyanax
- Update DataStax version
- Update Cassandra Compatibility page
- Unexpected extraneous bytes after set value
- NodeDiscovery threads have non-unique name
- Cassandra Credentails
- Question regarding testGetAllKeysRoot method in ThriftKeyspaceImplTest.java HOT 1
- Nodes unreachable when upgrading from 2.2.5 to 3.0.9 on aws ec2snitch
- Wiki mentions DC Aware policy, but no such policy is defined in astyanax code
- Note that Astyanax is being retired? HOT 1
- API changes review for Astyanax Core
- astyanax-cql ships with version of Netty with known vulnerabilily HOT 1
- schema update
- https://github.com/Netflix/astyanax/wiki/Chunked-Object-Store
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from astyanax.