@Test public void getDatabaseCount() { Response response = metaStoreApi.getDatabaseCount(); assertTrue(((String) response.getEntity()).contains("\"result\":1")); }
@GET @Path("/database/count") @SubmarineApi public Response getDatabaseCount() { int databaseCount = -1; try { databaseCount = submarineMetaStore.getDatabaseCount(); } catch (MetaException e) { LOG.error(e.getMessage(), e); return new JsonResponse.Builder<Integer>( Response.Status.INTERNAL_SERVER_ERROR).success(false) .result(databaseCount).build(); } return new JsonResponse.Builder<Integer>(Response.Status.OK) .success(true).result(databaseCount).build(); }
MetaStoreRestApi { @GET @Path("/database/count") @SubmarineApi public Response getDatabaseCount() { int databaseCount = -1; try { databaseCount = submarineMetaStore.getDatabaseCount(); } catch (MetaException e) { LOG.error(e.getMessage(), e); return new JsonResponse.Builder<Integer>( Response.Status.INTERNAL_SERVER_ERROR).success(false) .result(databaseCount).build(); } return new JsonResponse.Builder<Integer>(Response.Status.OK) .success(true).result(databaseCount).build(); } }
MetaStoreRestApi { @GET @Path("/database/count") @SubmarineApi public Response getDatabaseCount() { int databaseCount = -1; try { databaseCount = submarineMetaStore.getDatabaseCount(); } catch (MetaException e) { LOG.error(e.getMessage(), e); return new JsonResponse.Builder<Integer>( Response.Status.INTERNAL_SERVER_ERROR).success(false) .result(databaseCount).build(); } return new JsonResponse.Builder<Integer>(Response.Status.OK) .success(true).result(databaseCount).build(); } @Inject  MetaStoreRestApi(); }
MetaStoreRestApi { @GET @Path("/database/count") @SubmarineApi public Response getDatabaseCount() { int databaseCount = -1; try { databaseCount = submarineMetaStore.getDatabaseCount(); } catch (MetaException e) { LOG.error(e.getMessage(), e); return new JsonResponse.Builder<Integer>( Response.Status.INTERNAL_SERVER_ERROR).success(false) .result(databaseCount).build(); } return new JsonResponse.Builder<Integer>(Response.Status.OK) .success(true).result(databaseCount).build(); } @Inject  MetaStoreRestApi(); @POST @Path("/database/create") @SubmarineApi Response createDatabase(@QueryParam("database") String databaseJson); @POST @Path("/table/create") @SubmarineApi Response createTable(@QueryParam("database") String tableJson); @GET @Path("/database/count") @SubmarineApi Response getDatabaseCount(); @GET @Path("/database/list") @SubmarineApi Response listDatabases(); @GET @Path("/database") @SubmarineApi Response getDatabase(@QueryParam("database") String name); @DELETE @Path("/database") @SubmarineApi Response dropDatabase(@QueryParam("database") String name); @GET @Path("/table/list") @SubmarineApi Response listTables(@QueryParam("database") String databaseName); @GET @Path("/table/count") @SubmarineApi Response getTableCount(); @GET @Path("/table") @SubmarineApi Response getTable(@QueryParam("database") String databaseName,
                           @QueryParam("table") String tableName); @DELETE @Path("/table") @SubmarineApi Response dropTable(@QueryParam("database") String databaseName,
                            @QueryParam("table") String tableName); }
MetaStoreRestApi { @GET @Path("/database/count") @SubmarineApi public Response getDatabaseCount() { int databaseCount = -1; try { databaseCount = submarineMetaStore.getDatabaseCount(); } catch (MetaException e) { LOG.error(e.getMessage(), e); return new JsonResponse.Builder<Integer>( Response.Status.INTERNAL_SERVER_ERROR).success(false) .result(databaseCount).build(); } return new JsonResponse.Builder<Integer>(Response.Status.OK) .success(true).result(databaseCount).build(); } @Inject  MetaStoreRestApi(); @POST @Path("/database/create") @SubmarineApi Response createDatabase(@QueryParam("database") String databaseJson); @POST @Path("/table/create") @SubmarineApi Response createTable(@QueryParam("database") String tableJson); @GET @Path("/database/count") @SubmarineApi Response getDatabaseCount(); @GET @Path("/database/list") @SubmarineApi Response listDatabases(); @GET @Path("/database") @SubmarineApi Response getDatabase(@QueryParam("database") String name); @DELETE @Path("/database") @SubmarineApi Response dropDatabase(@QueryParam("database") String name); @GET @Path("/table/list") @SubmarineApi Response listTables(@QueryParam("database") String databaseName); @GET @Path("/table/count") @SubmarineApi Response getTableCount(); @GET @Path("/table") @SubmarineApi Response getTable(@QueryParam("database") String databaseName,
                           @QueryParam("table") String tableName); @DELETE @Path("/table") @SubmarineApi Response dropTable(@QueryParam("database") String databaseName,
                            @QueryParam("table") String tableName);  }