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
ac4c3080
Commit
ac4c3080
authored
May 20, 2015
by
Suma Shivaprasad
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed review comments
parent
7794686b
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
17 deletions
+10
-17
MetadataServiceClient.java
...ava/org/apache/hadoop/metadata/MetadataServiceClient.java
+5
-5
DefaultMetadataService.java
...ache/hadoop/metadata/services/DefaultMetadataService.java
+1
-1
GuiceServletConfig.java
...che/hadoop/metadata/web/listeners/GuiceServletConfig.java
+2
-3
TypesResource.java
...g/apache/hadoop/metadata/web/resources/TypesResource.java
+2
-8
No files found.
client/src/main/java/org/apache/hadoop/metadata/MetadataServiceClient.java
View file @
ac4c3080
...
@@ -58,7 +58,7 @@ public class MetadataServiceClient {
...
@@ -58,7 +58,7 @@ public class MetadataServiceClient {
public
static
final
String
ROWS
=
"rows"
;
public
static
final
String
ROWS
=
"rows"
;
public
static
final
String
BASE_URI
=
"api/metadata/"
;
public
static
final
String
BASE_URI
=
"api/metadata/"
;
public
static
final
String
URI_
TYPES
=
"types"
;
public
static
final
String
TYPES
=
"types"
;
public
static
final
String
URI_ENTITIES
=
"entities"
;
public
static
final
String
URI_ENTITIES
=
"entities"
;
public
static
final
String
URI_TRAITS
=
"traits"
;
public
static
final
String
URI_TRAITS
=
"traits"
;
public
static
final
String
URI_SEARCH
=
"discovery/search"
;
public
static
final
String
URI_SEARCH
=
"discovery/search"
;
...
@@ -97,10 +97,10 @@ public class MetadataServiceClient {
...
@@ -97,10 +97,10 @@ public class MetadataServiceClient {
static
enum
API
{
static
enum
API
{
//Type operations
//Type operations
CREATE_TYPE
(
BASE_URI
+
URI_
TYPES
,
HttpMethod
.
POST
),
CREATE_TYPE
(
BASE_URI
+
TYPES
,
HttpMethod
.
POST
),
GET_TYPE
(
BASE_URI
+
URI_
TYPES
,
HttpMethod
.
GET
),
GET_TYPE
(
BASE_URI
+
TYPES
,
HttpMethod
.
GET
),
LIST_TYPES
(
BASE_URI
+
URI_
TYPES
,
HttpMethod
.
GET
),
LIST_TYPES
(
BASE_URI
+
TYPES
,
HttpMethod
.
GET
),
LIST_TRAIT_TYPES
(
BASE_URI
+
URI_
TYPES
+
"?type=trait"
,
HttpMethod
.
GET
),
LIST_TRAIT_TYPES
(
BASE_URI
+
TYPES
+
"?type=trait"
,
HttpMethod
.
GET
),
//Entity operations
//Entity operations
CREATE_ENTITY
(
BASE_URI
+
URI_ENTITIES
,
HttpMethod
.
POST
),
CREATE_ENTITY
(
BASE_URI
+
URI_ENTITIES
,
HttpMethod
.
POST
),
...
...
repository/src/main/java/org/apache/hadoop/metadata/services/DefaultMetadataService.java
View file @
ac4c3080
...
@@ -115,7 +115,7 @@ public class DefaultMetadataService implements MetadataService {
...
@@ -115,7 +115,7 @@ public class DefaultMetadataService implements MetadataService {
onTypesAddedToRepo
(
typesAdded
);
onTypesAddedToRepo
(
typesAdded
);
JSONObject
response
=
new
JSONObject
()
{{
JSONObject
response
=
new
JSONObject
()
{{
put
(
MetadataServiceClient
.
URI_
TYPES
,
typesAdded
.
keySet
());
put
(
MetadataServiceClient
.
TYPES
,
typesAdded
.
keySet
());
}};
}};
return
response
;
return
response
;
}
catch
(
JSONException
e
)
{
}
catch
(
JSONException
e
)
{
...
...
webapp/src/main/java/org/apache/hadoop/metadata/web/listeners/GuiceServletConfig.java
View file @
ac4c3080
...
@@ -31,6 +31,7 @@ import com.sun.jersey.guice.spi.container.servlet.GuiceContainer;
...
@@ -31,6 +31,7 @@ import com.sun.jersey.guice.spi.container.servlet.GuiceContainer;
import
org.apache.commons.configuration.ConfigurationException
;
import
org.apache.commons.configuration.ConfigurationException
;
import
org.apache.commons.configuration.PropertiesConfiguration
;
import
org.apache.commons.configuration.PropertiesConfiguration
;
import
org.apache.hadoop.metadata.MetadataException
;
import
org.apache.hadoop.metadata.MetadataException
;
import
org.apache.hadoop.metadata.MetadataServiceClient
;
import
org.apache.hadoop.metadata.PropertiesUtil
;
import
org.apache.hadoop.metadata.PropertiesUtil
;
import
org.apache.hadoop.metadata.RepositoryMetadataModule
;
import
org.apache.hadoop.metadata.RepositoryMetadataModule
;
import
org.apache.hadoop.metadata.repository.typestore.ITypeStore
;
import
org.apache.hadoop.metadata.repository.typestore.ITypeStore
;
...
@@ -55,8 +56,6 @@ public class GuiceServletConfig extends GuiceServletContextListener {
...
@@ -55,8 +56,6 @@ public class GuiceServletConfig extends GuiceServletContextListener {
static
final
String
HTTP_AUTHENTICATION_ENABLED
=
"metadata.http.authentication.enabled"
;
static
final
String
HTTP_AUTHENTICATION_ENABLED
=
"metadata.http.authentication.enabled"
;
private
Injector
injector
;
private
Injector
injector
;
public
static
final
String
BASE_URI
=
"/api/metadata/"
;
@Override
@Override
protected
Injector
getInjector
()
{
protected
Injector
getInjector
()
{
LOG
.
info
(
"Loading Guice modules"
);
LOG
.
info
(
"Loading Guice modules"
);
...
@@ -85,7 +84,7 @@ public class GuiceServletConfig extends GuiceServletContextListener {
...
@@ -85,7 +84,7 @@ public class GuiceServletConfig extends GuiceServletContextListener {
Map
<
String
,
String
>
params
=
new
HashMap
<>();
Map
<
String
,
String
>
params
=
new
HashMap
<>();
params
.
put
(
PackagesResourceConfig
.
PROPERTY_PACKAGES
,
packages
);
params
.
put
(
PackagesResourceConfig
.
PROPERTY_PACKAGES
,
packages
);
serve
(
BASE_URI
+
"*"
).
with
(
GuiceContainer
.
class
,
params
);
serve
(
"/"
+
MetadataServiceClient
.
BASE_URI
+
"*"
).
with
(
GuiceContainer
.
class
,
params
);
}
}
private
void
configureAuthenticationFilter
()
throws
ConfigurationException
{
private
void
configureAuthenticationFilter
()
throws
ConfigurationException
{
...
...
webapp/src/main/java/org/apache/hadoop/metadata/web/resources/TypesResource.java
View file @
ac4c3080
...
@@ -62,10 +62,6 @@ public class TypesResource {
...
@@ -62,10 +62,6 @@ public class TypesResource {
private
final
MetadataService
metadataService
;
private
final
MetadataService
metadataService
;
static
final
String
TYPE_ALL
=
"all"
;
static
final
String
TYPE_ALL
=
"all"
;
private
static
final
String
URI_TYPES
=
"types"
;
@Context
UriInfo
uriInfo
;
@Inject
@Inject
public
TypesResource
(
MetadataService
metadataService
)
{
public
TypesResource
(
MetadataService
metadataService
)
{
...
@@ -85,13 +81,11 @@ public class TypesResource {
...
@@ -85,13 +81,11 @@ public class TypesResource {
LOG
.
debug
(
"creating type with definition {} "
,
typeDefinition
);
LOG
.
debug
(
"creating type with definition {} "
,
typeDefinition
);
JSONObject
typesJson
=
metadataService
.
createType
(
typeDefinition
);
JSONObject
typesJson
=
metadataService
.
createType
(
typeDefinition
);
UriBuilder
ub
=
uriInfo
.
getAbsolutePathBuilder
();
final
JSONArray
typesJsonArray
=
typesJson
.
getJSONArray
(
MetadataServiceClient
.
TYPES
);
final
JSONArray
typesJsonArray
=
typesJson
.
getJSONArray
(
"types"
);
List
<
Map
<
String
,
String
>>
typesAddedList
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
typesAddedList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
typesJsonArray
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
typesJsonArray
.
length
();
i
++)
{
final
String
name
=
typesJsonArray
.
getString
(
i
);
final
String
name
=
typesJsonArray
.
getString
(
i
);
final
URI
locationUri
=
ub
.
path
(
name
).
build
();
typesAddedList
.
add
(
typesAddedList
.
add
(
new
HashMap
<
String
,
String
>()
{{
new
HashMap
<
String
,
String
>()
{{
put
(
MetadataServiceClient
.
NAME
,
name
);
put
(
MetadataServiceClient
.
NAME
,
name
);
...
@@ -100,7 +94,7 @@ public class TypesResource {
...
@@ -100,7 +94,7 @@ public class TypesResource {
JSONObject
response
=
new
JSONObject
();
JSONObject
response
=
new
JSONObject
();
response
.
put
(
MetadataServiceClient
.
REQUEST_ID
,
Servlets
.
getRequestId
());
response
.
put
(
MetadataServiceClient
.
REQUEST_ID
,
Servlets
.
getRequestId
());
response
.
put
(
MetadataServiceClient
.
URI_
TYPES
,
typesAddedList
);
response
.
put
(
MetadataServiceClient
.
TYPES
,
typesAddedList
);
return
Response
.
status
(
ClientResponse
.
Status
.
CREATED
).
entity
(
response
).
build
();
return
Response
.
status
(
ClientResponse
.
Status
.
CREATED
).
entity
(
response
).
build
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Unable to persist types"
,
e
);
LOG
.
error
(
"Unable to persist types"
,
e
);
...
...
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