Source:
<code><START> public DiagnosticsManager(String jobName, String jobId, Map<String, ContainerModel> containerModels, <END> int containerMemoryMb, int containerNumCores, int numStoresWithChangelog, String containerId, String executionEnvContainerId, String taskClassVersion, String samzaVersion, String hostname, SystemStream diagnosticSystemStream, SystemProducer systemProducer, Duration terminationDuration, ScheduledExecutorService executorService) { this.jobName = jobName; this.jobId = jobId; this.containerModels = containerModels; this.containerMemoryMb = containerMemoryMb; this.containerNumCores = containerNumCores; this.numStoresWithChangelog = numStoresWithChangelog; this.containerId = containerId; this.executionEnvContainerId = executionEnvContainerId; this.taskClassVersion = taskClassVersion; this.samzaVersion = samzaVersion; this.hostname = hostname; this.diagnosticSystemStream = diagnosticSystemStream; this.systemProducer = systemProducer; this.terminationDuration = terminationDuration; this.processorStopEvents = new ConcurrentLinkedQueue<>(); this.exceptions = new BoundedList<>("exceptions"); this.scheduler = executorService; resetTime = Instant.now(); try { Util.getObj("org.apache.samza.logging.log4j.SimpleDiagnosticsAppender", JavaConverters.collectionAsScalaIterableConverter( Collections.singletonList(new Tuple2<Class<?>, Object>(DiagnosticsManager.class, this))) .asScala() .toSeq()); LOG.info("Attached log4j diagnostics appender."); } catch (ClassNotFoundException | InstantiationException | InvocationTargetException e) { try { Util.getObj("org.apache.samza.logging.log4j2.SimpleDiagnosticsAppender", JavaConverters.collectionAsScalaIterableConverter( Collections.singletonList(new Tuple2<Class<?>, Object>(DiagnosticsManager.class, this))) .asScala() .toSeq()); LOG.info("Attached log4j diagnostics appender."); } catch (ClassNotFoundException | InstantiationException | InvocationTargetException ex) { LOG.warn( "Failed to instantiate neither diagnostic appender for sending error information to diagnostics stream.", ex); } } }</code><technical_language>This is for testing, right? please package-private mark VisibleForTesting</technical_language>

Target:
DiagnosticsManager(String jobName, String jobId, Map<String, ContainerModel> containerModels, int containerMemoryMb, int containerNumCores, int numStoresWithChangelog, String containerId, String executionEnvContainerId, String taskClassVersion, String samzaVersion, String hostname, SystemStream diagnosticSystemStream, SystemProducer systemProducer, Duration terminationDuration, ScheduledExecutorService executorService) { this.jobName = jobName; this.jobId = jobId; this.containerModels = containerModels; this.containerMemoryMb = containerMemoryMb; this.containerNumCores = containerNumCores; this.numStoresWithChangelog = numStoresWithChangelog; this.containerId = containerId; this.executionEnvContainerId = executionEnvContainerId; this.taskClassVersion = taskClassVersion; this.samzaVersion = samzaVersion; this.hostname = hostname; this.diagnosticSystemStream = diagnosticSystemStream; this.systemProducer = systemProducer; this.terminationDuration = terminationDuration; this.processorStopEvents = new ConcurrentLinkedQueue<>(); this.exceptions = new BoundedList<>("exceptions"); this.scheduler = executorService; resetTime = Instant.now(); try { Util.getObj("org.apache.samza.logging.log4j.SimpleDiagnosticsAppender", JavaConverters.collectionAsScalaIterableConverter( Collections.singletonList(new Tuple2<Class<?>, Object>(DiagnosticsManager.class, this))) .asScala() .toSeq()); LOG.info("Attached log4j diagnostics appender."); } catch (ClassNotFoundException | InstantiationException | InvocationTargetException e) { try { Util.getObj("org.apache.samza.logging.log4j2.SimpleDiagnosticsAppender", JavaConverters.collectionAsScalaIterableConverter( Collections.singletonList(new Tuple2<Class<?>, Object>(DiagnosticsManager.class, this))) .asScala() .toSeq()); LOG.info("Attached log4j diagnostics appender."); } catch (ClassNotFoundException | InstantiationException | InvocationTargetException ex) { LOG.warn( "Failed to instantiate neither diagnostic appender for sending error information to diagnostics stream.", ex); } } }