/** * Get the edge types from the search criteria. * * @param scope The org scope * @param search The edge type search info * @param cf The column family to execute on */ private Iterator<String> getEdgeTypes( final ApplicationScope scope, final SearchEdgeType search, final MultiTenantColumnFamily<BucketScopedRowKey<Id>, String> cf ) { ValidationUtils.validateApplicationScope( scope ); GraphValidation.validateSearchEdgeType( search ); final Id applicationId = scope.getApplication(); final Id searchNode = search.getNode(); final int[] bucketIds = idExpandingShardLocator.getAllBuckets( searchNode ); //no generics is intentional here final List<BucketScopedRowKey<Id>> buckets = BucketScopedRowKey.fromRange( applicationId, searchNode, bucketIds ); final ColumnSearch<String> columnSearch = createSearch( search ); return new MultiRowColumnIterator( keyspace, cf, cassandraConfig.getReadCL(), PARSER, columnSearch, STRING_COMPARATOR, buckets, graphFig.getScanPageSize() ); }
/** * Get the id types from the specified column family * * @param scope The organization scope to use * @param search The search criteria * @param cf The column family to search */ public Iterator<String> getIdTypes( final ApplicationScope scope, final SearchIdType search, final MultiTenantColumnFamily<BucketScopedRowKey<EdgeIdTypeKey>, String> cf ) { ValidationUtils.validateApplicationScope( scope ); GraphValidation.validateSearchEdgeIdType( search ); final Id applicationId = scope.getApplication(); final Id searchNode = search.getNode(); final EdgeIdTypeKey edgeIdTypeKey = new EdgeIdTypeKey( searchNode, search.getEdgeType() ); final int[] bucketIds = edgeTypeExpandingShardLocator.getAllBuckets( edgeIdTypeKey ); //no generics is intentional here final List<BucketScopedRowKey<EdgeIdTypeKey>> buckets = BucketScopedRowKey.fromRange( applicationId, edgeIdTypeKey, bucketIds ); final ColumnSearch<String> columnSearch = createSearch( search ); return new MultiRowColumnIterator( keyspace, cf, cassandraConfig.getReadCL(), PARSER, columnSearch, STRING_COMPARATOR, buckets, graphFig.getScanPageSize() ); }