Skip to content

Commit acf43bf

Browse files
committed
add back ability to configure the getfattr command through core-site.xml.
1 parent fecde50 commit acf43bf

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,16 @@ public enum CMD {
4343

4444
private static String hostname;
4545

46-
private String getFattrCmdBase = "sudo getfattr -m . -n trusted.glusterfs.pathinfo";
47-
46+
private String getFattrCmdBase = null;
47+
48+
public GlusterFSXattr(String getAttr) {
49+
getFattrCmdBase=getAttr;
50+
}
4851

52+
public GlusterFSXattr(){
53+
getFattrCmdBase = "sudo getfattr -m . -n trusted.glusterfs.pathinfo";
54+
}
55+
4956
public String brick2host(String brick) throws IOException{
5057
String[] hf=null;
5158

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public class GlusterVolume extends RawLocalFileSystem{
4242

4343
protected String root=null;
4444

45-
protected static final GlusterFSXattr attr = new GlusterFSXattr();
45+
protected static GlusterFSXattr attr = null;
4646

4747
public GlusterVolume(){}
4848

@@ -55,10 +55,18 @@ public GlusterVolume(Configuration conf){
5555
public void setConf(Configuration conf){
5656
log.info("initializing gluster volume..");
5757
super.setConf(conf);
58+
String getfattrcmd = null;
5859
if(conf!=null){
5960

6061
try{
6162
root=conf.get("fs.glusterfs.mount", null);
63+
getfattrcmd = conf.get("fs.glusterfs.getfattrcmd", null);
64+
if(getfattrcmd!=null){
65+
attr = new GlusterFSXattr(getfattrcmd);
66+
}else{
67+
attr = new GlusterFSXattr();
68+
}
69+
6270
//volName=conf.get("fs.glusterfs.volname", null);
6371
//remoteGFSServer=conf.get("fs.glusterfs.server", null);
6472

0 commit comments

Comments
 (0)