> On Aug. 30, 2013, 9:20 p.m., Jay Kreps wrote: > > samza-api/src/main/java/org/apache/samza/util/BlockingEnvelopeMap.java, > > line 220 > > <https://reviews.apache.org/r/13912/diff/1/?file=346598#file346598line220> > > > > Should the inc/dec method be added in Gauge with proper synchronization > > there?
Thinking on this more, I think we can use the fact that the Gauge has an atomic reference to do read/modify/write in a thread-safe manner without locking the gauge. - Chris ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/13912/#review25806 ----------------------------------------------------------- On Aug. 30, 2013, 4:15 p.m., Chris Riccomini wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/13912/ > ----------------------------------------------------------- > > (Updated Aug. 30, 2013, 4:15 p.m.) > > > Review request for samza. > > > Repository: samza > > > Description > ------- > > lock gauges when we update, since this is not atomic, and there's a race > condition between poll and add > > > switch counter to gauge for buffered message count map > > > Diffs > ----- > > samza-api/src/main/java/org/apache/samza/util/BlockingEnvelopeMap.java > c1dd27988f130f38adcd39e0bc811b6f8074ca6b > > Diff: https://reviews.apache.org/r/13912/diff/ > > > Testing > ------- > > > Thanks, > > Chris Riccomini > >
