Search in sources :

Example 6 with GSFileSystemOptions

use of org.apache.flink.fs.gs.GSFileSystemOptions in project flink by apache.

the class GSRecoverableWriterCommitterTest method before.

@Before
public void before() {
    Configuration flinkConfig = new Configuration();
    if (temporaryBucketName != null) {
        flinkConfig.set(GSFileSystemOptions.WRITER_TEMPORARY_BUCKET_NAME, temporaryBucketName);
    }
    options = new GSFileSystemOptions(flinkConfig);
    random = new Random();
    random.setSeed(TestUtils.RANDOM_SEED);
    blobStorage = new MockBlobStorage();
    blobIdentifier = new GSBlobIdentifier("foo", "bar");
    expectedBytes = new ByteArrayOutputStream();
}
Also used : Configuration(org.apache.flink.configuration.Configuration) Random(java.util.Random) GSBlobIdentifier(org.apache.flink.fs.gs.storage.GSBlobIdentifier) MockBlobStorage(org.apache.flink.fs.gs.storage.MockBlobStorage) ByteArrayOutputStream(java.io.ByteArrayOutputStream) GSFileSystemOptions(org.apache.flink.fs.gs.GSFileSystemOptions) Before(org.junit.Before)

Example 7 with GSFileSystemOptions

use of org.apache.flink.fs.gs.GSFileSystemOptions in project flink by apache.

the class GSRecoverableWriterTest method before.

@Before
public void before() {
    MockBlobStorage storage = new MockBlobStorage();
    blobIdentifier = new GSBlobIdentifier("foo", "bar");
    Configuration flinkConfig = new Configuration();
    options = new GSFileSystemOptions(flinkConfig);
    writer = new GSRecoverableWriter(storage, options);
    componentObjectIds = new ArrayList<UUID>();
    for (int i = 0; i < componentCount; i++) {
        componentObjectIds.add(UUID.randomUUID());
    }
    resumeRecoverable = new GSResumeRecoverable(blobIdentifier, componentObjectIds, position, closed);
    commitRecoverable = new GSCommitRecoverable(blobIdentifier, componentObjectIds);
}
Also used : Configuration(org.apache.flink.configuration.Configuration) GSBlobIdentifier(org.apache.flink.fs.gs.storage.GSBlobIdentifier) MockBlobStorage(org.apache.flink.fs.gs.storage.MockBlobStorage) UUID(java.util.UUID) GSFileSystemOptions(org.apache.flink.fs.gs.GSFileSystemOptions) Before(org.junit.Before)

Example 8 with GSFileSystemOptions

use of org.apache.flink.fs.gs.GSFileSystemOptions in project flink by apache.

the class BlobUtilsTest method shouldProperlyConstructTemporaryBlobIdentifierWithTemporaryBucket.

@Test
public void shouldProperlyConstructTemporaryBlobIdentifierWithTemporaryBucket() {
    Configuration flinkConfig = new Configuration();
    flinkConfig.set(GSFileSystemOptions.WRITER_TEMPORARY_BUCKET_NAME, "temp");
    GSFileSystemOptions options = new GSFileSystemOptions(flinkConfig);
    GSBlobIdentifier identifier = new GSBlobIdentifier("foo", "bar");
    UUID temporaryObjectId = UUID.fromString("f09c43e5-ea49-4537-a406-0586f8f09d47");
    GSBlobIdentifier temporaryBlobIdentifier = BlobUtils.getTemporaryBlobIdentifier(identifier, temporaryObjectId, options);
    assertEquals("temp", temporaryBlobIdentifier.bucketName);
    assertEquals(".inprogress/foo/bar/f09c43e5-ea49-4537-a406-0586f8f09d47", temporaryBlobIdentifier.objectName);
}
Also used : Configuration(org.apache.flink.configuration.Configuration) GSBlobIdentifier(org.apache.flink.fs.gs.storage.GSBlobIdentifier) UUID(java.util.UUID) GSFileSystemOptions(org.apache.flink.fs.gs.GSFileSystemOptions) Test(org.junit.Test)

Aggregations

Configuration (org.apache.flink.configuration.Configuration)8 GSFileSystemOptions (org.apache.flink.fs.gs.GSFileSystemOptions)8 GSBlobIdentifier (org.apache.flink.fs.gs.storage.GSBlobIdentifier)8 Test (org.junit.Test)5 UUID (java.util.UUID)4 MockBlobStorage (org.apache.flink.fs.gs.storage.MockBlobStorage)3 Before (org.junit.Before)3 Random (java.util.Random)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1