@@ -59,6 +59,7 @@ public class PaimonVirtualFileSystem extends FileSystem {
5959 private Configuration conf ;
6060
6161 private static final String USER_AGENT = "HadoopPVFS" ;
62+ private static final long DEFAULT_BLOCK_SIZE = 128 * 1024 * 1024L ;
6263
6364 @ Override
6465 public void initialize (URI uri , Configuration conf ) throws IOException {
@@ -299,7 +300,7 @@ public boolean delete(Path f, boolean recursive) throws IOException {
299300 public FileStatus getFileStatus (Path f ) throws IOException {
300301 VFSIdentifier vfsIdentifier = vfsOperations .getVFSIdentifier (getVirtualPath (f ));
301302 if (vfsIdentifier instanceof VFSCatalogIdentifier ) {
302- return new FileStatus (0 , true , 1 , 1 , 0 , new Path (this .uri ));
303+ return new FileStatus (0 , true , 1 , 0 , 0 , new Path (this .uri ));
303304 } else if (vfsIdentifier instanceof VFSDatabaseIdentifier ) {
304305 String databaseName = ((VFSDatabaseIdentifier ) vfsIdentifier ).databaseName ();
305306 GetDatabaseResponse database = vfsOperations .getDatabase (databaseName );
@@ -318,7 +319,7 @@ public FileStatus getFileStatus(Path f) throws IOException {
318319 }
319320
320321 private FileStatus convertDatabase (GetDatabaseResponse database ) {
321- return new FileStatus (0 , true , 1 , 1 , 0 , new Path (new Path (this .uri ), database .getName ()));
322+ return new FileStatus (0 , true , 1 , 0 , 0 , new Path (new Path (this .uri ), database .getName ()));
322323 }
323324
324325 private FileStatus convertFileStatus (
@@ -338,11 +339,12 @@ private FileStatus convertFileStatus(
338339 childPath = "/" + childPath ;
339340 }
340341 Path virtualPath = new Path (new Path (this .uri ), databaseName + "/" + tableName + childPath );
342+ long blockSize = fileStatus .isDir () ? 0 : DEFAULT_BLOCK_SIZE ;
341343 return new FileStatus (
342344 fileStatus .getLen (),
343345 fileStatus .isDir (),
344346 1 ,
345- 1 ,
347+ blockSize ,
346348 fileStatus .getModificationTime (),
347349 virtualPath );
348350 }
@@ -375,7 +377,7 @@ private FileStatus[] convertDatabases(List<String> databases) {
375377 for (int i = 0 ; i < databases .size (); i ++) {
376378 String database = databases .get (i );
377379 FileStatus fileStatus =
378- new FileStatus (0 , true , 1 , 1 , 0 , new Path (new Path (this .uri ), database ));
380+ new FileStatus (0 , true , 1 , 0 , 0 , new Path (new Path (this .uri ), database ));
379381 fileStatuses [i ] = fileStatus ;
380382 }
381383 return fileStatuses ;
@@ -387,7 +389,7 @@ private FileStatus[] convertTables(String database, List<String> tables) {
387389 String table = tables .get (i );
388390 FileStatus fileStatus =
389391 new FileStatus (
390- 0 , true , 1 , 1 , 0 , new Path (new Path (this .uri ), database + "/" + table ));
392+ 0 , true , 1 , 0 , 0 , new Path (new Path (this .uri ), database + "/" + table ));
391393 fileStatuses [i ] = fileStatus ;
392394 }
393395 return fileStatuses ;
0 commit comments