Skip to content

Commit c6c5a15

Browse files
committed
Merge branch 'master' into BZ927278
2 parents 04eb60b + b3e898c commit c6c5a15

File tree

8 files changed

+208
-161
lines changed

8 files changed

+208
-161
lines changed

conf/core-site.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,8 @@
3535
<value>Off</value>
3636
</property>
3737

38+
<property>
39+
<name>fs.glusterfs.write.buffer.size</name>
40+
<value>1024</value>
41+
</property>
3842
</configuration>

pom.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>org.apache.hadoop.fs.glusterfs</groupId>
55
<artifactId>glusterfs</artifactId>
66
<packaging>jar</packaging>
7-
<version>0.20.2-0.1</version>
7+
<version>0.0.1-${maven.build.timestamp}</version>
88
<name>glusterfs</name>
99
<url>http://maven.apache.org</url>
1010
<dependencies>
@@ -18,6 +18,17 @@
1818
<artifactId>hadoop-core</artifactId>
1919
<version>0.20.2</version>
2020
</dependency>
21+
<dependency>
22+
<groupId>org.slf4j</groupId>
23+
<artifactId>slf4j-api</artifactId>
24+
<version>1.5.8</version>
25+
<scope>compile</scope>
26+
</dependency>
27+
<dependency>
28+
<groupId>org.slf4j</groupId>
29+
<artifactId>slf4j-log4j12</artifactId>
30+
<version>1.7.3</version>
31+
</dependency>
2132
</dependencies>
2233
<build>
2334
<plugins>

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

Lines changed: 0 additions & 73 deletions
This file was deleted.

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

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,31 @@
2020
package org.apache.hadoop.fs.glusterfs;
2121

2222
import java.io.*;
23-
24-
import org.apache.hadoop.fs.FSOutputSummer;
25-
import org.apache.hadoop.fs.FileSystem;
26-
23+
/**
24+
* An OutputStream for writing to a FUSE mount intended for use with gluster.
25+
*/
2726
public class GlusterFUSEOutputStream extends OutputStream{
2827
File f;
2928
long pos;
3029
boolean closed;
3130
OutputStream fuseOutputStream;
31+
org.slf4j.Logger LOG = org.slf4j.LoggerFactory.getLogger(GlusterFUSEOutputStream.class);
3232

3333
public GlusterFUSEOutputStream(String file, boolean append) throws IOException{
34+
this(file,append,0);
35+
}
36+
37+
/**
38+
* @param bufferSize : Size of buffer in bytes (if 0, then no buffer will be used).
39+
*/
40+
public GlusterFUSEOutputStream(String file, boolean append, int bufferSize) throws IOException{
3441
this.f=new File(file); /* not needed ? */
3542
this.pos=0;
36-
this.fuseOutputStream=new FileOutputStream(file, append);
43+
fuseOutputStream=new FileOutputStream(file, append) ;
44+
if(bufferSize > 0)
45+
fuseOutputStream = new BufferedOutputStream(fuseOutputStream, bufferSize);
3746
this.closed=false;
3847
}
39-
4048
public long getPos() throws IOException{
4149
return pos;
4250
}

0 commit comments

Comments
 (0)