You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@kafka.apache.org by "Jay Kreps (JIRA)" <ji...@apache.org> on 2013/09/21 00:18:54 UTC

[jira] [Comment Edited] (KAFKA-1008) Unmap before resizing

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

Jay Kreps edited comment on KAFKA-1008 at 9/20/13 10:17 PM:
------------------------------------------------------------

Sriram:
1.1 This is because this.mmap can be null so you have to either acquire the lock. To avoid this I just make the max size a separate variable.
1.2 It's actually only really useful in this class because the fact that we want to lock only on windows is very specific to the logic of this class.
1.3 Yeah this is technically not necessary since this method is only used during initialization but I try never to have the correctness of methods depend on when they are used.

2. Added a lock for the leader election test cases. I am skipping the other usage because that file was heavily refactored in trunk and that lock removed (I think).

3. I intend 
      inLock\(x\) {
        foo
      }
to be read as "in lock x do foo". So I like it since it is declarative.
                
      was (Author: jkreps):
    Sriram:
1.1 This is because this.mmap can be null so you have to either acquire the lock. To avoid this I just make the max size a separate variable.
1.2 It's actually only really useful in this class because the fact that we want to lock only on windows is very specific to the logic of this class.
1.3 Yeah this is technically not necessary since this method is only used during initialization but I try never to have the correctness of methods depend on when they are used.

2. Added a lock for the leader election test cases. I am skipping the other usage because that file was heavily refactored in trunk and that lock removed (I think).

3. I intend 
      inLock(x) {
        foo
      }
to be read as "in lock x do foo". So I like it since it is declarative.
                  
> Unmap before resizing
> ---------------------
>
>                 Key: KAFKA-1008
>                 URL: https://issues.apache.org/jira/browse/KAFKA-1008
>             Project: Kafka
>          Issue Type: Bug
>          Components: core, log
>    Affects Versions: 0.8
>         Environment: Windows, Linux, Mac OS
>            Reporter: Elizabeth Wei
>            Assignee: Jay Kreps
>              Labels: patch
>             Fix For: 0.8
>
>         Attachments: KAFKA-0.8-1008-v7.patch, KAFKA-0.8-1008-v8.patch, KAFKA-1008-v6.patch, KAFKA-trunk-1008-v7.patch, unmap-v5.patch
>
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> While I was studying how MappedByteBuffer works, I saw a sharing runtime exception on Windows. I applied what I learned to generate a patch which uses an internal open JDK API to solve this problem.
> Following Jay's advice, I made a helper method called tryUnmap(). 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira