Github user mattf-horton commented on a diff in the pull request: https://github.com/apache/incubator-metron/pull/481#discussion_r107779736 --- Diff: metron-platform/metron-common/src/main/java/org/apache/metron/common/configuration/IndexingConfigurations.java --- @@ -73,7 +74,30 @@ public boolean isDefault(String sensorName, String writerName) { } public int getBatchSize(String sensorName, String writerName ) { - return getBatchSize(getSensorIndexingConfig(sensorName, writerName)); + return getBatchSize(getSensorIndexingConfig(sensorName, writerName)); + } + + public int getBatchTimeout(String sensorName, String writerName ) { + return getBatchTimeout(getSensorIndexingConfig(sensorName, writerName)); + } + + public List<Integer> getAllConfiguredTimeouts(String writerName) { + //The configuration infrastructure was not designed to enumerate sensors, so we synthesize. + //The use of SENSOR_MARKER_STRING assumes the config key for a sensor name consists of a + //prefix string (dependent on the ConfigurationType) followed by the sensor name. + //This then allows us to determine the keyPrefixString, and thence which of all the + //configurations.keySet are actually sensor keys. Then we look under those for timeouts. + String markerKeyString = getKey(SENSOR_MARKER_STRING); --- End diff -- Yup, this is unnecessarily complex. I'm going to eliminate SENSOR_MARKER_STRING and replace: ``` String markerKeyString = getKey(SENSOR_MARKER_STRING); int prefixStringLength = markerKeyString.indexOf(SENSOR_MARKER_STRING); String keyPrefixString = markerKeyString.substring(0, prefixStringLength); ``` with just: ``` String keyPrefixString = getKey(""); ```
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---