public Iterable<DynamicRecord> getUsedDynamicLabelRecords() { return filter( AbstractBaseRecord::inUse, dynamicLabelRecords ); }
@Override public Iterable<RecordProxy<RECORD,ADDITIONAL>> changes() { return Iterables.filter( RecordProxy::isChanged, recordChanges.values() ); }
private Iterable<ConstraintDefinition> filteredRelationshipConstraints( String typeName, Predicate<ConstraintDefinition> filter ) { RelationshipType type = RelationshipType.withName( typeName ); Iterable<ConstraintDefinition> constraints = graphDb.schema().getConstraints( type ); return filter( filter, constraints ); }
private Iterable<ConstraintDefinition> filteredNodeConstraints( String labelName, Predicate<ConstraintDefinition> filter ) { Iterable<ConstraintDefinition> constraints = graphDb.schema().getConstraints( label( labelName ) ); return filter( filter, constraints ); }
private PropertyCommand singlePropertyCommand( Collection<StorageCommand> commands ) { return (PropertyCommand) Iterables.single( filter( t -> t instanceof PropertyCommand, commands ) ); }
private RelationshipGroupCommand singleRelationshipGroupCommand( Collection<StorageCommand> commands ) { return (RelationshipGroupCommand) Iterables.single( filter( t -> t instanceof RelationshipGroupCommand, commands ) ); }
/** * Matches the provided schema descriptors to the node updates in this object, and generates an IndexEntryUpdate * for any index that needs to be updated. * * Note that unless this object contains a full representation of the node state after the update, the results * from this methods will not be correct. In that case, use the propertyLoader variant. * * @param indexKeys The index keys to generate entry updates for * @return IndexEntryUpdates for all relevant index keys */ public <INDEX_KEY extends SchemaDescriptorSupplier> Iterable<IndexEntryUpdate<INDEX_KEY>> forIndexKeys( Iterable<INDEX_KEY> indexKeys ) { Iterable<INDEX_KEY> potentiallyRelevant = Iterables.filter( indexKey -> atLeastOneRelevantChange( indexKey.schema() ), indexKeys ); return gatherUpdatesForPotentials( potentiallyRelevant ); }
private Iterable<ConstraintDefinition> filteredRelationshipConstraints( String typeName, final ConstraintType type ) { return filter( item -> item.isConstraintType( type ), graphDb.schema().getConstraints( RelationshipType.withName( typeName ) ) ); }
private Iterable<ConstraintDefinition> filteredNodeConstraints( String labelName, final ConstraintType type ) { return filter( item -> item.isConstraintType( type ), graphDb.schema().getConstraints( label( labelName ) ) ); }
@Override public MutableDiffSetsImpl<T> filterAdded( Predicate<T> addedFilter ) { return new MutableDiffSetsImpl<>( Iterables.asSet( Iterables.filter( addedFilter, added( false ) ) ), Iterables.asSet( removed( false ) ) ); }
public Iterable<ConstraintDefinition> getPropertyUniquenessConstraints( String labelName, final String propertyKey ) { try ( Transaction tx = database.getGraph().beginTransaction( implicit, AnonymousContext.read() ) ) { Iterable<ConstraintDefinition> definitions = Iterables.filter( item -> { if ( item.isConstraintType( ConstraintType.UNIQUENESS ) ) { Iterable<String> keys = item.getPropertyKeys(); return single( keys ).equals( propertyKey ); } else { return false; } }, database.getGraph().schema().getConstraints( label( labelName ) ) ); tx.success(); return definitions; } }
count( filter( n -> n.getId() <= SCAN_BARRIER_NODE_ID_THRESHOLD, nodes ) ), greaterThan( 0L ) ); assertThat( "At least two nodes above the scan barrier threshold and below initial creation threshold must have been created, " + "otherwise test assumptions are invalid or outdated", count( filter( n -> n.getId() > SCAN_BARRIER_NODE_ID_THRESHOLD, nodes ) ), greaterThan( 1L ) ); db.getDependencyResolver().resolveDependency( IdController.class ).maintenance();
for ( Node node : filter( n -> n.hasLabel( label ) && n.hasProperty( NAME_PROPERTY ), db.getAllNodes() ) )
@Override public Iterable<RecordProxy<RECORD,ADDITIONAL>> changes() { return Iterables.filter( RecordProxy::isChanged, recordChanges.values() ); }
private Iterable<IndexDefinition> indexesByLabel( org.neo4j.graphdb.schema.Schema schema, Label[] labels ) { Iterable<IndexDefinition> indexes = schema.getIndexes(); for ( final Label label : labels ) { indexes = filter( item -> item.getLabel().name().equals( label.name() ), indexes ); } return indexes; }
private Iterable<ConstraintDefinition> filteredRelationshipConstraints( String typeName, Predicate<ConstraintDefinition> filter ) { RelationshipType type = RelationshipType.withName( typeName ); Iterable<ConstraintDefinition> constraints = graphDb.schema().getConstraints( type ); return filter( filter, constraints ); }
private Iterable<ConstraintDefinition> filteredNodeConstraints( String labelName, Predicate<ConstraintDefinition> filter ) { Iterable<ConstraintDefinition> constraints = graphDb.schema().getConstraints( label( labelName ) ); return filter( filter, constraints ); }
private Iterable<IndexDefinition> indexesByLabelAndProperty( org.neo4j.graphdb.schema.Schema schema, Label[] labels, final String property ) { Iterable<IndexDefinition> indexes = indexesByLabel( schema, labels ); if ( property != null ) { indexes = filter( index -> indexOf( property, index.getPropertyKeys() ) != -1, indexes ); } return indexes; }
private Iterable<ConstraintDefinition> constraintsByLabelAndProperty( org.neo4j.graphdb.schema.Schema schema, final Label[] labels, final String property ) { return filter( constraint -> isNodeConstraint( constraint ) && hasLabel( constraint, labels ) && isMatchingConstraint( constraint, property ), schema.getConstraints() ); }
@Override public MutableDiffSetsImpl<T> filterAdded( Predicate<T> addedFilter ) { return new MutableDiffSetsImpl<>( Iterables.asSet( Iterables.filter( addedFilter, added( false ) ) ), Iterables.asSet( removed( false ) ) ); }