> On Aug. 18, 2015, 10:51 p.m., Szehon Ho wrote: > > serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorFactory.java, > > line 90 > > <https://reviews.apache.org/r/37591/diff/2/?file=1043884#file1043884line90> > > > > Seems a little risky to me, what if there are some bad GC pause? > > > > If it's fully-inited it should get notified , so how about a longer > > timeout? > > Szehon Ho wrote: > Sorry, my question should be, why can't we sleep the thread, and wait for > it to get notified? > > Jimmy Xiang wrote: > We have a while loop, so it is fine to take longer than this much time to > init. Here, wait() achieves the same effect as sleep and get notified. It's > kind of sleep for up to that much time unless it is got notified earlier. > > Szehon Ho wrote: > I mean, should we wait without a timeout then? Not sure if we will ever > miss a notify? > > Jimmy Xiang wrote: > I see. That should work too. With a timeout, so that we can periodically > run a check and throw RuntimeException if things go wrong. > > Szehon Ho wrote: > I'm not so sure, I think it just does the same check in a while loop > without any other exit condition, right? Interrupt exception will happen > anyway regardless of the timeout.
Right, if the init is ok, both work the same way. When the init fails, using wait() is a little different, it could think the init is ok. - Jimmy ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/37591/#review95789 ----------------------------------------------------------- On Aug. 18, 2015, 9:51 p.m., Jimmy Xiang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/37591/ > ----------------------------------------------------------- > > (Updated Aug. 18, 2015, 9:51 p.m.) > > > Review request for hive. > > > Bugs: HIVE-11586 > https://issues.apache.org/jira/browse/HIVE-11586 > > > Repository: hive-git > > > Description > ------- > > Made ObjectInspectorFactory.getReflectionObjectInspector thread-safe. When it > returns, the object inspector is fully initialized. > > > Diffs > ----- > > > serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ObjectInspectorFactory.java > 97bb715 > > serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ReflectionStructObjectInspector.java > 78e6066 > > serde/src/java/org/apache/hadoop/hive/serde2/objectinspector/ThriftUnionObjectInspector.java > 600abbb > > serde/src/test/org/apache/hadoop/hive/serde2/objectinspector/TestReflectionObjectInspectors.java > e2408c6 > > Diff: https://reviews.apache.org/r/37591/diff/ > > > Testing > ------- > > Unit test > > > Thanks, > > Jimmy Xiang > >