[GitHub] [carbondata] kevinjmh commented on a change in pull request #3825: [CARBONDATA-3889] Cleanup code for carbondata-common module

2020-07-08 Thread GitBox


kevinjmh commented on a change in pull request #3825:
URL: https://github.com/apache/carbondata/pull/3825#discussion_r451468217



##
File path: 
common/src/main/java/org/apache/carbondata/common/logging/impl/ExtendedRollingFileAppender.java
##
@@ -203,19 +194,16 @@ public void rollOver() {
   private void cleanUpLogs(final String startName, final String folderPath) {
 if (maxBackupIndex > 0) {
   // Clean the logs files
-  Runnable r = new Runnable() {
-
-public void run() {
-  synchronized (ExtendedRollingFileAppender.class) {
-cleanupInProgress = true;
-try {
-  cleanLogs(startName, folderPath, maxBackupIndex);
-} catch (Throwable e) {
-  // ignore any error
-  LogLog.error("Cleaning logs failed", e);
-} finally {
-  cleanupInProgress = false;
-}
+  Runnable r = () -> {

Review comment:
   original one maybe more friendly to read. Unless we are targeting on 
JDK8 from now on :)





This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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




[GitHub] [carbondata] kevinjmh commented on a change in pull request #3825: [CARBONDATA-3889] Cleanup code for carbondata-common module

2020-07-08 Thread GitBox


kevinjmh commented on a change in pull request #3825:
URL: https://github.com/apache/carbondata/pull/3825#discussion_r451468217



##
File path: 
common/src/main/java/org/apache/carbondata/common/logging/impl/ExtendedRollingFileAppender.java
##
@@ -203,19 +194,16 @@ public void rollOver() {
   private void cleanUpLogs(final String startName, final String folderPath) {
 if (maxBackupIndex > 0) {
   // Clean the logs files
-  Runnable r = new Runnable() {
-
-public void run() {
-  synchronized (ExtendedRollingFileAppender.class) {
-cleanupInProgress = true;
-try {
-  cleanLogs(startName, folderPath, maxBackupIndex);
-} catch (Throwable e) {
-  // ignore any error
-  LogLog.error("Cleaning logs failed", e);
-} finally {
-  cleanupInProgress = false;
-}
+  Runnable r = () -> {

Review comment:
   original one maybe more friendly to read





This is an automated message from the Apache Git Service.
To respond to the message, please log on to 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