mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
hdfs: Hadoop on SeaweedFS: create empty file
This commit is contained in:
parent
95bfec4931
commit
ac162fc857
|
@ -8,14 +8,10 @@ import org.apache.hadoop.fs.permission.FsPermission;
|
||||||
import org.apache.hadoop.security.UserGroupInformation;
|
import org.apache.hadoop.security.UserGroupInformation;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import seaweedfs.client.FilerClient;
|
import seaweedfs.client.*;
|
||||||
import seaweedfs.client.FilerGrpcClient;
|
|
||||||
import seaweedfs.client.FilerProto;
|
|
||||||
import seaweedfs.client.SeaweedRead;
|
|
||||||
|
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
@ -202,8 +198,7 @@ public class SeaweedFileSystemStore {
|
||||||
.clearGroupName()
|
.clearGroupName()
|
||||||
.addAllGroupName(Arrays.asList(userGroupInformation.getGroupNames()))
|
.addAllGroupName(Arrays.asList(userGroupInformation.getGroupNames()))
|
||||||
);
|
);
|
||||||
|
SeaweedWrite.writeMeta(filerGrpcClient, getParentDirectory(path), entry);
|
||||||
filerClient.createEntry(getParentDirectory(path), entry.build());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SeaweedOutputStream(filerGrpcClient, path, entry, writePosition, bufferSize, replication);
|
return new SeaweedOutputStream(filerGrpcClient, path, entry, writePosition, bufferSize, replication);
|
||||||
|
|
Loading…
Reference in a new issue