rename db->metadata

This commit is contained in:
Xavier Léauté 2014-10-31 10:54:33 -07:00
parent 9c06db021f
commit 97a2f5af4a
7 changed files with 45 additions and 45 deletions

View File

@ -25,14 +25,14 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="Description" content="Druid Indexer Coordinator Console"/> <meta name="Description" content="Druid Indexer Coordinator Console"/>
<style type="text/css">@import "css/style.css";</style> <style type="text/css">@import "old-console/css/style.css";</style>
<style type="text/css">@import "css/demo_table.css";</style> <style type="text/css">@import "old-console/css/demo_table.css";</style>
<script type="text/javascript" src="js/underscore-1.2.2.js"></script> <script type="text/javascript" src="old-console/js/underscore-1.2.2.js"></script>
<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script> <script type="text/javascript" src="old-console/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="js/jquery.dataTables-1.8.2.js"></script> <script type="text/javascript" src="old-console/js/jquery.dataTables-1.8.2.js"></script>
<script type="text/javascript" src="js/druidTable-0.0.1.js"></script> <script type="text/javascript" src="old-console/js/druidTable-0.0.1.js"></script>
<script type="text/javascript" src="js/tablehelper-0.0.2.js"></script> <script type="text/javascript" src="old-console/js/tablehelper-0.0.2.js"></script>
<script type="text/javascript" src="js/console-0.0.1.js"></script> <script type="text/javascript" src="js/console-0.0.1.js"></script>
</head> </head>

View File

@ -102,8 +102,8 @@ public class InfoResource
private final DruidCoordinator coordinator; private final DruidCoordinator coordinator;
private final InventoryView serverInventoryView; private final InventoryView serverInventoryView;
private final MetadataSegmentManager databaseSegmentManager; private final MetadataSegmentManager metadataSegmentManager;
private final MetadataRuleManager databaseRuleManager; private final MetadataRuleManager metadataRuleManager;
private final IndexingServiceClient indexingServiceClient; private final IndexingServiceClient indexingServiceClient;
private final ObjectMapper jsonMapper; private final ObjectMapper jsonMapper;
@ -112,8 +112,8 @@ public class InfoResource
public InfoResource( public InfoResource(
DruidCoordinator coordinator, DruidCoordinator coordinator,
InventoryView serverInventoryView, InventoryView serverInventoryView,
MetadataSegmentManager databaseSegmentManager, MetadataSegmentManager metadataSegmentManager,
MetadataRuleManager databaseRuleManager, MetadataRuleManager metadataRuleManager,
@Nullable @Nullable
IndexingServiceClient indexingServiceClient, IndexingServiceClient indexingServiceClient,
ObjectMapper jsonMapper ObjectMapper jsonMapper
@ -121,8 +121,8 @@ public class InfoResource
{ {
this.coordinator = coordinator; this.coordinator = coordinator;
this.serverInventoryView = serverInventoryView; this.serverInventoryView = serverInventoryView;
this.databaseSegmentManager = databaseSegmentManager; this.metadataSegmentManager = metadataSegmentManager;
this.databaseRuleManager = databaseRuleManager; this.metadataRuleManager = metadataRuleManager;
this.indexingServiceClient = indexingServiceClient; this.indexingServiceClient = indexingServiceClient;
this.jsonMapper = jsonMapper; this.jsonMapper = jsonMapper;
} }
@ -358,7 +358,7 @@ public class InfoResource
// This will def. be removed as part of the next release // This will def. be removed as part of the next release
return Response.ok().entity( return Response.ok().entity(
Maps.transformValues( Maps.transformValues(
databaseRuleManager.getAllRules(), metadataRuleManager.getAllRules(),
new Function<List<Rule>, Object>() new Function<List<Rule>, Object>()
{ {
@Override @Override
@ -409,10 +409,10 @@ public class InfoResource
) )
{ {
if (full != null) { if (full != null) {
return Response.ok(databaseRuleManager.getRulesWithDefault(dataSourceName)) return Response.ok(metadataRuleManager.getRulesWithDefault(dataSourceName))
.build(); .build();
} }
return Response.ok(databaseRuleManager.getRules(dataSourceName)) return Response.ok(metadataRuleManager.getRules(dataSourceName))
.build(); .build();
} }
@ -424,7 +424,7 @@ public class InfoResource
final List<Rule> rules final List<Rule> rules
) )
{ {
if (databaseRuleManager.overrideRule(dataSourceName, rules)) { if (metadataRuleManager.overrideRule(dataSourceName, rules)) {
return Response.status(Response.Status.OK).build(); return Response.status(Response.Status.OK).build();
} }
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build();
@ -491,7 +491,7 @@ public class InfoResource
if (kill != null && Boolean.valueOf(kill)) { if (kill != null && Boolean.valueOf(kill)) {
indexingServiceClient.killSegments(dataSourceName, new Interval(interval)); indexingServiceClient.killSegments(dataSourceName, new Interval(interval));
} else { } else {
if (!databaseSegmentManager.removeDatasource(dataSourceName)) { if (!metadataSegmentManager.removeDatasource(dataSourceName)) {
return Response.status(Response.Status.NOT_FOUND).build(); return Response.status(Response.Status.NOT_FOUND).build();
} }
} }
@ -506,7 +506,7 @@ public class InfoResource
@PathParam("dataSourceName") final String dataSourceName @PathParam("dataSourceName") final String dataSourceName
) )
{ {
if (!databaseSegmentManager.enableDatasource(dataSourceName)) { if (!metadataSegmentManager.enableDatasource(dataSourceName)) {
return Response.status(Response.Status.NOT_FOUND).build(); return Response.status(Response.Status.NOT_FOUND).build();
} }
@ -574,7 +574,7 @@ public class InfoResource
@PathParam("segmentId") String segmentId @PathParam("segmentId") String segmentId
) )
{ {
if (!databaseSegmentManager.removeSegment(dataSourceName, segmentId)) { if (!metadataSegmentManager.removeSegment(dataSourceName, segmentId)) {
return Response.status(Response.Status.NOT_FOUND).build(); return Response.status(Response.Status.NOT_FOUND).build();
} }
@ -589,7 +589,7 @@ public class InfoResource
@PathParam("segmentId") String segmentId @PathParam("segmentId") String segmentId
) )
{ {
if (!databaseSegmentManager.enableSegment(segmentId)) { if (!metadataSegmentManager.enableSegment(segmentId)) {
return Response.status(Response.Status.NOT_FOUND).build(); return Response.status(Response.Status.NOT_FOUND).build();
} }
@ -672,7 +672,7 @@ public class InfoResource
} }
@GET @GET
@Path("/db/datasources") @Path("/metadata/datasources")
@Produces("application/json") @Produces("application/json")
public Response getDatabaseDataSources( public Response getDatabaseDataSources(
@QueryParam("full") String full, @QueryParam("full") String full,
@ -681,15 +681,15 @@ public class InfoResource
{ {
Response.ResponseBuilder builder = Response.status(Response.Status.OK); Response.ResponseBuilder builder = Response.status(Response.Status.OK);
if (includeDisabled != null) { if (includeDisabled != null) {
return builder.entity(databaseSegmentManager.getAllDatasourceNames()).build(); return builder.entity(metadataSegmentManager.getAllDatasourceNames()).build();
} }
if (full != null) { if (full != null) {
return builder.entity(databaseSegmentManager.getInventory()).build(); return builder.entity(metadataSegmentManager.getInventory()).build();
} }
List<String> dataSourceNames = Lists.newArrayList( List<String> dataSourceNames = Lists.newArrayList(
Iterables.transform( Iterables.transform(
databaseSegmentManager.getInventory(), metadataSegmentManager.getInventory(),
new Function<DruidDataSource, String>() new Function<DruidDataSource, String>()
{ {
@Override @Override
@ -707,13 +707,13 @@ public class InfoResource
} }
@GET @GET
@Path("/db/datasources/{dataSourceName}") @Path("/metadata/datasources/{dataSourceName}")
@Produces("application/json") @Produces("application/json")
public Response getDatabaseSegmentDataSource( public Response getDatabaseSegmentDataSource(
@PathParam("dataSourceName") final String dataSourceName @PathParam("dataSourceName") final String dataSourceName
) )
{ {
DruidDataSource dataSource = databaseSegmentManager.getInventoryValue(dataSourceName); DruidDataSource dataSource = metadataSegmentManager.getInventoryValue(dataSourceName);
if (dataSource == null) { if (dataSource == null) {
return Response.status(Response.Status.NOT_FOUND).build(); return Response.status(Response.Status.NOT_FOUND).build();
} }
@ -722,14 +722,14 @@ public class InfoResource
} }
@GET @GET
@Path("/db/datasources/{dataSourceName}/segments") @Path("/metadata/datasources/{dataSourceName}/segments")
@Produces("application/json") @Produces("application/json")
public Response getDatabaseSegmentDataSourceSegments( public Response getDatabaseSegmentDataSourceSegments(
@PathParam("dataSourceName") String dataSourceName, @PathParam("dataSourceName") String dataSourceName,
@QueryParam("full") String full @QueryParam("full") String full
) )
{ {
DruidDataSource dataSource = databaseSegmentManager.getInventoryValue(dataSourceName); DruidDataSource dataSource = metadataSegmentManager.getInventoryValue(dataSourceName);
if (dataSource == null) { if (dataSource == null) {
return Response.status(Response.Status.NOT_FOUND).build(); return Response.status(Response.Status.NOT_FOUND).build();
} }
@ -755,14 +755,14 @@ public class InfoResource
} }
@GET @GET
@Path("/db/datasources/{dataSourceName}/segments/{segmentId}") @Path("/metadata/datasources/{dataSourceName}/segments/{segmentId}")
@Produces("application/json") @Produces("application/json")
public Response getDatabaseSegmentDataSourceSegment( public Response getDatabaseSegmentDataSourceSegment(
@PathParam("dataSourceName") String dataSourceName, @PathParam("dataSourceName") String dataSourceName,
@PathParam("segmentId") String segmentId @PathParam("segmentId") String segmentId
) )
{ {
DruidDataSource dataSource = databaseSegmentManager.getInventoryValue(dataSourceName); DruidDataSource dataSource = metadataSegmentManager.getInventoryValue(dataSourceName);
if (dataSource == null) { if (dataSource == null) {
return Response.status(Response.Status.NOT_FOUND).build(); return Response.status(Response.Status.NOT_FOUND).build();
} }

View File

@ -38,7 +38,7 @@ import java.util.List;
/** /**
*/ */
@Path("/druid/coordinator/v1/db") @Path("/druid/coordinator/v1/metadata")
public class MetadataResource public class MetadataResource
{ {
private final MetadataSegmentManager metadataSegmentManager; private final MetadataSegmentManager metadataSegmentManager;

View File

@ -11375,10 +11375,10 @@ app.factory('$druid', function($q, $http, $utils, $window) {
return this.getAndProcess("/servers?simple", $utils.processServerTiers); return this.getAndProcess("/servers?simple", $utils.processServerTiers);
}, },
getDataSources: function() { getDataSources: function() {
return this.getAndProcess("/db/datasources", $utils.processDataSources); return this.getAndProcess("/metadata/datasources", $utils.processDataSources);
}, },
getAllDataSources: function() { getAllDataSources: function() {
return this.getAndProcess("/db/datasources?includeDisabled", function(dataSources) { return this.getAndProcess("/metadata/datasources?includeDisabled", function(dataSources) {
return dataSources; return dataSources;
}); });
}, },

View File

@ -70,12 +70,12 @@ $(document).ready(function() {
} }
}); });
$.getJSON("/druid/coordinator/v1/db/datasources", function(enabled_datasources) { $.getJSON("/druid/coordinator/v1/metadata/datasources", function(enabled_datasources) {
$.each(enabled_datasources, function(index, datasource) { $.each(enabled_datasources, function(index, datasource) {
$('#enabled_datasources').append($('<li>' + datasource + '</li>')); $('#enabled_datasources').append($('<li>' + datasource + '</li>'));
}); });
$.getJSON("/druid/coordinator/v1/db/datasources?includeDisabled", function(db_datasources) { $.getJSON("/druid/coordinator/v1/metadata/datasources?includeDisabled", function(db_datasources) {
var disabled_datasources = _.difference(db_datasources, enabled_datasources); var disabled_datasources = _.difference(db_datasources, enabled_datasources);
$.each(disabled_datasources, function(index, datasource) { $.each(disabled_datasources, function(index, datasource) {
$('#disabled_datasources').append($('<li>' + datasource + '</li>')); $('#disabled_datasources').append($('<li>' + datasource + '</li>'));

View File

@ -41,7 +41,7 @@ $(document).ready(function() {
} }
}); });
$.getJSON("/druid/coordinator/v1/db/datasources?includeDisabled", function(data) { $.getJSON("/druid/coordinator/v1/metadata/datasources?includeDisabled", function(data) {
$.each(data, function(index, datasource) { $.each(data, function(index, datasource) {
$('#datasources').append($('<option></option>').val(datasource).text(datasource)); $('#datasources').append($('<option></option>').val(datasource).text(datasource));
}); });

View File

@ -268,7 +268,7 @@ $(document).ready(function() {
tiers = theTiers; tiers = theTiers;
}); });
$.getJSON("/druid/coordinator/v1/db/datasources", function(data) { $.getJSON("/druid/coordinator/v1/metadata/datasources", function(data) {
$.each(data, function(index, datasource) { $.each(data, function(index, datasource) {
$('#datasources').append($('<option></option>').val(datasource).text(datasource)); $('#datasources').append($('<option></option>').val(datasource).text(datasource));
}); });