當前位置: 首頁>>代碼示例>>Java>>正文


Java ContainerModel.getProcessorId方法代碼示例

本文整理匯總了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);
    }
  }
}
 
開發者ID:apache,項目名稱:samza,代碼行數:57,代碼來源:StorageRecovery.java


注:本文中的org.apache.samza.job.model.ContainerModel.getProcessorId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。