[GitHub] incubator-rocketmq pull request #143: [ROCKETMQ-256] Clean commit log files ...

2017-09-20 Thread dongeforever
Github user dongeforever commented on a diff in the pull request:

https://github.com/apache/incubator-rocketmq/pull/143#discussion_r140139906
  
--- Diff: 
store/src/main/java/org/apache/rocketmq/store/DefaultMessageStore.java ---
@@ -1392,6 +1397,14 @@ public void run() {
 }, 6, TimeUnit.SECONDS);
 }
 
+@Override
+public void purge(int watermark, long consumedPhysicalOffset, boolean 
force) {
+cleanCommitLogService.setPurgeForcefullyWhenManual(force);
+cleanCommitLogService.setDiskSpaceManuallyCleanRatio(watermark / 
100.0);
+
cleanCommitLogService.setConsumedPhysicalOffset(consumedPhysicalOffset);
+cleanCommitLogService.executeDeleteFilesManually();
--- End diff --

This is not thread safe.
How about just delivering the arguments into executeDeleteFilesManually() 
directly?


---


[GitHub] incubator-rocketmq pull request #143: [ROCKETMQ-256] Clean commit log files ...

2017-09-20 Thread dongeforever
Github user dongeforever commented on a diff in the pull request:

https://github.com/apache/incubator-rocketmq/pull/143#discussion_r140139302
  
--- Diff: common/src/test/java/org/apache/rocketmq/common/UtilAllTest.java 
---
@@ -89,6 +89,14 @@ public void testGetDiskPartitionSpaceUsedPercent() {
 
assertThat(UtilAll.getDiskPartitionSpaceUsedPercent(tmpDir)).isNotCloseTo(-1, 
within(0.01));
 }
 
+
+@Test
+public void testGetDiskPartitionSpaceUsedPercent4Home() {
+String tmpDir = System.getProperty("user.home");
+double percent = UtilAll.getDiskPartitionSpaceUsedPercent(tmpDir);
+System.out.println(percent);
--- End diff --

What did this unit test mean for?


---


[GitHub] incubator-rocketmq pull request #143: [ROCKETMQ-256] Clean commit log files ...

2017-09-20 Thread dongeforever
Github user dongeforever commented on a diff in the pull request:

https://github.com/apache/incubator-rocketmq/pull/143#discussion_r140139119
  
--- Diff: 
broker/src/main/java/org/apache/rocketmq/broker/plugin/AbstractPluginMessageStore.java
 ---
@@ -246,4 +247,14 @@ public void setConfirmOffset(long phyOffset) {
 public ConsumeQueue getConsumeQueue(String topic, int queueId) {
 return next.getConsumeQueue(topic, queueId);
 }
+
+@Override
+public PutMessageResult putMessages(MessageExtBatch messageExtBatch) {
+return null;
+}
--- End diff --

why return null  but not next.putMessages(messageExtBatch)


---


[GitHub] incubator-rocketmq pull request #143: [ROCKETMQ-256] Clean commit log files ...

2017-08-07 Thread lizhanhui
GitHub user lizhanhui opened a pull request:

https://github.com/apache/incubator-rocketmq/pull/143

[ROCKETMQ-256] Clean commit log files manually to specified disk usage 
watermark

Associated JIRA ticket is: 
https://issues.apache.org/jira/browse/ROCKETMQ-256


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/lizhanhui/incubator-rocketmq store_clean

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/incubator-rocketmq/pull/143.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #143


commit b195d89905ce2ff3c9e24b5c676ebc75ab0537e7
Author: Li Zhanhui 
Date:   2017-08-01T12:57:00Z

develop

commit 9b187f337273ad3f93ee2d923ab55e1cdd46cc9e
Author: Li Zhanhui 
Date:   2017-08-04T05:54:55Z

Add command to clean commit log files to specified watermark

commit 56a1c3587028def12525dd0daed8dd28e128dd64
Author: Li Zhanhui 
Date:   2017-08-07T06:36:09Z

Delete commit log files to meet disk usage goals specified in command line

commit b9d0fafbc7f7e19eeba28a7e4a43c8055587dc41
Author: Li Zhanhui 
Date:   2017-08-07T07:16:05Z

Log detailed activity for manually purging commit log files

commit e6d323b81866386360708ea515734ccdd8cdd72c
Author: Li Zhanhui 
Date:   2017-08-07T07:19:39Z

Fix method throws signature

commit c967102209c27f268fb1c058263c909474d46b00
Author: Li Zhanhui 
Date:   2017-08-07T07:52:45Z

Implement the command




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---