@Test public void testGetTableWithNoDocument() throws Exception { TableFieldMapping request = new TableFieldMapping(TestUtils.TEST_TABLE_NAME, new HashSet<>()); TableFieldMapping response = resources.client() .target(String.format("/v1/tables/%s/fields", TestUtils.TEST_TABLE_NAME)) .request() .get(TableFieldMapping.class); assertEquals(request.getTable(), response.getTable()); assertNotNull(response.getMappings()); }
@GET @Timed @Path("/{name}/fields") @ApiOperation("Get fields") public Response get(@PathParam("name") final String table, @QueryParam("withCardinality") @DefaultValue("false") boolean withCardinality, @QueryParam("calculateCardinality") @DefaultValue("false") boolean calculateCardinality) { return Response.ok(tableMetadataManager.getFieldMappings(table, withCardinality, calculateCardinality)) .build(); }
TableFieldMappingResource { @GET @Timed @Path("/{name}/fields") @ApiOperation("Get fields") public Response get(@PathParam("name") final String table, @QueryParam("withCardinality") @DefaultValue("false") boolean withCardinality, @QueryParam("calculateCardinality") @DefaultValue("false") boolean calculateCardinality) { return Response.ok(tableMetadataManager.getFieldMappings(table, withCardinality, calculateCardinality)) .build(); } }
TableFieldMappingResource { @GET @Timed @Path("/{name}/fields") @ApiOperation("Get fields") public Response get(@PathParam("name") final String table, @QueryParam("withCardinality") @DefaultValue("false") boolean withCardinality, @QueryParam("calculateCardinality") @DefaultValue("false") boolean calculateCardinality) { return Response.ok(tableMetadataManager.getFieldMappings(table, withCardinality, calculateCardinality)) .build(); } @Inject  TableFieldMappingResource(TableManager tableManager, TableMetadataManager tableMetadataManager); }
TableFieldMappingResource { @GET @Timed @Path("/{name}/fields") @ApiOperation("Get fields") public Response get(@PathParam("name") final String table, @QueryParam("withCardinality") @DefaultValue("false") boolean withCardinality, @QueryParam("calculateCardinality") @DefaultValue("false") boolean calculateCardinality) { return Response.ok(tableMetadataManager.getFieldMappings(table, withCardinality, calculateCardinality)) .build(); } @Inject  TableFieldMappingResource(TableManager tableManager, TableMetadataManager tableMetadataManager); @GET @Timed @Path("/{name}/fields") @ApiOperation("Get fields") Response get(@PathParam("name") final String table,
                        @QueryParam("withCardinality") @DefaultValue("false") boolean withCardinality,
                        @QueryParam("calculateCardinality") @DefaultValue("false") boolean calculateCardinality); @GET @Timed @Path("/fields") @ApiOperation("Get all Fields") Response getAllFields(@QueryParam("withCardinality") @DefaultValue("false") boolean withCardinality,
                                 @QueryParam("calculateCardinality") @DefaultValue("false") boolean calculateCardinality); @POST @Timed @Path("/{name}/fields/update") @ApiOperation("Update Fields") Response updateEstimation(@PathParam("name") final String table, @QueryParam("time") @DefaultValue("0") long epoch); }
TableFieldMappingResource { @GET @Timed @Path("/{name}/fields") @ApiOperation("Get fields") public Response get(@PathParam("name") final String table, @QueryParam("withCardinality") @DefaultValue("false") boolean withCardinality, @QueryParam("calculateCardinality") @DefaultValue("false") boolean calculateCardinality) { return Response.ok(tableMetadataManager.getFieldMappings(table, withCardinality, calculateCardinality)) .build(); } @Inject  TableFieldMappingResource(TableManager tableManager, TableMetadataManager tableMetadataManager); @GET @Timed @Path("/{name}/fields") @ApiOperation("Get fields") Response get(@PathParam("name") final String table,
                        @QueryParam("withCardinality") @DefaultValue("false") boolean withCardinality,
                        @QueryParam("calculateCardinality") @DefaultValue("false") boolean calculateCardinality); @GET @Timed @Path("/fields") @ApiOperation("Get all Fields") Response getAllFields(@QueryParam("withCardinality") @DefaultValue("false") boolean withCardinality,
                                 @QueryParam("calculateCardinality") @DefaultValue("false") boolean calculateCardinality); @POST @Timed @Path("/{name}/fields/update") @ApiOperation("Update Fields") Response updateEstimation(@PathParam("name") final String table, @QueryParam("time") @DefaultValue("0") long epoch);  }