Search in sources :

Example 1 with LocalAlluxioJobCluster

use of alluxio.master.LocalAlluxioJobCluster in project alluxio by Alluxio.

the class JobServiceFaultToleranceShellTest method before.

@Before
public void before() throws Exception {
    mLocalAlluxioCluster = new MultiMasterLocalAlluxioCluster(2);
    mLocalAlluxioCluster.initConfiguration(IntegrationTestUtils.getTestName(getClass().getSimpleName(), mTestName.getMethodName()));
    mLocalAlluxioCluster.start();
    mLocalAlluxioJobCluster = new LocalAlluxioJobCluster();
    mLocalAlluxioJobCluster.start();
    mOutput = new ByteArrayOutputStream();
    System.setOut(new PrintStream(mOutput));
}
Also used : PrintStream(java.io.PrintStream) LocalAlluxioJobCluster(alluxio.master.LocalAlluxioJobCluster) MultiMasterLocalAlluxioCluster(alluxio.master.MultiMasterLocalAlluxioCluster) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Before(org.junit.Before)

Example 2 with LocalAlluxioJobCluster

use of alluxio.master.LocalAlluxioJobCluster in project alluxio by Alluxio.

the class TableMasterJournalIntegrationTest method journalTransformDb.

@Test
public void journalTransformDb() throws Exception {
    LocalAlluxioCluster mCluster = sClusterResource.get();
    TableMaster tableMaster = mCluster.getLocalAlluxioMaster().getMasterProcess().getMaster(TableMaster.class);
    LocalAlluxioJobCluster jobCluster = new LocalAlluxioJobCluster();
    jobCluster.start();
    JobMaster jobMaster = jobCluster.getMaster().getJobMaster();
    genTable(1, 2, true);
    tableMaster.attachDatabase(TestUdbFactory.TYPE, "connect", DB_NAME, DB_NAME, Collections.emptyMap(), false);
    List<String> tables = tableMaster.getAllTables(DB_NAME);
    assertFalse(tables.isEmpty());
    // all partitions are not transformed, so baselayout is the same as layout
    String tableName = tables.get(0);
    assertTrue(tableMaster.getTable(DB_NAME, tableName).getPartitions().stream().allMatch(partition -> partition.getBaseLayout() == partition.getLayout()));
    long jobid = tableMaster.transformTable(DB_NAME, tableName, null);
    assertNotEquals(0, jobid);
    JobTestUtils.waitForJobStatus(jobMaster, jobid, ImmutableSet.of(Status.COMPLETED, Status.CANCELED, Status.FAILED));
    final JobInfo status = jobMaster.getStatus(jobid);
    assertEquals("", status.getErrorMessage());
    assertEquals(Status.COMPLETED, status.getStatus());
    HeartbeatScheduler.execute(HeartbeatContext.MASTER_TABLE_TRANSFORMATION_MONITOR);
    // all partitions are transformed, so baselayout should be different as layout
    assertTrue(tableMaster.getTable(DB_NAME, tableName).getPartitions().stream().allMatch(partition -> partition.getBaseLayout() != partition.getLayout()));
    restartMaster();
    genTable(1, 4, true);
    TableMaster tableMasterRestart = mCluster.getLocalAlluxioMaster().getMasterProcess().getMaster(TableMaster.class);
    Table table = tableMaster.getTable(DB_NAME, tableName);
    // all partitions remain transformed
    assertTrue(tableMaster.getTable(DB_NAME, tableName).getPartitions().stream().allMatch(partition -> partition.getBaseLayout() != partition.getLayout()));
    tableMasterRestart.syncDatabase(DB_NAME);
    // The first two partitions should remain transformed, the new partitions are not transformed
    assertTrue(tableMaster.getTable(DB_NAME, tableName).getPartitions().stream().allMatch(partition -> (partition.getSpec().endsWith("0") || partition.getSpec().endsWith("1")) == (partition.getBaseLayout() != partition.getLayout())));
}
Also used : JobMaster(alluxio.master.job.JobMaster) PrincipalType(alluxio.grpc.table.PrincipalType) TestUdbFactory(alluxio.master.table.TestUdbFactory) TestRule(org.junit.rules.TestRule) Status(alluxio.job.wire.Status) PropertyKey(alluxio.conf.PropertyKey) TableMaster(alluxio.master.table.TableMaster) HeartbeatScheduler(alluxio.heartbeat.HeartbeatScheduler) DatabaseInfo(alluxio.master.table.DatabaseInfo) Constants(alluxio.Constants) Database(alluxio.grpc.table.Database) JobTestUtils(alluxio.job.util.JobTestUtils) Assert.fail(org.junit.Assert.fail) ClassRule(org.junit.ClassRule) Before(org.junit.Before) ImmutableSet(com.google.common.collect.ImmutableSet) HeartbeatContext(alluxio.heartbeat.HeartbeatContext) ManuallyScheduleHeartbeat(alluxio.heartbeat.ManuallyScheduleHeartbeat) ImmutableMap(com.google.common.collect.ImmutableMap) LocalAlluxioClusterResource(alluxio.testutils.LocalAlluxioClusterResource) LocalAlluxioJobCluster(alluxio.master.LocalAlluxioJobCluster) JobMaster(alluxio.master.job.JobMaster) Assert.assertTrue(org.junit.Assert.assertTrue) TestDatabase.genTable(alluxio.master.table.TestDatabase.genTable) Test(org.junit.Test) IOException(java.io.IOException) TestDatabase(alluxio.master.table.TestDatabase) Assert.assertNotEquals(org.junit.Assert.assertNotEquals) List(java.util.List) Rule(org.junit.Rule) Assert.assertFalse(org.junit.Assert.assertFalse) JobInfo(alluxio.job.wire.JobInfo) LocalAlluxioCluster(alluxio.master.LocalAlluxioCluster) Table(alluxio.master.table.Table) Collections(java.util.Collections) Assert.assertEquals(org.junit.Assert.assertEquals) LocalAlluxioJobCluster(alluxio.master.LocalAlluxioJobCluster) TestDatabase.genTable(alluxio.master.table.TestDatabase.genTable) Table(alluxio.master.table.Table) LocalAlluxioCluster(alluxio.master.LocalAlluxioCluster) JobInfo(alluxio.job.wire.JobInfo) TableMaster(alluxio.master.table.TableMaster) Test(org.junit.Test)

Example 3 with LocalAlluxioJobCluster

use of alluxio.master.LocalAlluxioJobCluster in project alluxio by Alluxio.

the class JobMasterHealthCheckClientIntegrationTest method before.

@Before
public final void before() throws Exception {
    mLocalAlluxioJobCluster = new LocalAlluxioJobCluster();
    mLocalAlluxioJobCluster.start();
    InetSocketAddress address = mLocalAlluxioJobCluster.getMaster().getRpcAddress();
    mHealthCheckClient = new JobMasterRpcHealthCheckClient(address, () -> new CountingRetry(1), ServerConfiguration.global());
}
Also used : LocalAlluxioJobCluster(alluxio.master.LocalAlluxioJobCluster) CountingRetry(alluxio.retry.CountingRetry) InetSocketAddress(java.net.InetSocketAddress) JobMasterRpcHealthCheckClient(alluxio.master.job.JobMasterRpcHealthCheckClient) Before(org.junit.Before)

Example 4 with LocalAlluxioJobCluster

use of alluxio.master.LocalAlluxioJobCluster in project alluxio by Alluxio.

the class PinCommandMultipleMediaIntegrationTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception {
    sJobCluster = new LocalAlluxioJobCluster();
    sJobCluster.start();
}
Also used : LocalAlluxioJobCluster(alluxio.master.LocalAlluxioJobCluster) BeforeClass(org.junit.BeforeClass)

Example 5 with LocalAlluxioJobCluster

use of alluxio.master.LocalAlluxioJobCluster in project alluxio by Alluxio.

the class AbstractFileSystemShellTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception {
    sLocalAlluxioCluster = sLocalAlluxioClusterResource.get();
    sLocalAlluxioJobCluster = new LocalAlluxioJobCluster();
    sLocalAlluxioJobCluster.start();
    sFileSystem = sLocalAlluxioCluster.getClient();
    sJobMaster = sLocalAlluxioJobCluster.getMaster().getJobMaster();
    sJobShell = new alluxio.cli.job.JobShell(ServerConfiguration.global());
    sFsShell = new FileSystemShell(ServerConfiguration.global());
}
Also used : LocalAlluxioJobCluster(alluxio.master.LocalAlluxioJobCluster) JobShell(alluxio.cli.job.JobShell) FileSystemShell(alluxio.cli.fs.FileSystemShell) BeforeClass(org.junit.BeforeClass)

Aggregations

LocalAlluxioJobCluster (alluxio.master.LocalAlluxioJobCluster)15 Before (org.junit.Before)10 BeforeClass (org.junit.BeforeClass)5 FileSystemShell (alluxio.cli.fs.FileSystemShell)2 CountingRetry (alluxio.retry.CountingRetry)2 InetSocketAddress (java.net.InetSocketAddress)2 Constants (alluxio.Constants)1 JobShell (alluxio.cli.job.JobShell)1 PropertyKey (alluxio.conf.PropertyKey)1 Database (alluxio.grpc.table.Database)1 PrincipalType (alluxio.grpc.table.PrincipalType)1 HeartbeatContext (alluxio.heartbeat.HeartbeatContext)1 HeartbeatScheduler (alluxio.heartbeat.HeartbeatScheduler)1 ManuallyScheduleHeartbeat (alluxio.heartbeat.ManuallyScheduleHeartbeat)1 JobTestUtils (alluxio.job.util.JobTestUtils)1 JobInfo (alluxio.job.wire.JobInfo)1 Status (alluxio.job.wire.Status)1 LocalAlluxioCluster (alluxio.master.LocalAlluxioCluster)1 MultiMasterLocalAlluxioCluster (alluxio.master.MultiMasterLocalAlluxioCluster)1 JobMaster (alluxio.master.job.JobMaster)1