Package net.sf.katta.operation.master.MasterOperation

Examples of net.sf.katta.operation.master.MasterOperation.ExecutionInstruction


  @Test(timeout = 10000)
  public void testOperationLocks_CancelLockedOperation() throws Exception {
    final MasterOperation leaderOperation1 = mock(MasterOperation.class);
    final MasterOperation leaderOperation2 = mock(MasterOperation.class);
    ExecutionInstruction lockInstruction = MasterOperation.ExecutionInstruction.CANCEL;

    runLockSituation(leaderOperation1, leaderOperation2, lockInstruction);
    verify(leaderOperation2, times(0)).execute(_context, EMPTY_LIST);
  }
View Full Code Here


  @Test(timeout = 10000)
  public void testOperationLocks_SuspendLockedTask() throws Exception {
    final MasterOperation leaderOperation1 = mock(MasterOperation.class);
    final MasterOperation leaderOperation2 = mock(MasterOperation.class);

    ExecutionInstruction lockInstruction = MasterOperation.ExecutionInstruction.ADD_TO_QUEUE_TAIL;
    runLockSituation(leaderOperation1, leaderOperation2, lockInstruction);
    verify(leaderOperation2, times(0)).execute(_context, EMPTY_LIST);
    verify(_queue, times(1)).add(leaderOperation2);
  }
View Full Code Here

          // global check operation ?
          MasterOperation operation = _queue.peek();
          List<OperationId> nodeOperationIds = null;
          try {
            List<MasterOperation> runningOperations = _registry.getRunningOperations();
            ExecutionInstruction instruction = operation.getExecutionInstruction(runningOperations);
            nodeOperationIds = executeOperation(operation, instruction, runningOperations);
          } catch (Exception e) {
            ExceptionUtil.rethrowInterruptedException(e);
            LOG.error("failed to execute " + operation, e);
          }
View Full Code Here

TOP

Related Classes of net.sf.katta.operation.master.MasterOperation.ExecutionInstruction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.