Commit dd9a76b0 by Shwetha GS

Merge branch 'master' into dal

parents f82182e4 4b2a4cae
......@@ -250,7 +250,8 @@ public class MetadataServiceClient {
throw new MetadataServiceException(api, e);
}
}
throw new MetadataServiceException(api, clientResponse.getClientResponseStatus());
throw new MetadataServiceException(api, clientResponse);
}
private JSONObject callAPI(API api, Object requestObject,
......
......@@ -27,10 +27,12 @@ public class MetadataServiceException extends Exception {
super("Metadata service API " + api + " failed", e);
}
public MetadataServiceException(MetadataServiceClient.API api, ClientResponse.Status status) {
super("Metadata service API " + api + " failed with status " + status.getStatusCode()
+ "(" + status.getReasonPhrase() + ")");
this.status = status;
public MetadataServiceException(MetadataServiceClient.API api, ClientResponse response) {
super("Metadata service API " + api + " failed with status " +
response.getClientResponseStatus().getStatusCode() + "(" +
response.getClientResponseStatus().getReasonPhrase() + ") Response Body (" +
response.getEntity(String.class) + ")");
this.status = response.getClientResponseStatus();
}
public MetadataServiceException(Exception e) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
/*!
* Start Bootstrap - Heroic Features HTML Template (http://startbootstrap.com)
* Code licensed under the Apache License v2.0.
* For details, see http://www.apache.org/licenses/LICENSE-2.0.
*/
body {
padding-top: 70px; /* Required padding for .navbar-fixed-top. Remove if using .navbar-static-top. Change if height of navigation changes. */
}
.hero-spacer {
margin-top: 50px;
}
.hero-feature {
margin-bottom: 30px;
}
footer {
margin: 50px 0;
}
\ No newline at end of file
/* Sticky footer styles
-------------------------------------------------- */
html {
position: relative;
min-height: 100%;
}
body {
/* Margin bottom by footer height */
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
background-color: #f5f5f5;
}
/* Custom page CSS
-------------------------------------------------- */
/* Not required for template or sticky footer method. */
body > .container {
padding: 60px 15px 0;
}
.container .text-muted {
margin: 20px 0;
}
.footer > .container {
padding-right: 15px;
padding-left: 15px;
}
code {
font-size: 80%;
}
@font-face {
font-family: 'lettrgoth12_btroman';
src: url('lettrgoth12-bt-roman.eot');
src: url('lettrgoth12-bt-roman.eot?#iefix') format('embedded-opentype'),
url('lettrgoth12-bt-roman.woff2') format('woff2'),
url('lettrgoth12-bt-roman.woff') format('woff'),
url('lettrgoth12-bt-roman.ttf') format('truetype'),
url('lettrgoth12-bt-roman.svg#lettrgoth12_btroman') format('svg');
font-weight: normal;
font-style: normal;
}
.litag{
font:Arial, Helvetica, sans-serif;
padding: 8px 0px 8px 0px;
font-size:14px;
color:#7b7b7b;
margin-left:40px;
margin-top:5px;
height:40px;
}
.litag:hover{
font:Arial, Helvetica, sans-serif;
padding: 8px 0px 8px 25px;
font-size:14px;
color:#7b7b7b;
margin-left:15px;
margin-top:5px;
width:90%;
height:40px;
background-color:#e5e5e5;
}
.search_btn {
background-image:url(../img/search_icon.jpg);
background-repeat:no-repeat;
width:30px;
height:30px;
border:none;
margin-left:15px;
}
.leftpanal {
background-color:#f9f9f9;
background-image:url(../img/bg2.jpg);
background-repeat:repeat-x;
padding-bottom:56px;
}
.rightpanal {
background-color:#eeeeed;
background-image:url(../img/bg1.jpg);
background-repeat:repeat-x;
padding-bottom:40px;
}
.mrgt40 {
margin-top:40px;
margin-bottom:40px;
}
.mrgt40lm30 {
margin-top:60px;
margin-left:-30px;
}
.greyt {
color:#939598;
font-family:"LettrGoth12 BT";
font-weight:bold;
}
.mini-box {
background-color: #10BCFF;
color: white;
text-align: center;
margin: 2px;
font-size: 1.5em;
}
.mini-box1 {
height: 30px;
margin-top:10px;
margin-left:-20px;
background-color:#f4f4f5;
padding-left:15px;
padding-top:5px;
width:577px;
}
.mini-box1input {
background-color:#f4f4f5;
border:none;
}
.mini-box2 {
height: 30px;
margin-top:6px;
margin-left:-20px;
background-color:#f0f0f1;
padding-left:15px;
padding-top:5px;
width:577px;
}
.mini-box2input {
background-color:#f0f0f1;
border:none;
}
.mini-box3 {
height: 30px;
margin-top:6px;
margin-left:-20px;
background-color:#f4f4f5;
padding-left:15px;
padding-top:5px;
width:577px;
}
.mini-box4 {
height: 30px;
margin-top:6px;
margin-left:-35px;
background-color:#f0f0f1;
padding-left:15px;
padding-top:5px;
width:577px;
}
.tagtxt {
color:#000;
padding-top:10px;
margin-left:-100px
}
.guidtxt {
color:#000000;
padding-top:30px;
text-decoration:underline;
font-weight:600;
font-size:14px;
color:#636364;
margin-left:10px
}
.guidtxt2 {
color:#000000;
padding-top:10px;
padding-bottom:20px;
font-weight:600;
font-size:14px;
color:#636364;
border-bottom:thin #d9d9d9 solid;
}
.resulttxt {
color:#000000;
padding-top:3px;
padding-bottom:3px;
font-size:13px;
color:#636364;
}
.img2 {
float:right;
margin-top:20px;
margin-bottom:-40px;
margin-right:-30px;
}
.borderright {
border-right:1px solid #89BC3B;
height:400px;
}
.box1 {
margin-top:5px;
background-color:#F4F4F6;
width:48%;
height:250px;
padding-top:10px;
}
.div_ex
{
/*background-color:#EEEEED;*/
}
.div_ex:hover
{
background-color:#f5f5f5;
}
.div_ex2
{
background-color:#f9f9f9;
}
.div_ex2:hover
{
background-color:#e5e5e5;
}
\ No newline at end of file
<!DOCTYPE html>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<html ng-app="DgcApp" lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content="">
<title ng-bind="windowTitle">search</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.min.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/heroic-features.css" rel="stylesheet">
<link href="css/sticky-footer-navbar.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="css/sticky-footer-navbar.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="css/pagination.css" />
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
<script src="lib/angular.js" type="text/javascript" ></script>
<script src="lib/angular-ui-router.js" type="text/javascript" ></script>
<script src="lib/angular-ui-router.min.js" type="text/javascript" ></script>
<script src="http://angular-ui.github.io/bootstrap/ui-bootstrap-tpls-0.6.0.js" type="text/javascript"></script>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<script src="lib/d3.tip.v0.6.3.js"></script>
<script src="js/app.js" type="text/javascript" ></script>
<script src="js/controllers.js" type="text/javascript" ></script>
<style type="text/css">
.node {
font: 15px sans-serif;
opacity: 1.5;
stroke-width: 0.5px;
}
.nodeTrans{
position: relative;
float:left;
left:20px;
}
.node a{
text-decoration:none;
pointer-events: none;
text-anchor: middle;
}
.link {
stroke: #23A410;
stroke-opacity: 1.6;
}
svg { margin:20px; }
#mybounce {
position:fixed; top:0; bottom:0; left:0; right:0
}
#suit{
stroke: #23A410;
background: #23A410;
}
path.link {
fill: none;
stroke: #23A410;
stroke-width: 4px;
cursor: default;
}
svg:not(.active):not(.ctrl) path.link {
cursor: pointer;
}
path.link.selected {
stroke-dasharray: 10,2;
}
path.link.dragline {
pointer-events: none;
}
path.link.hidden {
stroke-width: 0;
}
.navbar-bottom{
background-color:#fafafa;
border-top:solid 4px #5cbb5a;
position:absolute;
width:100%;
height:60px;
}
</style>
</head>
<body>
<a ui-sref="Home">
<div class="col-lg-12" style="margin-left:-15px;margin-top: -70px;background-image:url(img/topbg.jpg); width:1349px; height:187px">
<div class="col-lg-12" style=" padding-top:45px; padding-left:1050px" >
<p style="color:#ffffff"> Hello John Morgan | Help | Logout</p>
</div>
</div>
</a>
<!--SEARCH-->
<div class="col-lg-12" >
<div class="col-lg-4"></div>
<div class="col-lg-6" style="margin-top:-80px; margin-left:-55px;" ng-controller="headerController">
<div class="input-group" >
<input type="text" ng-model="query" ng-keyup="$event.keyCode == 13 && executeSearch()" class="form-control search_table" placeholder="">
<p style="color:#939598"> search: Table, DB, Column </p>
<span class="input-group-btn" >
<button type="submit" class="search_btn" ng-click="executeSearch()" style="margin-bottom: 30px;"></button>
</span> </div>
</div>
<div class="col-lg-4"></div>
</div>
<!--table main-->
<div class="col-lg-1"></div>
<div class="col-lg-10">
<div class="col-lg-3" ng-controller="NavController">
<div class="row" >
<!--nav1-->
<h4 class="greyt ">Tags</h4>
<div class="leftpanal" >
<div class="row">
<div class="litag" ng-repeat="nav in leftnav" style="margin-top: 10px;">
<a ng-click="updateVar($event)" ui-sref="Search({ searchid: nav })" style="color: #636364 !important;">{{nav}} </a>
</div>
</div>
<!--end nav3-->
</div>
</div>
</div>
<div class="main" ui-view="content">
</div>
<div class="col-lg-2"></div>
</div>
<!--<div class="col-lg-12" ng-controller="footerController" style="margin-top: 50px;"><pre><h4>API Version - {{apiVersion}}</h4></pre></div>-->
</body>
</html>
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var DgcApp = angular.module('DgcApp', [
'ui.router',
'DgcControllers',
'ui.bootstrap'
]);
DgcApp.config(['$urlRouterProvider','$stateProvider', function($urlRouterProvider, $stateProvider) {
$urlRouterProvider.otherwise('Home');
$stateProvider
.state('Home', {
url: 'Home',
views: {
'content': {
templateUrl: 'partials/search.html',
controller: 'ListController'
}
}
})
.state('Search', {
url: '/Search/:searchid',
views: {
'content': {
templateUrl: 'partials/search.html',
controller: 'ListController'
}
}
})
.state('details', {
url: 'details/:Id',
views: {
'content': {
templateUrl: 'partials/wiki.html',
controller: 'DefinitionController'
}
}
});
}]);
DgcApp.run(['$window', '$rootScope',
function ($window , $rootScope) {
$rootScope.goBack = function(){
$window.history.back();
return false;
}
}]);
\ No newline at end of file
{ "Search": {
"Table": [
{ "$id$":["id"] },
"name",
{ "description": ["description"] },
"owner",
"createTime",
{ "$traits$":[""]}
],
"DB": [
{ "$id$":["id"] },
"name",
{ "description": ["description"] },
"locationUri",
"owner",
{ "$traits$":[""]}
],
"Column": [
{ "$id$":["id"] },
"name",
"dataType",
"comment",
"table",
{ "$traits$":[""]}
],
"__tempQueryResultStruct": [
{ "instanceInfo": ["guid","typeName"] }
],
"StorageDesc": [
{ "$id$":["id"] },
"compressed",
"outputFormat",
"location",
"inputFormat",
{ "$traits$":[""]}
],
"LoadProcess": [
{ "$id$":["id"] },
{ "inputTables":["id"] },
"name",
"queryText",
"startTime",
"endTime",
{ "$traits$":[""]}
],
"View": [
{ "$id$":["id"] },
{ "inputTables":["id"] },
"name",
{ "$traits$":[""]}
]
}
}
\ No newline at end of file
/*
AngularJS v1.2.18
(c) 2010-2014 Google, Inc. http://angularjs.org
License: MIT
*/
(function(n,e,A){'use strict';function x(s,g,k){return{restrict:"ECA",terminal:!0,priority:400,transclude:"element",link:function(a,c,b,f,w){function y(){p&&(p.remove(),p=null);h&&(h.$destroy(),h=null);l&&(k.leave(l,function(){p=null}),p=l,l=null)}function v(){var b=s.current&&s.current.locals;if(e.isDefined(b&&b.$template)){var b=a.$new(),d=s.current;l=w(b,function(d){k.enter(d,null,l||c,function(){!e.isDefined(t)||t&&!a.$eval(t)||g()});y()});h=d.scope=b;h.$emit("$viewContentLoaded");h.$eval(u)}else y()}
var h,l,p,t=b.autoscroll,u=b.onload||"";a.$on("$routeChangeSuccess",v);v()}}}function z(e,g,k){return{restrict:"ECA",priority:-400,link:function(a,c){var b=k.current,f=b.locals;c.html(f.$template);var w=e(c.contents());b.controller&&(f.$scope=a,f=g(b.controller,f),b.controllerAs&&(a[b.controllerAs]=f),c.data("$ngControllerController",f),c.children().data("$ngControllerController",f));w(a)}}}n=e.module("ngRoute",["ng"]).provider("$route",function(){function s(a,c){return e.extend(new (e.extend(function(){},
{prototype:a})),c)}function g(a,e){var b=e.caseInsensitiveMatch,f={originalPath:a,regexp:a},k=f.keys=[];a=a.replace(/([().])/g,"\\$1").replace(/(\/)?:(\w+)([\?\*])?/g,function(a,e,b,c){a="?"===c?c:null;c="*"===c?c:null;k.push({name:b,optional:!!a});e=e||"";return""+(a?"":e)+"(?:"+(a?e:"")+(c&&"(.+?)"||"([^/]+)")+(a||"")+")"+(a||"")}).replace(/([\/$\*])/g,"\\$1");f.regexp=RegExp("^"+a+"$",b?"i":"");return f}var k={};this.when=function(a,c){k[a]=e.extend({reloadOnSearch:!0},c,a&&g(a,c));if(a){var b=
"/"==a[a.length-1]?a.substr(0,a.length-1):a+"/";k[b]=e.extend({redirectTo:a},g(b,c))}return this};this.otherwise=function(a){this.when(null,a);return this};this.$get=["$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache","$sce",function(a,c,b,f,g,n,v,h){function l(){var d=p(),m=r.current;if(d&&m&&d.$$route===m.$$route&&e.equals(d.pathParams,m.pathParams)&&!d.reloadOnSearch&&!u)m.params=d.params,e.copy(m.params,b),a.$broadcast("$routeUpdate",m);else if(d||m)u=!1,a.$broadcast("$routeChangeStart",
d,m),(r.current=d)&&d.redirectTo&&(e.isString(d.redirectTo)?c.path(t(d.redirectTo,d.params)).search(d.params).replace():c.url(d.redirectTo(d.pathParams,c.path(),c.search())).replace()),f.when(d).then(function(){if(d){var a=e.extend({},d.resolve),c,b;e.forEach(a,function(d,c){a[c]=e.isString(d)?g.get(d):g.invoke(d)});e.isDefined(c=d.template)?e.isFunction(c)&&(c=c(d.params)):e.isDefined(b=d.templateUrl)&&(e.isFunction(b)&&(b=b(d.params)),b=h.getTrustedResourceUrl(b),e.isDefined(b)&&(d.loadedTemplateUrl=
b,c=n.get(b,{cache:v}).then(function(a){return a.data})));e.isDefined(c)&&(a.$template=c);return f.all(a)}}).then(function(c){d==r.current&&(d&&(d.locals=c,e.copy(d.params,b)),a.$broadcast("$routeChangeSuccess",d,m))},function(c){d==r.current&&a.$broadcast("$routeChangeError",d,m,c)})}function p(){var a,b;e.forEach(k,function(f,k){var q;if(q=!b){var g=c.path();q=f.keys;var l={};if(f.regexp)if(g=f.regexp.exec(g)){for(var h=1,p=g.length;h<p;++h){var n=q[h-1],r="string"==typeof g[h]?decodeURIComponent(g[h]):
g[h];n&&r&&(l[n.name]=r)}q=l}else q=null;else q=null;q=a=q}q&&(b=s(f,{params:e.extend({},c.search(),a),pathParams:a}),b.$$route=f)});return b||k[null]&&s(k[null],{params:{},pathParams:{}})}function t(a,c){var b=[];e.forEach((a||"").split(":"),function(a,d){if(0===d)b.push(a);else{var e=a.match(/(\w+)(.*)/),f=e[1];b.push(c[f]);b.push(e[2]||"");delete c[f]}});return b.join("")}var u=!1,r={routes:k,reload:function(){u=!0;a.$evalAsync(l)}};a.$on("$locationChangeSuccess",l);return r}]});n.provider("$routeParams",
function(){this.$get=function(){return{}}});n.directive("ngView",x);n.directive("ngView",z);x.$inject=["$route","$anchorScroll","$animate"];z.$inject=["$compile","$controller","$route"]})(window,window.angular);
//# sourceMappingURL=angular-route.min.js.map
{
"version":3,
"file":"angular-route.min.js",
"lineCount":13,
"mappings":"A;;;;;aAKC,SAAQ,CAACA,CAAD,CAASC,CAA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,KAAA,CAAYgE,CAAZ,CADF,KAEO,CACL,IAAIC,EAAeD,CAAAZ,MAAA,CAAc,WAAd,CAAnB,CACIxD,EAAMqE,CAAA,CAAa,CAAb,CACVH,EAAA9D,KAAA,CAAYY,CAAA,CAAOhB,CAAP,CAAZ,CACAkE,EAAA9D,KAAA,CAAYiE,CAAA,CAAa,CAAb,CAAZ,EAA+B,EAA/B,CACA,QAAOrD,CAAA,CAAOhB,CAAP,CALF,CAHqD,CAA9D,CAWA,OAAOkE,EAAAI,KAAA,CAAY,EAAZ,CAb4B,CA7VuD,IA8LxFpC,EAAc,CAAA,CA9L0E,CA+LxF7F,EAAS,QACCkE,CADD,QAeCgE,QAAQ,EAAG,CACjBrC,CAAA,CAAc,CAAA,CACdhB,EAAAsD,WAAA,CAAsB9C,CAAtB,CAFiB,CAfZ,CAqBbR,EAAA/C,IAAA,CAAe,wBAAf,CAAyCuD,CAAzC,CAEA,OAAOrF,EAtNqF,CARlF,CA5LW,CAlBL,CAqkBpByC,EAAAE,SAAA,CAAuB,cAAvB;AAoCAyF,QAA6B,EAAG,CAC9B,IAAAxD,KAAA,CAAYyD,QAAQ,EAAG,CAAE,MAAO,EAAT,CADO,CApChC,CAwCA5F,EAAA6F,UAAA,CAAwB,QAAxB,CAAkCvI,CAAlC,CACA0C,EAAA6F,UAAA,CAAwB,QAAxB,CAAkCvG,CAAlC,CAiLAhC,EAAAwI,QAAA,CAAwB,CAAC,QAAD,CAAW,eAAX,CAA4B,UAA5B,CAoExBxG,EAAAwG,QAAA,CAAmC,CAAC,UAAD,CAAa,aAAb,CAA4B,QAA5B,CAt3BG,CAArC,CAAA,CAm5BE3I,MAn5BF,CAm5BUA,MAAAC,QAn5BV;",
"sources":["angular-route.js"],
"names":["window","angular","undefined","ngViewFactory","$route","$anchorScroll","$animate","link","scope","$element","attr","ctrl","$transclude","cleanupLastView","currentScope","$destroy","currentElement","leave","update","locals","current","isDefined","$template","newScope","$new","clone","enter","onNgViewEnter","autoScrollExp","$eval","$emit","onloadExp","autoscroll","onload","$on","ngViewFillContentFactory","$compile","$controller","html","contents","controller","$scope","controllerAs","data","children","ngRouteModule","module","provider","$RouteProvider","inherit","parent","extra","extend","pathRegExp","path","opts","insensitive","caseInsensitiveMatch","ret","keys","replace","_","slash","key","option","optional","star","push","regexp","RegExp","routes","when","this.when","route","redirectPath","length","substr","otherwise","this.otherwise","params","$get","$rootScope","$location","$routeParams","$q","$injector","$http","$templateCache","$sce","updateRoute","next","parseRoute","last","$$route","equals","pathParams","reloadOnSearch","forceReload","copy","$broadcast","redirectTo","isString","interpolate","search","url","then","resolve","template","templateUrl","forEach","value","get","invoke","isFunction","getTrustedResourceUrl","loadedTemplateUrl","response","all","error","match","m","exec","on","i","len","val","decodeURIComponent","name","string","result","split","segment","segmentMatch","join","reload","$evalAsync","$RouteParamsProvider","this.$get","directive","$inject"]
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
// d3.tip
// Copyright (c) 2013 Justin Palmer
//
// Tooltips for d3.js SVG visualizations
// Public - contructs a new tooltip
//
// Returns a tip
d3.tip = function() {
var direction = d3_tip_direction,
offset = d3_tip_offset,
html = d3_tip_html,
node = initNode(),
svg = null,
point = null,
target = null
function tip(vis) {
svg = getSVGNode(vis)
if(!svg){
return;
}
point = svg.createSVGPoint()
document.body.appendChild(node)
}
// Public - show the tooltip on the screen
//
// Returns a tip
tip.show = function() {
var args = Array.prototype.slice.call(arguments)
if(args[args.length - 1] instanceof SVGElement) target = args.pop()
var content = html.apply(this, args),
poffset = offset.apply(this, args),
dir = direction.apply(this, args),
nodel = d3.select(node), i = 0,
coords
nodel.html(content)
.style({ opacity: 1, 'pointer-events': 'all' })
while(i--) nodel.classed(directions[i], false)
coords = direction_callbacks.get(dir).apply(this)
nodel.classed(dir, true).style({
top: (coords.top + poffset[0]) + 'px',
left: (coords.left + poffset[1]) + 'px'
})
return tip
}
// Public - hide the tooltip
//
// Returns a tip
tip.hide = function() {
nodel = d3.select(node)
nodel.style({ opacity: 0, 'pointer-events': 'none' })
return tip
}
// Public: Proxy attr calls to the d3 tip container. Sets or gets attribute value.
//
// n - name of the attribute
// v - value of the attribute
//
// Returns tip or attribute value
tip.attr = function(n, v) {
if (arguments.length < 2 && typeof n === 'string') {
return d3.select(node).attr(n)
} else {
var args = Array.prototype.slice.call(arguments)
d3.selection.prototype.attr.apply(d3.select(node), args)
}
return tip
}
// Public: Proxy style calls to the d3 tip container. Sets or gets a style value.
//
// n - name of the property
// v - value of the property
//
// Returns tip or style property value
tip.style = function(n, v) {
if (arguments.length < 2 && typeof n === 'string') {
return d3.select(node).style(n)
} else {
var args = Array.prototype.slice.call(arguments)
d3.selection.prototype.style.apply(d3.select(node), args)
}
return tip
}
// Public: Set or get the direction of the tooltip
//
// v - One of n(north), s(south), e(east), or w(west), nw(northwest),
// sw(southwest), ne(northeast) or se(southeast)
//
// Returns tip or direction
tip.direction = function(v) {
if (!arguments.length) return direction
direction = v == null ? v : d3.functor(v)
return tip
}
// Public: Sets or gets the offset of the tip
//
// v - Array of [x, y] offset
//
// Returns offset or
tip.offset = function(v) {
if (!arguments.length) return offset
offset = v == null ? v : d3.functor(v)
return tip
}
// Public: sets or gets the html value of the tooltip
//
// v - String value of the tip
//
// Returns html value or tip
tip.html = function(v) {
if (!arguments.length) return html
html = v == null ? v : d3.functor(v)
return tip
}
function d3_tip_direction() { return 'n' }
function d3_tip_offset() { return [0, 0] }
function d3_tip_html() { return ' ' }
var direction_callbacks = d3.map({
n: direction_n,
s: direction_s,
e: direction_e,
w: direction_w,
nw: direction_nw,
ne: direction_ne,
sw: direction_sw,
se: direction_se
}),
directions = direction_callbacks.keys()
function direction_n() {
var bbox = getScreenBBox()
return {
top: bbox.n.y - node.offsetHeight,
left: bbox.n.x - node.offsetWidth / 2
}
}
function direction_s() {
var bbox = getScreenBBox()
return {
top: bbox.s.y,
left: bbox.s.x - node.offsetWidth / 2
}
}
function direction_e() {
var bbox = getScreenBBox()
return {
top: bbox.e.y - node.offsetHeight / 2,
left: bbox.e.x
}
}
function direction_w() {
var bbox = getScreenBBox()
return {
top: bbox.w.y - node.offsetHeight / 2,
left: bbox.w.x - node.offsetWidth
}
}
function direction_nw() {
var bbox = getScreenBBox()
return {
top: bbox.nw.y - node.offsetHeight,
left: bbox.nw.x - node.offsetWidth
}
}
function direction_ne() {
var bbox = getScreenBBox()
return {
top: bbox.ne.y - node.offsetHeight,
left: bbox.ne.x
}
}
function direction_sw() {
var bbox = getScreenBBox()
return {
top: bbox.sw.y,
left: bbox.sw.x - node.offsetWidth
}
}
function direction_se() {
var bbox = getScreenBBox()
return {
top: bbox.se.y,
left: bbox.e.x
}
}
function initNode() {
var node = d3.select(document.createElement('div'))
node.style({
position: 'absolute',
opacity: 0,
pointerEvents: 'none',
boxSizing: 'border-box'
})
return node.node()
}
function getSVGNode(el) {
el = el.node()
if(!el){
return;
}
if(el.tagName.toLowerCase() == 'svg')
return el
return el.ownerSVGElement
}
// Private - gets the screen coordinates of a shape
//
// Given a shape on the screen, will return an SVGPoint for the directions
// n(north), s(south), e(east), w(west), ne(northeast), se(southeast), nw(northwest),
// sw(southwest).
//
// +-+-+
// | |
// + +
// | |
// +-+-+
//
// Returns an Object {n, s, e, w, nw, sw, ne, se}
function getScreenBBox() {
var targetel = target || d3.event.target,
bbox = {},
matrix = targetel.getScreenCTM(),
tbbox = targetel.getBBox(),
width = tbbox.width,
height = tbbox.height,
x = tbbox.x,
y = tbbox.y,
scrollTop = document.documentElement.scrollTop || document.body.scrollTop,
scrollLeft = document.documentElement.scrollLeft || document.body.scrollLeft
point.x = x + scrollLeft
point.y = y + scrollTop
bbox.nw = point.matrixTransform(matrix)
point.x += width
bbox.ne = point.matrixTransform(matrix)
point.y += height
bbox.se = point.matrixTransform(matrix)
point.x -= width
bbox.sw = point.matrixTransform(matrix)
point.y -= height / 2
bbox.w = point.matrixTransform(matrix)
point.x += width
bbox.e = point.matrixTransform(matrix)
point.x -= width / 2
point.y -= height / 2
bbox.n = point.matrixTransform(matrix)
point.y += height
bbox.s = point.matrixTransform(matrix)
return bbox
}
return tip
};
// NOTICE!! DO NOT USE ANY OF THIS JAVASCRIPT
// IT'S JUST JUNK FOR OUR DOCS!
// ++++++++++++++++++++++++++++++++++++++++++
/*!
* Copyright 2014 Twitter, Inc.
*
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
* details, see http://creativecommons.org/licenses/by/3.0/.
*/
// Intended to prevent false-positive bug reports about Bootstrap not working properly in old versions of IE due to folks testing using IE's unreliable emulation modes.
(function () {
'use strict';
function emulatedIEMajorVersion() {
var groups = /MSIE ([0-9.]+)/.exec(window.navigator.userAgent)
if (groups === null) {
return null
}
var ieVersionNum = parseInt(groups[1], 10)
var ieMajorVersion = Math.floor(ieVersionNum)
return ieMajorVersion
}
function actualNonEmulatedIEMajorVersion() {
// Detects the actual version of IE in use, even if it's in an older-IE emulation mode.
// IE JavaScript conditional compilation docs: http://msdn.microsoft.com/en-us/library/ie/121hztk3(v=vs.94).aspx
// @cc_on docs: http://msdn.microsoft.com/en-us/library/ie/8ka90k2e(v=vs.94).aspx
var jscriptVersion = new Function('/*@cc_on return @_jscript_version; @*/')() // jshint ignore:line
if (jscriptVersion === undefined) {
return 11 // IE11+ not in emulation mode
}
if (jscriptVersion < 9) {
return 8 // IE8 (or lower; haven't tested on IE<8)
}
return jscriptVersion // IE9 or IE10 in any mode, or IE11 in non-IE11 mode
}
var ua = window.navigator.userAgent
if (ua.indexOf('Opera') > -1 || ua.indexOf('Presto') > -1) {
return // Opera, which might pretend to be IE
}
var emulated = emulatedIEMajorVersion()
if (emulated === null) {
return // Not IE
}
var nonEmulated = actualNonEmulatedIEMajorVersion()
if (emulated !== nonEmulated) {
window.alert('WARNING: You appear to be using IE' + nonEmulated + ' in IE' + emulated + ' emulation mode.\nIE emulation modes can behave significantly differently from ACTUAL older versions of IE.\nPLEASE DON\'T FILE BOOTSTRAP BUGS based on testing in IE emulation modes!')
}
})();
/*!
* IE10 viewport hack for Surface/desktop Windows 8 bug
* Copyright 2014 Twitter, Inc.
* Licensed under the Creative Commons Attribution 3.0 Unported License. For
* details, see http://creativecommons.org/licenses/by/3.0/.
*/
// See the Getting Started docs for more information:
// http://getbootstrap.com/getting-started/#support-ie10-width
(function () {
'use strict';
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement('style')
msViewportStyle.appendChild(
document.createTextNode(
'@-ms-viewport{width:auto!important}'
)
)
document.querySelector('head').appendChild(msViewportStyle)
}
})();
// This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment.
require('../../js/transition.js')
require('../../js/alert.js')
require('../../js/button.js')
require('../../js/carousel.js')
require('../../js/collapse.js')
require('../../js/dropdown.js')
require('../../js/modal.js')
require('../../js/tooltip.js')
require('../../js/popover.js')
require('../../js/scrollspy.js')
require('../../js/tab.js')
require('../../js/affix.js')
\ No newline at end of file
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
--> <!-- Page Content -->
<!--right panel-->
<div class="col-lg-8 mrgl45">
<div class="col-lg-12">
<h4 class="greyt" ng-hide="isUndefined(SearchQuery)" style="font: 15px sans-serif">{{itemlength}} results found for {{SearchQuery}}</h4>
<h4 ng-show="isUndefined(SearchQuery)">Results</h4>
</div>
<div class="col-lg-12 rightpanal">
<!--1-->
<div class="col-lg-12 div_ex" style="margin-top:30px" ng-repeat="(key, value) in pagedItems[currentPage]">
<div class="row">
<div ng-repeat="(k, v) in configdata">
<div class="col-xs-10" ng-if="datatype === k">
<span ng-repeat="(key1, value1) in v">
<span ng-if="isString(value1)">
<span class="resulttxt" ng-if="!(value1=='name')">
<b> {{value1}} : </b> {{value[value1] | date:'medium'}}<span ng-show=" ! $last ">,</span>
</span>
</span>
<span ng-if="value1.inputTables">
<span class="resulttxt">
<b> inputTables : </b> <span ng-repeat="(inkey, invalue) in value.inputTables"> <span ng-controller="GuidController"> <span ng-init="getGuidName(invalue.id)"> <span ng-repeat="x in gnew track by $index">{{x}}</span>, </span> </span> </span>
</span>
</span>
<div ng-if="value1.$id$">
<div class="col-lg-12" style="margin-left:-40px;">
<img src="img/arrow.png"> <span class="guidtxt">
<a ui-sref="details({ Id: value['$id$'].id })" style="color: #636364 !important;">{{value['name']}}</a></span>
</div>
</br>
</div>
<div ng-if="value1.instanceInfo" ng-controller="GuidController">
<div class="col-lg-12" style="margin-left:-40px;">
<img src="img/arrow.png"> <span class="guidtxt" ui-sref="details({ Id: value['instanceInfo'].guid })" style="color: #636364 !important;" ng-init="getGuidName(value['instanceInfo'].guid)">
<a ui-sref="details({ Id: value['instanceInfo'].guid })" style="color: #636364 !important;" ng-repeat="x in gnew track by $index">{{x}}</a>
</span>
</div>
</br>
<div class="col-lg-12" style="margin-left: -15px;">
<p>{{value['instanceInfo'].typeName}}</p>
</div>
</div>
<div ng-if="value1.description">
<div class="col-lg-12" style="margin-left: -15px;">
<p>{{value['description']}}</p>
</div>
</br>
</div>
<div ng-if="value1.$traits$" class="col-lg-12 guidtxt2" style="margin-left: -15px;">Tags:
<b ng-if="isObject(value['$traits$'])">
<u ng-repeat="(keytag, valtag) in value['$traits$']">
<a ng-click="updateVars($event)" ui-sref="Search({ searchid: keytag })" style="color: #636364 !important;">{{keytag}}</a>
</u>
</b>
</div>
</span>
</div>
<!--1-->
</div>
</div>
</div>
<div class="col-lg-12 img2" align="right"><img src="img/img2.png"></div>
<br/>
<br/>
<br/>
<div class="col-lg-12" >
<!-- DC Pagination:A1 Start -->
<ul class="tsc_pagination tsc_paginationA tsc_paginationA01" style="margin-top:-30px" ng-show="Showpaging(pagedItems.length)">
<li ng-class="{disabled: currentPage == 0}"><a href ng-click="firstPage()" class="first">First</a></li>
<li><a href ng-click="prevPage()" class="previous">Previous</a></li>
<li ng-repeat="n in range(pagedItems.length)" nd-class="{current: n == currentPage}" ng-click="setPage()"><a href ng-bind="n+1">1</a></li>
<li ng-class="{disabled: currentPage == pagedItems.length-1}"><a href ng-click="nextPage()" class="next">Next</a></li>
<li ng-class="{disabled: currentPage == pagedItems.length-1}"><a href ng-click="lastPage()" class="last">Last</a></li>
</ul>
</div>
</div>
</div>
......@@ -55,6 +55,11 @@ public class DefaultGraphPersistenceStrategy implements GraphPersistenceStrategi
}
@Override
public String superTypeAttributeName() {
return metadataRepository.getSuperTypeAttributeName();
}
@Override
public String edgeLabel(IDataType<?> dataType, AttributeInfo aInfo) {
return metadataRepository.getEdgeLabel(dataType, aInfo);
}
......@@ -107,7 +112,7 @@ public class DefaultGraphPersistenceStrategy implements GraphPersistenceStrategi
TypeSystem.IdType idType = TypeSystem.getInstance().getIdType();
if ( dataType.getName() == idType.getName()) {
if (dataType.getName().equals(idType.getName())) {
structInstance.set(idType.typeNameAttrName(),
structVertex.getProperty(typeAttributeName()));
structInstance.set(idType.idAttrName(),
......
......@@ -23,8 +23,6 @@ import com.thinkaurelius.titan.core.TitanIndexQuery;
import com.thinkaurelius.titan.core.TitanProperty;
import com.thinkaurelius.titan.core.TitanVertex;
import com.tinkerpop.blueprints.Vertex;
import org.apache.commons.lang.StringUtils;
import org.apache.hadoop.metadata.MetadataException;
import org.apache.hadoop.metadata.discovery.DiscoveryException;
import org.apache.hadoop.metadata.discovery.DiscoveryService;
import org.apache.hadoop.metadata.query.Expressions;
......@@ -52,7 +50,6 @@ import javax.script.ScriptEngine;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
......
......@@ -32,6 +32,15 @@ public final class Constants {
public static final String ENTITY_TYPE_PROPERTY_KEY = "typeName";
public static final String ENTITY_TYPE_INDEX = "type_index";
/**
* Entity type's super types property key.
*/
public static final String SUPER_TYPES_PROPERTY_KEY = "superTypeNames";
public static final String SUPER_TYPES_INDEX = "super_types_index";
/**
* Full-text for the entity for enabling full-text search.
*/
public static final String ENTITY_TEXT_PROPERTY_KEY = "entityText";
/**
......
......@@ -39,6 +39,13 @@ public interface MetadataRepository {
String getTypeAttributeName();
/**
* Returns the property key used to store super type names.
*
* @return property key used to store super type names.
*/
String getSuperTypeAttributeName();
/**
* Return the property key used to store a given traitName in the repository.
*
* @param dataType data type
......
......@@ -90,10 +90,14 @@ public class GraphBackedSearchIndexer implements SearchIndexer {
createCompositeAndMixedIndex(Constants.ENTITY_TYPE_INDEX,
Constants.ENTITY_TYPE_PROPERTY_KEY, String.class, false, Cardinality.SINGLE);
// create a composite and mixed index for type since it can be combined with other keys
createCompositeAndMixedIndex(Constants.SUPER_TYPES_INDEX,
Constants.SUPER_TYPES_PROPERTY_KEY, String.class, false, Cardinality.SET);
// create a composite and mixed index for traitNames since it can be combined with other
// keys. Traits must be a set and not a list.
createCompositeAndMixedIndex(Constants.TRAIT_NAMES_INDEX, Constants.TRAIT_NAMES_PROPERTY_KEY, String.class,
false, Cardinality.SET);
createCompositeAndMixedIndex(Constants.TRAIT_NAMES_INDEX,
Constants.TRAIT_NAMES_PROPERTY_KEY, String.class, false, Cardinality.SET);
// Index for full text search
createFullTextIndex();
......
......@@ -19,6 +19,7 @@
package org.apache.hadoop.metadata.repository.graph;
import com.thinkaurelius.titan.core.TitanGraph;
import com.thinkaurelius.titan.core.TitanVertex;
import com.tinkerpop.blueprints.Direction;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Graph;
......@@ -31,6 +32,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.Iterator;
import java.util.Set;
import java.util.UUID;
/**
......@@ -44,9 +46,10 @@ public final class GraphHelper {
}
public static Vertex createVertexWithIdentity(Graph graph,
ITypedReferenceableInstance typedInstance) {
ITypedReferenceableInstance typedInstance,
Set<String> superTypeNames) {
final Vertex vertexWithIdentity = createVertexWithoutIdentity(
graph, typedInstance.getTypeName(), typedInstance.getId());
graph, typedInstance.getTypeName(), typedInstance.getId(), superTypeNames);
// add identity
final String guid = UUID.randomUUID().toString();
......@@ -57,12 +60,19 @@ public final class GraphHelper {
public static Vertex createVertexWithoutIdentity(Graph graph,
String typeName,
Id typedInstanceId) {
Id typedInstanceId,
Set<String> superTypeNames) {
final Vertex vertexWithoutIdentity = graph.addVertex(null);
// add type information
vertexWithoutIdentity.setProperty(Constants.ENTITY_TYPE_PROPERTY_KEY, typeName);
// add super types
for (String superTypeName : superTypeNames) {
((TitanVertex) vertexWithoutIdentity).addProperty(
Constants.SUPER_TYPES_PROPERTY_KEY, superTypeName);
}
// add version information
vertexWithoutIdentity.setProperty(Constants.VERSION_PROPERTY_KEY, typedInstanceId.version);
......@@ -75,7 +85,7 @@ public final class GraphHelper {
public static Edge addEdge(TitanGraph titanGraph, Vertex fromVertex, Vertex toVertex,
String edgeLabel) {
LOG.debug("Adding edge for {} -> struct label {} -> v{}",
LOG.debug("Adding edge for {} -> label {} -> {}",
fromVertex, edgeLabel, toVertex);
return titanGraph.addEdge(null, fromVertex, toVertex, edgeLabel);
......
......@@ -45,6 +45,11 @@ trait GraphPersistenceStrategies {
def typeAttributeName: String
/**
* Name of attribute used to store super type names in vertex.
*/
def superTypeAttributeName: String
/**
* Name of attribute used to store guid in vertex
*/
def idAttributeName : String
......@@ -113,6 +118,7 @@ trait GraphPersistenceStrategies {
object GraphPersistenceStrategy1 extends GraphPersistenceStrategies {
val typeAttributeName = "typeName"
val superTypeAttributeName = "superTypeNames"
val idAttributeName = "guid"
def edgeLabel(dataType: IDataType[_], aInfo: AttributeInfo) = s"${dataType.getName}.${aInfo.name}"
......
......@@ -151,7 +151,7 @@ public final class TestUtils {
jane.set("name", "Jane");
jane.set("department", hrDept);
janeAddr.set("street", "Great Americal Parkway");
janeAddr.set("street", "Great America Parkway");
janeAddr.set("city", "Santa Clara");
jane.set("address", janeAddr);
......
......@@ -18,6 +18,7 @@
package org.apache.hadoop.metadata.discovery;
import com.google.common.collect.ImmutableList;
import com.thinkaurelius.titan.core.TitanGraph;
import com.tinkerpop.blueprints.Edge;
import com.tinkerpop.blueprints.Vertex;
......@@ -33,6 +34,8 @@ import org.apache.hadoop.metadata.repository.graph.GraphProvider;
import org.apache.hadoop.metadata.typesystem.ITypedReferenceableInstance;
import org.apache.hadoop.metadata.typesystem.Referenceable;
import org.apache.hadoop.metadata.typesystem.types.ClassType;
import org.apache.hadoop.metadata.typesystem.types.DataTypes;
import org.apache.hadoop.metadata.typesystem.types.HierarchicalTypeDefinition;
import org.apache.hadoop.metadata.typesystem.types.Multiplicity;
import org.apache.hadoop.metadata.typesystem.types.TypeSystem;
import org.codehaus.jettison.json.JSONArray;
......@@ -51,6 +54,10 @@ import javax.script.ScriptEngineManager;
import javax.script.ScriptException;
import java.io.File;
import static org.apache.hadoop.metadata.typesystem.types.utils.TypesUtil.createClassTypeDef;
import static org.apache.hadoop.metadata.typesystem.types.utils.TypesUtil.createOptionalAttrDef;
import static org.apache.hadoop.metadata.typesystem.types.utils.TypesUtil.createRequiredAttrDef;
@Guice(modules = RepositoryMetadataModule.class)
public class GraphBackedDiscoveryServiceTest {
......@@ -292,4 +299,54 @@ public class GraphBackedDiscoveryServiceTest {
Assert.assertNotEquals(name, "null");
}
}
@Test
public void testSearchForTypeInheritance() throws Exception {
createTypesWithMultiLevelInheritance();
createInstances();
String dslQuery = "from D where a = 1";
String jsonResults = discoveryService.searchByDSL(dslQuery);
Assert.assertNotNull(jsonResults);
JSONObject results = new JSONObject(jsonResults);
System.out.println("results = " + results);
}
/*
* Type Hierarchy is:
* A(a)
* B(b) extends A
* C(c) extends B
* D(d) extends C
*/
private void createTypesWithMultiLevelInheritance() throws Exception {
HierarchicalTypeDefinition A = createClassTypeDef("A", null,
createRequiredAttrDef("a", DataTypes.INT_TYPE));
HierarchicalTypeDefinition B = createClassTypeDef("B", ImmutableList.of("A"),
createOptionalAttrDef("b", DataTypes.BOOLEAN_TYPE));
HierarchicalTypeDefinition C = createClassTypeDef("C", ImmutableList.of("B"),
createOptionalAttrDef("c", DataTypes.BYTE_TYPE));
HierarchicalTypeDefinition D = createClassTypeDef("D", ImmutableList.of("C"),
createOptionalAttrDef("d", DataTypes.SHORT_TYPE));
TypeSystem.getInstance().defineClassTypes(A, B, C, D);
}
private void createInstances() throws Exception {
Referenceable instance = new Referenceable("D");
instance.set("d", 1);
instance.set("c", 1);
instance.set("b", true);
instance.set("a", 1);
ClassType deptType = TypeSystem.getInstance().getDataType(ClassType.class, "D");
ITypedReferenceableInstance typedInstance =
deptType.convert(instance, Multiplicity.REQUIRED);
repositoryService.createEntity(typedInstance);
}
}
\ No newline at end of file
......@@ -75,6 +75,7 @@ public class GraphBackedMetadataRepositoryTest {
private static final String TABLE_NAME = "bar";
private static final String CLASSIFICATION = "classification";
private static final String PII = "PII";
private static final String SUPER_TYPE_NAME = "Base";
@Inject
private GraphProvider<TitanGraph> graphProvider;
......@@ -101,8 +102,8 @@ public class GraphBackedMetadataRepositoryTest {
/*
@AfterMethod
public void tearDown() {
dumpGraph();
public void tearDown() throws Exception {
TestUtils.dumpGraph(graphProvider.get());
}
*/
......@@ -144,9 +145,9 @@ public class GraphBackedMetadataRepositoryTest {
@Test (dependsOnMethods = "testSubmitEntity")
public void testGetTraitLabel() throws Exception {
Assert.assertEquals(repositoryService.getTraitLabel(typeSystem.getDataType(ClassType.class, TABLE_TYPE),
CLASSIFICATION),
TABLE_TYPE + "." + CLASSIFICATION);
Assert.assertEquals(repositoryService.getTraitLabel(
typeSystem.getDataType(ClassType.class, TABLE_TYPE),
CLASSIFICATION), TABLE_TYPE + "." + CLASSIFICATION);
}
@Test
......@@ -154,6 +155,10 @@ public class GraphBackedMetadataRepositoryTest {
Referenceable databaseInstance = new Referenceable(DATABASE_TYPE);
databaseInstance.set("name", DATABASE_NAME);
databaseInstance.set("description", "foo database");
databaseInstance.set("namespace", "colo:cluster:hive:db");
databaseInstance.set("cluster", "cluster-1");
databaseInstance.set("colo", "colo-1");
System.out.println("databaseInstance = " + databaseInstance);
ClassType dbType = typeSystem.getDataType(ClassType.class, DATABASE_TYPE);
......@@ -329,17 +334,12 @@ public class GraphBackedMetadataRepositoryTest {
String response = discoveryService.searchByFullText("john");
Assert.assertNotNull(response);
JSONArray results = new JSONArray(response);
System.out.println("Found the following results");
for (int i = 0 ; i < results.length(); i++) {
JSONObject myrow = results.getJSONObject(i);
System.out.println(myrow.toString());
}
Assert.assertEquals(results.length(), 1);
JSONObject row = (JSONObject) results.get(0);
Assert.assertEquals(row.get("typeName"), "Person");
//person in hr department who lives in santa clara
response = discoveryService.searchByFullText("hr AND santa AND clara");
response = discoveryService.searchByFullText("Jane AND santa AND clara");
Assert.assertNotNull(response);
results = new JSONArray(response);
Assert.assertEquals(results.length(), 1);
......@@ -355,27 +355,17 @@ public class GraphBackedMetadataRepositoryTest {
Assert.assertEquals(row.get("typeName"), "Person");
}
/*
private void dumpGraph() {
TitanGraph graph = titanGraphService.getTitanGraph();
System.out.println("*******************Graph Dump****************************");
System.out.println("Vertices of " + graph);
for (Vertex vertex : graph.getVertices()) {
System.out.println(GraphHelper.vertexString(vertex));
}
System.out.println("Edges of " + graph);
for (Edge edge : graph.getEdges()) {
System.out.println(GraphHelper.edgeString(edge));
}
System.out.println("*******************Graph Dump****************************");
}
*/
private void createHiveTypes() throws Exception {
HierarchicalTypeDefinition<ClassType> superTypeDefinition =
TypesUtil.createClassTypeDef(SUPER_TYPE_NAME,
ImmutableList.<String>of(),
TypesUtil.createOptionalAttrDef("namespace", DataTypes.STRING_TYPE),
TypesUtil.createOptionalAttrDef("cluster", DataTypes.STRING_TYPE),
TypesUtil.createOptionalAttrDef("colo", DataTypes.STRING_TYPE));
HierarchicalTypeDefinition<ClassType> databaseTypeDefinition =
TypesUtil.createClassTypeDef(DATABASE_TYPE,
ImmutableList.<String>of(),
ImmutableList.of(SUPER_TYPE_NAME),
TypesUtil.createUniqueRequiredAttrDef("name", DataTypes.STRING_TYPE),
TypesUtil.createRequiredAttrDef("description", DataTypes.STRING_TYPE));
......@@ -408,7 +398,7 @@ public class GraphBackedMetadataRepositoryTest {
HierarchicalTypeDefinition<ClassType> tableTypeDefinition =
TypesUtil.createClassTypeDef(TABLE_TYPE,
ImmutableList.<String>of(),
ImmutableList.of(SUPER_TYPE_NAME),
TypesUtil.createUniqueRequiredAttrDef("name", DataTypes.STRING_TYPE),
TypesUtil.createRequiredAttrDef("description", DataTypes.STRING_TYPE),
TypesUtil.createRequiredAttrDef("type", DataTypes.STRING_TYPE),
......@@ -457,10 +447,16 @@ public class GraphBackedMetadataRepositoryTest {
ImmutableList.<String>of(),
TypesUtil.createRequiredAttrDef("tag", DataTypes.STRING_TYPE));
HierarchicalTypeDefinition<TraitType> fetlClassificationTypeDefinition =
TypesUtil.createTraitTypeDef("fetl" + CLASSIFICATION,
ImmutableList.of(CLASSIFICATION),
TypesUtil.createRequiredAttrDef("tag", DataTypes.STRING_TYPE));
typeSystem.defineTypes(
ImmutableList.of(structTypeDefinition, partitionDefinition),
ImmutableList.of(classificationTypeDefinition),
ImmutableList.of(databaseTypeDefinition, columnsDefinition, tableTypeDefinition));
ImmutableList.of(classificationTypeDefinition, fetlClassificationTypeDefinition),
ImmutableList.of(superTypeDefinition, databaseTypeDefinition,
columnsDefinition, tableTypeDefinition));
}
private ITypedReferenceableInstance createHiveTableInstance(
......@@ -471,6 +467,11 @@ public class GraphBackedMetadataRepositoryTest {
tableInstance.set("type", "managed");
tableInstance.set("tableType", 1); // enum
// super type
tableInstance.set("namespace", "colo:cluster:hive:db:table");
tableInstance.set("cluster", "cluster-1");
tableInstance.set("colo", "colo-1");
// refer to an existing class
tableInstance.set("database", databaseInstance);
......
......@@ -36,7 +36,7 @@ import scala.collection.JavaConversions._
package object dsl {
val defFormat = new DefaultFormats {
override protected def dateFormatter = new SimpleDateFormat("yyyy-MM-dd")
override protected def dateFormatter = TypeSystem.getInstance().getDateFormat;
override val typeHints = NoTypeHints
}
......
......@@ -120,7 +120,7 @@ class DSLTest {
Assert.assertEquals(s"${i.o.asInstanceOf[java.util.Map[_, _]].keySet}", "[b, a]")
// 5. Serialize mytype instance to Json
Assert.assertEquals(s"${pretty(render(i))}", "{\n \"$typeName$\":\"mytype\",\n \"e\":1,\n \"n\":[1,1.100000000000000088817841970012523233890533447265625],\n \"h\":1.0,\n \"b\":true,\n \"k\":1,\n \"j\":1,\n \"d\":2,\n \"m\":[1,1],\n \"g\":1,\n \"a\":1,\n \"i\":1.0,\n \"c\":1,\n \"l\":\"2014-12-03\",\n \"f\":1,\n \"o\":{\n \"b\":2.0,\n \"a\":1.0\n }\n}")
Assert.assertEquals(s"${pretty(render(i))}", "{\n \"$typeName$\":\"mytype\",\n \"e\":1," + "\n \"n\":[1,1.100000000000000088817841970012523233890533447265625],\n \"h\":1.0,\n \"b\":true,\n \"k\":1,\n \"j\":1,\n \"d\":2,\n \"m\":[1,1],\n \"g\":1,\n \"a\":1,\n \"i\":1.0,\n \"c\":1,\n \"l\":\"2014-12-03\",\n \"f\":1,\n \"o\":{\n \"b\":2.0,\n \"a\":1.0\n }\n}")
}
@Test def test2 {
......
......@@ -42,10 +42,10 @@ import java.util.concurrent.ConcurrentHashMap;
@InterfaceAudience.Private
public class TypeSystem {
private static final TypeSystem INSTANCE = new TypeSystem();
public static ThreadLocal<DateFormat> dateFormat = new ThreadLocal() {
private static ThreadLocal<SimpleDateFormat> dateFormat = new ThreadLocal() {
@Override
public DateFormat initialValue() {
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
public SimpleDateFormat initialValue() {
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
return dateFormat;
}
......@@ -225,6 +225,15 @@ public class TypeSystem {
return transientTypes.defineTypes();
}
public Map<String, IDataType> defineClassTypes(
HierarchicalTypeDefinition<ClassType>... classDefs) throws MetadataException {
TransientTypeSystem transientTypes = new TransientTypeSystem(
ImmutableList.<StructTypeDefinition>of(),
ImmutableList.<HierarchicalTypeDefinition<TraitType>>of(),
ImmutableList.copyOf(classDefs));
return transientTypes.defineTypes();
}
public Map<String, IDataType> defineTypes(TypesDef typesDef)
throws MetadataException {
......@@ -285,7 +294,7 @@ public class TypeSystem {
return eT;
}
public DateFormat getDateFormat() {
public SimpleDateFormat getDateFormat() {
return dateFormat.get();
}
......
......@@ -106,6 +106,11 @@ public abstract class BaseTest {
return getTypeSystem().defineTraitTypes(tDefs);
}
protected Map<String, IDataType> defineClasses(
HierarchicalTypeDefinition<ClassType>... classDefs) throws MetadataException {
return getTypeSystem().defineClassTypes(classDefs);
}
/*
* Class Hierarchy is:
* Department(name : String, employees : Array[Person])
......@@ -152,7 +157,7 @@ public abstract class BaseTest {
ImmutableList.of(deptTypeDef, personTypeDef,
managerTypeDef));
ImmutableList<HierarchicalType> types = ImmutableList.of(
ImmutableList.of(
ts.getDataType(HierarchicalType.class, "SecurityClearance"),
ts.getDataType(ClassType.class, "Department"),
ts.getDataType(ClassType.class, "Person"),
......@@ -180,7 +185,7 @@ public abstract class BaseTest {
jane.getTrait("SecurityClearance").set("level", 1);
ClassType deptType = ts.getDataType(ClassType.class, "Department");
ITypedReferenceableInstance hrDept2 = deptType.convert(hrDept, Multiplicity.REQUIRED);
deptType.convert(hrDept, Multiplicity.REQUIRED);
return hrDept;
}
......
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.apache.hadoop.metadata.typesystem.types;
import com.google.common.collect.ImmutableList;
import org.apache.hadoop.metadata.MetadataException;
import org.apache.hadoop.metadata.typesystem.IStruct;
import org.apache.hadoop.metadata.typesystem.ITypedInstance;
import org.apache.hadoop.metadata.typesystem.ITypedStruct;
import org.apache.hadoop.metadata.typesystem.Struct;
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import static org.apache.hadoop.metadata.typesystem.types.utils.TypesUtil.createClassTypeDef;
import static org.apache.hadoop.metadata.typesystem.types.utils.TypesUtil.createOptionalAttrDef;
import static org.apache.hadoop.metadata.typesystem.types.utils.TypesUtil.createRequiredAttrDef;
import static org.apache.hadoop.metadata.typesystem.types.utils.TypesUtil.createTraitTypeDef;
/**
* Unit tests for type inheritance.
*/
public class TypeInheritanceTest extends BaseTest {
@BeforeMethod
public void setup() throws Exception {
TypeSystem.getInstance().reset();
super.setup();
}
/*
* Type Hierarchy is:
* A(a)
* B(b) extends A
*/
@Test
public void testSimpleInheritance() throws MetadataException {
HierarchicalTypeDefinition A = createClassTypeDef("A", null,
createRequiredAttrDef("a", DataTypes.INT_TYPE));
HierarchicalTypeDefinition B = createClassTypeDef("B", ImmutableList.of("A"),
createOptionalAttrDef("b", DataTypes.BOOLEAN_TYPE));
defineClasses(A, B);
ClassType BType = getTypeSystem().getDataType(ClassType.class, "B");
Struct s1 = new Struct("B");
s1.set("b", true);
s1.set("a", 1);
ITypedInstance ts = BType.convert(s1, Multiplicity.REQUIRED);
Assert.assertEquals(ts.toString(), "{\n" +
"\tid : (type: B, id: <unassigned>)\n" +
"\tb : \ttrue\n" +
"\ta : \t1\n" +
"}");
}
/*
* Type Hierarchy is:
* A(a, b)
* B(b) extends A
*/
@Test
public void testSimpleInheritanceWithOverrides() throws MetadataException {
HierarchicalTypeDefinition A = createClassTypeDef("A", null,
createRequiredAttrDef("a", DataTypes.INT_TYPE),
createRequiredAttrDef("b", DataTypes.BOOLEAN_TYPE));
HierarchicalTypeDefinition B = createClassTypeDef("B", ImmutableList.of("A"),
createOptionalAttrDef("b", DataTypes.BOOLEAN_TYPE));
defineClasses(A, B);
ClassType BType = getTypeSystem().getDataType(ClassType.class, "B");
Struct s1 = new Struct("B");
s1.set("b", true);
s1.set("a", 1);
s1.set("A.B.b", false);
ITypedInstance ts = BType.convert(s1, Multiplicity.REQUIRED);
Assert.assertEquals(ts.toString(), "{\n" +
"\tid : (type: B, id: <unassigned>)\n" +
"\tb : \ttrue\n" +
"\ta : \t1\n" +
"\tA.B.b : \tfalse\n" +
"}");
}
/*
* Type Hierarchy is:
* A(a)
* B(b) extends A
* C(c) extends B
* D(d) extends C
*/
@Test
public void testMultiLevelInheritance() throws MetadataException {
HierarchicalTypeDefinition A = createClassTypeDef("A", null,
createRequiredAttrDef("a", DataTypes.INT_TYPE));
HierarchicalTypeDefinition B = createClassTypeDef("B", ImmutableList.of("A"),
createOptionalAttrDef("b", DataTypes.BOOLEAN_TYPE));
HierarchicalTypeDefinition C = createClassTypeDef("C", ImmutableList.of("B"),
createOptionalAttrDef("c", DataTypes.BYTE_TYPE));
HierarchicalTypeDefinition D = createClassTypeDef("D", ImmutableList.of("C"),
createOptionalAttrDef("d", DataTypes.SHORT_TYPE));
defineClasses(A, B, C, D);
ClassType DType = getTypeSystem().getDataType(ClassType.class, "D");
Struct s1 = new Struct("D");
s1.set("d", 1);
s1.set("c", 1);
s1.set("b", true);
s1.set("a", 1);
ITypedInstance ts = DType.convert(s1, Multiplicity.REQUIRED);
Assert.assertEquals(ts.toString(), "{\n" +
"\tid : (type: D, id: <unassigned>)\n" +
"\td : \t1\n" +
"\tc : \t1\n" +
"\tb : \ttrue\n" +
"\ta : \t1\n" +
"}");
}
/*
* Type Hierarchy is:
* A(a,b,c,d)
* B(b) extends A
* C(c) extends A
* D(d) extends B,C
*
* - There are a total of 11 fields in an instance of D
* - an attribute that is hidden by a SubType can referenced by prefixing it with the
* complete Path.
* For e.g. the 'b' attribute in A (that is a superType for B) is hidden the 'b' attribute
* in B.
* So it is availabel by the name 'A.B.D.b'
*
* - Another way to set attributes is to cast. Casting a 'D' instance of 'B' makes the 'A.B.D
* .b' attribute
* available as 'A.B.b'. Casting one more time to an 'A' makes the 'A.B.b' attribute
* available as 'b'.
*/
@Test
public void testDiamondInheritance() throws MetadataException {
HierarchicalTypeDefinition A = createTraitTypeDef("A", null,
createRequiredAttrDef("a", DataTypes.INT_TYPE),
createOptionalAttrDef("b", DataTypes.BOOLEAN_TYPE),
createOptionalAttrDef("c", DataTypes.BYTE_TYPE),
createOptionalAttrDef("d", DataTypes.SHORT_TYPE));
HierarchicalTypeDefinition B = createTraitTypeDef("B", ImmutableList.of("A"),
createOptionalAttrDef("b", DataTypes.BOOLEAN_TYPE));
HierarchicalTypeDefinition C = createTraitTypeDef("C", ImmutableList.of("A"),
createOptionalAttrDef("c", DataTypes.BYTE_TYPE));
HierarchicalTypeDefinition D = createTraitTypeDef("D", ImmutableList.of("B", "C"),
createOptionalAttrDef("d", DataTypes.SHORT_TYPE));
defineTraits(A, B, C, D);
TraitType DType = getTypeSystem().getDataType(TraitType.class, "D");
Struct s1 = new Struct("D");
s1.set("d", 1);
s1.set("c", 1);
s1.set("b", true);
s1.set("a", 1);
s1.set("A.B.D.b", true);
s1.set("A.B.D.c", 2);
s1.set("A.B.D.d", 2);
s1.set("A.C.D.a", 3);
s1.set("A.C.D.b", false);
s1.set("A.C.D.c", 3);
s1.set("A.C.D.d", 3);
ITypedStruct ts = DType.convert(s1, Multiplicity.REQUIRED);
Assert.assertEquals(ts.toString(), "{\n" +
"\td : \t1\n" +
"\tb : \ttrue\n" +
"\tc : \t1\n" +
"\ta : \t1\n" +
"\tA.B.D.b : \ttrue\n" +
"\tA.B.D.c : \t2\n" +
"\tA.B.D.d : \t2\n" +
"\tA.C.D.a : \t3\n" +
"\tA.C.D.b : \tfalse\n" +
"\tA.C.D.c : \t3\n" +
"\tA.C.D.d : \t3\n" +
"}");
/*
* cast to B and set the 'b' attribute on A.
*/
TraitType BType = getTypeSystem().getDataType(TraitType.class, "B");
IStruct s2 = DType.castAs(ts, "B");
s2.set("A.B.b", false);
Assert.assertEquals(ts.toString(), "{\n" +
"\td : \t1\n" +
"\tb : \ttrue\n" +
"\tc : \t1\n" +
"\ta : \t1\n" +
"\tA.B.D.b : \tfalse\n" +
"\tA.B.D.c : \t2\n" +
"\tA.B.D.d : \t2\n" +
"\tA.C.D.a : \t3\n" +
"\tA.C.D.b : \tfalse\n" +
"\tA.C.D.c : \t3\n" +
"\tA.C.D.d : \t3\n" +
"}");
/*
* cast again to A and set the 'b' attribute on A.
*/
IStruct s3 = BType.castAs(s2, "A");
s3.set("b", true);
Assert.assertEquals(ts.toString(), "{\n" +
"\td : \t1\n" +
"\tb : \ttrue\n" +
"\tc : \t1\n" +
"\ta : \t1\n" +
"\tA.B.D.b : \ttrue\n" +
"\tA.B.D.c : \t2\n" +
"\tA.B.D.d : \t2\n" +
"\tA.C.D.a : \t3\n" +
"\tA.C.D.b : \tfalse\n" +
"\tA.C.D.c : \t3\n" +
"\tA.C.D.d : \t3\n" +
"}");
}
}
......@@ -216,14 +216,10 @@
<configuration>
<webResources>
<resource>
<directory>../dashboard/v1</directory>
<directory>../dashboard/v3</directory>
<targetPath>dashboard</targetPath>
</resource>
<resource>
<directory>../dashboard/v2</directory>
<targetPath>dashboard/v2</targetPath>
</resource>
<resource>
<directory>src/main/webapp/WEB-INF</directory>
<targetPath>WEB-INF</targetPath>
</resource>
......
......@@ -23,11 +23,12 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="Date-Revision-yyyymmdd" content="20130821"/>
<meta http-equiv="Content-Language" content="en"/>
<title>Apache DGI - Data Governance platform</title>
<title>Apache Atlas - Data Governance for Hadoop</title>
</head>
<body class="topBarEnabled">
<h1> Apache DGI </h1>
More information at: <a href="http://dgi.incubator.apache.org/index.html" title="About">Project
Website</a>
<h1> Apache Atlas </h1>
<a href="./dashboard/index.html" title="Atlas">Atlas Dashboard</a>
<br/>
More information at: <a href="http://atlas.incubator.apache.org/index.html" title="About">Project Website</a>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment