Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
074211db
Commit
074211db
authored
May 06, 2015
by
Suma Shivaprasad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG_36056 - Fixed all issues in ITs
parent
bbc46662
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
24 deletions
+33
-24
MetadataServiceClient.java
...ava/org/apache/hadoop/metadata/MetadataServiceClient.java
+17
-15
EntityResource.java
.../apache/hadoop/metadata/web/resources/EntityResource.java
+1
-1
EntityJerseyResourceIT.java
...hadoop/metadata/web/resources/EntityJerseyResourceIT.java
+4
-2
HiveLineageJerseyResourceIT.java
...p/metadata/web/resources/HiveLineageJerseyResourceIT.java
+11
-6
No files found.
client/src/main/java/org/apache/hadoop/metadata/MetadataServiceClient.java
View file @
074211db
...
...
@@ -52,29 +52,31 @@ public class MetadataServiceClient {
service
=
client
.
resource
(
UriBuilder
.
fromUri
(
baseUrl
).
build
());
}
private
static
final
String
BASE_URI
=
"api/metadata/"
;
static
enum
API
{
//Type operations
CREATE_TYPE
(
"api/metadata/types/submit
"
,
HttpMethod
.
POST
),
GET_TYPE
(
"api/metadata/types/definition
"
,
HttpMethod
.
GET
),
LIST_TYPES
(
"api/metadata/types/list
"
,
HttpMethod
.
GET
),
LIST_TRAIT_TYPES
(
"api/metadata/types/traits/lis
t"
,
HttpMethod
.
GET
),
CREATE_TYPE
(
BASE_URI
+
"types
"
,
HttpMethod
.
POST
),
GET_TYPE
(
BASE_URI
+
"types
"
,
HttpMethod
.
GET
),
LIST_TYPES
(
BASE_URI
+
"types
"
,
HttpMethod
.
GET
),
LIST_TRAIT_TYPES
(
BASE_URI
+
"types?type=trai
t"
,
HttpMethod
.
GET
),
//Entity operations
CREATE_ENTITY
(
"api/metadata/entities/submit
"
,
HttpMethod
.
POST
),
GET_ENTITY
(
"api/metadata/entities/definition
"
,
HttpMethod
.
GET
),
UPDATE_ENTITY
(
"api/metadata/entities/update
"
,
HttpMethod
.
PUT
),
LIST_ENTITY
(
"api/metadata/entities/list
"
,
HttpMethod
.
GET
),
CREATE_ENTITY
(
BASE_URI
+
"entities
"
,
HttpMethod
.
POST
),
GET_ENTITY
(
BASE_URI
+
"entities
"
,
HttpMethod
.
GET
),
UPDATE_ENTITY
(
BASE_URI
+
"entities
"
,
HttpMethod
.
PUT
),
LIST_ENTITY
(
BASE_URI
+
"entities
"
,
HttpMethod
.
GET
),
//Trait operations
ADD_TRAITS
(
"api/metadata/traits/add
"
,
HttpMethod
.
POST
),
DELETE_TRAITS
(
"api/metadata/traits/delete"
,
HttpMethod
.
PUT
),
LIST_TRAITS
(
"api/metadata/traits/list
"
,
HttpMethod
.
GET
),
ADD_TRAITS
(
BASE_URI
+
"traits
"
,
HttpMethod
.
POST
),
DELETE_TRAITS
(
BASE_URI
+
"traits"
,
HttpMethod
.
DELETE
),
LIST_TRAITS
(
BASE_URI
+
"traits
"
,
HttpMethod
.
GET
),
//Search operations
SEARCH
(
"api/metadata/
discovery/search"
,
HttpMethod
.
GET
),
SEARCH_DSL
(
"api/metadata/
discovery/search/dsl"
,
HttpMethod
.
GET
),
SEARCH_GREMLIN
(
"api/metadata/
discovery/search/gremlin"
,
HttpMethod
.
GET
),
SEARCH_FULL_TEXT
(
"api/metadata/
discovery/search/fulltext"
,
HttpMethod
.
GET
);
SEARCH
(
BASE_URI
+
"
discovery/search"
,
HttpMethod
.
GET
),
SEARCH_DSL
(
BASE_URI
+
"
discovery/search/dsl"
,
HttpMethod
.
GET
),
SEARCH_GREMLIN
(
BASE_URI
+
"
discovery/search/gremlin"
,
HttpMethod
.
GET
),
SEARCH_FULL_TEXT
(
BASE_URI
+
"
discovery/search/fulltext"
,
HttpMethod
.
GET
);
private
final
String
method
;
private
final
String
path
;
...
...
webapp/src/main/java/org/apache/hadoop/metadata/web/resources/EntityResource.java
View file @
074211db
...
...
@@ -150,7 +150,7 @@ public class EntityResource {
*/
@GET
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
Response
getEntityList
(
@QueryParam
(
"type"
)
String
entityType
,
public
Response
getEntityList
ByType
(
@QueryParam
(
"type"
)
String
entityType
,
@DefaultValue
(
"0"
)
@QueryParam
(
"offset"
)
Integer
offset
,
@QueryParam
(
"numResults"
)
Integer
resultsPerPage
)
{
Preconditions
.
checkNotNull
(
entityType
,
"Entity type cannot be null"
);
...
...
webapp/src/test/java/org/apache/hadoop/metadata/web/resources/EntityJerseyResourceIT.java
View file @
074211db
...
...
@@ -219,7 +219,8 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
@Test
public
void
testGetEntityListForBadEntityType
()
throws
Exception
{
ClientResponse
clientResponse
=
service
.
path
(
"api/metadata/entities/blah"
)
.
path
(
"api/metadata/entities"
)
.
queryParam
(
"type"
,
"blah"
)
.
accept
(
MediaType
.
APPLICATION_JSON
)
.
type
(
MediaType
.
APPLICATION_JSON
)
.
method
(
HttpMethod
.
GET
,
ClientResponse
.
class
);
...
...
@@ -235,7 +236,8 @@ public class EntityJerseyResourceIT extends BaseResourceIT {
addNewType
();
ClientResponse
clientResponse
=
service
.
path
(
"api/metadata/entities/test"
)
.
path
(
"api/metadata/entities"
)
.
queryParam
(
"type"
,
"test"
)
.
accept
(
MediaType
.
APPLICATION_JSON
)
.
type
(
MediaType
.
APPLICATION_JSON
)
.
method
(
HttpMethod
.
GET
,
ClientResponse
.
class
);
...
...
webapp/src/test/java/org/apache/hadoop/metadata/web/resources/HiveLineageJerseyResourceIT.java
View file @
074211db
...
...
@@ -53,6 +53,8 @@ import java.util.List;
*/
public
class
HiveLineageJerseyResourceIT
extends
BaseResourceIT
{
private
static
final
String
BASE_URI
=
"api/metadata/lineage/hive/table/"
;
@BeforeClass
public
void
setUp
()
throws
Exception
{
super
.
setUp
();
...
...
@@ -64,8 +66,9 @@ public class HiveLineageJerseyResourceIT extends BaseResourceIT {
@Test
public
void
testInputs
()
throws
Exception
{
WebResource
resource
=
service
.
path
(
"api/metadata/lineage/hive/inputs"
)
.
path
(
"sales_fact_monthly_mv"
);
.
path
(
BASE_URI
)
.
path
(
"sales_fact_monthly_mv"
)
.
path
(
"inputs"
);
ClientResponse
clientResponse
=
resource
.
accept
(
MediaType
.
APPLICATION_JSON
)
...
...
@@ -94,8 +97,9 @@ public class HiveLineageJerseyResourceIT extends BaseResourceIT {
@Test
public
void
testOutputs
()
throws
Exception
{
WebResource
resource
=
service
.
path
(
"api/metadata/lineage/hive/outputs"
)
.
path
(
"sales_fact"
);
.
path
(
BASE_URI
)
.
path
(
"sales_fact"
)
.
path
(
"outputs"
);
ClientResponse
clientResponse
=
resource
.
accept
(
MediaType
.
APPLICATION_JSON
)
...
...
@@ -124,8 +128,9 @@ public class HiveLineageJerseyResourceIT extends BaseResourceIT {
@Test
public
void
testSchema
()
throws
Exception
{
WebResource
resource
=
service
.
path
(
"api/metadata/lineage/hive/schema"
)
.
path
(
"sales_fact"
);
.
path
(
BASE_URI
)
.
path
(
"sales_fact"
)
.
path
(
"schema"
);
ClientResponse
clientResponse
=
resource
.
accept
(
MediaType
.
APPLICATION_JSON
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment