You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ta...@apache.org on 2023/06/27 13:24:14 UTC
[iotdb] branch rel/1.2 updated: [To rel/1.2][IOTDB-6030] Improve efficiency of ConfigNode PartitionInfo takeSnapshot (#10336)
This is an automated email from the ASF dual-hosted git repository.
tanxinyu pushed a commit to branch rel/1.2
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/rel/1.2 by this push:
new a7710cb25a3 [To rel/1.2][IOTDB-6030] Improve efficiency of ConfigNode PartitionInfo takeSnapshot (#10336)
a7710cb25a3 is described below
commit a7710cb25a3f9cfe96db7e903de2c682ecc0e0c7
Author: YongzaoDan <33...@users.noreply.github.com>
AuthorDate: Tue Jun 27 21:24:05 2023 +0800
[To rel/1.2][IOTDB-6030] Improve efficiency of ConfigNode PartitionInfo takeSnapshot (#10336)
* Finish
* unparallel take snapshot
---
.../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);