Java Code Examples for org.apache.atlas.v1.model.instance.Id#EntityState
The following examples show how to use
org.apache.atlas.v1.model.instance.Id#EntityState .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GraphHelper.java From atlas with Apache License 2.0 | 5 votes |
public AtlasEdge getEdgeForLabel(AtlasVertex vertex, String edgeLabel, AtlasEdgeDirection edgeDirection) { Iterator<AtlasEdge> iterator = getAdjacentEdgesByLabel(vertex, edgeDirection, edgeLabel); AtlasEdge latestDeletedEdge = null; long latestDeletedEdgeTime = Long.MIN_VALUE; while (iterator != null && iterator.hasNext()) { AtlasEdge edge = iterator.next(); Id.EntityState edgeState = getState(edge); if (edgeState == null || edgeState == Id.EntityState.ACTIVE) { if (LOG.isDebugEnabled()) { LOG.debug("Found {}", string(edge)); } return edge; } else { Long modificationTime = edge.getProperty(MODIFICATION_TIMESTAMP_PROPERTY_KEY, Long.class); if (modificationTime != null && modificationTime >= latestDeletedEdgeTime) { latestDeletedEdgeTime = modificationTime; latestDeletedEdge = edge; } } } if (LOG.isDebugEnabled()) { LOG.debug("Found {}", latestDeletedEdge == null ? "null" : string(latestDeletedEdge)); } //If the vertex is deleted, return latest deleted edge return latestDeletedEdge; }
Example 2
Source File: AtlasEntityFormatConverter.java From atlas with Apache License 2.0 | 4 votes |
private Status convertState(Id.EntityState state){ return (state != null && state.equals(Id.EntityState.DELETED)) ? Status.DELETED : Status.ACTIVE; }
Example 3
Source File: GraphHelper.java From atlas with Apache License 2.0 | 4 votes |
public static Id.EntityState getState(AtlasElement element) { String state = getStateAsString(element); return state == null ? null : Id.EntityState.valueOf(state); }