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
96381206
Commit
96381206
authored
Jan 24, 2015
by
Venkatesh Seetharam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rebase issues. Contributed by Venkatesh Seetharam
parent
a92298c5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
63 additions
and
73 deletions
+63
-73
pom.xml
hivetypes/pom.xml
+2
-23
HiveGraphRepositoryTest.java
...he/hadoop/metadata/hivetypes/HiveGraphRepositoryTest.java
+7
-8
HiveTypeSystemTest.java
.../apache/hadoop/metadata/hivetypes/HiveTypeSystemTest.java
+5
-11
HiveLineageResource.java
...he/hadoop/metadata/web/resources/HiveLineageResource.java
+15
-22
GraphRepoMapperTest.java
...hadoop/metadata/repository/graph/GraphRepoMapperTest.java
+32
-7
GraphBackedMetadataRepositoryTest.java
.../metadata/services/GraphBackedMetadataRepositoryTest.java
+2
-2
No files found.
hivetypes/pom.xml
View file @
96381206
...
...
@@ -45,12 +45,6 @@
<version>
2.2.2
</version>
</dependency>
<dependency>
<groupId>
junit
</groupId>
<artifactId>
junit
</artifactId>
<version>
4.10
</version>
<scope>
test
</scope>
</dependency>
<dependency>
<groupId>
org.apache.hadoop.metadata
</groupId>
<artifactId>
metadata-typesystem
</artifactId>
</dependency>
...
...
@@ -75,23 +69,8 @@
<artifactId>
log4j
</artifactId>
</dependency>
<dependency>
<groupId>
com.sun.jersey
</groupId>
<artifactId>
jersey-core
</artifactId>
</dependency>
<dependency>
<groupId>
com.sun.jersey
</groupId>
<artifactId>
jersey-server
</artifactId>
</dependency>
<dependency>
<groupId>
com.sun.jersey
</groupId>
<artifactId>
jersey-client
</artifactId>
</dependency>
<dependency>
<groupId>
com.sun.jersey
</groupId>
<artifactId>
jersey-json
</artifactId>
<groupId>
org.testng
</groupId>
<artifactId>
testng
</artifactId>
</dependency>
</dependencies>
...
...
hivetypes/src/test/java/org/apache/hadoop/metadata/hivetypes/HiveGraphRepositoryTest.java
View file @
96381206
...
...
@@ -32,18 +32,17 @@ import org.apache.hadoop.metadata.repository.graph.GraphHelper;
import
org.apache.hadoop.metadata.repository.graph.GraphService
;
import
org.apache.hadoop.metadata.repository.graph.TitanGraphProvider
;
import
org.apache.hadoop.metadata.repository.graph.TitanGraphService
;
import
org.junit.After
;
import
org.junit.Before
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.testng.annotations.AfterClass
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.io.BufferedWriter
;
import
java.io.FileWriter
;
import
java.util.List
;
@
Ignore
@
Test
(
enabled
=
false
)
public
class
HiveGraphRepositoryTest
{
protected
HiveTypeSystem
hts
;
...
...
@@ -53,7 +52,7 @@ public class HiveGraphRepositoryTest {
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
HiveGraphRepositoryTest
.
class
);
@Before
@Before
Class
public
void
setup
()
throws
ConfigurationException
,
MetadataException
{
gs
=
new
TitanGraphService
(
new
TitanGraphProvider
());
...
...
@@ -61,7 +60,7 @@ public class HiveGraphRepositoryTest {
hts
=
HiveTypeSystem
.
getInstance
();
}
@After
@After
Class
public
void
tearDown
()
{
Graph
graph
=
gs
.
getBlueprintsGraph
();
System
.
out
.
println
(
"*******************Graph Dump****************************"
);
...
...
@@ -77,7 +76,7 @@ public class HiveGraphRepositoryTest {
System
.
out
.
println
(
"*******************Graph Dump****************************"
);
}
@Test
@Test
(
enabled
=
false
)
public
void
testHiveImport
()
throws
Exception
{
HiveImporter
hImporter
=
new
HiveImporter
(
repository
,
hts
,
new
HiveMetaStoreClient
(
new
HiveConf
()));
...
...
hivetypes/src/test/java/org/apache/hadoop/metadata/hivetypes/HiveTypeSystemTest.java
View file @
96381206
...
...
@@ -18,8 +18,6 @@
package
org
.
apache
.
hadoop
.
metadata
.
hivetypes
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.apache.hadoop.hive.conf.HiveConf
;
import
org.apache.hadoop.hive.metastore.HiveMetaStoreClient
;
import
org.apache.hadoop.hive.metastore.api.MetaException
;
...
...
@@ -28,18 +26,16 @@ import org.apache.hadoop.metadata.MetadataException;
import
org.apache.hadoop.metadata.storage.Id
;
import
org.apache.hadoop.metadata.storage.memory.MemRepository
;
import
org.apache.hadoop.metadata.types.TypeSystem
;
import
org.junit.Before
;
import
org.junit.Ignore
;
import
org.junit.Test
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Test
;
import
java.io.BufferedWriter
;
import
java.io.FileOutputStream
;
import
java.io.FileWriter
;
import
java.io.IOException
;
@
Ignore
@
Test
(
enabled
=
false
)
public
class
HiveTypeSystemTest
{
protected
MemRepository
mr
;
...
...
@@ -48,7 +44,7 @@ public class HiveTypeSystemTest {
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
HiveTypeSystemTest
.
class
);
@Before
@Before
Class
public
void
setup
()
throws
MetadataException
{
TypeSystem
ts
=
TypeSystem
.
getInstance
();
...
...
@@ -57,7 +53,7 @@ public class HiveTypeSystemTest {
hts
=
HiveTypeSystem
.
getInstance
();
}
@Test
@Test
(
enabled
=
false
)
public
void
testHiveImport
()
throws
MetaException
,
MetadataException
,
IOException
{
HiveImporter
hImporter
=
new
HiveImporter
(
mr
,
hts
,
new
HiveMetaStoreClient
(
new
HiveConf
()));
...
...
@@ -87,5 +83,4 @@ public class HiveTypeSystemTest {
bw
.
flush
();
bw
.
close
();
}
}
\ No newline at end of file
metadata-bridge-parent/metadata-bridge-core/src/main/java/org/apache/hadoop/metadata/web/resources/HiveLineageResource.java
View file @
96381206
package
org
.
apache
.
hadoop
.
metadata
.
web
.
resources
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.io.Reader
;
import
java.io.Writer
;
import
java.util.ArrayList
;
import
java.util.List
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonPrimitive
;
import
org.apache.hadoop.metadata.MetadataException
;
import
org.apache.hadoop.metadata.bridge.hivelineage.HiveLineageBridge
;
import
org.apache.hadoop.metadata.bridge.hivelineage.hook.HiveLineage
;
import
org.apache.hadoop.metadata.storage.RepositoryException
;
import
javax.inject.Inject
;
import
javax.inject.Singleton
;
...
...
@@ -18,16 +21,9 @@ import javax.ws.rs.PathParam;
import
javax.ws.rs.Produces
;
import
javax.ws.rs.core.Context
;
import
javax.ws.rs.core.MediaType
;
import
org.apache.hadoop.metadata.bridge.hivelineage.HiveLineageBridge
;
import
org.apache.hadoop.metadata.bridge.hivelineage.hook.HiveLineage
;
import
org.apache.hadoop.metadata.storage.RepositoryException
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonObject
;
import
com.google.gson.JsonPrimitive
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.io.Reader
;
@Path
(
"bridge/hive"
)
@Singleton
...
...
@@ -73,10 +69,10 @@ public class HiveLineageResource {
@POST
@Consumes
(
MediaType
.
APPLICATION_JSON
)
@Produces
(
MediaType
.
APPLICATION_JSON
)
public
JsonElement
addLineage
(
@Context
HttpServletRequest
request
)
throws
IOException
,
RepositoryException
{
public
JsonElement
addLineage
(
@Context
HttpServletRequest
request
)
throws
IOException
,
MetadataException
{
// create a reader
Reader
reader
=
new
InputStreamReader
(
request
.
getInputStream
());
try
{
try
(
Reader
reader
=
new
InputStreamReader
(
request
.
getInputStream
()))
{
// deserialize
HiveLineage
bean
=
new
Gson
().
fromJson
(
reader
,
HiveLineage
.
class
);
String
id
=
bridge
.
create
(
bean
);
...
...
@@ -84,9 +80,6 @@ public class HiveLineageResource {
JsonObject
jo
=
new
JsonObject
();
jo
.
addProperty
(
"id"
,
id
);
return
jo
;
}
finally
{
// be a good citizen
reader
.
close
();
}
}
}
repository/src/test/java/org/apache/hadoop/metadata/repository/graph/GraphRepoMapperTest.java
View file @
96381206
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
hadoop
.
metadata
.
repository
.
graph
;
import
com.google.common.collect.ImmutableList
;
...
...
@@ -6,7 +24,7 @@ import com.tinkerpop.blueprints.Edge;
import
com.tinkerpop.blueprints.Vertex
;
import
org.apache.hadoop.metadata.ITypedReferenceableInstance
;
import
org.apache.hadoop.metadata.Referenceable
;
import
org.apache.hadoop.metadata.RepositoryM
oduleBaseTest
;
import
org.apache.hadoop.metadata.RepositoryM
etadataModule
;
import
org.apache.hadoop.metadata.Struct
;
import
org.apache.hadoop.metadata.types.AttributeDefinition
;
import
org.apache.hadoop.metadata.types.ClassType
;
...
...
@@ -20,25 +38,32 @@ import org.apache.hadoop.metadata.types.StructTypeDefinition;
import
org.apache.hadoop.metadata.types.TraitType
;
import
org.apache.hadoop.metadata.types.TypeSystem
;
import
org.testng.annotations.BeforeClass
;
import
org.testng.annotations.Guice
;
import
org.testng.annotations.Test
;
public
class
GraphRepoMapperTest
extends
RepositoryModuleBaseTest
{
import
javax.inject.Inject
;
@Test
@Guice
(
modules
=
RepositoryMetadataModule
.
class
)
public
class
GraphRepoMapperTest
{
private
static
final
String
DATABASE_TYPE
=
"hive_database"
;
private
static
final
String
DATABASE_NAME
=
"foo"
;
private
static
final
String
TABLE_TYPE
=
"hive_table"
;
private
static
final
String
TABLE_NAME
=
"bar"
;
private
TitanGraphService
titanGraphService
;
private
GraphBackedMetadataRepository
repositoryService
;
@Inject
TitanGraphService
titanGraphService
;
@Inject
GraphBackedMetadataRepository
repositoryService
;
private
TypeSystem
typeSystem
;
@BeforeClass
public
void
setUp
()
throws
Exception
{
titanGraphService
=
super
.
injector
.
getInstance
(
TitanGraphService
.
class
);
// start the injected graph service
titanGraphService
.
start
();
repositoryService
=
super
.
injector
.
getInstance
(
GraphBackedMetadataRepository
.
class
);
// start the injected repository service
repositoryService
.
start
();
typeSystem
=
TypeSystem
.
getInstance
();
...
...
repository/src/test/java/org/apache/hadoop/metadata/services/GraphBackedMetadataRepositoryTest.java
View file @
96381206
...
...
@@ -60,9 +60,9 @@ public class GraphBackedMetadataRepositoryTest {
private
static
final
String
ENTITY_TYPE
=
"Department"
;
@Inject
TitanGraphService
titanGraphService
;
private
TitanGraphService
titanGraphService
;
@Inject
GraphBackedMetadataRepository
repositoryService
;
private
GraphBackedMetadataRepository
repositoryService
;
private
TypeSystem
ts
;
private
String
guid
;
...
...
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