Search in sources :

Example 16 with CheckpointStorageLocationReference

use of org.apache.flink.runtime.state.CheckpointStorageLocationReference in project flink by apache.

the class FsStorageLocationReferenceTest method testDecodingGarbage.

@Test(expected = IllegalArgumentException.class)
public void testDecodingGarbage() {
    final byte[] bytes = new byte[] { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C };
    decodePathFromReference(new CheckpointStorageLocationReference(bytes));
}
Also used : CheckpointStorageLocationReference(org.apache.flink.runtime.state.CheckpointStorageLocationReference) Test(org.junit.Test)

Example 17 with CheckpointStorageLocationReference

use of org.apache.flink.runtime.state.CheckpointStorageLocationReference in project flink by apache.

the class FsStorageLocationReferenceTest method testEncodeAndDecode.

@Test
public void testEncodeAndDecode() throws Exception {
    final Path path = randomPath(new Random());
    try {
        CheckpointStorageLocationReference ref = encodePathAsReference(path);
        Path decoded = decodePathFromReference(ref);
        assertEquals(path, decoded);
    } catch (Exception | Error e) {
        // if something goes wrong, help by printing the problematic path
        log.error("ERROR FOR PATH " + path);
        throw e;
    }
}
Also used : Path(org.apache.flink.core.fs.Path) Random(java.util.Random) CheckpointStorageLocationReference(org.apache.flink.runtime.state.CheckpointStorageLocationReference) Test(org.junit.Test)

Example 18 with CheckpointStorageLocationReference

use of org.apache.flink.runtime.state.CheckpointStorageLocationReference in project flink by apache.

the class CheckpointSerializationTest method testSuspendingCheckpointBarrierSerialization.

@Test
public void testSuspendingCheckpointBarrierSerialization() throws Exception {
    CheckpointOptions suspendSavepointToSerialize = new CheckpointOptions(SavepointType.suspend(SavepointFormatType.CANONICAL), new CheckpointStorageLocationReference(STORAGE_LOCATION_REF));
    testCheckpointBarrierSerialization(suspendSavepointToSerialize);
}
Also used : CheckpointOptions(org.apache.flink.runtime.checkpoint.CheckpointOptions) CheckpointStorageLocationReference(org.apache.flink.runtime.state.CheckpointStorageLocationReference) Test(org.junit.Test)

Example 19 with CheckpointStorageLocationReference

use of org.apache.flink.runtime.state.CheckpointStorageLocationReference in project flink by apache.

the class CheckpointSerializationTest method testSavepointBarrierSerialization.

@Test
public void testSavepointBarrierSerialization() throws Exception {
    CheckpointOptions savepointToSerialize = new CheckpointOptions(SavepointType.savepoint(SavepointFormatType.CANONICAL), new CheckpointStorageLocationReference(STORAGE_LOCATION_REF));
    testCheckpointBarrierSerialization(savepointToSerialize);
}
Also used : CheckpointOptions(org.apache.flink.runtime.checkpoint.CheckpointOptions) CheckpointStorageLocationReference(org.apache.flink.runtime.state.CheckpointStorageLocationReference) Test(org.junit.Test)

Aggregations

CheckpointStorageLocationReference (org.apache.flink.runtime.state.CheckpointStorageLocationReference)19 Test (org.junit.Test)16 CheckpointOptions (org.apache.flink.runtime.checkpoint.CheckpointOptions)12 CheckpointBarrier (org.apache.flink.runtime.io.network.api.CheckpointBarrier)4 Random (java.util.Random)2 Path (org.apache.flink.core.fs.Path)2 CheckpointMetaData (org.apache.flink.runtime.checkpoint.CheckpointMetaData)2 RecordingChannelStateWriter (org.apache.flink.runtime.checkpoint.channel.RecordingChannelStateWriter)2 Buffer (org.apache.flink.runtime.io.network.buffer.Buffer)2 BufferBuilderTestUtils.createEventBufferConsumer (org.apache.flink.runtime.io.network.buffer.BufferBuilderTestUtils.createEventBufferConsumer)2 BufferBuilderTestUtils.createFilledFinishedBufferConsumer (org.apache.flink.runtime.io.network.buffer.BufferBuilderTestUtils.createFilledFinishedBufferConsumer)2 BufferBuilderTestUtils.createFilledUnfinishedBufferConsumer (org.apache.flink.runtime.io.network.buffer.BufferBuilderTestUtils.createFilledUnfinishedBufferConsumer)2 BufferConsumer (org.apache.flink.runtime.io.network.buffer.BufferConsumer)2 IOException (java.io.IOException)1 JobID (org.apache.flink.api.common.JobID)1 DuplicatingFileSystem (org.apache.flink.core.fs.DuplicatingFileSystem)1 FileSystem (org.apache.flink.core.fs.FileSystem)1 LocalFileSystem (org.apache.flink.core.fs.local.LocalFileSystem)1 CheckpointException (org.apache.flink.runtime.checkpoint.CheckpointException)1 SnapshotType (org.apache.flink.runtime.checkpoint.SnapshotType)1