Search in sources :

Example 1 with AgentListCatalogRequest

use of alluxio.hub.proto.AgentListCatalogRequest in project alluxio by Alluxio.

the class AgentManagerServiceTest method testListCatalogs.

@Test
public void testListCatalogs() throws Exception {
    String confDir = mTemp.getRoot().getAbsolutePath();
    AgentListCatalogRequest r = AgentListCatalogRequest.newBuilder().setConfDir(confDir).build();
    Files.createDirectory(Paths.get(confDir, "catalog"));
    Path testCatalog = Paths.get(confDir, "catalog", "test-hive.properties");
    Path badCatalog = Paths.get(confDir, "catalog", "bad.poperties");
    Files.createFile(testCatalog);
    Files.write(testCatalog, "hive.metastore.uri=thrift://aaabbbccc::9083/\nconnector.name=hive-hadoop2\n".getBytes());
    Files.write(badCatalog, "hive.metastore.uri=thrift://aaabbbccc::9083/\nconnector.name=hive-hadoop2\n".getBytes());
    AgentListCatalogResponse resp = mClient.listCatalogs(r);
    assertEquals(1, resp.getCatalogCount());
    PrestoCatalogListing l = resp.getCatalog(0);
    assertEquals("test-hive", l.getCatalogName());
    assertEquals("thrift://aaabbbccc::9083/", l.getHiveMetastoreUri());
}
Also used : Path(java.nio.file.Path) AgentListCatalogRequest(alluxio.hub.proto.AgentListCatalogRequest) PrestoCatalogListing(alluxio.hub.proto.PrestoCatalogListing) AgentListCatalogResponse(alluxio.hub.proto.AgentListCatalogResponse) Test(org.junit.Test) BaseHubTest(alluxio.hub.test.BaseHubTest)

Aggregations

AgentListCatalogRequest (alluxio.hub.proto.AgentListCatalogRequest)1 AgentListCatalogResponse (alluxio.hub.proto.AgentListCatalogResponse)1 PrestoCatalogListing (alluxio.hub.proto.PrestoCatalogListing)1 BaseHubTest (alluxio.hub.test.BaseHubTest)1 Path (java.nio.file.Path)1 Test (org.junit.Test)1