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

Benedict commented on CASSANDRA-4050:
-------------------------------------

bq. It looks like we run the risk of Bad Things if someone does a 
MemoryInputStream.skipBytes that pushes the position past Max Int - this impl 
has us casting off the remainder on a seek call so you could end up in negative 
territory.

How so? The MemoryInputStream defines what its limit is, and the skipBytes 
method ensures it never goes above this. So seek() can never be called with a 
value that is out of range (since it is a protected method). We could put in an 
assert if we want to be doubly certain, however, and that's probably not a bad 
idea for simple declaration of intent.

I think the reduced code duplication (from readLine and skipBytes now being 
shared), and cleaner hierarchy is preferable, especially as ADISmall is not a 
very clear distinction from ADI. Think the overall footprint is reduced rather 
than increased...?

bq. Thanks for taking the time to do that - clean idiomatic usage of the nio 
API's clearly makes things easier to parse.

I find the NIO library tough to parse at the best of times, and wanted to be 
sure I was reading it right, so it was a freebie to change as I reviewed :)

> Unable to remove snapshot files on Windows while original sstables are live
> ---------------------------------------------------------------------------
>
>                 Key: CASSANDRA-4050
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4050
>             Project: Cassandra
>          Issue Type: Bug
>         Environment: Windows 7
>            Reporter: Jim Newsham
>            Assignee: Joshua McKenzie
>            Priority: Minor
>         Attachments: CASSANDRA-4050_v1.patch
>
>
> I'm using Cassandra 1.0.8, on Windows 7.  When I take a snapshot of the 
> database, I find that I am unable to delete the snapshot directory (i.e., dir 
> named "{datadir}\{keyspacename}\snapshots\{snapshottag}") while Cassandra is 
> running:  "The action can't be completed because the folder or a file in it 
> is open in another program.  Close the folder or file and try again" [in 
> Windows Explorer].  If I terminate Cassandra, then I can delete the directory 
> with no problem.
> I expect to be able to move or delete the snapshotted files while Cassandra 
> is running, as this should not affect the runtime operation of Cassandra.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to