org.apache.samza.util.Util.getObj()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(8.7k)|赞(0)|评价(0)|浏览(151)

本文整理了Java中org.apache.samza.util.Util.getObj()方法的一些代码示例,展示了Util.getObj()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getObj()方法的具体详情如下:
包路径:org.apache.samza.util.Util
类名称:Util
方法名:getObj

Util.getObj介绍

暂无

代码示例

代码示例来源:origin: apache/samza

  1. public CoordinationUtilsFactory getCoordinationUtilsFactory() {
  2. // load the class
  3. String coordinationUtilsFactoryClass = getJobCoordinationUtilsFactoryClassName();
  4. return Util.getObj(coordinationUtilsFactoryClass, CoordinationUtilsFactory.class);
  5. }

代码示例来源:origin: org.apache.samza/samza-core

  1. public CoordinationUtilsFactory getCoordinationUtilsFactory() {
  2. // load the class
  3. String coordinationUtilsFactoryClass = getJobCoordinationUtilsFactoryClassName();
  4. return Util.getObj(coordinationUtilsFactoryClass, CoordinationUtilsFactory.class);
  5. }

代码示例来源:origin: org.apache.samza/samza-core_2.11

  1. public CoordinationUtilsFactory getCoordinationUtilsFactory() {
  2. // load the class
  3. String coordinationUtilsFactoryClass = getJobCoordinationUtilsFactoryClassName();
  4. return Util.getObj(coordinationUtilsFactoryClass, CoordinationUtilsFactory.class);
  5. }

代码示例来源:origin: org.apache.samza/samza-core_2.10

  1. public CoordinationUtilsFactory getCoordinationUtilsFactory() {
  2. // load the class
  3. String coordinationUtilsFactoryClass = getJobCoordinationUtilsFactoryClassName();
  4. return Util.getObj(coordinationUtilsFactoryClass, CoordinationUtilsFactory.class);
  5. }

代码示例来源:origin: org.apache.samza/samza-core_2.12

  1. public CoordinationUtilsFactory getCoordinationUtilsFactory() {
  2. // load the class
  3. String coordinationUtilsFactoryClass = getJobCoordinationUtilsFactoryClassName();
  4. return Util.getObj(coordinationUtilsFactoryClass, CoordinationUtilsFactory.class);
  5. }

代码示例来源:origin: apache/samza

  1. protected static IndexRequestFactory getIndexRequestFactory(ElasticsearchConfig config) {
  2. if (config.getIndexRequestFactoryClassName().isPresent()) {
  3. return Util.getObj(config.getIndexRequestFactoryClassName().get(), IndexRequestFactory.class);
  4. } else {
  5. return new DefaultIndexRequestFactory();
  6. }
  7. }

代码示例来源:origin: apache/samza

  1. public static Monitor instantiateMonitor(String monitorName, MonitorConfig monitorConfig, MetricsRegistry metricsRegistry)
  2. throws InstantiationException {
  3. String factoryClass = monitorConfig.getMonitorFactoryClass();
  4. try {
  5. MonitorFactory monitorFactory = Util.getObj(factoryClass, MonitorFactory.class);
  6. return monitorFactory.getMonitorInstance(monitorName, monitorConfig, metricsRegistry);
  7. } catch (Exception e) {
  8. throw (InstantiationException)
  9. new InstantiationException("Unable to instantiate monitor with factory class " + factoryClass).initCause(e);
  10. }
  11. }
  12. }

代码示例来源:origin: apache/samza

  1. /**
  2. * Gets a SystemStreamPartitionGrouper object from the configuration.
  3. */
  4. private SystemStreamPartitionGrouper getSystemStreamPartitionGrouper() {
  5. JobConfig jobConfig = new JobConfig(config);
  6. String factoryString = jobConfig.getSystemStreamPartitionGrouperFactory();
  7. SystemStreamPartitionGrouper grouper = Util.getObj(factoryString, SystemStreamPartitionGrouperFactory.class)
  8. .getSystemStreamPartitionGrouper(jobConfig);
  9. return grouper;
  10. }

代码示例来源:origin: apache/samza

  1. private void addTable(String tableId, Config config) {
  2. if (tableContexts.containsKey(tableId)) {
  3. throw new SamzaException("Table " + tableId + " already exists");
  4. }
  5. JavaTableConfig tableConfig = new JavaTableConfig(config);
  6. String providerFactoryClassName = tableConfig.getTableProviderFactory(tableId);
  7. TableProviderFactory tableProviderFactory =
  8. Util.getObj(providerFactoryClassName, TableProviderFactory.class);
  9. TableCtx ctx = new TableCtx();
  10. ctx.tableProvider = tableProviderFactory.getTableProvider(tableId);
  11. tableContexts.put(tableId, ctx);
  12. }

代码示例来源:origin: apache/samza

  1. private JobCoordinator createJobCoordinator() {
  2. String jobCoordinatorFactoryClassName = new JobCoordinatorConfig(config).getJobCoordinatorFactoryClassName();
  3. return Util.getObj(jobCoordinatorFactoryClassName, JobCoordinatorFactory.class).getJobCoordinator(processorId, config, metricsRegistry);
  4. }

代码示例来源:origin: org.apache.samza/samza-core_2.11

  1. private JobCoordinator createJobCoordinator() {
  2. String jobCoordinatorFactoryClassName = new JobCoordinatorConfig(config).getJobCoordinatorFactoryClassName();
  3. return Util.getObj(jobCoordinatorFactoryClassName, JobCoordinatorFactory.class).getJobCoordinator(config);
  4. }

代码示例来源:origin: org.apache.samza/samza-core_2.10

  1. private JobCoordinator createJobCoordinator() {
  2. String jobCoordinatorFactoryClassName = new JobCoordinatorConfig(config).getJobCoordinatorFactoryClassName();
  3. return Util.getObj(jobCoordinatorFactoryClassName, JobCoordinatorFactory.class).getJobCoordinator(config);
  4. }

代码示例来源:origin: apache/samza

  1. /**
  2. * Creates a instance of {@link SystemStreamPartitionMapper} using the stream partition expansion factory class
  3. * defined in the {@param config}.
  4. * @param config the configuration of the samza job.
  5. * @return the instantiated {@link SystemStreamPartitionMapper} object.
  6. */
  7. private SystemStreamPartitionMapper getSystemStreamPartitionMapper(Config config) {
  8. JobConfig jobConfig = new JobConfig(config);
  9. String systemStreamPartitionMapperClass = jobConfig.getSystemStreamPartitionMapperFactoryName();
  10. SystemStreamPartitionMapperFactory systemStreamPartitionMapperFactory = Util.getObj(systemStreamPartitionMapperClass, SystemStreamPartitionMapperFactory.class);
  11. return systemStreamPartitionMapperFactory.getStreamPartitionMapper(config, new MetricsRegistryMap());
  12. }

代码示例来源:origin: apache/samza

  1. public PassthroughJobCoordinator(String processorId, Config config, MetricsRegistry metricsRegistry) {
  2. this.processorId = processorId;
  3. this.config = config;
  4. LocationIdProviderFactory locationIdProviderFactory = Util.getObj(new JobConfig(config).getLocationIdProviderFactory(), LocationIdProviderFactory.class);
  5. LocationIdProvider locationIdProvider = locationIdProviderFactory.getLocationIdProvider(config);
  6. this.locationId = locationIdProvider.getLocationId();
  7. }

代码示例来源:origin: apache/samza

  1. public SimpleYarnJobProxy(JobsResourceConfig config) throws Exception {
  2. super(config);
  3. this.installFinder = new SimpleInstallationFinder(config.getInstallationsPath(),
  4. Util.getObj(config.getJobConfigFactory(), ConfigFactory.class));
  5. this.statusProvider = new YarnRestJobStatusProvider(config);
  6. }

代码示例来源:origin: apache/samza

  1. /**
  2. * Returns a command builder with the build environment configured with the containerId.
  3. * @param samzaContainerId to configure the builder with.
  4. * @return the constructed builder object
  5. */
  6. private CommandBuilder getCommandBuilder(String samzaContainerId) {
  7. String cmdBuilderClassName = taskConfig.getCommandClass(ShellCommandBuilder.class.getName());
  8. CommandBuilder cmdBuilder = Util.getObj(cmdBuilderClassName, CommandBuilder.class);
  9. cmdBuilder.setConfig(config).setId(samzaContainerId).setUrl(state.jobModelManager.server().getUrl());
  10. return cmdBuilder;
  11. }
  12. /**

代码示例来源:origin: org.apache.samza/samza-core

  1. /**
  2. * Returns a command builder with the build environment configured with the containerId.
  3. * @param samzaContainerId to configure the builder with.
  4. * @return the constructed builder object
  5. */
  6. private CommandBuilder getCommandBuilder(String samzaContainerId) {
  7. String cmdBuilderClassName = taskConfig.getCommandClass(ShellCommandBuilder.class.getName());
  8. CommandBuilder cmdBuilder = Util.getObj(cmdBuilderClassName, CommandBuilder.class);
  9. cmdBuilder.setConfig(config).setId(samzaContainerId).setUrl(state.jobModelManager.server().getUrl());
  10. return cmdBuilder;
  11. }
  12. /**

代码示例来源:origin: org.apache.samza/samza-core_2.12

  1. /**
  2. * Returns a command builder with the build environment configured with the containerId.
  3. * @param samzaContainerId to configure the builder with.
  4. * @return the constructed builder object
  5. */
  6. private CommandBuilder getCommandBuilder(String samzaContainerId) {
  7. String cmdBuilderClassName = taskConfig.getCommandClass(ShellCommandBuilder.class.getName());
  8. CommandBuilder cmdBuilder = Util.getObj(cmdBuilderClassName, CommandBuilder.class);
  9. cmdBuilder.setConfig(config).setId(samzaContainerId).setUrl(state.jobModelManager.server().getUrl());
  10. return cmdBuilder;
  11. }
  12. /**

代码示例来源:origin: org.apache.samza/samza-core_2.10

  1. /**
  2. * Returns a command builder with the build environment configured with the containerId.
  3. * @param samzaContainerId to configure the builder with.
  4. * @return the constructed builder object
  5. */
  6. private CommandBuilder getCommandBuilder(String samzaContainerId) {
  7. String cmdBuilderClassName = taskConfig.getCommandClass(ShellCommandBuilder.class.getName());
  8. CommandBuilder cmdBuilder = Util.getObj(cmdBuilderClassName, CommandBuilder.class);
  9. cmdBuilder.setConfig(config).setId(samzaContainerId).setUrl(state.jobModelManager.server().getUrl());
  10. return cmdBuilder;
  11. }
  12. /**

代码示例来源:origin: org.apache.samza/samza-core_2.11

  1. /**
  2. * Returns a command builder with the build environment configured with the containerId.
  3. * @param samzaContainerId to configure the builder with.
  4. * @return the constructed builder object
  5. */
  6. private CommandBuilder getCommandBuilder(String samzaContainerId) {
  7. String cmdBuilderClassName = taskConfig.getCommandClass(ShellCommandBuilder.class.getName());
  8. CommandBuilder cmdBuilder = Util.getObj(cmdBuilderClassName, CommandBuilder.class);
  9. cmdBuilder.setConfig(config).setId(samzaContainerId).setUrl(state.jobModelManager.server().getUrl());
  10. return cmdBuilder;
  11. }
  12. /**

相关文章