On Mon, May 2, 2016 at 11:04 AM, Corry Opdenakker <co...@bestdata.be> wrote:
> Hi all, > > Is it possible to execute queries towards an embedded cassandra db whyle > bypassing completely the TCP (or IPC) protocol stack? > tl,dr: it is not for the faint of heart and you must understand *exactly* what you are doing. First I have to ask is there something specific that is not working the way you anticipate? Short answer is yes, though: https://github.com/apache/cassandra/tree/cassandra-2.1/examples/client_only This was removed in > 2.1 because very few people were using it and it was confusing to have there as an "example." I would not call this embedded so much as running a "client-mode proxy" but same idea. Apparantly the embedded cassandra is by default accessed using localhost as > hostname which will result in an IPC optimized connection I assume. > Not quite sure what you mean here? > Is there a way to fully omit the Tcp/ipc stack and execute queries > directly in-memory at the cassandra database? preferrably in a (query > resultset -> to -> appcode) zero-copy approach. > > Again, yes per the link above, but you would need to modify a few things for recent versions. The general approach is there however. You could even go a level below QueryProcessor and invoke methods on StorageProxy directly, bypassing the parse/PS lookup. That all said, you need to understand: - These are all internal APIs and as such can and will change substantially without warning even between point releases - Understanding the internals to use them correctly at this level requires a deep understanding of the code base - You will be bypassing a substantial amount of validation and could easily insert data that will corrupt your table - You can potentially put a lot more pressure on portions of the system that anticipate upstream throttling In sum: it's possible, but put something in production first using standard APIs before you go this deep. This is not the level at which you want to write your first app against Cassandra. -- ----------------- Nate McCall Austin, TX @zznate CTO Apache Cassandra Consulting http://www.thelastpickle.com