Codota Logo
JavaSystemConfig
Code IndexAdd Codota to your IDE (free)

How to use
JavaSystemConfig
in
org.apache.samza.config

Best Java code snippets using org.apache.samza.config.JavaSystemConfig (Showing top 20 results out of 315)

  • Common ways to obtain JavaSystemConfig
private void myMethod () {
JavaSystemConfig j =
  • Codota IconConfig config;new JavaSystemConfig(config)
  • Smart code suggestions by Codota
}
origin: apache/samza

public SystemAdmins(Config config) {
 JavaSystemConfig systemConfig = new JavaSystemConfig(config);
 this.systemAdminMap = systemConfig.getSystemAdmins();
}
origin: apache/samza

public String getSystemFactory(String name) {
 if (name == null) {
  return null;
 }
 String systemFactory = String.format(SYSTEM_FACTORY_FORMAT, name);
 String value = get(systemFactory, null);
 return (StringUtils.isBlank(value)) ? null : value;
}
origin: apache/samza

/**
 * Get {@link SystemAdmin} instances for all the systems defined in this config.
 *
 * @return map of system name to {@link SystemAdmin}
 */
public Map<String, SystemAdmin> getSystemAdmins() {
 return getSystemFactories().entrySet()
   .stream()
   .collect(Collectors.toMap(systemNameToFactoryEntry -> systemNameToFactoryEntry.getKey(),
     systemNameToFactoryEntry -> systemNameToFactoryEntry.getValue()
       .getAdmin(systemNameToFactoryEntry.getKey(), this)));
}
origin: org.apache.samza/samza-core

/**
 * get the SystemConsumers for the stores
 */
private HashMap<String, SystemConsumer> getStoreConsumers() {
 HashMap<String, SystemConsumer> storeConsumers = new HashMap<>();
 Map<String, SystemFactory> systemFactories = new JavaSystemConfig(jobConfig).getSystemFactories();
 for (Entry<String, SystemStream> entry : changeLogSystemStreams.entrySet()) {
  String storeSystem = entry.getValue().getSystem();
  if (!systemFactories.containsKey(storeSystem)) {
   throw new SamzaException("Changelog system " + storeSystem + " for store " + entry.getKey() + " does not exist in the config.");
  }
  storeConsumers.put(entry.getKey(), systemFactories.get(storeSystem).getConsumer(storeSystem, jobConfig, new MetricsRegistryMap()));
 }
 return storeConsumers;
}
origin: apache/samza

/**
 * Get {@link SystemFactory} instances for all the systems defined in this config.
 *
 * @return a map from system name to {@link SystemFactory}
 */
public Map<String, SystemFactory> getSystemFactories() {
 Map<String, SystemFactory> systemFactories = getSystemNames().stream().collect(Collectors.toMap(
  systemName -> systemName,
  systemName -> {
   String systemFactoryClassName = getSystemFactory(systemName);
   if (systemFactoryClassName == null) {
    throw new SamzaException(
      String.format("A stream uses system %s, which is missing from the configuration.", systemName));
   }
   return Util.getObj(systemFactoryClassName, SystemFactory.class);
  }));
 return systemFactories;
}
origin: apache/samza

JavaSystemConfig systemConfig = new JavaSystemConfig(config);
storeNameSystemStreamMapping.forEach((storeName, systemStream) -> {
  SystemAdmin systemAdmin = systemConfig.getSystemAdmin(systemStream.getSystem());
origin: apache/samza

@Test
public void testGetEmptyClassNameAsNull() {
 Map<String, String> map = new HashMap<String, String>();
 map.put(MOCK_SYSTEM_FACTORY_NAME1, "");
 map.put(MOCK_SYSTEM_FACTORY_NAME2, " ");
 JavaSystemConfig systemConfig = new JavaSystemConfig(new MapConfig(map));
 assertNull(systemConfig.getSystemFactory(MOCK_SYSTEM_NAME1));
 assertNull(systemConfig.getSystemFactory(MOCK_SYSTEM_NAME2));
}
origin: apache/samza

 @Test
 public void testGetSystemNames() {
  Map<String, String> map = new HashMap<String, String>();
  map.put(MOCK_SYSTEM_FACTORY_NAME1, MOCK_SYSTEM_FACTORY_CLASSNAME1);
  map.put(MOCK_SYSTEM_FACTORY_NAME2, MOCK_SYSTEM_FACTORY_CLASSNAME2);
  JavaSystemConfig systemConfig = new JavaSystemConfig(new MapConfig(map));

  assertEquals(2, systemConfig.getSystemNames().size());
  assertTrue(systemConfig.getSystemNames().contains(MOCK_SYSTEM_NAME1));
  assertTrue(systemConfig.getSystemNames().contains(MOCK_SYSTEM_NAME2));
 }
}
origin: org.apache.samza/samza-core_2.10

 /**
  * Gets the system-wide defaults for streams.
  *
  * @param systemName the name of the system for which the defaults will be returned.
  * @return a subset of the config with the system prefix removed.
  */
 public Config getDefaultStreamProperties(String systemName) {
  return subset(String.format(SYSTEM_DEFAULT_STREAMS_PREFIX_FORMAT, systemName), true);
 }
}
origin: apache/samza

String systemOffsetDefault = new JavaSystemConfig(config).getSystemOffsetDefault(systemName);
origin: org.apache.samza/samza-core

/**
 * Get {@link SystemAdmin} instance for given system name.
 *
 * @param systemName System name
 * @return SystemAdmin of the system if it exists, otherwise null.
 */
public SystemAdmin getSystemAdmin(String systemName) {
 return getSystemAdmins().get(systemName);
}
origin: org.apache.samza/samza-core_2.10

/**
 * get the SystemConsumers for the stores
 */
private HashMap<String, SystemConsumer> getStoreConsumers() {
 HashMap<String, SystemConsumer> storeConsumers = new HashMap<>();
 Map<String, SystemFactory> systemFactories = new JavaSystemConfig(jobConfig).getSystemFactories();
 for (Entry<String, SystemStream> entry : changeLogSystemStreams.entrySet()) {
  String storeSystem = entry.getValue().getSystem();
  if (!systemFactories.containsKey(storeSystem)) {
   throw new SamzaException("Changelog system " + storeSystem + " for store " + entry.getKey() + " does not exist in the config.");
  }
  storeConsumers.put(entry.getKey(), systemFactories.get(storeSystem).getConsumer(storeSystem, jobConfig, new MetricsRegistryMap()));
 }
 return storeConsumers;
}
origin: org.apache.samza/samza-core_2.10

/**
 * Get {@link SystemFactory} instances for all the systems defined in this config.
 *
 * @return a map from system name to {@link SystemFactory}
 */
public Map<String, SystemFactory> getSystemFactories() {
 Map<String, SystemFactory> systemFactories = getSystemNames().stream().collect(Collectors.toMap(
  systemName -> systemName,
  systemName -> {
   String systemFactoryClassName = getSystemFactory(systemName);
   if (systemFactoryClassName == null) {
    throw new SamzaException(
      String.format("A stream uses system %s, which is missing from the configuration.", systemName));
   }
   return Util.getObj(systemFactoryClassName, SystemFactory.class);
  }));
 return systemFactories;
}
origin: org.apache.samza/samza-core_2.10

JavaSystemConfig systemConfig = new JavaSystemConfig(config);
storeNameSystemStreamMapping.forEach((storeName, systemStream) -> {
  SystemAdmin systemAdmin = systemConfig.getSystemAdmin(systemStream.getSystem());
origin: apache/samza

@Test
public void testClassName() {
 Map<String, String> map = new HashMap<String, String>();
 map.put(MOCK_SYSTEM_FACTORY_NAME1, MOCK_SYSTEM_FACTORY_CLASSNAME1);
 JavaSystemConfig systemConfig = new JavaSystemConfig(new MapConfig(map));
 assertEquals(MOCK_SYSTEM_FACTORY_CLASSNAME1, systemConfig.getSystemFactory(MOCK_SYSTEM_NAME1));
}
origin: org.apache.samza/samza-core

 /**
  * Gets the system-wide defaults for streams.
  *
  * @param systemName the name of the system for which the defaults will be returned.
  * @return a subset of the config with the system prefix removed.
  */
 public Config getDefaultStreamProperties(String systemName) {
  return subset(String.format(SYSTEM_DEFAULT_STREAMS_PREFIX_FORMAT, systemName), true);
 }
}
origin: org.apache.samza/samza-core_2.12

/**
 * Get {@link SystemAdmin} instance for given system name.
 *
 * @param systemName System name
 * @return SystemAdmin of the system if it exists, otherwise null.
 */
public SystemAdmin getSystemAdmin(String systemName) {
 return getSystemAdmins().get(systemName);
}
origin: org.apache.samza/samza-core_2.10

public SystemAdmins(Config config) {
 JavaSystemConfig systemConfig = new JavaSystemConfig(config);
 this.systemAdminMap = systemConfig.getSystemAdmins();
}
origin: org.apache.samza/samza-core_2.12

/**
 * get the SystemConsumers for the stores
 */
private HashMap<String, SystemConsumer> getStoreConsumers() {
 HashMap<String, SystemConsumer> storeConsumers = new HashMap<>();
 Map<String, SystemFactory> systemFactories = new JavaSystemConfig(jobConfig).getSystemFactories();
 for (Entry<String, SystemStream> entry : changeLogSystemStreams.entrySet()) {
  String storeSystem = entry.getValue().getSystem();
  if (!systemFactories.containsKey(storeSystem)) {
   throw new SamzaException("Changelog system " + storeSystem + " for store " + entry.getKey() + " does not exist in the config.");
  }
  storeConsumers.put(entry.getKey(), systemFactories.get(storeSystem).getConsumer(storeSystem, jobConfig, new MetricsRegistryMap()));
 }
 return storeConsumers;
}
origin: org.apache.samza/samza-core_2.12

/**
 * Get {@link SystemFactory} instances for all the systems defined in this config.
 *
 * @return a map from system name to {@link SystemFactory}
 */
public Map<String, SystemFactory> getSystemFactories() {
 Map<String, SystemFactory> systemFactories = getSystemNames().stream().collect(Collectors.toMap(
  systemName -> systemName,
  systemName -> {
   String systemFactoryClassName = getSystemFactory(systemName);
   if (systemFactoryClassName == null) {
    throw new SamzaException(
      String.format("A stream uses system %s, which is missing from the configuration.", systemName));
   }
   return Util.getObj(systemFactoryClassName, SystemFactory.class);
  }));
 return systemFactories;
}
org.apache.samza.configJavaSystemConfig

Javadoc

a java version of the system config

Most used methods

  • <init>
  • getSystemFactory
  • getSystemNames
    Get a list of system names.
  • get
  • getSystemAdmin
    Get SystemAdmin instance for given system name.
  • getSystemAdmins
    Get SystemAdmin instances for all the systems defined in this config.
  • getSystemFactories
    Get SystemFactory instances for all the systems defined in this config.
  • subset
  • getSystemOffsetDefault
    Get system offset default value. systems.'system'.default.stream.samza.offset.default is the config.

Popular in Java

  • Reactive rest calls using spring rest template
  • getSystemService (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now