[GitHub] cjmctague opened a new pull request #1040: Replace anonymous types with lambda

2018-06-12 Thread GitBox
cjmctague opened a new pull request #1040: Replace anonymous types with lambda
URL: https://github.com/apache/fluo/pull/1040
 
 
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] keith-turner commented on a change in pull request #1040: Replace anonymous types with lambda

2018-06-12 Thread GitBox
keith-turner commented on a change in pull request #1040: Replace anonymous 
types with lambda
URL: https://github.com/apache/fluo/pull/1040#discussion_r194846033
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/fluo/core/oracle/OracleServer.java
 ##
 @@ -299,13 +299,7 @@ private InetSocketAddress startServer() throws 
TTransportException {
 serverArgs.outputProtocolFactory(new TCompactProtocol.Factory());
 server = new THsHaServer(serverArgs);
 
-Runnable st = new Runnable() {
-
-  @Override
-  public void run() {
-server.serve();
-  }
-};
+Runnable st = () -> server.serve();
 
 Review comment:
   Could `st` be inlined?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] cjmctague commented on a change in pull request #1040: Replace anonymous types with lambda

2018-06-12 Thread GitBox
cjmctague commented on a change in pull request #1040: Replace anonymous types 
with lambda
URL: https://github.com/apache/fluo/pull/1040#discussion_r194851399
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/fluo/core/oracle/OracleServer.java
 ##
 @@ -299,13 +299,7 @@ private InetSocketAddress startServer() throws 
TTransportException {
 serverArgs.outputProtocolFactory(new TCompactProtocol.Factory());
 server = new THsHaServer(serverArgs);
 
-Runnable st = new Runnable() {
-
-  @Override
-  public void run() {
-server.serve();
-  }
-};
+Runnable st = () -> server.serve();
 
 Review comment:
   I don't see why not. 
   
   Also I left this one since the class is Deprecated. Is that the right 
approach?
   
https://github.com/apache/fluo/blob/327ab36c194a73343bcf38b8578b83647979266a/modules/cluster/src/main/java/org/apache/fluo/cluster/runner/AppRunner.java#L160-L166


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] keith-turner commented on a change in pull request #1040: Replace anonymous types with lambda

2018-06-12 Thread GitBox
keith-turner commented on a change in pull request #1040: Replace anonymous 
types with lambda
URL: https://github.com/apache/fluo/pull/1040#discussion_r194858105
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/fluo/core/oracle/OracleServer.java
 ##
 @@ -299,13 +299,7 @@ private InetSocketAddress startServer() throws 
TTransportException {
 serverArgs.outputProtocolFactory(new TCompactProtocol.Factory());
 server = new THsHaServer(serverArgs);
 
-Runnable st = new Runnable() {
-
-  @Override
-  public void run() {
-server.serve();
-  }
-};
+Runnable st = () -> server.serve();
 
 Review comment:
   Personally, I would not go looking for improvements to make in deprecated 
code.  But since you have already found it, I think its worthwhile to make the 
improvement and make the code more readable.


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services


[GitHub] ctubbsii commented on a change in pull request #1040: Replace anonymous types with lambda

2018-06-12 Thread GitBox
ctubbsii commented on a change in pull request #1040: Replace anonymous types 
with lambda
URL: https://github.com/apache/fluo/pull/1040#discussion_r194929870
 
 

 ##
 File path: 
modules/core/src/main/java/org/apache/fluo/core/oracle/OracleServer.java
 ##
 @@ -299,9 +299,7 @@ private InetSocketAddress startServer() throws 
TTransportException {
 serverArgs.outputProtocolFactory(new TCompactProtocol.Factory());
 server = new THsHaServer(serverArgs);
 
-Runnable st = () -> server.serve();
-
-serverThread = new Thread(st);
+serverThread = new Thread(() -> server.serve());
 
 Review comment:
   A shorter syntax for `() -> server.serve()` is `server::serve`


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services