Skip to content

Commit

Permalink
address comment: adding javadoc and change to a more reasonable name
Browse files Browse the repository at this point in the history
  • Loading branch information
MabelYC committed Aug 7, 2020
1 parent 2092530 commit a05c6e4
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 4 deletions.
35 changes: 32 additions & 3 deletions samza-api/src/main/java/org/apache/samza/system/SystemFactory.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,44 @@ public interface SystemFactory {

SystemAdmin getAdmin(String systemName, Config config);

default SystemConsumer getConsumer(String systemName, Config config, MetricsRegistry registry, String consumerIdPrefix) {
/**
* This function provides an extra input parameter than {@link #getConsumer}, which can be used to provide extra
* information e.g. ownership of client instance
*
* @param systemName The name of the system to create consumer for.
* @param config The config to create consumer with.
* @param registry MetricsRegistry to which to publish consumer specific metrics.
* @param consumerLabel a string used to provide info the consumer instance.
* @return A SystemConsumer
*/
default SystemConsumer getConsumer(String systemName, Config config, MetricsRegistry registry, String consumerLabel) {
return getConsumer(systemName, config, registry);
}

default SystemProducer getProducer(String systemName, Config config, MetricsRegistry registry, String producerIdPrefix) {
/**
* This function provides an extra input parameter than {@link #getProducer}, which can be used to provide extra
* information e.g. ownership of client instance
*
* @param systemName The name of the system to create producer for.
* @param config The config to create producer with.
* @param registry MetricsRegistry to which to publish producer specific metrics.
* @param producerLabel a string used to provide info the producer instance.
* @return A SystemProducer
*/
default SystemProducer getProducer(String systemName, Config config, MetricsRegistry registry, String producerLabel) {
return getProducer(systemName, config, registry);
}

default SystemAdmin getAdmin(String systemName, Config config, String adminIdPrefix) {
/**
*This function provides an extra input parameter than {@link #getAdmin}, which can be used to provide extra
* information e.g. ownership of client instance
*
* @param systemName The name of the system to create admin for.
* @param config The config to create admin with.
* @param adminLabel a string used to provide info the admin instance.
* @return A SystemAmind
*/
default SystemAdmin getAdmin(String systemName, Config config, String adminLabel) {
return getAdmin(systemName, config);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public static Optional<Pair<DiagnosticsManager, MetricsSnapshotReporter>> buildD
SystemFactory systemFactory = ReflectionUtil.getObj(diagnosticsSystemFactoryName.get(), SystemFactory.class);
SystemProducer systemProducer =
systemFactory.getProducer(diagnosticsSystemStream.getSystem(), config, new MetricsRegistryMap(),
MethodHandles.lookup().lookupClass().getSimpleName());
DiagnosticsUtil.class.getSimpleName());

DiagnosticsManager diagnosticsManager =
new DiagnosticsManager(jobName, jobId, jobModel.getContainers(), containerMemoryMb, containerNumCores,
Expand Down

0 comments on commit a05c6e4

Please sign in to comment.