use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.
the class RecordLoadingTest method shouldReturnsFalseOnMissingToken.
@Test
void shouldReturnsFalseOnMissingToken() {
// given
NodeRecord entity = new NodeRecord(0);
TokenHolder tokenHolder = new DelegatingTokenHolder(new ReadOnlyTokenCreator(), "Test");
TokenStore<PropertyKeyTokenRecord> store = mock(TokenStore.class);
BiConsumer noopReporter = mock(BiConsumer.class);
// when
boolean valid = RecordLoading.checkValidToken(entity, 0, tokenHolder, store, noopReporter, noopReporter, CursorContext.NULL);
// then
assertFalse(valid);
}
use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.
the class PhysicalLogCommandReaderV2_0 method visitPropertyKeyTokenCommand.
private Command visitPropertyKeyTokenCommand(ReadableChannel channel) throws IOException {
// id+in_use(byte)+count(int)+key_blockId(int)
int id = channel.getInt();
byte inUseFlag = channel.get();
boolean inUse = false;
if ((inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue()) {
inUse = true;
} else if (inUseFlag != Record.NOT_IN_USE.byteValue()) {
throw new IOException("Illegal in use flag: " + inUseFlag);
}
PropertyKeyTokenRecord record = new PropertyKeyTokenRecord(id);
record.setInUse(inUse);
record.setPropertyCount(channel.getInt());
record.setNameId(channel.getInt());
int recordNr = readDynamicRecords(channel, record, PROPERTY_INDEX_DYNAMIC_RECORD_ADDER);
if (recordNr == -1) {
return null;
}
return new Command.PropertyKeyTokenCommand(null, record);
}
use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.
the class PhysicalLogCommandReaderV2_1 method visitPropertyKeyTokenCommand.
private Command visitPropertyKeyTokenCommand(ReadableChannel channel) throws IOException {
// id+in_use(byte)+count(int)+key_blockId(int)
int id = channel.getInt();
byte inUseFlag = channel.get();
boolean inUse = false;
if ((inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue()) {
inUse = true;
} else if (inUseFlag != Record.NOT_IN_USE.byteValue()) {
throw new IOException("Illegal in use flag: " + inUseFlag);
}
PropertyKeyTokenRecord record = new PropertyKeyTokenRecord(id);
record.setInUse(inUse);
record.setPropertyCount(channel.getInt());
record.setNameId(channel.getInt());
if (readDynamicRecords(channel, record, PROPERTY_INDEX_DYNAMIC_RECORD_ADDER) == -1) {
return null;
}
return new Command.PropertyKeyTokenCommand(null, record);
}
use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.
the class PhysicalLogCommandReaderV2_2_4 method visitPropertyKeyTokenCommand.
private Command visitPropertyKeyTokenCommand(ReadableChannel channel) throws IOException {
// id+in_use(byte)+count(int)+key_blockId(int)
int id = channel.getInt();
byte inUseFlag = channel.get();
boolean inUse = false;
if ((inUseFlag & Record.IN_USE.byteValue()) == Record.IN_USE.byteValue()) {
inUse = true;
} else if (inUseFlag != Record.NOT_IN_USE.byteValue()) {
throw new IOException("Illegal in use flag: " + inUseFlag);
}
PropertyKeyTokenRecord record = new PropertyKeyTokenRecord(id);
record.setInUse(inUse);
record.setPropertyCount(channel.getInt());
record.setNameId(channel.getInt());
if (readDynamicRecords(channel, record, PROPERTY_INDEX_DYNAMIC_RECORD_ADDER) == -1) {
return null;
}
return new Command.PropertyKeyTokenCommand(null, record);
}
use of org.neo4j.kernel.impl.store.record.PropertyKeyTokenRecord in project neo4j by neo4j.
the class PhysicalLogCommandReaderV3_0_2 method visitPropertyKeyTokenCommand.
private Command visitPropertyKeyTokenCommand(ReadableChannel channel) throws IOException {
int id = channel.getInt();
PropertyKeyTokenRecord before = readPropertyKeyTokenRecord(id, channel);
if (before == null) {
return null;
}
PropertyKeyTokenRecord after = readPropertyKeyTokenRecord(id, channel);
if (after == null) {
return null;
}
return new Command.PropertyKeyTokenCommand(before, after);
}
Aggregations