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
34e7f58a
Commit
34e7f58a
authored
Jan 08, 2015
by
Harish Butani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
introduce ThriftTypesGen tool
parent
402e3680
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
0 deletions
+16
-0
ThriftParser.scala
...rg/apache/hadoop/metadata/tools/thrift/ThriftParser.scala
+16
-0
ThriftTypesGen.scala
.../apache/hadoop/metadata/tools/thrift/ThriftTypesGen.scala
+0
-0
No files found.
typesystem/src/main/scala/org/apache/hadoop/metadata/tools/thrift/ThriftParser.scala
View file @
34e7f58a
...
@@ -18,6 +18,9 @@
...
@@ -18,6 +18,9 @@
package
org.apache.hadoop.metadata.tools.thrift
package
org.apache.hadoop.metadata.tools.thrift
import
org.apache.hadoop.metadata.MetadataException
import
org.apache.hadoop.metadata.types.DataTypes
import
scala.util.parsing.combinator.
{
ImplicitConversions
,
PackratParsers
}
import
scala.util.parsing.combinator.
{
ImplicitConversions
,
PackratParsers
}
import
scala.util.parsing.combinator.lexical.StdLexical
import
scala.util.parsing.combinator.lexical.StdLexical
import
scala.util.parsing.combinator.syntactical.StandardTokenParsers
import
scala.util.parsing.combinator.syntactical.StandardTokenParsers
...
@@ -34,6 +37,19 @@ object BASE_TYPES extends Enumeration {
...
@@ -34,6 +37,19 @@ object BASE_TYPES extends Enumeration {
val
I32
=
Value
(
"i32"
)
val
I32
=
Value
(
"i32"
)
val
I64
=
Value
(
"i64"
)
val
I64
=
Value
(
"i64"
)
val
DOUBLE
=
Value
(
"double"
)
val
DOUBLE
=
Value
(
"double"
)
@throws
[
MetadataException
]
def
toPrimitiveTypeName
(
t
:
BASE_TYPES.Value
)
:
String
=
t
match
{
case
STRING
=>
DataTypes
.
STRING_TYPE
.
getName
case
SLIST
=>
DataTypes
.
STRING_TYPE
.
getName
case
BOOLEAN
=>
DataTypes
.
BOOLEAN_TYPE
.
getName
case
BYTE
=>
DataTypes
.
BYTE_TYPE
.
getName
case
I16
=>
DataTypes
.
SHORT_TYPE
.
getName
case
I32
=>
DataTypes
.
INT_TYPE
.
getName
case
I64
=>
DataTypes
.
LONG_TYPE
.
getName
case
DOUBLE
=>
DataTypes
.
DOUBLE_TYPE
.
getName
case
_
=>
throw
new
MetadataException
(
s
"Thrift BaseType ($t) not supported"
)
}
}
}
object
THRIFT_LANG
extends
Enumeration
{
object
THRIFT_LANG
extends
Enumeration
{
...
...
typesystem/src/main/scala/org/apache/hadoop/metadata/tools/thrift/ThriftTypesGen.scala
0 → 100644
View file @
34e7f58a
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