----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/6982/#review11517 -----------------------------------------------------------
Thanks for the patch! This change needs to be reworked to be thread safe under concurrency. I have marked a couple of the places below, but I didn't mark all of them. In general, we need to use atomic increment / decrement operations. flume-ng-core/src/main/java/org/apache/flume/channel/MemoryChannel.java <https://reviews.apache.org/r/6982/#comment24752> Not thread safe; need to use atomic increment operations (i.e. AtomicLong) to avoid interleaving ops between threads. flume-ng-core/src/main/java/org/apache/flume/channel/MemoryChannel.java <https://reviews.apache.org/r/6982/#comment24751> This variable is not thread safe. I recommend using an AtomicLong. - Mike Percy On Sept. 10, 2012, 1:59 p.m., Ted Malaska wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/6982/ > ----------------------------------------------------------- > > (Updated Sept. 10, 2012, 1:59 p.m.) > > > Review request for Flume. > > > Description > ------- > > 1. The user will be able to define a byteCapacity and a > byteCapacityBufferPercentage. > 2. Events byte size will be estimated from there body contents > 3. On put bytes are added to current total > 4. On commit any uncommitted takes are removed from the current byte total > 5. On rollover any uncommitted puts are removed from the current byte total > > > This addresses bug FLUME-1535. > https://issues.apache.org/jira/browse/FLUME-1535 > > > Diffs > ----- > > flume-ng-core/src/main/java/org/apache/flume/channel/MemoryChannel.java > c72e97c > flume-ng-core/src/test/java/org/apache/flume/channel/TestMemoryChannel.java > e070864 > > Diff: https://reviews.apache.org/r/6982/diff/ > > > Testing > ------- > > > Thanks, > > Ted Malaska > >
