Package org.apache.aurora.scheduler.storage.log.LogManager.StreamManager

Examples of org.apache.aurora.scheduler.storage.log.LogManager.StreamManager.StreamTransaction.commit()


  public void testStreamManagerSuccessiveCommits() throws CodingException {
    control.replay();

    StreamManager streamManager = createNoMessagesStreamManager();
    StreamTransaction streamTransaction = streamManager.startTransaction();
    streamTransaction.commit();

    assertNotSame("Expected a new transaction to be started after a commit",
        streamTransaction, streamManager.startTransaction());
  }
View Full Code Here


  @Test(expected = IllegalStateException.class)
  public void testTransactionDoubleCommit() throws CodingException {
    control.replay();

    StreamTransaction streamTransaction = createNoMessagesStreamManager().startTransaction();
    streamTransaction.commit();
    streamTransaction.commit();
  }

  @Test(expected = IllegalStateException.class)
  public void testTransactionAddAfterCommit() throws CodingException {
View Full Code Here

  public void testTransactionDoubleCommit() throws CodingException {
    control.replay();

    StreamTransaction streamTransaction = createNoMessagesStreamManager().startTransaction();
    streamTransaction.commit();
    streamTransaction.commit();
  }

  @Test(expected = IllegalStateException.class)
  public void testTransactionAddAfterCommit() throws CodingException {
    control.replay();
View Full Code Here

  @Test(expected = IllegalStateException.class)
  public void testTransactionAddAfterCommit() throws CodingException {
    control.replay();

    StreamTransaction streamTransaction = createNoMessagesStreamManager().startTransaction();
    streamTransaction.commit();
    streamTransaction.add(Op.saveFrameworkId(new SaveFrameworkId("don't allow this")));
  }

  private static class LogEntryMatcher implements IArgumentMatcher {
    private final LogEntry expected;
View Full Code Here

    // The next 2 removes should coalesce
    streamTransaction.add(Op.removeTasks(removeTasks2));
    streamTransaction.add(Op.removeTasks(removeTasks3));

    assertEquals(position1, streamTransaction.commit());
  }

  @Test
  public void testTransactionSnapshot() throws CodingException {
    Snapshot snapshot = createSnapshot();
View Full Code Here

    StreamTransaction transaction = createNoMessagesStreamManager().startTransaction();
    transaction.add(saveFrameworkId);
    transaction.add(deleteJob);

    Position position = transaction.commit();
    assertSame(position1, position);
  }

  static class Message {
    private final Amount<Integer, Data> chunkSize;
View Full Code Here

    StreamManager streamManager = createStreamManager(message.chunkSize);
    StreamTransaction transaction = streamManager.startTransaction();
    transaction.add(saveFrameworkId);

    Position position = transaction.commit();
    assertSame(position1, position);
  }

  @Test
  public void testConcurrentWrites() throws Exception {
View Full Code Here

      public void run() {
        StreamTransaction tr2 = streamManager.startTransaction();
        tr2.add(op2);
        try {
          message1Started.await();
          tr2.commit();
        } catch (CodingException | InterruptedException e) {
          throw new RuntimeException(e);
        }
      }
    };
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.