当前位置: 首页>>代码示例>>Java>>正文


Java DriverIdentifier类代码示例

本文整理汇总了Java中org.apache.reef.driver.parameters.DriverIdentifier的典型用法代码示例。如果您正苦于以下问题:Java DriverIdentifier类的具体用法?Java DriverIdentifier怎么用?Java DriverIdentifier使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


DriverIdentifier类属于org.apache.reef.driver.parameters包,在下文中一共展示了DriverIdentifier类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: OwnershipCache

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
@Inject
private OwnershipCache(@Parameter(NumTotalBlocks.class) final int numTotalBlocks,
                       @Parameter(TableIdentifier.class) final String tableId,
                       @Parameter(ExecutorIdentifier.class) final String executorId,
                       @Parameter(DriverIdentifier.class) final String driverId,
                       final InjectionFuture<MessageSender> msgSenderFuture) {
  this.blockOwnerArray = new AtomicReferenceArray<>(numTotalBlocks);
  this.tableId = tableId;
  this.localExecutorId = executorId;
  this.driverId = driverId;
  this.msgSenderFuture = msgSenderFuture;

  for (int blockId = 0; blockId < numTotalBlocks; blockId++) {
    this.ownershipLocks.put(blockId, new ReentrantReadWriteLock(true));
  }
}
 
开发者ID:snuspl,项目名称:cruise,代码行数:17,代码来源:OwnershipCache.java

示例2: RemoteAccessOpSender

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
@Inject
private RemoteAccessOpSender(final InjectionFuture<Tables> tablesFuture,
                             @Parameter(ExecutorIdentifier.class) final String executorId,
                             @Parameter(DriverIdentifier.class) final String driverId,
                             @Parameter(SenderQueueSize.class) final int queueSize,
                             @Parameter(NumRemoteOpsSenderThreads.class) final int numSenderThreads,
                             final InjectionFuture<MessageSender> msgSenderFuture,
                             final InjectionFuture<RemoteAccessOpStat> networkUsageStatFuture) {
  this.tablesFuture = tablesFuture;
  this.executorId = executorId;
  this.driverId = driverId;
  this.numSenderThreads = numSenderThreads;
  this.msgSenderFuture = msgSenderFuture;
  this.networkUsageStatFuture = networkUsageStatFuture;
  this.senderThreads = initSenderThreads(numSenderThreads, queueSize);
}
 
开发者ID:snuspl,项目名称:cruise,代码行数:17,代码来源:RemoteAccessOpSender.java

示例3: ExecutorManager

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
@Inject
private ExecutorManager(final CallbackRegistry callbackRegistry,
                        final EvaluatorManager evaluatorManager,
                        final MessageSender msgSender,
                        final NameServer nameServer,
                        final LocalAddressProvider localAddressProvider,
                        final IdentifierFactory identifierFactory,
                        final JVMProcessFactory jvmProcessFactory,
                        @Parameter(ChkpCommitPath.class) final String chkpCommitPath,
                        @Parameter(ChkpTempPath.class) final String chkpTempPath,
                        @Parameter(JVMHeapSlack.class) final double jvmHeapSlack,
                        @Parameter(ETIdentifier.class) final String etIdentifier,
                        @Parameter(DriverIdentifier.class) final String driverIdentifier) {
  this.callbackRegistry = callbackRegistry;
  this.evaluatorManager = evaluatorManager;
  this.msgSender = msgSender;
  this.nameServer = nameServer;
  this.localAddressProvider = localAddressProvider;
  this.identifierFactory = identifierFactory;
  this.etIdentifier = etIdentifier;
  this.driverIdentifier = driverIdentifier;
  this.jvmHeapSlack = jvmHeapSlack;
  this.jvmProcessFactory = jvmProcessFactory;
  this.chkpTempPath = chkpTempPath;
  this.chkpCommitPath = chkpCommitPath;
}
 
开发者ID:snuspl,项目名称:cruise,代码行数:27,代码来源:ExecutorManager.java

示例4: MessageHandlerImpl

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
@Inject
private MessageHandlerImpl(@Parameter(DriverIdentifier.class) final String driverId,
                           final TaskletCustomMsgHandler taskletCustomMsgHandler,
                           final InjectionFuture<TableControlAgent> tableControlAgentFuture,
                           final InjectionFuture<ExecutorManager> executorManagerFuture,
                           final InjectionFuture<TableManager> tableManagerFuture,
                           final InjectionFuture<MigrationManager> migrationManagerFuture,
                           final InjectionFuture<MetricReceiver> metricReceiver,
                           final InjectionFuture<MessageSender> messageSenderFuture,
                           final InjectionFuture<FallbackManager> fallbackManagerFuture,
                           final InjectionFuture<ChkpManagerMaster> chkpManagerMasterFuture) {
  this.driverId = driverId;
  this.taskletCustomMsgHandler = taskletCustomMsgHandler;
  this.metricReceiver = metricReceiver;
  this.tableControlAgentFuture = tableControlAgentFuture;
  this.migrationManagerFuture = migrationManagerFuture;
  this.fallbackManagerFuture = fallbackManagerFuture;
  this.executorManagerFuture = executorManagerFuture;
  this.tableManagerFuture = tableManagerFuture;
  this.messageSenderFuture = messageSenderFuture;
  this.chkpManagerMasterFuture = chkpManagerMasterFuture;
}
 
开发者ID:snuspl,项目名称:cruise,代码行数:23,代码来源:MessageHandlerImpl.java

示例5: CommunicationGroupDriverImpl

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
@Inject
private CommunicationGroupDriverImpl(
    @Parameter(CommGroupNameClass.class) final Class<? extends Name<String>> groupName,
    final ConfigurationSerializer confSerializer,
    @Parameter(GroupCommRunningTaskHandler.class)
        final BroadcastingEventHandler<RunningTask> groupCommRunningTaskHandler,
    @Parameter(GroupCommFailedTaskHandler.class)
        final BroadcastingEventHandler<FailedTask> groupCommFailedTaskHandler,
    @Parameter(GroupCommFailedEvalHandler.class)
        final BroadcastingEventHandler<FailedEvaluator> groupCommFailedEvaluatorHandler,
        final GroupCommMessageHandler groupCommMessageHandler,
    @Parameter(DriverIdentifier.class) final String driverId,
    @Parameter(CommGroupNumTask.class) final int numberOfTasks,
    final TopologyFactory topologyFactory,
    @Parameter(TopologyClass.class) final Class<? extends Topology> topologyClass) {
  super();
  this.groupName = groupName;
  this.driverId = driverId;
  this.confSerializer = confSerializer;
  this.allInitialTasksRunning = new CountingSemaphore(numberOfTasks, getQualifiedName(), topologiesLock);

  registerHandlers(groupCommRunningTaskHandler, groupCommFailedTaskHandler,
      groupCommFailedEvaluatorHandler, groupCommMessageHandler);
  this.topologyFactory = topologyFactory;
  this.topologyClass = topologyClass;
}
 
开发者ID:apache,项目名称:reef,代码行数:27,代码来源:CommunicationGroupDriverImpl.java

示例6: CommunicationGroupDriverFactory

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
@Inject
private CommunicationGroupDriverFactory(
    @Parameter(DriverIdentifier.class) final String driverId,
    @Parameter(GroupCommSenderStage.class) final EStage<GroupCommunicationMessage> senderStage,
    @Parameter(GroupCommRunningTaskHandler.class)
        final BroadcastingEventHandler<RunningTask> groupCommRunningTaskHandler,
    @Parameter(GroupCommFailedTaskHandler.class)
        final BroadcastingEventHandler<FailedTask> groupCommFailedTaskHandler,
    @Parameter(GroupCommFailedEvalHandler.class)
        final BroadcastingEventHandler<FailedEvaluator> groupCommFailedEvaluatorHandler,
    final GroupCommMessageHandler groupCommMessageHandler) {
  injector = Tang.Factory.getTang().newInjector();
  injector.bindVolatileParameter(GroupCommSenderStage.class, senderStage);
  injector.bindVolatileParameter(DriverIdentifier.class, driverId);
  injector.bindVolatileParameter(GroupCommRunningTaskHandler.class, groupCommRunningTaskHandler);
  injector.bindVolatileParameter(GroupCommFailedTaskHandler.class, groupCommFailedTaskHandler);
  injector.bindVolatileParameter(GroupCommFailedEvalHandler.class, groupCommFailedEvaluatorHandler);
  injector.bindVolatileInstance(GroupCommMessageHandler.class, groupCommMessageHandler);
}
 
开发者ID:apache,项目名称:reef,代码行数:20,代码来源:CommunicationGroupDriverFactory.java

示例7: RunningJobImpl

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
@Inject
RunningJobImpl(final RemoteManager remoteManager,
               @Parameter(DriverIdentifier.class) final String driverIdentifier,
               @Parameter(REEFImplementation.DriverRemoteIdentifier.class) final String driverRID,
               @Parameter(JobRunningHandler.class) final EventHandler<RunningJob> runningJobEventHandler,
               @Parameter(JobCompletedHandler.class) final EventHandler<CompletedJob> completedJobEventHandler,
               @Parameter(JobFailedHandler.class) final EventHandler<FailedJob> failedJobEventHandler,
               @Parameter(JobMessageHandler.class) final EventHandler<JobMessage> jobMessageEventHandler,
               final ExceptionCodec exceptionCodec) {

  this.jobId = driverIdentifier;
  this.runningJobEventHandler = runningJobEventHandler;
  this.completedJobEventHandler = completedJobEventHandler;
  this.failedJobEventHandler = failedJobEventHandler;
  this.jobMessageEventHandler = jobMessageEventHandler;
  this.exceptionCodec = exceptionCodec;
  this.jobControlHandler = remoteManager.getHandler(driverRID, JobControlProto.class);

  this.runningJobEventHandler.onNext(this);
  LOG.log(Level.FINE, "Instantiated 'RunningJobImpl'");
}
 
开发者ID:apache,项目名称:reef,代码行数:22,代码来源:RunningJobImpl.java

示例8: setupWorker

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
/**
 * Set up a worker. The mocked message handler for CentComm service pretends the actual messages to be exchanged.
 * This method should be called after {@link #setupDriver(List)}.
 * @param workerId a worker id
 */
private void setupWorker(final String workerId) throws InjectionException, NetworkException {
  final Injector injector = Tang.Factory.getTang().newInjector();
  injector.bindVolatileParameter(ExecutorIdentifier.class, workerId);
  injector.bindVolatileParameter(JobIdentifier.class, JOB_ID);
  injector.bindVolatileParameter(DriverIdentifier.class, DRIVER_ID);

  // mock classes that this test does not use
  injector.bindVolatileInstance(ModelEvaluator.class, mock(ModelEvaluator.class));

  final WorkerSideMsgSender mockedWorkerSideMsgSender = mock(WorkerSideMsgSender.class);
  injector.bindVolatileInstance(WorkerSideMsgSender.class, mockedWorkerSideMsgSender);

  final WorkerGlobalBarrier workerGlobalBarrier = injector.getInstance(WorkerGlobalBarrier.class);
  final TaskletCustomMsgHandler taskletCustomMsgHandler = injector.getInstance(WorkerSideMsgHandler.class);
  final SerializableCodec<WorkerGlobalBarrier.State> codec = new SerializableCodec<>();

  workerIdToWorkerComponents.put(workerId,
      new Tuple3<>(workerGlobalBarrier, mockedWorkerSideMsgSender, taskletCustomMsgHandler));

  doAnswer(invocation -> {
    final WorkerGlobalBarrier.State state = invocation.getArgumentAt(0, WorkerGlobalBarrier.State.class);
    final PSMsg cruiseMsg = PSMsg.newBuilder()
        .setJobId(JOB_ID)
        .setType(cruiseMsgType.SyncMsg)
        .setSyncMsg(
            SyncMsg.newBuilder()
            .setExecutorId(workerId)
            .setSerializedState(ByteBuffer.wrap(codec.encode(state)))
            .build()
        )
        .build();

    LOG.log(Level.INFO, "sending a progress msg from {0}", workerId);
    final MasterSideMsgHandler masterSideMsgHandler = driverComponents.getRight();
    masterSideMsgHandler.onPSMsg(cruiseMsg);
    return null;
  }).when(mockedWorkerSideMsgSender).sendSyncMsg(any(WorkerGlobalBarrier.State.class));
}
 
开发者ID:snuspl,项目名称:cruise,代码行数:44,代码来源:WorkerStateManagerTest.java

示例9: RemoteAccessOpHandler

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
@Inject
private RemoteAccessOpHandler(final InjectionFuture<Tables> tablesFuture,
                              @Parameter(DriverIdentifier.class) final String driverId,
                              @Parameter(ExecutorIdentifier.class) final String executorId,
                              @Parameter(HandlerQueueSize.class) final int queueSize,
                              @Parameter(NumRemoteOpsHandlerThreads.class) final int numHandlerThreads,
                              final InjectionFuture<MessageSender> msgSenderFuture) {
  this.driverId = driverId;
  this.executorId = executorId;
  this.tablesFuture = tablesFuture;
  this.msgSenderFuture = msgSenderFuture;
  this.numHandlerThreads = numHandlerThreads;
  this.handlerThreads = initExecutor(numHandlerThreads, queueSize);
}
 
开发者ID:snuspl,项目名称:cruise,代码行数:15,代码来源:RemoteAccessOpHandler.java

示例10: TaskletCustomMsgSender

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
@Inject
private TaskletCustomMsgSender(@Parameter(TaskletIdentifier.class) final String taskletId,
                               final NetworkConnection<ETMsg> networkConnection,
                               @Parameter(DriverIdentifier.class) final String driverId) {
  this.networkConnection = networkConnection;
  this.taskletId = taskletId;
  this.driverId = driverId;
}
 
开发者ID:snuspl,项目名称:cruise,代码行数:9,代码来源:TaskletCustomMsgSender.java

示例11: MessageSenderImpl

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
@Inject
private MessageSenderImpl(final NetworkConnection<ETMsg> networkConnection,
                          @Parameter(DriverIdentifier.class) final String driverId,
                          @Parameter(ExecutorIdentifier.class) final String executorId) {
  this.networkConnection = networkConnection;
  this.driverId = driverId;
  this.executorId = executorId;
}
 
开发者ID:snuspl,项目名称:cruise,代码行数:9,代码来源:MessageSenderImpl.java

示例12: ETMasterImpl

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
@Inject
private ETMasterImpl(final ExecutorManager executorManager,
                     final TableManager tableManager,
                     final NetworkConnection networkConnection,
                     @Parameter(DriverIdentifier.class) final String driverId) {
  this.executorManager = executorManager;
  this.tableManager = tableManager;
  networkConnection.setup(driverId);
}
 
开发者ID:snuspl,项目名称:cruise,代码行数:10,代码来源:ETMasterImpl.java

示例13: setup

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
@Before
public void setup() throws InjectionException {
  final Configuration driverConf = Tang.Factory.getTang().newConfigurationBuilder()
      .bindNamedParameter(NumTotalBlocks.class, Integer.toString(NUM_TOTAL_BLOCKS))
      .build();

  final Injector driverInjector = Tang.Factory.getTang().newInjector(driverConf);
  final BlockManager blockManager = driverInjector.getInstance(BlockManager.class);
  final Set<String> executorIds = new HashSet<>();
  executorIds.add(TARGET_EXECUTOR_ID); // one executor owns whole blocks
  blockManager.init(executorIds);
  final List<String> blockOwners = blockManager.getOwnershipStatus();

  final Configuration evalConf = Tang.Factory.getTang().newConfigurationBuilder()
      .bindNamedParameter(ExecutorIdentifier.class, TARGET_EXECUTOR_ID)
      .bindNamedParameter(DriverIdentifier.class, DRIVER_ID)
      .build();

  mockMsgSender = mock(MessageSender.class);

  final Injector evalInjector = Tang.Factory.getTang().newInjector(evalConf);
  evalInjector.bindVolatileInstance(MessageSender.class, mockMsgSender);
  remoteAccessOpHandler = evalInjector.getInstance(RemoteAccessOpHandler.class);

  tables = evalInjector.getInstance(Tables.class);
  tables.initTable(buildTableConf(TABLE_ID, NUM_TOTAL_BLOCKS).getConfiguration(), blockOwners);
}
 
开发者ID:snuspl,项目名称:cruise,代码行数:28,代码来源:RemoteAccessOpHandlerTest.java

示例14: NetworkDriverRegister

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
@Inject
private NetworkDriverRegister(final CentCommNetworkSetup centCommNetworkSetup,
                              final IdentifierFactory identifierFactory,
                              @Parameter(DriverIdentifier.class) final String driverIdStr) {
  this.centCommNetworkSetup = centCommNetworkSetup;
  this.driverId = identifierFactory.getNewInstance(driverIdStr);
}
 
开发者ID:snuspl,项目名称:cruise,代码行数:8,代码来源:NetworkDriverRegister.java

示例15: CentCommConfProvider

import org.apache.reef.driver.parameters.DriverIdentifier; //导入依赖的package包/类
/**
 * Constructor for the manager of CentComm Service.
 * This class is instantiated by TANG.
 *
 * @param nameServer a NameServer for NCS, which provides NameServer port
 * @param localAddressProvider a LocalAddressProvider for NCS, which provides NameServer address
 * @param configurationSerializer used for deserializing slave configuration
 * @param serializedSlaveConf serialized slave configuration which should not be instantiated in driver
 * @param driverId driver identifier
 * @throws IOException if there is a problem in deserializing slave configuration
 */
@Inject
private CentCommConfProvider(final NameServer nameServer,
                             final LocalAddressProvider localAddressProvider,
                             final ConfigurationSerializer configurationSerializer,
                             @Parameter(SerializedCentCommSlavesConf.class) final String serializedSlaveConf,
                             @Parameter(DriverIdentifier.class) final String driverId) throws IOException {
  this.nameServer = nameServer;
  this.localAddressProvider = localAddressProvider;
  this.slaveConf = configurationSerializer.fromString(serializedSlaveConf);
  this.driverId = driverId;
}
 
开发者ID:snuspl,项目名称:cruise,代码行数:23,代码来源:CentCommConfProvider.java


注:本文中的org.apache.reef.driver.parameters.DriverIdentifier类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。