You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ji...@apache.org on 2019/09/29 11:13:59 UTC
[incubator-iotdb] branch dev_preallocate_data_file updated: fix
create file option
This is an automated email from the ASF dual-hosted git repository.
jiangtian pushed a commit to branch dev_preallocate_data_file
in repository https://gitbox.apache.org/repos/asf/incubator-iotdb.git
The following commit(s) were added to refs/heads/dev_preallocate_data_file by this push:
new 99ffeb7 fix create file option
99ffeb7 is described below
commit 99ffeb75a072f4fe71e792b51288f8bf1dba657b
Author: jt <jt...@163.com>
AuthorDate: Sun Sep 29 19:02:57 2019 +0800
fix create file option
---
.../java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
index 12c2a4f..2e25521 100644
--- a/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
+++ b/server/src/main/java/org/apache/iotdb/db/engine/storagegroup/TsFileProcessor.java
@@ -139,7 +139,8 @@ public class TsFileProcessor {
private void preAllocateTsFile(File tsFile) throws IOException {
- try (FileChannel fileChannel = FileChannel.open(tsFile.toPath(), StandardOpenOption.CREATE_NEW)) {
+ try (FileChannel fileChannel = FileChannel.open(tsFile.toPath(),
+ StandardOpenOption.CREATE, StandardOpenOption.WRITE)) {
long fileSizeThreshold = IoTDBDescriptor.getInstance().getConfig().getTsFileSizeThreshold();
// usually, jvm cannot allocate size of just Integer.maxValue, so we use a smaller value
// instead