[
https://issues.apache.org/jira/browse/METRON-1005?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16095513#comment-16095513
]
ASF GitHub Bot commented on METRON-1005:
----------------------------------------
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!
> Create Decodable Row Key for Profiler
> -------------------------------------
>
> Key: METRON-1005
> URL: https://issues.apache.org/jira/browse/METRON-1005
> Project: Metron
> Issue Type: Improvement
> Affects Versions: 0.3.0
> Reporter: Nick Allen
> Assignee: Nick Allen
> Fix For: Next + 1
>
>
> To be able to answer the types of questions that I outlined in METRON-450, we
> need a row key that is decodable. Right now there is no logic to decode a
> row key, nor is the existing row key easily decodable.
> Once the row keys can be decoded, you could scan all of the row keys in the
> Profiler's HBase table, decode each of them and extract things like, the
> names of all your profiles, the names of entities within a profile, the
> period duration of a given profile.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)