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

Sylvain Lebresne commented on CASSANDRA-3576:
---------------------------------------------

It is indeed not thread safe but that was kind of on purpose. It didn't feel 
like there is very much use to access the writers concurrently. They are 
clearly IO bounded, so there isn't much use to concurrently access them. 
Besides, for SSTableSimpleWriter, accessing it concurrently would be a bug 
anyway. The intention was that the correct use case is one writer per thread, 
but multiple thread. And since there is definitively cases where threaf-safety 
doesn't make sense, I'd rather avoid the synchronization cost and have people 
synchronize extraneously if that is really what they want.

Note that the UnsortedWriter could probably be improving by having it spawn a 
'writer' thread, allowing to continue feed new info in the buffer while the 
writer thread is busy writting the previous buffer, but even if we do this 
internally, the one writer per thread would still make more sense.
                
> make AbstractSSTableSimpleWriters threadsafe
> --------------------------------------------
>
>                 Key: CASSANDRA-3576
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3576
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 0.8.1
>            Reporter: Jonathan Ellis
>            Assignee: Sylvain Lebresne
>            Priority: Minor
>             Fix For: 1.1
>
>
> I took a quick look and the Unsorted writer has a non-threadsafe 
> getColumnFamily method.  I did not look deeper than that.

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

        

Reply via email to