Search in sources :

Example 1 with Tables

use of com.hortonworks.streamline.streams.cluster.service.metadata.json.Tables in project streamline by hortonworks.

the class HiveMetadataService method getHiveTables.

/**
 * @return The table names for the database specified in the parameter
 */
public Tables getHiveTables(String dbName) throws MetaException, PrivilegedActionException, IOException, InterruptedException {
    final Tables tables = Tables.newInstance(executeSecure(() -> metaStoreClient.getAllTables(dbName)), securityContext, false, getPrincipals(), getKeytabs());
    LOG.debug("Hive database [{}] has tables {}", dbName, tables.getTables());
    return tables;
}
Also used : Tables(com.hortonworks.streamline.streams.cluster.service.metadata.json.Tables)

Example 2 with Tables

use of com.hortonworks.streamline.streams.cluster.service.metadata.json.Tables in project streamline by hortonworks.

the class HBaseBundleHintProviderTest method testGetHintsOnCluster.

// FIXME: below hint needs to access HBase and currently it doesn't work with secure cluster
// FIXME: hence can't add HBase sink to the topology
// FIXME: so we should mark this test to ignore until it is fixed
@Ignore
@Test
public void testGetHintsOnCluster() throws Exception {
    List<String> tables = Lists.newArrayList("test1", "test2", "test3");
    new Expectations() {

        {
            hbaseMetadataService.getHBaseTables();
            result = new Tables(tables);
        }
    };
    Cluster cluster = new Cluster();
    cluster.setId(1L);
    cluster.setName("cluster1");
    Map<String, Object> hints = provider.getHintsOnCluster(cluster, null, null);
    Assert.assertNotNull(hints);
    Assert.assertEquals(1, hints.size());
    Assert.assertEquals(tables, hints.get(HBaseBundleHintProvider.FIELD_NAME_TABLE));
    new Verifications() {

        {
            hbaseMetadataService.getHBaseTables();
        }
    };
}
Also used : Expectations(mockit.Expectations) Tables(com.hortonworks.streamline.streams.cluster.service.metadata.json.Tables) Cluster(com.hortonworks.streamline.streams.cluster.catalog.Cluster) Verifications(mockit.Verifications) Ignore(org.junit.Ignore) Test(org.junit.Test)

Aggregations

Tables (com.hortonworks.streamline.streams.cluster.service.metadata.json.Tables)2 Cluster (com.hortonworks.streamline.streams.cluster.catalog.Cluster)1 Expectations (mockit.Expectations)1 Verifications (mockit.Verifications)1 Ignore (org.junit.Ignore)1 Test (org.junit.Test)1