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
58dce4c6
Commit
58dce4c6
authored
Apr 23, 2015
by
Aaron Dossett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add check for empty string
parent
589c2a65
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
DefaultMetadataService.java
...ache/hadoop/metadata/services/DefaultMetadataService.java
+5
-4
No files found.
repository/src/main/java/org/apache/hadoop/metadata/services/DefaultMetadataService.java
View file @
58dce4c6
...
...
@@ -43,6 +43,7 @@ import org.codehaus.jettison.json.JSONException;
import
org.codehaus.jettison.json.JSONObject
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
scala.tools.cmd.Meta
;
import
javax.inject.Inject
;
import
javax.inject.Singleton
;
...
...
@@ -90,14 +91,14 @@ public class DefaultMetadataService implements MetadataService {
public
JSONObject
createType
(
String
typeDefinition
)
throws
MetadataException
{
try
{
Preconditions
.
checkNotNull
(
typeDefinition
,
"type definition cannot be null"
);
Preconditions
.
checkArgument
(!
typeDefinition
.
equals
(
""
),
"type definition cannot be an empty string"
);
TypesDef
typesDef
=
TypesSerialization
.
fromJson
(
typeDefinition
);
Map
<
String
,
IDataType
>
typesAdded
=
typeSystem
.
defineTypes
(
typesDef
);
//TODO A more elegant way to detect failures?
if
(
typesAdded
.
size
()
==
0
)
if
(
typesDef
.
classTypesAsJavaList
().
size
()
==
0
)
throw
new
MetadataException
(
"Invalid type definition"
);
Map
<
String
,
IDataType
>
typesAdded
=
typeSystem
.
defineTypes
(
typesDef
);
//TODO how do we handle transaction - store failure??
typeStore
.
store
(
typeSystem
,
ImmutableList
.
copyOf
(
typesAdded
.
keySet
()));
...
...
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