use of org.neo4j.internal.kernel.api.TokenWrite in project neo4j by neo4j.
the class NodeGetUniqueFromIndexSeekIT method createKeys.
@BeforeEach
void createKeys() throws Exception {
TokenWrite tokenWrite = tokenWriteInNewTransaction();
this.labelId = tokenWrite.labelGetOrCreateForName("Person");
this.propertyId1 = tokenWrite.propertyKeyGetOrCreateForName("foo");
this.propertyId2 = tokenWrite.propertyKeyGetOrCreateForName("bar");
commit();
}
use of org.neo4j.internal.kernel.api.TokenWrite in project neo4j by neo4j.
the class NodeCheckerTest method initialData.
@Override
void initialData(KernelTransaction tx) throws KernelException {
TokenWrite tokenWrite = tx.tokenWrite();
int[] labelIds = new int[300];
for (int i = 0; i < labelIds.length; i++) {
labelIds[i] = tokenWrite.labelGetOrCreateForName(String.valueOf(i));
}
Arrays.sort(labelIds);
label1 = labelIds[0];
label2 = labelIds[1];
label3 = labelIds[2];
otherLabels = Arrays.copyOfRange(labelIds, 3, labelIds.length);
unusedLabel = labelIds[labelIds.length - 1] + 99;
}
use of org.neo4j.internal.kernel.api.TokenWrite in project neo4j by neo4j.
the class IndexIT method createIndexesForDifferentLabelsConcurrently.
@Test
@Timeout(10)
void createIndexesForDifferentLabelsConcurrently() throws Throwable {
TokenWrite tokenWrite = tokenWriteInNewTransaction();
int label2 = tokenWrite.labelGetOrCreateForName("Label2");
commit();
LabelSchemaDescriptor anotherLabelDescriptor = SchemaDescriptor.forLabel(label2, propertyKeyId);
schemaWriteInNewTransaction().indexCreate(anotherLabelDescriptor, "my index");
Future<?> indexFuture = executorService.submit(createIndex(db, label(LABEL), PROPERTY_KEY));
indexFuture.get();
commit();
}
use of org.neo4j.internal.kernel.api.TokenWrite in project neo4j by neo4j.
the class IndexIT method createLabelAndProperty.
@BeforeEach
void createLabelAndProperty() throws Exception {
TokenWrite tokenWrites = tokenWriteInNewTransaction();
labelId = tokenWrites.labelGetOrCreateForName(LABEL);
labelId2 = tokenWrites.labelGetOrCreateForName(LABEL2);
relType = tokenWrites.relationshipTypeGetOrCreateForName(REL_TYPE);
relType2 = tokenWrites.relationshipTypeGetOrCreateForName(REL_TYPE2);
propertyKeyId = tokenWrites.propertyKeyGetOrCreateForName(PROPERTY_KEY);
propertyKeyId2 = tokenWrites.propertyKeyGetOrCreateForName(PROPERTY_KEY2);
schema = SchemaDescriptor.forLabel(labelId, propertyKeyId);
schema2 = SchemaDescriptor.forLabel(labelId, propertyKeyId2);
commit();
executorService = Executors.newCachedThreadPool();
}
use of org.neo4j.internal.kernel.api.TokenWrite in project neo4j by neo4j.
the class CompositeUniquenessConstraintValidationIT method setup.
@BeforeEach
public void setup() throws Exception {
kernel = db.getDependencyResolver().resolveDependency(Kernel.class);
newTransaction();
// This transaction allocates all the tokens we'll need in this test.
// We rely on token ids being allocated sequentially, from and including zero.
TokenWrite tokenWrite = transaction.tokenWrite();
tokenWrite.labelGetOrCreateForName("Label0");
label = tokenWrite.labelGetOrCreateForName("Label1");
propIds = new int[10];
for (int i = 0; i < propIds.length; i++) {
propIds[i] = tokenWrite.propertyKeyGetOrCreateForName("prop" + i);
}
commit();
}
Aggregations