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
9 years ago
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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
10 deletions
+14
-10
DefaultMetadataService.java
...ache/hadoop/metadata/services/DefaultMetadataService.java
+14
-10
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;
import
javax.inject.Inject
;
import
javax.inject.Singleton
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.net.URL
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.LinkedHashSet
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
/**
* Simple wrapper over TypeSystem and MetadataRepository services with hooks
...
...
@@ -136,13 +133,20 @@ public class DefaultMetadataService implements MetadataService {
*/
@Override
public
JSONObject
createType
(
String
typeDefinition
)
throws
MetadataException
{
try
{
ParamChecker
.
notEmpty
(
typeDefinition
,
"type definition cannot be empty"
);
TypesDef
typesDef
=
TypesSerialization
.
fromJson
(
typeDefinition
);
if
(
typesDef
.
isEmpty
())
TypesDef
typesDef
;
try
{
typesDef
=
TypesSerialization
.
fromJson
(
typeDefinition
);
if
(
typesDef
.
isEmpty
())
{
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
);
try
{
...
...
This diff is collapsed.
Click to expand it.
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