Search in sources :

Example 16 with BeforeClass

use of org.junit.BeforeClass in project flink by apache.

the class BackPressureStatsTrackerITCase method setup.

@BeforeClass
public static void setup() {
    testActorSystem = AkkaUtils.createLocalActorSystem(new Configuration());
    networkBufferPool = new NetworkBufferPool(100, 8192, MemoryType.HEAP);
}
Also used : Configuration(org.apache.flink.configuration.Configuration) NetworkBufferPool(org.apache.flink.runtime.io.network.buffer.NetworkBufferPool) BeforeClass(org.junit.BeforeClass)

Example 17 with BeforeClass

use of org.junit.BeforeClass in project flink by apache.

the class JobSubmitTest method setupJobManager.

@BeforeClass
public static void setupJobManager() {
    jmConfig = new Configuration();
    int port = NetUtils.getAvailablePort();
    jmConfig.setString(ConfigConstants.JOB_MANAGER_IPC_ADDRESS_KEY, "localhost");
    jmConfig.setInteger(ConfigConstants.JOB_MANAGER_IPC_PORT_KEY, port);
    scala.Option<Tuple2<String, Object>> listeningAddress = scala.Option.apply(new Tuple2<String, Object>("localhost", port));
    jobManagerSystem = AkkaUtils.createActorSystem(jmConfig, listeningAddress);
    // only start JobManager (no ResourceManager)
    JobManager.startJobManagerActors(jmConfig, jobManagerSystem, TestingUtils.defaultExecutor(), TestingUtils.defaultExecutor(), JobManager.class, MemoryArchivist.class)._1();
    try {
        LeaderRetrievalService lrs = LeaderRetrievalUtils.createLeaderRetrievalService(jmConfig);
        jmGateway = LeaderRetrievalUtils.retrieveLeaderGateway(lrs, jobManagerSystem, timeout);
    } catch (Exception e) {
        fail("Could not retrieve the JobManager gateway. " + e.getMessage());
    }
}
Also used : Configuration(org.apache.flink.configuration.Configuration) Tuple2(scala.Tuple2) LeaderRetrievalService(org.apache.flink.runtime.leaderretrieval.LeaderRetrievalService) JobExecutionException(org.apache.flink.runtime.client.JobExecutionException) IOException(java.io.IOException) BeforeClass(org.junit.BeforeClass)

Example 18 with BeforeClass

use of org.junit.BeforeClass in project flink by apache.

the class SlotManagerTest method setUp.

@BeforeClass
public static void setUp() {
    taskExecutorRegistration = Mockito.mock(TaskExecutorRegistration.class);
    TaskExecutorGateway gateway = Mockito.mock(TaskExecutorGateway.class);
    Mockito.when(taskExecutorRegistration.getTaskExecutorGateway()).thenReturn(gateway);
    Mockito.when(gateway.requestSlot(any(SlotID.class), any(JobID.class), any(AllocationID.class), any(String.class), any(UUID.class), any(Time.class))).thenReturn(new FlinkCompletableFuture<TMSlotRequestReply>());
}
Also used : SlotID(org.apache.flink.runtime.clusterframework.types.SlotID) TMSlotRequestReply(org.apache.flink.runtime.resourcemanager.messages.taskexecutor.TMSlotRequestReply) TaskExecutorRegistration(org.apache.flink.runtime.resourcemanager.registration.TaskExecutorRegistration) AllocationID(org.apache.flink.runtime.clusterframework.types.AllocationID) TaskExecutorGateway(org.apache.flink.runtime.taskexecutor.TaskExecutorGateway) Time(org.apache.flink.api.common.time.Time) UUID(java.util.UUID) JobID(org.apache.flink.api.common.JobID) BeforeClass(org.junit.BeforeClass)

Example 19 with BeforeClass

use of org.junit.BeforeClass in project flink by apache.

the class SimpleRecoveryFailureRateStrategyITBase method setupCluster.

@BeforeClass
public static void setupCluster() {
    Configuration config = new Configuration();
    config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, 2);
    config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, 2);
    config.setString(ConfigConstants.RESTART_STRATEGY, "failure-rate");
    config.setInteger(ConfigConstants.RESTART_STRATEGY_FAILURE_RATE_MAX_FAILURES_PER_INTERVAL, 1);
    config.setString(ConfigConstants.RESTART_STRATEGY_FAILURE_RATE_FAILURE_RATE_INTERVAL, "1 second");
    config.setString(ConfigConstants.RESTART_STRATEGY_FAILURE_RATE_DELAY, "100 ms");
    cluster = new LocalFlinkMiniCluster(config, false);
    cluster.start();
}
Also used : Configuration(org.apache.flink.configuration.Configuration) LocalFlinkMiniCluster(org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster) BeforeClass(org.junit.BeforeClass)

Example 20 with BeforeClass

use of org.junit.BeforeClass in project flink by apache.

the class SimpleRecoveryFixedDelayRestartStrategyITBase method setupCluster.

@BeforeClass
public static void setupCluster() {
    Configuration config = new Configuration();
    config.setInteger(ConfigConstants.LOCAL_NUMBER_TASK_MANAGER, 2);
    config.setInteger(ConfigConstants.TASK_MANAGER_NUM_TASK_SLOTS, 2);
    config.setString(ConfigConstants.RESTART_STRATEGY, "fixed-delay");
    config.setInteger(ConfigConstants.RESTART_STRATEGY_FIXED_DELAY_ATTEMPTS, 1);
    config.setString(ConfigConstants.RESTART_STRATEGY_FIXED_DELAY_DELAY, "100 ms");
    cluster = new LocalFlinkMiniCluster(config, false);
    cluster.start();
}
Also used : Configuration(org.apache.flink.configuration.Configuration) LocalFlinkMiniCluster(org.apache.flink.runtime.minicluster.LocalFlinkMiniCluster) BeforeClass(org.junit.BeforeClass)

Aggregations

BeforeClass (org.junit.BeforeClass)2454 File (java.io.File)331 Configuration (org.apache.hadoop.conf.Configuration)275 Connection (java.sql.Connection)111 IOException (java.io.IOException)109 Properties (java.util.Properties)100 Reader (java.io.Reader)99 SqlSessionFactoryBuilder (org.apache.ibatis.session.SqlSessionFactoryBuilder)98 Provisioning (com.zimbra.cs.account.Provisioning)93 ScriptRunner (org.apache.ibatis.jdbc.ScriptRunner)91 MockProvisioning (com.zimbra.cs.account.MockProvisioning)77 URI (java.net.URI)73 HiveConf (org.apache.hadoop.hive.conf.HiveConf)73 Path (org.apache.hadoop.fs.Path)70 SqlSession (org.apache.ibatis.session.SqlSession)62 HashMap (java.util.HashMap)58 MiniDFSCluster (org.apache.hadoop.hdfs.MiniDFSCluster)58 Injector (com.google.inject.Injector)57 CConfiguration (co.cask.cdap.common.conf.CConfiguration)56 DeploymentInfo (io.undertow.servlet.api.DeploymentInfo)55