You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Benedict (JIRA)" <ji...@apache.org> on 2015/08/18 18:55:45 UTC

[jira] [Comment Edited] (CASSANDRA-10082) Transactional classes shouldn't also implement streams, channels, etc

    [ https://issues.apache.org/jira/browse/CASSANDRA-10082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14701578#comment-14701578 ] 

Benedict edited comment on CASSANDRA-10082 at 8/18/15 4:54 PM:
---------------------------------------------------------------

Still not convinced by the nomenclature, sorry :)

How about {{DetransactionWrapper}}, {{UntransactionalWrapper}}, {{AsNonTransactional}} or something? Just want to make it clear what it is we're doing. Similar method naming.

You're also working against an obsolete version of {{SequentialWriter}} by the looks of it.

Any chance of switching to github for your patches, btw? It's a lot easier to negotiate the commit process, and to rebase as necessary.


was (Author: benedict):
Still not convinced by the nomenclature, sorry :)

How about {{DetransactionWrapper}}, {{UntransactionalWrapper}}, {{AsNonTransactional}} or something? Just want to make it clear what it is we're doing. Similar method naming.

You're also working against an obsolete version of {{SequentialWriter}} by the looks of it.

> 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)