Search in sources :

Example 66 with DrillConfig

use of org.apache.drill.common.config.DrillConfig in project drill by apache.

the class TestIcebergTablesMetastoreConfigAndVersion method testNewInstance.

@Test
public void testNewInstance() {
    DrillConfig config = new DrillConfig(baseIcebergConfig(baseLocation.getRoot()));
    Metastore metastore = new IcebergMetastore(config);
    assertNotSame(metastore.tables(), metastore.tables());
}
Also used : IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Metastore(org.apache.drill.metastore.Metastore) DrillConfig(org.apache.drill.common.config.DrillConfig) IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Test(org.junit.Test) IcebergBaseTest(org.apache.drill.metastore.iceberg.IcebergBaseTest)

Example 67 with DrillConfig

use of org.apache.drill.common.config.DrillConfig in project drill by apache.

the class TestIcebergTablesMetastoreConfigAndVersion method testLoadWithoutProperties.

@Test
public void testLoadWithoutProperties() {
    DrillConfig config = new DrillConfig(baseIcebergConfig(baseLocation.getRoot()));
    Metastore initialMetastore = new IcebergMetastore(config);
    assertTrue(initialMetastore.tables().metadata().properties().isEmpty());
    Metastore newMetastore = new IcebergMetastore(config);
    assertTrue(newMetastore.tables().metadata().properties().isEmpty());
}
Also used : IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Metastore(org.apache.drill.metastore.Metastore) DrillConfig(org.apache.drill.common.config.DrillConfig) IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Test(org.junit.Test) IcebergBaseTest(org.apache.drill.metastore.iceberg.IcebergBaseTest)

Example 68 with DrillConfig

use of org.apache.drill.common.config.DrillConfig in project drill by apache.

the class TestIcebergTablesMetastoreConfigAndVersion method testVersionUpdate.

@Test
public void testVersionUpdate() {
    DrillConfig config = new DrillConfig(baseIcebergConfig(baseLocation.getRoot()));
    Tables tables = new IcebergMetastore(config).tables();
    Metadata metadata = tables.metadata();
    assertTrue(metadata.supportsVersioning());
    assertEquals(0, metadata.version());
    tables.modify().overwrite(TableMetadataUnit.builder().storagePlugin("dfs").workspace("tmp").tableName("nation").metadataKey("dir0").build()).execute();
    assertNotEquals(0, metadata.version());
}
Also used : DrillConfig(org.apache.drill.common.config.DrillConfig) Metadata(org.apache.drill.metastore.operate.Metadata) Tables(org.apache.drill.metastore.components.tables.Tables) IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Test(org.junit.Test) IcebergBaseTest(org.apache.drill.metastore.iceberg.IcebergBaseTest)

Example 69 with DrillConfig

use of org.apache.drill.common.config.DrillConfig in project drill by apache.

the class TestIcebergTablesMetastoreConfigAndVersion method testVersionInitial.

@Test
public void testVersionInitial() {
    DrillConfig config = new DrillConfig(baseIcebergConfig(baseLocation.getRoot()));
    Metastore metastore = new IcebergMetastore(config);
    Metadata metadata = metastore.tables().metadata();
    assertTrue(metadata.supportsVersioning());
    assertEquals(0, metadata.version());
}
Also used : IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Metastore(org.apache.drill.metastore.Metastore) DrillConfig(org.apache.drill.common.config.DrillConfig) Metadata(org.apache.drill.metastore.operate.Metadata) IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) Test(org.junit.Test) IcebergBaseTest(org.apache.drill.metastore.iceberg.IcebergBaseTest)

Example 70 with DrillConfig

use of org.apache.drill.common.config.DrillConfig in project drill by apache.

the class TestTablesOperationTransformer method init.

@BeforeClass
public static void init() throws Exception {
    location = new Path(defaultFolder.newFolder(TestTablesOperationTransformer.class.getSimpleName()).toURI().getPath()).toUri().getPath();
    IcebergMetastore metastore = new IcebergMetastore(new DrillConfig(baseIcebergConfig(new File(location))));
    transformer = new TablesOperationTransformer((IcebergTables) metastore.tables());
}
Also used : Path(org.apache.hadoop.fs.Path) DrillConfig(org.apache.drill.common.config.DrillConfig) IcebergMetastore(org.apache.drill.metastore.iceberg.IcebergMetastore) File(java.io.File) BeforeClass(org.junit.BeforeClass)

Aggregations

DrillConfig (org.apache.drill.common.config.DrillConfig)249 Test (org.junit.Test)165 Properties (java.util.Properties)89 SecurityTest (org.apache.drill.categories.SecurityTest)88 DrillProperties (org.apache.drill.common.config.DrillProperties)77 NonTransientRpcException (org.apache.drill.exec.rpc.NonTransientRpcException)32 ScanResult (org.apache.drill.common.scanner.persistence.ScanResult)29 DrillbitContext (org.apache.drill.exec.server.DrillbitContext)28 BeforeClass (org.junit.BeforeClass)25 DrillbitEndpoint (org.apache.drill.exec.proto.CoordinationProtos.DrillbitEndpoint)23 SaslException (javax.security.sasl.SaslException)20 RpcException (org.apache.drill.exec.rpc.RpcException)20 Drillbit (org.apache.drill.exec.server.Drillbit)20 DrillbitStartupException (org.apache.drill.exec.exception.DrillbitStartupException)18 RemoteServiceSet (org.apache.drill.exec.server.RemoteServiceSet)17 BaseTest (org.apache.drill.test.BaseTest)17 ExecTest (org.apache.drill.exec.ExecTest)14 IOException (java.io.IOException)12 IcebergMetastore (org.apache.drill.metastore.iceberg.IcebergMetastore)12 File (java.io.File)10