flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpe...@apache.org
Subject flume git commit: FLUME-2844. SpillableMemoryChannel must start ChannelCounter
Date Wed, 17 Aug 2016 22:49:11 GMT
Repository: flume
Updated Branches:
  refs/heads/trunk b6dede8c1 -> 118d5a4bc


FLUME-2844. SpillableMemoryChannel must start ChannelCounter

Reviewed by Bessenyei Balázs Donát

(Denes Arvay via Mike Percy)


Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/118d5a4b
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/118d5a4b
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/118d5a4b

Branch: refs/heads/trunk
Commit: 118d5a4bcf5371fb215e0f7393fadf26073643f8
Parents: b6dede8
Author: Denes Arvay <denes@cloudera.com>
Authored: Wed Aug 17 11:00:16 2016 -0700
Committer: Mike Percy <mpercy@apache.org>
Committed: Wed Aug 17 11:01:36 2016 -0700

----------------------------------------------------------------------
 .../java/org/apache/flume/channel/SpillableMemoryChannel.java     | 1 +
 .../java/org/apache/flume/channel/TestSpillableMemoryChannel.java | 3 +++
 2 files changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/118d5a4b/flume-ng-channels/flume-spillable-memory-channel/src/main/java/org/apache/flume/channel/SpillableMemoryChannel.java
----------------------------------------------------------------------
diff --git a/flume-ng-channels/flume-spillable-memory-channel/src/main/java/org/apache/flume/channel/SpillableMemoryChannel.java
b/flume-ng-channels/flume-spillable-memory-channel/src/main/java/org/apache/flume/channel/SpillableMemoryChannel.java
index b46d646..09d7f29 100644
--- a/flume-ng-channels/flume-spillable-memory-channel/src/main/java/org/apache/flume/channel/SpillableMemoryChannel.java
+++ b/flume-ng-channels/flume-spillable-memory-channel/src/main/java/org/apache/flume/channel/SpillableMemoryChannel.java
@@ -790,6 +790,7 @@ public class SpillableMemoryChannel extends FileChannel {
       drainOrder.putOverflow(overFlowCount);
       totalStored.release(overFlowCount);
     }
+    channelCounter.start();
     int totalCount = overFlowCount + memQueue.size();
     channelCounter.setChannelCapacity(memoryCapacity + getOverflowCapacity());
     channelCounter.setChannelSize(totalCount);

http://git-wip-us.apache.org/repos/asf/flume/blob/118d5a4b/flume-ng-channels/flume-spillable-memory-channel/src/test/java/org/apache/flume/channel/TestSpillableMemoryChannel.java
----------------------------------------------------------------------
diff --git a/flume-ng-channels/flume-spillable-memory-channel/src/test/java/org/apache/flume/channel/TestSpillableMemoryChannel.java
b/flume-ng-channels/flume-spillable-memory-channel/src/test/java/org/apache/flume/channel/TestSpillableMemoryChannel.java
index 848636b..ab90c3d 100644
--- a/flume-ng-channels/flume-spillable-memory-channel/src/test/java/org/apache/flume/channel/TestSpillableMemoryChannel.java
+++ b/flume-ng-channels/flume-spillable-memory-channel/src/test/java/org/apache/flume/channel/TestSpillableMemoryChannel.java
@@ -682,6 +682,9 @@ public class TestSpillableMemoryChannel {
     params.put("overflowTimeout", "0");
     startChannel(params);
 
+    Assert.assertTrue("channel.channelCounter should have started",
+        channel.channelCounter.getStartTime() > 0);
+
     //1. fill up mem queue
     Thread sourceThd = makePutThread("src", 1, 5000, 2500, channel);
     sourceThd.start();


Mime
View raw message