public GenericEntityScanStreamReader(EntityDefinition entityDef, SearchCondition condition, String prefix) throws InstantiationException, IllegalAccessException { this.prefix = prefix; checkNotNull(entityDef, "entityDef"); this.entityDef = entityDef; checkNotNull(entityDef, "EntityDefinition"); this.condition = condition; }
return new GenericEntityScanStreamReader(entityDef, condition, this.prefix);
private StreamReader selectQueryReader() throws InstantiationException, IllegalAccessException { final ORExpression query = condition.getQueryExpression(); IndexDefinition[] indexDefs = entityDef.getIndexes(); // Index just works with query condition if (indexDefs != null && condition.getQueryExpression()!=null) { List<byte[]> rowkeys = new ArrayList<>(); for (IndexDefinition index : indexDefs) { // Check unique index first if (index.isUnique()) { final IndexDefinition.IndexType type = index.canGoThroughIndex(query, rowkeys); if (!IndexDefinition.IndexType.NON_INDEX.equals(type)) { LOG.info("Selectd query unique index " + index.getIndexName() + " for query: " + condition.getQueryExpression()); return new UniqueIndexStreamReader(index, condition, rowkeys); } } } for (IndexDefinition index : indexDefs) { // Check non-clustered index if (!index.isUnique()) { final IndexDefinition.IndexType type = index.canGoThroughIndex(query, rowkeys); if (!IndexDefinition.IndexType.NON_INDEX.equals(type)) { LOG.info("Selectd query non clustered index " + index.getIndexName() + " for query: " + condition.getQueryExpression().toString()); return new NonClusteredIndexStreamReader(index, condition, rowkeys); } } } } return new GenericEntityScanStreamReader(entityDef, condition, this.prefix); }
public GenericEntityScanStreamReader(EntityDefinition entityDef, SearchCondition condition, String prefix) throws InstantiationException, IllegalAccessException{ this.prefix = prefix; checkNotNull(entityDef, "entityDef"); this.entityDef = entityDef; checkNotNull(entityDef, "EntityDefinition"); this.condition = condition; }
public GenericEntityScanStreamReader(String serviceName, SearchCondition condition, String prefix) throws InstantiationException, IllegalAccessException { this.prefix = prefix; checkNotNull(serviceName, "serviceName"); this.entityDef = EntityDefinitionManager.getEntityByServiceName(serviceName); checkNotNull(entityDef, "EntityDefinition"); this.condition = condition; }
public GenericEntityScanStreamReader(String serviceName, SearchCondition condition, String prefix) throws InstantiationException, IllegalAccessException{ this.prefix = prefix; checkNotNull(serviceName, "serviceName"); this.entityDef = EntityDefinitionManager.getEntityByServiceName(serviceName); checkNotNull(entityDef, "EntityDefinition"); this.condition = condition; }