Search in sources :

Example 6 with CheckpointOutputStream

use of alluxio.master.journal.checkpoint.CheckpointOutputStream in project alluxio by Alluxio.

the class UfsJournalReaderTest method buildCheckpoint.

/**
 * Builds checkpoint.
 *
 * @param sequenceNumber the sequence number after the checkpoint
 * @return the checkpoint data
 */
private byte[] buildCheckpoint(long sequenceNumber) throws Exception {
    byte[] bytes = CommonUtils.randomAlphaNumString(10).getBytes();
    try (UfsJournalCheckpointWriter writer = UfsJournalCheckpointWriter.create(mJournal, sequenceNumber)) {
        CheckpointOutputStream stream = new CheckpointOutputStream(writer, CheckpointType.JOURNAL_ENTRY);
        stream.write(bytes);
    }
    return bytes;
}
Also used : CheckpointOutputStream(alluxio.master.journal.checkpoint.CheckpointOutputStream)

Aggregations

CheckpointOutputStream (alluxio.master.journal.checkpoint.CheckpointOutputStream)6 CheckpointInputStream (alluxio.master.journal.checkpoint.CheckpointInputStream)1 Checkpointed (alluxio.master.journal.checkpoint.Checkpointed)1 JournalEntry (alluxio.proto.journal.Journal.JournalEntry)1 OutputChunked (com.esotericsoftware.kryo.io.OutputChunked)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1 Test (org.junit.Test)1 RocksDBException (org.rocksdb.RocksDBException)1