> On March 3, 2017, 10:13 p.m., Vadim Spector wrote: > > sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestCounterWait.java > > Lines 55 (patched) > > <https://reviews.apache.org/r/57219/diff/5/?file=1655286#file1655286line55> > > > > The way inSyncQueue is used (only care of its size), it would be > > simpler to use CoundDownLatch instead: > > > > CountDownLatch cdl = new CountDownLatch(nthreads); > > in run() method: > > cdl.countDown(); > > and after executor.execute() loop: > > cdl.await(); > > > > Or, perhaps even better, for more concurrency around waiter.waitFor() > > calls: > > > > CountDownLatch cdl = new CountDownLatch(1); > > in run() method: > > cdl.await(); > > and after executor.execute() loop: > > cdl.countDown(); > > > > Another thought, if CounterWait had getNumWaiters() method, it would be > > more robust (less chances of flaky tests) to do smth. like this instead of > > sleep(100): > > > > while (waiter.getNumWaiters() < nthreads) { > > sleep(10); > > }
Oops, I've missed, CounterWait.waitersCount() already exists ... even better - Vadim ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/57219/#review167879 ----------------------------------------------------------- On March 3, 2017, 3:08 a.m., Alexander Kolbasov wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/57219/ > ----------------------------------------------------------- > > (Updated March 3, 2017, 3:08 a.m.) > > > Review request for sentry, Misha Dmitriev, Lei Xu, Hao Hao, kalyan kumar > kalvagadda, Mat Crocker, Vamsee Yarlagadda, and Vadim Spector. > > > Bugs: SENTRY-1601 > https://issues.apache.org/jira/browse/SENTRY-1601 > > > Repository: sentry > > > Description > ------- > > SENTRY-1601 Implement HMS Notification barrier on the server side > > > Diffs > ----- > > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/persistent/SentryStore.java > b9272bc80ea473685b90f6c30dc8e0b0dff7b9a9 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryMetrics.java > 3f7542c2b7bfacc99b5a2bed14f841d5ec89f6e1 > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/provider/db/service/thrift/SentryPolicyStoreProcessor.java > 30e91ae05af5350ea30f08e099d73feac94c120a > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/CounterWait.java > PRE-CREATION > > sentry-provider/sentry-provider-db/src/main/java/org/apache/sentry/service/thrift/HMSFollower.java > bdbb0cc3ff639bf2e5c3725e6ebf1cc641c01374 > > sentry-provider/sentry-provider-db/src/test/java/org/apache/sentry/service/thrift/TestCounterWait.java > PRE-CREATION > > > Diff: https://reviews.apache.org/r/57219/diff/5/ > > > Testing > ------- > > The new CounterWait class has a unit test. End to end functionality will be > tested once HMS part is implemented. > > > Thanks, > > Alexander Kolbasov > >
