mirror of https://github.com/apache/druid.git
rename db->metadata
This commit is contained in:
parent
9c06db021f
commit
97a2f5af4a
|
@ -25,14 +25,14 @@
|
|||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<meta name="Description" content="Druid Indexer Coordinator Console"/>
|
||||
|
||||
<style type="text/css">@import "css/style.css";</style>
|
||||
<style type="text/css">@import "css/demo_table.css";</style>
|
||||
<style type="text/css">@import "old-console/css/style.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="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="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/underscore-1.2.2.js"></script>
|
||||
<script type="text/javascript" src="old-console/js/jquery-1.11.0.min.js"></script>
|
||||
<script type="text/javascript" src="old-console/js/jquery.dataTables-1.8.2.js"></script>
|
||||
<script type="text/javascript" src="old-console/js/druidTable-0.0.1.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>
|
||||
</head>
|
||||
|
||||
|
@ -64,4 +64,4 @@
|
|||
<table id="eventTable"></table>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
@ -102,8 +102,8 @@ public class InfoResource
|
|||
|
||||
private final DruidCoordinator coordinator;
|
||||
private final InventoryView serverInventoryView;
|
||||
private final MetadataSegmentManager databaseSegmentManager;
|
||||
private final MetadataRuleManager databaseRuleManager;
|
||||
private final MetadataSegmentManager metadataSegmentManager;
|
||||
private final MetadataRuleManager metadataRuleManager;
|
||||
private final IndexingServiceClient indexingServiceClient;
|
||||
|
||||
private final ObjectMapper jsonMapper;
|
||||
|
@ -112,8 +112,8 @@ public class InfoResource
|
|||
public InfoResource(
|
||||
DruidCoordinator coordinator,
|
||||
InventoryView serverInventoryView,
|
||||
MetadataSegmentManager databaseSegmentManager,
|
||||
MetadataRuleManager databaseRuleManager,
|
||||
MetadataSegmentManager metadataSegmentManager,
|
||||
MetadataRuleManager metadataRuleManager,
|
||||
@Nullable
|
||||
IndexingServiceClient indexingServiceClient,
|
||||
ObjectMapper jsonMapper
|
||||
|
@ -121,8 +121,8 @@ public class InfoResource
|
|||
{
|
||||
this.coordinator = coordinator;
|
||||
this.serverInventoryView = serverInventoryView;
|
||||
this.databaseSegmentManager = databaseSegmentManager;
|
||||
this.databaseRuleManager = databaseRuleManager;
|
||||
this.metadataSegmentManager = metadataSegmentManager;
|
||||
this.metadataRuleManager = metadataRuleManager;
|
||||
this.indexingServiceClient = indexingServiceClient;
|
||||
this.jsonMapper = jsonMapper;
|
||||
}
|
||||
|
@ -358,7 +358,7 @@ public class InfoResource
|
|||
// This will def. be removed as part of the next release
|
||||
return Response.ok().entity(
|
||||
Maps.transformValues(
|
||||
databaseRuleManager.getAllRules(),
|
||||
metadataRuleManager.getAllRules(),
|
||||
new Function<List<Rule>, Object>()
|
||||
{
|
||||
@Override
|
||||
|
@ -374,8 +374,8 @@ public class InfoResource
|
|||
if (rule instanceof LoadRule) {
|
||||
Map<String, Object> newRule = jsonMapper.convertValue(
|
||||
rule, new TypeReference<Map<String, Object>>()
|
||||
{
|
||||
}
|
||||
{
|
||||
}
|
||||
);
|
||||
Set<String> tiers = Sets.newHashSet(((LoadRule) rule).getTieredReplicants().keySet());
|
||||
tiers.remove(DruidServer.DEFAULT_TIER);
|
||||
|
@ -409,10 +409,10 @@ public class InfoResource
|
|||
)
|
||||
{
|
||||
if (full != null) {
|
||||
return Response.ok(databaseRuleManager.getRulesWithDefault(dataSourceName))
|
||||
return Response.ok(metadataRuleManager.getRulesWithDefault(dataSourceName))
|
||||
.build();
|
||||
}
|
||||
return Response.ok(databaseRuleManager.getRules(dataSourceName))
|
||||
return Response.ok(metadataRuleManager.getRules(dataSourceName))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
@ -424,7 +424,7 @@ public class InfoResource
|
|||
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.INTERNAL_SERVER_ERROR).build();
|
||||
|
@ -491,7 +491,7 @@ public class InfoResource
|
|||
if (kill != null && Boolean.valueOf(kill)) {
|
||||
indexingServiceClient.killSegments(dataSourceName, new Interval(interval));
|
||||
} else {
|
||||
if (!databaseSegmentManager.removeDatasource(dataSourceName)) {
|
||||
if (!metadataSegmentManager.removeDatasource(dataSourceName)) {
|
||||
return Response.status(Response.Status.NOT_FOUND).build();
|
||||
}
|
||||
}
|
||||
|
@ -506,7 +506,7 @@ public class InfoResource
|
|||
@PathParam("dataSourceName") final String dataSourceName
|
||||
)
|
||||
{
|
||||
if (!databaseSegmentManager.enableDatasource(dataSourceName)) {
|
||||
if (!metadataSegmentManager.enableDatasource(dataSourceName)) {
|
||||
return Response.status(Response.Status.NOT_FOUND).build();
|
||||
}
|
||||
|
||||
|
@ -574,7 +574,7 @@ public class InfoResource
|
|||
@PathParam("segmentId") String segmentId
|
||||
)
|
||||
{
|
||||
if (!databaseSegmentManager.removeSegment(dataSourceName, segmentId)) {
|
||||
if (!metadataSegmentManager.removeSegment(dataSourceName, segmentId)) {
|
||||
return Response.status(Response.Status.NOT_FOUND).build();
|
||||
}
|
||||
|
||||
|
@ -589,7 +589,7 @@ public class InfoResource
|
|||
@PathParam("segmentId") String segmentId
|
||||
)
|
||||
{
|
||||
if (!databaseSegmentManager.enableSegment(segmentId)) {
|
||||
if (!metadataSegmentManager.enableSegment(segmentId)) {
|
||||
return Response.status(Response.Status.NOT_FOUND).build();
|
||||
}
|
||||
|
||||
|
@ -672,7 +672,7 @@ public class InfoResource
|
|||
}
|
||||
|
||||
@GET
|
||||
@Path("/db/datasources")
|
||||
@Path("/metadata/datasources")
|
||||
@Produces("application/json")
|
||||
public Response getDatabaseDataSources(
|
||||
@QueryParam("full") String full,
|
||||
|
@ -681,15 +681,15 @@ public class InfoResource
|
|||
{
|
||||
Response.ResponseBuilder builder = Response.status(Response.Status.OK);
|
||||
if (includeDisabled != null) {
|
||||
return builder.entity(databaseSegmentManager.getAllDatasourceNames()).build();
|
||||
return builder.entity(metadataSegmentManager.getAllDatasourceNames()).build();
|
||||
}
|
||||
if (full != null) {
|
||||
return builder.entity(databaseSegmentManager.getInventory()).build();
|
||||
return builder.entity(metadataSegmentManager.getInventory()).build();
|
||||
}
|
||||
|
||||
List<String> dataSourceNames = Lists.newArrayList(
|
||||
Iterables.transform(
|
||||
databaseSegmentManager.getInventory(),
|
||||
metadataSegmentManager.getInventory(),
|
||||
new Function<DruidDataSource, String>()
|
||||
{
|
||||
@Override
|
||||
|
@ -707,13 +707,13 @@ public class InfoResource
|
|||
}
|
||||
|
||||
@GET
|
||||
@Path("/db/datasources/{dataSourceName}")
|
||||
@Path("/metadata/datasources/{dataSourceName}")
|
||||
@Produces("application/json")
|
||||
public Response getDatabaseSegmentDataSource(
|
||||
@PathParam("dataSourceName") final String dataSourceName
|
||||
)
|
||||
{
|
||||
DruidDataSource dataSource = databaseSegmentManager.getInventoryValue(dataSourceName);
|
||||
DruidDataSource dataSource = metadataSegmentManager.getInventoryValue(dataSourceName);
|
||||
if (dataSource == null) {
|
||||
return Response.status(Response.Status.NOT_FOUND).build();
|
||||
}
|
||||
|
@ -722,14 +722,14 @@ public class InfoResource
|
|||
}
|
||||
|
||||
@GET
|
||||
@Path("/db/datasources/{dataSourceName}/segments")
|
||||
@Path("/metadata/datasources/{dataSourceName}/segments")
|
||||
@Produces("application/json")
|
||||
public Response getDatabaseSegmentDataSourceSegments(
|
||||
@PathParam("dataSourceName") String dataSourceName,
|
||||
@QueryParam("full") String full
|
||||
)
|
||||
{
|
||||
DruidDataSource dataSource = databaseSegmentManager.getInventoryValue(dataSourceName);
|
||||
DruidDataSource dataSource = metadataSegmentManager.getInventoryValue(dataSourceName);
|
||||
if (dataSource == null) {
|
||||
return Response.status(Response.Status.NOT_FOUND).build();
|
||||
}
|
||||
|
@ -755,14 +755,14 @@ public class InfoResource
|
|||
}
|
||||
|
||||
@GET
|
||||
@Path("/db/datasources/{dataSourceName}/segments/{segmentId}")
|
||||
@Path("/metadata/datasources/{dataSourceName}/segments/{segmentId}")
|
||||
@Produces("application/json")
|
||||
public Response getDatabaseSegmentDataSourceSegment(
|
||||
@PathParam("dataSourceName") String dataSourceName,
|
||||
@PathParam("segmentId") String segmentId
|
||||
)
|
||||
{
|
||||
DruidDataSource dataSource = databaseSegmentManager.getInventoryValue(dataSourceName);
|
||||
DruidDataSource dataSource = metadataSegmentManager.getInventoryValue(dataSourceName);
|
||||
if (dataSource == null) {
|
||||
return Response.status(Response.Status.NOT_FOUND).build();
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ import java.util.List;
|
|||
|
||||
/**
|
||||
*/
|
||||
@Path("/druid/coordinator/v1/db")
|
||||
@Path("/druid/coordinator/v1/metadata")
|
||||
public class MetadataResource
|
||||
{
|
||||
private final MetadataSegmentManager metadataSegmentManager;
|
||||
|
|
|
@ -11375,10 +11375,10 @@ app.factory('$druid', function($q, $http, $utils, $window) {
|
|||
return this.getAndProcess("/servers?simple", $utils.processServerTiers);
|
||||
},
|
||||
getDataSources: function() {
|
||||
return this.getAndProcess("/db/datasources", $utils.processDataSources);
|
||||
return this.getAndProcess("/metadata/datasources", $utils.processDataSources);
|
||||
},
|
||||
getAllDataSources: function() {
|
||||
return this.getAndProcess("/db/datasources?includeDisabled", function(dataSources) {
|
||||
return this.getAndProcess("/metadata/datasources?includeDisabled", function(dataSources) {
|
||||
return dataSources;
|
||||
});
|
||||
},
|
||||
|
@ -12758,4 +12758,4 @@ ClusterConfigInstanceCtrl = function($scope, $modalInstance, $druid) {
|
|||
};
|
||||
|
||||
|
||||
},{"../../bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js":1,"../../bower_components/angular-sanitize/angular-sanitize.min.js":2,"../../bower_components/angular-ui-router/release/angular-ui-router.min.js":3,"../../bower_components/angular/angular.min.js":4,"../../bower_components/d3/d3.js":5,"../../bower_components/moment/min/moment.min.js":7,"../../bower_components/ng-clip/dest/ng-clip.min.js":8,"../../bower_components/ng-csv/build/ng-csv.min.js":9,"../../bower_components/underscore/underscore.js":10,"../../bower_components/zeroclipboard/ZeroClipboard.min.js":11,"../../lib/moment-interval.js":12,"jquery":6}]},{},[13])
|
||||
},{"../../bower_components/angular-bootstrap/ui-bootstrap-tpls.min.js":1,"../../bower_components/angular-sanitize/angular-sanitize.min.js":2,"../../bower_components/angular-ui-router/release/angular-ui-router.min.js":3,"../../bower_components/angular/angular.min.js":4,"../../bower_components/d3/d3.js":5,"../../bower_components/moment/min/moment.min.js":7,"../../bower_components/ng-clip/dest/ng-clip.min.js":8,"../../bower_components/ng-csv/build/ng-csv.min.js":9,"../../bower_components/underscore/underscore.js":10,"../../bower_components/zeroclipboard/ZeroClipboard.min.js":11,"../../lib/moment-interval.js":12,"jquery":6}]},{},[13])
|
||||
|
|
|
@ -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) {
|
||||
$('#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);
|
||||
$.each(disabled_datasources, function(index, datasource) {
|
||||
$('#disabled_datasources').append($('<li>' + datasource + '</li>'));
|
||||
|
@ -93,4 +93,4 @@ $(document).ready(function() {
|
|||
$('#disable').click(function (){
|
||||
$("#disable_dialog").dialog("open")
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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) {
|
||||
$('#datasources').append($('<option></option>').val(datasource).text(datasource));
|
||||
});
|
||||
|
@ -50,4 +50,4 @@ $(document).ready(function() {
|
|||
$("#confirm").click(function() {
|
||||
$("#confirm_dialog").dialog("open");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -268,7 +268,7 @@ $(document).ready(function() {
|
|||
tiers = theTiers;
|
||||
});
|
||||
|
||||
$.getJSON("/druid/coordinator/v1/db/datasources", function(data) {
|
||||
$.getJSON("/druid/coordinator/v1/metadata/datasources", function(data) {
|
||||
$.each(data, function(index, datasource) {
|
||||
$('#datasources').append($('<option></option>').val(datasource).text(datasource));
|
||||
});
|
||||
|
@ -307,4 +307,4 @@ $(document).ready(function() {
|
|||
$('#update').click(function (){
|
||||
$("#update_dialog").dialog("open")
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue