You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by yulin2 <gi...@git.apache.org> on 2014/12/31 21:02:00 UTC

[GitHub] cassandra pull request: opinion on refactoring ListenableFuture to...

GitHub user yulin2 opened a pull request:

    https://github.com/apache/cassandra/pull/50

    opinion on refactoring ListenableFuture to Java 8 CompletableFuture

    I'm doing research on new concurrent constructs in Java 8. I found `CompletableFuture` in Java 8 has the same functionality as Guava `ListenableFuture`. But `CompletableFuture` is much nicer because it comes together with Lambda expression in Java 8, and it is monadic, which makes the code more readable and cleaner. Also, it provides more ways to compose different tasks. Therefore, using `CompletableFuture` instead of `ListenableFuture` is better for future extension and maintenance of the code.
    
    I tried to refactoring one Guava `ListenableFuture` to Java 8 `CompletableFuture` in Cassandra, so you can see the difference in the code. You don't have to merge this pull request. I'm just wondering your opinion on this kind of refactoring (or migrating the code from Java 7 to Java 8). Do you think the refactoring is useful? Do you have any plan to use Java 8?

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/yulin2/cassandra trunk

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/cassandra/pull/50.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #50
    
----
commit 6b68f5479fc642d8342702f195bf05f6ca044d40
Author: Yu Lin <yu...@gmail.com>
Date:   2014-12-31T19:44:03Z

    refactor one ListenableFuture to Java 8 CompletableFuture

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] cassandra pull request: opinion on refactoring ListenableFuture to...

Posted by MarkReddy <gi...@git.apache.org>.
Github user MarkReddy commented on the pull request:

    https://github.com/apache/cassandra/pull/50#issuecomment-68760981
  
    @yulin2 Pull requests are not used for Apache Cassandra. Please open a JIRA (https://issues.apache.org/jira/browse/CASSANDRA) if you have an improvement, idea or issue to share and close this request.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Java code design issue

Posted by Cheng Jie He <he...@cn.ibm.com>.
all:

In the trunk branch of cassandra code, in file of src/java/org/apache/
cassandra/service/GCInspector.java:

import com.sun.management.GarbageCollectionNotificationInfo;

This seems a specific implementation of Sun. For common use, could we make
this implementation more high level (interface level)?


Thanks,
-jack

the issues when porting Cassandra to IBM power8 machine

Posted by Cheng Jie He <he...@cn.ibm.com>.
all:

I am trying to port Cassandra to IBM's Power8 platform, which is little
endian and Ubuntu14 installed. The follow tests failed with errors below:

hcj@ubuntu-hcj:~$ ant test -Dtest.name=PreparedStatementsTest -v
error log:
 [junit] ------------- ---------------- ---------------
    [junit] Testcase: testStatementRePreparationOnReconnect
(org.apache.cassandra.cql3.PreparedStatementsTest):	Caused an ERROR
    [junit] All host(s) tried for query failed (no host was tried)
    [junit] com.datastax.driver.core.exceptions.NoHostAvailableException:
All host(s) tried for query failed (no host was tried)
    [junit] 	at
com.datastax.driver.core.exceptions.NoHostAvailableException.copy
(NoHostAvailableException.java:65)
    [junit] 	at
com.datastax.driver.core.DefaultResultSetFuture.extractCauseFromExecutionException
(DefaultResultSetFuture.java:259)
    [junit] 	at
com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly
(DefaultResultSetFuture.java:175)
    [junit] 	at com.datastax.driver.core.AbstractSession.execute
(AbstractSession.java:52)
    [junit] 	at
org.apache.cassandra.cql3.PreparedStatementsTest.testStatementRePreparationOnReconnect
(PreparedStatementsTest.java:118)
    [junit] Caused by:
com.datastax.driver.core.exceptions.NoHostAvailableException: All host(s)
tried for query failed (no host was tried)
    [junit] 	at com.datastax.driver.core.RequestHandler.sendRequest
(RequestHandler.java:102)
    [junit] 	at com.datastax.driver.core.SessionManager.execute
(SessionManager.java:461)
    [junit] 	at com.datastax.driver.core.SessionManager.executeQuery
(SessionManager.java:497)
    [junit] 	at com.datastax.driver.core.SessionManager.executeAsync
(SessionManager.java:87)
    [junit]

hcj@ubuntu-hcj:~/cassandra/cassandra-trunk$ ant test
-Dtest.name=NativeCellTest -v
error log:
[junit] WARNING: multiple versions of ant detected in path for junit
    [junit]
jar:file:/usr/share/ant/lib/ant.jar!/org/apache/tools/ant/Project.class
    [junit]      and
jar:file:/home/hcj/cassandra/cassandra-trunk/build/lib/jars/ant-1.6.5.jar!/org/apache/tools/ant/Project.class
    [junit] Testsuite: org.apache.cassandra.db.NativeCellTest
    [junit] Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed:
0.932 sec
    [junit]
    [junit] ------------- Standard Output ---------------
    [junit] WARN  11:52:26 JNA link failure, one or more native method will
be unavailable.
    [junit] WARN  11:52:26 JNA link failure, one or more native method will
be unavailable.
    [junit] ------------- ---------------- ---------------
    [junit] Testcase: testCells(org.apache.cassandra.db.NativeCellTest):
FAILED
    [junit]
    [junit] junit.framework.AssertionFailedError:
    [junit] 	at org.apache.cassandra.db.NativeCellTest.test
(NativeCellTest.java:218)
    [junit] 	at org.apache.cassandra.db.NativeCellTest.testCells
(NativeCellTest.java:122)
    [junit]

hcj@ubuntu-hcj:~/cassandra/cassandra-trunk$ ant test
-Dtest.name=SSTableMetadataTest -v
error log:
 [junit] ------------- Standard Output ---------------
    [junit] WARN  11:54:28 JNA link failure, one or more native method will
be unavailable.
    [junit] WARN  11:54:28 JNA link failure, one or more native method will
be unavailable.
    [junit] ------------- ---------------- ---------------
    [junit] Testcase: testWithDeletes
(org.apache.cassandra.io.sstable.SSTableMetadataTest):	FAILED
    [junit] expected:<-1.71136172E8> but was:<1.420545269E9>
    [junit] junit.framework.AssertionFailedError: expected:<-1.71136172E8>
but was:<1.420545269E9>
    [junit] 	at
org.apache.cassandra.io.sstable.SSTableMetadataTest.testWithDeletes
(SSTableMetadataTest.java:186)
    [junit]

Could anyone give me any hint on how to hacking these three issues? If they
are related to some native lib, which lib needs to be recompiled?

Thanks,
-jack

[GitHub] cassandra pull request: opinion on refactoring ListenableFuture to...

Posted by yulin2 <gi...@git.apache.org>.
Github user yulin2 closed the pull request at:

    https://github.com/apache/cassandra/pull/50


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---