Coder Social home page Coder Social logo

Comments (6)

zznate avatar zznate commented on June 24, 2024

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.

rantav avatar rantav commented on June 24, 2024

@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.

hz avatar hz commented on June 24, 2024

I had forked one before I created this issue. Let me think more about it.

from hector.

hz avatar hz commented on June 24, 2024

So, before any result is reached, I close this issue firstly. :)

from hector.

hz avatar hz commented on June 24, 2024

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.

rantav avatar rantav commented on June 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.