[ https://issues.apache.org/jira/browse/CASSANDRA-2475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169759#comment-13169759 ]
Eric Evans commented on CASSANDRA-2475: --------------------------------------- bq. Thanks Eric, for all the help and attention to detail! I learned a lot. I'll be tuning up my formatter (Eclipse) to handle the nits of formatting and white-space. And I'll try to break things up much finer in future large patches Thank you for knocking this out! bq. I'm still a bit iffy about having the server ditching entries in the prepared statement map without regard to whether the client side closed the associated PreparedStatement. But like you, I think the chances of ever seeing 50 entries without closing the connection are slim. Think about it this way: whether or not the client removes unused entries, it's still prudent to put a limit on the number of statements we cache, otherwise a buggy client could eat up our heap. And, if you're going to put something in place to evict, choosing the least recently accessed seems like the safest approach. The question then becomes, how many can we afford to hang onto, and what is the likelihood that, short of a buggy client, we won't be able to accommodate everything needed. Remember, this is only for the life of a connection, reconnecting starts a whole new Map. So if an API to remove entries is ultimately of little to no benefit, then we should save everyone the trouble of implementing and maintaining it. And, we could always take this to a wider audience to see what others think, but it's easier to add something like this later than it is to remove (or fix) it. Also, 50 might not be the right number. I basically pulled that out of my butt. > Prepared statements > ------------------- > > Key: CASSANDRA-2475 > URL: https://issues.apache.org/jira/browse/CASSANDRA-2475 > Project: Cassandra > Issue Type: New Feature > Components: API, Core > Affects Versions: 1.0.5 > Reporter: Eric Evans > Assignee: Rick Shaw > Priority: Minor > Labels: cql > Fix For: 1.1 > > Attachments: 2475-v1.patch, 2475-v2.patch, 2475-v3.1.patch, > 2475-v3.2-Thrift.patch, v1-0001-CASSANDRA-2475-prepared-statement-patch.txt, > v1-0002-regenerated-thrift-java.txt, > v2-0001-CASSANDRA-2475-rickshaw-2475-v3.1.patch.txt, > v2-0002-rickshaw-2475-v3.2-Thrift.patch-w-changes.txt, > v2-0003-eevans-increment-thrift-version-by-1-not-3.txt, > v2-0004-eevans-misc-cleanups.txt, > v2-0005-eevans-refactor-for-better-encapsulation-of-prepare.txt, > v2-0006-eevans-log-queries-at-TRACE.txt, > v2-0007-use-an-LRU-map-for-storage-of-prepared-statements.txt > > -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira