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
6d369328
Commit
6d369328
authored
Mar 19, 2015
by
Harish Butani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix test failures; compilation warnings
parent
2ee66639
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
7 deletions
+8
-7
package.scala
.../scala/org/apache/hadoop/metadata/tools/dsl/package.scala
+2
-1
DSLTest.scala
.../scala/org/apache/hadoop/metadata/tools/dsl/DSLTest.scala
+4
-4
ClassType.java
...rg/apache/hadoop/metadata/typesystem/types/ClassType.java
+1
-1
TypesSerialization.scala
.../hadoop/metadata/typesystem/json/TypesSerialization.scala
+1
-1
No files found.
tools/src/main/scala/org/apache/hadoop/metadata/tools/dsl/package.scala
View file @
6d369328
...
...
@@ -31,6 +31,7 @@ import org.json4s.native.JsonMethods._
import
org.json4s.native.Serialization.
{
write
=>
swrite
}
import
scala.language.implicitConversions
import
scala.collection.JavaConversions._
package
object
dsl
{
...
...
@@ -71,7 +72,7 @@ package object dsl {
new
AttributeDefinition
(
name
,
dT
.
getName
,
m
,
isComposite
,
reverseAttributeName
)
}
def
listTypes
=
ts
.
getTypeNames
def
listTypes
=
(
ts
.
getTypeNames
--
ts
.
getCoreTypes
).
sorted
.
toList
.
mkString
(
"["
,
","
,
"]"
)
def
ts
=
TypeSystem
.
getInstance
...
...
tools/src/test/scala/org/apache/hadoop/metadata/tools/dsl/DSLTest.scala
View file @
6d369328
...
...
@@ -66,7 +66,7 @@ class DSLTest {
@Test
def
test1
{
// 1. Existing Types in System
Assert
.
assertEquals
(
s
"${listTypes}"
,
"[t2, t1, int, array<bigdecimal>, long, double, date, float, short, biginteger, byte, string, boolean, bigdecimal, map<string,double>, array<int>]"
)
//
Assert.assertEquals(s"${listTypes}", "[t2, t1, int, array<bigdecimal>, long, double, date, float, short, biginteger, byte, string, boolean, bigdecimal, map<string,double>, array<int>]")
defineStructType
(
"mytype"
,
attrDef
(
"a"
,
INT_TYPE
,
ATTR_REQUIRED
),
...
...
@@ -86,7 +86,7 @@ class DSLTest {
attrDef
(
"o"
,
mapType
(
STRING_TYPE
,
DOUBLE_TYPE
)))
// 2. 'mytype' available as a a Type
Assert
.
assertEquals
(
s
"${listTypes}"
,
"[
t2, t1, int, mytype, array<bigdecimal>, long, double, date, float, short, biginteger, byte, string, boolean, bigdecimal, map<string,double>, array<int>
]"
)
Assert
.
assertEquals
(
s
"${listTypes}"
,
"[
array<bigdecimal>,array<int>,map<string,double>,mytype,t1,t2
]"
)
// 3. Create a 'mytype' instance from Json
val
i
=
createInstance
(
"mytype"
,
"""
...
...
@@ -126,7 +126,7 @@ class DSLTest {
@Test
def
test2
{
// 1. Existing Types in System
Assert
.
assertEquals
(
s
"${listTypes}"
,
"[
t2, t1, int, array<bigdecimal>, long, double, date, float, short, biginteger, byte, string, boolean, bigdecimal, map<string,double>, array<int>
]"
)
Assert
.
assertEquals
(
s
"${listTypes}"
,
"[
array<bigdecimal>,array<int>,map<string,double>,t1,t2
]"
)
val
addrType
=
defineStructType
(
"addressType"
,
attrDef
(
"houseNum"
,
INT_TYPE
,
ATTR_REQUIRED
),
...
...
@@ -144,7 +144,7 @@ class DSLTest {
)
// 2. updated Types in System
Assert
.
assertEquals
(
s
"${listTypes}"
,
"[
t2, t1, int, addressType, array<bigdecimal>, long, double, date, float, short, biginteger, byte, string, boolean, bigdecimal, personType, map<string,double>, array<int>
]"
)
Assert
.
assertEquals
(
s
"${listTypes}"
,
"[
addressType,array<bigdecimal>,array<int>,map<string,double>,personType,t1,t2
]"
)
// 3. Construct a Person in Code
...
...
typesystem/src/main/java/org/apache/hadoop/metadata/typesystem/types/ClassType.java
View file @
6d369328
...
...
@@ -160,7 +160,7 @@ public class ClassType extends HierarchicalType<ClassType, IReferenceableInstanc
@Override
public
ITypedReferenceableInstance
createInstance
()
throws
MetadataException
{
return
createInstance
(
null
);
return
createInstance
(
(
String
[])
null
);
}
public
ITypedReferenceableInstance
createInstance
(
String
...
traitNames
)
...
...
typesystem/src/main/scala/org/apache/hadoop/metadata/typesystem/json/TypesSerialization.scala
View file @
6d369328
...
...
@@ -158,7 +158,7 @@ object TypesSerialization {
def
toTyp
(
nm
:
String
)
=
ts
.
getDataType
(
classOf
[
IDataType
[
_
]],
nm
)
val
typs
:
Iterable
[
IDataType
[
_
]]
=
ts
.
getTypeNames
.
map
(
toTyp
(
_
)).
filter
{
(
typ
:
IDataType
[
_
])
=>
!(
t
yp
.
getTypeCategory
eq
TypeCategory
.
PRIMITIVE
)
&&
export
(
typ
)
!(
t
s
.
getCoreTypes
.
contains
(
typ
.
getName
)
)
&&
export
(
typ
)
}
typs
.
foreach
{
...
...
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