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));
}
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);
}
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);
}
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;
}
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());
}
Aggregations