ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oleew...@apache.org
Subject ambari git commit: AMBARI-17528. Fix Logfeeder visibilities (Miklos Gergely via oleewere)
Date Mon, 04 Jul 2016 11:04:50 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.4 636d4c11e -> 9cbb2c974


AMBARI-17528. Fix Logfeeder visibilities (Miklos Gergely via oleewere)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/9cbb2c97
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/9cbb2c97
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/9cbb2c97

Branch: refs/heads/branch-2.4
Commit: 9cbb2c974cb17a73063d2326e9e0656144e05340
Parents: 636d4c1
Author: Miklos Gergely <mgergely@hortonworks.com>
Authored: Mon Jul 4 12:59:42 2016 +0200
Committer: oleewere <oleewere@gmail.com>
Committed: Mon Jul 4 13:04:32 2016 +0200

----------------------------------------------------------------------
 .../org/apache/ambari/logfeeder/AliasUtil.java  |   2 +-
 .../apache/ambari/logfeeder/ConfigBlock.java    |   2 +-
 .../org/apache/ambari/logfeeder/InputMgr.java   | 120 ++-----------------
 .../org/apache/ambari/logfeeder/LogFeeder.java  |  46 ++++---
 .../ambari/logfeeder/LogFeederAMSClient.java    |   4 +-
 .../apache/ambari/logfeeder/LogFeederUtil.java  |  30 ++---
 .../org/apache/ambari/logfeeder/MetricsMgr.java |  20 ++--
 .../org/apache/ambari/logfeeder/OutputMgr.java  |  10 +-
 .../apache/ambari/logfeeder/filter/Filter.java  |  14 +--
 .../ambari/logfeeder/filter/FilterGrok.java     |  30 ++---
 .../ambari/logfeeder/filter/FilterKeyValue.java |  10 +-
 .../apache/ambari/logfeeder/input/Input.java    |  26 ++--
 .../ambari/logfeeder/input/InputFile.java       |  26 ++--
 .../ambari/logfeeder/input/InputS3File.java     |  26 ++--
 .../logfeeder/input/reader/GZIPReader.java      |   8 +-
 .../logconfig/FetchConfigFromSolr.java          |   8 +-
 .../logconfig/filter/ApplyLogFilter.java        |   2 +-
 .../logconfig/filter/DefaultDataFilter.java     |   8 +-
 .../apache/ambari/logfeeder/mapper/Mapper.java  |   6 +-
 .../ambari/logfeeder/mapper/MapperDate.java     |   8 +-
 .../logfeeder/mapper/MapperFieldName.java       |   5 +-
 .../logfeeder/mapper/MapperFieldValue.java      |   6 +-
 .../apache/ambari/logfeeder/output/Output.java  |   6 +-
 .../apache/ambari/logfeeder/util/SolrUtil.java  |  27 ++---
 24 files changed, 163 insertions(+), 287 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/AliasUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/AliasUtil.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/AliasUtil.java
index c3b36df..44bc829 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/AliasUtil.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/AliasUtil.java
@@ -82,7 +82,7 @@ public class AliasUtil {
   }
 
   @SuppressWarnings("unchecked")
-  public HashMap<String, String> getAliasInfo(String key, ALIAS_TYPE aliastype) {
+  private HashMap<String, String> getAliasInfo(String key, ALIAS_TYPE aliastype) {
     HashMap<String, String> aliasInfo = null;
     if (aliasMap != null) {
       String typeKey = aliastype.name().toLowerCase();

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/ConfigBlock.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/ConfigBlock.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/ConfigBlock.java
index 19bb191..c3ccc47 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/ConfigBlock.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/ConfigBlock.java
@@ -30,7 +30,7 @@ import org.apache.log4j.Priority;
 public abstract class ConfigBlock {
   static private Logger logger = Logger.getLogger(ConfigBlock.class);
 
-  boolean drain = false;
+  private boolean drain = false;
 
   protected Map<String, Object> configs;
   protected Map<String, String> contextFields = new HashMap<String, String>();

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/InputMgr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/InputMgr.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/InputMgr.java
index d83642e..fa60702 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/InputMgr.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/InputMgr.java
@@ -24,14 +24,7 @@ import java.io.File;
 import java.io.FileFilter;
 import java.io.IOException;
 import java.io.RandomAccessFile;
-import java.nio.file.FileSystems;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.nio.file.WatchEvent;
-import java.nio.file.WatchKey;
-import java.nio.file.WatchService;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
@@ -39,8 +32,6 @@ import java.util.Map;
 import java.util.Set;
 import java.util.UUID;
 
-import static java.nio.file.StandardWatchEventKinds.*;
-
 import org.apache.ambari.logfeeder.input.Input;
 import org.apache.ambari.logfeeder.input.InputFile;
 import org.apache.commons.io.filefilter.WildcardFileFilter;
@@ -48,21 +39,18 @@ import org.apache.log4j.Logger;
 import org.apache.solr.common.util.Base64;
 
 public class InputMgr {
-  static Logger logger = Logger.getLogger(InputMgr.class);
+  private static final Logger logger = Logger.getLogger(InputMgr.class);
 
-  List<Input> inputList = new ArrayList<Input>();
-  Set<Input> notReadyList = new HashSet<Input>();
+  private List<Input> inputList = new ArrayList<Input>();
+  private Set<Input> notReadyList = new HashSet<Input>();
 
-  WatchService folderWatcher = null;
-  Set<File> foldersToMonitor = new HashSet<File>();
-  Map<String, Input> filesToMonitor = new HashMap<String, Input>();
-  boolean isDrain = false;
-  boolean isAnyInputTail = false;
+  private boolean isDrain = false;
+  private boolean isAnyInputTail = false;
 
   private String checkPointSubFolderName = "logfeeder_checkpoints";
-  File checkPointFolderFile = null;
+  private File checkPointFolderFile = null;
 
-  MetricCount filesCountMetric = new MetricCount();
+  private MetricCount filesCountMetric = new MetricCount();
 
   private String checkPointExtension = ".cp";
   
@@ -172,7 +160,7 @@ public class InputMgr {
     return checkPointFolderFile;
   }
 
-  boolean verifyCheckPointFolder(File folderPathFile) {
+  private boolean verifyCheckPointFolder(File folderPathFile) {
     if (!folderPathFile.exists()) {
       // Create the folder
       try {
@@ -434,98 +422,6 @@ public class InputMgr {
     }
   }
 
-  synchronized public void monitorSystemFileChanges(Input inputToMonitor) {
-    try {
-      File fileToMonitor = new File(inputToMonitor.getFilePath());
-      if (filesToMonitor.containsKey(fileToMonitor.getAbsolutePath())) {
-        logger.info("Already monitoring file " + fileToMonitor
-          + ". So ignoring this request");
-        return;
-      }
-
-      // make a new watch service that we can register interest in
-      // directories and files with.
-      if (folderWatcher == null) {
-        folderWatcher = FileSystems.getDefault().newWatchService();
-        // start the file watcher thread below
-        Thread th = new Thread(new FileSystemMonitor(),
-          "FileSystemWatcher");
-        th.setDaemon(true);
-        th.start();
-
-      }
-      File folderToWatch = fileToMonitor.getParentFile();
-      if (folderToWatch != null) {
-        if (foldersToMonitor.contains(folderToWatch.getAbsolutePath())) {
-          logger.info("Already monitoring folder " + folderToWatch
-            + ". So ignoring this request.");
-        } else {
-          logger.info("Configuring to monitor folder "
-            + folderToWatch + " for file " + fileToMonitor);
-          // get the directory we want to watch, using the Paths singleton class
-          Path toWatch = Paths.get(folderToWatch.getAbsolutePath());
-          if (toWatch == null) {
-            throw new UnsupportedOperationException(
-              "Directory not found. folder=" + folderToWatch);
-          }
-
-          toWatch.register(folderWatcher, ENTRY_CREATE);
-          foldersToMonitor.add(folderToWatch);
-        }
-        filesToMonitor.put(fileToMonitor.getAbsolutePath(),
-          inputToMonitor);
-      } else {
-        logger.error("File doesn't have parent folder." + fileToMonitor);
-      }
-    } catch (IOException e) {
-      logger.error("Error while trying to set watcher for file:"
-        + inputToMonitor);
-    }
-
-  }
-
-  class FileSystemMonitor implements Runnable {
-    @Override
-    public void run() {
-      try {
-        // get the first event before looping
-        WatchKey key = folderWatcher.take();
-        while (key != null) {
-          Path dir = (Path) key.watchable();
-          // we have a polled event, now we traverse it and
-          // receive all the states from it
-          for (WatchEvent<?> event : key.pollEvents()) {
-            if (!event.kind().equals(ENTRY_CREATE)) {
-              logger.info("Ignoring event.kind=" + event.kind());
-              continue;
-            }
-            logger.info("Received " + event.kind()
-              + " event for file " + event.context());
-
-            File newFile = new File(dir.toFile(), event.context()
-              .toString());
-            Input rolledOverInput = filesToMonitor.get(newFile
-              .getAbsolutePath());
-            if (rolledOverInput == null) {
-              logger.info("Input not found for file " + newFile);
-            } else {
-              rolledOverInput.rollOver();
-            }
-          }
-          if (!key.reset()) {
-            logger.error("Error while key.reset(). Will have to abort watching files. Rollover will not work.");
-            break;
-          }
-          key = folderWatcher.take();
-        }
-      } catch (InterruptedException e) {
-        logger.info("Stop request for thread");
-      }
-      logger.info("Exiting FileSystemMonitor thread.");
-    }
-
-  }
-
   public void waitOnAllInputs() {
     //wait on inputs
     if (inputList != null) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
index b0c43bb..88a6737 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeeder.java
@@ -50,36 +50,36 @@ import org.apache.log4j.Logger;
 import com.google.gson.reflect.TypeToken;
 
 public class LogFeeder {
-  static Logger logger = Logger.getLogger(LogFeeder.class);
+  private static final Logger logger = Logger.getLogger(LogFeeder.class);
 
-  Collection<Output> outputList = new ArrayList<Output>();
-  
   private static final int LOGFEEDER_SHUTDOWN_HOOK_PRIORITY = 30;
 
-  OutputMgr outMgr = new OutputMgr();
-  InputMgr inputMgr = new InputMgr();
-  MetricsMgr metricsMgr = new MetricsMgr();
+  private Collection<Output> outputList = new ArrayList<Output>();
+
+  private OutputMgr outMgr = new OutputMgr();
+  private InputMgr inputMgr = new InputMgr();
+  private MetricsMgr metricsMgr = new MetricsMgr();
 
   public static Map<String, Object> globalMap = null;
-  String[] inputParams;
+  private String[] inputParams;
 
-  List<Map<String, Object>> globalConfigList = new ArrayList<Map<String, Object>>();
-  List<Map<String, Object>> inputConfigList = new ArrayList<Map<String, Object>>();
-  List<Map<String, Object>> filterConfigList = new ArrayList<Map<String, Object>>();
-  List<Map<String, Object>> outputConfigList = new ArrayList<Map<String, Object>>();
+  private List<Map<String, Object>> globalConfigList = new ArrayList<Map<String, Object>>();
+  private List<Map<String, Object>> inputConfigList = new ArrayList<Map<String, Object>>();
+  private List<Map<String, Object>> filterConfigList = new ArrayList<Map<String, Object>>();
+  private List<Map<String, Object>> outputConfigList = new ArrayList<Map<String, Object>>();
   
-  int checkPointCleanIntervalMS = 24 * 60 * 60 * 60 * 1000; // 24 hours
-  long lastCheckPointCleanedMS = 0;
+  private int checkPointCleanIntervalMS = 24 * 60 * 60 * 60 * 1000; // 24 hours
+  private long lastCheckPointCleanedMS = 0;
   
   private static boolean isLogfeederCompleted = false;
   
   private Thread statLoggerThread = null;
 
-  public LogFeeder(String[] args) {
+  private LogFeeder(String[] args) {
     inputParams = args;
   }
 
-  public void init() throws Throwable {
+  private void init() throws Throwable {
 
     LogFeederUtil.loadProperties("logfeeder.properties", inputParams);
 
@@ -131,7 +131,7 @@ public class LogFeeder {
     logger.debug("==============");
   }
 
-  void loadConfigsUsingClassLoader(String configFileName) throws Exception {
+  private void loadConfigsUsingClassLoader(String configFileName) throws Exception {
     BufferedInputStream fileInputStream = (BufferedInputStream) this
       .getClass().getClassLoader()
       .getResourceAsStream(configFileName);
@@ -148,7 +148,7 @@ public class LogFeeder {
   /**
    * This method loads the configurations from the given file.
    */
-  void loadConfigsUsingFile(File configFile) throws Exception {
+  private void loadConfigsUsingFile(File configFile) throws Exception {
     FileInputStream fileInputStream = null;
     try {
       fileInputStream = new FileInputStream(configFile);
@@ -172,7 +172,7 @@ public class LogFeeder {
   }
 
   @SuppressWarnings("unchecked")
-  void loadConfigs(String configData) throws Exception {
+  private void loadConfigs(String configData) throws Exception {
     Type type = new TypeToken<Map<String, Object>>() {
     }.getType();
     Map<String, Object> configMap = LogFeederUtil.getGson().fromJson(
@@ -503,7 +503,7 @@ public class LogFeeder {
     }
   }
 
-  public String readFile(BufferedReader br) throws Exception {
+  private String readFile(BufferedReader br) throws Exception {
     try {
       StringBuilder sb = new StringBuilder();
       String line = br.readLine();
@@ -531,12 +531,6 @@ public class LogFeeder {
     logFeeder.run();
   }
 
-
-  public static void run(String[] args) {
-    LogFeeder logFeeder = new LogFeeder(args);
-    logFeeder.run();
-  }
-
   public void run() {
     try {
       Date startTime = new Date();
@@ -572,7 +566,7 @@ public class LogFeeder {
     }
   }
   
-  public void waitOnAllDaemonThreads() {
+  private void waitOnAllDaemonThreads() {
     String foreground = LogFeederUtil.getStringProperty("foreground");
     if (foreground != null && foreground.equalsIgnoreCase("true")) {
       inputMgr.waitOnAllInputs();

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederAMSClient.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederAMSClient.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederAMSClient.java
index 7278812..53498ff 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederAMSClient.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederAMSClient.java
@@ -24,9 +24,9 @@ import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics;
 import org.apache.log4j.Logger;
 
 public class LogFeederAMSClient extends AbstractTimelineMetricsSink {
-  static Logger logger = Logger.getLogger(LogFeederAMSClient.class);
+  private static final Logger logger = Logger.getLogger(LogFeederAMSClient.class);
 
-  String collectorHosts = null;
+  private String collectorHosts = null;
 
   public LogFeederAMSClient() {
     collectorHosts = LogFeederUtil

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederUtil.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederUtil.java
index 78d0499..15dd5c9 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederUtil.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/LogFeederUtil.java
@@ -60,14 +60,14 @@ import com.google.gson.reflect.TypeToken;
  * This class contains utility methods used by LogFeeder
  */
 public class LogFeederUtil {
-  static Logger logger = Logger.getLogger(LogFeederUtil.class);
+  private static final Logger logger = Logger.getLogger(LogFeederUtil.class);
 
-  final static int HASH_SEED = 31174077;
+  private static final int HASH_SEED = 31174077;
   public final static String DATE_FORMAT = "yyyy-MM-dd HH:mm:ss.SSS";
   public final static String SOLR_DATE_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'";
-  static Gson gson = new GsonBuilder().setDateFormat(DATE_FORMAT).create();
+  private static Gson gson = new GsonBuilder().setDateFormat(DATE_FORMAT).create();
 
-  static Properties props;
+  private static Properties props;
 
   private static Map<String, LogHistory> logHistoryList = new Hashtable<String, LogHistory>();
   private static int logInterval = 30000; // 30 seconds
@@ -75,9 +75,9 @@ public class LogFeederUtil {
   public static String hostName = null;
   public static String ipAddress = null;
   
-  public static String logfeederTempDir = null;
+  private static String logfeederTempDir = null;
   
-  public static final Object _LOCK = new Object();
+  private static final Object _LOCK = new Object();
   
   static{
     setHostNameAndIP();
@@ -91,7 +91,7 @@ public class LogFeederUtil {
    * This method will read the properties from System, followed by propFile
    * and finally from the map
    */
-  static public void loadProperties(String propFile, String[] propNVList)
+  public static void loadProperties(String propFile, String[] propNVList)
     throws Exception {
     logger.info("Loading properties. propFile=" + propFile);
     props = new Properties(System.getProperties());
@@ -232,7 +232,7 @@ public class LogFeederUtil {
     return retValue;
   }
 
-  static public boolean isEnabled(Map<String, Object> conditionConfigs,
+  public static boolean isEnabled(Map<String, Object> conditionConfigs,
                                   Map<String, Object> valueConfigs) {
     boolean allow = toBoolean((String) valueConfigs.get("is_enabled"), true);
     @SuppressWarnings("unchecked")
@@ -274,7 +274,7 @@ public class LogFeederUtil {
     return allow;
   }
 
-  static public boolean isFieldConditionMatch(Map<String, Object> configs,
+  public static boolean isFieldConditionMatch(Map<String, Object> configs,
                                               String fieldName, String stringValue) {
     boolean allow = false;
     String fieldValue = (String) configs.get(fieldName);
@@ -295,7 +295,7 @@ public class LogFeederUtil {
     return allow;
   }
 
-  static public void logStatForMetric(MetricCount metric, String prefixStr,
+  public static void logStatForMetric(MetricCount metric, String prefixStr,
                                       String postFix) {
     long currStat = metric.count;
     long currMS = System.currentTimeMillis();
@@ -368,16 +368,16 @@ public class LogFeederUtil {
     return str.substring(0, maxLength);
   }
 
-  static public long genHash(String value) {
+  public static long genHash(String value) {
     if (value == null) {
       value = "null";
     }
     return MurmurHash.hash64A(value.getBytes(), HASH_SEED);
   }
 
-  static class LogHistory {
-    long lastLogTime = 0;
-    int counter = 0;
+  private static class LogHistory {
+    private long lastLogTime = 0;
+    private int counter = 0;
   }
 
   public static String getDate(String timeStampStr) {
@@ -477,7 +477,7 @@ public class LogFeederUtil {
   }
   
   
-  public static synchronized String setHostNameAndIP() {
+  private static synchronized String setHostNameAndIP() {
     if (hostName == null || ipAddress == null) {
       try {
         InetAddress ip = InetAddress.getLocalHost();

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MetricsMgr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MetricsMgr.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MetricsMgr.java
index 12ed3cd..8b2648a 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MetricsMgr.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/MetricsMgr.java
@@ -30,20 +30,20 @@ import org.apache.hadoop.metrics2.sink.timeline.TimelineMetrics;
 import org.apache.log4j.Logger;
 
 public class MetricsMgr {
-  static Logger logger = Logger.getLogger(MetricsMgr.class);
+  private static final Logger logger = Logger.getLogger(MetricsMgr.class);
 
-  boolean isMetricsEnabled = false;
-  String nodeHostName = null;
-  String appId = "logfeeder";
+  private boolean isMetricsEnabled = false;
+  private String nodeHostName = null;
+  private String appId = "logfeeder";
 
-  long lastPublishTimeMS = 0; // Let's do the first publish immediately
-  long lastFailedPublishTimeMS = System.currentTimeMillis(); // Reset the clock
+  private long lastPublishTimeMS = 0; // Let's do the first publish immediately
+  private long lastFailedPublishTimeMS = System.currentTimeMillis(); // Reset the clock
 
-  int publishIntervalMS = 60 * 1000;
-  int maxMetricsBuffer = 60 * 60 * 1000; // If AMS is down, we should not keep
+  private int publishIntervalMS = 60 * 1000;
+  private int maxMetricsBuffer = 60 * 60 * 1000; // If AMS is down, we should not keep
   // the metrics in memory forever
-  HashMap<String, TimelineMetric> metricsMap = new HashMap<String, TimelineMetric>();
-  LogFeederAMSClient amsClient = null;
+  private HashMap<String, TimelineMetric> metricsMap = new HashMap<String, TimelineMetric>();
+  private LogFeederAMSClient amsClient = null;
 
   public void init() {
     logger.info("Initializing MetricsMgr()");

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/OutputMgr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/OutputMgr.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/OutputMgr.java
index f6d3481..c65b352 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/OutputMgr.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/OutputMgr.java
@@ -35,15 +35,15 @@ import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 
 public class OutputMgr {
-  static Logger logger = Logger.getLogger(OutputMgr.class);
+  private static final Logger logger = Logger.getLogger(OutputMgr.class);
 
-  Collection<Output> outputList = new ArrayList<Output>();
+  private Collection<Output> outputList = new ArrayList<Output>();
 
-  boolean addMessageMD5 = true;
+  private boolean addMessageMD5 = true;
 
   private int MAX_OUTPUT_SIZE = 32765; // 32766-1
-  static long doc_counter = 0;
-  public MetricCount messageTruncateMetric = new MetricCount();
+  private static long doc_counter = 0;
+  private MetricCount messageTruncateMetric = new MetricCount();
 
   
   public Collection<Output> getOutputList() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java
index d34eed6..ca75ea5 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/Filter.java
@@ -38,13 +38,13 @@ import org.apache.log4j.Logger;
 import org.apache.log4j.Priority;
 
 public abstract class Filter extends ConfigBlock {
-  static private Logger logger = Logger.getLogger(Filter.class);
+  private static final Logger logger = Logger.getLogger(Filter.class);
 
-  OutputMgr outputMgr;
-  Input input;
-  Filter nextFilter = null;
+  protected Input input;
+  private Filter nextFilter = null;
+  private OutputMgr outputMgr;
 
-  Map<String, List<Mapper>> postFieldValueMappers = new HashMap<String, List<Mapper>>();
+  private Map<String, List<Mapper>> postFieldValueMappers = new HashMap<String, List<Mapper>>();
 
   @Override
   public void init() throws Exception {
@@ -57,7 +57,7 @@ public abstract class Filter extends ConfigBlock {
   }
 
   @SuppressWarnings("unchecked")
-  protected void initializePostMapValues() {
+  private void initializePostMapValues() {
     Map<String, Object> postMapValues = (Map<String, Object>) getConfigValue("post_map_values");
     if (postMapValues == null) {
       return;
@@ -93,7 +93,7 @@ public abstract class Filter extends ConfigBlock {
     }
   }
 
-  protected Mapper getMapper(String mapClassCode) {
+  private Mapper getMapper(String mapClassCode) {
     String classFullName = AliasUtil.getInstance().readAlias(mapClassCode, ALIAS_TYPE.MAPPER, ALIAS_PARAM.KLASS);
     if (classFullName != null && !classFullName.isEmpty()) {
       Mapper mapper = (Mapper) LogFeederUtil.getClassInstance(classFullName, ALIAS_TYPE.MAPPER);

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterGrok.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterGrok.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterGrok.java
index 31e1cd1..fb46169 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterGrok.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterGrok.java
@@ -48,28 +48,26 @@ public class FilterGrok extends Filter {
 
   private static final String GROK_PATTERN_FILE = "grok-patterns";
 
-  String messagePattern = null;
-  String multilinePattern = null;
+  private String messagePattern = null;
+  private String multilinePattern = null;
 
-  Grok grokMultiline = null;
-  Grok grokMessage = null;
+  private Grok grokMultiline = null;
+  private Grok grokMessage = null;
 
-  StringBuilder strBuff = null;
-  String currMultilineJsonStr = null;
+  private StringBuilder strBuff = null;
+  private String currMultilineJsonStr = null;
 
-  InputMarker firstInputMarker = null;
-  InputMarker savedInputMarker = null;
+  private InputMarker savedInputMarker = null;
 
-  String sourceField = null;
-  boolean removeSourceField = true;
+  private String sourceField = null;
+  private boolean removeSourceField = true;
 
-  Set<String> namedParamList = new HashSet<String>();
-  Set<String> multiLineamedParamList = new HashSet<String>();
+  private Set<String> namedParamList = new HashSet<String>();
+  private Set<String> multiLineamedParamList = new HashSet<String>();
 
-  Type jsonType = new TypeToken<Map<String, String>>() {
-  }.getType();
+  private Type jsonType = new TypeToken<Map<String, String>>() {}.getType();
 
-  public MetricCount grokErrorMetric = new MetricCount();
+  private MetricCount grokErrorMetric = new MetricCount();
 
   @Override
   public void init() throws Exception {
@@ -185,7 +183,6 @@ public class FilterGrok extends Filter {
           } finally {
             strBuff = null;
             savedInputMarker = null;
-            firstInputMarker = null;
           }
         }
         currMultilineJsonStr = jsonStr;
@@ -193,7 +190,6 @@ public class FilterGrok extends Filter {
 
       if (strBuff == null) {
         strBuff = new StringBuilder();
-        firstInputMarker = inputMarker;
       } else {
         strBuff.append('\r');
         strBuff.append('\n');

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java
index 7b1e5e0..b48ac2f 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/filter/FilterKeyValue.java
@@ -31,13 +31,13 @@ import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 
 public class FilterKeyValue extends Filter {
-  static private Logger logger = Logger.getLogger(FilterKeyValue.class);
+  private static final Logger logger = Logger.getLogger(FilterKeyValue.class);
 
-  String sourceField = null;
-  String valueSplit = "=";
-  String fieldSplit = "\t";
+  private String sourceField = null;
+  private String valueSplit = "=";
+  private String fieldSplit = "\t";
 
-  public MetricCount errorMetric = new MetricCount();
+  private MetricCount errorMetric = new MetricCount();
 
   @Override
   public void init() throws Exception {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/Input.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/Input.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/Input.java
index 2e38255..f089af9 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/Input.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/Input.java
@@ -37,22 +37,22 @@ import org.apache.log4j.Logger;
 public abstract class Input extends ConfigBlock implements Runnable {
   static private Logger logger = Logger.getLogger(Input.class);
 
-  OutputMgr outputMgr;
-  InputMgr inputMgr;
+  protected OutputMgr outputMgr;
+  protected InputMgr inputMgr;
 
-  List<Output> outputList = new ArrayList<Output>();
+  private List<Output> outputList = new ArrayList<Output>();
 
-  Filter firstFilter = null;
-  Thread thread;
+  private Filter firstFilter = null;
+  private Thread thread;
   private boolean isClosed = false;
-  String filePath = null;
-  String type = null;
+  protected String filePath = null;
+  private String type = null;
 
-  boolean tail = true;
-  boolean useEventMD5 = false;
-  boolean genEventMD5 = true;
+  protected boolean tail = true;
+  private boolean useEventMD5 = false;
+  private boolean genEventMD5 = true;
 
-  public MetricCount readBytesMetric = new MetricCount();
+  protected MetricCount readBytesMetric = new MetricCount();
 
   /**
    * This method will be called from the thread spawned for the output. This
@@ -97,7 +97,7 @@ public abstract class Input extends ConfigBlock implements Runnable {
     logger.info("Exiting thread. " + getShortDescription());
   }
 
-  public void outputLine(String line, InputMarker marker) {
+  protected void outputLine(String line, InputMarker marker) {
     statMetric.count++;
     readBytesMetric.count += (line.length());
 
@@ -110,7 +110,7 @@ public abstract class Input extends ConfigBlock implements Runnable {
     }
   }
 
-  public void flush() {
+  protected void flush() {
     if (firstFilter != null) {
       firstFilter.flush();
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java
index 3538ba0..9d3545e 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputFile.java
@@ -42,25 +42,25 @@ import org.apache.log4j.Logger;
 import org.apache.solr.common.util.Base64;
 
 public class InputFile extends Input {
-  static private Logger logger = Logger.getLogger(InputFile.class);
+  private static final Logger logger = Logger.getLogger(InputFile.class);
 
-  String logPath = null;
-  boolean isStartFromBegining = true;
+  private String logPath = null;
+  private boolean isStartFromBegining = true;
 
-  boolean isReady = false;
-  File[] logPathFiles = null;
-  Object fileKey = null;
-  String base64FileKey = null;
+  private boolean isReady = false;
+  private File[] logPathFiles = null;
+  private Object fileKey = null;
+  private String base64FileKey = null;
 
   private boolean isRolledOver = false;
-  boolean addWildCard = false;
+  private boolean addWildCard = false;
 
-  long lastCheckPointTimeMS = 0;
-  int checkPointIntervalMS = 5 * 1000; // 5 seconds
-  RandomAccessFile checkPointWriter = null;
-  Map<String, Object> jsonCheckPoint = null;
+  private long lastCheckPointTimeMS = 0;
+  private int checkPointIntervalMS = 5 * 1000; // 5 seconds
+  private RandomAccessFile checkPointWriter = null;
+  private Map<String, Object> jsonCheckPoint = null;
 
-  File checkPointFile = null;
+  private File checkPointFile = null;
 
   private InputMarker lastCheckPointInputMarker = null;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputS3File.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputS3File.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputS3File.java
index 9d5f970..12a512f 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputS3File.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/InputS3File.java
@@ -36,25 +36,25 @@ import org.apache.log4j.Logger;
 import org.apache.solr.common.util.Base64;
 
 public class InputS3File extends Input {
-  static private Logger logger = Logger.getLogger(InputS3File.class);
+  private static final Logger logger = Logger.getLogger(InputS3File.class);
 
-  String logPath = null;
-  boolean isStartFromBegining = true;
+  private String logPath = null;
+  private boolean isStartFromBegining = true;
 
-  boolean isReady = false;
-  String[] s3LogPathFiles = null;
-  Object fileKey = null;
-  String base64FileKey = null;
+  private boolean isReady = false;
+  private String[] s3LogPathFiles = null;
+  private Object fileKey = null;
+  private String base64FileKey = null;
 
   private boolean isRolledOver = false;
-  boolean addWildCard = false;
+  private boolean addWildCard = false;
 
-  long lastCheckPointTimeMS = 0;
-  int checkPointIntervalMS = 5 * 1000; // 5 seconds
-  RandomAccessFile checkPointWriter = null;
-  Map<String, Object> jsonCheckPoint = null;
+  private long lastCheckPointTimeMS = 0;
+  private int checkPointIntervalMS = 5 * 1000; // 5 seconds
+  private RandomAccessFile checkPointWriter = null;
+  private Map<String, Object> jsonCheckPoint = null;
 
-  File checkPointFile = null;
+  private File checkPointFile = null;
 
   private InputMarker lastCheckPointInputMarker = null;
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/reader/GZIPReader.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/reader/GZIPReader.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/reader/GZIPReader.java
index 7c455f6..a2a9db2 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/reader/GZIPReader.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/input/reader/GZIPReader.java
@@ -28,16 +28,16 @@ import java.util.zip.GZIPInputStream;
 
 import org.apache.log4j.Logger;
 
-public class GZIPReader extends InputStreamReader {
+class GZIPReader extends InputStreamReader {
 
   private static Logger logger = Logger.getLogger(GZIPReader.class);
 
-  public GZIPReader(String fileName) throws FileNotFoundException {
+  GZIPReader(String fileName) throws FileNotFoundException {
     super(getStream(fileName));
     logger.info("Created GZIPReader for file : " + fileName);
   }
 
-  public GZIPReader(File file) throws FileNotFoundException {
+  GZIPReader(File file) throws FileNotFoundException {
     super(getStream(file.getName()));
   }
 
@@ -56,7 +56,7 @@ public class GZIPReader extends InputStreamReader {
   /**
    * validating file based on magic number
    */
-  public static boolean isValidFile(String fileName) {
+  static boolean isValidFile(String fileName) {
     // TODO make it generic and put in factory itself
     InputStream is = null;
     try {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java
index 4833d3f..872460b 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/FetchConfigFromSolr.java
@@ -40,7 +40,7 @@ public class FetchConfigFromSolr extends Thread {
   private static String endTimeDateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSS";//2016-04-05T04:30:00.000Z
   private static String sysTimeZone = "GMT";
 
-  public FetchConfigFromSolr(boolean isDaemon) {
+  FetchConfigFromSolr(boolean isDaemon) {
     this.setName(this.getClass().getSimpleName());
     this.setDaemon(isDaemon);
   }
@@ -81,7 +81,7 @@ public class FetchConfigFromSolr extends Thread {
     }
   }
 
-  public static boolean isFilterExpired(VLogfeederFilter logfeederFilter) {
+  private static boolean isFilterExpired(VLogfeederFilter logfeederFilter) {
     boolean isFilterExpired = false;// default is false
     if (logfeederFilter != null) {
       Date filterEndDate = parseFilterExpireDate(logfeederFilter);
@@ -98,7 +98,7 @@ public class FetchConfigFromSolr extends Thread {
     return isFilterExpired;
   }
 
-  public static String dateToStr(Date date) {
+  private static String dateToStr(Date date) {
     if (date == null) {
       return "";
     }
@@ -108,7 +108,7 @@ public class FetchConfigFromSolr extends Thread {
     return formatter.format(date);
   }
 
-  public static Date parseFilterExpireDate(VLogfeederFilter vLogfeederFilter) {
+  private static Date parseFilterExpireDate(VLogfeederFilter vLogfeederFilter) {
     String expiryTime = vLogfeederFilter.getExpiryTime();
     if (expiryTime != null && !expiryTime.isEmpty()) {
       SimpleDateFormat formatter = new SimpleDateFormat(endTimeDateFormat);

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/ApplyLogFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/ApplyLogFilter.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/ApplyLogFilter.java
index c71d4b9..8691a19 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/ApplyLogFilter.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/ApplyLogFilter.java
@@ -28,7 +28,7 @@ import org.apache.ambari.logfeeder.logconfig.LogFeederConstants;
 import org.apache.ambari.logfeeder.view.VLogfeederFilter;
 import org.apache.log4j.Logger;
 
-public class ApplyLogFilter extends DefaultDataFilter {
+class ApplyLogFilter extends DefaultDataFilter {
 
   private static Logger logger = Logger.getLogger(ApplyLogFilter.class);
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/DefaultDataFilter.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/DefaultDataFilter.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/DefaultDataFilter.java
index e67512b..04d2ca4 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/DefaultDataFilter.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/logconfig/filter/DefaultDataFilter.java
@@ -23,26 +23,26 @@ import java.util.Map;
 /**
  * Default filter to allow everything
  */
-public class DefaultDataFilter {
+class DefaultDataFilter {
   public boolean applyFilter(Map<String, Object> outputJsonObj, boolean defaultValue) {
     return defaultValue;
   }
 
-  public boolean isEmpty(Map<String, Object> map) {
+  protected boolean isEmpty(Map<String, Object> map) {
     if (map == null || map.isEmpty()) {
       return true;
     }
     return false;
   }
 
-  public boolean isEmpty(String str) {
+  protected boolean isEmpty(String str) {
     if (str == null || str.trim().isEmpty()) {
       return true;
     }
     return false;
   }
 
-  public boolean isNotEmpty(String str) {
+  protected boolean isNotEmpty(String str) {
     return !isEmpty(str);
   }
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/Mapper.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/Mapper.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/Mapper.java
index b87ce50..906dd25 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/Mapper.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/Mapper.java
@@ -22,9 +22,9 @@ package org.apache.ambari.logfeeder.mapper;
 import java.util.Map;
 
 public abstract class Mapper {
-  String inputDesc;
-  String fieldName;
-  String mapClassCode;
+  private String inputDesc;
+  protected String fieldName;
+  private String mapClassCode;
 
   public boolean init(String inputDesc, String fieldName,
                       String mapClassCode, Object mapConfigs) {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java
index f293ede..45ccc70 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperDate.java
@@ -29,11 +29,11 @@ import org.apache.log4j.Level;
 import org.apache.log4j.Logger;
 
 public class MapperDate extends Mapper {
-  Logger logger = Logger.getLogger(MapperDate.class);
+  private static final Logger logger = Logger.getLogger(MapperDate.class);
 
-  String dateFormat = null;
-  SimpleDateFormat dateFormatter = null;
-  boolean isEpoch = false;
+  private String dateFormat = null;
+  private SimpleDateFormat dateFormatter = null;
+  private boolean isEpoch = false;
 
   @Override
   public boolean init(String inputDesc, String fieldName,

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldName.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldName.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldName.java
index afbb126..e1f8f97 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldName.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldName.java
@@ -30,8 +30,9 @@ import org.apache.log4j.Logger;
  * Overrides the value for the field
  */
 public class MapperFieldName extends Mapper {
-  Logger logger = Logger.getLogger(MapperFieldName.class);
-  String newValue = null;
+  private static final Logger logger = Logger.getLogger(MapperFieldName.class);
+
+  private String newValue = null;
 
   @Override
   public boolean init(String inputDesc, String fieldName,

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldValue.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldValue.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldValue.java
index 00a69df..7e530f5 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldValue.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/mapper/MapperFieldValue.java
@@ -30,9 +30,9 @@ import org.apache.log4j.Logger;
  * Overrides the value for the field
  */
 public class MapperFieldValue extends Mapper {
-  Logger logger = Logger.getLogger(MapperFieldValue.class);
-  String prevValue = null;
-  String newValue = null;
+  private Logger logger = Logger.getLogger(MapperFieldValue.class);
+  private String prevValue = null;
+  private String newValue = null;
 
   @Override
   public boolean init(String inputDesc, String fieldName,

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/Output.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/Output.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/Output.java
index 0624c59..a4e0eda 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/Output.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/output/Output.java
@@ -31,11 +31,11 @@ import org.apache.ambari.logfeeder.input.InputMarker;
 import org.apache.log4j.Logger;
 
 public abstract class Output extends ConfigBlock {
-  static private Logger logger = Logger.getLogger(Output.class);
+  private static final Logger logger = Logger.getLogger(Output.class);
 
-  String destination = null;
+  private String destination = null;
 
-  public MetricCount writeBytesMetric = new MetricCount();
+  protected MetricCount writeBytesMetric = new MetricCount();
 
   @Override
   public String getShortDescription() {

http://git-wip-us.apache.org/repos/asf/ambari/blob/9cbb2c97/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java
----------------------------------------------------------------------
diff --git a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java
index 19dd404..aaf809f 100644
--- a/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java
+++ b/ambari-logsearch/ambari-logsearch-logfeeder/src/main/java/org/apache/ambari/logfeeder/util/SolrUtil.java
@@ -40,14 +40,14 @@ import org.apache.solr.common.SolrException;
 
 public class SolrUtil {
 
-  private static Logger logger = Logger.getLogger(SolrUtil.class);
+  private static final Logger logger = Logger.getLogger(SolrUtil.class);
 
   private static SolrUtil instance = null;
-  SolrClient solrClient = null;
-  CloudSolrClient solrClouldClient = null;
+  
+  private SolrClient solrClient = null;
+  private CloudSolrClient solrClouldClient = null;
 
-  String solrDetail = "";
-  String collectionName = null;
+  private String solrDetail = "";
 
   private SolrUtil() throws Exception {
     String url = LogFeederUtil.getStringProperty("logfeeder.solr.url");
@@ -76,9 +76,8 @@ public class SolrUtil {
     return instance;
   }
 
-  public SolrClient connectToSolr(String url, String zkConnectString,
+  private SolrClient connectToSolr(String url, String zkConnectString,
                                   String collection) throws Exception {
-    this.collectionName = collection;
     solrDetail = "zkConnectString=" + zkConnectString + ", collection=" + collection
       + ", url=" + url;
 
@@ -110,7 +109,7 @@ public class SolrUtil {
     return solrClient;
   }
 
-  public boolean checkSolrStatus(int waitDurationMS) {
+  private boolean checkSolrStatus(int waitDurationMS) {
     boolean status = false;
     try {
       long beginTimeMS = System.currentTimeMillis();
@@ -150,14 +149,7 @@ public class SolrUtil {
     return status;
   }
 
-  /**
-   * @param solrQuery
-   * @return
-   * @throws SolrServerException
-   * @throws IOException
-   * @throws SolrException
-   */
-  public QueryResponse process(SolrQuery solrQuery) throws SolrServerException, IOException, SolrException {
+  private QueryResponse process(SolrQuery solrQuery) throws SolrServerException, IOException, SolrException {
     if (solrClient != null) {
       QueryResponse queryResponse = solrClient.query(solrQuery, METHOD.POST);
       return queryResponse;
@@ -167,9 +159,6 @@ public class SolrUtil {
     }
   }
 
-  /**
-   * @return
-   */
   public HashMap<String, Object> getConfigDoc() {
     HashMap<String, Object> configMap = new HashMap<String, Object>();
     SolrQuery solrQuery = new SolrQuery();


Mime
View raw message