Skip to content

Conversation

@dcapwell
Copy link
Contributor

@dcapwell dcapwell commented Mar 4, 2024

No description provided.

{
int domainSize = (maxExclusive - minInclusive + 1);
if (domainSize < 0)
throw new IllegalArgumentException("Range is too large; min=" + minInclusive + ", max=" + maxExclusive);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could support but figured its best to keep this logic simpler until thats needed... if you want mixDistribution(Long.MIN_VALUE, Long.MAX_VALUE) we need BigInteger to handle this...

int[] array, indexes;
if (domainSize > 200) // randomly selected
{
int numBuckets = 10;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when it comes to randomWeight and zipF having larger arrays doesn't make too much sense, so this puts a bias into a smaller array and generates values within that section of the range.

I could make this a config, but I didn't need so can refactor later if needed


import static accord.utils.Property.qt;

class SearchableRangeListTest
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is kinda duplicated in org.apache.cassandra.utils.RTreeTest#test but has better coverage... I wrote this class first and feel its always best to have tests at this level / project rather than depending on the C* test...


compileJava {
sourceCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_11
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we actually don't compile on jdk8... so this just makes it so we can use JDK 11 features again

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant