accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [1/3] accumulo git commit: ACCUMULO-3681 modified log statements that take format string (slf4j) from using arbitrary strings as first argument.
Date Tue, 07 Apr 2015 20:32:40 GMT
Repository: accumulo
Updated Branches:
  refs/heads/master 58aad7d5c -> c138a7f5d


http://git-wip-us.apache.org/repos/asf/accumulo/blob/26c0cae8/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
index 662ee31..0308f37 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServer.java
@@ -423,7 +423,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable
{
           try {
             importTablet.importMapFiles(tid, fileRefMap, setTime);
           } catch (IOException ioe) {
-            log.info("files " + fileMap.keySet() + " not imported to " + new KeyExtent(tke)
+ ": " + ioe.getMessage());
+            log.info("files {} not imported to {}: {}", fileMap.keySet(), new KeyExtent(tke),
ioe.getMessage());
             failures.add(tke);
           }
         }
@@ -1563,7 +1563,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable
{
             flushID = tablet.getFlushID();
           } catch (NoNodeException e) {
             // table was probably deleted
-            log.info("Asked to flush table that has no flush id " + ke + " " + e.getMessage());
+            log.info("Asked to flush table that has no flush id {} {}", ke, e.getMessage());
             return;
           }
         }
@@ -1586,7 +1586,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable
{
         try {
           tablet.flush(tablet.getFlushID());
         } catch (NoNodeException nne) {
-          log.info("Asked to flush tablet that has no flush id " + new KeyExtent(textent)
+ " " + nne.getMessage());
+          log.info("Asked to flush tablet that has no flush id {} {}", new KeyExtent(textent),
nne.getMessage());
         }
       }
     }
@@ -1681,7 +1681,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable
{
           try {
             compactionInfo = tablet.getCompactionID();
           } catch (NoNodeException e) {
-            log.info("Asked to compact table with no compaction id " + ke + " " + e.getMessage());
+            log.info("Asked to compact table with no compaction id {} {}", ke, e.getMessage());
             return;
           }
         tablet.compactAll(compactionInfo.getFirst(), compactionInfo.getSecond());
@@ -1904,10 +1904,10 @@ public class TabletServer extends AccumuloServerContext implements
Runnable {
       }
     } catch (IOException e) {
       statsKeeper.updateTime(Operation.SPLIT, 0, 0, true);
-      log.error("split failed: " + e.getMessage() + " for tablet " + tablet.getExtent(),
e);
+      log.error("split failed: {} for tablet {}", e.getMessage(), tablet.getExtent(), e);
     } catch (Exception e) {
       statsKeeper.updateTime(Operation.SPLIT, 0, 0, true);
-      log.error("Unknown error on split: " + e, e);
+      log.error("Unknown error on split: {}", e, e);
     }
   }
 
@@ -2009,9 +2009,9 @@ public class TabletServer extends AccumuloServerContext implements Runnable
{
       } catch (Throwable e) {
 
         if ((t.isClosing() || t.isClosed()) && e instanceof IllegalStateException)
{
-          log.debug("Failed to unload tablet " + extent + "... it was alread closing or closed
: " + e.getMessage());
+          log.debug("Failed to unload tablet {} ... it was alread closing or closed : {}",
extent, e.getMessage());
         } else {
-          log.error("Failed to close tablet " + extent + "... Aborting migration", e);
+          log.error("Failed to close tablet {}... Aborting migration", extent, e);
           enqueueMasterMessage(new TabletStatusMessage(TabletLoadState.UNLOAD_ERROR, extent));
         }
         return;
@@ -2183,9 +2183,12 @@ public class TabletServer extends AccumuloServerContext implements
Runnable {
         tablet = null; // release this reference
         successful = true;
       } catch (Throwable e) {
-        log.warn("exception trying to assign tablet " + extent + " " + locationToOpen, e);
-        if (e.getMessage() != null)
-          log.warn(e.getMessage());
+        log.warn("exception trying to assign tablet {} {}", extent, locationToOpen, e);
+
+        if (e.getMessage() != null) {
+          log.warn("{}", e.getMessage());
+        }
+
         String table = extent.getTableId().toString();
         ProblemReports.getInstance(TabletServer.this).report(new ProblemReport(table, TABLET_LOAD,
extent.getUUID().toString(), getClientAddressString(), e));
       } finally {
@@ -2580,7 +2583,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable
{
       log.debug("Closing filesystem");
       fs.close();
     } catch (IOException e) {
-      log.warn("Failed to close filesystem : " + e.getMessage(), e);
+      log.warn("Failed to close filesystem : {}", e.getMessage(), e);
     }
 
     gcLogger.logGCInfo(getConfiguration());
@@ -2816,7 +2819,7 @@ public class TabletServer extends AccumuloServerContext implements Runnable
{
         try {
           AccumuloVFSClassLoader.getContextManager().removeUnusedContexts(contexts);
         } catch (IOException e) {
-          log.warn(e.getMessage(), e);
+          log.warn("{}", e.getMessage(), e);
         }
       }
     };

http://git-wip-us.apache.org/repos/asf/accumulo/blob/26c0cae8/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
index 3567de8..cb8d01f 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/TabletServerResourceManager.java
@@ -409,7 +409,7 @@ public class TabletServerResourceManager {
           mma = memoryManager.getMemoryManagementActions(tabletStates);
 
         } catch (Throwable t) {
-          log.error("Memory manager failed " + t.getMessage(), t);
+          log.error("Memory manager failed {}", t.getMessage(), t);
         }
 
         try {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/26c0cae8/server/tserver/src/main/java/org/apache/accumulo/tserver/WriteTracker.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/WriteTracker.java b/server/tserver/src/main/java/org/apache/accumulo/tserver/WriteTracker.java
index d9f2114..b9b89a1 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/WriteTracker.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/WriteTracker.java
@@ -78,7 +78,7 @@ class WriteTracker {
       try {
         this.wait();
       } catch (InterruptedException e) {
-        log.error(e.getMessage(), e);
+        log.error("{}", e.getMessage(), e);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/26c0cae8/server/tserver/src/main/java/org/apache/accumulo/tserver/constraints/ConstraintChecker.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/constraints/ConstraintChecker.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/constraints/ConstraintChecker.java
index 6ef6709..605d768 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/constraints/ConstraintChecker.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/constraints/ConstraintChecker.java
@@ -102,7 +102,7 @@ public class ConstraintChecker {
 
       return currentLoader != loader;
     } catch (Exception e) {
-      log.debug("Failed to check " + e.getMessage());
+      log.debug("Failed to check {}", e.getMessage());
       return true;
     }
   }
@@ -138,7 +138,7 @@ public class ConstraintChecker {
           }
         }
       } catch (Throwable throwable) {
-        log.warn("CONSTRAINT FAILED : " + throwable.getMessage(), throwable);
+        log.warn("CONSTRAINT FAILED : {}", throwable.getMessage(), throwable);
 
         // constraint failed in some way, do not allow mutation to pass
         short vcode;

http://git-wip-us.apache.org/repos/asf/accumulo/blob/26c0cae8/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
index 1354b40..7dd819b 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/Compactor.java
@@ -234,10 +234,10 @@ public class Compactor implements Callable<CompactionStats> {
       majCStats.setFileSize(fileFactory.getFileSize(outputFile.path().toString(), ns, ns.getConf(),
acuTableConf));
       return majCStats;
     } catch (IOException e) {
-      log.error(e.getMessage(), e);
+      log.error("{}", e.getMessage(), e);
       throw e;
     } catch (RuntimeException e) {
-      log.error(e.getMessage(), e);
+      log.error("{}", e.getMessage(), e);
       throw e;
     } finally {
       Thread.currentThread().setName(oldThreadName);
@@ -258,9 +258,9 @@ public class Compactor implements Callable<CompactionStats> {
           }
         }
       } catch (IOException e) {
-        log.warn(e.getMessage(), e);
+        log.warn("{}", e.getMessage(), e);
       } catch (RuntimeException exception) {
-        log.warn(exception.getMessage(), exception);
+        log.warn("{}", exception.getMessage(), exception);
       }
     }
   }
@@ -292,7 +292,7 @@ public class Compactor implements Callable<CompactionStats> {
 
         ProblemReports.getInstance(context).report(new ProblemReport(extent.getTableId().toString(),
ProblemType.FILE_READ, mapFile.path().toString(), e));
 
-        log.warn("Some problem opening map file " + mapFile + " " + e.getMessage(), e);
+        log.warn("Some problem opening map file {} {}", mapFile, e.getMessage(), e);
         // failed to open some map file... close the ones that were opened
         for (FileSKVIterator reader : readers) {
           try {
@@ -369,7 +369,7 @@ public class Compactor implements Callable<CompactionStats> {
             try {
               mfw.close();
             } catch (IOException e) {
-              log.error(e.getMessage(), e);
+              log.error("{}", e.getMessage(), e);
             }
             fs.deleteRecursively(outputFile.path());
           } catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/accumulo/blob/26c0cae8/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactionTask.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactionTask.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactionTask.java
index 5669133..0f6a98d 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactionTask.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactionTask.java
@@ -72,7 +72,7 @@ class MinorCompactionTask implements Runnable {
           tablet.getTabletServer().minorCompactionStarted(commitSession, commitSession.getWALogSeq()
+ 1, newMapfileLocation.path().toString());
           break;
         } catch (IOException e) {
-          log.warn("Failed to write to write ahead log " + e.getMessage(), e);
+          log.warn("Failed to write to write ahead log {}", e.getMessage(), e);
         }
       }
       span.stop();

http://git-wip-us.apache.org/repos/asf/accumulo/blob/26c0cae8/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
index 9b67051..0eb7d85 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/MinorCompactor.java
@@ -105,13 +105,13 @@ public class MinorCompactor extends Compactor {
 
           return ret;
         } catch (IOException e) {
-          log.warn("MinC failed (" + e.getMessage() + ") to create " + getOutputFile() +
" retrying ...");
+          log.warn("MinC failed ({}) to create {} retrying ...", e.getMessage(),getOutputFile());
           ProblemReports.getInstance(tabletServer).report(new ProblemReport(getExtent().getTableId().toString(),
ProblemType.FILE_WRITE, getOutputFile(), e));
           reportedProblem = true;
         } catch (RuntimeException e) {
           // if this is coming from a user iterator, it is possible that the user could change
the iterator config and that the
           // minor compaction would succeed
-          log.warn("MinC failed (" + e.getMessage() + ") to create " + getOutputFile() +
" retrying ...", e);
+          log.warn("MinC failed ({}) to create {} retrying ...", e.getMessage(), getOutputFile(),
e);
           ProblemReports.getInstance(tabletServer).report(new ProblemReport(getExtent().getTableId().toString(),
ProblemType.FILE_WRITE, getOutputFile(), e));
           reportedProblem = true;
         } catch (CompactionCanceledException e) {
@@ -131,7 +131,7 @@ public class MinorCompactor extends Compactor {
             getFileSystem().deleteRecursively(new Path(getOutputFile()));
           }
         } catch (IOException e) {
-          log.warn("Failed to delete failed MinC file " + getOutputFile() + " " + e.getMessage());
+          log.warn("Failed to delete failed MinC file {} {}", getOutputFile(), e.getMessage());
         }
 
         if (isTableDeleting())

http://git-wip-us.apache.org/repos/asf/accumulo/blob/26c0cae8/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletMemory.java
----------------------------------------------------------------------
diff --git a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletMemory.java
b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletMemory.java
index 3d85871..0b39d40 100644
--- a/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletMemory.java
+++ b/server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletMemory.java
@@ -137,7 +137,7 @@ class TabletMemory implements Closeable {
       try {
         tablet.wait(50);
       } catch (InterruptedException e) {
-        log.warn(e.getMessage(), e);
+        log.warn("{}", e.getMessage(), e);
       }
     }
   }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/26c0cae8/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java
----------------------------------------------------------------------
diff --git a/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java
b/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java
index e84dd0b..3ccf592 100644
--- a/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java
+++ b/shell/src/main/java/org/apache/accumulo/shell/commands/ShellPluginConfigurationCommand.java
@@ -113,16 +113,16 @@ public abstract class ShellPluginConfigurationCommand extends Command
{
           CommandLine cl = new BasicParser().parse(o, args);
           pluginClazz = shellState.getClassLoader(cl, shellState).loadClass(ent.getValue()).asSubclass(clazz);
         } catch (ClassNotFoundException e) {
-          LoggerFactory.getLogger(ShellPluginConfigurationCommand.class).error("Class not
found" + e.getMessage());
+          LoggerFactory.getLogger(ShellPluginConfigurationCommand.class).error("Class not
found {}", e.getMessage());
           return null;
         } catch (ParseException e) {
-          LoggerFactory.getLogger(ShellPluginConfigurationCommand.class).error("Error parsing
table: " + Arrays.toString(args) + e.getMessage());
+          LoggerFactory.getLogger(ShellPluginConfigurationCommand.class).error("Error parsing
table: {} {}", Arrays.toString(args), e.getMessage());
           return null;
         } catch (TableNotFoundException e) {
-          LoggerFactory.getLogger(ShellPluginConfigurationCommand.class).error("Table not
found: " + tableName + e.getMessage());
+          LoggerFactory.getLogger(ShellPluginConfigurationCommand.class).error("Table not
found: {} {}", tableName, e.getMessage());
           return null;
         } catch (Exception e) {
-          LoggerFactory.getLogger(ShellPluginConfigurationCommand.class).error("Error: "
+ e.getMessage());
+          LoggerFactory.getLogger(ShellPluginConfigurationCommand.class).error("Error: {}",
e.getMessage());
           return null;
         }
 

http://git-wip-us.apache.org/repos/asf/accumulo/blob/26c0cae8/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java
----------------------------------------------------------------------
diff --git a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java
b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java
index a3e02a6..539f9f5 100644
--- a/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java
+++ b/start/src/main/java/org/apache/accumulo/start/classloader/vfs/AccumuloReloadingVFSClassLoader.java
@@ -88,11 +88,11 @@ public class AccumuloReloadingVFSClassLoader implements FileListener,
ReloadingC
           updateClassloader(files, cl);
           return;
         } catch (Exception e) {
-          log.error(e.getMessage(), e);
+          log.error("{}", e.getMessage(), e);
           try {
             Thread.sleep(DEFAULT_TIMEOUT);
           } catch (InterruptedException ie) {
-            log.error(e.getMessage(), ie);
+            log.error("{}", e.getMessage(), ie);
           }
         }
       }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/26c0cae8/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
index bd00f02..2b7dada 100644
--- a/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/ConditionalWriterIT.java
@@ -974,7 +974,7 @@ public class ConditionalWriterIT extends AccumuloClusterIT {
         }
 
       } catch (Exception e) {
-        log.error(e.getMessage(), e);
+        log.error("{}", e.getMessage(), e);
         failed.set(true);
       }
     }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/26c0cae8/test/src/test/java/org/apache/accumulo/test/MetaGetsReadersIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/MetaGetsReadersIT.java b/test/src/test/java/org/apache/accumulo/test/MetaGetsReadersIT.java
index ec89c5d..bcdcb29 100644
--- a/test/src/test/java/org/apache/accumulo/test/MetaGetsReadersIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/MetaGetsReadersIT.java
@@ -66,7 +66,7 @@ public class MetaGetsReadersIT extends ConfigurableMacIT {
             }
           }
         } catch (Exception ex) {
-          log.trace(ex.getMessage(), ex);
+          log.trace("{}", ex.getMessage(), ex);
           stop.set(true);
         }
       }

http://git-wip-us.apache.org/repos/asf/accumulo/blob/26c0cae8/test/src/test/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
----------------------------------------------------------------------
diff --git a/test/src/test/java/org/apache/accumulo/test/MultiTableRecoveryIT.java b/test/src/test/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
index 5f9b389..87145ef 100644
--- a/test/src/test/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
+++ b/test/src/test/java/org/apache/accumulo/test/MultiTableRecoveryIT.java
@@ -125,7 +125,7 @@ public class MultiTableRecoveryIT extends ConfigurableMacIT {
           }
           System.out.println("Restarted " + i + " times");
         } catch (Exception ex) {
-          log.error(ex.getMessage(), ex);
+          log.error("{}", ex.getMessage(), ex);
         }
       }
     };


Mime
View raw message