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

Examples of org.apache.aurora.scheduler.storage.log.LogManager.StreamManager


  private StreamManager createNoMessagesStreamManager() {
    return createStreamManager(NO_FRAMES_EVER_SIZE);
  }

  private StreamManager createStreamManager(Amount<Integer, Data> maxEntrySize) {
    return new StreamManager(stream, false, maxEntrySize);
  }
View Full Code Here


  @Test
  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

    Message message = frame(createLogEntry(saveFrameworkId));
    expectFrames(position1, message);

    control.replay();

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

    Position position = transaction.commit();
    assertSame(position1, position);
  }
View Full Code Here

          throws InvalidPositionException, StreamAccessException {
        throw new UnsupportedOperationException();
      }
    };

    final StreamManager streamManager = new StreamManager(mockStream, false, message1.chunkSize);
    StreamTransaction tr1 = streamManager.startTransaction();
    tr1.add(op1);

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

    Closure<LogEntry> reader = createMock(new Clazz<Closure<LogEntry>>() { });
    reader.execute(snapshotLogEntry);

    control.replay();

    StreamManager streamManager = new StreamManager(stream, true, NO_FRAMES_EVER_SIZE);
    streamManager.snapshot(snapshot);
    streamManager.readFromBeginning(reader);
  }
View Full Code Here

TOP

Related Classes of org.apache.aurora.scheduler.storage.log.LogManager.StreamManager

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.