Github user mattf-horton commented on a diff in the pull request:
https://github.com/apache/metron/pull/622#discussion_r128650596
--- Diff:
metron-analytics/metron-profiler-common/src/main/java/org/apache/metron/profiler/hbase/SaltyRowKeyBuilder.java
---
@@ -81,20 +99,19 @@ public SaltyRowKeyBuilder(int saltDivisor, long
duration, TimeUnit units) {
* @return All of the row keys necessary to retrieve the profile
measurements.
*/
@Override
- public List<byte[]> rowKeys(String profile, String entity, List<Object>
groups, long start, long end) {
+ public List<byte[]> encode(String profile, String entity, List<Object>
groups, long start, long end) {
// be forgiving of out-of-order start and end times; order is critical
to this algorithm
end = Math.max(start, end);
start = Math.min(start, end);
--- End diff --
Heh, this has been in the code for a long time, but isn't this a bug? If
it starts out in the wrong order, say end is 1 and start is 5, won't this pair
of statements result in both end and start being equal to the larger, ie 5 ?
We need an intermediate variable for a binary swap!
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---