Comments (6)
Within hector, the read/write operations all happen in Keyspace, CassandraClient encapsulates the connection to an individual Cassandra instance. Failover in this context is within the data operation on the inherently distributed keyspace, so those methods live there. In other words, we fail over to another client from within a keyspace operation, not vice versa.
If you choose to get a handle to the Cassandra.Client thrift stuff from CassandraClient, then you are loosing the functionality in Keyspace and to a large degree are on your own anyway.
from hector.
@hz your point is in place and this is a design issue I've been uncomfortable with from the beginning, but I agree with @zznate that the solution you suggest isn't going to work, at least no as things are now.
If you want to use Keyspace without failover you have 1 choice currently, to use FAIL_FAST.
Still you'd incur the (small) overhead of creating a client etc, but logically I believe it gets you what you need. I agree that this is not as clean, from the API perspective, but logically it's the same.
What we can do, though is maybe to implement two Keyspace implementations - one SimpleKeyspace and one FailoverCapableKeyspace and let the clients instantiate whichever Keyspace flavor they prefer.
I see this as a code enhancement, not a real feature. Let us know what you think.
Also, if you need this badly, we love contributions, just fork the project, make your changes and ping us for a code review.
from hector.
I had forked one before I created this issue. Let me think more about it.
from hector.
So, before any result is reached, I close this issue firstly. :)
from hector.
I added one interface: HectorRequest, to package the failover and pooling features.
The implements HectorRequestImpl implements the operation and failover.
The third class is HectorThriftRequest which extends HectorRequestImpl. It package all the thrift api in it.
Keyspace now initiate with a hector request. Each failover operation is run as request.thrift_api(parameter).
But you do some tricks on getColumn. I don't understand its logic.
I am not investigate the failover logic you used. So the code have many many mistakes. Please take some time to browse my code and decide if you can merge some into your trunk.
Thanks.
from hector.
Hi @hz, I'm sorry I had browsed http://github.com/hz/hector and couldn't find your changes. Could you post here (or email the dev mailing list from http://wiki.github.com/rantav/hector/mailing-lists) a link to your commits (something like http://github.com/rantav/hector/commit/4321125f79e9c3198ea2116527cd07546d737483)
Thanks!
from hector.
Related Issues (20)
- clock should get in a static way in HConnectionManager HOT 2
- HLocks configuration should allow a definable gc_grace seconds, instead of using default 10s HOT 2
- Clients wait indefinitely when pool exhausted HOT 2
- MicrosecondsClockResolution produces timestamps out of long range
- Wiki points to http://hector-client.org/
- Trivial improvements to *pom.xml HOT 2
- Upgrade dependency API usage to remove use of deprecated code
- me.prettyprint.hector.api.exceptions.HectorTransportException: Unable to open transport to (192.168.1.6):9160 HOT 2
- in 1.0.3 When many request come to hecotor pool . more than one node have problem.
- getting data from cassandra, column name from cassandra trailing with blank characters HOT 5
- DynamicLoadBalancingPolicy: LatencyAwareHClientPool may throw NoSuchElementException under certain circumstances HOT 1
- CQL 3 not supported
- Implement consistent logging for setters in me.prettyprint.cassandra.model.ConfigurableConsistencyLevel
- No Documentation available for Hector with SSL HOT 3
- Memory problem on ConcurrentHClientPool using HThriftClient with TFramedTransport HOT 3
- No failover policy when coordinating through partitioned off nodes
- Connecting to Cassandra does not ask for credentials
- hector 1.1-4 throws TimedOutException() execute_cql_query_result.read on Cassandra 2.1.12
- default validator comparator type on hector clients: "cannot parse 'SomeColumn' as hex bytes" HOT 3
- Copyright claim in HFactoryTest.java? HOT 1
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 hector.