Commit faf0b48b by A744013

Removed "Service" from the name of some interfaces and implementations -

they are not services and made more sense with simpler, shorter names
parent fb2207c0
......@@ -36,7 +36,7 @@ public class DefaultMetadataService implements MetadataService {
public static final String NAME = DefaultMetadataService.class.getSimpleName();
private TypeSystem typeSystem;
private MetadataRepositoryService repositoryService;
private MetadataRepository repositoryService;
/**
* Creates a new type based on the type system to enable adding
......@@ -149,7 +149,7 @@ public class DefaultMetadataService implements MetadataService {
}
if (Services.get().isRegistered(TitanGraphService.NAME)) {
repositoryService = Services.get().getService(GraphBackedMetadataRepositoryService.NAME);
repositoryService = Services.get().getService(GraphBackedMetadataRepository.NAME);
} else {
throw new RuntimeException("repository service is not initialized");
}
......
......@@ -54,11 +54,11 @@ import java.util.concurrent.atomic.AtomicInteger;
/**
* An implementation backed by Titan Graph DB.
*/
public class GraphBackedMetadataRepositoryService implements MetadataRepositoryService {
public class GraphBackedMetadataRepository implements MetadataRepository {
private static final Logger LOG =
LoggerFactory.getLogger(GraphBackedMetadataRepositoryService.class);
public static final String NAME = GraphBackedMetadataRepositoryService.class.getSimpleName();
LoggerFactory.getLogger(GraphBackedMetadataRepository.class);
public static final String NAME = GraphBackedMetadataRepository.class.getSimpleName();
private static final String GUID_PROPERTY_KEY = "guid";
private static final String TIMESTAMP_PROPERTY_KEY = "timestamp";
......
......@@ -28,7 +28,7 @@ import java.util.List;
/**
* An interface for persisting metadata into a blueprints enabled graph db.
*/
public interface MetadataRepositoryService extends Service {
public interface MetadataRepository extends Service {
String createEntity(IReferenceableInstance entity,
String entityType) throws RepositoryException;
......
......@@ -29,12 +29,12 @@ import org.testng.annotations.Test;
import java.util.List;
public class GraphBackedMetadataRepositoryServiceTest {
public class GraphBackedMetadataRepositoryTest {
private static final String ENTITY_TYPE = "hive-table";
private TitanGraphService titanGraphService;
private GraphBackedMetadataRepositoryService repositoryService;
private GraphBackedMetadataRepository repositoryService;
protected org.apache.hadoop.metadata.MetadataService ms;
private String guid;
......@@ -49,7 +49,7 @@ public class GraphBackedMetadataRepositoryServiceTest {
Services.get().register(typesService);
TypeSystem ts = typesService.getTypeSystem();
repositoryService = new GraphBackedMetadataRepositoryService();
repositoryService = new GraphBackedMetadataRepository();
repositoryService.start();
Services.get().register(repositoryService);
......@@ -63,16 +63,16 @@ public class GraphBackedMetadataRepositoryServiceTest {
@AfterClass
public void tearDown() throws Exception {
Services.get().getService(GraphBackedMetadataRepositoryService.NAME).close();
Services.get().getService(GraphBackedMetadataRepository.NAME).close();
Services.get().getService(TitanGraphService.NAME).close();
Services.get().reset();
}
@Test
public void testGetName() throws Exception {
Assert.assertEquals(GraphBackedMetadataRepositoryService.NAME,
GraphBackedMetadataRepositoryService.class.getSimpleName());
Assert.assertEquals(repositoryService.getName(), GraphBackedMetadataRepositoryService.NAME);
Assert.assertEquals(GraphBackedMetadataRepository.NAME,
GraphBackedMetadataRepository.class.getSimpleName());
Assert.assertEquals(repositoryService.getName(), GraphBackedMetadataRepository.NAME);
}
@Test
......@@ -122,8 +122,8 @@ public class GraphBackedMetadataRepositoryServiceTest {
public void testStartWithOutGraphServiceRegistration() throws Exception {
try {
Services.get().reset();
GraphBackedMetadataRepositoryService repositoryService = new
GraphBackedMetadataRepositoryService();
GraphBackedMetadataRepository repositoryService = new
GraphBackedMetadataRepository();
repositoryService.start();
Assert.fail("This should have thrown an exception");
} finally {
......
package org.apache.hadoop.metadata;
import org.apache.hadoop.metadata.service.Services;
import org.apache.hadoop.metadata.services.GraphBackedMetadataRepositoryService;
import org.apache.hadoop.metadata.services.GraphBackedMetadataRepository;
import org.apache.hadoop.metadata.services.TitanGraphService;
import org.json.simple.JSONValue;
import org.testng.Assert;
......@@ -25,15 +25,15 @@ public class GraphRepositoryServiceIT {
titanGraphService.start();
Services.get().register(titanGraphService);
GraphBackedMetadataRepositoryService repositoryService
= new GraphBackedMetadataRepositoryService();
GraphBackedMetadataRepository repositoryService
= new GraphBackedMetadataRepository();
repositoryService.start();
Services.get().register(repositoryService);
}
@AfterClass
public void tearDown() throws Exception {
Services.get().getService(GraphBackedMetadataRepositoryService.NAME).close();
Services.get().getService(GraphBackedMetadataRepository.NAME).close();
Services.get().getService(TitanGraphService.NAME).close();
Services.get().reset();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment