Ready: Better Search Testing + Bug Fix#594
Conversation
| } | ||
|
|
||
| if (rows > 0) | ||
| if (rows >= 0) |
There was a problem hiding this comment.
I take it that the builderwas not creating anything for zero rows?
There was a problem hiding this comment.
I think I see now. You changed the value to be initialized to -1 so now you have to set it to zero explicitly.
|
Errors from the builder: |
|
@javajolt @lukebakken This one's ready too! |
| private final String name; | ||
| private final String schema; | ||
|
|
||
| private volatile Integer nVal; |
There was a problem hiding this comment.
yaRly! We set it with withNVal() a few lines down, and not in the constructor. We typically mark any non-final fields as volatile in these "core" datatype objects, to make them thread-safer with all the setup we do. I also didn't want to add two more constructors :).
There was a problem hiding this comment.
So this protects against the case where two threads have access to the same YokozunaIndex object and one calls withNVal at the same time as the other calls getNVal.
There was a problem hiding this comment.
Yep. Since we don't have any synchronizing .build() function, the volatile will force a synchronization of an update across cached copies of the variable in other threads. Atomic vars would be overkill here.
|
Just a couple comments. |
|
👍 Tests passed on the 2nd & 3rd run. The first time, com.basho.riak.client.core.operations.itest.ITestListKeysOperation hung up on me indefinitely. It could have been my local config. Code changes look good. |
|
@christophermancini What was the error the first time? |
|
@alexmoore no error, just sat there for a good 10+ minutes till I killed it. |
|
@christophermancini Ok. That's one of those tests that I have suspicions about and want to rewrite at some point so I'll note it in my log. |
Ready: Better Search Testing + Bug Fix
|
That was my guess, which is why I noted it but wasn't too concerned. |
Refactored search setup into common base class to reduce duplication & make it easier to test search going forward.
Also contains a fix for #547 (CLIENTS-599), and #539 (CLIENTS-557).