Search in sources :

Example 6 with LocalAlluxioJobCluster

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

the class FileSystemUtilsIntegrationTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception {
    sJobCluster = new LocalAlluxioJobCluster();
    sJobCluster.start();
    sFileSystem = sLocalAlluxioClusterResource.get().getClient();
    sWriteBoth = CreateFilePOptions.newBuilder().setWriteType(WritePType.CACHE_THROUGH).setRecursive(true).build();
}
Also used : LocalAlluxioJobCluster(alluxio.master.LocalAlluxioJobCluster) BeforeClass(org.junit.BeforeClass)

Example 7 with LocalAlluxioJobCluster

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

the class TableIntegrationTest method beforeClass.

@BeforeClass
public static void beforeClass() throws Exception {
    sHmsAddress = sHms.getContainerIpAddress();
    sHmsPort = sHms.getMappedPort(9083);
    File dbDir = new File(WAREHOUSE_DIR, DB_NAME + ".db");
    dbDir.mkdirs();
    // write data files for the tables, to avoid the insert statement, which is slow.
    // write data files for table: test_table
    String base = dbDir.getAbsolutePath() + "/" + TEST_TABLE + "/";
    new File(base).mkdirs();
    PrintWriter writer = new PrintWriter(base + "data.csv");
    writer.println("1,11,111,1.1,1111,11111");
    writer.println("2,22,222,2.2,2222,22222");
    writer.close();
    // write data files for table: test_table_part
    base = dbDir.getAbsolutePath() + "/" + TEST_TABLE_PART + "/partitionint6=11111/";
    new File(base).mkdirs();
    writer = new PrintWriter(base + "data.csv");
    writer.println("1,11,111,1.1,1111");
    writer.close();
    base = dbDir.getAbsolutePath() + "/" + TEST_TABLE_PART + "/partitionint6=22222/";
    new File(base).mkdirs();
    writer = new PrintWriter(base + "data.csv");
    writer.println("2,22,222,2.2,2222");
    writer.close();
    // write data files for table: test_table_rename
    base = dbDir.getAbsolutePath() + "/" + TEST_TABLE_RENAME + "/";
    new File(base).mkdirs();
    writer = new PrintWriter(base + "data.csv");
    writer.println("1,11,111,1.1,1111,11111");
    writer.println("2,22,222,2.2,2222,22222");
    writer.close();
    String[] lines = { String.format("CREATE DATABASE %s; USE %s;", DB_NAME, DB_NAME), String.format("CREATE EXTERNAL TABLE %s(`int1` int, `long2` bigint, `string3` string, " + "`float4` float, " + "`long5` bigint, `partitionint6` int) LOCATION 'file://%s';", TEST_TABLE, dbDir.getAbsolutePath() + "/" + TEST_TABLE), String.format("MSCK REPAIR TABLE %s;", TEST_TABLE), String.format("CREATE EXTERNAL TABLE %s(`int1` int, `long2` bigint, `string3` string, " + "`float4` " + "float, `long5` bigint) PARTITIONED BY (partitionint6 INT) LOCATION 'file://%s';", TEST_TABLE_PART, dbDir.getAbsolutePath() + "/" + TEST_TABLE_PART), String.format("MSCK REPAIR TABLE %s;", TEST_TABLE_PART), String.format("CREATE EXTERNAL TABLE %s(`int1` int, `long2` bigint, `string3` string, " + "`float4` float, " + "`long5` bigint, `partitionint6` int) LOCATION 'file://%s';", TEST_TABLE_RENAME, dbDir.getAbsolutePath() + "/" + TEST_TABLE_RENAME), // this database has a table which cannot be mounted.
    String.format("CREATE DATABASE %s; USE %s;", DB_NAME_ERRORS, DB_NAME_ERRORS), String.format("CREATE EXTERNAL TABLE %s(`int1` int, `long2` bigint, `string3` string, " + "`float4` float, " + "`long5` bigint, `partitionint6` int) LOCATION 'file://%s';", TEST_TABLE, dbDir.getAbsolutePath() + "/" + TEST_TABLE), String.format("MSCK REPAIR TABLE %s;", TEST_TABLE), String.format("CREATE EXTERNAL TABLE %s(`int1` int) LOCATION 'file:///does/not/exist';", TEST_TABLE_ERROR) };
    execBeeline(Arrays.asList(lines));
    sLocalAlluxioJobCluster = new LocalAlluxioJobCluster();
    sLocalAlluxioJobCluster.start();
    sTableMaster = sLocalAlluxioClusterResource.get().getLocalAlluxioMaster().getMasterProcess().getMaster(TableMaster.class);
    sTableMaster.attachDatabase("hive", "thrift://" + sHmsAddress + ":" + sHmsPort, DB_NAME, DB_NAME, Collections.emptyMap(), false);
}
Also used : LocalAlluxioJobCluster(alluxio.master.LocalAlluxioJobCluster) File(java.io.File) MountableFile(org.testcontainers.utility.MountableFile) PrintWriter(java.io.PrintWriter) BeforeClass(org.junit.BeforeClass)

Example 8 with LocalAlluxioJobCluster

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

the class JobMasterClientRestApiTest method before.

@Before
public void before() throws Exception {
    mJobCluster = new LocalAlluxioJobCluster();
    mJobCluster.start();
    mJobMaster = mJobCluster.getMaster().getJobMaster();
    mHostname = mJobCluster.getHostname();
    mPort = mJobCluster.getMaster().getWebAddress().getPort();
    mServicePrefix = ServiceConstants.MASTER_SERVICE_PREFIX;
}
Also used : LocalAlluxioJobCluster(alluxio.master.LocalAlluxioJobCluster) Before(org.junit.Before)

Example 9 with LocalAlluxioJobCluster

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

the class JobMasterIntegrationTest method before.

@Before
public void before() throws Exception {
    mLocalAlluxioJobCluster = new LocalAlluxioJobCluster();
    mLocalAlluxioJobCluster.start();
    mJobMaster = mLocalAlluxioJobCluster.getMaster().getJobMaster();
    mJobWorker = mLocalAlluxioJobCluster.getWorker();
}
Also used : LocalAlluxioJobCluster(alluxio.master.LocalAlluxioJobCluster) Before(org.junit.Before)

Example 10 with LocalAlluxioJobCluster

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

the class JobIntegrationTest method before.

@Before
public void before() throws Exception {
    mLocalAlluxioJobCluster = new LocalAlluxioJobCluster();
    mLocalAlluxioJobCluster.start();
    mJobMaster = mLocalAlluxioJobCluster.getMaster().getJobMaster();
    mFsContext = FileSystemContext.create(ServerConfiguration.global());
    mFileSystem = mLocalAlluxioClusterResource.get().getClient();
}
Also used : LocalAlluxioJobCluster(alluxio.master.LocalAlluxioJobCluster) Before(org.junit.Before)

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