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();
}
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);
}
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;
}
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();
}
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();
}
Aggregations