use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class LegacyLogsTest method createNode.
private static LogEntry createNode(int id) {
NodeRecord before = new NodeRecord(id).initialize(false, NO_NEXT_REL, false, NO_NEXT_REL, NO_LABELS);
NodeRecord after = new NodeRecord(id).initialize(true, NO_NEXT_REL, false, NO_NEXT_REL, NO_LABELS);
Command.NodeCommand command = new Command.NodeCommand(before, after);
return new LogEntryCommand(command);
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class LogEntrySortingCursorTest method command.
private LogEntry command() {
NodeRecord before = new NodeRecord(random.nextInt());
NodeRecord after = new NodeRecord(random.nextInt());
return new LogEntryCommand(new Command.NodeCommand(before, after));
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class NodeDynamicLabelOrphanChainStartCheckTest method shouldReportOwningNodeRecordNotInUse.
@Test
public void shouldReportOwningNodeRecordNotInUse() throws Exception {
// given
NodeRecord nodeRecord = notInUse(new NodeRecord(12L, false, -1, -1));
add(nodeRecord);
DynamicRecord nodeDynamicLabelRecord = inUse(new DynamicRecord(0));
allocateFromNumbers(new ArrayList<>(), new long[] { 12L }, new ReusableRecordsAllocator(66, nodeDynamicLabelRecord));
// when
DynamicLabelConsistencyReport report = check(nodeDynamicLabelRecord);
// then
verify(report).orphanDynamicLabelRecordDueToInvalidOwner(nodeRecord);
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class DuplicatePropertyTest method shouldReportDuplicatePropertyIndexesInPropertyRecordForNode.
@Test
public void shouldReportDuplicatePropertyIndexesInPropertyRecordForNode() throws Exception {
// given
ChainCheck check = new ChainCheck();
RecordAccessStub records = new RecordAccessStub();
NodeRecord master = records.add(inUse(new NodeRecord(1, false, -1, 1)));
PropertyRecord propertyRecord = inUse(new PropertyRecord(1));
PropertyBlock firstBlock = new PropertyBlock();
firstBlock.setSingleBlock(1);
firstBlock.setKeyIndexId(1);
PropertyBlock secondBlock = new PropertyBlock();
secondBlock.setSingleBlock(1);
secondBlock.setKeyIndexId(2);
PropertyBlock thirdBlock = new PropertyBlock();
thirdBlock.setSingleBlock(1);
thirdBlock.setKeyIndexId(1);
propertyRecord.addPropertyBlock(firstBlock);
propertyRecord.addPropertyBlock(secondBlock);
propertyRecord.addPropertyBlock(thirdBlock);
records.add(propertyRecord);
// when
ConsistencyReport.NodeConsistencyReport report = mock(ConsistencyReport.NodeConsistencyReport.class);
CheckerEngine<NodeRecord, ConsistencyReport.NodeConsistencyReport> checkEngine = records.engine(master, report);
check.checkReference(master, propertyRecord, checkEngine, records);
// then
verify(report).propertyKeyNotUniqueInChain();
}
use of org.neo4j.kernel.impl.store.record.NodeRecord in project neo4j by neo4j.
the class DumpStoreChain method chainForNode.
private static DumpStoreChain chainForNode(Args args) {
Set<String> kwArgs = args.asMap().keySet();
verifyParameters(kwArgs, kwArgs.contains(RELS) ? RELS : PROPS, NODE);
final long node = Long.parseLong(args.get(NODE, null));
if (args.getBoolean(RELS, false, true)) {
return new DumpRelationshipChain(-1, node, false) {
@Override
RelationshipStore store(NeoStores neoStores) {
NodeRecord nodeRecord = nodeRecord(neoStores, node);
first = nodeRecord.isDense() ? -1 : nodeRecord.getNextRel();
return super.store(neoStores);
}
};
} else if (args.getBoolean(PROPS, false, true)) {
return new DumpPropertyChain(-1, false) {
@Override
PropertyStore store(NeoStores neoStores) {
first = nodeRecord(neoStores, node).getNextProp();
return super.store(neoStores);
}
};
} else {
throw invalidUsage(String.format("Must be either -%s or -%s", RELS, PROPS));
}
}
Aggregations