File tree Expand file tree Collapse file tree 2 files changed +18
-3
lines changed
src/main/java/org/apache/hadoop/fs/glusterfs Expand file tree Collapse file tree 2 files changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -43,9 +43,16 @@ public enum CMD {
43
43
44
44
private static String hostname ;
45
45
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
+ }
48
51
52
+ public GlusterFSXattr (){
53
+ getFattrCmdBase = "sudo getfattr -m . -n trusted.glusterfs.pathinfo" ;
54
+ }
55
+
49
56
public String brick2host (String brick ) throws IOException {
50
57
String [] hf =null ;
51
58
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public class GlusterVolume extends RawLocalFileSystem{
42
42
43
43
protected String root =null ;
44
44
45
- protected static final GlusterFSXattr attr = new GlusterFSXattr () ;
45
+ protected static GlusterFSXattr attr = null ;
46
46
47
47
public GlusterVolume (){}
48
48
@@ -55,10 +55,18 @@ public GlusterVolume(Configuration conf){
55
55
public void setConf (Configuration conf ){
56
56
log .info ("initializing gluster volume.." );
57
57
super .setConf (conf );
58
+ String getfattrcmd = null ;
58
59
if (conf !=null ){
59
60
60
61
try {
61
62
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
+
62
70
//volName=conf.get("fs.glusterfs.volname", null);
63
71
//remoteGFSServer=conf.get("fs.glusterfs.server", null);
64
72
You can’t perform that action at this time.
0 commit comments