use of org.neo4j.kernel.impl.store.record.DynamicRecord in project neo4j by neo4j.
the class RelativeIdRecordAllocator method nextRecord.
@Override
public DynamicRecord nextRecord() {
DynamicRecord record = new DynamicRecord(id++);
record.setInUse(true);
record.setCreated();
return record;
}
use of org.neo4j.kernel.impl.store.record.DynamicRecord in project neo4j by neo4j.
the class BatchInserterImpl method createNodePropertyExistenceConstraintRule.
private void createNodePropertyExistenceConstraintRule(int labelId, int... propertyKeyIds) {
SchemaRule rule = ConstraintRule.constraintRule(schemaStore.nextId(), ConstraintDescriptorFactory.existsForLabel(labelId, propertyKeyIds));
for (DynamicRecord record : schemaStore.allocateFrom(rule)) {
schemaStore.updateRecord(record);
}
schemaCache.addSchemaRule(rule);
labelsTouched = true;
flushStrategy.forceFlush();
}
use of org.neo4j.kernel.impl.store.record.DynamicRecord in project neo4j by neo4j.
the class BatchInserterImpl method createNewRelationshipType.
private int createNewRelationshipType(String name) {
int id = (int) relationshipTypeTokenStore.nextId();
RelationshipTypeTokenRecord record = new RelationshipTypeTokenRecord(id);
record.setInUse(true);
record.setCreated();
Collection<DynamicRecord> nameRecords = relationshipTypeTokenStore.allocateNameRecords(encodeString(name));
record.setNameId((int) Iterables.first(nameRecords).getId());
record.addNameRecords(nameRecords);
relationshipTypeTokenStore.updateRecord(record);
relationshipTypeTokens.addToken(new RelationshipTypeToken(name, id));
return id;
}
use of org.neo4j.kernel.impl.store.record.DynamicRecord in project neo4j by neo4j.
the class BatchInserterImpl method createIndexRule.
private void createIndexRule(int labelId, int[] propertyKeyIds) {
IndexRule schemaRule = IndexRule.indexRule(schemaStore.nextId(), NewIndexDescriptorFactory.forLabel(labelId, propertyKeyIds), schemaIndexProviders.getDefaultProvider().getProviderDescriptor());
for (DynamicRecord record : schemaStore.allocateFrom(schemaRule)) {
schemaStore.updateRecord(record);
}
schemaCache.addSchemaRule(schemaRule);
labelsTouched = true;
flushStrategy.forceFlush();
}
use of org.neo4j.kernel.impl.store.record.DynamicRecord in project neo4j by neo4j.
the class BatchInserterImpl method createUniquenessConstraintRule.
private void createUniquenessConstraintRule(UniquenessConstraint constraint) {
// TODO: Do not create duplicate index
long indexRuleId = schemaStore.nextId();
long constraintRuleId = schemaStore.nextId();
int propertyKeyId = constraint.indexDescriptor().schema().getPropertyId();
IndexRule indexRule = IndexRule.constraintIndexRule(indexRuleId, NewIndexDescriptorFactory.uniqueForLabel(constraint.label(), propertyKeyId), this.schemaIndexProviders.getDefaultProvider().getProviderDescriptor(), constraintRuleId);
ConstraintRule constraintRule = ConstraintRule.constraintRule(constraintRuleId, ConstraintDescriptorFactory.uniqueForLabel(constraint.label(), propertyKeyId), indexRuleId);
for (DynamicRecord record : schemaStore.allocateFrom(constraintRule)) {
schemaStore.updateRecord(record);
}
schemaCache.addSchemaRule(constraintRule);
for (DynamicRecord record : schemaStore.allocateFrom(indexRule)) {
schemaStore.updateRecord(record);
}
schemaCache.addSchemaRule(indexRule);
labelsTouched = true;
flushStrategy.forceFlush();
}
Aggregations