Search in sources :

Example 1 with BlobStoreService

use of org.apache.flink.runtime.blob.BlobStoreService in project flink by apache.

the class HighAvailabilityServicesUtils method createZooKeeperHaServices.

private static HighAvailabilityServices createZooKeeperHaServices(Configuration configuration, Executor executor, FatalErrorHandler fatalErrorHandler) throws Exception {
    final boolean useOldHaServices = configuration.get(HighAvailabilityOptions.USE_OLD_HA_SERVICES);
    BlobStoreService blobStoreService = BlobUtils.createBlobStoreFromConfig(configuration);
    final CuratorFrameworkWithUnhandledErrorListener curatorFrameworkWrapper = ZooKeeperUtils.startCuratorFramework(configuration, fatalErrorHandler);
    if (useOldHaServices) {
        return new ZooKeeperHaServices(curatorFrameworkWrapper, executor, configuration, blobStoreService);
    } else {
        return new ZooKeeperMultipleComponentLeaderElectionHaServices(curatorFrameworkWrapper, configuration, executor, blobStoreService, fatalErrorHandler);
    }
}
Also used : ZooKeeperHaServices(org.apache.flink.runtime.highavailability.zookeeper.ZooKeeperHaServices) CuratorFrameworkWithUnhandledErrorListener(org.apache.flink.runtime.highavailability.zookeeper.CuratorFrameworkWithUnhandledErrorListener) ZooKeeperMultipleComponentLeaderElectionHaServices(org.apache.flink.runtime.highavailability.zookeeper.ZooKeeperMultipleComponentLeaderElectionHaServices) BlobStoreService(org.apache.flink.runtime.blob.BlobStoreService)

Example 2 with BlobStoreService

use of org.apache.flink.runtime.blob.BlobStoreService in project flink by apache.

the class HDFSTest method testBlobCacheCorruptedFile.

/**
 * Tests that with {@link HighAvailabilityMode#ZOOKEEPER} distributed corrupted JARs are
 * recognised during the download via a BLOB cache.
 */
@Test
public void testBlobCacheCorruptedFile() throws Exception {
    org.apache.flink.configuration.Configuration config = new org.apache.flink.configuration.Configuration();
    config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
    config.setString(BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath());
    config.setString(HighAvailabilityOptions.HA_STORAGE_PATH, hdfsURI);
    BlobStoreService blobStoreService = BlobUtils.createBlobStoreFromConfig(config);
    try {
        BlobCacheCorruptionTest.testGetFailsFromCorruptFile(new JobID(), config, blobStoreService, temporaryFolder.newFolder());
    } finally {
        blobStoreService.closeAndCleanupAllData();
    }
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) BlobStoreService(org.apache.flink.runtime.blob.BlobStoreService) JobID(org.apache.flink.api.common.JobID) BlobServerCorruptionTest(org.apache.flink.runtime.blob.BlobServerCorruptionTest) BlobCacheCorruptionTest(org.apache.flink.runtime.blob.BlobCacheCorruptionTest) BlobServerRecoveryTest(org.apache.flink.runtime.blob.BlobServerRecoveryTest) Test(org.junit.Test) BlobCacheRecoveryTest(org.apache.flink.runtime.blob.BlobCacheRecoveryTest)

Example 3 with BlobStoreService

use of org.apache.flink.runtime.blob.BlobStoreService in project flink by apache.

the class HDFSTest method testBlobServerRecovery.

/**
 * Tests that with {@link HighAvailabilityMode#ZOOKEEPER} distributed JARs are recoverable from
 * any participating BlobServer when talking to the {@link
 * org.apache.flink.runtime.blob.BlobServer} directly.
 */
@Test
public void testBlobServerRecovery() throws Exception {
    org.apache.flink.configuration.Configuration config = new org.apache.flink.configuration.Configuration();
    config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
    config.setString(BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath());
    config.setString(HighAvailabilityOptions.HA_STORAGE_PATH, hdfsURI);
    BlobStoreService blobStoreService = BlobUtils.createBlobStoreFromConfig(config);
    try {
        BlobServerRecoveryTest.testBlobServerRecovery(config, blobStoreService, temporaryFolder.newFolder());
    } finally {
        blobStoreService.closeAndCleanupAllData();
    }
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) BlobStoreService(org.apache.flink.runtime.blob.BlobStoreService) BlobServerCorruptionTest(org.apache.flink.runtime.blob.BlobServerCorruptionTest) BlobCacheCorruptionTest(org.apache.flink.runtime.blob.BlobCacheCorruptionTest) BlobServerRecoveryTest(org.apache.flink.runtime.blob.BlobServerRecoveryTest) Test(org.junit.Test) BlobCacheRecoveryTest(org.apache.flink.runtime.blob.BlobCacheRecoveryTest)

Example 4 with BlobStoreService

use of org.apache.flink.runtime.blob.BlobStoreService in project flink by apache.

the class HDFSTest method testBlobCacheRecovery.

/**
 * Tests that with {@link HighAvailabilityMode#ZOOKEEPER} distributed JARs are recoverable from
 * any participating BlobServer when uploaded via a BLOB cache.
 */
@Test
public void testBlobCacheRecovery() throws Exception {
    org.apache.flink.configuration.Configuration config = new org.apache.flink.configuration.Configuration();
    config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
    config.setString(BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath());
    config.setString(HighAvailabilityOptions.HA_STORAGE_PATH, hdfsURI);
    BlobStoreService blobStoreService = BlobUtils.createBlobStoreFromConfig(config);
    try {
        BlobCacheRecoveryTest.testBlobCacheRecovery(config, blobStoreService, temporaryFolder.newFolder());
    } finally {
        blobStoreService.closeAndCleanupAllData();
    }
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) BlobStoreService(org.apache.flink.runtime.blob.BlobStoreService) BlobServerCorruptionTest(org.apache.flink.runtime.blob.BlobServerCorruptionTest) BlobCacheCorruptionTest(org.apache.flink.runtime.blob.BlobCacheCorruptionTest) BlobServerRecoveryTest(org.apache.flink.runtime.blob.BlobServerRecoveryTest) Test(org.junit.Test) BlobCacheRecoveryTest(org.apache.flink.runtime.blob.BlobCacheRecoveryTest)

Example 5 with BlobStoreService

use of org.apache.flink.runtime.blob.BlobStoreService in project flink by apache.

the class HDFSTest method testBlobServerCorruptedFile.

/**
 * Tests that with {@link HighAvailabilityMode#ZOOKEEPER} distributed corrupted JARs are
 * recognised during the download via a {@link org.apache.flink.runtime.blob.BlobServer}.
 */
@Test
public void testBlobServerCorruptedFile() throws Exception {
    org.apache.flink.configuration.Configuration config = new org.apache.flink.configuration.Configuration();
    config.setString(HighAvailabilityOptions.HA_MODE, "ZOOKEEPER");
    config.setString(BlobServerOptions.STORAGE_DIRECTORY, temporaryFolder.newFolder().getAbsolutePath());
    config.setString(HighAvailabilityOptions.HA_STORAGE_PATH, hdfsURI);
    BlobStoreService blobStoreService = BlobUtils.createBlobStoreFromConfig(config);
    try {
        BlobServerCorruptionTest.testGetFailsFromCorruptFile(config, blobStoreService, temporaryFolder.newFolder());
    } finally {
        blobStoreService.closeAndCleanupAllData();
    }
}
Also used : Configuration(org.apache.hadoop.conf.Configuration) BlobStoreService(org.apache.flink.runtime.blob.BlobStoreService) BlobServerCorruptionTest(org.apache.flink.runtime.blob.BlobServerCorruptionTest) BlobCacheCorruptionTest(org.apache.flink.runtime.blob.BlobCacheCorruptionTest) BlobServerRecoveryTest(org.apache.flink.runtime.blob.BlobServerRecoveryTest) Test(org.junit.Test) BlobCacheRecoveryTest(org.apache.flink.runtime.blob.BlobCacheRecoveryTest)

Aggregations

BlobStoreService (org.apache.flink.runtime.blob.BlobStoreService)6 Test (org.junit.Test)5 BlobCacheCorruptionTest (org.apache.flink.runtime.blob.BlobCacheCorruptionTest)4 BlobCacheRecoveryTest (org.apache.flink.runtime.blob.BlobCacheRecoveryTest)4 BlobServerCorruptionTest (org.apache.flink.runtime.blob.BlobServerCorruptionTest)4 BlobServerRecoveryTest (org.apache.flink.runtime.blob.BlobServerRecoveryTest)4 Configuration (org.apache.hadoop.conf.Configuration)4 JobID (org.apache.flink.api.common.JobID)2 File (java.io.File)1 FileInputStream (java.io.FileInputStream)1 InetSocketAddress (java.net.InetSocketAddress)1 ArrayList (java.util.ArrayList)1 Random (java.util.Random)1 ExecutorService (java.util.concurrent.ExecutorService)1 Configuration (org.apache.flink.configuration.Configuration)1 BlobServer (org.apache.flink.runtime.blob.BlobServer)1 PermanentBlobCache (org.apache.flink.runtime.blob.PermanentBlobCache)1 PermanentBlobKey (org.apache.flink.runtime.blob.PermanentBlobKey)1 CuratorFrameworkWithUnhandledErrorListener (org.apache.flink.runtime.highavailability.zookeeper.CuratorFrameworkWithUnhandledErrorListener)1 ZooKeeperHaServices (org.apache.flink.runtime.highavailability.zookeeper.ZooKeeperHaServices)1