From ac162fc85769cb1b2a1f8694f9644eae7d0ce6c8 Mon Sep 17 00:00:00 2001 From: limd Date: Sat, 10 Oct 2020 13:07:27 +0800 Subject: [PATCH] hdfs: Hadoop on SeaweedFS: create empty file --- .../java/seaweed/hdfs/SeaweedFileSystemStore.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java index 2d9f3ccb9..c76160bd2 100644 --- a/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java +++ b/other/java/hdfs3/src/main/java/seaweed/hdfs/SeaweedFileSystemStore.java @@ -8,14 +8,10 @@ import org.apache.hadoop.fs.permission.FsPermission; import org.apache.hadoop.security.UserGroupInformation; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import seaweedfs.client.FilerClient; -import seaweedfs.client.FilerGrpcClient; -import seaweedfs.client.FilerProto; -import seaweedfs.client.SeaweedRead; +import seaweedfs.client.*; import java.io.FileNotFoundException; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; import java.util.ArrayList; import java.util.Arrays; @@ -202,8 +198,7 @@ public class SeaweedFileSystemStore { .clearGroupName() .addAllGroupName(Arrays.asList(userGroupInformation.getGroupNames())) ); - - filerClient.createEntry(getParentDirectory(path), entry.build()); + SeaweedWrite.writeMeta(filerGrpcClient, getParentDirectory(path), entry); } return new SeaweedOutputStream(filerGrpcClient, path, entry, writePosition, bufferSize, replication); @@ -280,4 +275,4 @@ public class SeaweedFileSystemStore { } -} +} \ No newline at end of file