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
faf0b48b
Commit
faf0b48b
authored
Jan 12, 2015
by
A744013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed "Service" from the name of some interfaces and implementations -
they are not services and made more sense with simpler, shorter names
parent
fb2207c0
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
19 deletions
+19
-19
DefaultMetadataService.java
...ache/hadoop/metadata/services/DefaultMetadataService.java
+2
-2
GraphBackedMetadataRepository.java
...doop/metadata/services/GraphBackedMetadataRepository.java
+3
-3
MetadataRepository.java
...g/apache/hadoop/metadata/services/MetadataRepository.java
+1
-1
GraphBackedMetadataRepositoryTest.java
.../metadata/services/GraphBackedMetadataRepositoryTest.java
+9
-9
GraphRepositoryServiceIT.java
.../org/apache/hadoop/metadata/GraphRepositoryServiceIT.java
+4
-4
No files found.
repository/src/main/java/org/apache/hadoop/metadata/services/DefaultMetadataService.java
View file @
faf0b48b
...
@@ -36,7 +36,7 @@ public class DefaultMetadataService implements MetadataService {
...
@@ -36,7 +36,7 @@ public class DefaultMetadataService implements MetadataService {
public
static
final
String
NAME
=
DefaultMetadataService
.
class
.
getSimpleName
();
public
static
final
String
NAME
=
DefaultMetadataService
.
class
.
getSimpleName
();
private
TypeSystem
typeSystem
;
private
TypeSystem
typeSystem
;
private
MetadataRepository
Service
repositoryService
;
private
MetadataRepository
repositoryService
;
/**
/**
* Creates a new type based on the type system to enable adding
* Creates a new type based on the type system to enable adding
...
@@ -149,7 +149,7 @@ public class DefaultMetadataService implements MetadataService {
...
@@ -149,7 +149,7 @@ public class DefaultMetadataService implements MetadataService {
}
}
if
(
Services
.
get
().
isRegistered
(
TitanGraphService
.
NAME
))
{
if
(
Services
.
get
().
isRegistered
(
TitanGraphService
.
NAME
))
{
repositoryService
=
Services
.
get
().
getService
(
GraphBackedMetadataRepository
Service
.
NAME
);
repositoryService
=
Services
.
get
().
getService
(
GraphBackedMetadataRepository
.
NAME
);
}
else
{
}
else
{
throw
new
RuntimeException
(
"repository service is not initialized"
);
throw
new
RuntimeException
(
"repository service is not initialized"
);
}
}
...
...
repository/src/main/java/org/apache/hadoop/metadata/services/GraphBackedMetadataRepository
Service
.java
→
repository/src/main/java/org/apache/hadoop/metadata/services/GraphBackedMetadataRepository.java
View file @
faf0b48b
...
@@ -54,11 +54,11 @@ import java.util.concurrent.atomic.AtomicInteger;
...
@@ -54,11 +54,11 @@ import java.util.concurrent.atomic.AtomicInteger;
/**
/**
* An implementation backed by Titan Graph DB.
* An implementation backed by Titan Graph DB.
*/
*/
public
class
GraphBackedMetadataRepository
Service
implements
MetadataRepositoryService
{
public
class
GraphBackedMetadataRepository
implements
MetadataRepository
{
private
static
final
Logger
LOG
=
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
GraphBackedMetadataRepository
Service
.
class
);
LoggerFactory
.
getLogger
(
GraphBackedMetadataRepository
.
class
);
public
static
final
String
NAME
=
GraphBackedMetadataRepository
Service
.
class
.
getSimpleName
();
public
static
final
String
NAME
=
GraphBackedMetadataRepository
.
class
.
getSimpleName
();
private
static
final
String
GUID_PROPERTY_KEY
=
"guid"
;
private
static
final
String
GUID_PROPERTY_KEY
=
"guid"
;
private
static
final
String
TIMESTAMP_PROPERTY_KEY
=
"timestamp"
;
private
static
final
String
TIMESTAMP_PROPERTY_KEY
=
"timestamp"
;
...
...
repository/src/main/java/org/apache/hadoop/metadata/services/MetadataRepository
Service
.java
→
repository/src/main/java/org/apache/hadoop/metadata/services/MetadataRepository.java
View file @
faf0b48b
...
@@ -28,7 +28,7 @@ import java.util.List;
...
@@ -28,7 +28,7 @@ import java.util.List;
/**
/**
* An interface for persisting metadata into a blueprints enabled graph db.
* An interface for persisting metadata into a blueprints enabled graph db.
*/
*/
public
interface
MetadataRepository
Service
extends
Service
{
public
interface
MetadataRepository
extends
Service
{
String
createEntity
(
IReferenceableInstance
entity
,
String
createEntity
(
IReferenceableInstance
entity
,
String
entityType
)
throws
RepositoryException
;
String
entityType
)
throws
RepositoryException
;
...
...
repository/src/test/java/org/apache/hadoop/metadata/services/GraphBackedMetadataRepository
Service
Test.java
→
repository/src/test/java/org/apache/hadoop/metadata/services/GraphBackedMetadataRepositoryTest.java
View file @
faf0b48b
...
@@ -29,12 +29,12 @@ import org.testng.annotations.Test;
...
@@ -29,12 +29,12 @@ import org.testng.annotations.Test;
import
java.util.List
;
import
java.util.List
;
public
class
GraphBackedMetadataRepository
Service
Test
{
public
class
GraphBackedMetadataRepositoryTest
{
private
static
final
String
ENTITY_TYPE
=
"hive-table"
;
private
static
final
String
ENTITY_TYPE
=
"hive-table"
;
private
TitanGraphService
titanGraphService
;
private
TitanGraphService
titanGraphService
;
private
GraphBackedMetadataRepository
Service
repositoryService
;
private
GraphBackedMetadataRepository
repositoryService
;
protected
org
.
apache
.
hadoop
.
metadata
.
MetadataService
ms
;
protected
org
.
apache
.
hadoop
.
metadata
.
MetadataService
ms
;
private
String
guid
;
private
String
guid
;
...
@@ -49,7 +49,7 @@ public class GraphBackedMetadataRepositoryServiceTest {
...
@@ -49,7 +49,7 @@ public class GraphBackedMetadataRepositoryServiceTest {
Services
.
get
().
register
(
typesService
);
Services
.
get
().
register
(
typesService
);
TypeSystem
ts
=
typesService
.
getTypeSystem
();
TypeSystem
ts
=
typesService
.
getTypeSystem
();
repositoryService
=
new
GraphBackedMetadataRepository
Service
();
repositoryService
=
new
GraphBackedMetadataRepository
();
repositoryService
.
start
();
repositoryService
.
start
();
Services
.
get
().
register
(
repositoryService
);
Services
.
get
().
register
(
repositoryService
);
...
@@ -63,16 +63,16 @@ public class GraphBackedMetadataRepositoryServiceTest {
...
@@ -63,16 +63,16 @@ public class GraphBackedMetadataRepositoryServiceTest {
@AfterClass
@AfterClass
public
void
tearDown
()
throws
Exception
{
public
void
tearDown
()
throws
Exception
{
Services
.
get
().
getService
(
GraphBackedMetadataRepository
Service
.
NAME
).
close
();
Services
.
get
().
getService
(
GraphBackedMetadataRepository
.
NAME
).
close
();
Services
.
get
().
getService
(
TitanGraphService
.
NAME
).
close
();
Services
.
get
().
getService
(
TitanGraphService
.
NAME
).
close
();
Services
.
get
().
reset
();
Services
.
get
().
reset
();
}
}
@Test
@Test
public
void
testGetName
()
throws
Exception
{
public
void
testGetName
()
throws
Exception
{
Assert
.
assertEquals
(
GraphBackedMetadataRepository
Service
.
NAME
,
Assert
.
assertEquals
(
GraphBackedMetadataRepository
.
NAME
,
GraphBackedMetadataRepository
Service
.
class
.
getSimpleName
());
GraphBackedMetadataRepository
.
class
.
getSimpleName
());
Assert
.
assertEquals
(
repositoryService
.
getName
(),
GraphBackedMetadataRepository
Service
.
NAME
);
Assert
.
assertEquals
(
repositoryService
.
getName
(),
GraphBackedMetadataRepository
.
NAME
);
}
}
@Test
@Test
...
@@ -122,8 +122,8 @@ public class GraphBackedMetadataRepositoryServiceTest {
...
@@ -122,8 +122,8 @@ public class GraphBackedMetadataRepositoryServiceTest {
public
void
testStartWithOutGraphServiceRegistration
()
throws
Exception
{
public
void
testStartWithOutGraphServiceRegistration
()
throws
Exception
{
try
{
try
{
Services
.
get
().
reset
();
Services
.
get
().
reset
();
GraphBackedMetadataRepository
Service
repositoryService
=
new
GraphBackedMetadataRepository
repositoryService
=
new
GraphBackedMetadataRepository
Service
();
GraphBackedMetadataRepository
();
repositoryService
.
start
();
repositoryService
.
start
();
Assert
.
fail
(
"This should have thrown an exception"
);
Assert
.
fail
(
"This should have thrown an exception"
);
}
finally
{
}
finally
{
...
...
webapp/src/test/java/org/apache/hadoop/metadata/GraphRepositoryServiceIT.java
View file @
faf0b48b
package
org
.
apache
.
hadoop
.
metadata
;
package
org
.
apache
.
hadoop
.
metadata
;
import
org.apache.hadoop.metadata.service.Services
;
import
org.apache.hadoop.metadata.service.Services
;
import
org.apache.hadoop.metadata.services.GraphBackedMetadataRepository
Service
;
import
org.apache.hadoop.metadata.services.GraphBackedMetadataRepository
;
import
org.apache.hadoop.metadata.services.TitanGraphService
;
import
org.apache.hadoop.metadata.services.TitanGraphService
;
import
org.json.simple.JSONValue
;
import
org.json.simple.JSONValue
;
import
org.testng.Assert
;
import
org.testng.Assert
;
...
@@ -25,15 +25,15 @@ public class GraphRepositoryServiceIT {
...
@@ -25,15 +25,15 @@ public class GraphRepositoryServiceIT {
titanGraphService
.
start
();
titanGraphService
.
start
();
Services
.
get
().
register
(
titanGraphService
);
Services
.
get
().
register
(
titanGraphService
);
GraphBackedMetadataRepository
Service
repositoryService
GraphBackedMetadataRepository
repositoryService
=
new
GraphBackedMetadataRepository
Service
();
=
new
GraphBackedMetadataRepository
();
repositoryService
.
start
();
repositoryService
.
start
();
Services
.
get
().
register
(
repositoryService
);
Services
.
get
().
register
(
repositoryService
);
}
}
@AfterClass
@AfterClass
public
void
tearDown
()
throws
Exception
{
public
void
tearDown
()
throws
Exception
{
Services
.
get
().
getService
(
GraphBackedMetadataRepository
Service
.
NAME
).
close
();
Services
.
get
().
getService
(
GraphBackedMetadataRepository
.
NAME
).
close
();
Services
.
get
().
getService
(
TitanGraphService
.
NAME
).
close
();
Services
.
get
().
getService
(
TitanGraphService
.
NAME
).
close
();
Services
.
get
().
reset
();
Services
.
get
().
reset
();
}
}
...
...
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