use of jetbrains.exodus.entitystore.tables.PropertyValue in project xodus by JetBrains.
the class PropertyRangeIterable method countImpl.
@Override
protected long countImpl(@NotNull final PersistentStoreTransaction txn) {
final Cursor cursor = openCursor(txn);
if (cursor == null) {
return 0;
}
try {
final PropertyValue propertyValue = getStore().getPropertyTypes().dataToPropertyValue(min);
final ComparableBinding binding = propertyValue.getBinding();
long result = 0;
boolean success = cursor.getSearchKeyRange(propertyValue.dataToEntry()) != null;
while (success && max.compareTo(binding.entryToObject(cursor.getKey())) >= 0) {
result += cursor.count();
success = cursor.getNextNoDup();
}
return result;
} finally {
cursor.close();
}
}
Aggregations