Search in sources :

Example 61 with PropertyKeyTokenRecord

use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.

the class TransactionWriter method propertyKey.

public void propertyKey(int id, String key, boolean internal, int... dynamicIds) {
    PropertyKeyTokenRecord before = new PropertyKeyTokenRecord(id);
    PropertyKeyTokenRecord after = withName(new PropertyKeyTokenRecord(id), dynamicIds, key);
    after.setInternal(internal);
    otherCommands.add(new Command.PropertyKeyTokenCommand(before, after));
}
Also used : Command(org.neo4j.internal.recordstorage.Command) StorageCommand(org.neo4j.storageengine.api.StorageCommand) PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord)

Example 62 with PropertyKeyTokenRecord

use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.

the class TransactionWriter method create.

public void create(PropertyKeyTokenRecord token) {
    token.setCreated();
    update(new PropertyKeyTokenRecord(token.getIntId()), token);
}
Also used : PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord)

Example 63 with PropertyKeyTokenRecord

use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.

the class WriteTransactionCommandOrderingTest method injectAllPossibleCommands.

private static TransactionRecordState injectAllPossibleCommands() {
    RecordChangeSet recordChangeSet = mock(RecordChangeSet.class);
    RecordChanges<LabelTokenRecord, Void> labelTokenChanges = mock(RecordChanges.class);
    RecordChanges<RelationshipTypeTokenRecord, Void> relationshipTypeTokenChanges = mock(RecordChanges.class);
    RecordChanges<PropertyKeyTokenRecord, Void> propertyKeyTokenChanges = mock(RecordChanges.class);
    RecordChanges<NodeRecord, Void> nodeRecordChanges = mock(RecordChanges.class);
    RecordChanges<RelationshipRecord, Void> relationshipRecordChanges = mock(RecordChanges.class);
    RecordChanges<PropertyRecord, PrimitiveRecord> propertyRecordChanges = mock(RecordChanges.class);
    RecordChanges<RelationshipGroupRecord, Integer> relationshipGroupChanges = mock(RecordChanges.class);
    RecordChanges<SchemaRecord, SchemaRule> schemaRuleChanges = mock(RecordChanges.class);
    when(recordChangeSet.getLabelTokenChanges()).thenReturn(labelTokenChanges);
    when(recordChangeSet.getRelationshipTypeTokenChanges()).thenReturn(relationshipTypeTokenChanges);
    when(recordChangeSet.getPropertyKeyTokenChanges()).thenReturn(propertyKeyTokenChanges);
    when(recordChangeSet.getNodeRecords()).thenReturn(nodeRecordChanges);
    when(recordChangeSet.getRelRecords()).thenReturn(relationshipRecordChanges);
    when(recordChangeSet.getPropertyRecords()).thenReturn(propertyRecordChanges);
    when(recordChangeSet.getRelGroupRecords()).thenReturn(relationshipGroupChanges);
    when(recordChangeSet.getSchemaRuleChanges()).thenReturn(schemaRuleChanges);
    List<RecordProxy<NodeRecord, Void>> nodeChanges = new LinkedList<>();
    RecordChange<NodeRecord, Void> deletedNode = mock(RecordChange.class);
    when(deletedNode.getBefore()).thenReturn(inUseNode());
    when(deletedNode.forReadingLinkage()).thenReturn(missingNode());
    nodeChanges.add(deletedNode);
    RecordChange<NodeRecord, Void> createdNode = mock(RecordChange.class);
    when(createdNode.getBefore()).thenReturn(missingNode());
    when(createdNode.forReadingLinkage()).thenReturn(createdNode());
    nodeChanges.add(createdNode);
    RecordChange<NodeRecord, Void> updatedNode = mock(RecordChange.class);
    when(updatedNode.getBefore()).thenReturn(inUseNode());
    when(updatedNode.forReadingLinkage()).thenReturn(inUseNode());
    nodeChanges.add(updatedNode);
    when(nodeRecordChanges.changes()).thenReturn(nodeChanges);
    when(nodeRecordChanges.changeSize()).thenReturn(3);
    when(recordChangeSet.changeSize()).thenReturn(3);
    when(labelTokenChanges.changes()).thenReturn(Collections.emptyList());
    when(relationshipTypeTokenChanges.changes()).thenReturn(Collections.emptyList());
    when(propertyKeyTokenChanges.changes()).thenReturn(Collections.emptyList());
    when(relationshipRecordChanges.changes()).thenReturn(Collections.emptyList());
    when(propertyRecordChanges.changes()).thenReturn(Collections.emptyList());
    when(relationshipGroupChanges.changes()).thenReturn(Collections.emptyList());
    when(schemaRuleChanges.changes()).thenReturn(Collections.emptyList());
    NeoStores neoStores = mock(NeoStores.class);
    NodeStore store = mock(NodeStore.class);
    when(neoStores.getNodeStore()).thenReturn(store);
    RelationshipGroupStore relationshipGroupStore = mock(RelationshipGroupStore.class);
    when(neoStores.getRelationshipGroupStore()).thenReturn(relationshipGroupStore);
    RelationshipStore relationshipStore = mock(RelationshipStore.class);
    when(neoStores.getRelationshipStore()).thenReturn(relationshipStore);
    return new TransactionRecordState(neoStores, mock(IntegrityValidator.class), recordChangeSet, 0, null, LockTracer.NONE, null, null, null, NULL, INSTANCE, LATEST_LOG_SERIALIZATION);
}
Also used : RelationshipTypeTokenRecord(org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord) RelationshipRecord(org.neo4j.kernel.impl.store.record.RelationshipRecord) SchemaRule(org.neo4j.internal.schema.SchemaRule) PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord) NodeRecord(org.neo4j.kernel.impl.store.record.NodeRecord) PropertyRecord(org.neo4j.kernel.impl.store.record.PropertyRecord) NodeStore(org.neo4j.kernel.impl.store.NodeStore) SchemaRecord(org.neo4j.kernel.impl.store.record.SchemaRecord) LabelTokenRecord(org.neo4j.kernel.impl.store.record.LabelTokenRecord) PrimitiveRecord(org.neo4j.kernel.impl.store.record.PrimitiveRecord) RecordProxy(org.neo4j.internal.recordstorage.RecordAccess.RecordProxy) RelationshipGroupRecord(org.neo4j.kernel.impl.store.record.RelationshipGroupRecord) RelationshipGroupStore(org.neo4j.kernel.impl.store.RelationshipGroupStore) LinkedList(java.util.LinkedList) NeoStores(org.neo4j.kernel.impl.store.NeoStores) RelationshipStore(org.neo4j.kernel.impl.store.RelationshipStore)

Example 64 with PropertyKeyTokenRecord

use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.

the class PropertyStoreTest method propertyBlockWith.

private static PropertyBlock propertyBlockWith(DynamicRecord dynamicRecord) {
    PropertyBlock propertyBlock = new PropertyBlock();
    PropertyKeyTokenRecord key = new PropertyKeyTokenRecord(10);
    propertyBlock.setSingleBlock(key.getId() | (((long) PropertyType.STRING.intValue()) << 24) | (dynamicRecord.getId() << 28));
    propertyBlock.addValueRecord(dynamicRecord);
    return propertyBlock;
}
Also used : PropertyBlock(org.neo4j.kernel.impl.store.record.PropertyBlock) PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord)

Example 65 with PropertyKeyTokenRecord

use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.

the class AbstractRecordCloningTest method plainPropertyKeyTokenClone.

@RepeatedTest(1000)
void plainPropertyKeyTokenClone() {
    PropertyKeyTokenRecord propertyKeyTokenRecord = getPropertyKeyTokenRecord();
    keys.propertyKeyToken().assertRecordsEquals(propertyKeyTokenRecord, propertyKeyTokenRecord.copy());
}
Also used : PropertyKeyTokenRecord(org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord) RepeatedTest(org.junit.jupiter.api.RepeatedTest)

Aggregations

PropertyKeyTokenRecord (org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord)65 Test (org.junit.Test)31 DynamicRecord (org.neo4j.kernel.impl.store.record.DynamicRecord)30 ConsistencyReport (org.neo4j.consistency.report.ConsistencyReport)28 LabelTokenRecord (org.neo4j.kernel.impl.store.record.LabelTokenRecord)16 PropertyRecord (org.neo4j.kernel.impl.store.record.PropertyRecord)14 IOException (java.io.IOException)10 SchemaRuleUtil.constraintIndexRule (org.neo4j.consistency.checking.SchemaRuleUtil.constraintIndexRule)8 RecordAccessStub (org.neo4j.consistency.store.RecordAccessStub)8 SchemaIndexProvider (org.neo4j.kernel.api.index.SchemaIndexProvider)8 NodePropertyDescriptor (org.neo4j.kernel.api.schema.NodePropertyDescriptor)8 IndexRule (org.neo4j.kernel.impl.store.record.IndexRule)8 PropertyBlock (org.neo4j.kernel.impl.store.record.PropertyBlock)6 StorageCommand (org.neo4j.storageengine.api.StorageCommand)6 SchemaRuleUtil.uniquenessConstraintRule (org.neo4j.consistency.checking.SchemaRuleUtil.uniquenessConstraintRule)5 NeoStores (org.neo4j.kernel.impl.store.NeoStores)5 ConstraintRule (org.neo4j.kernel.impl.store.record.ConstraintRule)5 NodeRecord (org.neo4j.kernel.impl.store.record.NodeRecord)5 RelationshipTypeTokenRecord (org.neo4j.kernel.impl.store.record.RelationshipTypeTokenRecord)5 PrimitiveRecord (org.neo4j.kernel.impl.store.record.PrimitiveRecord)4