use of org.neo4j.kernel.impl.api.store.StorePropertyCursor in project neo4j by neo4j.
the class StoreMigrator method propertyDecorator.
private <ENTITY extends InputEntity, RECORD extends PrimitiveRecord> BiConsumer<ENTITY, RECORD> propertyDecorator(boolean requiresPropertyMigration, RecordCursors cursors) {
if (!requiresPropertyMigration) {
return (a, b) -> {
};
}
final StorePropertyCursor cursor = new StorePropertyCursor(cursors, ignored -> {
});
final List<Object> scratch = new ArrayList<>();
return (ENTITY entity, RECORD record) -> {
cursor.init(record.getNextProp(), LockService.NO_LOCK);
scratch.clear();
while (cursor.next()) {
// add key as int here as to have the importer use the token id
scratch.add(cursor.propertyKeyId());
scratch.add(cursor.value());
}
entity.setProperties(scratch.isEmpty() ? InputEntity.NO_PROPERTIES : scratch.toArray());
cursor.close();
};
}
Aggregations