Alluxio源码分析是一个基于内存的分布式文件系统,和HDFS、HBase等一样,也是由主从节点构成的。而节点之间的通信,一般都是采用的RPC通讯模型。Alluxio中RPC是基于何种技术如何实现的呢?它对于RPC请求是如何处理的?都涉及到哪些组件?本文将针对这些问题,为您一一解答。
一、Alluxio中RPC实现技术支持
Alluxio中的RPC是依靠Thrift实现的,Apache Thrift 是 Facebook 实现的一种高效的、支持多种编程语言的远程服务调用的框架。它采用接口描述语言定义并创建服务,支持可扩展的跨语言服务开发,所包含的代码生成引擎可以在多种语言中,如 C++, Java, Python, PHP, Ruby, Erlang, Perl, Haskell, C#, Cocoa, Smalltalk 等创建高效的、无缝的服务,其传输数据采用二进制格式,相对 XML 和 JSON 体积更小,对于高并发、大数据量和多语言的环境更有优势。
具体关于Thrift的介绍,请参照《Thrift简介》一文。
二、Alluxio中RPC实现细节
在《Thrift开发示例》一文中,我们已经详细讲解了如何利用Java语言开发一个Thrift程序。下面,对比着《Thrift开发示例》一文中的示例,我们看下Alluxio中的RPC服务是如何实现的。
1、服务接口脚本文件file_system_master.thrift
在file_system_master.thrift文件中,定义了Alluxio中文件系统相关的Master服务接口,具体如下:
(1)定义了命名空间为java alluxio.thrift
java alluxio.thrift
(2)定义了一些服务中需要用到的结构体,如文件信息FileInfo、完成文件选项CompleteFileTOptions、创建文件选项CreateFileTOptions等,具体如下:
/**
* 完成文件选项
*/
struct CompleteFileTOptions {
1: optional i64 ufsLength
}
/**
* 创建目录选项
*/
struct CreateDirectoryTOptions {
1: optional bool persisted
2: optional bool recursive
3: optional bool allowExists
}
/**
* 创建文件选项
*/
struct CreateFileTOptions {
1: optional i64 blockSizeBytes
2: optional bool persisted
3: optional bool recursive
4: optional i64 ttl
}
/**
* 挂载选项
*/
struct MountTOptions {
1: optional bool readOnly
}
/**
* 文件信息
*/
struct FileInfo {
1: i64 fileId
2: string name
3: string path
4: string ufsPath
5: i64 length
6: i64 blockSizeBytes
7: i64 creationTimeMs
8: bool completed
9: bool folder
10: bool pinned
11: bool cacheable
12: bool persisted
13: list blockIds
15: i32 inMemoryPercentage
16: i64 lastModificationTimeMs
17: i64 ttl
18: string userName
19: string groupName
20: i32 permission
21: string persistenceState
22: bool mountPoint
}
/**
* 文件系统命令
*/
struct FileSystemCommand {
1: common.CommandType commandType
2: FileSystemCommandOptions commandOptions
}
/**
* 持久化命令选项
*/
struct PersistCommandOptions {
1: list persistFiles
}
/**
* 持久化文件
*/
struct PersistFile {
1: i64 fileId
2: list blockIds
}
/**
* 设置属性选项
*/
struct SetAttributeTOptions {
1: optional bool pinned
2: optional i64 ttl
3: optional bool persisted
4: optional string owner
5: optional string group
6: optional i16 permission
7: optional bool recursive
}
/**
* 文件系统命令行选项
*/
union FileSystemCommandOptions {
1: optional PersistCommandOptions persistOptions
}
(3)定义了文件系统的两个服务,一个是Client至Master的FileSystemMasterClientService,另外一个是Worker至Master的FileSystemMasterWorkerService,其中FileSystemMasterClientService定义了读写文件等需要的createFile()、createDirectory()、completeFile()、getStatus()、getUfsAddress()、loadMetadata()、mount()等客户端Client至主节点Master通信的重要方法,而FileSystemMasterWorkerService定义了心跳等需要的getFileInfo()、heartbeat()等从节点Worker至主节点Master通信的重要方法,具体如下:
/**
* This interface contains file system master service endpoints for Alluxio clients.
*/
service FileSystemMasterClientService extends common.AlluxioService {
/**
* Marks a file as completed.
* 标记一个文件完成
*/
void completeFile( /** the path of the file */ 1: string path,
/** the method options */ 2: CompleteFileTOptions options)
throws (1: exception.AlluxioTException e)
/**
* Creates a directory.
* 创建一个目录
*/
void createDirectory( /** the path of the directory */ 1: string path,
/** the method options */ 2: CreateDirectoryTOptions options)
throws (1: exception.AlluxioTException e, 2: exception.ThriftIOException ioe)
/**
* Creates a file.
* 创建一个文件
*/
void createFile( /** the path of the file */ 1: string path,
/** the options for creating the file */ 2: CreateFileTOptions options)
throws (1: exception.AlluxioTException e, 2: exception.ThriftIOException ioe)
/**
* Frees the given file or directory from Alluxio.
* 从Alluxio中释放指定文件或目录
*/
void free( /** the path of the file or directory */ 1: string path,
/** whether to free recursively */ 2: bool recursive)
throws (1: exception.AlluxioTException e)
/**
* Returns the list of file blocks information for the given file.
* 获取指定文件对应的文件块信息列表
*/
list getFileBlockInfoList( /** the path of the file */ 1: string path)
throws (1: exception.AlluxioTException e)
/**
* Returns the status of the file or directory.
* 返回指定文件或目录的状态信息
*/
FileInfo getStatus( /** the path of the file or directory */ 1: string path)
throws (1: exception.AlluxioTException e)
/**
* Returns the status of the file or directory, only used internally by servers.
* 返回指定文件或目录的状态信息,仅服务端内部使用
*/
FileInfo getStatusInternal( /** the id of the file or directory */ 1: i64 fileId)
throws (1: exception.AlluxioTException e)
/**
* Generates a new block id for the given file.
* 为给定文件生成一个新的数据块ID
*/
i64 getNewBlockIdForFile( /** the path of the file */ 1: string path)
throws (1: exception.AlluxioTException e)
/**
* Returns the UFS address of the root mount point.
* 获取根挂载点对应底层文件系统地址
*
* THIS METHOD IS DEPRECATED SINCE VERSION 1.1 AND WILL BE REMOVED IN VERSION 2.0.
*/
string getUfsAddress()
/**
* If the path points to a file, the method returns a singleton with its file information.
* If the path points to a directory, the method returns a list with file information for the
* directory contents.
*/
list listStatus( /** the path of the file or directory */ 1: string path)
throws (1: exception.AlluxioTException e)
/**
* Loads metadata for the object identified by the given Alluxio path from UFS into Alluxio.
*/
// TODO(jiri): Get rid of this.
i64 loadMetadata( /** the path of the under file system */ 1: string ufsPath,
/** whether to load meta data recursively */ 2: bool recursive)
throws (1: exception.AlluxioTException e, 2: exception.ThriftIOException ioe)
/**
* Creates a new "mount point", mounts the given UFS path in the Alluxio namespace at the given
* path. The path should not exist and should not be nested under any existing mount point.
*/
void mount( /** the path of alluxio mount point */ 1: string alluxioPath,
/** the path of the under file system */ 2: string ufsPath,
/** the options for creating the mount point */ 3: MountTOptions options)
throws (1: exception.AlluxioTException e, 2: exception.ThriftIOException ioe)
/**
* Deletes a file or a directory and returns whether the remove operation succeeded.
* NOTE: Unfortunately, the method cannot be called "delete" as that is a reserved Thrift keyword.
*/
void remove( /** the path of the file or directory */ 1: string path,
/** whether to remove recursively */ 2: bool recursive)
throws (1: exception.AlluxioTException e)
/**
* Renames a file or a directory.
*/
void rename( /** the path of the file or directory */ 1: string path,
/** the desinationpath of the file */ 2: string dstPath)
throws (1: exception.AlluxioTException e, 2: exception.ThriftIOException ioe)
/**
* Sets file or directory attributes.
*/
void setAttribute( /** the path of the file or directory */ 1: string path,
/** the method options */ 2: SetAttributeTOptions options)
throws (1: exception.AlluxioTException e)
/**
* Schedules async persistence.
*/
void scheduleAsyncPersist( /** the path of the file */ 1: string path)
throws (1: exception.AlluxioTException e)
/**
* Deletes an existing "mount point", voiding the Alluxio namespace at the given path. The path
* should correspond to an existing mount point. Any files in its subtree that are backed by UFS
* will be persisted before they are removed from the Alluxio namespace.
*/
void unmount( /** the path of the alluxio mount point */ 1: string alluxioPath)
throws (1: exception.AlluxioTException e, 2: exception.ThriftIOException ioe)
}
/**
* This interface contains file system master service endpoints for Alluxio workers.
*/
service FileSystemMasterWorkerService extends common.AlluxioService {
/*
* Returns the file information.
*/
FileInfo getFileInfo( /** the id of the file */ 1: i64 fileId)
throws (1: exception.AlluxioTException e)
/**
* Returns the set of pinned files.
*/
set getPinIdList()
/**
* Periodic file system worker heartbeat. Returns the command for persisting
* the blocks of a file.
*/
FileSystemCommand heartbeat( /** the id of the worker */ 1: i64 workerId,
/** the list of persisted files */ 2: list persistedFiles)
throws (1: exception.AlluxioTException e)
}
2、根据服务接口脚本文件file_system_master.thrift中service生成的Java类,包括FileSystemMasterClientService.java、FileSystemMasterWorkerService.java,其中分别包含Thrift特有的Iface、Processor等接口或类,完整代码如下:
package alluxio.thrift;
import org.apache.thrift.scheme.IScheme;
import org.apache.thrift.scheme.SchemeFactory;
import org.apache.thrift.scheme.StandardScheme;
import org.apache.thrift.scheme.TupleScheme;
import org.apache.thrift.protocol.TTupleProtocol;
import org.apache.thrift.protocol.TProtocolException;
import org.apache.thrift.EncodingUtils;
import org.apache.thrift.TException;
import org.apache.thrift.async.AsyncMethodCallback;
import org.apache.thrift.server.AbstractNonblockingServer.*;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.HashMap;
import java.util.EnumMap;
import java.util.Set;
import java.util.HashSet;
import java.util.EnumSet;
import java.util.Collections;
import java.util.BitSet;
import java.nio.ByteBuffer;
import java.util.Arrays;
import javax.annotation.Generated;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@SuppressWarnings({"cast", "rawtypes", "serial", "unchecked"})
@Generated(value = "Autogenerated by Thrift Compiler (0.9.3)", date = "2016-03-08")
public class FileSystemMasterClientService {
/**
* This interface contains file system master service endpoints for Alluxio clients.
*/
public interface Iface extends alluxio.thrift.AlluxioService.Iface {
/**
* Marks a file as completed.
*
* @param path the path of the file
*
* @param options the method options
*/
public void completeFile(String path, CompleteFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Creates a directory.
*
* @param path the path of the directory
*
* @param options the method options
*/
public void createDirectory(String path, CreateDirectoryTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException;
/**
* Creates a file.
*
* @param path the path of the file
*
* @param options the options for creating the file
*/
public void createFile(String path, CreateFileTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException;
/**
* Frees the given file or directory from Alluxio.
*
* @param path the path of the file or directory
*
* @param recursive whether to free recursively
*/
public void free(String path, boolean recursive) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Returns the list of file blocks information for the given file.
*
* @param path the path of the file
*/
public List getFileBlockInfoList(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Returns the status of the file or directory.
*
* @param path the path of the file or directory
*/
public FileInfo getStatus(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Returns the status of the file or directory, only used internally by servers.
*
* @param fileId the id of the file or directory
*/
public FileInfo getStatusInternal(long fileId) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Generates a new block id for the given file.
*
* @param path the path of the file
*/
public long getNewBlockIdForFile(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Returns the UFS address of the root mount point.
*
* THIS METHOD IS DEPRECATED SINCE VERSION 1.1 AND WILL BE REMOVED IN VERSION 2.0.
*/
public String getUfsAddress() throws org.apache.thrift.TException;
/**
* If the path points to a file, the method returns a singleton with its file information.
* If the path points to a directory, the method returns a list with file information for the
* directory contents.
*
* @param path the path of the file or directory
*/
public List listStatus(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Loads metadata for the object identified by the given Alluxio path from UFS into Alluxio.
*
* @param ufsPath the path of the under file system
*
* @param recursive whether to load meta data recursively
*/
public long loadMetadata(String ufsPath, boolean recursive) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException;
/**
* Creates a new "mount point", mounts the given UFS path in the Alluxio namespace at the given
* path. The path should not exist and should not be nested under any existing mount point.
* mountPath() should be used instead, since it takes options.
*
* @param alluxioPath the path of alluxio mount point
*
* @param ufsPath the path of the under file system
*
* @param options the options for creating the mount point
*/
public void mount(String alluxioPath, String ufsPath, MountTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException;
/**
* Deletes a file or a directory and returns whether the remove operation succeeded.
* NOTE: Unfortunately, the method cannot be called "delete" as that is a reserved Thrift keyword.
*
* @param path the path of the file or directory
*
* @param recursive whether to remove recursively
*/
public void remove(String path, boolean recursive) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Renames a file or a directory.
*
* @param path the path of the file or directory
*
* @param dstPath the desinationpath of the file
*/
public void rename(String path, String dstPath) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException;
/**
* Sets file or directory attributes.
*
* @param path the path of the file or directory
*
* @param options the method options
*/
public void setAttribute(String path, SetAttributeTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Schedules async persistence.
*
* @param path the path of the file
*/
public void scheduleAsyncPersist(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException;
/**
* Deletes an existing "mount point", voiding the Alluxio namespace at the given path. The path
* should correspond to an existing mount point. Any files in its subtree that are backed by UFS
* will be persisted before they are removed from the Alluxio namespace.
*
* @param alluxioPath the path of the alluxio mount point
*/
public void unmount(String alluxioPath) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException;
}
public interface AsyncIface extends alluxio.thrift.AlluxioService .AsyncIface {
public void completeFile(String path, CompleteFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void createDirectory(String path, CreateDirectoryTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void createFile(String path, CreateFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void free(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void getFileBlockInfoList(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void getStatus(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void getStatusInternal(long fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void getNewBlockIdForFile(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void getUfsAddress(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void listStatus(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void loadMetadata(String ufsPath, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void mount(String alluxioPath, String ufsPath, MountTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void remove(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void rename(String path, String dstPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void setAttribute(String path, SetAttributeTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void scheduleAsyncPersist(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
public void unmount(String alluxioPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException;
}
public static class Client extends alluxio.thrift.AlluxioService.Client implements Iface {
public static class Factory implements org.apache.thrift.TServiceClientFactory {
public Factory() {}
public Client getClient(org.apache.thrift.protocol.TProtocol prot) {
return new Client(prot);
}
public Client getClient(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
return new Client(iprot, oprot);
}
}
public Client(org.apache.thrift.protocol.TProtocol prot)
{
super(prot, prot);
}
public Client(org.apache.thrift.protocol.TProtocol iprot, org.apache.thrift.protocol.TProtocol oprot) {
super(iprot, oprot);
}
public void completeFile(String path, CompleteFileTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_completeFile(path, options);
recv_completeFile();
}
public void send_completeFile(String path, CompleteFileTOptions options) throws org.apache.thrift.TException
{
completeFile_args args = new completeFile_args();
args.setPath(path);
args.setOptions(options);
sendBase("completeFile", args);
}
public void recv_completeFile() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
completeFile_result result = new completeFile_result();
receiveBase(result, "completeFile");
if (result.e != null) {
throw result.e;
}
return;
}
public void createDirectory(String path, CreateDirectoryTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException
{
send_createDirectory(path, options);
recv_createDirectory();
}
public void send_createDirectory(String path, CreateDirectoryTOptions options) throws org.apache.thrift.TException
{
createDirectory_args args = new createDirectory_args();
args.setPath(path);
args.setOptions(options);
sendBase("createDirectory", args);
}
public void recv_createDirectory() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException
{
createDirectory_result result = new createDirectory_result();
receiveBase(result, "createDirectory");
if (result.e != null) {
throw result.e;
}
if (result.ioe != null) {
throw result.ioe;
}
return;
}
public void createFile(String path, CreateFileTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException
{
send_createFile(path, options);
recv_createFile();
}
public void send_createFile(String path, CreateFileTOptions options) throws org.apache.thrift.TException
{
createFile_args args = new createFile_args();
args.setPath(path);
args.setOptions(options);
sendBase("createFile", args);
}
public void recv_createFile() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException
{
createFile_result result = new createFile_result();
receiveBase(result, "createFile");
if (result.e != null) {
throw result.e;
}
if (result.ioe != null) {
throw result.ioe;
}
return;
}
public void free(String path, boolean recursive) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_free(path, recursive);
recv_free();
}
public void send_free(String path, boolean recursive) throws org.apache.thrift.TException
{
free_args args = new free_args();
args.setPath(path);
args.setRecursive(recursive);
sendBase("free", args);
}
public void recv_free() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
free_result result = new free_result();
receiveBase(result, "free");
if (result.e != null) {
throw result.e;
}
return;
}
public List getFileBlockInfoList(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_getFileBlockInfoList(path);
return recv_getFileBlockInfoList();
}
public void send_getFileBlockInfoList(String path) throws org.apache.thrift.TException
{
getFileBlockInfoList_args args = new getFileBlockInfoList_args();
args.setPath(path);
sendBase("getFileBlockInfoList", args);
}
public List recv_getFileBlockInfoList() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
getFileBlockInfoList_result result = new getFileBlockInfoList_result();
receiveBase(result, "getFileBlockInfoList");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getFileBlockInfoList failed: unknown result");
}
public FileInfo getStatus(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_getStatus(path);
return recv_getStatus();
}
public void send_getStatus(String path) throws org.apache.thrift.TException
{
getStatus_args args = new getStatus_args();
args.setPath(path);
sendBase("getStatus", args);
}
public FileInfo recv_getStatus() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
getStatus_result result = new getStatus_result();
receiveBase(result, "getStatus");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getStatus failed: unknown result");
}
public FileInfo getStatusInternal(long fileId) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_getStatusInternal(fileId);
return recv_getStatusInternal();
}
public void send_getStatusInternal(long fileId) throws org.apache.thrift.TException
{
getStatusInternal_args args = new getStatusInternal_args();
args.setFileId(fileId);
sendBase("getStatusInternal", args);
}
public FileInfo recv_getStatusInternal() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
getStatusInternal_result result = new getStatusInternal_result();
receiveBase(result, "getStatusInternal");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getStatusInternal failed: unknown result");
}
public long getNewBlockIdForFile(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_getNewBlockIdForFile(path);
return recv_getNewBlockIdForFile();
}
public void send_getNewBlockIdForFile(String path) throws org.apache.thrift.TException
{
getNewBlockIdForFile_args args = new getNewBlockIdForFile_args();
args.setPath(path);
sendBase("getNewBlockIdForFile", args);
}
public long recv_getNewBlockIdForFile() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
getNewBlockIdForFile_result result = new getNewBlockIdForFile_result();
receiveBase(result, "getNewBlockIdForFile");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getNewBlockIdForFile failed: unknown result");
}
public String getUfsAddress() throws org.apache.thrift.TException
{
send_getUfsAddress();
return recv_getUfsAddress();
}
public void send_getUfsAddress() throws org.apache.thrift.TException
{
getUfsAddress_args args = new getUfsAddress_args();
sendBase("getUfsAddress", args);
}
public String recv_getUfsAddress() throws org.apache.thrift.TException
{
getUfsAddress_result result = new getUfsAddress_result();
receiveBase(result, "getUfsAddress");
if (result.isSetSuccess()) {
return result.success;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getUfsAddress failed: unknown result");
}
public List listStatus(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_listStatus(path);
return recv_listStatus();
}
public void send_listStatus(String path) throws org.apache.thrift.TException
{
listStatus_args args = new listStatus_args();
args.setPath(path);
sendBase("listStatus", args);
}
public List recv_listStatus() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
listStatus_result result = new listStatus_result();
receiveBase(result, "listStatus");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "listStatus failed: unknown result");
}
public long loadMetadata(String ufsPath, boolean recursive) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException
{
send_loadMetadata(ufsPath, recursive);
return recv_loadMetadata();
}
public void send_loadMetadata(String ufsPath, boolean recursive) throws org.apache.thrift.TException
{
loadMetadata_args args = new loadMetadata_args();
args.setUfsPath(ufsPath);
args.setRecursive(recursive);
sendBase("loadMetadata", args);
}
public long recv_loadMetadata() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException
{
loadMetadata_result result = new loadMetadata_result();
receiveBase(result, "loadMetadata");
if (result.isSetSuccess()) {
return result.success;
}
if (result.e != null) {
throw result.e;
}
if (result.ioe != null) {
throw result.ioe;
}
throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "loadMetadata failed: unknown result");
}
public void mount(String alluxioPath, String ufsPath, MountTOptions options) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException
{
send_mount(alluxioPath, ufsPath, options);
recv_mount();
}
public void send_mount(String alluxioPath, String ufsPath, MountTOptions options) throws org.apache.thrift.TException
{
mount_args args = new mount_args();
args.setAlluxioPath(alluxioPath);
args.setUfsPath(ufsPath);
args.setOptions(options);
sendBase("mount", args);
}
public void recv_mount() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException
{
mount_result result = new mount_result();
receiveBase(result, "mount");
if (result.e != null) {
throw result.e;
}
if (result.ioe != null) {
throw result.ioe;
}
return;
}
public void remove(String path, boolean recursive) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_remove(path, recursive);
recv_remove();
}
public void send_remove(String path, boolean recursive) throws org.apache.thrift.TException
{
remove_args args = new remove_args();
args.setPath(path);
args.setRecursive(recursive);
sendBase("remove", args);
}
public void recv_remove() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
remove_result result = new remove_result();
receiveBase(result, "remove");
if (result.e != null) {
throw result.e;
}
return;
}
public void rename(String path, String dstPath) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException
{
send_rename(path, dstPath);
recv_rename();
}
public void send_rename(String path, String dstPath) throws org.apache.thrift.TException
{
rename_args args = new rename_args();
args.setPath(path);
args.setDstPath(dstPath);
sendBase("rename", args);
}
public void recv_rename() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException
{
rename_result result = new rename_result();
receiveBase(result, "rename");
if (result.e != null) {
throw result.e;
}
if (result.ioe != null) {
throw result.ioe;
}
return;
}
public void setAttribute(String path, SetAttributeTOptions options) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_setAttribute(path, options);
recv_setAttribute();
}
public void send_setAttribute(String path, SetAttributeTOptions options) throws org.apache.thrift.TException
{
setAttribute_args args = new setAttribute_args();
args.setPath(path);
args.setOptions(options);
sendBase("setAttribute", args);
}
public void recv_setAttribute() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
setAttribute_result result = new setAttribute_result();
receiveBase(result, "setAttribute");
if (result.e != null) {
throw result.e;
}
return;
}
public void scheduleAsyncPersist(String path) throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
send_scheduleAsyncPersist(path);
recv_scheduleAsyncPersist();
}
public void send_scheduleAsyncPersist(String path) throws org.apache.thrift.TException
{
scheduleAsyncPersist_args args = new scheduleAsyncPersist_args();
args.setPath(path);
sendBase("scheduleAsyncPersist", args);
}
public void recv_scheduleAsyncPersist() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException
{
scheduleAsyncPersist_result result = new scheduleAsyncPersist_result();
receiveBase(result, "scheduleAsyncPersist");
if (result.e != null) {
throw result.e;
}
return;
}
public void unmount(String alluxioPath) throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException
{
send_unmount(alluxioPath);
recv_unmount();
}
public void send_unmount(String alluxioPath) throws org.apache.thrift.TException
{
unmount_args args = new unmount_args();
args.setAlluxioPath(alluxioPath);
sendBase("unmount", args);
}
public void recv_unmount() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException
{
unmount_result result = new unmount_result();
receiveBase(result, "unmount");
if (result.e != null) {
throw result.e;
}
if (result.ioe != null) {
throw result.ioe;
}
return;
}
}
public static class AsyncClient extends alluxio.thrift.AlluxioService.AsyncClient implements AsyncIface {
public static class Factory implements org.apache.thrift.async.TAsyncClientFactory {
private org.apache.thrift.async.TAsyncClientManager clientManager;
private org.apache.thrift.protocol.TProtocolFactory protocolFactory;
public Factory(org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.protocol.TProtocolFactory protocolFactory) {
this.clientManager = clientManager;
this.protocolFactory = protocolFactory;
}
public AsyncClient getAsyncClient(org.apache.thrift.transport.TNonblockingTransport transport) {
return new AsyncClient(protocolFactory, clientManager, transport);
}
}
public AsyncClient(org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.async.TAsyncClientManager clientManager, org.apache.thrift.transport.TNonblockingTransport transport) {
super(protocolFactory, clientManager, transport);
}
public void completeFile(String path, CompleteFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
completeFile_call method_call = new completeFile_call(path, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class completeFile_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
private CompleteFileTOptions options;
public completeFile_call(String path, CompleteFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("completeFile", org.apache.thrift.protocol.TMessageType.CALL, 0));
completeFile_args args = new completeFile_args();
args.setPath(path);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_completeFile();
}
}
public void createDirectory(String path, CreateDirectoryTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
createDirectory_call method_call = new createDirectory_call(path, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class createDirectory_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
private CreateDirectoryTOptions options;
public createDirectory_call(String path, CreateDirectoryTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createDirectory", org.apache.thrift.protocol.TMessageType.CALL, 0));
createDirectory_args args = new createDirectory_args();
args.setPath(path);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_createDirectory();
}
}
public void createFile(String path, CreateFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
createFile_call method_call = new createFile_call(path, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class createFile_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
private CreateFileTOptions options;
public createFile_call(String path, CreateFileTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("createFile", org.apache.thrift.protocol.TMessageType.CALL, 0));
createFile_args args = new createFile_args();
args.setPath(path);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_createFile();
}
}
public void free(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
free_call method_call = new free_call(path, recursive, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class free_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
private boolean recursive;
public free_call(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
this.recursive = recursive;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("free", org.apache.thrift.protocol.TMessageType.CALL, 0));
free_args args = new free_args();
args.setPath(path);
args.setRecursive(recursive);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_free();
}
}
public void getFileBlockInfoList(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
getFileBlockInfoList_call method_call = new getFileBlockInfoList_call(path, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getFileBlockInfoList_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
public getFileBlockInfoList_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getFileBlockInfoList", org.apache.thrift.protocol.TMessageType.CALL, 0));
getFileBlockInfoList_args args = new getFileBlockInfoList_args();
args.setPath(path);
args.write(prot);
prot.writeMessageEnd();
}
public List getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getFileBlockInfoList();
}
}
public void getStatus(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
getStatus_call method_call = new getStatus_call(path, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getStatus_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
public getStatus_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getStatus", org.apache.thrift.protocol.TMessageType.CALL, 0));
getStatus_args args = new getStatus_args();
args.setPath(path);
args.write(prot);
prot.writeMessageEnd();
}
public FileInfo getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getStatus();
}
}
public void getStatusInternal(long fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
getStatusInternal_call method_call = new getStatusInternal_call(fileId, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getStatusInternal_call extends org.apache.thrift.async.TAsyncMethodCall {
private long fileId;
public getStatusInternal_call(long fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.fileId = fileId;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getStatusInternal", org.apache.thrift.protocol.TMessageType.CALL, 0));
getStatusInternal_args args = new getStatusInternal_args();
args.setFileId(fileId);
args.write(prot);
prot.writeMessageEnd();
}
public FileInfo getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getStatusInternal();
}
}
public void getNewBlockIdForFile(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
getNewBlockIdForFile_call method_call = new getNewBlockIdForFile_call(path, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getNewBlockIdForFile_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
public getNewBlockIdForFile_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getNewBlockIdForFile", org.apache.thrift.protocol.TMessageType.CALL, 0));
getNewBlockIdForFile_args args = new getNewBlockIdForFile_args();
args.setPath(path);
args.write(prot);
prot.writeMessageEnd();
}
public long getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getNewBlockIdForFile();
}
}
public void getUfsAddress(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
getUfsAddress_call method_call = new getUfsAddress_call(resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class getUfsAddress_call extends org.apache.thrift.async.TAsyncMethodCall {
public getUfsAddress_call(org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getUfsAddress", org.apache.thrift.protocol.TMessageType.CALL, 0));
getUfsAddress_args args = new getUfsAddress_args();
args.write(prot);
prot.writeMessageEnd();
}
public String getResult() throws org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_getUfsAddress();
}
}
public void listStatus(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
listStatus_call method_call = new listStatus_call(path, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class listStatus_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
public listStatus_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("listStatus", org.apache.thrift.protocol.TMessageType.CALL, 0));
listStatus_args args = new listStatus_args();
args.setPath(path);
args.write(prot);
prot.writeMessageEnd();
}
public List getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_listStatus();
}
}
public void loadMetadata(String ufsPath, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
loadMetadata_call method_call = new loadMetadata_call(ufsPath, recursive, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class loadMetadata_call extends org.apache.thrift.async.TAsyncMethodCall {
private String ufsPath;
private boolean recursive;
public loadMetadata_call(String ufsPath, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.ufsPath = ufsPath;
this.recursive = recursive;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("loadMetadata", org.apache.thrift.protocol.TMessageType.CALL, 0));
loadMetadata_args args = new loadMetadata_args();
args.setUfsPath(ufsPath);
args.setRecursive(recursive);
args.write(prot);
prot.writeMessageEnd();
}
public long getResult() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
return (new Client(prot)).recv_loadMetadata();
}
}
public void mount(String alluxioPath, String ufsPath, MountTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
mount_call method_call = new mount_call(alluxioPath, ufsPath, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class mount_call extends org.apache.thrift.async.TAsyncMethodCall {
private String alluxioPath;
private String ufsPath;
private MountTOptions options;
public mount_call(String alluxioPath, String ufsPath, MountTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.alluxioPath = alluxioPath;
this.ufsPath = ufsPath;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("mount", org.apache.thrift.protocol.TMessageType.CALL, 0));
mount_args args = new mount_args();
args.setAlluxioPath(alluxioPath);
args.setUfsPath(ufsPath);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_mount();
}
}
public void remove(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
remove_call method_call = new remove_call(path, recursive, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class remove_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
private boolean recursive;
public remove_call(String path, boolean recursive, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
this.recursive = recursive;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("remove", org.apache.thrift.protocol.TMessageType.CALL, 0));
remove_args args = new remove_args();
args.setPath(path);
args.setRecursive(recursive);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_remove();
}
}
public void rename(String path, String dstPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
rename_call method_call = new rename_call(path, dstPath, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class rename_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
private String dstPath;
public rename_call(String path, String dstPath, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
this.dstPath = dstPath;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("rename", org.apache.thrift.protocol.TMessageType.CALL, 0));
rename_args args = new rename_args();
args.setPath(path);
args.setDstPath(dstPath);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_rename();
}
}
public void setAttribute(String path, SetAttributeTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
setAttribute_call method_call = new setAttribute_call(path, options, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class setAttribute_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
private SetAttributeTOptions options;
public setAttribute_call(String path, SetAttributeTOptions options, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
this.options = options;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("setAttribute", org.apache.thrift.protocol.TMessageType.CALL, 0));
setAttribute_args args = new setAttribute_args();
args.setPath(path);
args.setOptions(options);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_setAttribute();
}
}
public void scheduleAsyncPersist(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
scheduleAsyncPersist_call method_call = new scheduleAsyncPersist_call(path, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class scheduleAsyncPersist_call extends org.apache.thrift.async.TAsyncMethodCall {
private String path;
public scheduleAsyncPersist_call(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.path = path;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("scheduleAsyncPersist", org.apache.thrift.protocol.TMessageType.CALL, 0));
scheduleAsyncPersist_args args = new scheduleAsyncPersist_args();
args.setPath(path);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws alluxio.thrift.AlluxioTException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_scheduleAsyncPersist();
}
}
public void unmount(String alluxioPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException {
checkReady();
unmount_call method_call = new unmount_call(alluxioPath, resultHandler, this, ___protocolFactory, ___transport);
this.___currentMethod = method_call;
___manager.call(method_call);
}
public static class unmount_call extends org.apache.thrift.async.TAsyncMethodCall {
private String alluxioPath;
public unmount_call(String alluxioPath, org.apache.thrift.async.AsyncMethodCallback resultHandler, org.apache.thrift.async.TAsyncClient client, org.apache.thrift.protocol.TProtocolFactory protocolFactory, org.apache.thrift.transport.TNonblockingTransport transport) throws org.apache.thrift.TException {
super(client, protocolFactory, transport, resultHandler, false);
this.alluxioPath = alluxioPath;
}
public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException {
prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("unmount", org.apache.thrift.protocol.TMessageType.CALL, 0));
unmount_args args = new unmount_args();
args.setAlluxioPath(alluxioPath);
args.write(prot);
prot.writeMessageEnd();
}
public void getResult() throws alluxio.thrift.AlluxioTException, alluxio.thrift.ThriftIOException, org.apache.thrift.TException {
if (getState() != org.apache.thrift.async.TAsyncMethodCall.State.RESPONSE_READ) {
throw new IllegalStateException("Method call not finished!");
}
org.apache.thrift.transport.TMemoryInputTransport memoryTransport = new org.apache.thrift.transport.TMemoryInputTransport(getFrameBuffer().array());
org.apache.thrift.protocol.TProtocol prot = client.getProtocolFactory().getProtocol(memoryTransport);
(new Client(prot)).recv_unmount();
}
}
}
public static class Processor extends alluxio.thrift.AlluxioService.Processor implements org.apache.thrift.TProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName());
public Processor(I iface) {
super(iface, getProcessMap(new HashMap>()));
}
protected Processor(I iface, Map> processMap) {
super(iface, getProcessMap(processMap));
}
private static Map> getProcessMap(Map> processMap) {
processMap.put("completeFile", new completeFile());
processMap.put("createDirectory", new createDirectory());
processMap.put("createFile", new createFile());
processMap.put("free", new free());
processMap.put("getFileBlockInfoList", new getFileBlockInfoList());
processMap.put("getStatus", new getStatus());
processMap.put("getStatusInternal", new getStatusInternal());
processMap.put("getNewBlockIdForFile", new getNewBlockIdForFile());
processMap.put("getUfsAddress", new getUfsAddress());
processMap.put("listStatus", new listStatus());
processMap.put("loadMetadata", new loadMetadata());
processMap.put("mount", new mount());
processMap.put("remove", new remove());
processMap.put("rename", new rename());
processMap.put("setAttribute", new setAttribute());
processMap.put("scheduleAsyncPersist", new scheduleAsyncPersist());
processMap.put("unmount", new unmount());
return processMap;
}
public static class completeFile extends org.apache.thrift.ProcessFunction {
public completeFile() {
super("completeFile");
}
public completeFile_args getEmptyArgsInstance() {
return new completeFile_args();
}
protected boolean isOneway() {
return false;
}
public completeFile_result getResult(I iface, completeFile_args args) throws org.apache.thrift.TException {
completeFile_result result = new completeFile_result();
try {
iface.completeFile(args.path, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class createDirectory extends org.apache.thrift.ProcessFunction {
public createDirectory() {
super("createDirectory");
}
public createDirectory_args getEmptyArgsInstance() {
return new createDirectory_args();
}
protected boolean isOneway() {
return false;
}
public createDirectory_result getResult(I iface, createDirectory_args args) throws org.apache.thrift.TException {
createDirectory_result result = new createDirectory_result();
try {
iface.createDirectory(args.path, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
} catch (alluxio.thrift.ThriftIOException ioe) {
result.ioe = ioe;
}
return result;
}
}
public static class createFile extends org.apache.thrift.ProcessFunction {
public createFile() {
super("createFile");
}
public createFile_args getEmptyArgsInstance() {
return new createFile_args();
}
protected boolean isOneway() {
return false;
}
public createFile_result getResult(I iface, createFile_args args) throws org.apache.thrift.TException {
createFile_result result = new createFile_result();
try {
iface.createFile(args.path, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
} catch (alluxio.thrift.ThriftIOException ioe) {
result.ioe = ioe;
}
return result;
}
}
public static class free extends org.apache.thrift.ProcessFunction {
public free() {
super("free");
}
public free_args getEmptyArgsInstance() {
return new free_args();
}
protected boolean isOneway() {
return false;
}
public free_result getResult(I iface, free_args args) throws org.apache.thrift.TException {
free_result result = new free_result();
try {
iface.free(args.path, args.recursive);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class getFileBlockInfoList extends org.apache.thrift.ProcessFunction {
public getFileBlockInfoList() {
super("getFileBlockInfoList");
}
public getFileBlockInfoList_args getEmptyArgsInstance() {
return new getFileBlockInfoList_args();
}
protected boolean isOneway() {
return false;
}
public getFileBlockInfoList_result getResult(I iface, getFileBlockInfoList_args args) throws org.apache.thrift.TException {
getFileBlockInfoList_result result = new getFileBlockInfoList_result();
try {
result.success = iface.getFileBlockInfoList(args.path);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class getStatus extends org.apache.thrift.ProcessFunction {
public getStatus() {
super("getStatus");
}
public getStatus_args getEmptyArgsInstance() {
return new getStatus_args();
}
protected boolean isOneway() {
return false;
}
public getStatus_result getResult(I iface, getStatus_args args) throws org.apache.thrift.TException {
getStatus_result result = new getStatus_result();
try {
result.success = iface.getStatus(args.path);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class getStatusInternal extends org.apache.thrift.ProcessFunction {
public getStatusInternal() {
super("getStatusInternal");
}
public getStatusInternal_args getEmptyArgsInstance() {
return new getStatusInternal_args();
}
protected boolean isOneway() {
return false;
}
public getStatusInternal_result getResult(I iface, getStatusInternal_args args) throws org.apache.thrift.TException {
getStatusInternal_result result = new getStatusInternal_result();
try {
result.success = iface.getStatusInternal(args.fileId);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class getNewBlockIdForFile extends org.apache.thrift.ProcessFunction {
public getNewBlockIdForFile() {
super("getNewBlockIdForFile");
}
public getNewBlockIdForFile_args getEmptyArgsInstance() {
return new getNewBlockIdForFile_args();
}
protected boolean isOneway() {
return false;
}
public getNewBlockIdForFile_result getResult(I iface, getNewBlockIdForFile_args args) throws org.apache.thrift.TException {
getNewBlockIdForFile_result result = new getNewBlockIdForFile_result();
try {
result.success = iface.getNewBlockIdForFile(args.path);
result.setSuccessIsSet(true);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class getUfsAddress extends org.apache.thrift.ProcessFunction {
public getUfsAddress() {
super("getUfsAddress");
}
public getUfsAddress_args getEmptyArgsInstance() {
return new getUfsAddress_args();
}
protected boolean isOneway() {
return false;
}
public getUfsAddress_result getResult(I iface, getUfsAddress_args args) throws org.apache.thrift.TException {
getUfsAddress_result result = new getUfsAddress_result();
result.success = iface.getUfsAddress();
return result;
}
}
public static class listStatus extends org.apache.thrift.ProcessFunction {
public listStatus() {
super("listStatus");
}
public listStatus_args getEmptyArgsInstance() {
return new listStatus_args();
}
protected boolean isOneway() {
return false;
}
public listStatus_result getResult(I iface, listStatus_args args) throws org.apache.thrift.TException {
listStatus_result result = new listStatus_result();
try {
result.success = iface.listStatus(args.path);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class loadMetadata extends org.apache.thrift.ProcessFunction {
public loadMetadata() {
super("loadMetadata");
}
public loadMetadata_args getEmptyArgsInstance() {
return new loadMetadata_args();
}
protected boolean isOneway() {
return false;
}
public loadMetadata_result getResult(I iface, loadMetadata_args args) throws org.apache.thrift.TException {
loadMetadata_result result = new loadMetadata_result();
try {
result.success = iface.loadMetadata(args.ufsPath, args.recursive);
result.setSuccessIsSet(true);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
} catch (alluxio.thrift.ThriftIOException ioe) {
result.ioe = ioe;
}
return result;
}
}
public static class mount extends org.apache.thrift.ProcessFunction {
public mount() {
super("mount");
}
public mount_args getEmptyArgsInstance() {
return new mount_args();
}
protected boolean isOneway() {
return false;
}
public mount_result getResult(I iface, mount_args args) throws org.apache.thrift.TException {
mount_result result = new mount_result();
try {
iface.mount(args.alluxioPath, args.ufsPath, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
} catch (alluxio.thrift.ThriftIOException ioe) {
result.ioe = ioe;
}
return result;
}
}
public static class remove extends org.apache.thrift.ProcessFunction {
public remove() {
super("remove");
}
public remove_args getEmptyArgsInstance() {
return new remove_args();
}
protected boolean isOneway() {
return false;
}
public remove_result getResult(I iface, remove_args args) throws org.apache.thrift.TException {
remove_result result = new remove_result();
try {
iface.remove(args.path, args.recursive);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class rename extends org.apache.thrift.ProcessFunction {
public rename() {
super("rename");
}
public rename_args getEmptyArgsInstance() {
return new rename_args();
}
protected boolean isOneway() {
return false;
}
public rename_result getResult(I iface, rename_args args) throws org.apache.thrift.TException {
rename_result result = new rename_result();
try {
iface.rename(args.path, args.dstPath);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
} catch (alluxio.thrift.ThriftIOException ioe) {
result.ioe = ioe;
}
return result;
}
}
public static class setAttribute extends org.apache.thrift.ProcessFunction {
public setAttribute() {
super("setAttribute");
}
public setAttribute_args getEmptyArgsInstance() {
return new setAttribute_args();
}
protected boolean isOneway() {
return false;
}
public setAttribute_result getResult(I iface, setAttribute_args args) throws org.apache.thrift.TException {
setAttribute_result result = new setAttribute_result();
try {
iface.setAttribute(args.path, args.options);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class scheduleAsyncPersist extends org.apache.thrift.ProcessFunction {
public scheduleAsyncPersist() {
super("scheduleAsyncPersist");
}
public scheduleAsyncPersist_args getEmptyArgsInstance() {
return new scheduleAsyncPersist_args();
}
protected boolean isOneway() {
return false;
}
public scheduleAsyncPersist_result getResult(I iface, scheduleAsyncPersist_args args) throws org.apache.thrift.TException {
scheduleAsyncPersist_result result = new scheduleAsyncPersist_result();
try {
iface.scheduleAsyncPersist(args.path);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
}
return result;
}
}
public static class unmount extends org.apache.thrift.ProcessFunction {
public unmount() {
super("unmount");
}
public unmount_args getEmptyArgsInstance() {
return new unmount_args();
}
protected boolean isOneway() {
return false;
}
public unmount_result getResult(I iface, unmount_args args) throws org.apache.thrift.TException {
unmount_result result = new unmount_result();
try {
iface.unmount(args.alluxioPath);
} catch (alluxio.thrift.AlluxioTException e) {
result.e = e;
} catch (alluxio.thrift.ThriftIOException ioe) {
result.ioe = ioe;
}
return result;
}
}
}
public static class AsyncProcessor extends alluxio.thrift.AlluxioService.AsyncProcessor {
private static final Logger LOGGER = LoggerFactory.getLogger(AsyncProcessor.class.getName());
public AsyncProcessor(I iface) {
super(iface, getProcessMap(new HashMap>()));
}
protected AsyncProcessor(I iface, Map> processMap) {
super(iface, getProcessMap(processMap));
}
private static Map> getProcessMap(Map> processMap) {
processMap.put("completeFile", new completeFile());
processMap.put("createDirectory", new createDirectory());
processMap.put("createFile", new createFile());
processMap.put("free", new free());
processMap.put("getFileBlockInfoList", new getFileBlockInfoList());
processMap.put("getStatus", new getStatus());
processMap.put("getStatusInternal", new getStatusInternal());
processMap.put("getNewBlockIdForFile", new getNewBlockIdForFile());
processMap.put("getUfsAddress", new getUfsAddress());
processMap.put("listStatus", new listStatus());
processMap.put("loadMetadata", new loadMetadata());
processMap.put("mount", new mount());
processMap.put("remove", new remove());
processMap.put("rename", new rename());
processMap.put("setAttribute", new setAttribute());
processMap.put("scheduleAsyncPersist", new scheduleAsyncPersist());
processMap.put("unmount", new unmount());
return processMap;
}
public static class completeFile extends org.apache.thrift.AsyncProcessFunction {
public completeFile() {
super("completeFile");
}
public completeFile_args getEmptyArgsInstance() {
return new completeFile_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(Void o) {
completeFile_result result = new completeFile_result();
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
completeFile_result result = new completeFile_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, completeFile_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.completeFile(args.path, args.options,resultHandler);
}
}
public static class createDirectory extends org.apache.thrift.AsyncProcessFunction {
public createDirectory() {
super("createDirectory");
}
public createDirectory_args getEmptyArgsInstance() {
return new createDirectory_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(Void o) {
createDirectory_result result = new createDirectory_result();
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
createDirectory_result result = new createDirectory_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else if (e instanceof alluxio.thrift.ThriftIOException) {
result.ioe = (alluxio.thrift.ThriftIOException) e;
result.setIoeIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, createDirectory_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.createDirectory(args.path, args.options,resultHandler);
}
}
public static class createFile extends org.apache.thrift.AsyncProcessFunction {
public createFile() {
super("createFile");
}
public createFile_args getEmptyArgsInstance() {
return new createFile_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(Void o) {
createFile_result result = new createFile_result();
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
createFile_result result = new createFile_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else if (e instanceof alluxio.thrift.ThriftIOException) {
result.ioe = (alluxio.thrift.ThriftIOException) e;
result.setIoeIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, createFile_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.createFile(args.path, args.options,resultHandler);
}
}
public static class free extends org.apache.thrift.AsyncProcessFunction {
public free() {
super("free");
}
public free_args getEmptyArgsInstance() {
return new free_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(Void o) {
free_result result = new free_result();
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
free_result result = new free_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, free_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.free(args.path, args.recursive,resultHandler);
}
}
public static class getFileBlockInfoList extends org.apache.thrift.AsyncProcessFunction> {
public getFileBlockInfoList() {
super("getFileBlockInfoList");
}
public getFileBlockInfoList_args getEmptyArgsInstance() {
return new getFileBlockInfoList_args();
}
public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback>() {
public void onComplete(List o) {
getFileBlockInfoList_result result = new getFileBlockInfoList_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
getFileBlockInfoList_result result = new getFileBlockInfoList_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getFileBlockInfoList_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException {
iface.getFileBlockInfoList(args.path,resultHandler);
}
}
public static class getStatus extends org.apache.thrift.AsyncProcessFunction {
public getStatus() {
super("getStatus");
}
public getStatus_args getEmptyArgsInstance() {
return new getStatus_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(FileInfo o) {
getStatus_result result = new getStatus_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
getStatus_result result = new getStatus_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getStatus_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.getStatus(args.path,resultHandler);
}
}
public static class getStatusInternal extends org.apache.thrift.AsyncProcessFunction {
public getStatusInternal() {
super("getStatusInternal");
}
public getStatusInternal_args getEmptyArgsInstance() {
return new getStatusInternal_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(FileInfo o) {
getStatusInternal_result result = new getStatusInternal_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
getStatusInternal_result result = new getStatusInternal_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getStatusInternal_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.getStatusInternal(args.fileId,resultHandler);
}
}
public static class getNewBlockIdForFile extends org.apache.thrift.AsyncProcessFunction {
public getNewBlockIdForFile() {
super("getNewBlockIdForFile");
}
public getNewBlockIdForFile_args getEmptyArgsInstance() {
return new getNewBlockIdForFile_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(Long o) {
getNewBlockIdForFile_result result = new getNewBlockIdForFile_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
getNewBlockIdForFile_result result = new getNewBlockIdForFile_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getNewBlockIdForFile_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.getNewBlockIdForFile(args.path,resultHandler);
}
}
public static class getUfsAddress extends org.apache.thrift.AsyncProcessFunction {
public getUfsAddress() {
super("getUfsAddress");
}
public getUfsAddress_args getEmptyArgsInstance() {
return new getUfsAddress_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(String o) {
getUfsAddress_result result = new getUfsAddress_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
getUfsAddress_result result = new getUfsAddress_result();
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, getUfsAddress_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.getUfsAddress(resultHandler);
}
}
public static class listStatus extends org.apache.thrift.AsyncProcessFunction> {
public listStatus() {
super("listStatus");
}
public listStatus_args getEmptyArgsInstance() {
return new listStatus_args();
}
public AsyncMethodCallback> getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback>() {
public void onComplete(List o) {
listStatus_result result = new listStatus_result();
result.success = o;
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
listStatus_result result = new listStatus_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, listStatus_args args, org.apache.thrift.async.AsyncMethodCallback> resultHandler) throws TException {
iface.listStatus(args.path,resultHandler);
}
}
public static class loadMetadata extends org.apache.thrift.AsyncProcessFunction {
public loadMetadata() {
super("loadMetadata");
}
public loadMetadata_args getEmptyArgsInstance() {
return new loadMetadata_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(Long o) {
loadMetadata_result result = new loadMetadata_result();
result.success = o;
result.setSuccessIsSet(true);
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
loadMetadata_result result = new loadMetadata_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else if (e instanceof alluxio.thrift.ThriftIOException) {
result.ioe = (alluxio.thrift.ThriftIOException) e;
result.setIoeIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, loadMetadata_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.loadMetadata(args.ufsPath, args.recursive,resultHandler);
}
}
public static class mount extends org.apache.thrift.AsyncProcessFunction {
public mount() {
super("mount");
}
public mount_args getEmptyArgsInstance() {
return new mount_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(Void o) {
mount_result result = new mount_result();
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
mount_result result = new mount_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else if (e instanceof alluxio.thrift.ThriftIOException) {
result.ioe = (alluxio.thrift.ThriftIOException) e;
result.setIoeIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, mount_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.mount(args.alluxioPath, args.ufsPath, args.options,resultHandler);
}
}
public static class remove extends org.apache.thrift.AsyncProcessFunction {
public remove() {
super("remove");
}
public remove_args getEmptyArgsInstance() {
return new remove_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(Void o) {
remove_result result = new remove_result();
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
remove_result result = new remove_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, remove_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.remove(args.path, args.recursive,resultHandler);
}
}
public static class rename extends org.apache.thrift.AsyncProcessFunction {
public rename() {
super("rename");
}
public rename_args getEmptyArgsInstance() {
return new rename_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(Void o) {
rename_result result = new rename_result();
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
rename_result result = new rename_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else if (e instanceof alluxio.thrift.ThriftIOException) {
result.ioe = (alluxio.thrift.ThriftIOException) e;
result.setIoeIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, rename_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.rename(args.path, args.dstPath,resultHandler);
}
}
public static class setAttribute extends org.apache.thrift.AsyncProcessFunction {
public setAttribute() {
super("setAttribute");
}
public setAttribute_args getEmptyArgsInstance() {
return new setAttribute_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(Void o) {
setAttribute_result result = new setAttribute_result();
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
setAttribute_result result = new setAttribute_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, setAttribute_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.setAttribute(args.path, args.options,resultHandler);
}
}
public static class scheduleAsyncPersist extends org.apache.thrift.AsyncProcessFunction {
public scheduleAsyncPersist() {
super("scheduleAsyncPersist");
}
public scheduleAsyncPersist_args getEmptyArgsInstance() {
return new scheduleAsyncPersist_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(Void o) {
scheduleAsyncPersist_result result = new scheduleAsyncPersist_result();
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
scheduleAsyncPersist_result result = new scheduleAsyncPersist_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, scheduleAsyncPersist_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.scheduleAsyncPersist(args.path,resultHandler);
}
}
public static class unmount extends org.apache.thrift.AsyncProcessFunction {
public unmount() {
super("unmount");
}
public unmount_args getEmptyArgsInstance() {
return new unmount_args();
}
public AsyncMethodCallback getResultHandler(final AsyncFrameBuffer fb, final int seqid) {
final org.apache.thrift.AsyncProcessFunction fcall = this;
return new AsyncMethodCallback() {
public void onComplete(Void o) {
unmount_result result = new unmount_result();
try {
fcall.sendResponse(fb,result, org.apache.thrift.protocol.TMessageType.REPLY,seqid);
return;
} catch (Exception e) {
LOGGER.error("Exception writing to internal frame buffer", e);
}
fb.close();
}
public void onError(Exception e) {
byte msgType = org.apache.thrift.protocol.TMessageType.REPLY;
org.apache.thrift.TBase msg;
unmount_result result = new unmount_result();
if (e instanceof alluxio.thrift.AlluxioTException) {
result.e = (alluxio.thrift.AlluxioTException) e;
result.setEIsSet(true);
msg = result;
}
else if (e instanceof alluxio.thrift.ThriftIOException) {
result.ioe = (alluxio.thrift.ThriftIOException) e;
result.setIoeIsSet(true);
msg = result;
}
else
{
msgType = org.apache.thrift.protocol.TMessageType.EXCEPTION;
msg = (org.apache.thrift.TBase)new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.INTERNAL_ERROR, e.getMessage());
}
try {
fcall.sendResponse(fb,msg,msgType,seqid);
return;
} catch (Exception ex) {
LOGGER.error("Exception writing to internal frame buffer", ex);
}
fb.close();
}
};
}
protected boolean isOneway() {
return false;
}
public void start(I iface, unmount_args args, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws TException {
iface.unmount(args.alluxioPath,resultHandler);
}
}
}
public static class completeFile_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable, Comparable {
private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("completeFile_args");
private static final org.apache.thrift.protocol.TField PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("path", org.apache.thrift.protocol.TType.STRING, (short)1);
private static final org.apache.thrift.protocol.TField OPTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("options", org.apache.thrift.protocol.TType.STRUCT, (short)2);
private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>();
static {
schemes.put(StandardScheme.class, new completeFile_argsStandardSchemeFactory());
schemes.put(TupleScheme.class, new completeFile_argsTupleSchemeFactory());
}
private String path; // required
private CompleteFileTOptions options; // required
/** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */
public enum _Fields implements org.apache.thrift.TFieldIdEnum {
/**
* the path of the file
*/
PATH((short)1, "path"),
/**
* the method options
*/
OPTIONS((short)2, "options");
private static final Map byName = new HashMap();
static {
for (_Fields field : EnumSet.allOf(_Fields.class)) {
byName.put(field.getFieldName(), field);
}
}
/**
* Find the _Fields constant that matches fieldId, or null if its not found.
*/
public static _Fields findByThriftId(int fieldId) {
switch(fieldId) {
case 1: // PATH
return PATH;
case 2: // OPTIONS
return OPTIONS;
default:
return null;
}
}
/**
* Find the _Fields constant that matches fieldId, throwing an exception
* if it is not found.
*/
public static _Fields findByThriftIdOrThrow(int fieldId) {
_Fields fields = findByThriftId(fieldId);
if (fields == null) throw new IllegalArgumentException("Field " + fieldId + " doesn't exist!");
return fields;
}
/**
* Find the _Fields constant that matches name, or null if its not found.
*/
public static _Fields findByName(String name) {
return byName.get(name);
}
private final short _thriftId;
private final String _fieldName;
_Fields(short thriftId, String fieldName) {
_thriftId = thriftId;
_fieldName = fieldName;
}
public short getThriftFieldId() {
return _thriftId;
}
public String getFieldName() {
return _fieldName;
}
}
// isset id assignments
public static final Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> metaDataMap;
static {
Map<_Fields, org.apache.thrift.meta_data.FieldMetaData> tmpMap = new EnumMap<_Fields, org.apache.thrift.meta_data.FieldMetaData>(_Fields.class);
tmpMap.put(_Fields.PATH, new org.apache.thrift.meta_data.FieldMetaData("path", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)));
tmpMap.put(_Fields.OPTIONS, new org.apache.thrift.meta_data.FieldMetaData("options", org.apache.thrift.TFieldRequirementType.DEFAULT,
new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, CompleteFileTOptions.class)));
metaDataMap = Collections.unmodifiableMap(tmpMap);
org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(completeFile_args.class, metaDataMap);
}
public completeFile_args() {
}
public completeFile_args(
String path,
CompleteFileTOptions options)
{
this();
this.path = path;
this.options = options;
}
/**
* Performs a deep copy on other.
*/
public completeFile_args(completeFile_args other) {
if (other.isSetPath()) {
this.path = other.path;
}
if (other.isSetOptions()) {
this.options = new CompleteFileTOptions(other.options);
}
}
public completeFile_args deepCopy() {
return new completeFile_args(this);
}
@Override
public void clear() {
this.path = null;
this.options = null;
}
/**
* the path of the file
*/
public String getPath() {
return this.path;
}
/**
* the path of the file
*/
public completeFile_args setPath(String path) {
this.path = path;
return this;
}
public void unsetPath() {
this.path = null;
}
/** Returns true if field path is set (has been assigned a value) and false otherwise */
public boolean isSetPath() {
return this.path != null;
}
public void setPathIsSet(boolean value) {
if (!value) {
this.path = null;
}
}
/**
* the method options
*/
public CompleteFileTOptions getOptions() {
return this.options;
}
/**
* the method options
*/
public completeFile_args setOptions(CompleteFileTOptions options) {
this.options = options;
return this;
}
public void unsetOptions() {
this.options = null;
}
/** Returns true if field options is set (has been assigned a value) and false otherwise */
public boolean isSetOptions() {
return this.options != null;
}
public void setOptionsIsSet(boolean value) {
if (!value) {
this.options = null;
}
}
public void setFieldValue(_Fields field, Object value) {
switch (field) {
case PATH:
if (value == null) {
unsetPath();
} else {
setPath((String)value);
}
break;
case OPTIONS:
if (value == null) {
unsetOptions();
} else {
setOptions((CompleteFileTOptions)value);
}
break;
}
}
public Object getFieldValue(_Fields field) {
switch (field) {
case PATH:
return getPath();
case OPTIONS:
return getOptions();
}
throw new IllegalStateException();
}
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */
public boolean isSet(_Fields field) {
if (field == null) {
throw new IllegalArgumentException();
}
switch (field) {
case PATH:
return isSetPath();
case OPTIONS:
return isSetOptions();
}
throw new IllegalStateException();
}
@Override
public boolean equals(Object that) {
if (that == null)
return false;
if (that instanceof completeFile_args)
return this.equals((completeFile_args)that);
return false;
}
public boolean equals(completeFile_args that) {
if (that == null)
return false;
boolean this_present_path = true && this.isSetPath();
boolean that_present_path = true && that.isSetPath();
if (this_present_path || that_present_path) {
if (!(this_present_path && that_present_path))
return false;
if (!this.path.equals(that.path))
return false;
}
boolean this_present_options = true && this.isSetOptions();
boolean that_present_options = true && that.isSetOptions();
if (this_present_options || that_present_options) {
if (!(this_present_options && that_present_options))
return false;
if (!this.options.equals(that.options))
return false;
}
return true;
}
@Override
public int hashCode() {
List