Skip to content

Commit

Permalink
Merge pull request Alluxio#12 from TachyonNexus/cleanup-integration
Browse files Browse the repository at this point in the history
[RENAME] removing Tachyon occurrences from the integration modules
  • Loading branch information
apc999 committed Feb 5, 2016
2 parents f02fbd0 + e6d39b9 commit a94e3f2
Show file tree
Hide file tree
Showing 15 changed files with 142 additions and 144 deletions.
4 changes: 2 additions & 2 deletions integration/bin/alluxio-master-yarn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ ALLUXIO_MASTER_JAVA_OPTS="${ALLUXIO_MASTER_JAVA_OPTS:-${ALLUXIO_JAVA_OPTS}}"
# Yarn will set LOG_DIRS to point to the Yarn application log directory
YARN_LOG_DIR="$LOG_DIRS"

echo "Formatting Tachyon Master"
echo "Formatting Alluxio Master"

"${JAVA}" -cp "${CLASSPATH}" \
${ALLUXIO_MASTER_JAVA_OPTS} \
Expand All @@ -16,7 +16,7 @@ echo "Formatting Tachyon Master"
-Dalluxio.logs.dir="${YARN_LOG_DIR}" \
alluxio.Format master > "${YARN_LOG_DIR}"/master.out 2>&1

echo "Starting Tachyon Master"
echo "Starting Alluxio Master"

"${JAVA}" -cp "${CLASSPATH}" \
${ALLUXIO_MASTER_JAVA_OPTS} \
Expand Down
2 changes: 1 addition & 1 deletion integration/bin/alluxio-worker-yarn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ echo "Starting Alluxio Worker"
-Dalluxio.logger.type="WORKER_LOGGER" \
-Dalluxio.logs.dir="${YARN_LOG_DIR}" \
-Dalluxio.master.hostname="${ALLUXIO_MASTER_ADDRESS}" \
alluxio.worker.TachyonWorker >> "${YARN_LOG_DIR}"/worker.out 2>&1
alluxio.worker.AlluxioWorker >> "${YARN_LOG_DIR}"/worker.out 2>&1
18 changes: 9 additions & 9 deletions integration/fuse/src/main/java/alluxio/fuse/AlluxioFuse.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import alluxio.Configuration;

/**
* Main entry point to Tachyon-FUSE.
* Main entry point to Alluxio-FUSE.
*/
@ThreadSafe
public final class AlluxioFuse {
Expand Down Expand Up @@ -79,7 +79,7 @@ public static void main(String[] args) {
/**
* Parses CLI options
* @param args CLI args
* @return Tachyon-FUSE configuration options
* @return Alluxio-FUSE configuration options
*/
private static AlluxioFuseOptions parseOptions(String[] args) {
final Options opts = new Options();
Expand All @@ -90,7 +90,7 @@ private static AlluxioFuseOptions parseOptions(String[] args) {
.desc("Desired local mount point for alluxio-fuse.")
.build();

final Option tachyonRoot = Option.builder("r")
final Option alluxioRoot = Option.builder("r")
.hasArg()
.required(false)
.longOpt("alluxio-root")
Expand All @@ -111,7 +111,7 @@ private static AlluxioFuseOptions parseOptions(String[] args) {
.build();

opts.addOption(mntPoint);
opts.addOption(tachyonRoot);
opts.addOption(alluxioRoot);
opts.addOption(help);
opts.addOption(fuseOption);

Expand All @@ -126,7 +126,7 @@ private static AlluxioFuseOptions parseOptions(String[] args) {
}

String mntPointValue = cli.getOptionValue("m");
String tachyonRootValue = cli.getOptionValue("r");
String alluxioRootValue = cli.getOptionValue("r");

List<String> fuseOpts = Lists.newArrayList();
boolean noUserMaxWrite = true;
Expand All @@ -152,14 +152,14 @@ private static AlluxioFuseOptions parseOptions(String[] args) {
LOG.info("Mounting on default {}", mntPointValue);
}

if (tachyonRootValue == null) {
tachyonRootValue = sConfiguration.get(Constants.FUSE_FS_ROOT);
LOG.info("Using default alluxio root {}", tachyonRootValue);
if (alluxioRootValue == null) {
alluxioRootValue = sConfiguration.get(Constants.FUSE_FS_ROOT);
LOG.info("Using default alluxio root {}", alluxioRootValue);
}

final boolean fuseDebug = sConfiguration.getBoolean(Constants.FUSE_DEBUG_ENABLE);

return new AlluxioFuseOptions(mntPointValue, tachyonRootValue, fuseDebug, fuseOpts);
return new AlluxioFuseOptions(mntPointValue, alluxioRootValue, fuseDebug, fuseOpts);
} catch (ParseException e) {
System.err.println("Error while parsing CLI: " + e.getMessage());
final HelpFormatter fmt = new HelpFormatter();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,13 @@ final class AlluxioFuseFileSystem extends FuseStubFS {

private final Configuration mConfiguration;
private final FileSystem mFileSystem;
// base path within Tachyon namespace that is used for FUSE operations
// For example, if alluxio-fuse is mounted in /mnt/alluxio and mTachyonRootPath
// base path within Alluxio namespace that is used for FUSE operations
// For example, if alluxio-fuse is mounted in /mnt/alluxio and mAlluxioRootPath
// is /users/foo, then an operation on /mnt/alluxio/bar will be translated on
// an action on the URI alluxio://<master>:<port>/users/foo/bar
private final Path mTachyonRootPath;
private final String mTachyonMaster;
// Keeps a cache of the most recently translated paths from String to TachyonURI
private final Path mAlluxioRootPath;
private final String mAlluxioMaster;
// Keeps a cache of the most recently translated paths from String to Alluxio URI
private final LoadingCache<String, AlluxioURI> mPathResolverCache;

// Table of open files with corresponding InputStreams and OutputStreams
Expand All @@ -86,8 +86,8 @@ final class AlluxioFuseFileSystem extends FuseStubFS {
super();
mConfiguration = conf;
mFileSystem = fs;
mTachyonMaster = mConfiguration.get(Constants.MASTER_ADDRESS);
mTachyonRootPath = Paths.get(opts.getTachyonRoot());
mAlluxioMaster = mConfiguration.get(Constants.MASTER_ADDRESS);
mAlluxioRootPath = Paths.get(opts.getAlluxioRoot());
mNextOpenFileId = 0L;
mOpenFiles = Maps.newHashMap();

Expand All @@ -96,7 +96,7 @@ final class AlluxioFuseFileSystem extends FuseStubFS {
.maximumSize(maxCachedPaths)
.build(new PathCacheLoader());

Preconditions.checkArgument(mTachyonRootPath.isAbsolute(),
Preconditions.checkArgument(mAlluxioRootPath.isAbsolute(),
"alluxio root path should be absolute");
}

Expand All @@ -114,7 +114,7 @@ public int create(String path, @mode_t long mode, FuseFileInfo fi) {
// (see {@code man 2 open} for the structure of the flags bitfield)
// File creation flags are the last two bits of flags
final int flags = fi.flags.get();
LOG.trace("create({}, {}) [Tachyon: {}]", path, Integer.toHexString(flags), turi);
LOG.trace("create({}, {}) [Alluxio: {}]", path, Integer.toHexString(flags), turi);
final int openFlag = flags & 3;
if (openFlag != O_WRONLY.intValue()) {
OpenFlags flag = OpenFlags.valueOf(openFlag);
Expand All @@ -132,7 +132,7 @@ public int create(String path, @mode_t long mode, FuseFileInfo fi) {
}

final OpenFileEntry ofe = new OpenFileEntry(null, mFileSystem.createFile(turi));
LOG.debug("Tachyon OutStream created for {}", path);
LOG.debug("Alluxio OutStream created for {}", path);
mOpenFiles.put(mNextOpenFileId, ofe);
fi.fh.set(mNextOpenFileId);

Expand All @@ -148,7 +148,7 @@ public int create(String path, @mode_t long mode, FuseFileInfo fi) {
LOG.error("IOException on {}", path, e);
return -ErrorCodes.EIO();
} catch (AlluxioException e) {
LOG.error("TachyonException on {}", path, e);
LOG.error("AlluxioException on {}", path, e);
return -ErrorCodes.EFAULT();
} catch (Throwable e) {
LOG.error("Unexpected exception on {}", path, e);
Expand All @@ -159,7 +159,7 @@ public int create(String path, @mode_t long mode, FuseFileInfo fi) {
}

/**
* Flushes cached data on Tachyon.
* Flushes cached data on Alluxio.
*
* Called on explicit sync() operation or at close().
* @param path The path on the FS of the file to close
Expand Down Expand Up @@ -199,7 +199,7 @@ public int flush(String path, FuseFileInfo fi) {
@Override
public int getattr(String path, FileStat stat) {
final AlluxioURI turi = mPathResolverCache.getUnchecked(path);
LOG.trace("getattr({}) [Tachyon: {}]", path, turi);
LOG.trace("getattr({}) [Alluxio: {}]", path, turi);
try {
if (!mFileSystem.exists(turi)) {
return -ErrorCodes.ENOENT();
Expand Down Expand Up @@ -243,7 +243,7 @@ public int getattr(String path, FileStat stat) {
LOG.error("IOException on {}", path, e);
return -ErrorCodes.EIO();
} catch (AlluxioException e) {
LOG.error("TachyonException on {}", path, e);
LOG.error("AlluxioException on {}", path, e);
return -ErrorCodes.EFAULT();
} catch (Throwable e) {
LOG.error("Unexpected exception on {}", path, e);
Expand All @@ -270,7 +270,7 @@ public String getFSName() {
@Override
public int mkdir(String path, @mode_t long mode) {
final AlluxioURI turi = mPathResolverCache.getUnchecked(path);
LOG.trace("mkdir({}) [Tachyon: {}]", path, turi);
LOG.trace("mkdir({}) [Alluxio: {}]", path, turi);
try {
mFileSystem.createDirectory(turi);
} catch (FileAlreadyExistsException e) {
Expand Down Expand Up @@ -298,7 +298,7 @@ public int mkdir(String path, @mode_t long mode) {
*
* Note that the open mode <emph>must</emph> be
* O_RDONLY, otherwise the open will fail. This is due to
* the Tachyon "write-once/read-many-times" file model.
* the Alluxio "write-once/read-many-times" file model.
*
* @param path the FS path of the file to open
* @param fi FileInfo data structure kept by FUSE
Expand All @@ -310,7 +310,7 @@ public int open(String path, FuseFileInfo fi) {
// (see {@code man 2 open} for the structure of the flags bitfield)
// File creation flags are the last two bits of flags
final int flags = fi.flags.get();
LOG.trace("open({}, 0x{}) [Tachyon: {}]", path, Integer.toHexString(flags), turi);
LOG.trace("open({}, 0x{}) [Alluxio: {}]", path, Integer.toHexString(flags), turi);

if ((flags & 3) != O_RDONLY.intValue()) {
LOG.error("Files can only be opened in O_RDONLY mode ({})", path);
Expand Down Expand Up @@ -347,7 +347,7 @@ public int open(String path, FuseFileInfo fi) {
LOG.error("IOException on {}", path, e);
return -ErrorCodes.EIO();
} catch (AlluxioException e) {
LOG.error("TachyonException on {}", path, e);
LOG.error("AlluxioException on {}", path, e);
return -ErrorCodes.EFAULT();
} catch (Throwable e) {
LOG.error("Unexpected exception on {}", path, e);
Expand Down Expand Up @@ -435,7 +435,7 @@ public int read(String path, Pointer buf, @size_t long size, @off_t long offset,
public int readdir(String path, Pointer buff, FuseFillDir filter,
@off_t long offset, FuseFileInfo fi) {
final AlluxioURI turi = mPathResolverCache.getUnchecked(path);
LOG.trace("readdir({}) [Tachyon: {}]", path, turi);
LOG.trace("readdir({}) [Alluxio: {}]", path, turi);

try {
if (!mFileSystem.exists(turi)) {
Expand Down Expand Up @@ -464,7 +464,7 @@ public int readdir(String path, Pointer buff, FuseFillDir filter,
LOG.error("IOException on {}", path, e);
return -ErrorCodes.EIO();
} catch (AlluxioException e) {
LOG.error("TachyonException on {}", path, e);
LOG.error("AlluxioException on {}", path, e);
return -ErrorCodes.EFAULT();
} catch (Throwable e) {
LOG.error("Unexpected exception on {}", path, e);
Expand Down Expand Up @@ -515,7 +515,7 @@ public int release(String path, FuseFileInfo fi) {
public int rename(String oldPath, String newPath) {
final AlluxioURI oldUri = mPathResolverCache.getUnchecked(oldPath);
final AlluxioURI newUri = mPathResolverCache.getUnchecked(newPath);
LOG.trace("rename({}, {}) [Tachyon: {}, {}]", oldPath, newPath, oldUri, newUri);
LOG.trace("rename({}, {}) [Alluxio: {}, {}]", oldPath, newPath, oldUri, newUri);

try {
if (!mFileSystem.exists(oldUri)) {
Expand Down Expand Up @@ -564,7 +564,7 @@ public int unlink(String path) {
}

/**
* Writes a buffer to an open Tachyon file.
* Writes a buffer to an open Alluxio file.
* @param buf The buffer with source data
* @param size How much data to write from the buffer. The maximum accepted size
* for writes is {@link Integer#MAX_VALUE}. Note that current FUSE
Expand Down Expand Up @@ -638,7 +638,7 @@ private int rmInternal(String path, boolean mustBeFile) {
LOG.error("IOException on {}", path, e);
return -ErrorCodes.EIO();
} catch (AlluxioException e) {
LOG.error("TachyonException on {}", path, e);
LOG.error("AlluxioException on {}", path, e);
return -ErrorCodes.EFAULT();
} catch (Throwable e) {
LOG.error("Unexpected exception on {}", path, e);
Expand All @@ -649,24 +649,24 @@ private int rmInternal(String path, boolean mustBeFile) {
}

/**
* Exposed for testing
* Exposed for testing.
*/
LoadingCache<String, AlluxioURI> getPathResolverCache() {
return mPathResolverCache;
}

/**
* Resolves a FUSE path into a TachyonURI and possibly keeps it int cache
* Resolves a FUSE path into {@link AlluxioURI} and possibly keeps it in the cache.
*/
private class PathCacheLoader extends CacheLoader<String, AlluxioURI> {
@Override
public AlluxioURI load(String fusePath) {
// fusePath is guaranteed to always be an absolute path (i.e., starts
// with a fwd slash) - relative to the FUSE mount point
final String relPath = fusePath.substring(1);
final Path tpath = mTachyonRootPath.resolve(relPath);
final Path tpath = mAlluxioRootPath.resolve(relPath);

return new AlluxioURI(mTachyonMaster + tpath.toString());
return new AlluxioURI(mAlluxioMaster + tpath.toString());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@
import javax.annotation.concurrent.ThreadSafe;

/**
* Convenience class to pass around Tachyon-FUSE options.
* Convenience class to pass around Alluxio-FUSE options.
*/
@ThreadSafe
final class AlluxioFuseOptions {
private final String mMountPoint;
private final String mTachyonRoot;
private final String mAlluxioRoot;
private final boolean mDebug;
private final List<String> mFuseOpts;

AlluxioFuseOptions(String mountPoint, String tachyonRoot,
boolean debug, List<String> fuseOpts) {
AlluxioFuseOptions(String mountPoint, String alluxioRoot, boolean debug, List<String> fuseOpts) {
mMountPoint = mountPoint;
mTachyonRoot = tachyonRoot;
mAlluxioRoot = alluxioRoot;
mDebug = debug;
mFuseOpts = fuseOpts;
}
Expand All @@ -48,8 +47,8 @@ public String getMountPoint() {
* @return The path within alluxio that will be used as the mounted FS root
* (e.g. /users/andrea)
*/
public String getTachyonRoot() {
return mTachyonRoot;
public String getAlluxioRoot() {
return mAlluxioRoot;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import alluxio.Constants;

/**
* Utility methods for Tachyon-FUSE.
* Utility methods for Alluxio-FUSE.
*/
@ThreadSafe
public final class AlluxioFuseUtils {
Expand All @@ -36,7 +36,7 @@ public final class AlluxioFuseUtils {
private AlluxioFuseUtils() {}

/**
* Retrieves the uid and primary gid of the user running Tachyon-FUSE.
* Retrieves the uid and primary gid of the user running Alluxio-FUSE.
* @return a long[2] array {uid, gid}
*/
public static long[] getUidAndGid() {
Expand Down
13 changes: 6 additions & 7 deletions integration/fuse/src/main/java/alluxio/fuse/OpenFileEntry.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,14 @@
import alluxio.client.file.FileOutStream;

/**
* Convenience class to encapsulate input/output streams
* of open alluxio files.
* Convenience class to encapsulate input/output streams of open alluxio files.
*
* An open file can be either write-only or read-only, never both.
* This means that one of getIn or getOut will be null, while the other will be non-null.
* It is up to the user of this class (currently, only TachyonFuseFs) to check that.
* An open file can be either write-only or read-only, never both. This means that one of getIn or
* getOut will be null, while the other will be non-null. It is up to the user of this class
* (currently, only {@link AlluxioFuseFileSystem}) to check that.
*
* This mechanism is preferred over more complex subclassing to avoid useless casts
* or type checks for every read/write call, which happen quite often.
* This mechanism is preferred over more complex sub-classing to avoid useless casts or type checks
* for every read/write call, which happen quite often.
*/
@NotThreadSafe
final class OpenFileEntry implements Closeable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
import static org.junit.Assert.assertArrayEquals;

/**
* Isolation tests for TachyonFuseFs.
* Isolation tests for {@link AlluxioFuseFileSystem}.
*/
// TODO(andreareale): this test suite should be completed
public class AlluxioFuseFileSystemTest {
Expand Down
Loading

0 comments on commit a94e3f2

Please sign in to comment.