[ 
https://issues.apache.org/jira/browse/CASSANDRA-197?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12713143#action_12713143
 ] 

Jonathan Ellis commented on CASSANDRA-197:
------------------------------------------

The problem is "client" in a loose sense means "anything that can add data to 
or request data from the system."  So each cassandra node can be considered a 
"client" of the others which is meaningless.

So to me when I say a "client level api" I strictly mean one we expose via 
thrift to processes that are not expected to know anything about the Cassandra 
internals.  As soon as you say "we should expose this to the client, but it 
will need to use (non-thrift) org.apache.cassandra classes and the server .xml 
file" then we are in violation of this implicit contract.

So:

No, we should not expose any internals to thrift-based clients.  Other "client" 
processes based on the server internals can of course make use of those 
internals as much as they want, and the best way to do this is to have them use 
the existing apis as much as possible rather than adding hacks to shuttle some 
of this state from one server process to another via thrift.  Using the exising 
APIs promotes clean design and avoids other "wheel re-invention" problems as I 
described above.  ("The server already has perfectly good connection pooling 
code; it makes sense to use that instead of creating a separate pooling 
mechanism. Nor does it make sense when you are building off the server jars to 
go through the extra thrift serialization; make the calls directly via 
MessagingService [i.e., storageproxy].")

So having thought things through it is clear to me that my earlier suggestion 
("i could see maybe having a call "endpoint_for_key" that gives an ip/port pair 
for primary node owning a key") is also a poor one, and I withdraw it.

> Expose ring map to client for more direct access
> ------------------------------------------------
>
>                 Key: CASSANDRA-197
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-197
>             Project: Cassandra
>          Issue Type: New Feature
>            Reporter: Jun Rao
>            Assignee: Jun Rao
>         Attachments: issue197.patchv1
>
>
> For certain applications, it would be nice if a read is sent to a node that 
> owns the data locally. This saves an extra network hop. To do that, a client 
> will need to cache the ring map and use it to figure out the nodes owning a 
> row.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to