@Override protected int createKey( Transaction transaction, String name ) throws IllegalTokenNameException, TooManyLabelsException { return transaction.tokenWrite().labelCreateForName( name ); } }
@Override protected int createKey( Transaction transaction, String name ) throws IllegalTokenNameException { return transaction.tokenWrite().propertyKeyCreateForName( name ); } }
private long createLabeledNode( Transaction transaction, String label ) throws KernelException { long node = transaction.dataWrite().nodeCreate(); int labelId = transaction.tokenWrite().labelGetOrCreateForName( label ); transaction.dataWrite().nodeAddLabel( node, labelId ); return node; }
private Value getPropertyValueFromStore( long nodeReference ) { try ( NodeCursor storeCursor = cursors.allocateNodeCursor(); PropertyCursor propertyCursor = cursors.allocatePropertyCursor() ) { read.singleNode( nodeReference, storeCursor ); storeCursor.next(); storeCursor.properties( propertyCursor ); propertyCursor.next(); return propertyCursor.propertyValue(); } }
private void assertNoNode( long nodeId ) throws TransactionFailureException { try ( Transaction tx = beginTransaction(); NodeCursor cursor = tx.cursors().allocateNodeCursor() ) { tx.dataRead().singleNode( nodeId, cursor ); assertFalse( cursor.next() ); } } }
protected int countNodes( Transaction transaction ) { int result = 0; try ( NodeCursor cursor = transaction.cursors().allocateNodeCursor() ) { transaction.dataRead().allNodesScan( cursor ); while ( cursor.next() ) { result++; } } return result; }
private int getPropertyKeyForName( String name ) throws TransactionFailureException { try ( Transaction tx = kernel.beginTransaction( implicit, AUTH_DISABLED ) ) { int result = tx.tokenRead().propertyKey( name ); tx.success(); return result; } }
static int countRelationships( Transaction transaction ) { int result = 0; try ( RelationshipScanCursor cursor = transaction.cursors().allocateRelationshipScanCursor() ) { transaction.dataRead().allRelationshipsScan( cursor ); while ( cursor.next() ) { result++; } } return result; }
private boolean hasProperties( RelationshipScanCursor cursor, Transaction tx ) { try ( PropertyCursor propertyCursor = tx.cursors().allocatePropertyCursor() ) { cursor.properties( propertyCursor ); return propertyCursor.next(); } }
private void dropIndex( IndexReference reference ) throws KernelException { try ( Transaction transaction = kernel.beginTransaction( implicit, AUTH_DISABLED ) ) { transaction.schemaWrite().indexDrop( reference ); transaction.success(); } }
private void dropConstraint( ConstraintDescriptor descriptor ) throws KernelException { try ( Transaction transaction = kernel.beginTransaction( implicit, AUTH_DISABLED ) ) { transaction.schemaWrite().constraintDrop( descriptor ); transaction.success(); } }
private long createLabeledNode( int labelId ) throws KernelException { long node = transaction.dataWrite().nodeCreate(); transaction.dataWrite().nodeAddLabel( node, labelId ); return node; }
private boolean hasProperties( NodeCursor node, PropertyCursor props ) { node.properties( props ); return props.next(); }
protected SchemaWrite schemaWriteInNewTransaction() throws KernelException { transaction = kernel.beginTransaction( implicit, AUTH_DISABLED ); return transaction.schemaWrite(); }
private void relateNTimes( int nRelationshipsInStore, int type, long n1, long n2, Transaction tx ) throws KernelException { for ( int i = 0; i < nRelationshipsInStore; i++ ) { tx.dataWrite().relationshipCreate( n1, type, n2 ); } }
protected Transaction beginTransaction() throws TransactionFailureException { Kernel kernel = testSupport.kernelToTest(); return kernel.beginTransaction( Transaction.Type.implicit, LoginContext.AUTH_DISABLED ); }
protected Transaction beginTransaction() throws TransactionFailureException { Kernel kernel = testSupport.kernelToTest(); return kernel.beginTransaction( Transaction.Type.implicit, LoginContext.AUTH_DISABLED ); }
@Override public void createTestGraph( GraphDatabaseService graphDb ) { RelationshipTestSupport.someGraph( graphDb ); bareStartAndEnd( graphDb ); sparse = RelationshipTestSupport.sparse( graphDb ); dense = RelationshipTestSupport.dense( graphDb ); }
public static Permissions allPermissions() { return new Permissions( Permissions.Grant.values() ); } }
private boolean hasProperties( NodeCursor cursor, PropertyCursor props ) { cursor.properties( props ); return props.next(); }