[
https://issues.apache.org/jira/browse/CASSANDRA-197?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Jun Rao updated CASSANDRA-197:
------------------------------
Attachment: flexjson.jar
patch197.v2
v2 patch:
1. Extended get_string_property to support querying "token map". The returned
string is a JSON encoded <token, host> map.
2. A new class RingCache that caches the token map in a java application.
RingCache uses storage-conf.xml to obtain things like seeds, various ports, the
partitioning strategy, and the replication factor. During initialization,
RingCache makes a get_string_property call to the seed node to get the initial
token-to-host map. It then reuses the logic in the server to map a row key to a
list of hosts owning the row. If the token map changes, it's the application's
responsibility to refresh RingCache by calling refreshEndPointMap(). RingCache
doesn't start a Cassandra instance and can be embedded in any java application.
3. An example of how to use RingCache is provided at
test/unit/org.apache.cassandra.client.TestRingCache. For Hadoop integration,
one can use RingCache in InputFormat to generate splits with locality.
> 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
> Components: Core
> Reporter: Jun Rao
> Assignee: Jun Rao
> Attachments: flexjson.jar, issue197.patchv1, patch197.v2
>
>
> 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.