use of com.sun.jersey.spi.container.ResourceFilters in project druid by druid-io.
the class DatasourcesResource method getSegmentDataSourceSegment.
@GET
@Path("/{dataSourceName}/segments/{segmentId}")
@Produces(MediaType.APPLICATION_JSON)
@ResourceFilters(DatasourceResourceFilter.class)
public Response getSegmentDataSourceSegment(@PathParam("dataSourceName") String dataSourceName, @PathParam("segmentId") String segmentId) {
DruidDataSource dataSource = getDataSource(dataSourceName);
if (dataSource == null) {
return Response.noContent().build();
}
Pair<DataSegment, Set<String>> retVal = getSegment(segmentId);
if (retVal != null) {
return Response.ok(ImmutableMap.of("metadata", retVal.lhs, "servers", retVal.rhs)).build();
}
return Response.noContent().build();
}
use of com.sun.jersey.spi.container.ResourceFilters in project druid by druid-io.
the class WorkerResource method doDisable.
@POST
@Path("/disable")
@Produces(MediaType.APPLICATION_JSON)
@ResourceFilters(ConfigResourceFilter.class)
public Response doDisable() {
try {
final Worker disabledWorker = new Worker(enabledWorker.getHost(), enabledWorker.getIp(), enabledWorker.getCapacity(), DISABLED_VERSION);
curatorCoordinator.updateWorkerAnnouncement(disabledWorker);
return Response.ok(ImmutableMap.of(disabledWorker.getHost(), "disabled")).build();
} catch (Exception e) {
return Response.serverError().build();
}
}
Aggregations