gosonzhang commented on a change in pull request #174: URL: https://github.com/apache/incubator-tubemq/pull/174#discussion_r447314196
########## File path: tubemq-server/src/main/java/org/apache/tubemq/server/broker/metadata/TopicMetadata.java ########## @@ -37,7 +37,7 @@ private int unflushThreshold = 1000; // data will be flushed to disk when unflushed message count exceed this. private int unflushInterval = 10000; - @Deprecated + // data will be flushed to disk when unflushed data size reach this threshold. private int unflushDataHold = 10000; Review comment: The initial value of unflushdatahold is set to 0. By default, this function is turned off. When it is online, it is turned on as needed. ########## File path: tubemq-server/src/main/java/org/apache/tubemq/server/broker/msgstore/disk/MsgFileStore.java ########## @@ -169,8 +169,10 @@ public void batchAppendMsg(final StringBuilder sb, final int msgCnt, } // check whether need to flush to disk. long currTime = System.currentTimeMillis(); + int unflushDataHold = this.messageStore.getTopicMetadata().getUnflushDataHold(); Review comment: The topicMetadata initialized may not be the latest metadata object. It should be safe to construct the unflushdatahold according to the unflushinterval ########## File path: tubemq-server/src/main/java/org/apache/tubemq/server/broker/metadata/BrokerDefMetadata.java ########## @@ -32,7 +32,7 @@ private int numPartitions = 1; // data will be flushed to disk when unflushed message count exceed this. private int unflushThreshold = 1000; - @Deprecated + // data will be flushed to disk when unflushed data size reaches the threshold. private int unflushDataHold = 10000; Review comment: The initial value of unflushdatahold is set to 0 to turn off this feature by default. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org