Commit a67e8962 by Madhan Neethiraj

ATLAS-1541: renamed GraphEntityMapper to EntityGraphRetriever; added methods to…

ATLAS-1541: renamed GraphEntityMapper to EntityGraphRetriever; added methods to retrieve an entity from the given vertex
parent db18c824
......@@ -55,18 +55,15 @@ import java.util.Map;
public class AtlasEntityStoreV1 implements AtlasEntityStore {
protected AtlasTypeRegistry typeRegistry;
protected final GraphHelper graphHelper = GraphHelper.getInstance();
private final EntityGraphMapper graphMapper;
private final GraphEntityMapper entityMapper;
private final AtlasGraph graph;
private static final Logger LOG = LoggerFactory.getLogger(AtlasEntityStoreV1.class);
@Inject
public AtlasEntityStoreV1(EntityGraphMapper vertexMapper, GraphEntityMapper entityMapper) {
public AtlasEntityStoreV1(EntityGraphMapper vertexMapper) {
this.graphMapper = vertexMapper;
this.entityMapper = entityMapper;
this.graph = AtlasGraphProvider.getGraphInstance();
}
......@@ -81,7 +78,9 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore {
LOG.debug("Retrieving entity with guid={}", guid);
}
return entityMapper.toAtlasEntity(guid, true);
EntityGraphRetriever entityRetriever = new EntityGraphRetriever(typeRegistry);
return entityRetriever.toAtlasEntityWithExtInfo(guid);
}
@Override
......@@ -112,7 +111,9 @@ public class AtlasEntityStoreV1 implements AtlasEntityStore {
String guid = GraphHelper.getGuid(entityVertex);
return entityMapper.toAtlasEntity(guid, true);
EntityGraphRetriever entityRetriever = new EntityGraphRetriever(typeRegistry);
return entityRetriever.toAtlasEntityWithExtInfo(guid);
}
@Override
......
......@@ -69,8 +69,6 @@ import java.util.List;
import java.util.Map;
import static org.apache.atlas.TestUtils.COLUMNS_ATTR_NAME;
import static org.apache.atlas.TestUtils.COLUMN_TYPE;
import static org.apache.atlas.TestUtils.NAME;
import static org.apache.atlas.TestUtils.TABLE_TYPE;
import static org.apache.atlas.TestUtils.randomString;
import static org.testng.Assert.assertEquals;
......@@ -133,7 +131,7 @@ public class AtlasEntityStoreV1Test {
MapVertexMapper mapVertexMapper = new MapVertexMapper(deleteHandler);
entityStore = new AtlasEntityStoreV1(new EntityGraphMapper(arrVertexMapper, mapVertexMapper, deleteHandler), new GraphEntityMapper());
entityStore = new AtlasEntityStoreV1(new EntityGraphMapper(arrVertexMapper, mapVertexMapper, deleteHandler));
entityStore.init(typeRegistry);
RequestContextV1.clear();
......
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