/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements. See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License. You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package tachyon;

import java.io.File;
import java.io.IOException;

import org.apache.hadoop.conf.Configuration;

import tachyon.conf.CommonConf;

public class GlusterfsCluster extends UnderFileSystemCluster {
  private String mMount = null;
  private String mVolume = null;
  private UnderFileSystem mUfs = null;
  
  public GlusterfsCluster(String baseDir) {
    super(baseDir);
    mMount = System.getProperty("tachyon.underfs.glusterfs.mounts");
    mVolume = System.getProperty("tachyon.underfs.glusterfs.volumes");
    Configuration Conf = new Configuration();
    Conf.set("fs.glusterfs.impl", CommonConf.get().UNDERFS_GLUSTERFS_IMPL);
    Conf.set("mapred.system.dir", "mapr/dir");
    Conf.set("fs.glusterfs.volumes", mVolume);
    Conf.set("fs.glusterfs.volume.fuse." + mVolume,mMount);
    mUfs = UnderFileSystem.get("glusterfs:///", Conf);
  }

  @Override
  public String getUnderFilesystemAddress() {
    if (mUfs != null) {
      return new File(mMount + Constants.PATH_SEPARATOR + mBaseDir).getAbsolutePath();
    }
    // for env that doesn't have a glusterfs mount point, we fall to local fs
    return new File(mBaseDir).getAbsolutePath();
  }

  @Override
  public boolean isStarted() {
    return true;
  }

  @Override
  public void shutdown() throws IOException {
  }

  @Override
  public void start() throws IOException {
  }
}
@@ -820,1132 +820,241 @@
 .io.
-File;%0Aimport java.io.IOException;%0A%0Aimport org.apache.hadoop.conf.Configuration;%0A%0Aimport tachyon.conf.CommonConf;%0A%0Apublic class GlusterfsCluster extends UnderFileSystemCluster %7B%0A  private String mMount = null;%0A  private String mVolume = null;%0A  private UnderFileSystem mUfs = null;%0A  %0A  public GlusterfsCluster(String baseDir) %7B%0A    super(baseDir);%0A    mMount = System.getProperty(%22tachyon.underfs.glusterfs.mounts%22);%0A    mVolume = System.getProperty(%22tachyon.underfs.glusterfs.volumes%22);%0A    Configuration Conf = new Configuration();%0A    Conf.set(%22fs.glusterfs.impl%22, CommonConf.get().UNDERFS_GLUSTERFS_IMPL);%0A    Conf.set(%22mapred.system.dir%22, %22mapr/dir%22);%0A    Conf.set(%22fs.glusterfs.volumes%22, mVolume);%0A    Conf.set(%22fs.glusterfs.volume.fuse.%22 + mVolume,mMount);%0A    mUfs = UnderFileSystem.get(%22glusterfs:///%22, Conf);%0A  %7D%0A%0A  @Override%0A  public String getUnderFilesystemAddress() %7B%0A    if (mUfs != null) %7B%0A      return new File(mMount + Constants.PATH_SEPARATOR + mBaseDir).getAbsolutePath();%0A    %7D%0A    // for env that doesn't have a glusterfs mount point, we fall to local fs%0A    return new File(mBaseDir).getAbsolutePath()
+IOException;%0A%0Apublic class GlusterfsCluster extends UnderFileSystemCluster %7B%0A  %0A  public GlusterfsCluster(String baseDir) %7B%0A    super(baseDir);%0A  %7D%0A%0A  @Override%0A  public String getUnderFilesystemAddress() %7B%0A    return %22glusterfs:///%22
 ;%0A  

use glusterfs scheme for under fs address