[ https://issues.apache.org/jira/browse/CASSANDRA-10082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14703113#comment-14703113 ]
Benedict commented on CASSANDRA-10082: -------------------------------------- Looking at your 2.2 patch again, I see you were applying this much more literally than I had thought. I was only corroborating that your transformation to a non-transactional OS was fine, but I'm not comfortable with the changes you've made to the standard write path. That's introducing a lot of indirection to no gain. Since this can't (and hasn't) been applied to 3.0, it isn't even consistent / persistent, it's just a regression for 2.2, so I cannot see a good reason to introduce it. We could push the prior change without this modification, but I've pushed an "alternative" offering [here|https://github.com/belliottsmith/cassandra/tree/10082], which I think is much simpler: a boolean flag in {{SequentialWriter}} that switches its behaviour so it can be used like a standard {{OutputStream}}. > Transactional classes shouldn't also implement streams, channels, etc > --------------------------------------------------------------------- > > Key: CASSANDRA-10082 > URL: https://issues.apache.org/jira/browse/CASSANDRA-10082 > Project: Cassandra > Issue Type: Improvement > Reporter: Blake Eggleston > Assignee: Blake Eggleston > Attachments: > 0001-replacing-SequentialWriter-OutputStream-extension-wi.patch, 10082-2.txt > > > Since the close method on the Transactional interface means "abort if commit > hasn't been called", mixing Transactional and AutoCloseable interfaces where > close means "we're done here" is pretty much never the right thing to do. > The only class that does this is SequentialWriter. It's not used in a way > that causes a problem, but it's still a potential hazard for future > development. > The attached patch replaces the SequentialWriter OutputStream implementation > with a wrapper class that implements the expected behavior on close, and adds > a warning to the Transactional interface. It also adds a unit test that > demonstrates the problem without the fix. -- This message was sent by Atlassian JIRA (v6.3.4#6332)