Skip to content

Commit 27875b6

Browse files
committed
Merge pull request #84 from childsb/bz1010407
Set a default block size if not already defined.
2 parents edc7fff + a59d234 commit 27875b6

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/main/java/org/apache/hadoop/fs/glusterfs/GlusterVolume.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public class GlusterVolume extends RawLocalFileSystem{
4848
*/
4949
public static final int OVERRIDE_WRITE_BUFFER_SIZE = 1024 * 4;
5050
public static final int OPTIMAL_WRITE_BUFFER_SIZE = 1024 * 128;
51+
public static final int DEFAULT_BLOCK_SIZE = 64 * 1024 * 1024;
5152

5253
public static final URI NAME = URI.create("glusterfs:///");
5354

@@ -107,6 +108,18 @@ public void setConf(Configuration conf){
107108
conf.setInt("io.file.buffer.size", OPTIMAL_WRITE_BUFFER_SIZE);
108109
}
109110
log.info("Write buffer size : " +conf.getInt("io.file.buffer.size",-1)) ;
111+
112+
/**
113+
* Default block size
114+
*/
115+
116+
Long defaultBlockSize=conf.getLong("fs.local.block.size", -1);
117+
118+
if(defaultBlockSize == -1) {
119+
conf.setInt("fs.local.block.size", DEFAULT_BLOCK_SIZE);
120+
}
121+
log.info("Default block size : " +conf.getInt("fs.local.block.size",-1)) ;
122+
110123
}
111124
catch (Exception e){
112125
throw new RuntimeException(e);

0 commit comments

Comments
 (0)