本文整理匯總了Java中org.apache.samza.job.model.ContainerModel.getProcessorId方法的典型用法代碼示例。如果您正苦於以下問題:Java ContainerModel.getProcessorId方法的具體用法?Java ContainerModel.getProcessorId怎麽用?Java ContainerModel.getProcessorId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.apache.samza.job.model.ContainerModel
的用法示例。
在下文中一共展示了ContainerModel.getProcessorId方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getTaskStorageManagers
import org.apache.samza.job.model.ContainerModel; //導入方法依賴的package包/類
/**
* create one TaskStorageManager for each task. Add all of them to the
* List<TaskStorageManager>
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
private void getTaskStorageManagers() {
StreamMetadataCache streamMetadataCache = new StreamMetadataCache(Util.javaMapAsScalaMap(systemAdmins), 5000, SystemClock.instance());
for (ContainerModel containerModel : containers.values()) {
HashMap<String, StorageEngine> taskStores = new HashMap<String, StorageEngine>();
SamzaContainerContext containerContext = new SamzaContainerContext(containerModel.getProcessorId(), jobConfig, containerModel.getTasks()
.keySet(), new MetricsRegistryMap());
for (TaskModel taskModel : containerModel.getTasks().values()) {
HashMap<String, SystemConsumer> storeConsumers = getStoreConsumers();
for (Entry<String, StorageEngineFactory<?, ?>> entry : storageEngineFactories.entrySet()) {
String storeName = entry.getKey();
if (changeLogSystemStreams.containsKey(storeName)) {
SystemStreamPartition changeLogSystemStreamPartition = new SystemStreamPartition(changeLogSystemStreams.get(storeName),
taskModel.getChangelogPartition());
File storePartitionDir = TaskStorageManager.getStorePartitionDir(storeBaseDir, storeName, taskModel.getTaskName());
log.info("Got storage engine directory: " + storePartitionDir);
StorageEngine storageEngine = (entry.getValue()).getStorageEngine(
storeName,
storePartitionDir,
(Serde) new ByteSerde(),
(Serde) new ByteSerde(),
null,
new MetricsRegistryMap(),
changeLogSystemStreamPartition,
containerContext);
taskStores.put(storeName, storageEngine);
}
}
TaskStorageManager taskStorageManager = new TaskStorageManager(
taskModel.getTaskName(),
Util.javaMapAsScalaMap(taskStores),
Util.javaMapAsScalaMap(storeConsumers),
Util.javaMapAsScalaMap(changeLogSystemStreams),
maxPartitionNumber,
streamMetadataCache,
storeBaseDir,
storeBaseDir,
taskModel.getChangelogPartition(),
Util.javaMapAsScalaMap(systemAdmins),
new StorageConfig(jobConfig).getChangeLogDeleteRetentionsInMs(),
new SystemClock());
taskStorageManagers.add(taskStorageManager);
}
}
}