incubator-cassandra-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Send reads concurrently
Date Wed, 12 Jan 2011 11:03:12 GMT

I am reading through getRangeSlice() in StorageProxy, and I am trying to
do roughly the same thing for a join operation I am trying to implement in

I see that getRangeSlice() loops through all available ranges, and for
each range, it sends a request to the applicable nodes and then handles
their answer *before* advancing to the next range. That may be fine for
getRangeSlice(), but I'd like to send requests for all ranges at once and
collect and handle the responses asynchronoysly (when they arrive).

I tried the following (pseudocode mixed with code):

<create a list of handlers>

for (AbstractBounds range : ranges)
    <create handler for this range>

    for (InetAddress endpoint : entry.getValue())
        MessagingService.instance.sendRR(message, endpoint, handler);


for(QRH handler : handlers)
    List<ByteBuffer> response = handler.get();

However my client gets a TimedOutException and I think Cassandra blocks
during the resolve() in get().

I am using 0.7.0rc1, however I don't think this code would have changed much.

Any ideas?


View raw message