@Test public void testBaseSingerConfig() throws ConfigurationException { Map<String, Object> map = new HashMap<>(); map.put("monitor.monitorIntervalInSecs", "10"); map.put("statsPusherHostPort", "localhost:1900"); AbstractConfiguration config = new MapConfiguration(map); LogConfigUtils.parseCommonSingerConfigHeader(config); map.put("statsPusherClass", "com.pinterest.singer.monitor.DefaultLogMonitor"); try { LogConfigUtils.parseCommonSingerConfigHeader(config); fail( "Must fail since the supplied class is not a valid StatsPusher class but it is a valid class"); } catch (Exception e) { } map.put("statsPusherClass", "com.pinterest.singer.monitor.Xyz"); try { LogConfigUtils.parseCommonSingerConfigHeader(config); fail("Must fail since the supplied class is not a valid class"); } catch (Exception e) { } map.remove("statsPusherClass"); map.put("environmentProviderClass", "com.pinterest.singer.monitor.Xyz"); try { LogConfigUtils.parseCommonSingerConfigHeader(config); fail("Must fail since the supplied class is not a valid class"); } catch (Exception e) { } map.put("environmentProviderClass", "com.pinterest.singer.monitor.DefaultLogMonitor"); try { LogConfigUtils.parseCommonSingerConfigHeader(config); fail("Must fail since the supplied class is not a valid class"); } catch (Exception e) { } }
public static SingerConfig parseCommonSingerConfigHeader(AbstractConfiguration singerConfiguration) throws ConfigurationException { SingerConfig singerConfig = new SingerConfig(); if (singerConfiguration.containsKey("threadPoolSize")) { singerConfig.setThreadPoolSize(singerConfiguration.getInt("threadPoolSize")); } if (singerConfiguration.containsKey("ostrichPort")) { singerConfig.setOstrichPort(singerConfiguration.getInt("ostrichPort")); } if (singerConfiguration.containsKey("writerThreadPoolSize")) { int writerThreadPoolSize = singerConfiguration.getInt("writerThreadPoolSize"); singerConfig.setWriterThreadPoolSize(writerThreadPoolSize); } singerConfig.setLogMonitorConfig(LogConfigUtils .parseLogMonitorConfig(new SubsetConfiguration(singerConfiguration, "monitor."))); if (singerConfiguration.containsKey("logFileRotationTimeInMillis")) { int logFileRotationTimeInMillis = singerConfiguration.getInt("logFileRotationTimeInMillis"); singerConfig.setLogFileRotationTimeInMillis(logFileRotationTimeInMillis); } if (singerConfiguration.containsKey("logMonitorClass")) { String logMonitorClass = singerConfiguration.getString("logMonitorClass"); singerConfig.setLogMonitorClass(logMonitorClass); } if (singerConfiguration.containsKey("kubernetesEnabled")) { singerConfig.setKubernetesEnabled(singerConfiguration.getBoolean("kubernetesEnabled")); } if (singerConfiguration.containsKey("heartbeatEnabled")) { singerConfig.setHeartbeatEnabled(singerConfiguration.getBoolean("heartbeatEnabled")); } if (singerConfiguration.containsKey("environmentProviderClass")) { String envProviderClass = singerConfiguration.getString("environmentProviderClass"); singerConfig.setEnvironmentProviderClass(envProviderClass); try { Class<?> cls = Class.forName(envProviderClass); if (!EnvironmentProvider.class.isAssignableFrom(cls)) { throw new ConfigurationException("environmentProviderClass " + envProviderClass + " doesn't extend " + EnvironmentProvider.class.getName()); } } catch (ClassNotFoundException e) { throw new ConfigurationException("Couldn't find environmentProviderClass " + envProviderClass); } } String statsPusherHostPort = singerConfiguration.getString("statsPusherHostPort"); if (statsPusherHostPort != null) { singerConfig.setStatsPusherHostPort(statsPusherHostPort); String statsPusherClass = singerConfiguration.getString("statsPusherClass"); if (statsPusherClass != null) { singerConfig.setStatsPusherClass(statsPusherClass); } try { Class<?> cls = Class.forName(singerConfig.getStatsPusherClass()); if (!StatsPusher.class.isAssignableFrom(cls)) { throw new ConfigurationException("statsPusherClass " + singerConfig.getStatsPusherClass() + " doesn't extend " + StatsPusher.class.getName()); } } catch (ClassNotFoundException e) { throw new ConfigurationException("Couldn't find statsPusherClass " + statsPusherClass); } if (singerConfiguration.containsKey("statsPusherFrequencyInSeconds")) { int frequency = singerConfiguration.getInt("statsPusherFrequencyInSeconds"); if (frequency > 0) { singerConfig.setStatsPusherFrequencyInSeconds(frequency); } } } if (singerConfiguration.containsKey("loggingAuditEnabled")) { singerConfig.setLoggingAuditEnabled(singerConfiguration.getBoolean("loggingAuditEnabled")); } if (singerConfiguration.containsKey("shadowModeEnabled")) { if (!singerConfiguration.containsKey("shadowModeServersetMappingFile")) { throw new ConfigurationException("Invalid shadow mode configuration, missing shadowModeServersetMappingFile"); } SHADOW_MODE_ENABLED = singerConfiguration.getBoolean("shadowModeEnabled"); singerConfig.setShadowModeEnabled(SHADOW_MODE_ENABLED); if (SHADOW_MODE_ENABLED) { singerConfig.setShadowModeServersetMappingFile(singerConfiguration.getString("shadowModeServersetMappingFile")); try { SHADOW_SERVERSET_MAPPING.load(new FileInputStream(new File(singerConfig.getShadowModeServersetMappingFile()))); if (!SHADOW_SERVERSET_MAPPING.containsKey(DEFAULT_SHADOW_SERVERSET)) { throw new ConfigurationException("Missing default shadow serverset"); } } catch (IOException e) { throw new ConfigurationException("Error reading shadow mapping file", e); } } } return singerConfig; }
LogConfigUtils { public static SingerConfig parseCommonSingerConfigHeader(AbstractConfiguration singerConfiguration) throws ConfigurationException { SingerConfig singerConfig = new SingerConfig(); if (singerConfiguration.containsKey("threadPoolSize")) { singerConfig.setThreadPoolSize(singerConfiguration.getInt("threadPoolSize")); } if (singerConfiguration.containsKey("ostrichPort")) { singerConfig.setOstrichPort(singerConfiguration.getInt("ostrichPort")); } if (singerConfiguration.containsKey("writerThreadPoolSize")) { int writerThreadPoolSize = singerConfiguration.getInt("writerThreadPoolSize"); singerConfig.setWriterThreadPoolSize(writerThreadPoolSize); } singerConfig.setLogMonitorConfig(LogConfigUtils .parseLogMonitorConfig(new SubsetConfiguration(singerConfiguration, "monitor."))); if (singerConfiguration.containsKey("logFileRotationTimeInMillis")) { int logFileRotationTimeInMillis = singerConfiguration.getInt("logFileRotationTimeInMillis"); singerConfig.setLogFileRotationTimeInMillis(logFileRotationTimeInMillis); } if (singerConfiguration.containsKey("logMonitorClass")) { String logMonitorClass = singerConfiguration.getString("logMonitorClass"); singerConfig.setLogMonitorClass(logMonitorClass); } if (singerConfiguration.containsKey("kubernetesEnabled")) { singerConfig.setKubernetesEnabled(singerConfiguration.getBoolean("kubernetesEnabled")); } if (singerConfiguration.containsKey("heartbeatEnabled")) { singerConfig.setHeartbeatEnabled(singerConfiguration.getBoolean("heartbeatEnabled")); } if (singerConfiguration.containsKey("environmentProviderClass")) { String envProviderClass = singerConfiguration.getString("environmentProviderClass"); singerConfig.setEnvironmentProviderClass(envProviderClass); try { Class<?> cls = Class.forName(envProviderClass); if (!EnvironmentProvider.class.isAssignableFrom(cls)) { throw new ConfigurationException("environmentProviderClass " + envProviderClass + " doesn't extend " + EnvironmentProvider.class.getName()); } } catch (ClassNotFoundException e) { throw new ConfigurationException("Couldn't find environmentProviderClass " + envProviderClass); } } String statsPusherHostPort = singerConfiguration.getString("statsPusherHostPort"); if (statsPusherHostPort != null) { singerConfig.setStatsPusherHostPort(statsPusherHostPort); String statsPusherClass = singerConfiguration.getString("statsPusherClass"); if (statsPusherClass != null) { singerConfig.setStatsPusherClass(statsPusherClass); } try { Class<?> cls = Class.forName(singerConfig.getStatsPusherClass()); if (!StatsPusher.class.isAssignableFrom(cls)) { throw new ConfigurationException("statsPusherClass " + singerConfig.getStatsPusherClass() + " doesn't extend " + StatsPusher.class.getName()); } } catch (ClassNotFoundException e) { throw new ConfigurationException("Couldn't find statsPusherClass " + statsPusherClass); } if (singerConfiguration.containsKey("statsPusherFrequencyInSeconds")) { int frequency = singerConfiguration.getInt("statsPusherFrequencyInSeconds"); if (frequency > 0) { singerConfig.setStatsPusherFrequencyInSeconds(frequency); } } } if (singerConfiguration.containsKey("loggingAuditEnabled")) { singerConfig.setLoggingAuditEnabled(singerConfiguration.getBoolean("loggingAuditEnabled")); } if (singerConfiguration.containsKey("shadowModeEnabled")) { if (!singerConfiguration.containsKey("shadowModeServersetMappingFile")) { throw new ConfigurationException("Invalid shadow mode configuration, missing shadowModeServersetMappingFile"); } SHADOW_MODE_ENABLED = singerConfiguration.getBoolean("shadowModeEnabled"); singerConfig.setShadowModeEnabled(SHADOW_MODE_ENABLED); if (SHADOW_MODE_ENABLED) { singerConfig.setShadowModeServersetMappingFile(singerConfiguration.getString("shadowModeServersetMappingFile")); try { SHADOW_SERVERSET_MAPPING.load(new FileInputStream(new File(singerConfig.getShadowModeServersetMappingFile()))); if (!SHADOW_SERVERSET_MAPPING.containsKey(DEFAULT_SHADOW_SERVERSET)) { throw new ConfigurationException("Missing default shadow serverset"); } } catch (IOException e) { throw new ConfigurationException("Error reading shadow mapping file", e); } } } return singerConfig; } }
LogConfigUtils { public static SingerConfig parseCommonSingerConfigHeader(AbstractConfiguration singerConfiguration) throws ConfigurationException { SingerConfig singerConfig = new SingerConfig(); if (singerConfiguration.containsKey("threadPoolSize")) { singerConfig.setThreadPoolSize(singerConfiguration.getInt("threadPoolSize")); } if (singerConfiguration.containsKey("ostrichPort")) { singerConfig.setOstrichPort(singerConfiguration.getInt("ostrichPort")); } if (singerConfiguration.containsKey("writerThreadPoolSize")) { int writerThreadPoolSize = singerConfiguration.getInt("writerThreadPoolSize"); singerConfig.setWriterThreadPoolSize(writerThreadPoolSize); } singerConfig.setLogMonitorConfig(LogConfigUtils .parseLogMonitorConfig(new SubsetConfiguration(singerConfiguration, "monitor."))); if (singerConfiguration.containsKey("logFileRotationTimeInMillis")) { int logFileRotationTimeInMillis = singerConfiguration.getInt("logFileRotationTimeInMillis"); singerConfig.setLogFileRotationTimeInMillis(logFileRotationTimeInMillis); } if (singerConfiguration.containsKey("logMonitorClass")) { String logMonitorClass = singerConfiguration.getString("logMonitorClass"); singerConfig.setLogMonitorClass(logMonitorClass); } if (singerConfiguration.containsKey("kubernetesEnabled")) { singerConfig.setKubernetesEnabled(singerConfiguration.getBoolean("kubernetesEnabled")); } if (singerConfiguration.containsKey("heartbeatEnabled")) { singerConfig.setHeartbeatEnabled(singerConfiguration.getBoolean("heartbeatEnabled")); } if (singerConfiguration.containsKey("environmentProviderClass")) { String envProviderClass = singerConfiguration.getString("environmentProviderClass"); singerConfig.setEnvironmentProviderClass(envProviderClass); try { Class<?> cls = Class.forName(envProviderClass); if (!EnvironmentProvider.class.isAssignableFrom(cls)) { throw new ConfigurationException("environmentProviderClass " + envProviderClass + " doesn't extend " + EnvironmentProvider.class.getName()); } } catch (ClassNotFoundException e) { throw new ConfigurationException("Couldn't find environmentProviderClass " + envProviderClass); } } String statsPusherHostPort = singerConfiguration.getString("statsPusherHostPort"); if (statsPusherHostPort != null) { singerConfig.setStatsPusherHostPort(statsPusherHostPort); String statsPusherClass = singerConfiguration.getString("statsPusherClass"); if (statsPusherClass != null) { singerConfig.setStatsPusherClass(statsPusherClass); } try { Class<?> cls = Class.forName(singerConfig.getStatsPusherClass()); if (!StatsPusher.class.isAssignableFrom(cls)) { throw new ConfigurationException("statsPusherClass " + singerConfig.getStatsPusherClass() + " doesn't extend " + StatsPusher.class.getName()); } } catch (ClassNotFoundException e) { throw new ConfigurationException("Couldn't find statsPusherClass " + statsPusherClass); } if (singerConfiguration.containsKey("statsPusherFrequencyInSeconds")) { int frequency = singerConfiguration.getInt("statsPusherFrequencyInSeconds"); if (frequency > 0) { singerConfig.setStatsPusherFrequencyInSeconds(frequency); } } } if (singerConfiguration.containsKey("loggingAuditEnabled")) { singerConfig.setLoggingAuditEnabled(singerConfiguration.getBoolean("loggingAuditEnabled")); } if (singerConfiguration.containsKey("shadowModeEnabled")) { if (!singerConfiguration.containsKey("shadowModeServersetMappingFile")) { throw new ConfigurationException("Invalid shadow mode configuration, missing shadowModeServersetMappingFile"); } SHADOW_MODE_ENABLED = singerConfiguration.getBoolean("shadowModeEnabled"); singerConfig.setShadowModeEnabled(SHADOW_MODE_ENABLED); if (SHADOW_MODE_ENABLED) { singerConfig.setShadowModeServersetMappingFile(singerConfiguration.getString("shadowModeServersetMappingFile")); try { SHADOW_SERVERSET_MAPPING.load(new FileInputStream(new File(singerConfig.getShadowModeServersetMappingFile()))); if (!SHADOW_SERVERSET_MAPPING.containsKey(DEFAULT_SHADOW_SERVERSET)) { throw new ConfigurationException("Missing default shadow serverset"); } } catch (IOException e) { throw new ConfigurationException("Error reading shadow mapping file", e); } } } return singerConfig; } private  LogConfigUtils(); }
LogConfigUtils { public static SingerConfig parseCommonSingerConfigHeader(AbstractConfiguration singerConfiguration) throws ConfigurationException { SingerConfig singerConfig = new SingerConfig(); if (singerConfiguration.containsKey("threadPoolSize")) { singerConfig.setThreadPoolSize(singerConfiguration.getInt("threadPoolSize")); } if (singerConfiguration.containsKey("ostrichPort")) { singerConfig.setOstrichPort(singerConfiguration.getInt("ostrichPort")); } if (singerConfiguration.containsKey("writerThreadPoolSize")) { int writerThreadPoolSize = singerConfiguration.getInt("writerThreadPoolSize"); singerConfig.setWriterThreadPoolSize(writerThreadPoolSize); } singerConfig.setLogMonitorConfig(LogConfigUtils .parseLogMonitorConfig(new SubsetConfiguration(singerConfiguration, "monitor."))); if (singerConfiguration.containsKey("logFileRotationTimeInMillis")) { int logFileRotationTimeInMillis = singerConfiguration.getInt("logFileRotationTimeInMillis"); singerConfig.setLogFileRotationTimeInMillis(logFileRotationTimeInMillis); } if (singerConfiguration.containsKey("logMonitorClass")) { String logMonitorClass = singerConfiguration.getString("logMonitorClass"); singerConfig.setLogMonitorClass(logMonitorClass); } if (singerConfiguration.containsKey("kubernetesEnabled")) { singerConfig.setKubernetesEnabled(singerConfiguration.getBoolean("kubernetesEnabled")); } if (singerConfiguration.containsKey("heartbeatEnabled")) { singerConfig.setHeartbeatEnabled(singerConfiguration.getBoolean("heartbeatEnabled")); } if (singerConfiguration.containsKey("environmentProviderClass")) { String envProviderClass = singerConfiguration.getString("environmentProviderClass"); singerConfig.setEnvironmentProviderClass(envProviderClass); try { Class<?> cls = Class.forName(envProviderClass); if (!EnvironmentProvider.class.isAssignableFrom(cls)) { throw new ConfigurationException("environmentProviderClass " + envProviderClass + " doesn't extend " + EnvironmentProvider.class.getName()); } } catch (ClassNotFoundException e) { throw new ConfigurationException("Couldn't find environmentProviderClass " + envProviderClass); } } String statsPusherHostPort = singerConfiguration.getString("statsPusherHostPort"); if (statsPusherHostPort != null) { singerConfig.setStatsPusherHostPort(statsPusherHostPort); String statsPusherClass = singerConfiguration.getString("statsPusherClass"); if (statsPusherClass != null) { singerConfig.setStatsPusherClass(statsPusherClass); } try { Class<?> cls = Class.forName(singerConfig.getStatsPusherClass()); if (!StatsPusher.class.isAssignableFrom(cls)) { throw new ConfigurationException("statsPusherClass " + singerConfig.getStatsPusherClass() + " doesn't extend " + StatsPusher.class.getName()); } } catch (ClassNotFoundException e) { throw new ConfigurationException("Couldn't find statsPusherClass " + statsPusherClass); } if (singerConfiguration.containsKey("statsPusherFrequencyInSeconds")) { int frequency = singerConfiguration.getInt("statsPusherFrequencyInSeconds"); if (frequency > 0) { singerConfig.setStatsPusherFrequencyInSeconds(frequency); } } } if (singerConfiguration.containsKey("loggingAuditEnabled")) { singerConfig.setLoggingAuditEnabled(singerConfiguration.getBoolean("loggingAuditEnabled")); } if (singerConfiguration.containsKey("shadowModeEnabled")) { if (!singerConfiguration.containsKey("shadowModeServersetMappingFile")) { throw new ConfigurationException("Invalid shadow mode configuration, missing shadowModeServersetMappingFile"); } SHADOW_MODE_ENABLED = singerConfiguration.getBoolean("shadowModeEnabled"); singerConfig.setShadowModeEnabled(SHADOW_MODE_ENABLED); if (SHADOW_MODE_ENABLED) { singerConfig.setShadowModeServersetMappingFile(singerConfiguration.getString("shadowModeServersetMappingFile")); try { SHADOW_SERVERSET_MAPPING.load(new FileInputStream(new File(singerConfig.getShadowModeServersetMappingFile()))); if (!SHADOW_SERVERSET_MAPPING.containsKey(DEFAULT_SHADOW_SERVERSET)) { throw new ConfigurationException("Missing default shadow serverset"); } } catch (IOException e) { throw new ConfigurationException("Error reading shadow mapping file", e); } } } return singerConfig; } private  LogConfigUtils(); static SingerConfig parseDirBasedSingerConfigHeader(String singerConfigFile); static MemqWriterConfig parseMemqWriterConfig(SubsetConfiguration configuration); static void parseMemqAuditorConfigs(MemqWriterConfig config,
                                         AbstractConfiguration configuration); static SingerConfig parseFileBasedSingerConfig(String singerConfigFile); static LogMonitorConfig parseLogMonitorConfig(AbstractConfiguration monitorConfiguration); static SingerLogConfig parseLogConfigFromFile(File logConfigFile); static SingerLogConfig[] parseLogStreamConfigFromFile(String logConfigFile); static String parseLogNamespace(File logConfigFile); static SingerLogConfig parseLogConfig(String logName,
                                               AbstractConfiguration logConfiguration); static SingerLogConfig[] parseLogStreamConfig(AbstractConfiguration config); static SingerConfig parseCommonSingerConfigHeader(AbstractConfiguration singerConfiguration); static LogStreamWriterConfig parseLogStreamWriterConfig(AbstractConfiguration writerConfiguration); static RealpinWriterConfig parseRealpinWriterConfig(AbstractConfiguration configuration); static String filePathFromZKPath(String serverSetZKPath); static KafkaProducerConfig parseProducerConfig(AbstractConfiguration producerConfiguration); static PropertiesConfiguration[] getTopicConfigs(Configuration config); static PropertiesConfiguration getTopicConfig(Configuration config, String topicName); static void validateNewConfig(Configuration config); }
LogConfigUtils { public static SingerConfig parseCommonSingerConfigHeader(AbstractConfiguration singerConfiguration) throws ConfigurationException { SingerConfig singerConfig = new SingerConfig(); if (singerConfiguration.containsKey("threadPoolSize")) { singerConfig.setThreadPoolSize(singerConfiguration.getInt("threadPoolSize")); } if (singerConfiguration.containsKey("ostrichPort")) { singerConfig.setOstrichPort(singerConfiguration.getInt("ostrichPort")); } if (singerConfiguration.containsKey("writerThreadPoolSize")) { int writerThreadPoolSize = singerConfiguration.getInt("writerThreadPoolSize"); singerConfig.setWriterThreadPoolSize(writerThreadPoolSize); } singerConfig.setLogMonitorConfig(LogConfigUtils .parseLogMonitorConfig(new SubsetConfiguration(singerConfiguration, "monitor."))); if (singerConfiguration.containsKey("logFileRotationTimeInMillis")) { int logFileRotationTimeInMillis = singerConfiguration.getInt("logFileRotationTimeInMillis"); singerConfig.setLogFileRotationTimeInMillis(logFileRotationTimeInMillis); } if (singerConfiguration.containsKey("logMonitorClass")) { String logMonitorClass = singerConfiguration.getString("logMonitorClass"); singerConfig.setLogMonitorClass(logMonitorClass); } if (singerConfiguration.containsKey("kubernetesEnabled")) { singerConfig.setKubernetesEnabled(singerConfiguration.getBoolean("kubernetesEnabled")); } if (singerConfiguration.containsKey("heartbeatEnabled")) { singerConfig.setHeartbeatEnabled(singerConfiguration.getBoolean("heartbeatEnabled")); } if (singerConfiguration.containsKey("environmentProviderClass")) { String envProviderClass = singerConfiguration.getString("environmentProviderClass"); singerConfig.setEnvironmentProviderClass(envProviderClass); try { Class<?> cls = Class.forName(envProviderClass); if (!EnvironmentProvider.class.isAssignableFrom(cls)) { throw new ConfigurationException("environmentProviderClass " + envProviderClass + " doesn't extend " + EnvironmentProvider.class.getName()); } } catch (ClassNotFoundException e) { throw new ConfigurationException("Couldn't find environmentProviderClass " + envProviderClass); } } String statsPusherHostPort = singerConfiguration.getString("statsPusherHostPort"); if (statsPusherHostPort != null) { singerConfig.setStatsPusherHostPort(statsPusherHostPort); String statsPusherClass = singerConfiguration.getString("statsPusherClass"); if (statsPusherClass != null) { singerConfig.setStatsPusherClass(statsPusherClass); } try { Class<?> cls = Class.forName(singerConfig.getStatsPusherClass()); if (!StatsPusher.class.isAssignableFrom(cls)) { throw new ConfigurationException("statsPusherClass " + singerConfig.getStatsPusherClass() + " doesn't extend " + StatsPusher.class.getName()); } } catch (ClassNotFoundException e) { throw new ConfigurationException("Couldn't find statsPusherClass " + statsPusherClass); } if (singerConfiguration.containsKey("statsPusherFrequencyInSeconds")) { int frequency = singerConfiguration.getInt("statsPusherFrequencyInSeconds"); if (frequency > 0) { singerConfig.setStatsPusherFrequencyInSeconds(frequency); } } } if (singerConfiguration.containsKey("loggingAuditEnabled")) { singerConfig.setLoggingAuditEnabled(singerConfiguration.getBoolean("loggingAuditEnabled")); } if (singerConfiguration.containsKey("shadowModeEnabled")) { if (!singerConfiguration.containsKey("shadowModeServersetMappingFile")) { throw new ConfigurationException("Invalid shadow mode configuration, missing shadowModeServersetMappingFile"); } SHADOW_MODE_ENABLED = singerConfiguration.getBoolean("shadowModeEnabled"); singerConfig.setShadowModeEnabled(SHADOW_MODE_ENABLED); if (SHADOW_MODE_ENABLED) { singerConfig.setShadowModeServersetMappingFile(singerConfiguration.getString("shadowModeServersetMappingFile")); try { SHADOW_SERVERSET_MAPPING.load(new FileInputStream(new File(singerConfig.getShadowModeServersetMappingFile()))); if (!SHADOW_SERVERSET_MAPPING.containsKey(DEFAULT_SHADOW_SERVERSET)) { throw new ConfigurationException("Missing default shadow serverset"); } } catch (IOException e) { throw new ConfigurationException("Error reading shadow mapping file", e); } } } return singerConfig; } private  LogConfigUtils(); static SingerConfig parseDirBasedSingerConfigHeader(String singerConfigFile); static MemqWriterConfig parseMemqWriterConfig(SubsetConfiguration configuration); static void parseMemqAuditorConfigs(MemqWriterConfig config,
                                         AbstractConfiguration configuration); static SingerConfig parseFileBasedSingerConfig(String singerConfigFile); static LogMonitorConfig parseLogMonitorConfig(AbstractConfiguration monitorConfiguration); static SingerLogConfig parseLogConfigFromFile(File logConfigFile); static SingerLogConfig[] parseLogStreamConfigFromFile(String logConfigFile); static String parseLogNamespace(File logConfigFile); static SingerLogConfig parseLogConfig(String logName,
                                               AbstractConfiguration logConfiguration); static SingerLogConfig[] parseLogStreamConfig(AbstractConfiguration config); static SingerConfig parseCommonSingerConfigHeader(AbstractConfiguration singerConfiguration); static LogStreamWriterConfig parseLogStreamWriterConfig(AbstractConfiguration writerConfiguration); static RealpinWriterConfig parseRealpinWriterConfig(AbstractConfiguration configuration); static String filePathFromZKPath(String serverSetZKPath); static KafkaProducerConfig parseProducerConfig(AbstractConfiguration producerConfiguration); static PropertiesConfiguration[] getTopicConfigs(Configuration config); static PropertiesConfiguration getTopicConfig(Configuration config, String topicName); static void validateNewConfig(Configuration config); static final String DEFAULT_SHADOW_SERVERSET; static String DEFAULT_SERVERSET_DIR; static final Properties SHADOW_SERVERSET_MAPPING; static boolean SHADOW_MODE_ENABLED; }