use of alluxio.table.common.transform.TransformPlan in project alluxio by Alluxio.
the class AlluxioCatalogTest method getTransformPlanOutputUri.
@Test
public void getTransformPlanOutputUri() throws Exception {
String dbName = "testdb";
TestDatabase.genTable(1, 1, false);
mCatalog.attachDatabase(NoopJournalContext.INSTANCE, TestUdbFactory.TYPE, "connect_URI", TestDatabase.TEST_UDB_NAME, dbName, Collections.emptyMap(), false);
String tableName = TestDatabase.getTableName(0);
Table table = mCatalog.getTable(dbName, tableName);
ServerConfiguration.set(PropertyKey.MASTER_HOSTNAME, "localhost");
ServerConfiguration.set(PropertyKey.MASTER_RPC_PORT, "8080");
List<TransformPlan> plans = mCatalog.getTransformPlan(dbName, tableName, TRANSFORM_DEFINITION);
assertEquals("alluxio://localhost:8080/", plans.get(0).getTransformedLayout().getLocation().getRootPath());
ServerConfiguration.set(PropertyKey.MASTER_RPC_ADDRESSES, "host1:1,host2:2");
plans = mCatalog.getTransformPlan(dbName, tableName, TRANSFORM_DEFINITION);
assertEquals("alluxio://host1:1,host2:2/", plans.get(0).getTransformedLayout().getLocation().getRootPath());
ServerConfiguration.set(PropertyKey.ZOOKEEPER_ENABLED, true);
ServerConfiguration.set(PropertyKey.ZOOKEEPER_ADDRESS, "host:1000");
plans = mCatalog.getTransformPlan(dbName, tableName, TRANSFORM_DEFINITION);
assertEquals("alluxio://zk@host:1000/", plans.get(0).getTransformedLayout().getLocation().getRootPath());
}
use of alluxio.table.common.transform.TransformPlan in project alluxio by Alluxio.
the class AlluxioCatalogTest method getTransformPlanTransformedLayout.
@Test
public void getTransformPlanTransformedLayout() throws Exception {
String dbName = "testdb";
TestDatabase.genTable(1, 1, false);
mCatalog.attachDatabase(NoopJournalContext.INSTANCE, TestUdbFactory.TYPE, "connect_URI", TestDatabase.TEST_UDB_NAME, dbName, Collections.emptyMap(), false);
String tableName = TestDatabase.getTableName(0);
ServerConfiguration.set(PropertyKey.MASTER_HOSTNAME, "localhost");
final TransformDefinition transformDefinition = TransformDefinition.parse("file.count.max=100;file.parquet.compression=uncompressed");
List<TransformPlan> plans = mCatalog.getTransformPlan(dbName, tableName, transformDefinition);
assertEquals(1, plans.size());
alluxio.job.plan.transform.PartitionInfo transformedPartitionInfo = TransformActionUtils.generatePartitionInfo(plans.get(0).getTransformedLayout());
assertEquals("uncompressed", transformedPartitionInfo.getSerdeProperties().get("file.parquet.compression"));
}
Aggregations