/** * 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))); }
/** * 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))); }
/** * 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))); }
/** * 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))); }
/** * 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))); }
/** * 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; }
/** * 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; }
/** * 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; }
/** * 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; }
/** * create one TaskStorageManager for each task. Add all of them to the * List<TaskStorageManager> */ @SuppressWarnings({"unchecked", "rawtypes"}) private void getContainerStorageManagers() { Clock clock = SystemClock.instance(); StreamMetadataCache streamMetadataCache = new StreamMetadataCache(systemAdmins, 5000, clock); // don't worry about prefetching for this; looks like the tool doesn't flush to offset files anyways Map<String, SystemFactory> systemFactories = new JavaSystemConfig(jobConfig).getSystemFactories(); for (ContainerModel containerModel : containers.values()) { ContainerContext containerContext = new ContainerContextImpl(containerModel, new MetricsRegistryMap()); ContainerStorageManager containerStorageManager = new ContainerStorageManager(containerModel, streamMetadataCache, systemAdmins, changeLogSystemStreams, storageEngineFactories, systemFactories, this.getSerdes(), jobConfig, new HashMap<>(), new SamzaContainerMetrics(containerModel.getId(), new MetricsRegistryMap()), JobContextImpl.fromConfigWithDefaults(jobConfig), containerContext, new HashMap<>(), storeBaseDir, storeBaseDir, maxPartitionNumber, new SystemClock()); this.containerStorageManagers.put(containerModel.getId(), containerStorageManager); } } }