-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/72156/#review219628
-----------------------------------------------------------




repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java
Line 296 (original), 298 (patched)
<https://reviews.apache.org/r/72156/#comment307840>

    Consider replacing the changes in #298 to #324 with setting up 
'typeNamePredicate' in #101 to an in-memory filter that checks if the given 
vertex is an entity vertext or not.
    
      typeNamePredicate = 
SearchPredicateUtil.generateIsEntityVertexPredicate(context.getTypeRegistry());
    
    Similar one might be needed to check for classifications as well, to handle 
ALL_CLASSIFICATIONS filter. Please review and update.
    
    class SearchPredicateUtil {
    
      public static Predicate generateIsEntityVertexPredicate(AtlasTypeRegistry 
typeRegistry) {
        return new IsEntityVertexPredicate(typeRegistry)
      }
    
      static class IsEntityVertexPredicate extends Predicate {
        final AtlasTypeRegistry typeRegistry;
    
        public IsEntityVertexPredicate(AtlasTypeRegistry typeRegistry) {
          this.typeRegistry = typeRegistry;
        }
    
        @Override
        public boolean evaluate(final Object object) {
          final boolean ret;
    
          AtlasVertex vertex = (object instanceof AtlasVertex) ? 
(AtlasVertex)object : null;
    
          if (vertex != null) {
            String          typeName   = AtlasGraphUtilsV2.getTypeName(vertex);
            AtlasEntityType entityType = typeRegistry.getEntityType(typeName);
            
            ret = entityType != null;
          } else {
            ret = false;
          }
        }
      }



repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java
Lines 333 (patched)
<https://reviews.apache.org/r/72156/#comment307839>

    'isLastResultPage' should be set based on # of vertices in entityVertices 
before in-memory filters are applied in #327, #330 and #309/#318. Consider the 
case where all entries in entityVertices are removed by in-memory filter but 
the graph-db has more vertices for the search critieria.


- Madhan Neethiraj


On Feb. 21, 2020, 12:23 p.m., Pinal Shah wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/72156/
> -----------------------------------------------------------
> 
> (Updated Feb. 21, 2020, 12:23 p.m.)
> 
> 
> Review request for atlas, Madhan Neethiraj, Nixon Rodrigues, and Sarath 
> Subramanian.
> 
> 
> Bugs: ATLAS-3618
>     https://issues.apache.org/jira/browse/ATLAS-3618
> 
> 
> Repository: atlas
> 
> 
> Description
> -------
> 
> 1) Entities of struct types appears when ALL_ENTITY_TYPES is selected
> 2) Entities of internal types like AtlasGlossary etc appears when 
> ALL_ENTITY_TYPES is selected
> 
> 
> Diffs
> -----
> 
>   intg/src/main/java/org/apache/atlas/type/AtlasEntityType.java 2824feb16 
>   
> repository/src/main/java/org/apache/atlas/discovery/EntitySearchProcessor.java
>  b5606d046 
>   
> repository/src/main/java/org/apache/atlas/repository/store/graph/v2/AtlasGraphUtilsV2.java
>  bf13338b6 
> 
> 
> Diff: https://reviews.apache.org/r/72156/diff/1/
> 
> 
> Testing
> -------
> 
> 1) typeName: ALL_ENTITY_TYPES returns all entities with no struct types(whoes 
> guid isnotnull) and no internal types(whoes supertype is not _internal)
> 2) typeName: ALL_ENTITY_TYPES, filter: guid isnull, returns no result
> 3) typeName: ALL_ENTITY_TYPES, filter: typeName begins_with Atlas, returns no 
> result
> 
> 
> Thanks,
> 
> Pinal Shah
> 
>

Reply via email to