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
8cac97e5
Commit
8cac97e5
authored
9 years ago
by
Aaron Dossett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add isEmpty to TypesDef and check in MetadataService
parent
28139b40
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
1 deletion
+5
-1
DefaultMetadataService.java
...ache/hadoop/metadata/services/DefaultMetadataService.java
+1
-1
TypesDef.scala
...cala/org/apache/hadoop/metadata/typesystem/TypesDef.scala
+4
-0
No files found.
repository/src/main/java/org/apache/hadoop/metadata/services/DefaultMetadataService.java
View file @
8cac97e5
...
@@ -94,7 +94,7 @@ public class DefaultMetadataService implements MetadataService {
...
@@ -94,7 +94,7 @@ public class DefaultMetadataService implements MetadataService {
Preconditions
.
checkArgument
(!
typeDefinition
.
equals
(
""
),
"type definition cannot be an empty string"
);
Preconditions
.
checkArgument
(!
typeDefinition
.
equals
(
""
),
"type definition cannot be an empty string"
);
TypesDef
typesDef
=
TypesSerialization
.
fromJson
(
typeDefinition
);
TypesDef
typesDef
=
TypesSerialization
.
fromJson
(
typeDefinition
);
if
(
typesDef
.
classTypesAsJavaList
().
size
()
==
0
)
if
(
typesDef
.
isEmpty
()
)
throw
new
MetadataException
(
"Invalid type definition"
);
throw
new
MetadataException
(
"Invalid type definition"
);
Map
<
String
,
IDataType
>
typesAdded
=
typeSystem
.
defineTypes
(
typesDef
);
Map
<
String
,
IDataType
>
typesAdded
=
typeSystem
.
defineTypes
(
typesDef
);
...
...
This diff is collapsed.
Click to expand it.
typesystem/src/main/scala/org/apache/hadoop/metadata/typesystem/TypesDef.scala
View file @
8cac97e5
...
@@ -58,4 +58,8 @@ case class TypesDef(enumTypes: Seq[EnumTypeDefinition],
...
@@ -58,4 +58,8 @@ case class TypesDef(enumTypes: Seq[EnumTypeDefinition],
import
scala.collection.JavaConverters._
import
scala.collection.JavaConverters._
classTypes
.
asJava
classTypes
.
asJava
}
}
def
isEmpty
()
=
{
enumTypes
.
isEmpty
&
structTypes
.
isEmpty
&
traitTypes
.
isEmpty
&
classTypes
.
isEmpty
}
}
}
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