You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by qi...@apache.org on 2023/06/27 11:43:38 UTC
[iotdb] branch master updated: [IOTDB-6030] Improve efficiency of ConfigNode PartitionInfo takeSnapshot (#10335)
This is an automated email from the ASF dual-hosted git repository.
qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/master by this push:
new 25edadc0835 [IOTDB-6030] Improve efficiency of ConfigNode PartitionInfo takeSnapshot (#10335)
25edadc0835 is described below
commit 25edadc08353c36afe022ea15da76e2f39229b4d
Author: YongzaoDan <33...@users.noreply.github.com>
AuthorDate: Tue Jun 27 19:43:31 2023 +0800
[IOTDB-6030] Improve efficiency of ConfigNode PartitionInfo takeSnapshot (#10335)
---
.../iotdb/confignode/persistence/partition/PartitionInfo.java | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java
index c6a74c1313e..7b3c6629931 100644
--- a/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java
+++ b/confignode/src/main/java/org/apache/iotdb/confignode/persistence/partition/PartitionInfo.java
@@ -72,8 +72,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
import java.io.File;
-import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.util.ArrayList;
@@ -780,7 +780,9 @@ public class PartitionInfo implements SnapshotProcessor {
// snapshot operation.
File tmpFile = new File(snapshotFile.getAbsolutePath() + "-" + UUID.randomUUID());
- try (FileOutputStream fileOutputStream = new FileOutputStream(tmpFile);
+ try (BufferedOutputStream fileOutputStream =
+ new BufferedOutputStream(
+ Files.newOutputStream(tmpFile.toPath()), PARTITION_TABLE_BUFFER_SIZE);
TIOStreamTransport tioStreamTransport = new TIOStreamTransport(fileOutputStream)) {
TProtocol protocol = new TBinaryProtocol(tioStreamTransport);