You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "Pavel Yaskevich (Created) (JIRA)" <ji...@apache.org> on 2011/09/29 00:06:46 UTC

[jira] [Created] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

off-heap cache to use sun.misc.Unsafe instead of JNA
----------------------------------------------------

                 Key: CASSANDRA-3271
                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
             Project: Cassandra
          Issue Type: Improvement
          Components: Core
            Reporter: Pavel Yaskevich
            Assignee: Pavel Yaskevich
            Priority: Minor
             Fix For: 1.1


Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Updated] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Jonathan Ellis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-3271:
--------------------------------------

    Attachment: 3271-v2.txt
    
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: 3271-v2.txt, CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117313#comment-13117313 ] 

Jonathan Ellis commented on CASSANDRA-3271:
-------------------------------------------

Also: bounds checking for *each byte* seems pretty heavyweight.  Feels like we'd want to add setBytes/getBytes for arrays (that just does one bounds check outside the inner loop), and update MemoryOutputStream to use that.  (I realize this is not a new problem for the Unsafe Memory per se.)
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Pavel Yaskevich (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117431#comment-13117431 ] 

Pavel Yaskevich commented on CASSANDRA-3271:
--------------------------------------------

If we will move to setBytes/getBytes that means that we will need to make BufferedMemory{Output/Input}Stream and on my opinion it kind of breaks idea of off-heap caches because we create such streams on each serialization/deserialization of the cache value so this re-buffering of the memory will be done all the time.
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117307#comment-13117307 ] 

Jonathan Ellis commented on CASSANDRA-3271:
-------------------------------------------

can you verify that this works w/ jdk 7 as well as 6?
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Pavel Yaskevich (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13118496#comment-13118496 ] 

Pavel Yaskevich commented on CASSANDRA-3271:
--------------------------------------------

Oh, I misunderstood you - I thought that you wanted to make Memory{Input/Output}Stream classes buffered... your patch looks good +1
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: 3271-v2.txt, CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Hudson (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13121593#comment-13121593 ] 

Hudson commented on CASSANDRA-3271:
-----------------------------------

Integrated in Cassandra #1144 (See [https://builds.apache.org/job/Cassandra/1144/])
    off-heap cache to use sun.misc.Unsafe instead of JNA
patch by Pavel Yaskevich; reviewed by Jonathan Ellis for CASSANDRA-3271

xedin : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1179467
Files : 
* /cassandra/trunk/CHANGES.txt
* /cassandra/trunk/src/java/org/apache/cassandra/cache/FreeableMemory.java
* /cassandra/trunk/src/java/org/apache/cassandra/cache/SerializingCacheProvider.java
* /cassandra/trunk/src/java/org/apache/cassandra/config/CFMetaData.java
* /cassandra/trunk/src/java/org/apache/cassandra/io/util/Memory.java
* /cassandra/trunk/src/java/org/apache/cassandra/io/util/MemoryInputStream.java
* /cassandra/trunk/src/java/org/apache/cassandra/io/util/MemoryOutputStream.java
* /cassandra/trunk/src/resources/org/apache/cassandra/cli/CliHelp.yaml
* /cassandra/trunk/test/unit/org/apache/cassandra/cache/CacheProviderTest.java

                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: 3271-v2.txt, CASSANDRA-3271-v3.patch, CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117310#comment-13117310 ] 

Jonathan Ellis commented on CASSANDRA-3271:
-------------------------------------------

- might as well use UtilUnsafe.getUnsafe since we already use high_scale_lib
- i think it's fine to leave off the super.finalize + throwable declaration on Memory.finalize

otherwise, lgtm.
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Updated] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Jonathan Ellis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-3271:
--------------------------------------

    Attachment: 3271-v2.txt

v2 attached.  fixes an off-by-one in checkPosition, and adds the multibyte methods I described.
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: 3271-v2.txt, CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Updated] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Jonathan Ellis (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jonathan Ellis updated CASSANDRA-3271:
--------------------------------------

    Attachment:     (was: 3271-v2.txt)
    
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: 3271-v2.txt, CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13116919#comment-13116919 ] 

Jonathan Ellis commented on CASSANDRA-3271:
-------------------------------------------

If we're rolling our own Memory, why do we need FreeableMemory subclassing it?
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Updated] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Pavel Yaskevich (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Yaskevich updated CASSANDRA-3271:
---------------------------------------

    Attachment: CASSANDRA-3271.patch
    
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13121550#comment-13121550 ] 

Jonathan Ellis commented on CASSANDRA-3271:
-------------------------------------------

{noformat}
+        else if (bufferOffset < 0
+                 || bufferOffset > buffer.length
+                 || count < 0
+                 || bufferOffset + count > buffer.length
+                 || bufferOffset + count < 0)
{noformat}

I think the 2nd and 5th predicates there are redundant -- e.g., if we know bufferOffset and count are both positive, then we also know bufferOffset + count is positive w/o needing to test it explicitly.

other than that, +1
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: 3271-v2.txt, CASSANDRA-3271-v3.patch, CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Pavel Yaskevich (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117391#comment-13117391 ] 

Pavel Yaskevich commented on CASSANDRA-3271:
--------------------------------------------

After thinking about it - it maybe not such a good idea to buffer memory contents comparing to boundary checks.
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Pavel Yaskevich (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117309#comment-13117309 ] 

Pavel Yaskevich commented on CASSANDRA-3271:
--------------------------------------------

Sure.
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Updated] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Pavel Yaskevich (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Pavel Yaskevich updated CASSANDRA-3271:
---------------------------------------

    Attachment: CASSANDRA-3271-v3.patch

validation of the buffer added to setBytes/getBytes Memory methods. In checkPosition(...) IllegalArgumentException changed to IndexOutOfBoundsException
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: 3271-v2.txt, CASSANDRA-3271-v3.patch, CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13116921#comment-13116921 ] 

Jonathan Ellis commented on CASSANDRA-3271:
-------------------------------------------

... I guess we might want a Memory object that we don't reference count around.  Although I can't see any benefit there vs just keeping it on-heap.
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Jonathan Ellis (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117427#comment-13117427 ] 

Jonathan Ellis commented on CASSANDRA-3271:
-------------------------------------------

?
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Pavel Yaskevich (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13117135#comment-13117135 ] 

Pavel Yaskevich commented on CASSANDRA-3271:
--------------------------------------------

bq. If we're rolling our own Memory, why do we need FreeableMemory subclassing it?

FreeableMemory is already subclassing o.a.c.io.util.Memory. 

bq. I guess we might want a Memory object that we don't reference count around. Although I can't see any benefit there vs just keeping it on-heap.

I don't see it either. But anyway - if we will need that in the future o.a.c.io.util.Memory can be changed appropriately.
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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

        

[jira] [Commented] (CASSANDRA-3271) off-heap cache to use sun.misc.Unsafe instead of JNA

Posted by "Pavel Yaskevich (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CASSANDRA-3271?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13118397#comment-13118397 ] 

Pavel Yaskevich commented on CASSANDRA-3271:
--------------------------------------------

After CASSANDRA-3275 is committed I can now confirm that patch works under JDK 7.
                
> off-heap cache to use sun.misc.Unsafe instead of JNA
> ----------------------------------------------------
>
>                 Key: CASSANDRA-3271
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-3271
>             Project: Cassandra
>          Issue Type: Improvement
>          Components: Core
>            Reporter: Pavel Yaskevich
>            Assignee: Pavel Yaskevich
>            Priority: Minor
>             Fix For: 1.1
>
>         Attachments: CASSANDRA-3271.patch
>
>
> Instead of requiring JNA for off-heap caches we should try to use sun.misc.Unsafe.

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