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
a687d766
Commit
a687d766
authored
Jun 01, 2015
by
Venkatesh Seetharam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG-38312 create class with empty name returns a 500
parent
fee7c5cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
11 deletions
+15
-11
DefaultMetadataService.java
...ache/hadoop/metadata/services/DefaultMetadataService.java
+15
-11
No files found.
repository/src/main/java/org/apache/hadoop/metadata/services/DefaultMetadataService.java
View file @
a687d766
...
@@ -52,13 +52,10 @@ import org.slf4j.LoggerFactory;
...
@@ -52,13 +52,10 @@ import org.slf4j.LoggerFactory;
import
javax.inject.Inject
;
import
javax.inject.Inject
;
import
javax.inject.Singleton
;
import
javax.inject.Singleton
;
import
java.io.IOException
;
import
java.util.LinkedHashSet
;
import
java.io.InputStream
;
import
java.util.List
;
import
java.io.InputStreamReader
;
import
java.util.Map
;
import
java.net.URL
;
import
java.util.Set
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
/**
/**
* Simple wrapper over TypeSystem and MetadataRepository services with hooks
* Simple wrapper over TypeSystem and MetadataRepository services with hooks
...
@@ -136,13 +133,20 @@ public class DefaultMetadataService implements MetadataService {
...
@@ -136,13 +133,20 @@ public class DefaultMetadataService implements MetadataService {
*/
*/
@Override
@Override
public
JSONObject
createType
(
String
typeDefinition
)
throws
MetadataException
{
public
JSONObject
createType
(
String
typeDefinition
)
throws
MetadataException
{
try
{
ParamChecker
.
notEmpty
(
typeDefinition
,
"type definition cannot be empty"
);
ParamChecker
.
notEmpty
(
typeDefinition
,
"type definition cannot be empty"
);
TypesDef
typesDef
=
TypesSerialization
.
fromJson
(
typeDefinition
);
TypesDef
typesDef
;
if
(
typesDef
.
isEmpty
())
try
{
typesDef
=
TypesSerialization
.
fromJson
(
typeDefinition
);
if
(
typesDef
.
isEmpty
())
{
throw
new
MetadataException
(
"Invalid type definition"
);
throw
new
MetadataException
(
"Invalid type definition"
);
}
}
catch
(
Exception
e
)
{
LOG
.
error
(
"Unable to deserialize json={}"
,
typeDefinition
,
e
);
throw
new
IllegalArgumentException
(
"Unable to deserialize json"
);
}
try
{
final
Map
<
String
,
IDataType
>
typesAdded
=
typeSystem
.
defineTypes
(
typesDef
);
final
Map
<
String
,
IDataType
>
typesAdded
=
typeSystem
.
defineTypes
(
typesDef
);
try
{
try
{
...
...
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