Search in sources :

Example 1 with UdbContext

use of alluxio.table.common.udb.UdbContext in project alluxio by Alluxio.

the class GlueDatabaseTest method before.

@Before
public void before() {
    Map<String, String> conf = ImmutableMap.of("aws.region", "us-east-1");
    mUdbConfiguration = new UdbConfiguration(conf);
    mUdbContext = new UdbContext(null, null, "glue", "null", DB_NAME, DB_NAME);
}
Also used : UdbContext(alluxio.table.common.udb.UdbContext) UdbConfiguration(alluxio.table.common.udb.UdbConfiguration) Before(org.junit.Before)

Example 2 with UdbContext

use of alluxio.table.common.udb.UdbContext in project alluxio by Alluxio.

the class GlueDatabaseTest method createEmptyName.

@Test
public void createEmptyName() {
    mExpection.expect(IllegalArgumentException.class);
    UdbContext udbContext = new UdbContext(null, null, "glue", null, "", DB_NAME);
    assertEquals(DB_NAME, GlueDatabase.create(udbContext, new UdbConfiguration(ImmutableMap.of())).getName());
}
Also used : UdbContext(alluxio.table.common.udb.UdbContext) UdbConfiguration(alluxio.table.common.udb.UdbConfiguration) Test(org.junit.Test)

Example 3 with UdbContext

use of alluxio.table.common.udb.UdbContext in project alluxio by Alluxio.

the class HiveDatabaseTest method createNullConnectionUri.

@Test
public void createNullConnectionUri() {
    mExpection.expect(IllegalArgumentException.class);
    UdbContext udbContext = new UdbContext(null, null, "hive", null, DB_NAME, DB_NAME);
    assertEquals(DB_NAME, HiveDatabase.create(udbContext, new UdbConfiguration(ImmutableMap.of())).getName());
}
Also used : UdbContext(alluxio.table.common.udb.UdbContext) UdbConfiguration(alluxio.table.common.udb.UdbConfiguration) Test(org.junit.Test)

Example 4 with UdbContext

use of alluxio.table.common.udb.UdbContext in project alluxio by Alluxio.

the class GlueDatabaseTest method createNullName.

@Test
public void createNullName() {
    mExpection.expect(IllegalArgumentException.class);
    UdbContext udbContext = new UdbContext(null, null, "glue", null, null, DB_NAME);
    assertEquals(DB_NAME, GlueDatabase.create(udbContext, new UdbConfiguration(ImmutableMap.of())).getName());
}
Also used : UdbContext(alluxio.table.common.udb.UdbContext) UdbConfiguration(alluxio.table.common.udb.UdbConfiguration) Test(org.junit.Test)

Example 5 with UdbContext

use of alluxio.table.common.udb.UdbContext in project alluxio by Alluxio.

the class AlluxioCatalogTest method createMockDatabase.

private Database createMockDatabase(String type, String name, Collection<Table> tables) {
    UdbContext udbCtx = Mockito.mock(UdbContext.class);
    when(udbCtx.getUdbRegistry()).thenReturn(Mockito.mock(UnderDatabaseRegistry.class));
    Database db = Database.create(Mockito.mock(CatalogContext.class), udbCtx, type, name, Collections.emptyMap());
    tables.forEach(table -> addTableToDb(db, table));
    return db;
}
Also used : UnderDatabaseRegistry(alluxio.table.common.udb.UnderDatabaseRegistry) UdbContext(alluxio.table.common.udb.UdbContext)

Aggregations

UdbContext (alluxio.table.common.udb.UdbContext)11 UdbConfiguration (alluxio.table.common.udb.UdbConfiguration)8 Test (org.junit.Test)6 Before (org.junit.Before)2 Journal (alluxio.proto.journal.Journal)1 CloseableIterator (alluxio.resource.CloseableIterator)1 UnderDatabaseRegistry (alluxio.table.common.udb.UnderDatabaseRegistry)1 Iterator (java.util.Iterator)1 NoSuchElementException (java.util.NoSuchElementException)1