Skip to content

Commit

Permalink
Removing Tachyon occurrences from the common module.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsimsa committed Feb 5, 2016
1 parent 86dc732 commit 44fa979
Show file tree
Hide file tree
Showing 93 changed files with 352 additions and 358 deletions.
Expand Up @@ -238,7 +238,7 @@ public static void main(String[] args) {
* Prints an example usage of the command line.
*/
public static void printUsage() {
String cmd = "java -cp " + Version.TACHYON_JAR + " alluxio.client.UfsUtils ";
String cmd = "java -cp " + Version.ALLUXIO_JAR + " alluxio.client.UfsUtils ";

System.out.println("Usage: " + cmd + "<TachyonPath> <UfsPath> "
+ "[<Optional ExcludePathPrefix, separated by ;>]");
Expand Down
Expand Up @@ -107,7 +107,7 @@ public List<WorkerInfo> call() throws TException {
*/
public synchronized BlockInfo getBlockInfo(final long blockId)
throws AlluxioException, IOException {
return retryRPC(new RpcCallableThrowsTachyonTException<BlockInfo>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<BlockInfo>() {
@Override
public BlockInfo call() throws AlluxioTException, TException {
return ThriftUtils.fromThrift(mClient.getBlockInfo(blockId));
Expand Down
Expand Up @@ -125,7 +125,7 @@ public Void call() throws TException {
*/
public synchronized boolean asyncCheckpoint(final long fileId) throws IOException,
AlluxioException {
return retryRPC(new RpcCallableThrowsTachyonTException<Boolean>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<Boolean>() {
@Override
public Boolean call() throws AlluxioTException, TException {
return mClient.asyncCheckpoint(fileId);
Expand All @@ -141,7 +141,7 @@ public Boolean call() throws AlluxioTException, TException {
* @throws AlluxioException if a Tachyon error occurs
*/
public synchronized void cacheBlock(final long blockId) throws IOException, AlluxioException {
retryRPC(new RpcCallableThrowsTachyonTException<Void>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Void>() {
@Override
public Void call() throws AlluxioTException, TException {
mClient.cacheBlock(mSessionId, blockId);
Expand All @@ -158,7 +158,7 @@ public Void call() throws AlluxioTException, TException {
* @throws AlluxioException if a Tachyon error occurs
*/
public synchronized void cancelBlock(final long blockId) throws IOException, AlluxioException {
retryRPC(new RpcCallableThrowsTachyonTException<Void>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Void>() {
@Override
public Void call() throws AlluxioTException, TException {
mClient.cancelBlock(mSessionId, blockId);
Expand Down Expand Up @@ -281,7 +281,7 @@ public synchronized boolean isLocal() {
public synchronized LockBlockResult lockBlock(final long blockId) throws IOException {
// TODO(jiri) Would be nice to have a helper method to execute this try-catch logic
try {
return retryRPC(new RpcCallableThrowsTachyonTException<LockBlockResult>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<LockBlockResult>() {
@Override
public LockBlockResult call() throws AlluxioTException, TException {
return ThriftUtils.fromThrift(mClient.lockBlock(blockId, mSessionId));
Expand Down Expand Up @@ -324,7 +324,7 @@ public synchronized void connect() throws IOException {
*/
public synchronized boolean promoteBlock(final long blockId) throws IOException,
AlluxioException {
return retryRPC(new RpcCallableThrowsTachyonTException<Boolean>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<Boolean>() {
@Override
public Boolean call() throws AlluxioTException, TException {
return mClient.promoteBlock(blockId);
Expand All @@ -343,7 +343,7 @@ public Boolean call() throws AlluxioTException, TException {
public synchronized String requestBlockLocation(final long blockId, final long initialBytes)
throws IOException {
try {
return retryRPC(new RpcCallableThrowsTachyonTException<String>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<String>() {
@Override
public String call() throws AlluxioTException, TException {
return mClient.requestBlockLocation(mSessionId, blockId, initialBytes);
Expand All @@ -369,7 +369,7 @@ public String call() throws AlluxioTException, TException {
public synchronized boolean requestSpace(final long blockId, final long requestBytes)
throws IOException {
try {
return retryRPC(new RpcCallableThrowsTachyonTException<Boolean>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<Boolean>() {
@Override
public Boolean call() throws AlluxioTException, TException {
return mClient.requestSpace(mSessionId, blockId, requestBytes);
Expand Down
Expand Up @@ -93,7 +93,7 @@ protected void afterConnect() throws IOException {
*/
public synchronized void createDirectory(final AlluxioURI path,
final CreateDirectoryOptions options) throws IOException, AlluxioException {
retryRPC(new RpcCallableThrowsTachyonTException<Void>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Void>() {
@Override
public Void call() throws AlluxioTException, TException {
mClient.createDirectory(path.getPath(), options.toThrift());
Expand All @@ -112,7 +112,7 @@ public Void call() throws AlluxioTException, TException {
*/
public synchronized void createFile(final AlluxioURI path, final CreateFileOptions options)
throws IOException, AlluxioException {
retryRPC(new RpcCallableThrowsTachyonTException<Void>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Void>() {
@Override
public Void call() throws AlluxioTException, TException {
mClient.createFile(path.getPath(), options.toThrift());
Expand All @@ -131,7 +131,7 @@ public Void call() throws AlluxioTException, TException {
*/
public synchronized void completeFile(final AlluxioURI path, final CompleteFileOptions options)
throws IOException, AlluxioException {
retryRPC(new RpcCallableThrowsTachyonTException<Void>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Void>() {
@Override
public Void call() throws AlluxioTException, TException {
mClient.completeFile(path.getPath(), options.toThrift());
Expand All @@ -150,7 +150,7 @@ public Void call() throws AlluxioTException, TException {
*/
public synchronized void delete(final AlluxioURI path, final DeleteOptions options)
throws IOException, AlluxioException {
retryRPC(new RpcCallableThrowsTachyonTException<Void>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Void>() {
@Override
public Void call() throws AlluxioTException, TException {
mClient.remove(path.getPath(), options.isRecursive());
Expand All @@ -169,7 +169,7 @@ public Void call() throws AlluxioTException, TException {
*/
public synchronized void free(final AlluxioURI path, final FreeOptions options)
throws IOException, AlluxioException {
retryRPC(new RpcCallableThrowsTachyonTException<Void>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Void>() {
@Override
public Void call() throws AlluxioTException, TException {
mClient.free(path.getPath(), options.isRecursive());
Expand All @@ -186,7 +186,7 @@ public Void call() throws AlluxioTException, TException {
*/
public synchronized List<FileBlockInfo> getFileBlockInfoList(final AlluxioURI path)
throws IOException, AlluxioException {
return retryRPC(new RpcCallableThrowsTachyonTException<List<FileBlockInfo>>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<List<FileBlockInfo>>() {
@Override
public List<FileBlockInfo> call() throws AlluxioTException, TException {
List<FileBlockInfo> result = new ArrayList<FileBlockInfo>();
Expand All @@ -207,7 +207,7 @@ public List<FileBlockInfo> call() throws AlluxioTException, TException {
*/
public synchronized URIStatus getStatus(final AlluxioURI path) throws IOException,
AlluxioException {
return retryRPC(new RpcCallableThrowsTachyonTException<URIStatus>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<URIStatus>() {
@Override
public URIStatus call() throws AlluxioTException, TException {
return new URIStatus(ThriftUtils.fromThrift(mClient.getStatus(path.getPath())));
Expand All @@ -226,7 +226,7 @@ public URIStatus call() throws AlluxioTException, TException {
// TODO(calvin): Split this into its own client
public synchronized URIStatus getStatusInternal(final long fileId) throws IOException,
AlluxioException {
return retryRPC(new RpcCallableThrowsTachyonTException<URIStatus>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<URIStatus>() {
@Override
public URIStatus call() throws AlluxioTException, TException {
return new URIStatus(ThriftUtils.fromThrift(mClient.getStatusInternal(fileId)));
Expand All @@ -242,7 +242,7 @@ public URIStatus call() throws AlluxioTException, TException {
*/
public synchronized long getNewBlockIdForFile(final AlluxioURI path)
throws IOException, AlluxioException {
return retryRPC(new RpcCallableThrowsTachyonTException<Long>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<Long>() {
@Override
public Long call() throws AlluxioTException, TException {
return mClient.getNewBlockIdForFile(path.getPath());
Expand Down Expand Up @@ -272,7 +272,7 @@ public String call() throws TException {
*/
public synchronized List<URIStatus> listStatus(final AlluxioURI path)
throws IOException, AlluxioException {
return retryRPC(new RpcCallableThrowsTachyonTException<List<URIStatus>>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<List<URIStatus>>() {
@Override
public List<URIStatus> call() throws AlluxioTException, TException {
List<URIStatus> result = new ArrayList<URIStatus>();
Expand All @@ -294,7 +294,7 @@ public List<URIStatus> call() throws AlluxioTException, TException {
*/
public synchronized void loadMetadata(final AlluxioURI path,
final LoadMetadataOptions options) throws IOException, AlluxioException {
retryRPC(new RpcCallableThrowsTachyonTException<Long>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Long>() {
@Override
public Long call() throws AlluxioTException, TException {
return mClient.loadMetadata(path.toString(), options.isRecursive());
Expand All @@ -312,7 +312,7 @@ public Long call() throws AlluxioTException, TException {
*/
public synchronized void mount(final AlluxioURI tachyonPath, final AlluxioURI ufsPath)
throws AlluxioException, IOException {
retryRPC(new RpcCallableThrowsTachyonTException<Void>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Void>() {
@Override
public Void call() throws AlluxioTException, TException {
mClient.mount(tachyonPath.toString(), ufsPath.toString());
Expand All @@ -331,7 +331,7 @@ public Void call() throws AlluxioTException, TException {
*/
public synchronized void rename(final AlluxioURI src, final AlluxioURI dst)
throws IOException, AlluxioException {
retryRPC(new RpcCallableThrowsTachyonTException<Void>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Void>() {
@Override
public Void call() throws AlluxioTException, TException {
mClient.rename(src.getPath(), dst.getPath());
Expand All @@ -350,7 +350,7 @@ public Void call() throws AlluxioTException, TException {
*/
public synchronized void setAttribute(final AlluxioURI path, final SetAttributeOptions options)
throws IOException, AlluxioException {
retryRPC(new RpcCallableThrowsTachyonTException<Void>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Void>() {
@Override
public Void call() throws AlluxioTException, TException {
mClient.setAttribute(path.getPath(), options.toThrift());
Expand All @@ -368,7 +368,7 @@ public Void call() throws AlluxioTException, TException {
*/
public synchronized void scheduleAsyncPersist(final AlluxioURI path)
throws AlluxioException, IOException {
retryRPC(new RpcCallableThrowsTachyonTException<Void>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Void>() {
@Override
public Void call() throws AlluxioTException, TException {
mClient.scheduleAsyncPersist(path.getPath());
Expand All @@ -386,7 +386,7 @@ public Void call() throws AlluxioTException, TException {
*/
public synchronized void unmount(final AlluxioURI tachyonPath)
throws AlluxioException, IOException {
retryRPC(new RpcCallableThrowsTachyonTException<Void>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Void>() {
@Override
public Void call() throws AlluxioTException, TException {
mClient.unmount(tachyonPath.toString());
Expand Down
Expand Up @@ -90,7 +90,7 @@ protected void afterConnect() throws IOException {
public synchronized long createLineage(final List<String> inputFiles,
final List<String> outputFiles, final CommandLineJob job) throws IOException,
AlluxioException {
return retryRPC(new RpcCallableThrowsTachyonTException<Long>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<Long>() {
@Override
public Long call() throws AlluxioTException, TException {
return mClient.createLineage(inputFiles, outputFiles,
Expand All @@ -110,7 +110,7 @@ public Long call() throws AlluxioTException, TException {
*/
public synchronized boolean deleteLineage(final long lineageId, final boolean cascade)
throws IOException, AlluxioException {
return retryRPC(new RpcCallableThrowsTachyonTException<Boolean>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<Boolean>() {
@Override
public Boolean call() throws AlluxioTException, TException {
return mClient.deleteLineage(lineageId, cascade);
Expand All @@ -131,7 +131,7 @@ public Boolean call() throws AlluxioTException, TException {
*/
public synchronized long reinitializeFile(final String path, final long blockSizeBytes,
final long ttl) throws IOException, LineageDoesNotExistException, AlluxioException {
return retryRPC(new RpcCallableThrowsTachyonTException<Long>() {
return retryRPC(new RpcCallableThrowsAlluxioTException<Long>() {
@Override
public Long call() throws AlluxioTException, TException {
return mClient.reinitializeFile(path, blockSizeBytes, ttl);
Expand Down Expand Up @@ -168,7 +168,7 @@ public List<LineageInfo> call() throws TException {
* @throws AlluxioException if a Tachyon exception occurs
*/
public synchronized void reportLostFile(final String path) throws IOException, AlluxioException {
retryRPC(new RpcCallableThrowsTachyonTException<Void>() {
retryRPC(new RpcCallableThrowsAlluxioTException<Void>() {
@Override
public Void call() throws AlluxioTException, TException {
mClient.reportLostFile(path);
Expand Down
Expand Up @@ -51,7 +51,7 @@ public static void storeToHadoopConfiguration(Configuration source,
+ "org.apache.hadoop.io.serializer.WritableSerialization");
Properties confProperties = source.getInternalProperties();
try {
DefaultStringifier.store(target, confProperties, Constants.TACHYON_CONF_SITE);
DefaultStringifier.store(target, confProperties, Constants.CONF_SITE);
} catch (IOException ex) {
LOG.error("Unable to store TachyonConf in Hadoop configuration", ex);
throw new RuntimeException(ex);
Expand All @@ -69,10 +69,10 @@ public static Configuration loadFromHadoopConfiguration(
// Load TachyonConf if any and merge to the one in TachyonFS
// Push TachyonConf to the Job conf
Properties tachyonConfProperties = null;
if (source.get(Constants.TACHYON_CONF_SITE) != null) {
if (source.get(Constants.CONF_SITE) != null) {
LOG.info("Found TachyonConf site from Job configuration for Tachyon");
try {
tachyonConfProperties = DefaultStringifier.load(source, Constants.TACHYON_CONF_SITE,
tachyonConfProperties = DefaultStringifier.load(source, Constants.CONF_SITE,
Properties.class);
} catch (IOException e) {
LOG.error("Unable to load TachyonConf from Hadoop configuration", e);
Expand Down

0 comments on commit 44fa979

Please sign in to comment.