----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/59869/#review177277 -----------------------------------------------------------
sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryUtil.java Lines 107 (patched) <https://reviews.apache.org/r/59869/#comment250807> This is O(N). But we are dealing with sequence ranges, so it is enough to check that the value is within the range which is O(1) operation. sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryUtil.java Lines 126 (patched) <https://reviews.apache.org/r/59869/#comment250806> This seems simpler: int size = ids.size(); return (size <= 1) || ((ids.get(size - 1) - ids.get(0)) == (size - 1)); sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryUtil.java Lines 139 (patched) <https://reviews.apache.org/r/59869/#comment250810> Would the code produce such output? There is no joiner on commas. Also, the doc is incorrect, the output is not a list but a single string. sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryUtil.java Lines 145 (patched) <https://reviews.apache.org/r/59869/#comment250813> There should be a unit test for this function. Also, do we get any value from generics here? We can only do these on arithmetic types anyway, so this limits us to ints/longs - does it warrants generics? sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryUtil.java Lines 147 (patched) <https://reviews.apache.org/r/59869/#comment250811> I think that's an overkill - it should be possible to do in a single pass over a list. sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryUtil.java Lines 152 (patched) <https://reviews.apache.org/r/59869/#comment250812> For two consequitive numbers (e.g. 5, 6) there is no value of writing 5-6, we only want to collapse for 3 or more. sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java Line 3745 (original), 3746 (patched) <https://reviews.apache.org/r/59869/#comment250808> Please update this comment is well - it is very confusing. In particular, what should happen if there is a hole between changeId and deltas? E.g. changeId is 5 and we get deltas 10-15 sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java Line 3760 (original), 3765 (patched) <https://reviews.apache.org/r/59869/#comment250809> If the value is not included it doesn't mean that we have holes, it just means that we don't have enough deltas and need to send a full snapshot - Alexander Kolbasov On June 8, 2017, 1:05 a.m., Vamsee Yarlagadda wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/59869/ > ----------------------------------------------------------- > > (Updated June 8, 2017, 1:05 a.m.) > > > Review request for sentry, Alexander Kolbasov and Lei Xu. > > > Repository: sentry > > > Description > ------- > > * Changes on top of Lina's review (https://reviews.apache.org/r/59820/) > * Adds a couple of helper methods that would go under MSentryUtil > > > Diffs > ----- > > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryChange.java > 6011ef407aaf82d211c81f6d6a55975fb21261b9 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/model/MSentryUtil.java > 7558267546fc8c4dedc4f739df6092851becfc31 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java > 37eb0b25e10ef69057599277aa5941ca05d52290 > > > Diff: https://reviews.apache.org/r/59869/diff/5/ > > > Testing > ------- > > In progress. > > > Thanks, > > Vamsee Yarlagadda > >
