diff --git a/.gitignore b/.gitignore index 97551445c6fe..448387a77316 100644 --- a/.gitignore +++ b/.gitignore @@ -5,7 +5,11 @@ .settings/ conf/tachyon-env.sh data/ +docs/_site +docs/api +docs/serve/ journal/ logs/ +script/ tachyon.iml target/ diff --git a/README.md b/README.md index 3fab53094df5..07419c739e46 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,13 @@ Tachyon ======= -The master branch is in version 0.4.0-SNAPSHOT: +The master branch is in version 0.5.0-SNAPSHOT: -Project Homepage: http://www.tachyonproject.org - -Previous Releases: https://github.com/amplab/tachyon/tags - -Documentation: https://github.com/amplab/tachyon/wiki - -JIRA: https://spark-project.atlassian.net/browse/TACHYON - -User Mailing List: https://groups.google.com/forum/?fromgroups#!forum/tachyon-users +- [Project Homepage](http://www.tachyonproject.org) +- [Previous Releases](https://github.com/amplab/tachyon/tags) +- [Master Branch Document](http://tachyon-project.org/master/) +- [Tachyon Issue Tracker](https://spark-project.atlassian.net/browse/TACHYON) +- [User Mailing List](https://groups.google.com/forum/?fromgroups#!forum/tachyon-users) ## Dependency Information @@ -20,18 +16,18 @@ User Mailing List: https://groups.google.com/forum/?fromgroups#!forum/tachyon-us org.tachyonproject tachyon - 0.3.0 + 0.4.1 ``` ### Apache Ant ```xml - + ``` ### SBT ``` -libraryDependencies += "org.tachyonproject" % "tachyon" % "0.3.0" +libraryDependencies += "org.tachyonproject" % "tachyon" % "0.4.1" ``` diff --git a/bin/tachyon b/bin/tachyon index 29776f304d75..29c1de5315d5 100755 --- a/bin/tachyon +++ b/bin/tachyon @@ -3,15 +3,17 @@ function printUsage { echo "Usage: tachyon COMMAND " echo "where COMMAND is one of:" - echo -e " format \t Format Tachyon" + echo -e " format [-s] \t Format Tachyon (if -s specified, only format if underfs doesn't exist)" + echo -e " bootstrap-conf\t Generate a config file if one doesn't exist" echo -e " tfs \t Command line input for generic filesystem user client." echo -e " loadufs \t Load existing files in underlayer filesystem into Tachyon." echo -e " runTest \t Run a end-to-end test on a Tachyon cluster." echo -e " runTests \t Run all end-to-end tests on a Tachyon cluster." - echo -e " killAll \t Kill processes containing the WORD" - echo -e " copyDir \t Copy the PATH to all worker nodes" + echo -e " killAll \t Kill processes containing the WORD." + echo -e " copyDir \t Copy the PATH to all worker nodes." + echo -e " clearCache \t Clear OS buffer cache of the machine." echo -e " thriftGen \t Generate all thrift code." - echo -e " clearCache \t Clear OS buffer cache of the machine" + echo -e " version \t Print Tachyon version and exit." echo "Commands print help when invoked without parameters." } @@ -30,7 +32,7 @@ TACHYON_LIBEXEC_DIR=${TACHYON_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR} . $TACHYON_LIBEXEC_DIR/tachyon-config.sh function runTest { - Usage="Usage: tachyon runTest " + Usage="Usage: tachyon runTest " if [ "$#" -ne 2 ]; then echo $Usage @@ -43,12 +45,16 @@ function runTest { fi if [[ "$1" == "Basic" ]]; then - $bin/tachyon tfs rm /Basic_File_$2 - $JAVA -cp $TACHYON_CONF_DIR/:$TACHYON_JAR tachyon.examples.BasicOperations $MASTER_ADDRESS:19998 /Basic_File_$2 $2 + $bin/tachyon tfs rm /BasicFile_$2 + $JAVA -cp $TACHYON_CONF_DIR/:$TACHYON_JAR tachyon.examples.BasicOperations tachyon://$MASTER_ADDRESS:19998 /BasicFile_$2 $2 exit 0 elif [[ "$1" == "BasicRawTable" ]]; then - $bin/tachyon tfs rm /Basic_Raw_Table_$2 - $JAVA -cp $TACHYON_CONF_DIR/:$TACHYON_JAR tachyon.examples.BasicRawTableOperations $MASTER_ADDRESS:19998 /Basic_Raw_Table_$2 $2 + $bin/tachyon tfs rm /BasicRawTable_$2 + $JAVA -cp $TACHYON_CONF_DIR/:$TACHYON_JAR tachyon.examples.BasicRawTableOperations tachyon://$MASTER_ADDRESS:19998 /BasicRawTable_$2 $2 + exit 0 + elif [[ "$1" == "BasicCheckpoint" ]]; then + $bin/tachyon tfs rm /BasicCheckpoint + $JAVA -cp $TACHYON_CONF_DIR/:$TACHYON_JAR tachyon.examples.BasicCheckpoint tachyon://$MASTER_ADDRESS:19998 /BasicCheckpoint 10 exit 0 fi @@ -94,12 +100,58 @@ function copyDir { wait } +function bootstrapConf { + if [ $# -ne 1 ]; then + echo "Usage $0 bootstrap-conf TACHYON_MASTER_HOSTNAME" + exit 1 + fi + + if [ ! -e "$TACHYON_CONF_DIR/tachyon-env.sh" ]; then + # Create a default config that can be overridden later + cp "$TACHYON_CONF_DIR/tachyon-env.sh.template" "$TACHYON_CONF_DIR/tachyon-env.sh" + sed -i "s/TACHYON_MASTER_ADDRESS=localhost/TACHYON_MASTER_ADDRESS=$1/" "$TACHYON_CONF_DIR/tachyon-env.sh" + TOTAL_MEM=`awk '/MemTotal/{print $2}' /proc/meminfo` + TOTAL_MEM=$[TOTAL_MEM * 2 / 3] + sed -i "s/TACHYON_WORKER_MEMORY_SIZE=1GB/TACHYON_WORKER_MEMORY_SIZE=${TOTAL_MEM}KB/" "$TACHYON_CONF_DIR/tachyon-env.sh" + fi +} + +PARAMETER="" + if [ "$COMMAND" == "format" ]; then + if [ $# -eq 1 ]; then + if [ "$1" == "-s" ]; then + if [ -e $TACHYON_UNDERFS_ADDRESS ] || [[ $TACHYON_UNDERFS_ADDRESS == hdfs://* ]] || [[ $TACHYON_UNDERFS_ADDRESS == s3://* ]]; then + # already exists, hdfs, or s3, don't format + exit 0 + else + shift # remove -s param + fi + else + echo "Usage $0 format [-s]" + exit 2 + fi + elif [ $# -gt 1 ]; then + echo "Usage $0 format [-s]" + exit 2 + fi + if [ -z $TACHYON_MASTER_ADDRESS ] ; then TACHYON_MASTER_ADDRESS=localhost fi - echo "Formatting Tachyon @ $TACHYON_MASTER_ADDRESS" + + $bin/tachyon-slaves.sh $bin/tachyon formatWorker + + echo "Formatting Tachyon Master @ $TACHYON_MASTER_ADDRESS" + CLASS=tachyon.Format + PARAMETER=master +elif [ "$COMMAND" == "bootstrap-conf" ]; then + bootstrapConf "$@" + exit 0 +elif [ "$COMMAND" == "formatWorker" ]; then + echo "Formatting Tachyon Worker @ `hostname`" CLASS=tachyon.Format + PARAMETER=worker elif [ "$COMMAND" == "tfs" ]; then CLASS=tachyon.command.TFsShell elif [ "$COMMAND" == "loadufs" ]; then @@ -108,7 +160,7 @@ elif [ "$COMMAND" == "runTest" ]; then runTest "$@" exit 0 elif [ "$COMMAND" == "runTests" ]; then - declare -a opArr=(MUST_CACHE TRY_CACHE CACHE_THROUGH THROUGH) + declare -a opArr=(MUST_CACHE TRY_CACHE CACHE_THROUGH THROUGH ASYNC_THROUGH) for op in ${opArr[@]} do @@ -132,9 +184,11 @@ elif [ "$COMMAND" == "thriftGen" ]; then elif [ "$COMMAND" == "clearCache" ]; then sync; echo 3 > /proc/sys/vm/drop_caches ; exit 0 +elif [ "$COMMAND" == "version" ]; then + CLASS=tachyon.Version else printUsage exit 1 fi -$JAVA -cp $TACHYON_JAR -Dtachyon.home=$TACHYON_HOME -Dtachyon.master.hostname=$TACHYON_MASTER_ADDRESS -Dtachyon.logger.type=USER_LOGGER $TACHYON_JAVA_OPTS $CLASS $@ \ No newline at end of file +$JAVA -cp $TACHYON_JAR -Dtachyon.home=$TACHYON_HOME -Dtachyon.master.hostname=$TACHYON_MASTER_ADDRESS -Dtachyon.logger.type=USER_LOGGER $TACHYON_JAVA_OPTS $CLASS $PARAMETER $@ diff --git a/bin/tachyon-start.sh b/bin/tachyon-start.sh index 28764a297e01..7635b41b7812 100755 --- a/bin/tachyon-start.sh +++ b/bin/tachyon-start.sh @@ -101,7 +101,7 @@ start_master() { fi echo "Starting master @ $MASTER_ADDRESS" - (nohup $JAVA -cp $TACHYON_JAR -Dtachyon.home=$TACHYON_HOME -Dtachyon.logger.type="MASTER_LOGGER" -Dlog4j.configuration=file:$TACHYON_CONF_DIR/log4j.properties $TACHYON_JAVA_OPTS tachyon.Master > /dev/null 2>&1) & + (nohup $JAVA -cp $TACHYON_JAR -Dtachyon.home=$TACHYON_HOME -Dtachyon.logger.type="MASTER_LOGGER" -Dlog4j.configuration=file:$TACHYON_CONF_DIR/log4j.properties $TACHYON_JAVA_OPTS tachyon.master.TachyonMaster > /dev/null 2>&1) & } start_worker() { @@ -111,21 +111,21 @@ start_worker() { exit 1 fi echo "Starting worker @ `hostname`" - (nohup $JAVA -cp $TACHYON_JAR -Dtachyon.home=$TACHYON_HOME -Dtachyon.logger.type="WORKER_LOGGER" -Dlog4j.configuration=file:$TACHYON_CONF_DIR/log4j.properties $TACHYON_JAVA_OPTS tachyon.Worker `hostname` > /dev/null 2>&1 ) & + (nohup $JAVA -cp $TACHYON_JAR -Dtachyon.home=$TACHYON_HOME -Dtachyon.logger.type="WORKER_LOGGER" -Dlog4j.configuration=file:$TACHYON_CONF_DIR/log4j.properties $TACHYON_JAVA_OPTS tachyon.worker.TachyonWorker `hostname` > /dev/null 2>&1 ) & } restart_worker() { - RUN=`ps -ef | grep "tachyon.Worker" | grep "java" | wc | cut -d" " -f7` + RUN=`ps -ef | grep "tachyon.worker.TachyonWorker" | grep "java" | wc | cut -d" " -f7` if [[ $RUN -eq 0 ]] ; then echo "Restarting worker @ `hostname`" - (nohup $JAVA -cp $TACHYON_JAR -Dtachyon.home=$TACHYON_HOME -Dtachyon.is.system=true -Dtachyon.logger.type="WORKER_LOGGER" $TACHYON_JAVA_OPTS tachyon.Worker `hostname` > /dev/null 2>&1) & + (nohup $JAVA -cp $TACHYON_JAR -Dtachyon.home=$TACHYON_HOME -Dtachyon.is.system=true -Dtachyon.logger.type="WORKER_LOGGER" $TACHYON_JAVA_OPTS tachyon.worker.TachyonWorker `hostname` > /dev/null 2>&1) & fi } run_safe() { while [ 1 ] do - RUN=`ps -ef | grep "tachyon.Master" | grep "java" | wc | cut -d" " -f7` + RUN=`ps -ef | grep "tachyon.master.TachyonMaster" | grep "java" | wc | cut -d" " -f7` if [[ $RUN -eq 0 ]] ; then echo "Restarting the system master..." start_master @@ -197,7 +197,7 @@ case "${WHAT}" in ;; workers) check_mount_mode $2 - $bin/tachyon-slaves.sh $bin/tachyon-start.sh worker $2 + $bin/tachyon-slaves.sh $bin/tachyon-start.sh worker $2 $TACHYON_MASTER_ADDRESS ;; restart_worker) restart_worker diff --git a/bin/tachyon-stop.sh b/bin/tachyon-stop.sh index f998ef510ff1..d4e5c8f57806 100755 --- a/bin/tachyon-stop.sh +++ b/bin/tachyon-stop.sh @@ -26,7 +26,7 @@ fi bin=`cd "$( dirname "$0" )"; pwd` -$bin/tachyon killAll tachyon.Master -$bin/tachyon killAll tachyon.Worker +$bin/tachyon killAll tachyon.master.TachyonMaster +$bin/tachyon killAll tachyon.worker.TachyonWorker -$bin/tachyon-slaves.sh $bin/tachyon killAll tachyon.Worker \ No newline at end of file +$bin/tachyon-slaves.sh $bin/tachyon killAll tachyon.worker.TachyonWorker \ No newline at end of file diff --git a/conf/tachyon-env.sh.template b/conf/tachyon-env.sh.template index 32d5d39a08f1..7b2fa7dfb249 100755 --- a/conf/tachyon-env.sh.template +++ b/conf/tachyon-env.sh.template @@ -9,26 +9,30 @@ # - TACHYON_UNDERFS_ADDRESS, to set the under filesystem address. # - TACHYON_WORKER_MEMORY_SIZE, to set how much memory to use (e.g. 1000mb, 2gb) per worker # - TACHYON_RAM_FOLDER, to set where worker stores in memory data -# - TACHYON_UNDERFS_HDFS_IMPL, to set which HDFS implementation to use (e.g. com.mapr.fs.MapRFileSystem, -# org.apache.hadoop.hdfs.DistributedFileSystem) +# - TACHYON_UNDERFS_HDFS_IMPL, to set which HDFS implementation to use (e.g. com.mapr.fs.MapRFileSystem, +# org.apache.hadoop.hdfs.DistributedFileSystem) # The following gives an example: if [[ `uname -a` == Darwin* ]]; then # Assuming Mac OS X + export JAVA_HOME=$(/usr/libexec/java_home) export TACHYON_RAM_FOLDER=/Volumes/ramdisk export TACHYON_JAVA_OPTS="-Djava.security.krb5.realm= -Djava.security.krb5.kdc=" - export JAVA_HOME=$(/usr/libexec/java_home) else # Assuming Linux + if [ -z "$JAVA_HOME" ]; then + export JAVA_HOME=/usr/lib/jvm/java-7-oracle + fi export TACHYON_RAM_FOLDER=/mnt/ramdisk - export JAVA_HOME=/usr/lib/jvm/java-7-oracle fi export JAVA="$JAVA_HOME/bin/java" export TACHYON_MASTER_ADDRESS=localhost -export TACHYON_UNDERFS_ADDRESS=hdfs://localhost:8020 +export TACHYON_UNDERFS_ADDRESS=$TACHYON_HOME/underfs +#export TACHYON_UNDERFS_ADDRESS=hdfs://localhost:9000 export TACHYON_WORKER_MEMORY_SIZE=1GB +export TACHYON_UNDERFS_HDFS_IMPL=org.apache.hadoop.hdfs.DistributedFileSystem CONF_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" @@ -37,10 +41,13 @@ export TACHYON_JAVA_OPTS+=" -Dtachyon.debug=false -Dtachyon.underfs.address=$TACHYON_UNDERFS_ADDRESS -Dtachyon.underfs.hdfs.impl=$TACHYON_UNDERFS_HDFS_IMPL + -Dtachyon.data.folder=$TACHYON_UNDERFS_ADDRESS/tmp/tachyon/data + -Dtachyon.workers.folder=$TACHYON_UNDERFS_ADDRESS/tmp/tachyon/workers -Dtachyon.worker.memory.size=$TACHYON_WORKER_MEMORY_SIZE -Dtachyon.worker.data.folder=$TACHYON_RAM_FOLDER/tachyonworker/ -Dtachyon.master.worker.timeout.ms=60000 -Dtachyon.master.hostname=$TACHYON_MASTER_ADDRESS -Dtachyon.master.journal.folder=$TACHYON_HOME/journal/ -Dtachyon.master.pinlist=/pinfiles;/pindata + -Dorg.apache.jasper.compiler.disablejsr199=true " diff --git a/docs/Building-Tachyon-Master-Branch.md b/docs/Building-Tachyon-Master-Branch.md new file mode 100644 index 000000000000..2f1fac106020 --- /dev/null +++ b/docs/Building-Tachyon-Master-Branch.md @@ -0,0 +1,59 @@ +--- +layout: global +title: Building Tachyon Master Branch +--- + +This guide describes how to compile Tachyon from the beginning. + +The prerequisite for this guide is that you have [Java 6 (or above)](Java-Setup.html), +[Maven](Maven.html), and [Thrift 0.9 (Optional)](Thrift.html) installed. + +Checkout Tachyon master branch from Github, and package: + + $ git clone git://github.com/amplab/tachyon.git + $ cd tachyon + $ mvn package + +If you want to build a particular version of Tachyon, for example {{site.TACHYON_RELEASED_VERSION}}, +please do `git checkout v{{site.TACHYON_RELEASED_VERSION}}` after `cd tachyon`. + +The Maven build system fetches its dependencies, compiles, runs system's unit tests, and package the +system. If this is the first time you are building the project, it can take a while to download all +the dependencies. Subsequent builds, however, will be much faster. + +Once it is built, you can start the Tachyon: + + $ cp conf/tachyon-env.sh.template conf/tachyon-env.sh + $ ./bin/tachyon format + $ ./bin/tachyon-start.sh local + +To verify that Tachyon is running, you can visit [http://localhost:19999](http://localhost:19999), +or see the log in the folder tachyon/logs. You can also run a simple program: + + $ ./bin/tachyon runTest Basic CACHE_THROUGH + +You should be able to see results similar to the following: + + /Basic_File_CACHE_THROUGH has been removed + 2014-02-02 09:32:02,760 INFO (TachyonFS.java:connect) - Trying to connect master @ localhost/127.0.0.1:19998 + 2014-02-02 09:32:02,791 INFO (MasterClient.java:getUserId) - User registered at the master localhost/127.0.0.1:19998 got UserId 10 + 2014-02-02 09:32:02,792 INFO (TachyonFS.java:connect) - Trying to get local worker host : hy-ubuntu + 2014-02-02 09:32:02,800 INFO (TachyonFS.java:connect) - Connecting local worker @ hy-ubuntu/127.0.1.1:29998 + 2014-02-02 09:32:02,819 INFO (CommonUtils.java:printTimeTakenMs) - createFile with fileId 18 took 60 ms. + 2014-02-02 09:32:03,194 INFO (TachyonFS.java:createAndGetUserTempFolder) - Folder /mnt/ramdisk/tachyonworker/users/10 was created! + 2014-02-02 09:32:03,198 INFO (BlockOutStream.java:) - /mnt/ramdisk/tachyonworker/users/10/19327352832 was created! + Passed the test! + +You can also stop the system by using: + + $ ./bin/tachyon-stop.sh + +# Unit tests + +To run all unit tests: + + $ mvn test + +To run all the unit tests with under filesystem other than local filesystem: + + $ mvn test [ -Dhadoop.version=x.x.x ] -Dintegration [ -Dufs=tachyon.LocalMiniDFSCluster ] diff --git a/docs/Command-Line-Interface.md b/docs/Command-Line-Interface.md new file mode 100644 index 000000000000..c6af7e39269d --- /dev/null +++ b/docs/Command-Line-Interface.md @@ -0,0 +1,88 @@ +--- +layout: global +title: Command Line Interface +--- + +Tachyon's command line interface gives users access to basic file system operations. Invoke the +command line utility with the script: + + ./bin/tachyon tfs + +All "path" variables in tfs commands should start with + + tachyon://:/ + +Or, if no header is provided, the default hostname and port (set in the env file) will be used. + + / + +#List of Operations + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
OperationSyntaxDescription
catcat "path"Print the content of the file to the console.
countcount "path"Display the number of folders and files matching the specified prefix in "path".
lsls "path"List all the files and directories directly under the given path with information such as size.
lsrlsr "path"Recursively list all the files and directories directly under the given path with information such as size.
mkdirmkdir "path"Create a directory under the given path, and creates any necessary parent directories. Will fail if the path is already in use.
rmrm "path"Remove a file or directory and all folders and files under that directory.
tailtail "path"Print the last 1KB of the specified file to the console.
touchtouch "path"Create a 0 byte file at the specified location.
mvmv "source" "destination"Move a file or directory specified by "source" to a new path "destination". Will fail if "destination" is already in use.
copyFromLocalcopyFromLocal "source path" "remote path"Copy the specified file to the path specified by "remote path". Will fail if "remote path" is already in use.
copyToLocalcopyToLocal "remote path" "local path"Copy the specified file from the path specified by "remote source" to a local destination.
fileinfofileinfo "path"Print the information of the blocks of a specified file.
locationlocation "path"List the nodes where the file specified by "path" can be found.
diff --git a/docs/Configuration-Settings.md b/docs/Configuration-Settings.md new file mode 100644 index 000000000000..9189512ca6d5 --- /dev/null +++ b/docs/Configuration-Settings.md @@ -0,0 +1,183 @@ +--- +layout: global +title: Configuration Settings +--- + +Tachyon configuration parameters fall into four categories: Master, Worker, Common (Master and +Worker), and User configurations. The environment configuration file responsible for setting system +properties is under `conf/tachyon-env.sh`. These variables should be set as variables under the +`TACHYON_JAVA_OPTS` definition. A template is provided with the zip: `conf/tachyon-env.sh.template`. + +# Common Configuration + +The common configuration contains constants which specify paths and the log appender name. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Property NameDefaultMeaning
tachyon.home"/mnt/tachyon_default_home"Tachyon installation folder.
tachyon.underfs.address$tachyon.home + "/underfs"Tachyon folder in the underlayer file system
tachyon.data.folder$tachyon.underfs.address + "/tachyon/data"Tachyon's data folder in the underlayer file system.
tachyon.workers.folder$tachyon.underfs.address + "/tachyon/workers"Tachyon's workers folders in the underlayer file system.
tachyon.usezookeeperfalseIf setup master fault tolerant mode using ZooKeeper.
tachyon.zookeeper.addressnullZooKeeper address for master fault tolerance.
tachyon.zookeeper.election.path"/election"Election folder in ZooKeeper.
tachyon.zookeeper.leader.path"/leader"Leader folder in ZooKeeper.
tachyon.underfs.hdfs.impl"org.apache.hadoop.hdfs.DistributedFileSystem"The implementation class of the HDFS, if using it as the under FS.
tachyon.max.columns1000Maximum number of columns allowed in RawTable, must be set on the client and server side
tachyon.table.metadata.byte5242880Maximum amount of bytes allowed to be store as RawTable metadata, must be set on the server side
fs.s3n.awsAccessKeyIdnullS3 aws access key id if using S3 as the under FS.
fs.s3n.awsSecretAccessKeynullS3 aws secret access key id if using S3 as the under FS.
+ +# Master Configuration + +The master configuration specifies information regarding the master node, such as address and port +number. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Property NameDefaultMeaning
tachyon.master.journal.folder$tachyon.home + "/journal/"The folder to store master journal log.
tachyon.master.hostnamelocalhostThe externally visible hostname of Tachyon's master address.
tachyon.master.port19998The port Tachyon's master node runs on.
tachyon.master.web.port19999The port Tachyon's web interface runs on.
tachyon.master.whitelist/The list of prefixes of the paths which are cacheable, separated by semi-colons. Tachyon will try to cache the cacheable file when it is read for the first time.
tachyon.master.pinlistThe list of files that will remain in memory all the time. If the memory size is not sufficient, the exception will be raised for the last caching file's client.
+ +# Worker Configuration + +The worker configuration specifies information regarding the worker nodes, such as address and port +number. + + + + + + + + + + + + + + + + + + + + + + + +
Property NameDefaultMeaning
tachyon.worker.port29998The port Tachyon's worker node runs on.
tachyon.worker.data.port29999The port Tachyon's worker's data server runs on.
tachyon.worker.data.folder/mnt/ramdiskThe path to the data folder for Tachyon's worker nodes. Note for macs the value should be "/Volumes/"
tachyon.worker.memory.size128 MBMemory capacity of each worker node.
+ +# User Configuration + +The user configuration specifies values regarding file system access. + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Property NameDefaultMeaning
tachyon.user.failed.space.request.limits3The number of times to request space from the file system before aborting
tachyon.user.quota.unit.bytes8 MBThe minimum number of bytes that will be requested from a client to a worker at a time
tachyon.user.file.buffer.bytes1 MBThe size of the file buffer to use for file system reads/writes.
tachyon.user.default.block.size.byte1 GBDefault block size for Tachyon files.
tachyon.user.remote.read.buffer.size.byte1 MBThe size of the file buffer to read data from remote Tachyon worker.
diff --git a/docs/Contributing-to-Tachyon.md b/docs/Contributing-to-Tachyon.md new file mode 100644 index 000000000000..33b7ec1510c8 --- /dev/null +++ b/docs/Contributing-to-Tachyon.md @@ -0,0 +1,12 @@ +--- +layout: global +title: Contributing to Tachyon +--- + +Contributions via GitHub pull requests are gladly accepted from their original author. Along with +any pull requests, please state that the contribution is your original work and that you license the +work to the project under the project's open source license. Whether or not you state this +explicitly, by submitting any copyrighted material via pull request, email, or other means you agree +to license the material under the project's open source license and warrant that you have the legal +authority to do so. + diff --git a/docs/Fault-Tolerant-Tachyon-Cluster.md b/docs/Fault-Tolerant-Tachyon-Cluster.md new file mode 100644 index 000000000000..85a92da19dc3 --- /dev/null +++ b/docs/Fault-Tolerant-Tachyon-Cluster.md @@ -0,0 +1,86 @@ +--- +layout: global +title: Fault Tolerant Tachyon Cluster +--- + +# Prerequisites + +There are two prerequisites to set up a fault tolerant Tachyon cluster, +[ZooKeeper](Fault-Tolerant-Tachyon-Cluster#zookeeper), and a shared reliable under filesystem. +Currently [HDFS](Fault-Tolerant-Tachyon-Cluster#hdfs) and S3 can be used as under +layers. Also, please see [Configuration Settings](Configuration-Settings.html) +for a more succinct description of all the configuration options Tachyon has. + +## HDFS + +For information about setting up HDFS, see +[Getting Started With Hadoop](http://wiki.apache.org/hadoop/GettingStartedWithHadoop). + +Note the name of machine running your NameNode, as you will need to tell Tachyon where this is. In +your tachyon-env.sh (or environment) you'll need to include: + + export TACHYON_UNDERFS_ADDRESS=hdfs://[namenodeserver]:[namenodeport] + +## ZooKeeper + +Tachyon uses ZooKeeper to achieve master fault tolerance. It is also required in order to use shared +storage (such as HDFS) for writing logs and images. + +ZooKeeper must be set up independently (see +[ZooKeeper Getting Started](http://zookeeper.apache.org/doc/r3.1.2/zookeeperStarted.html)) +and then in conf/tachyon-env.sh, these java options should be used: + + + + + + + + + + + + + +
Property NameExampleMeaning
tachyon.usezookeepertrue + Whether or not Master processes should use ZooKeeper. +
tachyon.zookeeper.addresslocalhost:2181 + The hostname and port ZooKeeper is running on. +
+ +## Configuring Tachyon + +Once you have HDFS and ZooKeeper running, you need to set up your tachyon-env.sh appropriately on +each host. Some settings are relevant for Master Nodes, while others for Workers. Here we separate +these concerns, however it is also fine to run a Master and Worker(s) on a single node. + +## Externally Visible Address + +In the following sections we refer to an "externally visible address". This is simply the address of +an interface on the machine being configured that can be seen by other nodes in the Tachyon cluster. +On EC2, you should the "ip-x-x-x-x" address. In particular, don't use localhost or 127.0.0.1, as +other nodes will then be unable to reach your node. + +## Master Configuration + +For a master node the ZooKeeper and HDFS variables must be set, as described above. + +In addition, the following variable must also be set: + + export TACHYON_MASTER_ADDRESS=[externally visible address of this machine] + +Finally, configure your TACHYON\_JAVA\_OPTS to include: + + -Dtachyon.master.journal.folder=hdfs://[namenodeserver]:[namenodeport]/tachyon/journal + +You can then start a master node on the machine and it will either become leader, or wait until the +current master dies and then offer to be the new leader. + +## Worker Configuration + +For a worker, it is only necessary to set the TACHYON\_MASTER\_ADDRESS option, as: + + export TACHYON_MASTER_ADDRESS=[address of one of the master nodes in the system] + +Any of the configured and running masters can be used, as they will inform the worker of the current +leader. diff --git a/docs/Java-Setup.md b/docs/Java-Setup.md new file mode 100644 index 000000000000..2958228c7bc2 --- /dev/null +++ b/docs/Java-Setup.md @@ -0,0 +1,35 @@ +--- +layout: global +title: Java Setup +--- + +# Mac OSX + +1. Download the latest Java JDK from + [Oracle](http://www.oracle.com/technetwork/java/javase/downloads/index.html) +2. From either the Downloads window of the browser, or from the file + browser, double click the .dmg file to launch it. +3. A Finder window appears containing an icon of an open box and the + name of the .pkg file Double click the package icon to launch the + **Install** app. +4. The Install app displays the **Introduction** window. Click + **Continue**. +5. The **Installation Type** window appears. Click **Install**. +6. A window appears which says "Installer is trying to install new + software. Type your password to allow this." Enter the Administrator + login and password and click **Install Software**. +7. The software is installed and a confirmation window appears. Click + the ReadMe for more information about the installation. + +# Linux + +1. Download the latest Java JDK from + [Oracle](http://www.oracle.com/technetwork/java/javase/downloads/index.html) +2. Change directory to the location where you would like the JDK to be + installed. Move the .tar.gz archive binary to the current directory. +3. Unpack the tarball and install the JDK. + + `$ tar zxvf jdk-7u-linux-x64.tar.gz` + +4. The Java Development Kit files are installed in a directory called jdk1.7.0\_ in the current +directory. Delete the .tar.gz file if you want to save disk space. diff --git a/docs/Maven.md b/docs/Maven.md new file mode 100644 index 000000000000..8d88e76a3058 --- /dev/null +++ b/docs/Maven.md @@ -0,0 +1,30 @@ +--- +layout: global +title: Maven +--- + +# Mac OSX + +Mac OS X comes with Apache Maven 3 built in, and can be located at `/usr/share/maven` + +1. Maven Verification In terminal, issue the command `mvn -version`. + +# Linux + +1. Download [Maven Binary](http://maven.apache.org/download.cgi) +2. Extract the distribution archive, i.e. + `apache-maven-3.0.5-bin.tar.gz` to the directory you wish to install + Maven 3.0.5. These instructions assume you chose + `/usr/local/apache-maven`. The subdirectory `apache-maven-3.0.5` + will be created from the archive. +3. In a command terminal, add the `M2_HOME` environment variable, e.g. + `export M2_HOME=/usr/local/apache-maven/apache-maven-3.0.5`. +4. Add the `M2` environment variable, e.g. `export M2=$M2_HOME/bin`. +5. Add `M2` environment variable to your path, e.g. + `export PATH=$M2:$PATH`. +6. Make sure that `JAVA_HOME` is set to the location of your JDK, e.g. + `export JAVA_HOME=/usr/java/jdk1.5.0_02` and that `$JAVA_HOME/bin` + is in your `PATH` environment variable. +7. Run `mvn --version` to verify that it is correctly installed. + + diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 000000000000..8d1a3437bd3f --- /dev/null +++ b/docs/README.md @@ -0,0 +1,15 @@ +Welcome to the Tachyon documentation! + +This readme will walk you through navigating and building the Tachyon documentation, which is included here with the Tachyon source code. + +Read on to learn more about viewing documentation in plain text (i.e., markdown) or building the documentation yourself. Why build it yourself? So that you have the docs that corresponds to whichever version of Tachyon you currently have checked out of revision control. + +## Generating the Documentation HTML + +We include the Tachyon documentation as part of the source (as opposed to using a hosted wiki, such as the github wiki, as the definitive documentation) to enable the documentation to evolve along with the source code and be captured by revision control (currently git). This way the code automatically includes the version of the documentation that is relevant regardless of which version or release you have checked out or downloaded. + +In this directory you will find textfiles formatted using Markdown, with an ".md" suffix. You can read those text files directly if you want. Start with index.md. + +To make things quite a bit prettier and make the links easier to follow, generate the html version of the documentation based on the src directory by running `jekyll` in the docs directory. Use the command `SKIP_SCALADOC=1 jekyll` to skip building and copying over the scaladoc which can be timely. To use the `jekyll` command, you will need to have Jekyll installed, the easiest way to do this is via a Ruby Gem, see the [jekyll installation instructions](https://github.com/mojombo/jekyll/wiki/install). This will create a directory called _site containing index.html as well as the rest of the compiled files. Read more about Jekyll at https://github.com/mojombo/jekyll/wiki. + +In addition to generating the site as html from the markdown files, jekyll can serve up the site via a webserver. To build and run a webserver use the command `jekyll --server` which (currently) runs the webserver on port 4000, then visit the site at http://localhost:4000. diff --git a/docs/Running-Hadoop-MapReduce-on-Tachyon.md b/docs/Running-Hadoop-MapReduce-on-Tachyon.md new file mode 100644 index 000000000000..7c15ef53be3e --- /dev/null +++ b/docs/Running-Hadoop-MapReduce-on-Tachyon.md @@ -0,0 +1,92 @@ +--- +layout: global +title: Running Hadoop MapReduce on Tachyon +--- + +This guide describes how to get Tachyon running with Hadoop MapReduce, so that you can easily use +your MapReduce programs with files stored on Tachyon. + +# Prerequisites + +The prerequisite for this part is that you have +[Java](https://github.com/amplab/tachyon/wiki/Java-setup/). We also assume that you have set up +Tachyon and Hadoop in accordance to these guides [Local Mode](Running-Tachyon-Locally.html) or +[Cluster Mode](Running-Tachyon-on-a-Cluster.html) + +Ensure that the `hadoop/conf/core-site.xml` file in your Hadoop installation's conf directory has +the following property added: + + + fs.tachyon.impl + tachyon.hadoop.TFS + + +This will allow your MapReduce jobs to use Tachyon for their input and output files. If you are +using HDFS as the underlying store for Tachyon, it may be necessary to add this property to the +`hdfs-site.xml` conf file as well. + +# Distributing Tachyon Executables + +In order for the MapReduce job to be able to use files via Tachyon, we will need to distribute the +Tachyon jar amongst all the nodes in the cluster. This will allow the TaskTracker and JobClient to +have all the requisite executables to interface with Tachyon. + +We are presented with three options that for distributing the jars as outlined by this +[guide](http://blog.cloudera.com/blog/2011/01/how-to-include-third-party-libraries-in-your-map-reduce-job/) +from Cloudera. + +Assuming that Tachyon will be used prominently, it is best to ensure that the Tachyon jar will +permanently reside on each node, so that we do not rely on the Hadoop DistributedCache to avoid the +network costs of distributing the jar for each job (Option 1), and don't significantly increase our +job jar size by packaging Tachyon with it (Option 2). For this reason, of the three options laid +out, it is highly recommended to consider the third route, by installing the Tachyon jar on each +node. + +- For installing Tachyon on each node, you must place the `tachyon-{{site.TACHYON_RELEASED_VERSION}}-jar-with-dependencies.jar`, + located in the `tachyon/target` directory, in the `$HADOOP_HOME/lib` directory of each node, and + then restart all of the TaskTrackers. One downfall of this approach is that the jars must be + installed again for each update to a new release. + +- You can also run a job by using the `-libjars` command line option when using `hadoop jar...`, and + specifying `/path/to/tachyon/target/tachyon-{{site.TACHYON_RELEASED_VERSION}}-jar-with-dependencies.jar` as the argument. + This will place the jar in the Hadoop DistributedCache, and is desirable only if you are updating + the Tachyon jar a non-trivial number of times. + +- For those interested in the second option, please revisit the Cloudera guide for more assistance. + One must simply package the Tachyon jar in the `lib` subdirectory of the job jar. This option is + the most undesirable since for every change in Tachyon, we must recreate the job jar, thereby + incurring a network cost for every job by increasing the size of the job jar. + +In order to make the Tachyon executables available to the JobClient, one can also install the +Tachyon jar in the `$HADOOP_HOME/lib` directory, or modify `HADOOP_CLASSPATH` by changing `hadoop- +env.sh` to: + + $ export HADOOP_CLASSPATH=/path/to/tachyon/target/tachyon-{{site.TACHYON_RELEASED_VERSION}}-jar-with-dependencies.jar + +This will allow the code that creates the Job and submits it to reference Tachyon if necessary. + +# Example + +For simplicity, we will assume a psuedo-distributed Hadoop cluster. + + $ cd $HADOOP_HOME + $ ./bin/stop-all.sh + $ ./bin/start-all.sh + +Because we have a psuedo-distributed cluster, copying the Tachyon jar into `$HADOOP_HOME/lib` makes +the Tachyon executables available to both the TaskTrackers and the JobClient. We can now verify that +it is working by the following: + + $ cd $HADOOP_HOME + $ ./bin/hadoop jar hadoop-examples-1.0.4.jar wordcount -libjars /path/to/tachyon-dev/target/tachyon-{{site.TACHYON_RELEASED_VERSION}}-jar-with-dependencies.jar tachyon://localhost:19998/X tachyon://localhost:19998/X-wc + +Where X is some file on Tachyon and, the results of the wordcount job is in the X-wc directory. + +For example, say you have text files in HDFS directory `/user/hduser/gutenberg/`. You can run the +following: + + $ cd $HADOOP_HOME + $ ./bin/hadoop jar hadoop-examples-1.0.4.jar wordcount -libjars /path/to/tachyon-dev/target/tachyon-{{site.TACHYON_RELEASED_VERSION}}-jar-with-dependencies.jar tachyon://localhost:19998/user/hduser/gutenberg /user/hduser/output + +The above command tell the wordcount to load the files from HDFS directory `/user/hduser/gutenberg/` +into Tachyon and then save the output result to HDFS `/user/hduser/output/`. diff --git a/docs/Running-Shark-on-Tachyon.md b/docs/Running-Shark-on-Tachyon.md new file mode 100644 index 000000000000..bfff3475cc45 --- /dev/null +++ b/docs/Running-Shark-on-Tachyon.md @@ -0,0 +1,65 @@ +--- +layout: global +title: Running Shark on Tachyon +--- + +The additional prerequisite for this part is [Shark](https://github.com/amplab/shark/wiki). +We also assume that the user has set up Tachyon and Hadoop in accordance to these guides +[Local Mode](Running-Tachyon-Locally.html) or [Cluster Mode](Running-Tachyon-on-a-Cluster.html). + +Shark 0.7 adds a new storage format to support efficiently reading data from +[Tachyon](http://tachyonproject.org), which enables data sharing and isolation across instances of +Shark. Our meetup [slide](http://goo.gl/fVmxCG) gives a good overview of the benefits of using +Tachyon to cache Shark's tables. In summary, the followings are four major ones: + +- In-memory data sharing across multiple Shark instances (i.e. stronger isolation) +- Instant recovery of in-memory tables +- Reduce heap size =\> faster GC in shark +- If the table is larger than the memory size, only the hot columns will be cached in memory + +### Shark Compatibility + + + + + + + + + + + + + + + + + + + +
Tachyon VersionShark Version
0.2.10.7.x
0.3.00.8.1
0.4.00.9.0
0.4.10.9.1 + (To be released)
+ +### Setup + +In order to run Shark on Tachyon, you need to setup `Tachyon` first, either +[Local Mode](https://github.com/amplab/tachyon/wiki/Running-Tachyon-Locally), +or [Cluster Mode](https://github.com/amplab/tachyon/wiki/Running-Tachyon-on-a-Cluster), with HDFS. + +Then, edit `shark-env.sh` and add + + export TACHYON_MASTER="TachyonMasterHost:TachyonMasterPort" + export TACHYON_WAREHOUSE_PATH=/sharktables + +### Cache Shark table in Tachyon + +Running these queries requires some data to already be loaded into Shark. + +##### Specify TBLPROPERTIES(“shark.cache” = “tachyon”), for example: + + CREATE TABLE data TBLPROPERTIES(“shark.cache” = “tachyon”) AS SELECT a, b, c from data_on_disk WHERE month=“May”; + +##### Specify table's name ending with \_tachyon, for example: + + CREATE TABLE orders_tachyon AS SELECT * FROM orders; + +After creating the table in Tachyon, you can query it like query normal tables. diff --git a/docs/Running-Spark-on-Tachyon.md b/docs/Running-Spark-on-Tachyon.md new file mode 100644 index 000000000000..1c78462c3ffc --- /dev/null +++ b/docs/Running-Spark-on-Tachyon.md @@ -0,0 +1,55 @@ +--- +layout: global +title: Running Spark on Tachyon +--- + +The additional prerequisite for this part is [Spark](http://spark-project.org/docs/latest/) (0.6 or +later). We also assume that the user is running on Tachyon {{site.TACHYON_RELEASED_VERSION}} or +later and have set up Tachyon and Hadoop in accordance to these guides +[Local Mode](Running-Tachyon-Locally.html) or [Cluster Mode](Running-Tachyon-on-a-Cluster.html). + +Edit Spark `spark/conf/spark-env.sh`, add: + + export SPARK_CLASSPATH=/pathToTachyon/tachyon/target/tachyon-{{site.TACHYON_RELEASED_VERSION}}-jar-with-dependencies.jar:$SPARK_CLASSPATH + +Create a new file `spark/conf/core-site.xml` Add the following to it + + + + fs.tachyon.impl + tachyon.hadoop.TFS + + + +Put a file X into HDFS. Run Spark Shell: + + $ ./spark-shell + $ val s = sc.textFile("tachyon://localhost:19998/X") + $ s.count() + $ s.saveAsTextFile("tachyon://localhost:19998/Y") + +Take a look at [http://localhost:19999](http://localhost:19999), there should be a file info +there. + +If you are running tachyon in fault tolerant mode along with zookeeper additionally add new entry in +previously created `spark/conf/core-site.xml` + + + fs.tachyon-ft.impl + tachyon.hadoop.TFS + + +Edit `spark/conf/spark-env.sh`, add: + + export SPARK_JAVA_OPTS=" + -Dtachyon.zookeeper.address=zookeeperHost1:2181,zookeeperHost2:2181 + -Dtachyon.usezookeeper=true + $SPARK_JAVA_OPTS + " + +Put a file X into HDFS. Run Spark Shell, you can now point to any tachyon master: + + $ ./spark-shell + $ val s = sc.textFile("tachyon-ft://stanbyHost:19998/X") + $ s.count() + $ s.saveAsTextFile("tachyon-ft://activeHost:19998/Y") \ No newline at end of file diff --git a/docs/Running-Tachyon-Locally.md b/docs/Running-Tachyon-Locally.md new file mode 100644 index 000000000000..082be2fd90d2 --- /dev/null +++ b/docs/Running-Tachyon-Locally.md @@ -0,0 +1,74 @@ +--- +layout: global +title: Running Tachyon Locally +--- + +This guide describes how to accomplish the following: + +- Run Tachyon on a single machine +- Set Apache HDFS as Tachyon's underlayer filesystem +- Set Amazon S3 as Tachyon's underlayer filesystem + +# Run Tachyon Standalone + +The prerequisite for this part is that you have [Java](Java-Setup.html) (JDK 6 or above). + +Download the binary distribution of Tachyon {{site.TACHYON_RELEASED_VERSION}}: + + $ wget http://tachyon-project.org/downloads/tachyon-{{site.TACHYON_RELEASED_VERSION}}-bin.tar.gz + $ tar xvfz tachyon-{{site.TACHYON_RELEASED_VERSION}}-bin.tar.gz + $ cd tachyon-{{site.TACHYON_RELEASED_VERSION}} + +Before executing Tachyon run scripts, requisite environment variables must be specified in `conf +/tachyon-env.sh`, which should be created from the included template file: + + $ cp conf/tachyon-env.sh.template conf/tachyon-env.sh + +To run standalone mode, make sure that `TACHYON_UNDERFS_ADDRESS` in `conf/tachyon-env.sh` is set to +a tmp directory in the local filesystem (e.g., ``export TACHYON_UNDERFS_ADDRESS=/tmp``). + +Then, you can format Tachyon FileSystem and start it. *Note: since Tachyon needs to setup RAMfs, +starting a local system requires users to input their root password for Linux based users.* + + $ ./bin/tachyon format + $ ./bin/tachyon-start.sh local + +To verify that Tachyon is running, you can visit +**[http://localhost:19999](http://localhost:19999)**, or see the log in the folder `tachyon/logs`. +You can also run a sample program: + + $ ./bin/tachyon runTest Basic CACHE_THROUGH + +For the first sample program, you should be able to see something similar to the following: + + /Basic_File_CACHE_THROUGH has been removed + 2014-02-02 09:32:02,760 INFO (TachyonFS.java:connect) - Trying to connect master @ localhost/127.0.0.1:19998 + 2014-02-02 09:32:02,791 INFO (MasterClient.java:getUserId) - User registered at the master localhost/127.0.0.1:19998 got UserId 10 + 2014-02-02 09:32:02,792 INFO (TachyonFS.java:connect) - Trying to get local worker host : hy-ubuntu + 2014-02-02 09:32:02,800 INFO (TachyonFS.java:connect) - Connecting local worker @ hy-ubuntu/127.0.1.1:29998 + 2014-02-02 09:32:02,819 INFO (CommonUtils.java:printTimeTakenMs) - createFile with fileId 18 took 60 ms. + 2014-02-02 09:32:03,194 INFO (TachyonFS.java:createAndGetUserTempFolder) - Folder /mnt/ramdisk/tachyonworker/users/10 was created! + 2014-02-02 09:32:03,198 INFO (BlockOutStream.java:) - /mnt/ramdisk/tachyonworker/users/10/19327352832 was created! + Passed the test! + +To run a more comprehensive sanity check: + + $ ./bin/tachyon runTests + +# Set HDFS as Tachyon's under filesystem + +The additional prerequisite for this part is [Hadoop HDFS](http://www.michael-noll.com/tutorials +/running-hadoop-on-ubuntu-linux-multi-node-cluster/). By default, Tachyon is set to use HDFS version +1.0.4. You can use another Hadoop version by changing the hadoop.version tag in pom.xml in Tachyon +and recompiling it. You can also set the hadoop version when compiling with maven: + + $ mvn -Dhadoop.version=2.2.0 clean package + +Edit `tachyon-env.sh` file. Setup `TACHYON_UNDERFS_ADDRESS=hdfs://HDFS_HOSTNAME:HDFS_IP`. You may +also need to setup `JAVA_HOME` in the same file. + +# Set Amazon S3 as Tachyon's under filesystem + +Edit `tachyon-env.sh` file. Setup `TACHYON_UNDERFS_ADDRESS=s3://s3address` and the necessary +credentials such as `fs.s3n.awsAccessKeyId` and `fs.s3n.awsSecretAccessKey` under +`TACHYON_JAVA_OPTS`. You may also need to setup `JAVA_HOME` in the same file. diff --git a/docs/Running-Tachyon-on-EC2.md b/docs/Running-Tachyon-on-EC2.md new file mode 100644 index 000000000000..401280639a2c --- /dev/null +++ b/docs/Running-Tachyon-on-EC2.md @@ -0,0 +1,75 @@ +--- +layout: global +title: Running Tachyon on EC2 +--- + +Tachyon can be launched on EC2 using the [Spark EC2 +scripts](https://github.com/mesos/spark/wiki/EC2-Scripts) that come with Spark. These scripts let +you launch, pause and destroy clusters that come automatically configured with HDFS, Spark, Apache +Mesos, Shark, and Tachyon. + +# Launching a Cluster + +To run a Tachyon cluster on EC2, first sign up for an Amazon EC2 account +on the [Amazon Web Services site](http://aws.amazon.com/). Then, +download Spark to your local machine: + + $ wget https://github.com/downloads/mesos/spark/spark-0.6.0-sources.tar.gz + $ tar xvfz spark-0.6.0-sources.tar.gz + +The `ec2` directory contains the scripts to set up a cluster. Detailed instructions are available in +the [Spark EC2 guide](https://github.com/mesos/spark/wiki/EC2-Scripts). In a nutshell, you will need +to do: + + $ spark-0.6.0/ec2/spark-ec2 -a ami-691d9100 -k -i -s launch + +Where `` is the name of your EC2 key pair (that you gave it +when you created it), `` is the private key file for your key +pair, `` is the number of slave nodes to launch (try 1 at +first), and `` is the name to give to your cluster. This +creates a cluster on EC2 using a pre-built machine image that has +Tachyon, Spark, and Shark. + +Login to the master using `spark-ec2 login`: + + $ ./spark-ec2 -k key -i key.pem login + +Then, config Tachyon in `tachyon` folder + + $ cd /root/tachyon/conf + $ cp tachyon-env.sh.template tachyon-env.sh + +Edit `tachyon-env.sh` file. Setup `TACHYON_HDFS_ADDRESS=hdfs://HDFS_HOSTNAME:HDFS_PORT`. + +Edit `slaves` file, add slaves' hostnames into it. Sync the configuration to all nodes. + + $ cd /root/tachyon/conf + $ /root/mesos-ec2/copy-dir . + +Edit Spark `/root/spark/conf/spark-env.sh`, add: + + export SPARK_CLASSPATH+=/root/tachyon/target/tachyon-1.0-SNAPSHOT-jar-with-dependencies.jar + SPARK_JAVA_OPTS+=" -Dtachyon.hdfs.address=hdfs://HDFS_HOSTNAME:HDFS_PORT -Dspark.default.parallelism=1 " + export SPARK_JAVA_OPTS + +Edit Spark's `hdfs-site.xml`, add: + + + fs.tachyon.impl + tachyon.hadoop.TachyonFileSystem + + + +Sync Spark's new configuration to all nodes: + + $ cd /root/spark/conf + $ /root/mesos-ec2/copy-dir . + +Put a file X into HDFS. Run Spark Shell: + + $ ./spark-shell + $ val s = sc.textFile("tachyon://tachyon_master_host:9999/X") + $ s.count() + +Take a look at `MasterMachineHostName:9998`, there should be a dataset info there. The Tachyon will +load `hdfs://HDFS_HOSTNAME:HDFS_PORT/X` into the system. \ No newline at end of file diff --git a/docs/Running-Tachyon-on-a-Cluster.md b/docs/Running-Tachyon-on-a-Cluster.md new file mode 100644 index 000000000000..9effd7bee11d --- /dev/null +++ b/docs/Running-Tachyon-on-a-Cluster.md @@ -0,0 +1,34 @@ +--- +layout: global +title: Running Tachyon on a Cluster +--- + +## Standalone cluster + +First download `tachyon` tar file, and extract it. + + $ wget http://tachyon-project.org/downloads/tachyon-{{site.TACHYON_RELEASED_VERSION}}-bin.tar.gz + $ tar xvfz tachyon-{{site.TACHYON_RELEASED_VERSION}}-bin.tar.gz + +In the `tachyon/conf` directory, copy `tachyon-env.sh.template` to `tachyon-env.sh`. Make sure +`JAVA_HOME` points to a valid Java 6/7 installation. Edit `tachyon/conf/master` and +`tachyon/conf/slaves` files. And then sync all the information to worker nodes. + +Now, you can start Tachyon: + + $ cd tachyon + $ ./bin/tachyon format + $ ./bin/tachyon-start.sh # use the right parameters here. e.g. all Mount + +To verify that Tachyon is running, you can visit +[http://tachyon.master.hostname:19999](http://tachyon.master.hostname:19999), check the log in the +folder tachyon/logs, or run a sample program: + + $ ./bin/tachyon runTests + +**Note**: If you are using EC2, make sure the security group settings on the master node allow + incoming connections on the tachyon web UI port. + +## EC2 cluster with Spark + +If you use Spark to launch an EC2 cluster, `Tachyon` will be installed and configured by default. diff --git a/docs/Startup-Tasks-for-New-Contributors.md b/docs/Startup-Tasks-for-New-Contributors.md new file mode 100644 index 000000000000..a87e80d28821 --- /dev/null +++ b/docs/Startup-Tasks-for-New-Contributors.md @@ -0,0 +1,63 @@ +--- +layout: global +title: Startup Tasks for New Contributors +--- + +A list of tasks that everyone should do before contributing to Tachyon. + +1. [Running Tachyon Locally](Running-Tachyon-Locally.html) + +2. [Running Tachyon on a Cluster](Running-Tachyon-on-a-Cluster.html) + (Optional) + +3. Read + [Configuration-Settings](Configuration-Settings.html) + (Optional) and play + [Command-Line Interface](Command-Line-Interface.html) + (Optional) + +4. Read and understand [an example](https://github.com/amplab/tachyon/blob/master/src/main/java/tachyon/examples/BasicOperations.java). + +5. [Building Tachyon Master Branch](Building-Tachyon-Master-Branch.html). + +6. Fork the repository, write/add unit tests/java doc for one or two files in the following list, +and then submit a pull request. You are also welcome to address issues in our +[JIRA](https://spark-project.atlassian.net/browse/TACHYON) + +* * * * * + + src/main/java/tachyon/Users.java + + src/main/java/tachyon/master/MasterWorkerInfo.java + + src/main/java/tachyon/worker/Worker.java + + src/main/java/tachyon/worker/WorkerClient.java + + src/main/java/tachyon/worker/DataServerMessage.java + +#### After the pull request is reviewed and merged, you become a Tachyon contributor! + +### Coding Style + +- Follow the style of the existing codebase. Specifically, we use + [Sun's conventions](http://www.oracle.com/technetwork/java/codeconv-138413.html), + with the following changes: + - Indent two spaces per level, not four. + - Maximum line length of 100 characters. + - Imported packages should be order as alphabetical order. + - `i ++` instead of `i++` + - `i + j` instead of `i+j` + - Class and member modifiers, when present, appear in the order recommended by the Java Language Specification: `public protected private abstract static final transient volatile synchronized native strictfp` +- You can download our [Eclipse formatter](resources/tachyon-code-formatter-eclipse.xml). + +### Submitting Code + +- Break your work into small, single-purpose patches if possible. It’s much harder to merge in + a large change with a lot of disjoint features. + +- Submit the patch as a GitHub pull request. For a tutorial, see the GitHub guides on + [forking a repo](https://help.github.com/articles/fork-a-repo) and + [sending a pull request](https://help.github.com/articles/using-pull-requests). + +- Make sure that your code passes the unit tests. diff --git a/docs/Syncing-the-Underlying-Filesystem.md b/docs/Syncing-the-Underlying-Filesystem.md new file mode 100644 index 000000000000..7ab9c8c74126 --- /dev/null +++ b/docs/Syncing-the-Underlying-Filesystem.md @@ -0,0 +1,17 @@ +--- +layout: global +title: Syncing the Underlayer Filesystem +--- + +Often times, there is already data in the underlying store, but when Tachyon is started, it will not +have knowledge about the preexisting files. + +Use the tachyon shell command loadufs to sync the filesystems. + + $ ./bin/tachyon loadufs [TACHYON_ADDRESS] [UNDERLYING_FILESYSTEM_ADDRESS] [ROOT_DIRECTORY] [-Optional EXCLUDE_PATHS] + +For example: + + $ ./bin/tachyon loadufs tachyon://127.0.0.1:19998 hdfs://localhost:9000 / /tachyon + +Would load the meta-data for all the files in the local hdfs, except for the Tachyon folder. diff --git a/docs/Thrift.md b/docs/Thrift.md new file mode 100644 index 000000000000..b37901defa1b --- /dev/null +++ b/docs/Thrift.md @@ -0,0 +1,60 @@ +--- +layout: global +title: Thrift +--- + +# Mac OSX + +1. Grab the latest Thrift distribution (we only support 0.7.0) from + [http://archive.apache.org/dist/thrift/0.7.0/](http://archive.apache.org/dist/thrift/0.7.0/) +2. Install Xcode from the Mac App Store +3. Launch Xcode, open the Preferences, select Downloads, and install + the “Command Line Tools for Xcode” component. +4. Install [Homebrew](http://mxcl.github.io/homebrew/) + +Here the commands for Homebrew installation: + + ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)" + brew doctor + +Use Homebrew to install autoconf, automake, libtool and pkg-config: + + brew install autoconf automake libtool pkg-config libevent + +Use Homebrew to install [Boost](http://www.boost.org/) + + brew install boost + +Now build Thrift 0.7.0: + + ./configure --prefix=/usr/local/ --with-boost=/usr/local --with-libevent=/usr/local + make + make install + +# Linux + +[Reference](http://thrift.apache.org/docs/install/) + +The following command install all the required tools and libraries to +build and install the Apache Thrift compiler on a Debian/Ubuntu Linux +based system. + + sudo apt-get install libboost-dev libboost-test-dev libboost-program-options-dev libevent-dev automake libtool flex bison pkg-config g++ libssl-dev ant python-dev + +or + + sudo yum install automake libtool flex bison pkgconfig gcc-c++ boost-devel libevent-devel zlib-devel python-devel ruby-devel ant python-dev + +Then install the Java JDK of your choice. Type javac to see a list of +available packages, pick the one you prefer and apt-get install it. + +Debian Lenny Users need some packages from backports + + sudo apt-get -t lenny-backports install automake libboost-test-dev + +[Build The Thrift](http://thrift.apache.org/docs/BuildingFromSource/) + + ./configure --with-boost=/usr/local + make + make install + diff --git a/docs/Web-Interface.md b/docs/Web-Interface.md new file mode 100644 index 000000000000..0d0223c44718 --- /dev/null +++ b/docs/Web-Interface.md @@ -0,0 +1,27 @@ +--- +layout: global +title: Web Interface +--- + +Tachyon has a user-friendly web interface facilitating users to watch and manage the system. We +present its homepage, browsing page, and file page. + +The **home page** gives an overview of the system's status. + +![home](./img/screenshot_home.png) + + +To browse the list of file, click "Browse File System" button. In **browsing page**, files in the +current folder is listed, with the information of file name, size, size for each block, the +percentage of in-memory data, and the creation time. To view the content of a file in detail, select +a file arbitrarily. + +![browse](./img/screenshot_browse.png) + +## File content page + +**File page** displays file's content and its block information. When the size of the file is large, +the page only shows the first 5KB from a specified start position is displayed. To change the start +position, enter the position in the input bar beside "Go" button and click "Go". + +![view](./img/screenshot_viewFile.png) diff --git a/docs/_config.yml b/docs/_config.yml new file mode 100644 index 000000000000..6feb822ee0a3 --- /dev/null +++ b/docs/_config.yml @@ -0,0 +1,6 @@ +pygments: true +markdown: kramdown + +# These allow the documentation to be updated with new releases of Tachyon. +TACHYON_RELEASED_VERSION: 0.4.1 +TACHYON_MASTER_VERSION_SHORT: 0.5.0-SNAPSHOT \ No newline at end of file diff --git a/docs/_layouts/404.html b/docs/_layouts/404.html new file mode 100644 index 000000000000..a9ae98902944 --- /dev/null +++ b/docs/_layouts/404.html @@ -0,0 +1,159 @@ + + + + + Page Not Found :( + + + +
+

Not found :(

+ +

Sorry, but the page you were trying to view does not exist.

+ +

It looks like this was the result of either:

+
    +
  • a mistyped address
  • +
  • an out-of-date link
  • +
+ + +
+ + diff --git a/docs/_layouts/global.html b/docs/_layouts/global.html new file mode 100644 index 000000000000..ba9ade44e604 --- /dev/null +++ b/docs/_layouts/global.html @@ -0,0 +1,193 @@ + + + + + + + + + + {{ page.title }} - Tachyon {{site.TACHYON_MASTER_VERSION_SHORT}} Documentation + + + + + + + + + + + + + + + + + + + + + + +
+

{{ page.title }}

+ + {{ content }} + + + + + + +
+
+

+ Tachyon is a project developed at the UC Berkeley + + AMPLab + +

+
+ +
+ + + + + + + + + + + diff --git a/docs/css/bootstrap-responsive.min.css b/docs/css/bootstrap-responsive.min.css new file mode 100644 index 000000000000..ab59da3427c7 --- /dev/null +++ b/docs/css/bootstrap-responsive.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap Responsive v2.1.0 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*margin-left:16.98763411529369%}.row-fluid .offset1{margin-left:11.11111111111111%;*margin-left:11.004728132387708%}.row-fluid .offset1:first-child{margin-left:8.547008547008547%;*margin-left:8.440625568285142%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:30px}input.span12,textarea.span12,.uneditable-input.span12{width:1156px}input.span11,textarea.span11,.uneditable-input.span11{width:1056px}input.span10,textarea.span10,.uneditable-input.span10{width:956px}input.span9,textarea.span9,.uneditable-input.span9{width:856px}input.span8,textarea.span8,.uneditable-input.span8{width:756px}input.span7,textarea.span7,.uneditable-input.span7{width:656px}input.span6,textarea.span6,.uneditable-input.span6{width:556px}input.span5,textarea.span5,.uneditable-input.span5{width:456px}input.span4,textarea.span4,.uneditable-input.span4{width:356px}input.span3,textarea.span3,.uneditable-input.span3{width:256px}input.span2,textarea.span2,.uneditable-input.span2{width:156px}input.span1,textarea.span1,.uneditable-input.span1{width:56px}.thumbnails{margin-left:-30px}.thumbnails>li{margin-left:30px}.row-fluid .thumbnails{margin-left:0}}@media(min-width:768px) and (max-width:979px){.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:724px}.span12{width:724px}.span11{width:662px}.span10{width:600px}.span9{width:538px}.span8{width:476px}.span7{width:414px}.span6{width:352px}.span5{width:290px}.span4{width:228px}.span3{width:166px}.span2{width:104px}.span1{width:42px}.offset12{margin-left:764px}.offset11{margin-left:702px}.offset10{margin-left:640px}.offset9{margin-left:578px}.offset8{margin-left:516px}.offset7{margin-left:454px}.offset6{margin-left:392px}.offset5{margin-left:330px}.offset4{margin-left:268px}.offset3{margin-left:206px}.offset2{margin-left:144px}.offset1{margin-left:82px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.7624309392265194%;*margin-left:2.709239449864817%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.43646408839778%;*width:91.38327259903608%}.row-fluid .span10{width:82.87292817679558%;*width:82.81973668743387%}.row-fluid .span9{width:74.30939226519337%;*width:74.25620077583166%}.row-fluid .span8{width:65.74585635359117%;*width:65.69266486422946%}.row-fluid .span7{width:57.18232044198895%;*width:57.12912895262725%}.row-fluid .span6{width:48.61878453038674%;*width:48.56559304102504%}.row-fluid .span5{width:40.05524861878453%;*width:40.00205712942283%}.row-fluid .span4{width:31.491712707182323%;*width:31.43852121782062%}.row-fluid .span3{width:22.92817679558011%;*width:22.87498530621841%}.row-fluid .span2{width:14.3646408839779%;*width:14.311449394616199%}.row-fluid .span1{width:5.801104972375691%;*width:5.747913483013988%}.row-fluid .offset12{margin-left:105.52486187845304%;*margin-left:105.41847889972962%}.row-fluid .offset12:first-child{margin-left:102.76243093922652%;*margin-left:102.6560479605031%}.row-fluid .offset11{margin-left:96.96132596685082%;*margin-left:96.8549429881274%}.row-fluid .offset11:first-child{margin-left:94.1988950276243%;*margin-left:94.09251204890089%}.row-fluid .offset10{margin-left:88.39779005524862%;*margin-left:88.2914070765252%}.row-fluid .offset10:first-child{margin-left:85.6353591160221%;*margin-left:85.52897613729868%}.row-fluid .offset9{margin-left:79.8342541436464%;*margin-left:79.72787116492299%}.row-fluid .offset9:first-child{margin-left:77.07182320441989%;*margin-left:76.96544022569647%}.row-fluid .offset8{margin-left:71.2707182320442%;*margin-left:71.16433525332079%}.row-fluid .offset8:first-child{margin-left:68.50828729281768%;*margin-left:68.40190431409427%}.row-fluid .offset7{margin-left:62.70718232044199%;*margin-left:62.600799341718584%}.row-fluid .offset7:first-child{margin-left:59.94475138121547%;*margin-left:59.838368402492065%}.row-fluid .offset6{margin-left:54.14364640883978%;*margin-left:54.037263430116376%}.row-fluid .offset6:first-child{margin-left:51.38121546961326%;*margin-left:51.27483249088986%}.row-fluid .offset5{margin-left:45.58011049723757%;*margin-left:45.47372751851417%}.row-fluid .offset5:first-child{margin-left:42.81767955801105%;*margin-left:42.71129657928765%}.row-fluid .offset4{margin-left:37.01657458563536%;*margin-left:36.91019160691196%}.row-fluid .offset4:first-child{margin-left:34.25414364640884%;*margin-left:34.14776066768544%}.row-fluid .offset3{margin-left:28.45303867403315%;*margin-left:28.346655695309746%}.row-fluid .offset3:first-child{margin-left:25.69060773480663%;*margin-left:25.584224756083227%}.row-fluid .offset2{margin-left:19.88950276243094%;*margin-left:19.783119783707537%}.row-fluid .offset2:first-child{margin-left:17.12707182320442%;*margin-left:17.02068884448102%}.row-fluid .offset1{margin-left:11.32596685082873%;*margin-left:11.219583872105325%}.row-fluid .offset1:first-child{margin-left:8.56353591160221%;*margin-left:8.457152932878806%}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:710px}input.span11,textarea.span11,.uneditable-input.span11{width:648px}input.span10,textarea.span10,.uneditable-input.span10{width:586px}input.span9,textarea.span9,.uneditable-input.span9{width:524px}input.span8,textarea.span8,.uneditable-input.span8{width:462px}input.span7,textarea.span7,.uneditable-input.span7{width:400px}input.span6,textarea.span6,.uneditable-input.span6{width:338px}input.span5,textarea.span5,.uneditable-input.span5{width:276px}input.span4,textarea.span4,.uneditable-input.span4{width:214px}input.span3,textarea.span3,.uneditable-input.span3{width:152px}input.span2,textarea.span2,.uneditable-input.span2{width:90px}input.span1,textarea.span1,.uneditable-input.span1{width:28px}}@media(max-width:767px){body{padding-right:20px;padding-left:20px}.navbar-fixed-top,.navbar-fixed-bottom{margin-right:-20px;margin-left:-20px}.container-fluid{padding:0}.dl-horizontal dt{float:none;width:auto;clear:none;text-align:left}.dl-horizontal dd{margin-left:0}.container{width:auto}.row-fluid{width:100%}.row,.thumbnails{margin-left:0}.thumbnails>li{float:none;margin-left:0}[class*="span"],.row-fluid [class*="span"]{display:block;float:none;width:auto;margin-left:0}.span12,.row-fluid .span12{width:100%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-large,.input-xlarge,.input-xxlarge,input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.input-prepend input,.input-append input,.input-prepend input[class*="span"],.input-append input[class*="span"]{display:inline-block;width:auto}.modal{position:fixed;top:20px;right:20px;left:20px;width:auto;margin:0}.modal.fade.in{top:auto}}@media(max-width:480px){.nav-collapse{-webkit-transform:translate3d(0,0,0)}.page-header h1 small{display:block;line-height:20px}input[type="checkbox"],input[type="radio"]{border:1px solid #ccc}.form-horizontal .control-group>label{float:none;width:auto;padding-top:0;text-align:left}.form-horizontal .controls{margin-left:0}.form-horizontal .control-list{padding-top:0}.form-horizontal .form-actions{padding-right:10px;padding-left:10px}.modal{top:10px;right:10px;left:10px}.modal-header .close{padding:10px;margin:-10px}.carousel-caption{position:static}}@media(max-width:979px){body{padding-top:0}.navbar-fixed-top,.navbar-fixed-bottom{position:static}.navbar-fixed-top{margin-bottom:20px}.navbar-fixed-bottom{margin-top:20px}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding:5px}.navbar .container{width:auto;padding:0}.navbar .brand{padding-right:10px;padding-left:10px;margin:0 0 0 -5px}.nav-collapse{clear:both}.nav-collapse .nav{float:none;margin:0 0 10px}.nav-collapse .nav>li{float:none}.nav-collapse .nav>li>a{margin-bottom:2px}.nav-collapse .nav>.divider-vertical{display:none}.nav-collapse .nav .nav-header{color:#555;text-shadow:none}.nav-collapse .nav>li>a,.nav-collapse .dropdown-menu a{padding:9px 15px;font-weight:bold;color:#555;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.nav-collapse .btn{padding:4px 10px 4px;font-weight:normal;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.nav-collapse .dropdown-menu li+li a{margin-bottom:2px}.nav-collapse .nav>li>a:hover,.nav-collapse .dropdown-menu a:hover{background-color:#f2f2f2}.navbar-inverse .nav-collapse .nav>li>a:hover,.navbar-inverse .nav-collapse .dropdown-menu a:hover{background-color:#111}.nav-collapse.in .btn-group{padding:0;margin-top:5px}.nav-collapse .dropdown-menu{position:static;top:auto;left:auto;display:block;float:none;max-width:none;padding:0;margin:0 15px;background-color:transparent;border:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.nav-collapse .dropdown-menu:before,.nav-collapse .dropdown-menu:after{display:none}.nav-collapse .dropdown-menu .divider{display:none}.nav-collapse .navbar-form,.nav-collapse .navbar-search{float:none;padding:10px 15px;margin:10px 0;border-top:1px solid #f2f2f2;border-bottom:1px solid #f2f2f2;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.1)}.navbar .nav-collapse .nav.pull-right{float:none;margin-left:0}.nav-collapse,.nav-collapse.collapse{height:0;overflow:hidden}.navbar .btn-navbar{display:block}.navbar-static .navbar-inner{padding-right:10px;padding-left:10px}}@media(min-width:980px){.nav-collapse.collapse{height:auto!important;overflow:visible!important}} diff --git a/docs/css/bootstrap.min.css b/docs/css/bootstrap.min.css new file mode 100644 index 000000000000..30ea440c008e --- /dev/null +++ b/docs/css/bootstrap.min.css @@ -0,0 +1,9 @@ +/*! + * Bootstrap v2.1.0 + * + * Copyright 2012 Twitter, Inc + * Licensed under the Apache License v2.0 + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Designed and built with all the love in the world @twitter by @mdo and @fat. + */article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluid .offset8{margin-left:70.2127659574468%;*margin-left:70.10638297872339%}.row-fluid .offset8:first-child{margin-left:68.08510638297872%;*margin-left:67.9787234042553%}.row-fluid .offset7{margin-left:61.70212765957446%;*margin-left:61.59574468085106%}.row-fluid .offset7:first-child{margin-left:59.574468085106375%;*margin-left:59.46808510638297%}.row-fluid .offset6{margin-left:53.191489361702125%;*margin-left:53.085106382978715%}.row-fluid .offset6:first-child{margin-left:51.063829787234035%;*margin-left:50.95744680851063%}.row-fluid .offset5{margin-left:44.68085106382979%;*margin-left:44.57446808510638%}.row-fluid .offset5:first-child{margin-left:42.5531914893617%;*margin-left:42.4468085106383%}.row-fluid .offset4{margin-left:36.170212765957444%;*margin-left:36.06382978723405%}.row-fluid .offset4:first-child{margin-left:34.04255319148936%;*margin-left:33.93617021276596%}.row-fluid .offset3{margin-left:27.659574468085104%;*margin-left:27.5531914893617%}.row-fluid .offset3:first-child{margin-left:25.53191489361702%;*margin-left:25.425531914893618%}.row-fluid .offset2{margin-left:19.148936170212764%;*margin-left:19.04255319148936%}.row-fluid .offset2:first-child{margin-left:17.02127659574468%;*margin-left:16.914893617021278%}.row-fluid .offset1{margin-left:10.638297872340425%;*margin-left:10.53191489361702%}.row-fluid .offset1:first-child{margin-left:8.51063829787234%;*margin-left:8.404255319148938%}[class*="span"].hide,.row-fluid [class*="span"].hide{display:none}[class*="span"].pull-right,.row-fluid [class*="span"].pull-right{float:right}.container{margin-right:auto;margin-left:auto;*zoom:1}.container:before,.container:after{display:table;line-height:0;content:""}.container:after{clear:both}.container-fluid{padding-right:20px;padding-left:20px;*zoom:1}.container-fluid:before,.container-fluid:after{display:table;line-height:0;content:""}.container-fluid:after{clear:both}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:20px;font-weight:200;line-height:30px}small{font-size:85%}strong{font-weight:bold}em{font-style:italic}cite{font-style:normal}.muted{color:#999}h1,h2,h3,h4,h5,h6{margin:10px 0;font-family:inherit;font-weight:bold;line-height:1;color:inherit;text-rendering:optimizelegibility}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small{font-weight:normal;line-height:1;color:#999}h1{font-size:36px;line-height:40px}h2{font-size:30px;line-height:40px}h3{font-size:24px;line-height:40px}h4{font-size:18px;line-height:20px}h5{font-size:14px;line-height:20px}h6{font-size:12px;line-height:20px}h1 small{font-size:24px}h2 small{font-size:18px}h3 small{font-size:14px}h4 small{font-size:14px}.page-header{padding-bottom:9px;margin:20px 0 30px;border-bottom:1px solid #eee}ul,ol{padding:0;margin:0 0 10px 25px}ul ul,ul ol,ol ol,ol ul{margin-bottom:0}li{line-height:20px}ul.unstyled,ol.unstyled{margin-left:0;list-style:none}dl{margin-bottom:20px}dt,dd{line-height:20px}dt{font-weight:bold}dd{margin-left:10px}.dl-horizontal dt{float:left;width:120px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:130px}hr{margin:20px 0;border:0;border-top:1px solid #eee;border-bottom:1px solid #fff}abbr[title]{cursor:help;border-bottom:1px dotted #999}abbr.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:0 0 0 15px;margin:0 0 20px;border-left:5px solid #eee}blockquote p{margin-bottom:0;font-size:16px;font-weight:300;line-height:25px}blockquote small{display:block;line-height:20px;color:#999}blockquote small:before{content:'\2014 \00A0'}blockquote.pull-right{float:right;padding-right:15px;padding-left:0;border-right:5px solid #eee;border-left:0}blockquote.pull-right p,blockquote.pull-right small{text-align:right}blockquote.pull-right small:before{content:''}blockquote.pull-right small:after{content:'\00A0 \2014'}q:before,q:after,blockquote:before,blockquote:after{content:""}address{display:block;margin-bottom:20px;font-style:normal;line-height:20px}code,pre{padding:0 3px 2px;font-family:Monaco,Menlo,Consolas,"Courier New",monospace;font-size:12px;color:#333;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}code{padding:2px 4px;color:#d14;background-color:#f7f7f9;border:1px solid #e1e1e8}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre;white-space:pre-wrap;background-color:#f5f5f5;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.15);-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}pre.prettyprint{margin-bottom:20px}pre code{padding:0;color:inherit;background-color:transparent;border:0}.pre-scrollable{max-height:340px;overflow-y:scroll}form{margin:0 0 20px}fieldset{padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:40px;color:#333;border:0;border-bottom:1px solid #e5e5e5}legend small{font-size:15px;color:#999}label,input,button,select,textarea{font-size:14px;font-weight:normal;line-height:20px}input,button,select,textarea{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}label{display:block;margin-bottom:5px}select,textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{display:inline-block;height:20px;padding:4px 6px;margin-bottom:9px;font-size:14px;line-height:20px;color:#555;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}input,textarea{width:210px}textarea{height:auto}textarea,input[type="text"],input[type="password"],input[type="datetime"],input[type="datetime-local"],input[type="date"],input[type="month"],input[type="time"],input[type="week"],input[type="number"],input[type="email"],input[type="url"],input[type="search"],input[type="tel"],input[type="color"],.uneditable-input{background-color:#fff;border:1px solid #ccc;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-webkit-transition:border linear .2s,box-shadow linear .2s;-moz-transition:border linear .2s,box-shadow linear .2s;-o-transition:border linear .2s,box-shadow linear .2s;transition:border linear .2s,box-shadow linear .2s}textarea:focus,input[type="text"]:focus,input[type="password"]:focus,input[type="datetime"]:focus,input[type="datetime-local"]:focus,input[type="date"]:focus,input[type="month"]:focus,input[type="time"]:focus,input[type="week"]:focus,input[type="number"]:focus,input[type="email"]:focus,input[type="url"]:focus,input[type="search"]:focus,input[type="tel"]:focus,input[type="color"]:focus,.uneditable-input:focus{border-color:rgba(82,168,236,0.8);outline:0;outline:thin dotted \9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 8px rgba(82,168,236,0.6)}input[type="radio"],input[type="checkbox"]{margin:4px 0 0;margin-top:1px \9;*margin-top:0;line-height:normal;cursor:pointer}input[type="file"],input[type="image"],input[type="submit"],input[type="reset"],input[type="button"],input[type="radio"],input[type="checkbox"]{width:auto}select,input[type="file"]{height:30px;*margin-top:4px;line-height:30px}select{width:220px;background-color:#fff;border:1px solid #bbb}select[multiple],select[size]{height:auto}select:focus,input[type="file"]:focus,input[type="radio"]:focus,input[type="checkbox"]:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.uneditable-input,.uneditable-textarea{color:#999;cursor:not-allowed;background-color:#fcfcfc;border-color:#ccc;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.025);box-shadow:inset 0 1px 2px rgba(0,0,0,0.025)}.uneditable-input{overflow:hidden;white-space:nowrap}.uneditable-textarea{width:auto;height:auto}input:-moz-placeholder,textarea:-moz-placeholder{color:#999}input:-ms-input-placeholder,textarea:-ms-input-placeholder{color:#999}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#999}.radio,.checkbox{min-height:18px;padding-left:18px}.radio input[type="radio"],.checkbox input[type="checkbox"]{float:left;margin-left:-18px}.controls>.radio:first-child,.controls>.checkbox:first-child{padding-top:5px}.radio.inline,.checkbox.inline{display:inline-block;padding-top:5px;margin-bottom:0;vertical-align:middle}.radio.inline+.radio.inline,.checkbox.inline+.checkbox.inline{margin-left:10px}.input-mini{width:60px}.input-small{width:90px}.input-medium{width:150px}.input-large{width:210px}.input-xlarge{width:270px}.input-xxlarge{width:530px}input[class*="span"],select[class*="span"],textarea[class*="span"],.uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"]{float:none;margin-left:0}.input-append input[class*="span"],.input-append .uneditable-input[class*="span"],.input-prepend input[class*="span"],.input-prepend .uneditable-input[class*="span"],.row-fluid input[class*="span"],.row-fluid select[class*="span"],.row-fluid textarea[class*="span"],.row-fluid .uneditable-input[class*="span"],.row-fluid .input-prepend [class*="span"],.row-fluid .input-append [class*="span"]{display:inline-block}input,textarea,.uneditable-input{margin-left:0}.controls-row [class*="span"]+[class*="span"]{margin-left:20px}input.span12,textarea.span12,.uneditable-input.span12{width:926px}input.span11,textarea.span11,.uneditable-input.span11{width:846px}input.span10,textarea.span10,.uneditable-input.span10{width:766px}input.span9,textarea.span9,.uneditable-input.span9{width:686px}input.span8,textarea.span8,.uneditable-input.span8{width:606px}input.span7,textarea.span7,.uneditable-input.span7{width:526px}input.span6,textarea.span6,.uneditable-input.span6{width:446px}input.span5,textarea.span5,.uneditable-input.span5{width:366px}input.span4,textarea.span4,.uneditable-input.span4{width:286px}input.span3,textarea.span3,.uneditable-input.span3{width:206px}input.span2,textarea.span2,.uneditable-input.span2{width:126px}input.span1,textarea.span1,.uneditable-input.span1{width:46px}.controls-row{*zoom:1}.controls-row:before,.controls-row:after{display:table;line-height:0;content:""}.controls-row:after{clear:both}.controls-row [class*="span"]{float:left}input[disabled],select[disabled],textarea[disabled],input[readonly],select[readonly],textarea[readonly]{cursor:not-allowed;background-color:#eee}input[type="radio"][disabled],input[type="checkbox"][disabled],input[type="radio"][readonly],input[type="checkbox"][readonly]{background-color:transparent}.control-group.warning>label,.control-group.warning .help-block,.control-group.warning .help-inline{color:#c09853}.control-group.warning .checkbox,.control-group.warning .radio,.control-group.warning input,.control-group.warning select,.control-group.warning textarea{color:#c09853;border-color:#c09853;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.warning .checkbox:focus,.control-group.warning .radio:focus,.control-group.warning input:focus,.control-group.warning select:focus,.control-group.warning textarea:focus{border-color:#a47e3c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #dbc59e}.control-group.warning .input-prepend .add-on,.control-group.warning .input-append .add-on{color:#c09853;background-color:#fcf8e3;border-color:#c09853}.control-group.error>label,.control-group.error .help-block,.control-group.error .help-inline{color:#b94a48}.control-group.error .checkbox,.control-group.error .radio,.control-group.error input,.control-group.error select,.control-group.error textarea{color:#b94a48;border-color:#b94a48;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.error .checkbox:focus,.control-group.error .radio:focus,.control-group.error input:focus,.control-group.error select:focus,.control-group.error textarea:focus{border-color:#953b39;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #d59392}.control-group.error .input-prepend .add-on,.control-group.error .input-append .add-on{color:#b94a48;background-color:#f2dede;border-color:#b94a48}.control-group.success>label,.control-group.success .help-block,.control-group.success .help-inline{color:#468847}.control-group.success .checkbox,.control-group.success .radio,.control-group.success input,.control-group.success select,.control-group.success textarea{color:#468847;border-color:#468847;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075);box-shadow:inset 0 1px 1px rgba(0,0,0,0.075)}.control-group.success .checkbox:focus,.control-group.success .radio:focus,.control-group.success input:focus,.control-group.success select:focus,.control-group.success textarea:focus{border-color:#356635;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b;box-shadow:inset 0 1px 1px rgba(0,0,0,0.075),0 0 6px #7aba7b}.control-group.success .input-prepend .add-on,.control-group.success .input-append .add-on{color:#468847;background-color:#dff0d8;border-color:#468847}input:focus:required:invalid,textarea:focus:required:invalid,select:focus:required:invalid{color:#b94a48;border-color:#ee5f5b}input:focus:required:invalid:focus,textarea:focus:required:invalid:focus,select:focus:required:invalid:focus{border-color:#e9322d;-webkit-box-shadow:0 0 6px #f8b9b7;-moz-box-shadow:0 0 6px #f8b9b7;box-shadow:0 0 6px #f8b9b7}.form-actions{padding:19px 20px 20px;margin-top:20px;margin-bottom:20px;background-color:#f5f5f5;border-top:1px solid #e5e5e5;*zoom:1}.form-actions:before,.form-actions:after{display:table;line-height:0;content:""}.form-actions:after{clear:both}.help-block,.help-inline{color:#595959}.help-block{display:block;margin-bottom:10px}.help-inline{display:inline-block;*display:inline;padding-left:5px;vertical-align:middle;*zoom:1}.input-append,.input-prepend{margin-bottom:5px;font-size:0;white-space:nowrap}.input-append input,.input-prepend input,.input-append select,.input-prepend select,.input-append .uneditable-input,.input-prepend .uneditable-input{position:relative;margin-bottom:0;*margin-left:0;font-size:14px;vertical-align:top;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.input-append input:focus,.input-prepend input:focus,.input-append select:focus,.input-prepend select:focus,.input-append .uneditable-input:focus,.input-prepend .uneditable-input:focus{z-index:2}.input-append .add-on,.input-prepend .add-on{display:inline-block;width:auto;height:20px;min-width:16px;padding:4px 5px;font-size:14px;font-weight:normal;line-height:20px;text-align:center;text-shadow:0 1px 0 #fff;background-color:#eee;border:1px solid #ccc}.input-append .add-on,.input-prepend .add-on,.input-append .btn,.input-prepend .btn{margin-left:-1px;vertical-align:top;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-append .active,.input-prepend .active{background-color:#a9dba9;border-color:#46a546}.input-prepend .add-on,.input-prepend .btn{margin-right:-1px}.input-prepend .add-on:first-child,.input-prepend .btn:first-child{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.input-append input,.input-append select,.input-append .uneditable-input{-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.input-append .add-on:last-child,.input-append .btn:last-child{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.input-prepend.input-append input,.input-prepend.input-append select,.input-prepend.input-append .uneditable-input{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.input-prepend.input-append .add-on:first-child,.input-prepend.input-append .btn:first-child{margin-right:-1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.input-prepend.input-append .add-on:last-child,.input-prepend.input-append .btn:last-child{margin-left:-1px;-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}input.search-query{padding-right:14px;padding-right:4px \9;padding-left:14px;padding-left:4px \9;margin-bottom:0;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.form-search .input-append .search-query,.form-search .input-prepend .search-query{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.form-search .input-append .search-query{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search .input-append .btn{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .search-query{-webkit-border-radius:0 14px 14px 0;-moz-border-radius:0 14px 14px 0;border-radius:0 14px 14px 0}.form-search .input-prepend .btn{-webkit-border-radius:14px 0 0 14px;-moz-border-radius:14px 0 0 14px;border-radius:14px 0 0 14px}.form-search input,.form-inline input,.form-horizontal input,.form-search textarea,.form-inline textarea,.form-horizontal textarea,.form-search select,.form-inline select,.form-horizontal select,.form-search .help-inline,.form-inline .help-inline,.form-horizontal .help-inline,.form-search .uneditable-input,.form-inline .uneditable-input,.form-horizontal .uneditable-input,.form-search .input-prepend,.form-inline .input-prepend,.form-horizontal .input-prepend,.form-search .input-append,.form-inline .input-append,.form-horizontal .input-append{display:inline-block;*display:inline;margin-bottom:0;vertical-align:middle;*zoom:1}.form-search .hide,.form-inline .hide,.form-horizontal .hide{display:none}.form-search label,.form-inline label,.form-search .btn-group,.form-inline .btn-group{display:inline-block}.form-search .input-append,.form-inline .input-append,.form-search .input-prepend,.form-inline .input-prepend{margin-bottom:0}.form-search .radio,.form-search .checkbox,.form-inline .radio,.form-inline .checkbox{padding-left:0;margin-bottom:0;vertical-align:middle}.form-search .radio input[type="radio"],.form-search .checkbox input[type="checkbox"],.form-inline .radio input[type="radio"],.form-inline .checkbox input[type="checkbox"]{float:left;margin-right:3px;margin-left:0}.control-group{margin-bottom:10px}legend+.control-group{margin-top:20px;-webkit-margin-top-collapse:separate}.form-horizontal .control-group{margin-bottom:20px;*zoom:1}.form-horizontal .control-group:before,.form-horizontal .control-group:after{display:table;line-height:0;content:""}.form-horizontal .control-group:after{clear:both}.form-horizontal .control-label{float:left;width:140px;padding-top:5px;text-align:right}.form-horizontal .controls{*display:inline-block;*padding-left:20px;margin-left:160px;*margin-left:0}.form-horizontal .controls:first-child{*padding-left:160px}.form-horizontal .help-block{margin-top:10px;margin-bottom:0}.form-horizontal .form-actions{padding-left:160px}table{max-width:100%;background-color:transparent;border-collapse:collapse;border-spacing:0}.table{width:100%;margin-bottom:20px}.table th,.table td{padding:8px;line-height:20px;text-align:left;vertical-align:top;border-top:1px solid #ddd}.table th{font-weight:bold}.table thead th{vertical-align:bottom}.table caption+thead tr:first-child th,.table caption+thead tr:first-child td,.table colgroup+thead tr:first-child th,.table colgroup+thead tr:first-child td,.table thead:first-child tr:first-child th,.table thead:first-child tr:first-child td{border-top:0}.table tbody+tbody{border-top:2px solid #ddd}.table-condensed th,.table-condensed td{padding:4px 5px}.table-bordered{border:1px solid #ddd;border-collapse:separate;*border-collapse:collapse;border-left:0;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.table-bordered th,.table-bordered td{border-left:1px solid #ddd}.table-bordered caption+thead tr:first-child th,.table-bordered caption+tbody tr:first-child th,.table-bordered caption+tbody tr:first-child td,.table-bordered colgroup+thead tr:first-child th,.table-bordered colgroup+tbody tr:first-child th,.table-bordered colgroup+tbody tr:first-child td,.table-bordered thead:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child th,.table-bordered tbody:first-child tr:first-child td{border-top:0}.table-bordered thead:first-child tr:first-child th:first-child,.table-bordered tbody:first-child tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered thead:first-child tr:first-child th:last-child,.table-bordered tbody:first-child tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-radius-topright:4px}.table-bordered thead:last-child tr:last-child th:first-child,.table-bordered tbody:last-child tr:last-child td:first-child,.table-bordered tfoot:last-child tr:last-child td:first-child{-webkit-border-radius:0 0 0 4px;-moz-border-radius:0 0 0 4px;border-radius:0 0 0 4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomleft:4px}.table-bordered thead:last-child tr:last-child th:last-child,.table-bordered tbody:last-child tr:last-child td:last-child,.table-bordered tfoot:last-child tr:last-child td:last-child{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-bottomright:4px}.table-bordered caption+thead tr:first-child th:first-child,.table-bordered caption+tbody tr:first-child td:first-child,.table-bordered colgroup+thead tr:first-child th:first-child,.table-bordered colgroup+tbody tr:first-child td:first-child{-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topleft:4px}.table-bordered caption+thead tr:first-child th:last-child,.table-bordered caption+tbody tr:first-child td:last-child,.table-bordered colgroup+thead tr:first-child th:last-child,.table-bordered colgroup+tbody tr:first-child td:last-child{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-moz-border-right-topleft:4px}.table-striped tbody tr:nth-child(odd) td,.table-striped tbody tr:nth-child(odd) th{background-color:#f9f9f9}.table-hover tbody tr:hover td,.table-hover tbody tr:hover th{background-color:#f5f5f5}table [class*=span],.row-fluid table [class*=span]{display:table-cell;float:none;margin-left:0}table .span1{float:none;width:44px;margin-left:0}table .span2{float:none;width:124px;margin-left:0}table .span3{float:none;width:204px;margin-left:0}table .span4{float:none;width:284px;margin-left:0}table .span5{float:none;width:364px;margin-left:0}table .span6{float:none;width:444px;margin-left:0}table .span7{float:none;width:524px;margin-left:0}table .span8{float:none;width:604px;margin-left:0}table .span9{float:none;width:684px;margin-left:0}table .span10{float:none;width:764px;margin-left:0}table .span11{float:none;width:844px;margin-left:0}table .span12{float:none;width:924px;margin-left:0}table .span13{float:none;width:1004px;margin-left:0}table .span14{float:none;width:1084px;margin-left:0}table .span15{float:none;width:1164px;margin-left:0}table .span16{float:none;width:1244px;margin-left:0}table .span17{float:none;width:1324px;margin-left:0}table .span18{float:none;width:1404px;margin-left:0}table .span19{float:none;width:1484px;margin-left:0}table .span20{float:none;width:1564px;margin-left:0}table .span21{float:none;width:1644px;margin-left:0}table .span22{float:none;width:1724px;margin-left:0}table .span23{float:none;width:1804px;margin-left:0}table .span24{float:none;width:1884px;margin-left:0}.table tbody tr.success td{background-color:#dff0d8}.table tbody tr.error td{background-color:#f2dede}.table tbody tr.info td{background-color:#d9edf7}[class^="icon-"],[class*=" icon-"]{display:inline-block;width:14px;height:14px;margin-top:1px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("../img/glyphicons-halflings.png");background-position:14px 14px;background-repeat:no-repeat}.icon-white,.nav>.active>a>[class^="icon-"],.nav>.active>a>[class*=" icon-"],.dropdown-menu>li>a:hover>[class^="icon-"],.dropdown-menu>li>a:hover>[class*=" icon-"],.dropdown-menu>.active>a>[class^="icon-"],.dropdown-menu>.active>a>[class*=" icon-"]{background-image:url("../img/glyphicons-halflings-white.png")}.icon-glass{background-position:0 0}.icon-music{background-position:-24px 0}.icon-search{background-position:-48px 0}.icon-envelope{background-position:-72px 0}.icon-heart{background-position:-96px 0}.icon-star{background-position:-120px 0}.icon-star-empty{background-position:-144px 0}.icon-user{background-position:-168px 0}.icon-film{background-position:-192px 0}.icon-th-large{background-position:-216px 0}.icon-th{background-position:-240px 0}.icon-th-list{background-position:-264px 0}.icon-ok{background-position:-288px 0}.icon-remove{background-position:-312px 0}.icon-zoom-in{background-position:-336px 0}.icon-zoom-out{background-position:-360px 0}.icon-off{background-position:-384px 0}.icon-signal{background-position:-408px 0}.icon-cog{background-position:-432px 0}.icon-trash{background-position:-456px 0}.icon-home{background-position:0 -24px}.icon-file{background-position:-24px -24px}.icon-time{background-position:-48px -24px}.icon-road{background-position:-72px -24px}.icon-download-alt{background-position:-96px -24px}.icon-download{background-position:-120px -24px}.icon-upload{background-position:-144px -24px}.icon-inbox{background-position:-168px -24px}.icon-play-circle{background-position:-192px -24px}.icon-repeat{background-position:-216px -24px}.icon-refresh{background-position:-240px -24px}.icon-list-alt{background-position:-264px -24px}.icon-lock{background-position:-287px -24px}.icon-flag{background-position:-312px -24px}.icon-headphones{background-position:-336px -24px}.icon-volume-off{background-position:-360px -24px}.icon-volume-down{background-position:-384px -24px}.icon-volume-up{background-position:-408px -24px}.icon-qrcode{background-position:-432px -24px}.icon-barcode{background-position:-456px -24px}.icon-tag{background-position:0 -48px}.icon-tags{background-position:-25px -48px}.icon-book{background-position:-48px -48px}.icon-bookmark{background-position:-72px -48px}.icon-print{background-position:-96px -48px}.icon-camera{background-position:-120px -48px}.icon-font{background-position:-144px -48px}.icon-bold{background-position:-167px -48px}.icon-italic{background-position:-192px -48px}.icon-text-height{background-position:-216px -48px}.icon-text-width{background-position:-240px -48px}.icon-align-left{background-position:-264px -48px}.icon-align-center{background-position:-288px -48px}.icon-align-right{background-position:-312px -48px}.icon-align-justify{background-position:-336px -48px}.icon-list{background-position:-360px -48px}.icon-indent-left{background-position:-384px -48px}.icon-indent-right{background-position:-408px -48px}.icon-facetime-video{background-position:-432px -48px}.icon-picture{background-position:-456px -48px}.icon-pencil{background-position:0 -72px}.icon-map-marker{background-position:-24px -72px}.icon-adjust{background-position:-48px -72px}.icon-tint{background-position:-72px -72px}.icon-edit{background-position:-96px -72px}.icon-share{background-position:-120px -72px}.icon-check{background-position:-144px -72px}.icon-move{background-position:-168px -72px}.icon-step-backward{background-position:-192px -72px}.icon-fast-backward{background-position:-216px -72px}.icon-backward{background-position:-240px -72px}.icon-play{background-position:-264px -72px}.icon-pause{background-position:-288px -72px}.icon-stop{background-position:-312px -72px}.icon-forward{background-position:-336px -72px}.icon-fast-forward{background-position:-360px -72px}.icon-step-forward{background-position:-384px -72px}.icon-eject{background-position:-408px -72px}.icon-chevron-left{background-position:-432px -72px}.icon-chevron-right{background-position:-456px -72px}.icon-plus-sign{background-position:0 -96px}.icon-minus-sign{background-position:-24px -96px}.icon-remove-sign{background-position:-48px -96px}.icon-ok-sign{background-position:-72px -96px}.icon-question-sign{background-position:-96px -96px}.icon-info-sign{background-position:-120px -96px}.icon-screenshot{background-position:-144px -96px}.icon-remove-circle{background-position:-168px -96px}.icon-ok-circle{background-position:-192px -96px}.icon-ban-circle{background-position:-216px -96px}.icon-arrow-left{background-position:-240px -96px}.icon-arrow-right{background-position:-264px -96px}.icon-arrow-up{background-position:-289px -96px}.icon-arrow-down{background-position:-312px -96px}.icon-share-alt{background-position:-336px -96px}.icon-resize-full{background-position:-360px -96px}.icon-resize-small{background-position:-384px -96px}.icon-plus{background-position:-408px -96px}.icon-minus{background-position:-433px -96px}.icon-asterisk{background-position:-456px -96px}.icon-exclamation-sign{background-position:0 -120px}.icon-gift{background-position:-24px -120px}.icon-leaf{background-position:-48px -120px}.icon-fire{background-position:-72px -120px}.icon-eye-open{background-position:-96px -120px}.icon-eye-close{background-position:-120px -120px}.icon-warning-sign{background-position:-144px -120px}.icon-plane{background-position:-168px -120px}.icon-calendar{background-position:-192px -120px}.icon-random{width:16px;background-position:-216px -120px}.icon-comment{background-position:-240px -120px}.icon-magnet{background-position:-264px -120px}.icon-chevron-up{background-position:-288px -120px}.icon-chevron-down{background-position:-313px -119px}.icon-retweet{background-position:-336px -120px}.icon-shopping-cart{background-position:-360px -120px}.icon-folder-close{background-position:-384px -120px}.icon-folder-open{width:16px;background-position:-408px -120px}.icon-resize-vertical{background-position:-432px -119px}.icon-resize-horizontal{background-position:-456px -118px}.icon-hdd{background-position:0 -144px}.icon-bullhorn{background-position:-24px -144px}.icon-bell{background-position:-48px -144px}.icon-certificate{background-position:-72px -144px}.icon-thumbs-up{background-position:-96px -144px}.icon-thumbs-down{background-position:-120px -144px}.icon-hand-right{background-position:-144px -144px}.icon-hand-left{background-position:-168px -144px}.icon-hand-up{background-position:-192px -144px}.icon-hand-down{background-position:-216px -144px}.icon-circle-arrow-right{background-position:-240px -144px}.icon-circle-arrow-left{background-position:-264px -144px}.icon-circle-arrow-up{background-position:-288px -144px}.icon-circle-arrow-down{background-position:-312px -144px}.icon-globe{background-position:-336px -144px}.icon-wrench{background-position:-360px -144px}.icon-tasks{background-position:-384px -144px}.icon-filter{background-position:-408px -144px}.icon-briefcase{background-position:-432px -144px}.icon-fullscreen{background-position:-456px -144px}.dropup,.dropdown{position:relative}.dropdown-toggle{*margin-bottom:-3px}.dropdown-toggle:active,.open .dropdown-toggle{outline:0}.caret{display:inline-block;width:0;height:0;vertical-align:top;border-top:4px solid #000;border-right:4px solid transparent;border-left:4px solid transparent;content:""}.dropdown .caret{margin-top:8px;margin-left:2px}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;list-style:none;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);*border-right-width:2px;*border-bottom-width:2px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.dropdown-menu a{display:block;padding:3px 20px;clear:both;font-weight:normal;line-height:20px;color:#333;white-space:nowrap}.dropdown-menu li>a:hover,.dropdown-menu li>a:focus,.dropdown-submenu:hover>a{color:#fff;text-decoration:none;background-color:#0088cc;background-color:#0088cc;background-image:-moz-linear-gradient(top,#0088cc,#0087b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#0088cc),to(#0087b3));background-image:-webkit-linear-gradient(top,#0088cc,#0087b3);background-image:-o-linear-gradient(top,#0088cc,#0087b3);background-image:linear-gradient(to bottom,#0088cc,#0087b3);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0087b3',GradientType=0)}.dropdown-menu .active>a,.dropdown-menu .active>a:hover{color:#fff;text-decoration:none;background-color:#0088cc;background-color:#0081c2;background-image:linear-gradient(to bottom,#0088cc,#0087b3);background-image:-moz-linear-gradient(top,#0088cc,#0087b3);background-image:-webkit-gradient(linear,0 0,0 100%,from(#0088cc),to(#0087b3));background-image:-webkit-linear-gradient(top,#0088cc,#0087b3);background-image:-o-linear-gradient(top,#0088cc,#0087b3);background-repeat:repeat-x;outline:0;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0087b3',GradientType=0)}.dropdown-menu .disabled>a,.dropdown-menu .disabled>a:hover{color:#999}.dropdown-menu .disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.open{*z-index:1000}.open>.dropdown-menu{display:block}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{border-top:0;border-bottom:4px solid #000;content:"\2191"}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}.dropdown-submenu{position:relative}.dropdown-submenu>.dropdown-menu{top:0;left:100%;margin-top:-6px;margin-left:-1px;-webkit-border-radius:0 6px 6px 6px;-moz-border-radius:0 6px 6px 6px;border-radius:0 6px 6px 6px}.dropdown-submenu:hover .dropdown-menu{display:block}.dropdown-submenu>a:after{display:block;float:right;width:0;height:0;margin-top:5px;margin-right:-10px;border-color:transparent;border-left-color:#ccc;border-style:solid;border-width:5px 0 5px 5px;content:" "}.dropdown-submenu:hover>a:after{border-left-color:#fff}.dropdown .dropdown-menu .nav-header{padding-right:20px;padding-left:20px}.typeahead{margin-top:2px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 1px rgba(0,0,0,0.05);box-shadow:inset 0 1px 1px rgba(0,0,0,0.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,0.15)}.well-large{padding:24px;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.well-small{padding:9px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.fade{opacity:0;-webkit-transition:opacity .15s linear;-moz-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{position:relative;height:0;overflow:hidden;overflow:visible \9;-webkit-transition:height .35s ease;-moz-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.collapse.in{height:auto}.close{float:right;font-size:20px;font-weight:bold;line-height:20px;color:#000;text-shadow:0 1px 0 #fff;opacity:.2;filter:alpha(opacity=20)}.close:hover{color:#000;text-decoration:none;cursor:pointer;opacity:.4;filter:alpha(opacity=40)}button.close{padding:0;cursor:pointer;background:transparent;border:0;-webkit-appearance:none}.btn{display:inline-block;*display:inline;padding:4px 14px;margin-bottom:0;*margin-left:.3em;font-size:14px;line-height:20px;*line-height:20px;color:#333;text-align:center;text-shadow:0 1px 1px rgba(255,255,255,0.75);vertical-align:middle;cursor:pointer;background-color:#f5f5f5;*background-color:#e6e6e6;background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#e6e6e6));background-image:-webkit-linear-gradient(top,#fff,#e6e6e6);background-image:-o-linear-gradient(top,#fff,#e6e6e6);background-image:linear-gradient(to bottom,#fff,#e6e6e6);background-image:-moz-linear-gradient(top,#fff,#e6e6e6);background-repeat:repeat-x;border:1px solid #bbb;*border:0;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);border-color:#e6e6e6 #e6e6e6 #bfbfbf;border-bottom-color:#a2a2a2;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffffffff',endColorstr='#ffe6e6e6',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false);*zoom:1;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn:hover,.btn:active,.btn.active,.btn.disabled,.btn[disabled]{color:#333;background-color:#e6e6e6;*background-color:#d9d9d9}.btn:active,.btn.active{background-color:#ccc \9}.btn:first-child{*margin-left:0}.btn:hover{color:#333;text-decoration:none;background-color:#e6e6e6;*background-color:#d9d9d9;background-position:0 -15px;-webkit-transition:background-position .1s linear;-moz-transition:background-position .1s linear;-o-transition:background-position .1s linear;transition:background-position .1s linear}.btn:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn.active,.btn:active{background-color:#e6e6e6;background-color:#d9d9d9 \9;background-image:none;outline:0;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn.disabled,.btn[disabled]{cursor:default;background-color:#e6e6e6;background-image:none;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-large{padding:9px 14px;font-size:16px;line-height:normal;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.btn-large [class^="icon-"]{margin-top:2px}.btn-small{padding:3px 9px;font-size:12px;line-height:18px}.btn-small [class^="icon-"]{margin-top:0}.btn-mini{padding:2px 6px;font-size:11px;line-height:16px}.btn-block{display:block;width:100%;padding-right:0;padding-left:0;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.btn-block+.btn-block{margin-top:5px}.btn-primary.active,.btn-warning.active,.btn-danger.active,.btn-success.active,.btn-info.active,.btn-inverse.active{color:rgba(255,255,255,0.75)}.btn{border-color:#c5c5c5;border-color:rgba(0,0,0,0.15) rgba(0,0,0,0.15) rgba(0,0,0,0.25)}.btn-primary{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#006dcc;*background-color:#04c;background-image:-webkit-gradient(linear,0 0,0 100%,from(#08c),to(#04c));background-image:-webkit-linear-gradient(top,#08c,#04c);background-image:-o-linear-gradient(top,#08c,#04c);background-image:linear-gradient(to bottom,#08c,#04c);background-image:-moz-linear-gradient(top,#08c,#04c);background-repeat:repeat-x;border-color:#04c #04c #002a80;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff0088cc',endColorstr='#ff0044cc',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-primary:hover,.btn-primary:active,.btn-primary.active,.btn-primary.disabled,.btn-primary[disabled]{color:#fff;background-color:#04c;*background-color:#003bb3}.btn-primary:active,.btn-primary.active{background-color:#039 \9}.btn-warning{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#faa732;*background-color:#f89406;background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-repeat:repeat-x;border-color:#f89406 #f89406 #ad6704;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-warning:hover,.btn-warning:active,.btn-warning.active,.btn-warning.disabled,.btn-warning[disabled]{color:#fff;background-color:#f89406;*background-color:#df8505}.btn-warning:active,.btn-warning.active{background-color:#c67605 \9}.btn-danger{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#da4f49;*background-color:#bd362f;background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#bd362f));background-image:-webkit-linear-gradient(top,#ee5f5b,#bd362f);background-image:-o-linear-gradient(top,#ee5f5b,#bd362f);background-image:linear-gradient(to bottom,#ee5f5b,#bd362f);background-image:-moz-linear-gradient(top,#ee5f5b,#bd362f);background-repeat:repeat-x;border-color:#bd362f #bd362f #802420;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffbd362f',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-danger:hover,.btn-danger:active,.btn-danger.active,.btn-danger.disabled,.btn-danger[disabled]{color:#fff;background-color:#bd362f;*background-color:#a9302a}.btn-danger:active,.btn-danger.active{background-color:#942a25 \9}.btn-success{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#5bb75b;*background-color:#51a351;background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#51a351));background-image:-webkit-linear-gradient(top,#62c462,#51a351);background-image:-o-linear-gradient(top,#62c462,#51a351);background-image:linear-gradient(to bottom,#62c462,#51a351);background-image:-moz-linear-gradient(top,#62c462,#51a351);background-repeat:repeat-x;border-color:#51a351 #51a351 #387038;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff51a351',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-success:hover,.btn-success:active,.btn-success.active,.btn-success.disabled,.btn-success[disabled]{color:#fff;background-color:#51a351;*background-color:#499249}.btn-success:active,.btn-success.active{background-color:#408140 \9}.btn-info{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#49afcd;*background-color:#2f96b4;background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#2f96b4));background-image:-webkit-linear-gradient(top,#5bc0de,#2f96b4);background-image:-o-linear-gradient(top,#5bc0de,#2f96b4);background-image:linear-gradient(to bottom,#5bc0de,#2f96b4);background-image:-moz-linear-gradient(top,#5bc0de,#2f96b4);background-repeat:repeat-x;border-color:#2f96b4 #2f96b4 #1f6377;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff2f96b4',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-info:hover,.btn-info:active,.btn-info.active,.btn-info.disabled,.btn-info[disabled]{color:#fff;background-color:#2f96b4;*background-color:#2a85a0}.btn-info:active,.btn-info.active{background-color:#24748c \9}.btn-inverse{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#363636;*background-color:#222;background-image:-webkit-gradient(linear,0 0,0 100%,from(#444),to(#222));background-image:-webkit-linear-gradient(top,#444,#222);background-image:-o-linear-gradient(top,#444,#222);background-image:linear-gradient(to bottom,#444,#222);background-image:-moz-linear-gradient(top,#444,#222);background-repeat:repeat-x;border-color:#222 #222 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff444444',endColorstr='#ff222222',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.btn-inverse:hover,.btn-inverse:active,.btn-inverse.active,.btn-inverse.disabled,.btn-inverse[disabled]{color:#fff;background-color:#222;*background-color:#151515}.btn-inverse:active,.btn-inverse.active{background-color:#080808 \9}button.btn,input[type="submit"].btn{*padding-top:3px;*padding-bottom:3px}button.btn::-moz-focus-inner,input[type="submit"].btn::-moz-focus-inner{padding:0;border:0}button.btn.btn-large,input[type="submit"].btn.btn-large{*padding-top:7px;*padding-bottom:7px}button.btn.btn-small,input[type="submit"].btn.btn-small{*padding-top:3px;*padding-bottom:3px}button.btn.btn-mini,input[type="submit"].btn.btn-mini{*padding-top:1px;*padding-bottom:1px}.btn-link,.btn-link:active{background-color:transparent;background-image:none;-webkit-box-shadow:none;-moz-box-shadow:none;box-shadow:none}.btn-link{color:#08c;cursor:pointer;border-color:transparent;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-link:hover{color:#005580;text-decoration:underline;background-color:transparent}.btn-group{position:relative;*margin-left:.3em;font-size:0;white-space:nowrap}.btn-group:first-child{*margin-left:0}.btn-group+.btn-group{margin-left:5px}.btn-toolbar{margin-top:10px;margin-bottom:10px;font-size:0}.btn-toolbar .btn-group{display:inline-block;*display:inline;*zoom:1}.btn-toolbar .btn+.btn,.btn-toolbar .btn-group+.btn,.btn-toolbar .btn+.btn-group{margin-left:5px}.btn-group>.btn{position:relative;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group>.btn+.btn{margin-left:-1px}.btn-group>.btn,.btn-group>.dropdown-menu{font-size:14px}.btn-group>.btn-mini{font-size:11px}.btn-group>.btn-small{font-size:12px}.btn-group>.btn-large{font-size:16px}.btn-group>.btn:first-child{margin-left:0;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-bottomleft:4px;-moz-border-radius-topleft:4px}.btn-group>.btn:last-child,.btn-group>.dropdown-toggle{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-bottomright:4px}.btn-group>.btn.large:first-child{margin-left:0;-webkit-border-bottom-left-radius:6px;border-bottom-left-radius:6px;-webkit-border-top-left-radius:6px;border-top-left-radius:6px;-moz-border-radius-bottomleft:6px;-moz-border-radius-topleft:6px}.btn-group>.btn.large:last-child,.btn-group>.large.dropdown-toggle{-webkit-border-top-right-radius:6px;border-top-right-radius:6px;-webkit-border-bottom-right-radius:6px;border-bottom-right-radius:6px;-moz-border-radius-topright:6px;-moz-border-radius-bottomright:6px}.btn-group>.btn:hover,.btn-group>.btn:focus,.btn-group>.btn:active,.btn-group>.btn.active{z-index:2}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{*padding-top:5px;padding-right:8px;*padding-bottom:5px;padding-left:8px;-webkit-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 1px 0 0 rgba(255,255,255,0.125),inset 0 1px 0 rgba(255,255,255,0.2),0 1px 2px rgba(0,0,0,0.05)}.btn-group>.btn-mini+.dropdown-toggle{*padding-top:2px;padding-right:5px;*padding-bottom:2px;padding-left:5px}.btn-group>.btn-small+.dropdown-toggle{*padding-top:5px;*padding-bottom:4px}.btn-group>.btn-large+.dropdown-toggle{*padding-top:7px;padding-right:12px;*padding-bottom:7px;padding-left:12px}.btn-group.open .dropdown-toggle{background-image:none;-webkit-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05);box-shadow:inset 0 2px 4px rgba(0,0,0,0.15),0 1px 2px rgba(0,0,0,0.05)}.btn-group.open .btn.dropdown-toggle{background-color:#e6e6e6}.btn-group.open .btn-primary.dropdown-toggle{background-color:#04c}.btn-group.open .btn-warning.dropdown-toggle{background-color:#f89406}.btn-group.open .btn-danger.dropdown-toggle{background-color:#bd362f}.btn-group.open .btn-success.dropdown-toggle{background-color:#51a351}.btn-group.open .btn-info.dropdown-toggle{background-color:#2f96b4}.btn-group.open .btn-inverse.dropdown-toggle{background-color:#222}.btn .caret{margin-top:8px;margin-left:0}.btn-mini .caret,.btn-small .caret,.btn-large .caret{margin-top:6px}.btn-large .caret{border-top-width:5px;border-right-width:5px;border-left-width:5px}.dropup .btn-large .caret{border-top:0;border-bottom:5px solid #000}.btn-primary .caret,.btn-warning .caret,.btn-danger .caret,.btn-info .caret,.btn-success .caret,.btn-inverse .caret{border-top-color:#fff;border-bottom-color:#fff}.btn-group-vertical{display:inline-block;*display:inline;*zoom:1}.btn-group-vertical .btn{display:block;float:none;width:100%;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.btn-group-vertical .btn+.btn{margin-top:-1px;margin-left:0}.btn-group-vertical .btn:first-child{-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.btn-group-vertical .btn:last-child{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.btn-group-vertical .btn-large:first-child{-webkit-border-radius:6px 6px 0 0;-moz-border-radius:6px 6px 0 0;border-radius:6px 6px 0 0}.btn-group-vertical .btn-large:last-child{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.alert{padding:8px 35px 8px 14px;margin-bottom:20px;color:#c09853;text-shadow:0 1px 0 rgba(255,255,255,0.5);background-color:#fcf8e3;border:1px solid #fbeed5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.alert h4{margin:0}.alert .close{position:relative;top:-2px;right:-21px;line-height:20px}.alert-success{color:#468847;background-color:#dff0d8;border-color:#d6e9c6}.alert-danger,.alert-error{color:#b94a48;background-color:#f2dede;border-color:#eed3d7}.alert-info{color:#3a87ad;background-color:#d9edf7;border-color:#bce8f1}.alert-block{padding-top:14px;padding-bottom:14px}.alert-block>p,.alert-block>ul{margin-bottom:0}.alert-block p+p{margin-top:5px}.nav{margin-bottom:20px;margin-left:0;list-style:none}.nav>li>a{display:block}.nav>li>a:hover{text-decoration:none;background-color:#eee}.nav>.pull-right{float:right}.nav-header{display:block;padding:3px 15px;font-size:11px;font-weight:bold;line-height:20px;color:#999;text-shadow:0 1px 0 rgba(255,255,255,0.5);text-transform:uppercase}.nav li+.nav-header{margin-top:9px}.nav-list{padding-right:15px;padding-left:15px;margin-bottom:0}.nav-list>li>a,.nav-list .nav-header{margin-right:-15px;margin-left:-15px;text-shadow:0 1px 0 rgba(255,255,255,0.5)}.nav-list>li>a{padding:3px 15px}.nav-list>.active>a,.nav-list>.active>a:hover{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.2);background-color:#08c}.nav-list [class^="icon-"]{margin-right:2px}.nav-list .divider{*width:100%;height:1px;margin:9px 1px;*margin:-5px 0 5px;overflow:hidden;background-color:#e5e5e5;border-bottom:1px solid #fff}.nav-tabs,.nav-pills{*zoom:1}.nav-tabs:before,.nav-pills:before,.nav-tabs:after,.nav-pills:after{display:table;line-height:0;content:""}.nav-tabs:after,.nav-pills:after{clear:both}.nav-tabs>li,.nav-pills>li{float:left}.nav-tabs>li>a,.nav-pills>li>a{padding-right:12px;padding-left:12px;margin-right:2px;line-height:14px}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{margin-bottom:-1px}.nav-tabs>li>a{padding-top:8px;padding-bottom:8px;line-height:20px;border:1px solid transparent;-webkit-border-radius:4px 4px 0 0;-moz-border-radius:4px 4px 0 0;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>.active>a,.nav-tabs>.active>a:hover{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-pills>li>a{padding-top:8px;padding-bottom:8px;margin-top:2px;margin-bottom:2px;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.nav-pills>.active>a,.nav-pills>.active>a:hover{color:#fff;background-color:#08c}.nav-stacked>li{float:none}.nav-stacked>li>a{margin-right:0}.nav-tabs.nav-stacked{border-bottom:0}.nav-tabs.nav-stacked>li>a{border:1px solid #ddd;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.nav-tabs.nav-stacked>li:first-child>a{-webkit-border-top-right-radius:4px;border-top-right-radius:4px;-webkit-border-top-left-radius:4px;border-top-left-radius:4px;-moz-border-radius-topright:4px;-moz-border-radius-topleft:4px}.nav-tabs.nav-stacked>li:last-child>a{-webkit-border-bottom-right-radius:4px;border-bottom-right-radius:4px;-webkit-border-bottom-left-radius:4px;border-bottom-left-radius:4px;-moz-border-radius-bottomright:4px;-moz-border-radius-bottomleft:4px}.nav-tabs.nav-stacked>li>a:hover{z-index:2;border-color:#ddd}.nav-pills.nav-stacked>li>a{margin-bottom:3px}.nav-pills.nav-stacked>li:last-child>a{margin-bottom:1px}.nav-tabs .dropdown-menu{-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px}.nav-pills .dropdown-menu{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.nav .dropdown-toggle .caret{margin-top:6px;border-top-color:#08c;border-bottom-color:#08c}.nav .dropdown-toggle:hover .caret{border-top-color:#005580;border-bottom-color:#005580}.nav-tabs .dropdown-toggle .caret{margin-top:8px}.nav .active .dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.nav-tabs .active .dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.nav>.dropdown.active>a:hover{cursor:pointer}.nav-tabs .open .dropdown-toggle,.nav-pills .open .dropdown-toggle,.nav>li.dropdown.open.active>a:hover{color:#fff;background-color:#999;border-color:#999}.nav li.dropdown.open .caret,.nav li.dropdown.open.active .caret,.nav li.dropdown.open a:hover .caret{border-top-color:#fff;border-bottom-color:#fff;opacity:1;filter:alpha(opacity=100)}.tabs-stacked .open>a:hover{border-color:#999}.tabbable{*zoom:1}.tabbable:before,.tabbable:after{display:table;line-height:0;content:""}.tabbable:after{clear:both}.tab-content{overflow:auto}.tabs-below>.nav-tabs,.tabs-right>.nav-tabs,.tabs-left>.nav-tabs{border-bottom:0}.tab-content>.tab-pane,.pill-content>.pill-pane{display:none}.tab-content>.active,.pill-content>.active{display:block}.tabs-below>.nav-tabs{border-top:1px solid #ddd}.tabs-below>.nav-tabs>li{margin-top:-1px;margin-bottom:0}.tabs-below>.nav-tabs>li>a{-webkit-border-radius:0 0 4px 4px;-moz-border-radius:0 0 4px 4px;border-radius:0 0 4px 4px}.tabs-below>.nav-tabs>li>a:hover{border-top-color:#ddd;border-bottom-color:transparent}.tabs-below>.nav-tabs>.active>a,.tabs-below>.nav-tabs>.active>a:hover{border-color:transparent #ddd #ddd #ddd}.tabs-left>.nav-tabs>li,.tabs-right>.nav-tabs>li{float:none}.tabs-left>.nav-tabs>li>a,.tabs-right>.nav-tabs>li>a{min-width:74px;margin-right:0;margin-bottom:3px}.tabs-left>.nav-tabs{float:left;margin-right:19px;border-right:1px solid #ddd}.tabs-left>.nav-tabs>li>a{margin-right:-1px;-webkit-border-radius:4px 0 0 4px;-moz-border-radius:4px 0 0 4px;border-radius:4px 0 0 4px}.tabs-left>.nav-tabs>li>a:hover{border-color:#eee #ddd #eee #eee}.tabs-left>.nav-tabs .active>a,.tabs-left>.nav-tabs .active>a:hover{border-color:#ddd transparent #ddd #ddd;*border-right-color:#fff}.tabs-right>.nav-tabs{float:right;margin-left:19px;border-left:1px solid #ddd}.tabs-right>.nav-tabs>li>a{margin-left:-1px;-webkit-border-radius:0 4px 4px 0;-moz-border-radius:0 4px 4px 0;border-radius:0 4px 4px 0}.tabs-right>.nav-tabs>li>a:hover{border-color:#eee #eee #eee #ddd}.tabs-right>.nav-tabs .active>a,.tabs-right>.nav-tabs .active>a:hover{border-color:#ddd #ddd #ddd transparent;*border-left-color:#fff}.nav>.disabled>a{color:#999}.nav>.disabled>a:hover{text-decoration:none;cursor:default;background-color:transparent}.navbar{*position:relative;*z-index:2;margin-bottom:20px;overflow:visible;color:#555}.navbar-inner{min-height:40px;padding-right:20px;padding-left:20px;background-color:#fafafa;background-image:-moz-linear-gradient(top,#fff,#feead8);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fff),to(#feead8));background-image:-webkit-linear-gradient(top,#fff,#feead8);background-image:-o-linear-gradient(top,#fff,#feead8);background-image:linear-gradient(to bottom,#fff,#feead8);background-repeat:repeat-x;border:1px solid #d4d4d4;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffffffff',endColorstr='#fffeead8',GradientType=0);-webkit-box-shadow:0 1px 4px rgba(0,0,0,0.065);-moz-box-shadow:0 1px 4px rgba(0,0,0,0.065);box-shadow:0 1px 4px rgba(0,0,0,0.065)}.navbar .container{width:auto}.nav-collapse.collapse{height:auto}.navbar .brand{display:block;float:left;padding:10px 20px 10px;margin-left:-20px;font-size:20px;font-weight:200;color:#555;text-shadow:0 1px 0 #fff}.navbar .brand:hover{text-decoration:none}.navbar-text{margin-bottom:0;line-height:40px}.navbar-link{color:#555}.navbar-link:hover{color:#333}.navbar .divider-vertical{height:40px;margin:0 9px;border-right:1px solid #fff;border-left:1px solid #f2f2f2}.navbar .btn,.navbar .btn-group{margin-top:6px}.navbar .btn-group .btn{margin:0}.navbar-form{margin-bottom:0;*zoom:1}.navbar-form:before,.navbar-form:after{display:table;line-height:0;content:""}.navbar-form:after{clear:both}.navbar-form input,.navbar-form select,.navbar-form .radio,.navbar-form .checkbox{margin-top:5px}.navbar-form input,.navbar-form select,.navbar-form .btn{display:inline-block;margin-bottom:0}.navbar-form input[type="image"],.navbar-form input[type="checkbox"],.navbar-form input[type="radio"]{margin-top:3px}.navbar-form .input-append,.navbar-form .input-prepend{margin-top:6px;white-space:nowrap}.navbar-form .input-append input,.navbar-form .input-prepend input{margin-top:0}.navbar-search{position:relative;float:left;margin-top:5px;margin-bottom:0}.navbar-search .search-query{padding:4px 14px;margin-bottom:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:13px;font-weight:normal;line-height:1;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.navbar-static-top{position:static;width:100%;margin-bottom:0}.navbar-static-top .navbar-inner{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;margin-bottom:0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner,.navbar-static-top .navbar-inner{border:0}.navbar-fixed-top .navbar-inner,.navbar-fixed-bottom .navbar-inner{padding-right:0;padding-left:0;-webkit-border-radius:0;-moz-border-radius:0;border-radius:0}.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.navbar-fixed-top{top:0}.navbar-fixed-top .navbar-inner,.navbar-static-top .navbar-inner{-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.1),0 1px 10px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.1),0 1px 10px rgba(0,0,0,0.1);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.1),0 1px 10px rgba(0,0,0,0.1)}.navbar-fixed-bottom{bottom:0}.navbar-fixed-bottom .navbar-inner{-webkit-box-shadow:inset 0 1px 0 rgba(0,0,0,0.1),0 -1px 10px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 0 rgba(0,0,0,0.1),0 -1px 10px rgba(0,0,0,0.1);box-shadow:inset 0 1px 0 rgba(0,0,0,0.1),0 -1px 10px rgba(0,0,0,0.1)}.navbar .nav{position:relative;left:0;display:block;float:left;margin:0 10px 0 0}.navbar .nav.pull-right{float:right}.navbar .nav>li{float:left}.navbar .nav>li>a{float:none;padding:10px 15px 10px;color:#555;text-decoration:none;text-shadow:0 1px 0 #fff}.navbar .nav .dropdown-toggle .caret{margin-top:8px}.navbar .nav>li>a:focus,.navbar .nav>li>a:hover{color:#333;text-decoration:none;background-color:transparent}.navbar .nav>.active>a,.navbar .nav>.active>a:hover,.navbar .nav>.active>a:focus{color:#555;text-decoration:none;background-color:#e5e5e5;-webkit-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);-moz-box-shadow:inset 0 3px 8px rgba(0,0,0,0.125);box-shadow:inset 0 3px 8px rgba(0,0,0,0.125)}.navbar .btn-navbar{display:none;float:right;padding:7px 10px;margin-right:5px;margin-left:5px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#ededed;*background-color:#e5e5e5;background-image:-webkit-gradient(linear,0 0,0 100%,from(#f2f2f2),to(#e5e5e5));background-image:-webkit-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:-o-linear-gradient(top,#f2f2f2,#e5e5e5);background-image:linear-gradient(to bottom,#f2f2f2,#e5e5e5);background-image:-moz-linear-gradient(top,#f2f2f2,#e5e5e5);background-repeat:repeat-x;border-color:#e5e5e5 #e5e5e5 #bfbfbf;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fff2f2f2',endColorstr='#ffe5e5e5',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false);-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);-moz-box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075);box-shadow:inset 0 1px 0 rgba(255,255,255,0.1),0 1px 0 rgba(255,255,255,0.075)}.navbar .btn-navbar:hover,.navbar .btn-navbar:active,.navbar .btn-navbar.active,.navbar .btn-navbar.disabled,.navbar .btn-navbar[disabled]{color:#fff;background-color:#e5e5e5;*background-color:#d9d9d9}.navbar .btn-navbar:active,.navbar .btn-navbar.active{background-color:#ccc \9}.navbar .btn-navbar .icon-bar{display:block;width:18px;height:2px;background-color:#f5f5f5;-webkit-border-radius:1px;-moz-border-radius:1px;border-radius:1px;-webkit-box-shadow:0 1px 0 rgba(0,0,0,0.25);-moz-box-shadow:0 1px 0 rgba(0,0,0,0.25);box-shadow:0 1px 0 rgba(0,0,0,0.25)}.btn-navbar .icon-bar+.icon-bar{margin-top:3px}.navbar .nav>li>.dropdown-menu:before{position:absolute;top:-7px;left:9px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.navbar .nav>li>.dropdown-menu:after{position:absolute;top:-6px;left:10px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.navbar-fixed-bottom .nav>li>.dropdown-menu:before{top:auto;bottom:-7px;border-top:7px solid #ccc;border-bottom:0;border-top-color:rgba(0,0,0,0.2)}.navbar-fixed-bottom .nav>li>.dropdown-menu:after{top:auto;bottom:-6px;border-top:6px solid #fff;border-bottom:0}.navbar .nav li.dropdown.open>.dropdown-toggle,.navbar .nav li.dropdown.active>.dropdown-toggle,.navbar .nav li.dropdown.open.active>.dropdown-toggle{color:#555;background-color:#e5e5e5}.navbar .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .nav li.dropdown.open>.dropdown-toggle .caret,.navbar .nav li.dropdown.active>.dropdown-toggle .caret,.navbar .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#555;border-bottom-color:#555}.navbar .pull-right>li>.dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right{right:0;left:auto}.navbar .pull-right>li>.dropdown-menu:before,.navbar .nav>li>.dropdown-menu.pull-right:before{right:12px;left:auto}.navbar .pull-right>li>.dropdown-menu:after,.navbar .nav>li>.dropdown-menu.pull-right:after{right:13px;left:auto}.navbar .pull-right>li>.dropdown-menu .dropdown-menu,.navbar .nav>li>.dropdown-menu.pull-right .dropdown-menu{right:100%;left:auto;margin-right:-1px;margin-left:0;-webkit-border-radius:6px 0 6px 6px;-moz-border-radius:6px 0 6px 6px;border-radius:6px 0 6px 6px}.navbar-inverse{color:#999}.navbar-inverse .navbar-inner{background-color:#1b1b1b;background-image:-moz-linear-gradient(top,#222,#111);background-image:-webkit-gradient(linear,0 0,0 100%,from(#222),to(#111));background-image:-webkit-linear-gradient(top,#222,#111);background-image:-o-linear-gradient(top,#222,#111);background-image:linear-gradient(to bottom,#222,#111);background-repeat:repeat-x;border-color:#252525;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff222222',endColorstr='#ff111111',GradientType=0)}.navbar-inverse .brand,.navbar-inverse .nav>li>a{color:#999;text-shadow:0 -1px 0 rgba(0,0,0,0.25)}.navbar-inverse .brand:hover,.navbar-inverse .nav>li>a:hover{color:#fff}.navbar-inverse .nav>li>a:focus,.navbar-inverse .nav>li>a:hover{color:#fff;background-color:transparent}.navbar-inverse .nav .active>a,.navbar-inverse .nav .active>a:hover,.navbar-inverse .nav .active>a:focus{color:#fff;background-color:#111}.navbar-inverse .navbar-link{color:#999}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .divider-vertical{border-right-color:#222;border-left-color:#111}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle{color:#fff;background-color:#111}.navbar-inverse .nav li.dropdown>.dropdown-toggle .caret{border-top-color:#999;border-bottom-color:#999}.navbar-inverse .nav li.dropdown.open>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.active>.dropdown-toggle .caret,.navbar-inverse .nav li.dropdown.open.active>.dropdown-toggle .caret{border-top-color:#fff;border-bottom-color:#fff}.navbar-inverse .navbar-search .search-query{color:#fff;background-color:#515151;border-color:#111;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1),0 1px 0 rgba(255,255,255,0.15);-webkit-transition:none;-moz-transition:none;-o-transition:none;transition:none}.navbar-inverse .navbar-search .search-query:-moz-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:-ms-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query::-webkit-input-placeholder{color:#ccc}.navbar-inverse .navbar-search .search-query:focus,.navbar-inverse .navbar-search .search-query.focused{padding:5px 15px;color:#333;text-shadow:0 1px 0 #fff;background-color:#fff;border:0;outline:0;-webkit-box-shadow:0 0 3px rgba(0,0,0,0.15);-moz-box-shadow:0 0 3px rgba(0,0,0,0.15);box-shadow:0 0 3px rgba(0,0,0,0.15)}.navbar-inverse .btn-navbar{color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e0e0e;*background-color:#040404;background-image:-webkit-gradient(linear,0 0,0 100%,from(#151515),to(#040404));background-image:-webkit-linear-gradient(top,#151515,#040404);background-image:-o-linear-gradient(top,#151515,#040404);background-image:linear-gradient(to bottom,#151515,#040404);background-image:-moz-linear-gradient(top,#151515,#040404);background-repeat:repeat-x;border-color:#040404 #040404 #000;border-color:rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25);filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff151515',endColorstr='#ff040404',GradientType=0);filter:progid:dximagetransform.microsoft.gradient(enabled=false)}.navbar-inverse .btn-navbar:hover,.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active,.navbar-inverse .btn-navbar.disabled,.navbar-inverse .btn-navbar[disabled]{color:#fff;background-color:#040404;*background-color:#000}.navbar-inverse .btn-navbar:active,.navbar-inverse .btn-navbar.active{background-color:#000 \9}.breadcrumb{padding:8px 15px;margin:0 0 20px;list-style:none;background-color:#f5f5f5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.breadcrumb li{display:inline-block;*display:inline;text-shadow:0 1px 0 #fff;*zoom:1}.breadcrumb .divider{padding:0 5px;color:#ccc}.breadcrumb .active{color:#999}.pagination{height:40px;margin:20px 0}.pagination ul{display:inline-block;*display:inline;margin-bottom:0;margin-left:0;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px;*zoom:1;-webkit-box-shadow:0 1px 2px rgba(0,0,0,0.05);-moz-box-shadow:0 1px 2px rgba(0,0,0,0.05);box-shadow:0 1px 2px rgba(0,0,0,0.05)}.pagination li{display:inline}.pagination a,.pagination span{float:left;padding:0 14px;line-height:38px;text-decoration:none;background-color:#fff;border:1px solid #ddd;border-left-width:0}.pagination a:hover,.pagination .active a,.pagination .active span{background-color:#f5f5f5}.pagination .active a,.pagination .active span{color:#999;cursor:default}.pagination .disabled span,.pagination .disabled a,.pagination .disabled a:hover{color:#999;cursor:default;background-color:transparent}.pagination li:first-child a,.pagination li:first-child span{border-left-width:1px;-webkit-border-radius:3px 0 0 3px;-moz-border-radius:3px 0 0 3px;border-radius:3px 0 0 3px}.pagination li:last-child a,.pagination li:last-child span{-webkit-border-radius:0 3px 3px 0;-moz-border-radius:0 3px 3px 0;border-radius:0 3px 3px 0}.pagination-centered{text-align:center}.pagination-right{text-align:right}.pager{margin:20px 0;text-align:center;list-style:none;*zoom:1}.pager:before,.pager:after{display:table;line-height:0;content:""}.pager:after{clear:both}.pager li{display:inline}.pager a{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;-webkit-border-radius:15px;-moz-border-radius:15px;border-radius:15px}.pager a:hover{text-decoration:none;background-color:#f5f5f5}.pager .next a{float:right}.pager .previous a{float:left}.pager .disabled a,.pager .disabled a:hover{color:#999;cursor:default;background-color:#fff}.modal-open .dropdown-menu{z-index:2050}.modal-open .dropdown.open{*z-index:2050}.modal-open .popover{z-index:2060}.modal-open .tooltip{z-index:2080}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{opacity:0}.modal-backdrop,.modal-backdrop.fade.in{opacity:.8;filter:alpha(opacity=80)}.modal{position:fixed;top:50%;left:50%;z-index:1050;width:560px;margin:-250px 0 0 -280px;overflow:auto;background-color:#fff;border:1px solid #999;border:1px solid rgba(0,0,0,0.3);*border:1px solid #999;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 3px 7px rgba(0,0,0,0.3);-moz-box-shadow:0 3px 7px rgba(0,0,0,0.3);box-shadow:0 3px 7px rgba(0,0,0,0.3);-webkit-background-clip:padding-box;-moz-background-clip:padding-box;background-clip:padding-box}.modal.fade{top:-25%;-webkit-transition:opacity .3s linear,top .3s ease-out;-moz-transition:opacity .3s linear,top .3s ease-out;-o-transition:opacity .3s linear,top .3s ease-out;transition:opacity .3s linear,top .3s ease-out}.modal.fade.in{top:50%}.modal-header{padding:9px 15px;border-bottom:1px solid #eee}.modal-header .close{margin-top:2px}.modal-header h3{margin:0;line-height:30px}.modal-body{max-height:400px;padding:15px;overflow-y:auto}.modal-form{margin-bottom:0}.modal-footer{padding:14px 15px 15px;margin-bottom:0;text-align:right;background-color:#f5f5f5;border-top:1px solid #ddd;-webkit-border-radius:0 0 6px 6px;-moz-border-radius:0 0 6px 6px;border-radius:0 0 6px 6px;*zoom:1;-webkit-box-shadow:inset 0 1px 0 #fff;-moz-box-shadow:inset 0 1px 0 #fff;box-shadow:inset 0 1px 0 #fff}.modal-footer:before,.modal-footer:after{display:table;line-height:0;content:""}.modal-footer:after{clear:both}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.tooltip{position:absolute;z-index:1030;display:block;padding:5px;font-size:11px;opacity:0;filter:alpha(opacity=0);visibility:visible}.tooltip.in{opacity:.8;filter:alpha(opacity=80)}.tooltip.top{margin-top:-3px}.tooltip.right{margin-left:3px}.tooltip.bottom{margin-top:3px}.tooltip.left{margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-top-color:#000;border-width:5px 5px 0}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-right-color:#000;border-width:5px 5px 5px 0}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-left-color:#000;border-width:5px 0 5px 5px}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-bottom-color:#000;border-width:0 5px 5px}.popover{position:absolute;top:0;left:0;z-index:1010;display:none;width:236px;padding:1px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,0.2);-moz-box-shadow:0 5px 10px rgba(0,0,0,0.2);box-shadow:0 5px 10px rgba(0,0,0,0.2);-webkit-background-clip:padding-box;-moz-background-clip:padding;background-clip:padding-box}.popover.top{margin-bottom:10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-right:10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:normal;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;-webkit-border-radius:5px 5px 0 0;-moz-border-radius:5px 5px 0 0;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover-content p,.popover-content ul,.popover-content ol{margin-bottom:0}.popover .arrow,.popover .arrow:after{position:absolute;display:inline-block;width:0;height:0;border-color:transparent;border-style:solid}.popover .arrow:after{z-index:-1;content:""}.popover.top .arrow{bottom:-10px;left:50%;margin-left:-10px;border-top-color:#fff;border-width:10px 10px 0}.popover.top .arrow:after{bottom:-1px;left:-11px;border-top-color:rgba(0,0,0,0.25);border-width:11px 11px 0}.popover.right .arrow{top:50%;left:-10px;margin-top:-10px;border-right-color:#fff;border-width:10px 10px 10px 0}.popover.right .arrow:after{bottom:-11px;left:-1px;border-right-color:rgba(0,0,0,0.25);border-width:11px 11px 11px 0}.popover.bottom .arrow{top:-10px;left:50%;margin-left:-10px;border-bottom-color:#fff;border-width:0 10px 10px}.popover.bottom .arrow:after{top:-1px;left:-11px;border-bottom-color:rgba(0,0,0,0.25);border-width:0 11px 11px}.popover.left .arrow{top:50%;right:-10px;margin-top:-10px;border-left-color:#fff;border-width:10px 0 10px 10px}.popover.left .arrow:after{right:-1px;bottom:-11px;border-left-color:rgba(0,0,0,0.25);border-width:11px 0 11px 11px}.thumbnails{margin-left:-20px;list-style:none;*zoom:1}.thumbnails:before,.thumbnails:after{display:table;line-height:0;content:""}.thumbnails:after{clear:both}.row-fluid .thumbnails{margin-left:0}.thumbnails>li{float:left;margin-bottom:20px;margin-left:20px}.thumbnail{display:block;padding:4px;line-height:20px;border:1px solid #ddd;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.055);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.055);box-shadow:0 1px 3px rgba(0,0,0,0.055);-webkit-transition:all .2s ease-in-out;-moz-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}a.thumbnail:hover{border-color:#08c;-webkit-box-shadow:0 1px 4px rgba(0,105,214,0.25);-moz-box-shadow:0 1px 4px rgba(0,105,214,0.25);box-shadow:0 1px 4px rgba(0,105,214,0.25)}.thumbnail>img{display:block;max-width:100%;margin-right:auto;margin-left:auto}.thumbnail .caption{padding:9px;color:#555}.label,.badge{font-size:11.844px;font-weight:bold;line-height:14px;color:#fff;text-shadow:0 -1px 0 rgba(0,0,0,0.25);white-space:nowrap;vertical-align:baseline;background-color:#999}.label{padding:1px 4px 2px;-webkit-border-radius:3px;-moz-border-radius:3px;border-radius:3px}.badge{padding:1px 9px 2px;-webkit-border-radius:9px;-moz-border-radius:9px;border-radius:9px}a.label:hover,a.badge:hover{color:#fff;text-decoration:none;cursor:pointer}.label-important,.badge-important{background-color:#b94a48}.label-important[href],.badge-important[href]{background-color:#953b39}.label-warning,.badge-warning{background-color:#f89406}.label-warning[href],.badge-warning[href]{background-color:#c67605}.label-success,.badge-success{background-color:#468847}.label-success[href],.badge-success[href]{background-color:#356635}.label-info,.badge-info{background-color:#3a87ad}.label-info[href],.badge-info[href]{background-color:#2d6987}.label-inverse,.badge-inverse{background-color:#333}.label-inverse[href],.badge-inverse[href]{background-color:#1a1a1a}.btn .label,.btn .badge{position:relative;top:-1px}.btn-mini .label,.btn-mini .badge{top:0}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-moz-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-ms-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:0 0}to{background-position:40px 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f7f7f7;background-image:-moz-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#f5f5f5),to(#f9f9f9));background-image:-webkit-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:-o-linear-gradient(top,#f5f5f5,#f9f9f9);background-image:linear-gradient(to bottom,#f5f5f5,#f9f9f9);background-repeat:repeat-x;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fff5f5f5',endColorstr='#fff9f9f9',GradientType=0);-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);-moz-box-shadow:inset 0 1px 2px rgba(0,0,0,0.1);box-shadow:inset 0 1px 2px rgba(0,0,0,0.1)}.progress .bar{float:left;width:0;height:100%;font-size:12px;color:#fff;text-align:center;text-shadow:0 -1px 0 rgba(0,0,0,0.25);background-color:#0e90d2;background-image:-moz-linear-gradient(top,#149bdf,#0480be);background-image:-webkit-gradient(linear,0 0,0 100%,from(#149bdf),to(#0480be));background-image:-webkit-linear-gradient(top,#149bdf,#0480be);background-image:-o-linear-gradient(top,#149bdf,#0480be);background-image:linear-gradient(to bottom,#149bdf,#0480be);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff149bdf',endColorstr='#ff0480be',GradientType=0);-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,0.15);-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-transition:width .6s ease;-moz-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress .bar+.bar{-webkit-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);-moz-box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15);box-shadow:inset 1px 0 0 rgba(0,0,0,0.15),inset 0 -1px 0 rgba(0,0,0,0.15)}.progress-striped .bar{background-color:#149bdf;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;-moz-background-size:40px 40px;-o-background-size:40px 40px;background-size:40px 40px}.progress.active .bar{-webkit-animation:progress-bar-stripes 2s linear infinite;-moz-animation:progress-bar-stripes 2s linear infinite;-ms-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-danger .bar,.progress .bar-danger{background-color:#dd514c;background-image:-moz-linear-gradient(top,#ee5f5b,#c43c35);background-image:-webkit-gradient(linear,0 0,0 100%,from(#ee5f5b),to(#c43c35));background-image:-webkit-linear-gradient(top,#ee5f5b,#c43c35);background-image:-o-linear-gradient(top,#ee5f5b,#c43c35);background-image:linear-gradient(to bottom,#ee5f5b,#c43c35);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ffee5f5b',endColorstr='#ffc43c35',GradientType=0)}.progress-danger.progress-striped .bar,.progress-striped .bar-danger{background-color:#ee5f5b;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-success .bar,.progress .bar-success{background-color:#5eb95e;background-image:-moz-linear-gradient(top,#62c462,#57a957);background-image:-webkit-gradient(linear,0 0,0 100%,from(#62c462),to(#57a957));background-image:-webkit-linear-gradient(top,#62c462,#57a957);background-image:-o-linear-gradient(top,#62c462,#57a957);background-image:linear-gradient(to bottom,#62c462,#57a957);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff62c462',endColorstr='#ff57a957',GradientType=0)}.progress-success.progress-striped .bar,.progress-striped .bar-success{background-color:#62c462;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-info .bar,.progress .bar-info{background-color:#4bb1cf;background-image:-moz-linear-gradient(top,#5bc0de,#339bb9);background-image:-webkit-gradient(linear,0 0,0 100%,from(#5bc0de),to(#339bb9));background-image:-webkit-linear-gradient(top,#5bc0de,#339bb9);background-image:-o-linear-gradient(top,#5bc0de,#339bb9);background-image:linear-gradient(to bottom,#5bc0de,#339bb9);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#ff5bc0de',endColorstr='#ff339bb9',GradientType=0)}.progress-info.progress-striped .bar,.progress-striped .bar-info{background-color:#5bc0de;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.progress-warning .bar,.progress .bar-warning{background-color:#faa732;background-image:-moz-linear-gradient(top,#fbb450,#f89406);background-image:-webkit-gradient(linear,0 0,0 100%,from(#fbb450),to(#f89406));background-image:-webkit-linear-gradient(top,#fbb450,#f89406);background-image:-o-linear-gradient(top,#fbb450,#f89406);background-image:linear-gradient(to bottom,#fbb450,#f89406);background-repeat:repeat-x;filter:progid:dximagetransform.microsoft.gradient(startColorstr='#fffbb450',endColorstr='#fff89406',GradientType=0)}.progress-warning.progress-striped .bar,.progress-striped .bar-warning{background-color:#fbb450;background-image:-webkit-gradient(linear,0 100%,100% 0,color-stop(0.25,rgba(255,255,255,0.15)),color-stop(0.25,transparent),color-stop(0.5,transparent),color-stop(0.5,rgba(255,255,255,0.15)),color-stop(0.75,rgba(255,255,255,0.15)),color-stop(0.75,transparent),to(transparent));background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-moz-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,0.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,0.15) 50%,rgba(255,255,255,0.15) 75%,transparent 75%,transparent)}.accordion{margin-bottom:20px}.accordion-group{margin-bottom:2px;border:1px solid #e5e5e5;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px}.accordion-heading{border-bottom:0}.accordion-heading .accordion-toggle{display:block;padding:8px 15px}.accordion-toggle{cursor:pointer}.accordion-inner{padding:9px 15px;border-top:1px solid #e5e5e5}.carousel{position:relative;margin-bottom:20px;line-height:1}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel .item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-moz-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel .item>img{display:block;line-height:1}.carousel .active,.carousel .next,.carousel .prev{display:block}.carousel .active{left:0}.carousel .next,.carousel .prev{position:absolute;top:0;width:100%}.carousel .next{left:100%}.carousel .prev{left:-100%}.carousel .next.left,.carousel .prev.right{left:0}.carousel .active.left{left:-100%}.carousel .active.right{left:100%}.carousel-control{position:absolute;top:40%;left:15px;width:40px;height:40px;margin-top:-20px;font-size:60px;font-weight:100;line-height:30px;color:#fff;text-align:center;background:#222;border:3px solid #fff;-webkit-border-radius:23px;-moz-border-radius:23px;border-radius:23px;opacity:.5;filter:alpha(opacity=50)}.carousel-control.right{right:15px;left:auto}.carousel-control:hover{color:#fff;text-decoration:none;opacity:.9;filter:alpha(opacity=90)}.carousel-caption{position:absolute;right:0;bottom:0;left:0;padding:15px;background:#333;background:rgba(0,0,0,0.75)}.carousel-caption h4,.carousel-caption p{line-height:20px;color:#fff}.carousel-caption h4{margin:0 0 5px}.carousel-caption p{margin-bottom:0}.hero-unit{padding:60px;margin-bottom:30px;background-color:#eee;-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.hero-unit h1{margin-bottom:0;font-size:60px;line-height:1;letter-spacing:-1px;color:inherit}.hero-unit p{font-size:18px;font-weight:200;line-height:30px;color:inherit}.pull-right{float:right}.pull-left{float:left}.hide{display:none}.show{display:block}.invisible{visibility:hidden}.affix{position:fixed} diff --git a/docs/css/main.css b/docs/css/main.css new file mode 100644 index 000000000000..31122d563380 --- /dev/null +++ b/docs/css/main.css @@ -0,0 +1,106 @@ +/* ========================================================================== + Author's custom styles + ========================================================================== */ + +.navbar .brand { + height: 50px; + width: 110px; + margin-left: 1px; + padding: 0; +} + +.version { + line-height: 30px; + vertical-align: bottom; + font-size: 12px; + padding: 0; + margin: 0; + font-weight: bold; + color: #777; +} + +.navbar-inner { + padding-top: 2px; + height: 50px; +} + +.navbar-inner .nav { + margin-top: 5px; + font-size: 15px; +} + +.navbar .divider-vertical { + border-right-color: lightgray; +} + +.navbar-text .version-text { + color: #555555; + padding: 5px; + margin-left: 10px; +} + +body #content { + line-height: 1.6; /* Inspired by Github's wiki style */ +} + +.title { + font-size: 32px; +} + +h1 { + font-size: 28px; + margin-top: 12px; +} + +h2 { + font-size: 24px; + margin-top: 12px; +} + +h3 { + font-size: 21px; + margin-top: 10px; +} + +pre { + font-family: "Menlo", "Lucida Console", monospace; +} + +code { + font-family: "Menlo", "Lucida Console", monospace; + background: white; + border: none; + padding: 0; + color: #444444; +} + +a code { + color: #0088cc; +} + +a:hover code { + color: #005580; + text-decoration: underline; +} + +.container { + max-width: 914px; +} + +/** + * Make dropdown menus in nav bars show on hover instead of click + * using solution at http://stackoverflow.com/questions/8878033/how- + * to-make-twitter-bootstrap-menu-dropdown-on-hover-rather-than-click + **/ +.dropdown-menu { + /* Remove the default 2px top margin which causes a small + gap between the hover trigger area and the popup menu */ + margin-top: 0; +} +ul.nav li.dropdown:hover ul.dropdown-menu{ + display: block; +} +a.menu:after, .dropdown-toggle:after { + content: none; +} + diff --git a/docs/css/pygments-default.css b/docs/css/pygments-default.css new file mode 100644 index 000000000000..6247cd8396cf --- /dev/null +++ b/docs/css/pygments-default.css @@ -0,0 +1,76 @@ +/* +Documentation for pygments (and Jekyll for that matter) is super sparse. +To generate this, I had to run + `pygmentize -S default -f html > pygments-default.css` +But first I had to install pygments via easy_install pygments + +I had to override the conflicting bootstrap style rules by linking to +this stylesheet lower in the html than the bootstap css. + +Also, I was thrown off for a while at first when I was using markdown +code block inside my {% highlight scala %} ... {% endhighlight %} tags +(I was using 4 spaces for this), when it turns out that pygments will +insert the code (or pre?) tags for you. +*/ + +.hll { background-color: #ffffcc } +.c { color: #60a0b0; font-style: italic } /* Comment */ +.err { } /* Error */ +.k { color: #007020; font-weight: bold } /* Keyword */ +.o { color: #666666 } /* Operator */ +.cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */ +.cp { color: #007020 } /* Comment.Preproc */ +.c1 { color: #60a0b0; font-style: italic } /* Comment.Single */ +.cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */ +.gd { color: #A00000 } /* Generic.Deleted */ +.ge { font-style: italic } /* Generic.Emph */ +.gr { color: #FF0000 } /* Generic.Error */ +.gh { color: #000080; font-weight: bold } /* Generic.Heading */ +.gi { color: #00A000 } /* Generic.Inserted */ +.go { color: #808080 } /* Generic.Output */ +.gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */ +.gs { font-weight: bold } /* Generic.Strong */ +.gu { color: #800080; font-weight: bold } /* Generic.Subheading */ +.gt { color: #0040D0 } /* Generic.Traceback */ +.kc { color: #007020; font-weight: bold } /* Keyword.Constant */ +.kd { color: #007020; font-weight: bold } /* Keyword.Declaration */ +.kn { color: #007020; font-weight: bold } /* Keyword.Namespace */ +.kp { color: #007020 } /* Keyword.Pseudo */ +.kr { color: #007020; font-weight: bold } /* Keyword.Reserved */ +.kt { color: #902000 } /* Keyword.Type */ +.m { color: #40a070 } /* Literal.Number */ +.s { color: #4070a0 } /* Literal.String */ +.na { color: #4070a0 } /* Name.Attribute */ +.nb { color: #007020 } /* Name.Builtin */ +.nc { color: #0e84b5; font-weight: bold } /* Name.Class */ +.no { color: #60add5 } /* Name.Constant */ +.nd { color: #555555; font-weight: bold } /* Name.Decorator */ +.ni { color: #d55537; font-weight: bold } /* Name.Entity */ +.ne { color: #007020 } /* Name.Exception */ +.nf { color: #06287e } /* Name.Function */ +.nl { color: #002070; font-weight: bold } /* Name.Label */ +.nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */ +.nt { color: #062873; font-weight: bold } /* Name.Tag */ +.nv { color: #bb60d5 } /* Name.Variable */ +.ow { color: #007020; font-weight: bold } /* Operator.Word */ +.w { color: #bbbbbb } /* Text.Whitespace */ +.mf { color: #40a070 } /* Literal.Number.Float */ +.mh { color: #40a070 } /* Literal.Number.Hex */ +.mi { color: #40a070 } /* Literal.Number.Integer */ +.mo { color: #40a070 } /* Literal.Number.Oct */ +.sb { color: #4070a0 } /* Literal.String.Backtick */ +.sc { color: #4070a0 } /* Literal.String.Char */ +.sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */ +.s2 { color: #4070a0 } /* Literal.String.Double */ +.se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */ +.sh { color: #4070a0 } /* Literal.String.Heredoc */ +.si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */ +.sx { color: #c65d09 } /* Literal.String.Other */ +.sr { color: #235388 } /* Literal.String.Regex */ +.s1 { color: #4070a0 } /* Literal.String.Single */ +.ss { color: #517918 } /* Literal.String.Symbol */ +.bp { color: #007020 } /* Name.Builtin.Pseudo */ +.vc { color: #bb60d5 } /* Name.Variable.Class */ +.vg { color: #bb60d5 } /* Name.Variable.Global */ +.vi { color: #bb60d5 } /* Name.Variable.Instance */ +.il { color: #40a070 } /* Literal.Number.Integer.Long */ \ No newline at end of file diff --git a/src/main/java/tachyon/web/resources/img/glyphicons-halflings-white.png b/docs/img/glyphicons-halflings-white.png similarity index 100% rename from src/main/java/tachyon/web/resources/img/glyphicons-halflings-white.png rename to docs/img/glyphicons-halflings-white.png diff --git a/src/main/java/tachyon/web/resources/img/glyphicons-halflings.png b/docs/img/glyphicons-halflings.png similarity index 100% rename from src/main/java/tachyon/web/resources/img/glyphicons-halflings.png rename to docs/img/glyphicons-halflings.png diff --git a/docs/img/logo.jpg b/docs/img/logo.jpg new file mode 100644 index 000000000000..a1ee52a87beb Binary files /dev/null and b/docs/img/logo.jpg differ diff --git a/docs/img/screenshot_browse.png b/docs/img/screenshot_browse.png new file mode 100644 index 000000000000..2d673378baf6 Binary files /dev/null and b/docs/img/screenshot_browse.png differ diff --git a/docs/img/screenshot_home.png b/docs/img/screenshot_home.png new file mode 100644 index 000000000000..a8d9bfef8cf6 Binary files /dev/null and b/docs/img/screenshot_home.png differ diff --git a/docs/img/screenshot_viewFile.png b/docs/img/screenshot_viewFile.png new file mode 100644 index 000000000000..9db639392af4 Binary files /dev/null and b/docs/img/screenshot_viewFile.png differ diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 000000000000..6bcdba08f16c --- /dev/null +++ b/docs/index.md @@ -0,0 +1,108 @@ +--- +layout: global +title: Tachyon Overview +--- + +Tachyon is a fault tolerant distributed file system enabling reliable file sharing at memory-speed +across cluster frameworks, such as Spark and MapReduce. It achieves high performance by leveraging +lineage information and using memory aggressively. Tachyon caches working set files in memory +thereby avoiding going to disk to load datasets that are frequently read. This enables different +jobs/queries and frameworks to access cached files at memory speed. + +[Github Repository](https://github.com/amplab/tachyon/) | +[Releases and Downloads](https://github.com/amplab/tachyon/releases) | +[User Documentation](#user-documentation) | +[Developer Documentation](#developer-documentation) | +[Acknowledgement](#acknowledgement) + +# Current Features + +* **Java-like File API**: Tachyon's native API is similar to that of the java.io.File class, +providing InputStream and OutputStream interfaces and efficient support for memory-mapped I/O. We +recommend using this API to get the best performance from Tachyon + +* **Compatibility**: Tachyon implements the Hadoop FileSystem interface. Therefore, Hadoop MapReduce +and Spark can run with Tachyon without modification. However, close integration is required to fully +take advantage of Tachyon and we are working towards that. End-to-end latency speedup depends on the +workload and the framework, since various frameworks have different execution overhead. + +* **Pluggable underlayer file system**: Tachyon checkpoints in-memory data to the underlayer file +system. Tachyon has a generic interface to make plugging an underlayer file system easy. It +currently supports HDFS, S3, and single-node local file systems. Support for many other file systems +is coming. + +* **Native support for raw tables**: Table data with over hundreds of columns is common in data +warehouses. Tachyon provides native support for multi-columned data. The user can choose to only put +hot columns in memory. + +* **[Web UI](Web-Interface.html)**: Users can browse the file system easily through web UI. Under +debug mode, administrators can view detailed information of each file, including locations, +checkpoint path, etc. + +* **[Command line interaction](Command-Line-Interface.html)**: Users can use ``./bin/tachyon tfs`` +to interact with Tachyon, e.g. copy data in and out of the file system. + +# User Documentation + +[Running Tachyon Locally](Running-Tachyon-Locally.html): Get Tachyon up and running on a single node +for a quick spin in ~ 5 minutes. + +[Running Tachyon on a Cluster](Running-Tachyon-on-a-Cluster.html): Get Tachyon up and running on +your own cluster. + +[Fault Tolerant Tachyon Cluster](Fault-Tolerant-Tachyon-Cluster.html): Make your cluster fault +tolerant. + +[Running Spark on Tachyon](Running-Spark-on-Tachyon.html): Get Spark running on Tachyon + +[Running Shark on Tachyon](Running-Shark-on-Tachyon.html): Get Shark running on Tachyon + +[Running Hadoop MapReduce on Tachyon](Running-Hadoop-MapReduce-on-Tachyon.html): Get Hadoop +MapReduce running on Tachyon + +[Configuration Settings](Configuration-Settings.html): How to configure Tachyon. + +[Command-Line Interface](Command-Line-Interface.html): Interact with Tachyon through the command +line. + +[Syncing the Underlying Filesystem](Syncing-the-Underlying-Filesystem.html): Make Tachyon understand +an existing underlayer filesystem. + +[Tachyon Presentation](http://goo.gl/AHgz0E) at Strata and Hadoop World 2013 (October, 2013) + +# Developer Documentation + +[Startup Tasks for New Contributors](Startup-Tasks-for-New-Contributors.html) + +[Building Tachyon Master Branch](Building-Tachyon-Master-Branch.html) + +# External resources + + +[Tachyon Mini Courses at Strata 2014](http://ampcamp.berkeley.edu/big-data-mini-course/) + +[Hot Rod Hadoop With Tachyon on Fedora 21](http://timothysc.github.io/blog/2014/02/17/bdas-tachyon/) + +# Support or Contact + +You are welcome to join our +[mailing list](https://groups.google.com/forum/?fromgroups#!forum/tachyon-users) to discuss +questions and make suggestions. We use [JIRA](https://spark-project.atlassian.net/browse/TACHYON) to +track development and issues. If you are interested in trying out Tachyon in your cluster, please +contact [Haoyuan](mailto:haoyuan@cs.berkeley.edu). + +# Acknowledgement + +Tachyon is an open source project started in the +[UC Berkeley AMP Lab](http://amplab.cs.berkeley.edu). This research and development is supported in +part by NSF CISE Expeditions award CCF-1139158 and DARPA XData Award FA8750-12-2-0331, and gifts +from Amazon Web Services, Google, SAP, Apple, Inc., Cisco, Clearstory Data, Cloudera, Ericsson, +Facebook, GameOnTalis, General Electric, Hortonworks, Huawei, Intel, Microsoft, NetApp, Oracle, +Samsung, Splunk, VMware, WANdisco and Yahoo!. + +We would also like to thank to our project +[contributors](https://github.com/amplab/tachyon/graphs/contributors). + +# Related Projects + +[Berkeley Data Analysis Stack (BDAS)](https://amplab.cs.berkeley.edu/bdas/) from AMPLab at Berkeley diff --git a/docs/js/main.js b/docs/js/main.js new file mode 100644 index 000000000000..8b137891791f --- /dev/null +++ b/docs/js/main.js @@ -0,0 +1 @@ + diff --git a/docs/js/vendor/bootstrap.min.js b/docs/js/vendor/bootstrap.min.js new file mode 100644 index 000000000000..66e887bb3fde --- /dev/null +++ b/docs/js/vendor/bootstrap.min.js @@ -0,0 +1,6 @@ +/*! +* Bootstrap.js by @fat & @mdo +* Copyright 2012 Twitter, Inc. +* http://www.apache.org/licenses/LICENSE-2.0.txt +*/ +!function(e){e(function(){"use strict";e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()},e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e(function(){e("body").on("click.alert.data-api",t,n.prototype.close)})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.parent('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")},e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e(function(){e("body").on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=n,this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},to:function(t){var n=this.$element.find(".item.active"),r=n.parent().children(),i=r.index(n),s=this;if(t>r.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){s.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",e(r[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f=e.Event("slide",{relatedTarget:i[0]});this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u]();if(i.hasClass("active"))return;if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}},e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e(function(){e("body").on("click.carousel.data-api","[data-slide]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=!i.data("modal")&&e.extend({},i.data(),n.data());i.carousel(s),t.preventDefault()})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hasClass("width");return e?"width":"height"},show:function(){var t,n,r,i;if(this.transitioning)return;t=this.dimension(),n=e.camelCase(["scroll",t].join("-")),r=this.$parent&&this.$parent.find("> .accordion-group > .in");if(r&&r.length){i=r.data("collapse");if(i&&i.transitioning)return;r.collapse("hide"),i||r.data("collapse",null)}this.$element[t](0),this.transition("addClass",e.Event("show"),"shown"),e.support.transition&&this.$element[t](this.$element[0][n])},hide:function(){var t;if(this.transitioning)return;t=this.dimension(),this.reset(this.$element[t]()),this.transition("removeClass",e.Event("hide"),"hidden"),this.$element[t](0)},reset:function(e){var t=this.dimension();return this.$element.removeClass("collapse")[t](e||"auto")[0].offsetWidth,this.$element[e!==null?"addClass":"removeClass"]("collapse"),this},transition:function(t,n,r){var i=this,s=function(){n.type=="show"&&i.reset(),i.transitioning=0,i.$element.trigger(r)};this.$element.trigger(n);if(n.isDefaultPrevented())return;this.transitioning=1,this.$element[t]("in"),e.support.transition&&this.$element.hasClass("collapse")?this.$element.one(e.support.transition.end,s):s()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},e.fn.collapse=function(n){return this.each(function(){var r=e(this),i=r.data("collapse"),s=typeof n=="object"&&n;i||r.data("collapse",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.collapse.defaults={toggle:!0},e.fn.collapse.Constructor=t,e(function(){e("body").on("click.collapse.data-api","[data-toggle=collapse]",function(t){var n=e(this),r,i=n.attr("data-target")||t.preventDefault()||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,""),s=e(i).data("collapse")?"toggle":n.data();n[e(i).hasClass("in")?"addClass":"removeClass"]("collapsed"),e(i).collapse(s)})})}(window.jQuery),!function(e){"use strict";function r(){i(e(t)).removeClass("open")}function i(t){var n=t.attr("data-target"),r;return n||(n=t.attr("href"),n=n&&n.replace(/.*(?=#[^\s]*$)/,"")),r=e(n),r.length||(r=t.parent()),r}var t="[data-toggle=dropdown]",n=function(t){var n=e(t).on("click.dropdown.data-api",this.toggle);e("html").on("click.dropdown.data-api",function(){n.parent().removeClass("open")})};n.prototype={constructor:n,toggle:function(t){var n=e(this),s,o;if(n.is(".disabled, :disabled"))return;return s=i(n),o=s.hasClass("open"),r(),o||(s.toggleClass("open"),n.focus()),!1},keydown:function(t){var n,r,s,o,u,a;if(!/(38|40|27)/.test(t.keyCode))return;n=e(this),t.preventDefault(),t.stopPropagation();if(n.is(".disabled, :disabled"))return;o=i(n),u=o.hasClass("open");if(!u||u&&t.keyCode==27)return n.click();r=e("[role=menu] li:not(.divider) a",o);if(!r.length)return;a=r.index(r.filter(":focus")),t.keyCode==38&&a>0&&a--,t.keyCode==40&&a').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(e.proxy(this.hide,this)),i&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),i?this.$backdrop.one(e.support.transition.end,t):t()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),e.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(e.support.transition.end,e.proxy(this.removeBackdrop,this)):this.removeBackdrop()):t&&t()}},e.fn.modal=function(n){return this.each(function(){var r=e(this),i=r.data("modal"),s=e.extend({},e.fn.modal.defaults,r.data(),typeof n=="object"&&n);i||r.data("modal",i=new t(this,s)),typeof n=="string"?i[n]():s.show&&i.show()})},e.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},e.fn.modal.Constructor=t,e(function(){e("body").on("click.modal.data-api",'[data-toggle="modal"]',function(t){var n=e(this),r=n.attr("href"),i=e(n.attr("data-target")||r&&r.replace(/.*(?=#[^\s]+$)/,"")),s=i.data("modal")?"toggle":e.extend({remote:!/#/.test(r)&&r},i.data(),n.data());t.preventDefault(),i.modal(s).one("hide",function(){n.focus()})})})}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("tooltip",e,t)};t.prototype={constructor:t,init:function(t,n,r){var i,s;this.type=t,this.$element=e(n),this.options=this.getOptions(r),this.enabled=!0,this.options.trigger=="click"?this.$element.on("click."+this.type,this.options.selector,e.proxy(this.toggle,this)):this.options.trigger!="manual"&&(i=this.options.trigger=="hover"?"mouseenter":"focus",s=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(i+"."+this.type,this.options.selector,e.proxy(this.enter,this)),this.$element.on(s+"."+this.type,this.options.selector,e.proxy(this.leave,this))),this.options.selector?this._options=e.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(t){return t=e.extend({},e.fn[this.type].defaults,t,this.$element.data()),t.delay&&typeof t.delay=="number"&&(t.delay={show:t.delay,hide:t.delay}),t},enter:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);if(!n.options.delay||!n.options.delay.show)return n.show();clearTimeout(this.timeout),n.hoverState="in",this.timeout=setTimeout(function(){n.hoverState=="in"&&n.show()},n.options.delay.show)},leave:function(t){var n=e(t.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!n.options.delay||!n.options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(function(){n.hoverState=="out"&&n.hide()},n.options.delay.hide)},show:function(){var e,t,n,r,i,s,o;if(this.hasContent()&&this.enabled){e=this.tip(),this.setContent(),this.options.animation&&e.addClass("fade"),s=typeof this.options.placement=="function"?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,t=/in/.test(s),e.remove().css({top:0,left:0,display:"block"}).appendTo(t?this.$element:document.body),n=this.getPosition(t),r=e[0].offsetWidth,i=e[0].offsetHeight;switch(t?s.split(" ")[1]:s){case"bottom":o={top:n.top+n.height,left:n.left+n.width/2-r/2};break;case"top":o={top:n.top-i,left:n.left+n.width/2-r/2};break;case"left":o={top:n.top+n.height/2-i/2,left:n.left-r};break;case"right":o={top:n.top+n.height/2-i/2,left:n.left+n.width}}e.css(o).addClass(s).addClass("in")}},setContent:function(){var e=this.tip(),t=this.getTitle();e.find(".tooltip-inner")[this.options.html?"html":"text"](t),e.removeClass("fade in top bottom left right")},hide:function(){function r(){var t=setTimeout(function(){n.off(e.support.transition.end).remove()},500);n.one(e.support.transition.end,function(){clearTimeout(t),n.remove()})}var t=this,n=this.tip();return n.removeClass("in"),e.support.transition&&this.$tip.hasClass("fade")?r():n.remove(),this},fixTitle:function(){var e=this.$element;(e.attr("title")||typeof e.attr("data-original-title")!="string")&&e.attr("data-original-title",e.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(t){return e.extend({},t?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-original-title")||(typeof n.title=="function"?n.title.call(t[0]):n.title),e},tip:function(){return this.$tip=this.$tip||e(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}},e.fn.tooltip=function(n){return this.each(function(){var r=e(this),i=r.data("tooltip"),s=typeof n=="object"&&n;i||r.data("tooltip",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.tooltip.Constructor=t,e.fn.tooltip.defaults={animation:!0,placement:"top",selector:!1,template:'
',trigger:"hover",title:"",delay:0,html:!0}}(window.jQuery),!function(e){"use strict";var t=function(e,t){this.init("popover",e,t)};t.prototype=e.extend({},e.fn.tooltip.Constructor.prototype,{constructor:t,setContent:function(){var e=this.tip(),t=this.getTitle(),n=this.getContent();e.find(".popover-title")[this.options.html?"html":"text"](t),e.find(".popover-content > *")[this.options.html?"html":"text"](n),e.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var e,t=this.$element,n=this.options;return e=t.attr("data-content")||(typeof n.content=="function"?n.content.call(t[0]):n.content),e},tip:function(){return this.$tip||(this.$tip=e(this.options.template)),this.$tip},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}}),e.fn.popover=function(n){return this.each(function(){var r=e(this),i=r.data("popover"),s=typeof n=="object"&&n;i||r.data("popover",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.popover.Constructor=t,e.fn.popover.defaults=e.extend({},e.fn.tooltip.defaults,{placement:"right",trigger:"click",content:"",template:'

'})}(window.jQuery),!function(e){"use strict";function t(t,n){var r=e.proxy(this.process,this),i=e(t).is("body")?e(window):e(t),s;this.options=e.extend({},e.fn.scrollspy.defaults,n),this.$scrollElement=i.on("scroll.scroll-spy.data-api",r),this.selector=(this.options.target||(s=e(t).attr("href"))&&s.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=e("body"),this.refresh(),this.process()}t.prototype={constructor:t,refresh:function(){var t=this,n;this.offsets=e([]),this.targets=e([]),n=this.$body.find(this.selector).map(function(){var t=e(this),n=t.data("target")||t.attr("href"),r=/^#\w/.test(n)&&e(n);return r&&r.length&&[[r.position().top,n]]||null}).sort(function(e,t){return e[0]-t[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},process:function(){var e=this.$scrollElement.scrollTop()+this.options.offset,t=this.$scrollElement[0].scrollHeight||this.$body[0].scrollHeight,n=t-this.$scrollElement.height(),r=this.offsets,i=this.targets,s=this.activeTarget,o;if(e>=n)return s!=(o=i.last()[0])&&this.activate(o);for(o=r.length;o--;)s!=i[o]&&e>=r[o]&&(!r[o+1]||e<=r[o+1])&&this.activate(i[o])},activate:function(t){var n,r;this.activeTarget=t,e(this.selector).parent(".active").removeClass("active"),r=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',n=e(r).parent("li").addClass("active"),n.parent(".dropdown-menu").length&&(n=n.closest("li.dropdown").addClass("active")),n.trigger("activate")}},e.fn.scrollspy=function(n){return this.each(function(){var r=e(this),i=r.data("scrollspy"),s=typeof n=="object"&&n;i||r.data("scrollspy",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.scrollspy.Constructor=t,e.fn.scrollspy.defaults={offset:10},e(window).on("load",function(){e('[data-spy="scroll"]').each(function(){var t=e(this);t.scrollspy(t.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t){this.element=e(t)};t.prototype={constructor:t,show:function(){var t=this.element,n=t.closest("ul:not(.dropdown-menu)"),r=t.attr("data-target"),i,s,o;r||(r=t.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,""));if(t.parent("li").hasClass("active"))return;i=n.find(".active a").last()[0],o=e.Event("show",{relatedTarget:i}),t.trigger(o);if(o.isDefaultPrevented())return;s=e(r),this.activate(t.parent("li"),n),this.activate(s,s.parent(),function(){t.trigger({type:"shown",relatedTarget:i})})},activate:function(t,n,r){function o(){i.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),t.addClass("active"),s?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu")&&t.closest("li.dropdown").addClass("active"),r&&r()}var i=n.find("> .active"),s=r&&e.support.transition&&i.hasClass("fade");s?i.one(e.support.transition.end,o):o(),i.removeClass("in")}},e.fn.tab=function(n){return this.each(function(){var r=e(this),i=r.data("tab");i||r.data("tab",i=new t(this)),typeof n=="string"&&i[n]()})},e.fn.tab.Constructor=t,e(function(){e("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(t){t.preventDefault(),e(this).tab("show")})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.typeahead.defaults,n),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.updater=this.options.updater||this.updater,this.$menu=e(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};t.prototype={constructor:t,select:function(){var e=this.$menu.find(".active").attr("data-value");return this.$element.val(this.updater(e)).change(),this.hide()},updater:function(e){return e},show:function(){var t=e.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:t.top+t.height,left:t.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(t){var n;return this.query=this.$element.val(),!this.query||this.query.length"+t+""})},render:function(t){var n=this;return t=e(t).map(function(t,r){return t=e(n.options.item).attr("data-value",r),t.find("a").html(n.highlighter(r)),t[0]}),t.first().addClass("active"),this.$menu.html(t),this},next:function(t){var n=this.$menu.find(".active").removeClass("active"),r=n.next();r.length||(r=e(this.$menu.find("li")[0])),r.addClass("active")},prev:function(e){var t=this.$menu.find(".active").removeClass("active"),n=t.prev();n.length||(n=this.$menu.find("li").last()),n.addClass("active")},listen:function(){this.$element.on("blur",e.proxy(this.blur,this)).on("keypress",e.proxy(this.keypress,this)).on("keyup",e.proxy(this.keyup,this)),(e.browser.webkit||e.browser.msie)&&this.$element.on("keydown",e.proxy(this.keydown,this)),this.$menu.on("click",e.proxy(this.click,this)).on("mouseenter","li",e.proxy(this.mouseenter,this))},move:function(e){if(!this.shown)return;switch(e.keyCode){case 9:case 13:case 27:e.preventDefault();break;case 38:e.preventDefault(),this.prev();break;case 40:e.preventDefault(),this.next()}e.stopPropagation()},keydown:function(t){this.suppressKeyPressRepeat=!~e.inArray(t.keyCode,[40,38,9,13,27]),this.move(t)},keypress:function(e){if(this.suppressKeyPressRepeat)return;this.move(e)},keyup:function(e){switch(e.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:if(!this.shown)return;this.hide();break;default:this.lookup()}e.stopPropagation(),e.preventDefault()},blur:function(e){var t=this;setTimeout(function(){t.hide()},150)},click:function(e){e.stopPropagation(),e.preventDefault(),this.select()},mouseenter:function(t){this.$menu.find(".active").removeClass("active"),e(t.currentTarget).addClass("active")}},e.fn.typeahead=function(n){return this.each(function(){var r=e(this),i=r.data("typeahead"),s=typeof n=="object"&&n;i||r.data("typeahead",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.typeahead.defaults={source:[],items:8,menu:'',item:'
  • ',minLength:1},e.fn.typeahead.Constructor=t,e(function(){e("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(t){var n=e(this);if(n.data("typeahead"))return;t.preventDefault(),n.typeahead(n.data())})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.options=e.extend({},e.fn.affix.defaults,n),this.$window=e(window).on("scroll.affix.data-api",e.proxy(this.checkPosition,this)),this.$element=e(t),this.checkPosition()};t.prototype.checkPosition=function(){if(!this.$element.is(":visible"))return;var t=e(document).height(),n=this.$window.scrollTop(),r=this.$element.offset(),i=this.options.offset,s=i.bottom,o=i.top,u="affix affix-top affix-bottom",a;typeof i!="object"&&(s=o=i),typeof o=="function"&&(o=i.top()),typeof s=="function"&&(s=i.bottom()),a=this.unpin!=null&&n+this.unpin<=r.top?!1:s!=null&&r.top+this.$element.height()>=t-s?"bottom":o!=null&&n<=o?"top":!1;if(this.affixed===a)return;this.affixed=a,this.unpin=a=="bottom"?r.top-n:null,this.$element.removeClass(u).addClass("affix"+(a?"-"+a:""))},e.fn.affix=function(n){return this.each(function(){var r=e(this),i=r.data("affix"),s=typeof n=="object"&&n;i||r.data("affix",i=new t(this,s)),typeof n=="string"&&i[n]()})},e.fn.affix.Constructor=t,e.fn.affix.defaults={offset:0},e(window).on("load",function(){e('[data-spy="affix"]').each(function(){var t=e(this),n=t.data();n.offset=n.offset||{},n.offsetBottom&&(n.offset.bottom=n.offsetBottom),n.offsetTop&&(n.offset.top=n.offsetTop),t.affix(n)})})}(window.jQuery); \ No newline at end of file diff --git a/docs/js/vendor/jquery-1.8.0.min.js b/docs/js/vendor/jquery-1.8.0.min.js new file mode 100644 index 000000000000..066d72c7e3a2 --- /dev/null +++ b/docs/js/vendor/jquery-1.8.0.min.js @@ -0,0 +1,2 @@ +/*! jQuery v@1.8.0 jquery.com | jquery.org/license */ +(function(a,b){function G(a){var b=F[a]={};return p.each(a.split(s),function(a,c){b[c]=!0}),b}function J(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(I,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:+d+""===d?+d:H.test(d)?p.parseJSON(d):d}catch(f){}p.data(a,c,d)}else d=b}return d}function K(a){var b;for(b in a){if(b==="data"&&p.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function ba(){return!1}function bb(){return!0}function bh(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function bi(a,b){do a=a[b];while(a&&a.nodeType!==1);return a}function bj(a,b,c){b=b||0;if(p.isFunction(b))return p.grep(a,function(a,d){var e=!!b.call(a,d,a);return e===c});if(b.nodeType)return p.grep(a,function(a,d){return a===b===c});if(typeof b=="string"){var d=p.grep(a,function(a){return a.nodeType===1});if(be.test(b))return p.filter(b,d,!c);b=p.filter(b,d)}return p.grep(a,function(a,d){return p.inArray(a,b)>=0===c})}function bk(a){var b=bl.split("|"),c=a.createDocumentFragment();if(c.createElement)while(b.length)c.createElement(b.pop());return c}function bC(a,b){return a.getElementsByTagName(b)[0]||a.appendChild(a.ownerDocument.createElement(b))}function bD(a,b){if(b.nodeType!==1||!p.hasData(a))return;var c,d,e,f=p._data(a),g=p._data(b,f),h=f.events;if(h){delete g.handle,g.events={};for(c in h)for(d=0,e=h[c].length;d").appendTo(e.body),c=b.css("display");b.remove();if(c==="none"||c===""){bI=e.body.appendChild(bI||p.extend(e.createElement("iframe"),{frameBorder:0,width:0,height:0}));if(!bJ||!bI.createElement)bJ=(bI.contentWindow||bI.contentDocument).document,bJ.write(""),bJ.close();b=bJ.body.appendChild(bJ.createElement(a)),c=bH(b,"display"),e.body.removeChild(bI)}return bR[a]=c,c}function ch(a,b,c,d){var e;if(p.isArray(b))p.each(b,function(b,e){c||cd.test(a)?d(a,e):ch(a+"["+(typeof e=="object"?b:"")+"]",e,c,d)});else if(!c&&p.type(b)==="object")for(e in b)ch(a+"["+e+"]",b[e],c,d);else d(a,b)}function cy(a){return function(b,c){typeof b!="string"&&(c=b,b="*");var d,e,f,g=b.toLowerCase().split(s),h=0,i=g.length;if(p.isFunction(c))for(;h)[^>]*$|#([\w\-]*)$)/,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^[\],:{}\s]*$/,x=/(?:^|:|,)(?:\s*\[)+/g,y=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,z=/"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,A=/^-ms-/,B=/-([\da-z])/gi,C=function(a,b){return(b+"").toUpperCase()},D=function(){e.addEventListener?(e.removeEventListener("DOMContentLoaded",D,!1),p.ready()):e.readyState==="complete"&&(e.detachEvent("onreadystatechange",D),p.ready())},E={};p.fn=p.prototype={constructor:p,init:function(a,c,d){var f,g,h,i;if(!a)return this;if(a.nodeType)return this.context=this[0]=a,this.length=1,this;if(typeof a=="string"){a.charAt(0)==="<"&&a.charAt(a.length-1)===">"&&a.length>=3?f=[null,a,null]:f=u.exec(a);if(f&&(f[1]||!c)){if(f[1])return c=c instanceof p?c[0]:c,i=c&&c.nodeType?c.ownerDocument||c:e,a=p.parseHTML(f[1],i,!0),v.test(f[1])&&p.isPlainObject(c)&&this.attr.call(a,c,!0),p.merge(this,a);g=e.getElementById(f[2]);if(g&&g.parentNode){if(g.id!==f[2])return d.find(a);this.length=1,this[0]=g}return this.context=e,this.selector=a,this}return!c||c.jquery?(c||d).find(a):this.constructor(c).find(a)}return p.isFunction(a)?d.ready(a):(a.selector!==b&&(this.selector=a.selector,this.context=a.context),p.makeArray(a,this))},selector:"",jquery:"1.8.0",length:0,size:function(){return this.length},toArray:function(){return k.call(this)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=p.merge(this.constructor(),a);return d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")"),d},each:function(a,b){return p.each(this,a,b)},ready:function(a){return p.ready.promise().done(a),this},eq:function(a){return a=+a,a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(k.apply(this,arguments),"slice",k.call(arguments).join(","))},map:function(a){return this.pushStack(p.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:j,sort:[].sort,splice:[].splice},p.fn.init.prototype=p.fn,p.extend=p.fn.extend=function(){var a,c,d,e,f,g,h=arguments[0]||{},i=1,j=arguments.length,k=!1;typeof h=="boolean"&&(k=h,h=arguments[1]||{},i=2),typeof h!="object"&&!p.isFunction(h)&&(h={}),j===i&&(h=this,--i);for(;i0)return;d.resolveWith(e,[p]),p.fn.trigger&&p(e).trigger("ready").off("ready")},isFunction:function(a){return p.type(a)==="function"},isArray:Array.isArray||function(a){return p.type(a)==="array"},isWindow:function(a){return a!=null&&a==a.window},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):E[m.call(a)]||"object"},isPlainObject:function(a){if(!a||p.type(a)!=="object"||a.nodeType||p.isWindow(a))return!1;try{if(a.constructor&&!n.call(a,"constructor")&&!n.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||n.call(a,d)},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},error:function(a){throw new Error(a)},parseHTML:function(a,b,c){var d;return!a||typeof a!="string"?null:(typeof b=="boolean"&&(c=b,b=0),b=b||e,(d=v.exec(a))?[b.createElement(d[1])]:(d=p.buildFragment([a],b,c?null:[]),p.merge([],(d.cacheable?p.clone(d.fragment):d.fragment).childNodes)))},parseJSON:function(b){if(!b||typeof b!="string")return null;b=p.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(w.test(b.replace(y,"@").replace(z,"]").replace(x,"")))return(new Function("return "+b))();p.error("Invalid JSON: "+b)},parseXML:function(c){var d,e;if(!c||typeof c!="string")return null;try{a.DOMParser?(e=new DOMParser,d=e.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(f){d=b}return(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&p.error("Invalid XML: "+c),d},noop:function(){},globalEval:function(b){b&&r.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(A,"ms-").replace(B,C)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var e,f=0,g=a.length,h=g===b||p.isFunction(a);if(d){if(h){for(e in a)if(c.apply(a[e],d)===!1)break}else for(;f0&&a[0]&&a[i-1]||i===0||p.isArray(a));if(j)for(;h-1)i.splice(c,1),e&&(c<=g&&g--,c<=h&&h--)}),this},has:function(a){return p.inArray(a,i)>-1},empty:function(){return i=[],this},disable:function(){return i=j=c=b,this},disabled:function(){return!i},lock:function(){return j=b,c||l.disable(),this},locked:function(){return!j},fireWith:function(a,b){return b=b||[],b=[a,b.slice?b.slice():b],i&&(!d||j)&&(e?j.push(b):k(b)),this},fire:function(){return l.fireWith(this,arguments),this},fired:function(){return!!d}};return l},p.extend({Deferred:function(a){var b=[["resolve","done",p.Callbacks("once memory"),"resolved"],["reject","fail",p.Callbacks("once memory"),"rejected"],["notify","progress",p.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return p.Deferred(function(c){p.each(b,function(b,d){var f=d[0],g=a[b];e[d[1]](p.isFunction(g)?function(){var a=g.apply(this,arguments);a&&p.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f+"With"](this===e?c:this,[a])}:c[f])}),a=null}).promise()},promise:function(a){return typeof a=="object"?p.extend(a,d):d}},e={};return d.pipe=d.then,p.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[a^1][2].disable,b[2][2].lock),e[f[0]]=g.fire,e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=k.call(arguments),d=c.length,e=d!==1||a&&p.isFunction(a.promise)?d:0,f=e===1?a:p.Deferred(),g=function(a,b,c){return function(d){b[a]=this,c[a]=arguments.length>1?k.call(arguments):d,c===h?f.notifyWith(b,c):--e||f.resolveWith(b,c)}},h,i,j;if(d>1){h=new Array(d),i=new Array(d),j=new Array(d);for(;b
    a",c=n.getElementsByTagName("*"),d=n.getElementsByTagName("a")[0],d.style.cssText="top:1px;float:left;opacity:.5";if(!c||!c.length||!d)return{};f=e.createElement("select"),g=f.appendChild(e.createElement("option")),h=n.getElementsByTagName("input")[0],b={leadingWhitespace:n.firstChild.nodeType===3,tbody:!n.getElementsByTagName("tbody").length,htmlSerialize:!!n.getElementsByTagName("link").length,style:/top/.test(d.getAttribute("style")),hrefNormalized:d.getAttribute("href")==="/a",opacity:/^0.5/.test(d.style.opacity),cssFloat:!!d.style.cssFloat,checkOn:h.value==="on",optSelected:g.selected,getSetAttribute:n.className!=="t",enctype:!!e.createElement("form").enctype,html5Clone:e.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",boxModel:e.compatMode==="CSS1Compat",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0,boxSizingReliable:!0,pixelPosition:!1},h.checked=!0,b.noCloneChecked=h.cloneNode(!0).checked,f.disabled=!0,b.optDisabled=!g.disabled;try{delete n.test}catch(o){b.deleteExpando=!1}!n.addEventListener&&n.attachEvent&&n.fireEvent&&(n.attachEvent("onclick",m=function(){b.noCloneEvent=!1}),n.cloneNode(!0).fireEvent("onclick"),n.detachEvent("onclick",m)),h=e.createElement("input"),h.value="t",h.setAttribute("type","radio"),b.radioValue=h.value==="t",h.setAttribute("checked","checked"),h.setAttribute("name","t"),n.appendChild(h),i=e.createDocumentFragment(),i.appendChild(n.lastChild),b.checkClone=i.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=h.checked,i.removeChild(h),i.appendChild(n);if(n.attachEvent)for(k in{submit:!0,change:!0,focusin:!0})j="on"+k,l=j in n,l||(n.setAttribute(j,"return;"),l=typeof n[j]=="function"),b[k+"Bubbles"]=l;return p(function(){var c,d,f,g,h="padding:0;margin:0;border:0;display:block;overflow:hidden;",i=e.getElementsByTagName("body")[0];if(!i)return;c=e.createElement("div"),c.style.cssText="visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px",i.insertBefore(c,i.firstChild),d=e.createElement("div"),c.appendChild(d),d.innerHTML="
    t
    ",f=d.getElementsByTagName("td"),f[0].style.cssText="padding:0;margin:0;border:0;display:none",l=f[0].offsetHeight===0,f[0].style.display="",f[1].style.display="none",b.reliableHiddenOffsets=l&&f[0].offsetHeight===0,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",b.boxSizing=d.offsetWidth===4,b.doesNotIncludeMarginInBodyOffset=i.offsetTop!==1,a.getComputedStyle&&(b.pixelPosition=(a.getComputedStyle(d,null)||{}).top!=="1%",b.boxSizingReliable=(a.getComputedStyle(d,null)||{width:"4px"}).width==="4px",g=e.createElement("div"),g.style.cssText=d.style.cssText=h,g.style.marginRight=g.style.width="0",d.style.width="1px",d.appendChild(g),b.reliableMarginRight=!parseFloat((a.getComputedStyle(g,null)||{}).marginRight)),typeof d.style.zoom!="undefined"&&(d.innerHTML="",d.style.cssText=h+"width:1px;padding:1px;display:inline;zoom:1",b.inlineBlockNeedsLayout=d.offsetWidth===3,d.style.display="block",d.style.overflow="visible",d.innerHTML="
    ",d.firstChild.style.width="5px",b.shrinkWrapBlocks=d.offsetWidth!==3,c.style.zoom=1),i.removeChild(c),c=d=f=g=null}),i.removeChild(n),c=d=f=g=h=i=n=null,b}();var H=/^(?:\{.*\}|\[.*\])$/,I=/([A-Z])/g;p.extend({cache:{},deletedIds:[],uuid:0,expando:"jQuery"+(p.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){return a=a.nodeType?p.cache[a[p.expando]]:a[p.expando],!!a&&!K(a)},data:function(a,c,d,e){if(!p.acceptData(a))return;var f,g,h=p.expando,i=typeof c=="string",j=a.nodeType,k=j?p.cache:a,l=j?a[h]:a[h]&&h;if((!l||!k[l]||!e&&!k[l].data)&&i&&d===b)return;l||(j?a[h]=l=p.deletedIds.pop()||++p.uuid:l=h),k[l]||(k[l]={},j||(k[l].toJSON=p.noop));if(typeof c=="object"||typeof c=="function")e?k[l]=p.extend(k[l],c):k[l].data=p.extend(k[l].data,c);return f=k[l],e||(f.data||(f.data={}),f=f.data),d!==b&&(f[p.camelCase(c)]=d),i?(g=f[c],g==null&&(g=f[p.camelCase(c)])):g=f,g},removeData:function(a,b,c){if(!p.acceptData(a))return;var d,e,f,g=a.nodeType,h=g?p.cache:a,i=g?a[p.expando]:p.expando;if(!h[i])return;if(b){d=c?h[i]:h[i].data;if(d){p.isArray(b)||(b in d?b=[b]:(b=p.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,f=b.length;e1,null,!1))},removeData:function(a){return this.each(function(){p.removeData(this,a)})}}),p.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=p._data(a,b),c&&(!d||p.isArray(c)?d=p._data(a,b,p.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=p.queue(a,b),d=c.shift(),e=p._queueHooks(a,b),f=function(){p.dequeue(a,b)};d==="inprogress"&&(d=c.shift()),d&&(b==="fx"&&c.unshift("inprogress"),delete e.stop,d.call(a,f,e)),!c.length&&e&&e.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return p._data(a,c)||p._data(a,c,{empty:p.Callbacks("once memory").add(function(){p.removeData(a,b+"queue",!0),p.removeData(a,c,!0)})})}}),p.fn.extend({queue:function(a,c){var d=2;return typeof a!="string"&&(c=a,a="fx",d--),arguments.length1)},removeAttr:function(a){return this.each(function(){p.removeAttr(this,a)})},prop:function(a,b){return p.access(this,p.prop,a,b,arguments.length>1)},removeProp:function(a){return a=p.propFix[a]||a,this.each(function(){try{this[a]=b,delete this[a]}catch(c){}})},addClass:function(a){var b,c,d,e,f,g,h;if(p.isFunction(a))return this.each(function(b){p(this).addClass(a.call(this,b,this.className))});if(a&&typeof a=="string"){b=a.split(s);for(c=0,d=this.length;c-1)d=d.replace(" "+c[f]+" "," ");e.className=a?p.trim(d):""}}}return this},toggleClass:function(a,b){var c=typeof a,d=typeof b=="boolean";return p.isFunction(a)?this.each(function(c){p(this).toggleClass(a.call(this,c,this.className,b),b)}):this.each(function(){if(c==="string"){var e,f=0,g=p(this),h=b,i=a.split(s);while(e=i[f++])h=d?h:!g.hasClass(e),g[h?"addClass":"removeClass"](e)}else if(c==="undefined"||c==="boolean")this.className&&p._data(this,"__className__",this.className),this.className=this.className||a===!1?"":p._data(this,"__className__")||""})},hasClass:function(a){var b=" "+a+" ",c=0,d=this.length;for(;c-1)return!0;return!1},val:function(a){var c,d,e,f=this[0];if(!arguments.length){if(f)return c=p.valHooks[f.type]||p.valHooks[f.nodeName.toLowerCase()],c&&"get"in c&&(d=c.get(f,"value"))!==b?d:(d=f.value,typeof d=="string"?d.replace(P,""):d==null?"":d);return}return e=p.isFunction(a),this.each(function(d){var f,g=p(this);if(this.nodeType!==1)return;e?f=a.call(this,d,g.val()):f=a,f==null?f="":typeof f=="number"?f+="":p.isArray(f)&&(f=p.map(f,function(a){return a==null?"":a+""})),c=p.valHooks[this.type]||p.valHooks[this.nodeName.toLowerCase()];if(!c||!("set"in c)||c.set(this,f,"value")===b)this.value=f})}}),p.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,f=a.selectedIndex,g=[],h=a.options,i=a.type==="select-one";if(f<0)return null;c=i?f:0,d=i?f+1:h.length;for(;c=0}),c.length||(a.selectedIndex=-1),c}}},attrFn:{},attr:function(a,c,d,e){var f,g,h,i=a.nodeType;if(!a||i===3||i===8||i===2)return;if(e&&p.isFunction(p.fn[c]))return p(a)[c](d);if(typeof a.getAttribute=="undefined")return p.prop(a,c,d);h=i!==1||!p.isXMLDoc(a),h&&(c=c.toLowerCase(),g=p.attrHooks[c]||(T.test(c)?M:L));if(d!==b){if(d===null){p.removeAttr(a,c);return}return g&&"set"in g&&h&&(f=g.set(a,d,c))!==b?f:(a.setAttribute(c,""+d),d)}return g&&"get"in g&&h&&(f=g.get(a,c))!==null?f:(f=a.getAttribute(c),f===null?b:f)},removeAttr:function(a,b){var c,d,e,f,g=0;if(b&&a.nodeType===1){d=b.split(s);for(;g=0}})});var V=/^(?:textarea|input|select)$/i,W=/^([^\.]*|)(?:\.(.+)|)$/,X=/(?:^|\s)hover(\.\S+|)\b/,Y=/^key/,Z=/^(?:mouse|contextmenu)|click/,$=/^(?:focusinfocus|focusoutblur)$/,_=function(a){return p.event.special.hover?a:a.replace(X,"mouseenter$1 mouseleave$1")};p.event={add:function(a,c,d,e,f){var g,h,i,j,k,l,m,n,o,q,r;if(a.nodeType===3||a.nodeType===8||!c||!d||!(g=p._data(a)))return;d.handler&&(o=d,d=o.handler,f=o.selector),d.guid||(d.guid=p.guid++),i=g.events,i||(g.events=i={}),h=g.handle,h||(g.handle=h=function(a){return typeof p!="undefined"&&(!a||p.event.triggered!==a.type)?p.event.dispatch.apply(h.elem,arguments):b},h.elem=a),c=p.trim(_(c)).split(" ");for(j=0;j=0&&(s=s.slice(0,-1),i=!0),s.indexOf(".")>=0&&(t=s.split("."),s=t.shift(),t.sort());if((!f||p.event.customEvent[s])&&!p.event.global[s])return;c=typeof c=="object"?c[p.expando]?c:new p.Event(s,c):new p.Event(s),c.type=s,c.isTrigger=!0,c.exclusive=i,c.namespace=t.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+t.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,m=s.indexOf(":")<0?"on"+s:"";if(!f){h=p.cache;for(j in h)h[j].events&&h[j].events[s]&&p.event.trigger(c,d,h[j].handle.elem,!0);return}c.result=b,c.target||(c.target=f),d=d!=null?p.makeArray(d):[],d.unshift(c),n=p.event.special[s]||{};if(n.trigger&&n.trigger.apply(f,d)===!1)return;q=[[f,n.bindType||s]];if(!g&&!n.noBubble&&!p.isWindow(f)){r=n.delegateType||s,k=$.test(r+s)?f:f.parentNode;for(l=f;k;k=k.parentNode)q.push([k,r]),l=k;l===(f.ownerDocument||e)&&q.push([l.defaultView||l.parentWindow||a,r])}for(j=0;jq&&u.push({elem:this,matches:o.slice(q)});for(d=0;d0?this.on(b,null,a,c):this.trigger(b)},Y.test(b)&&(p.event.fixHooks[b]=p.event.keyHooks),Z.test(b)&&(p.event.fixHooks[b]=p.event.mouseHooks)}),function(a,b){function bd(a,b,c,d){var e=0,f=b.length;for(;e0?h(g,c,f):[]}function bf(a,c,d,e,f){var g,h,i,j,k,l,m,n,p=0,q=f.length,s=L.POS,t=new RegExp("^"+s.source+"(?!"+r+")","i"),u=function(){var a=1,c=arguments.length-2;for(;ai){m=a.slice(i,g.index),i=n,l=[c],B.test(m)&&(k&&(l=k),k=e);if(h=H.test(m))m=m.slice(0,-5).replace(B,"$&*");g.length>1&&g[0].replace(t,u),k=be(m,g[1],g[2],l,k,h)}}k?(j=j.concat(k),(m=a.slice(i))&&m!==")"?B.test(m)?bd(m,j,d,e):Z(m,c,d,e?e.concat(k):k):o.apply(d,j)):Z(a,c,d,e)}return q===1?d:Z.uniqueSort(d)}function bg(a,b,c){var d,e,f,g=[],i=0,j=D.exec(a),k=!j.pop()&&!j.pop(),l=k&&a.match(C)||[""],m=$.preFilter,n=$.filter,o=!c&&b!==h;for(;(e=l[i])!=null&&k;i++){g.push(d=[]),o&&(e=" "+e);while(e){k=!1;if(j=B.exec(e))e=e.slice(j[0].length),k=d.push({part:j.pop().replace(A," "),captures:j});for(f in n)(j=L[f].exec(e))&&(!m[f]||(j=m[f](j,b,c)))&&(e=e.slice(j.shift().length),k=d.push({part:f,captures:j}));if(!k)break}}return k||Z.error(a),g}function bh(a,b,e){var f=b.dir,g=m++;return a||(a=function(a){return a===e}),b.first?function(b,c){while(b=b[f])if(b.nodeType===1)return a(b,c)&&b}:function(b,e){var h,i=g+"."+d,j=i+"."+c;while(b=b[f])if(b.nodeType===1){if((h=b[q])===j)return b.sizset;if(typeof h=="string"&&h.indexOf(i)===0){if(b.sizset)return b}else{b[q]=j;if(a(b,e))return b.sizset=!0,b;b.sizset=!1}}}}function bi(a,b){return a?function(c,d){var e=b(c,d);return e&&a(e===!0?c:e,d)}:b}function bj(a,b,c){var d,e,f=0;for(;d=a[f];f++)$.relative[d.part]?e=bh(e,$.relative[d.part],b):(d.captures.push(b,c),e=bi(e,$.filter[d.part].apply(null,d.captures)));return e}function bk(a){return function(b,c){var d,e=0;for(;d=a[e];e++)if(d(b,c))return!0;return!1}}var c,d,e,f,g,h=a.document,i=h.documentElement,j="undefined",k=!1,l=!0,m=0,n=[].slice,o=[].push,q=("sizcache"+Math.random()).replace(".",""),r="[\\x20\\t\\r\\n\\f]",s="(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",t=s.replace("w","w#"),u="([*^$|!~]?=)",v="\\["+r+"*("+s+")"+r+"*(?:"+u+r+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+t+")|)|)"+r+"*\\]",w=":("+s+")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|((?:[^,]|\\\\,|(?:,(?=[^\\[]*\\]))|(?:,(?=[^\\(]*\\))))*))\\)|)",x=":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)",y=r+"*([\\x20\\t\\r\\n\\f>+~])"+r+"*",z="(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|"+v+"|"+w.replace(2,7)+"|[^\\\\(),])+",A=new RegExp("^"+r+"+|((?:^|[^\\\\])(?:\\\\.)*)"+r+"+$","g"),B=new RegExp("^"+y),C=new RegExp(z+"?(?="+r+"*,|$)","g"),D=new RegExp("^(?:(?!,)(?:(?:^|,)"+r+"*"+z+")*?|"+r+"*(.*?))(\\)|$)"),E=new RegExp(z.slice(19,-6)+"\\x20\\t\\r\\n\\f>+~])+|"+y,"g"),F=/^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,G=/[\x20\t\r\n\f]*[+~]/,H=/:not\($/,I=/h\d/i,J=/input|select|textarea|button/i,K=/\\(?!\\)/g,L={ID:new RegExp("^#("+s+")"),CLASS:new RegExp("^\\.("+s+")"),NAME:new RegExp("^\\[name=['\"]?("+s+")['\"]?\\]"),TAG:new RegExp("^("+s.replace("[-","[-\\*")+")"),ATTR:new RegExp("^"+v),PSEUDO:new RegExp("^"+w),CHILD:new RegExp("^:(only|nth|last|first)-child(?:\\("+r+"*(even|odd|(([+-]|)(\\d*)n|)"+r+"*(?:([+-]|)"+r+"*(\\d+)|))"+r+"*\\)|)","i"),POS:new RegExp(x,"ig"),needsContext:new RegExp("^"+r+"*[>+~]|"+x,"i")},M={},N=[],O={},P=[],Q=function(a){return a.sizzleFilter=!0,a},R=function(a){return function(b){return b.nodeName.toLowerCase()==="input"&&b.type===a}},S=function(a){return function(b){var c=b.nodeName.toLowerCase();return(c==="input"||c==="button")&&b.type===a}},T=function(a){var b=!1,c=h.createElement("div");try{b=a(c)}catch(d){}return c=null,b},U=T(function(a){a.innerHTML="";var b=typeof a.lastChild.getAttribute("multiple");return b!=="boolean"&&b!=="string"}),V=T(function(a){a.id=q+0,a.innerHTML="
    ",i.insertBefore(a,i.firstChild);var b=h.getElementsByName&&h.getElementsByName(q).length===2+h.getElementsByName(q+0).length;return g=!h.getElementById(q),i.removeChild(a),b}),W=T(function(a){return a.appendChild(h.createComment("")),a.getElementsByTagName("*").length===0}),X=T(function(a){return a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!==j&&a.firstChild.getAttribute("href")==="#"}),Y=T(function(a){return a.innerHTML="",!a.getElementsByClassName||a.getElementsByClassName("e").length===0?!1:(a.lastChild.className="e",a.getElementsByClassName("e").length!==1)}),Z=function(a,b,c,d){c=c||[],b=b||h;var e,f,g,i,j=b.nodeType;if(j!==1&&j!==9)return[];if(!a||typeof a!="string")return c;g=ba(b);if(!g&&!d)if(e=F.exec(a))if(i=e[1]){if(j===9){f=b.getElementById(i);if(!f||!f.parentNode)return c;if(f.id===i)return c.push(f),c}else if(b.ownerDocument&&(f=b.ownerDocument.getElementById(i))&&bb(b,f)&&f.id===i)return c.push(f),c}else{if(e[2])return o.apply(c,n.call(b.getElementsByTagName(a),0)),c;if((i=e[3])&&Y&&b.getElementsByClassName)return o.apply(c,n.call(b.getElementsByClassName(i),0)),c}return bm(a,b,c,d,g)},$=Z.selectors={cacheLength:50,match:L,order:["ID","TAG"],attrHandle:{},createPseudo:Q,find:{ID:g?function(a,b,c){if(typeof b.getElementById!==j&&!c){var d=b.getElementById(a);return d&&d.parentNode?[d]:[]}}:function(a,c,d){if(typeof c.getElementById!==j&&!d){var e=c.getElementById(a);return e?e.id===a||typeof e.getAttributeNode!==j&&e.getAttributeNode("id").value===a?[e]:b:[]}},TAG:W?function(a,b){if(typeof b.getElementsByTagName!==j)return b.getElementsByTagName(a)}:function(a,b){var c=b.getElementsByTagName(a);if(a==="*"){var d,e=[],f=0;for(;d=c[f];f++)d.nodeType===1&&e.push(d);return e}return c}},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(K,""),a[3]=(a[4]||a[5]||"").replace(K,""),a[2]==="~="&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),a[1]==="nth"?(a[2]||Z.error(a[0]),a[3]=+(a[3]?a[4]+(a[5]||1):2*(a[2]==="even"||a[2]==="odd")),a[4]=+(a[6]+a[7]||a[2]==="odd")):a[2]&&Z.error(a[0]),a},PSEUDO:function(a){var b,c=a[4];return L.CHILD.test(a[0])?null:(c&&(b=D.exec(c))&&b.pop()&&(a[0]=a[0].slice(0,b[0].length-c.length-1),c=b[0].slice(0,-1)),a.splice(2,3,c||a[3]),a)}},filter:{ID:g?function(a){return a=a.replace(K,""),function(b){return b.getAttribute("id")===a}}:function(a){return a=a.replace(K,""),function(b){var c=typeof b.getAttributeNode!==j&&b.getAttributeNode("id");return c&&c.value===a}},TAG:function(a){return a==="*"?function(){return!0}:(a=a.replace(K,"").toLowerCase(),function(b){return b.nodeName&&b.nodeName.toLowerCase()===a})},CLASS:function(a){var b=M[a];return b||(b=M[a]=new RegExp("(^|"+r+")"+a+"("+r+"|$)"),N.push(a),N.length>$.cacheLength&&delete M[N.shift()]),function(a){return b.test(a.className||typeof a.getAttribute!==j&&a.getAttribute("class")||"")}},ATTR:function(a,b,c){return b?function(d){var e=Z.attr(d,a),f=e+"";if(e==null)return b==="!=";switch(b){case"=":return f===c;case"!=":return f!==c;case"^=":return c&&f.indexOf(c)===0;case"*=":return c&&f.indexOf(c)>-1;case"$=":return c&&f.substr(f.length-c.length)===c;case"~=":return(" "+f+" ").indexOf(c)>-1;case"|=":return f===c||f.substr(0,c.length+1)===c+"-"}}:function(b){return Z.attr(b,a)!=null}},CHILD:function(a,b,c,d){if(a==="nth"){var e=m++;return function(a){var b,f,g=0,h=a;if(c===1&&d===0)return!0;b=a.parentNode;if(b&&(b[q]!==e||!a.sizset)){for(h=b.firstChild;h;h=h.nextSibling)if(h.nodeType===1){h.sizset=++g;if(h===a)break}b[q]=e}return f=a.sizset-d,c===0?f===0:f%c===0&&f/c>=0}}return function(b){var c=b;switch(a){case"only":case"first":while(c=c.previousSibling)if(c.nodeType===1)return!1;if(a==="first")return!0;c=b;case"last":while(c=c.nextSibling)if(c.nodeType===1)return!1;return!0}}},PSEUDO:function(a,b,c,d){var e=$.pseudos[a]||$.pseudos[a.toLowerCase()];return e||Z.error("unsupported pseudo: "+a),e.sizzleFilter?e(b,c,d):e}},pseudos:{not:Q(function(a,b,c){var d=bl(a.replace(A,"$1"),b,c);return function(a){return!d(a)}}),enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&!!a.checked||b==="option"&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},parent:function(a){return!$.pseudos.empty(a)},empty:function(a){var b;a=a.firstChild;while(a){if(a.nodeName>"@"||(b=a.nodeType)===3||b===4)return!1;a=a.nextSibling}return!0},contains:Q(function(a){return function(b){return(b.textContent||b.innerText||bc(b)).indexOf(a)>-1}}),has:Q(function(a){return function(b){return Z(a,b).length>0}}),header:function(a){return I.test(a.nodeName)},text:function(a){var b,c;return a.nodeName.toLowerCase()==="input"&&(b=a.type)==="text"&&((c=a.getAttribute("type"))==null||c.toLowerCase()===b)},radio:R("radio"),checkbox:R("checkbox"),file:R("file"),password:R("password"),image:R("image"),submit:S("submit"),reset:S("reset"),button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&a.type==="button"||b==="button"},input:function(a){return J.test(a.nodeName)},focus:function(a){var b=a.ownerDocument;return a===b.activeElement&&(!b.hasFocus||b.hasFocus())&&(!!a.type||!!a.href)},active:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b,c){return c?a.slice(1):[a[0]]},last:function(a,b,c){var d=a.pop();return c?a:[d]},even:function(a,b,c){var d=[],e=c?1:0,f=a.length;for(;e$.cacheLength&&delete O[P.shift()],g};Z.matches=function(a,b){return Z(a,null,null,b)},Z.matchesSelector=function(a,b){return Z(b,null,null,[a]).length>0};var bm=function(a,b,e,f,g){a=a.replace(A,"$1");var h,i,j,k,l,m,p,q,r,s=a.match(C),t=a.match(E),u=b.nodeType;if(L.POS.test(a))return bf(a,b,e,f,s);if(f)h=n.call(f,0);else if(s&&s.length===1){if(t.length>1&&u===9&&!g&&(s=L.ID.exec(t[0]))){b=$.find.ID(s[1],b,g)[0];if(!b)return e;a=a.slice(t.shift().length)}q=(s=G.exec(t[0]))&&!s.index&&b.parentNode||b,r=t.pop(),m=r.split(":not")[0];for(j=0,k=$.order.length;j",a.querySelectorAll("[selected]").length||e.push("\\["+r+"*(?:checked|disabled|ismap|multiple|readonly|selected|value)"),a.querySelectorAll(":checked").length||e.push(":checked")}),T(function(a){a.innerHTML="

    ",a.querySelectorAll("[test^='']").length&&e.push("[*^$]="+r+"*(?:\"\"|'')"),a.innerHTML="",a.querySelectorAll(":enabled").length||e.push(":enabled",":disabled")}),e=e.length&&new RegExp(e.join("|")),bm=function(a,d,f,g,h){if(!g&&!h&&(!e||!e.test(a)))if(d.nodeType===9)try{return o.apply(f,n.call(d.querySelectorAll(a),0)),f}catch(i){}else if(d.nodeType===1&&d.nodeName.toLowerCase()!=="object"){var j=d.getAttribute("id"),k=j||q,l=G.test(a)&&d.parentNode||d;j?k=k.replace(c,"\\$&"):d.setAttribute("id",k);try{return o.apply(f,n.call(l.querySelectorAll(a.replace(C,"[id='"+k+"'] $&")),0)),f}catch(i){}finally{j||d.removeAttribute("id")}}return b(a,d,f,g,h)},g&&(T(function(b){a=g.call(b,"div");try{g.call(b,"[test!='']:sizzle"),f.push($.match.PSEUDO)}catch(c){}}),f=new RegExp(f.join("|")),Z.matchesSelector=function(b,c){c=c.replace(d,"='$1']");if(!ba(b)&&!f.test(c)&&(!e||!e.test(c)))try{var h=g.call(b,c);if(h||a||b.document&&b.document.nodeType!==11)return h}catch(i){}return Z(c,null,null,[b]).length>0})}(),Z.attr=p.attr,p.find=Z,p.expr=Z.selectors,p.expr[":"]=p.expr.pseudos,p.unique=Z.uniqueSort,p.text=Z.getText,p.isXMLDoc=Z.isXML,p.contains=Z.contains}(a);var bc=/Until$/,bd=/^(?:parents|prev(?:Until|All))/,be=/^.[^:#\[\.,]*$/,bf=p.expr.match.needsContext,bg={children:!0,contents:!0,next:!0,prev:!0};p.fn.extend({find:function(a){var b,c,d,e,f,g,h=this;if(typeof a!="string")return p(a).filter(function(){for(b=0,c=h.length;b0)for(e=d;e=0:p.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c,d=0,e=this.length,f=[],g=bf.test(a)||typeof a!="string"?p(a,b||this.context):0;for(;d-1:p.find.matchesSelector(c,a)){f.push(c);break}c=c.parentNode}}return f=f.length>1?p.unique(f):f,this.pushStack(f,"closest",a)},index:function(a){return a?typeof a=="string"?p.inArray(this[0],p(a)):p.inArray(a.jquery?a[0]:a,this):this[0]&&this[0].parentNode?this.prevAll().length:-1},add:function(a,b){var c=typeof a=="string"?p(a,b):p.makeArray(a&&a.nodeType?[a]:a),d=p.merge(this.get(),c);return this.pushStack(bh(c[0])||bh(d[0])?d:p.unique(d))},addBack:function(a){return this.add(a==null?this.prevObject:this.prevObject.filter(a))}}),p.fn.andSelf=p.fn.addBack,p.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return p.dir(a,"parentNode")},parentsUntil:function(a,b,c){return p.dir(a,"parentNode",c)},next:function(a){return bi(a,"nextSibling")},prev:function(a){return bi(a,"previousSibling")},nextAll:function(a){return p.dir(a,"nextSibling")},prevAll:function(a){return p.dir(a,"previousSibling")},nextUntil:function(a,b,c){return p.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return p.dir(a,"previousSibling",c)},siblings:function(a){return p.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return p.sibling(a.firstChild)},contents:function(a){return p.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:p.merge([],a.childNodes)}},function(a,b){p.fn[a]=function(c,d){var e=p.map(this,b,c);return bc.test(a)||(d=c),d&&typeof d=="string"&&(e=p.filter(d,e)),e=this.length>1&&!bg[a]?p.unique(e):e,this.length>1&&bd.test(a)&&(e=e.reverse()),this.pushStack(e,a,k.call(arguments).join(","))}}),p.extend({filter:function(a,b,c){return c&&(a=":not("+a+")"),b.length===1?p.find.matchesSelector(b[0],a)?[b[0]]:[]:p.find.matches(a,b)},dir:function(a,c,d){var e=[],f=a[c];while(f&&f.nodeType!==9&&(d===b||f.nodeType!==1||!p(f).is(d)))f.nodeType===1&&e.push(f),f=f[c];return e},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var bl="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",bm=/ jQuery\d+="(?:null|\d+)"/g,bn=/^\s+/,bo=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bp=/<([\w:]+)/,bq=/]","i"),bv=/^(?:checkbox|radio)$/,bw=/checked\s*(?:[^=]|=\s*.checked.)/i,bx=/\/(java|ecma)script/i,by=/^\s*\s*$/g,bz={option:[1,""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bA=bk(e),bB=bA.appendChild(e.createElement("div"));bz.optgroup=bz.option,bz.tbody=bz.tfoot=bz.colgroup=bz.caption=bz.thead,bz.th=bz.td,p.support.htmlSerialize||(bz._default=[1,"X
    ","
    "]),p.fn.extend({text:function(a){return p.access(this,function(a){return a===b?p.text(this):this.empty().append((this[0]&&this[0].ownerDocument||e).createTextNode(a))},null,a,arguments.length)},wrapAll:function(a){if(p.isFunction(a))return this.each(function(b){p(this).wrapAll(a.call(this,b))});if(this[0]){var b=p(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){return p.isFunction(a)?this.each(function(b){p(this).wrapInner(a.call(this,b))}):this.each(function(){var b=p(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=p.isFunction(a);return this.each(function(c){p(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){p.nodeName(this,"body")||p(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){(this.nodeType===1||this.nodeType===11)&&this.insertBefore(a,this.firstChild)})},before:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(a,this),"before",this.selector)}},after:function(){if(!bh(this[0]))return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=p.clean(arguments);return this.pushStack(p.merge(this,a),"after",this.selector)}},remove:function(a,b){var c,d=0;for(;(c=this[d])!=null;d++)if(!a||p.filter(a,[c]).length)!b&&c.nodeType===1&&(p.cleanData(c.getElementsByTagName("*")),p.cleanData([c])),c.parentNode&&c.parentNode.removeChild(c);return this},empty:function(){var a,b=0;for(;(a=this[b])!=null;b++){a.nodeType===1&&p.cleanData(a.getElementsByTagName("*"));while(a.firstChild)a.removeChild(a.firstChild)}return this},clone:function(a,b){return a=a==null?!1:a,b=b==null?a:b,this.map(function(){return p.clone(this,a,b)})},html:function(a){return p.access(this,function(a){var c=this[0]||{},d=0,e=this.length;if(a===b)return c.nodeType===1?c.innerHTML.replace(bm,""):b;if(typeof a=="string"&&!bs.test(a)&&(p.support.htmlSerialize||!bu.test(a))&&(p.support.leadingWhitespace||!bn.test(a))&&!bz[(bp.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(bo,"<$1>");try{for(;d1&&typeof j=="string"&&bw.test(j))return this.each(function(){p(this).domManip(a,c,d)});if(p.isFunction(j))return this.each(function(e){var f=p(this);a[0]=j.call(this,e,c?f.html():b),f.domManip(a,c,d)});if(this[0]){e=p.buildFragment(a,this,k),g=e.fragment,f=g.firstChild,g.childNodes.length===1&&(g=f);if(f){c=c&&p.nodeName(f,"tr");for(h=e.cacheable||l-1;i0?this.clone(!0):this).get(),p(g[e])[b](d),f=f.concat(d);return this.pushStack(f,a,g.selector)}}),p.extend({clone:function(a,b,c){var d,e,f,g;p.support.html5Clone||p.isXMLDoc(a)||!bu.test("<"+a.nodeName+">")?g=a.cloneNode(!0):(bB.innerHTML=a.outerHTML,bB.removeChild(g=bB.firstChild));if((!p.support.noCloneEvent||!p.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!p.isXMLDoc(a)){bE(a,g),d=bF(a),e=bF(g);for(f=0;d[f];++f)e[f]&&bE(d[f],e[f])}if(b){bD(a,g);if(c){d=bF(a),e=bF(g);for(f=0;d[f];++f)bD(d[f],e[f])}}return d=e=null,g},clean:function(a,b,c,d){var f,g,h,i,j,k,l,m,n,o,q,r,s=0,t=[];if(!b||typeof b.createDocumentFragment=="undefined")b=e;for(g=b===e&&bA;(h=a[s])!=null;s++){typeof h=="number"&&(h+="");if(!h)continue;if(typeof h=="string")if(!br.test(h))h=b.createTextNode(h);else{g=g||bk(b),l=l||g.appendChild(b.createElement("div")),h=h.replace(bo,"<$1>"),i=(bp.exec(h)||["",""])[1].toLowerCase(),j=bz[i]||bz._default,k=j[0],l.innerHTML=j[1]+h+j[2];while(k--)l=l.lastChild;if(!p.support.tbody){m=bq.test(h),n=i==="table"&&!m?l.firstChild&&l.firstChild.childNodes:j[1]===""&&!m?l.childNodes:[];for(f=n.length-1;f>=0;--f)p.nodeName(n[f],"tbody")&&!n[f].childNodes.length&&n[f].parentNode.removeChild(n[f])}!p.support.leadingWhitespace&&bn.test(h)&&l.insertBefore(b.createTextNode(bn.exec(h)[0]),l.firstChild),h=l.childNodes,l=g.lastChild}h.nodeType?t.push(h):t=p.merge(t,h)}l&&(g.removeChild(l),h=l=g=null);if(!p.support.appendChecked)for(s=0;(h=t[s])!=null;s++)p.nodeName(h,"input")?bG(h):typeof h.getElementsByTagName!="undefined"&&p.grep(h.getElementsByTagName("input"),bG);if(c){q=function(a){if(!a.type||bx.test(a.type))return d?d.push(a.parentNode?a.parentNode.removeChild(a):a):c.appendChild(a)};for(s=0;(h=t[s])!=null;s++)if(!p.nodeName(h,"script")||!q(h))c.appendChild(h),typeof h.getElementsByTagName!="undefined"&&(r=p.grep(p.merge([],h.getElementsByTagName("script")),q),t.splice.apply(t,[s+1,0].concat(r)),s+=r.length)}return t},cleanData:function(a,b){var c,d,e,f,g=0,h=p.expando,i=p.cache,j=p.support.deleteExpando,k=p.event.special;for(;(e=a[g])!=null;g++)if(b||p.acceptData(e)){d=e[h],c=d&&i[d];if(c){if(c.events)for(f in c.events)k[f]?p.event.remove(e,f):p.removeEvent(e,f,c.handle);i[d]&&(delete i[d],j?delete e[h]:e.removeAttribute?e.removeAttribute(h):e[h]=null,p.deletedIds.push(d))}}}}),function(){var a,b;p.uaMatch=function(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}},a=p.uaMatch(g.userAgent),b={},a.browser&&(b[a.browser]=!0,b.version=a.version),b.webkit&&(b.safari=!0),p.browser=b,p.sub=function(){function a(b,c){return new a.fn.init(b,c)}p.extend(!0,a,this),a.superclass=this,a.fn=a.prototype=this(),a.fn.constructor=a,a.sub=this.sub,a.fn.init=function c(c,d){return d&&d instanceof p&&!(d instanceof a)&&(d=a(d)),p.fn.init.call(this,c,d,b)},a.fn.init.prototype=a.fn;var b=a(e);return a}}();var bH,bI,bJ,bK=/alpha\([^)]*\)/i,bL=/opacity=([^)]*)/,bM=/^(top|right|bottom|left)$/,bN=/^margin/,bO=new RegExp("^("+q+")(.*)$","i"),bP=new RegExp("^("+q+")(?!px)[a-z%]+$","i"),bQ=new RegExp("^([-+])=("+q+")","i"),bR={},bS={position:"absolute",visibility:"hidden",display:"block"},bT={letterSpacing:0,fontWeight:400,lineHeight:1},bU=["Top","Right","Bottom","Left"],bV=["Webkit","O","Moz","ms"],bW=p.fn.toggle;p.fn.extend({css:function(a,c){return p.access(this,function(a,c,d){return d!==b?p.style(a,c,d):p.css(a,c)},a,c,arguments.length>1)},show:function(){return bZ(this,!0)},hide:function(){return bZ(this)},toggle:function(a,b){var c=typeof a=="boolean";return p.isFunction(a)&&p.isFunction(b)?bW.apply(this,arguments):this.each(function(){(c?a:bY(this))?p(this).show():p(this).hide()})}}),p.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=bH(a,"opacity");return c===""?"1":c}}}},cssNumber:{fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":p.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,c,d,e){if(!a||a.nodeType===3||a.nodeType===8||!a.style)return;var f,g,h,i=p.camelCase(c),j=a.style;c=p.cssProps[i]||(p.cssProps[i]=bX(j,i)),h=p.cssHooks[c]||p.cssHooks[i];if(d===b)return h&&"get"in h&&(f=h.get(a,!1,e))!==b?f:j[c];g=typeof d,g==="string"&&(f=bQ.exec(d))&&(d=(f[1]+1)*f[2]+parseFloat(p.css(a,c)),g="number");if(d==null||g==="number"&&isNaN(d))return;g==="number"&&!p.cssNumber[i]&&(d+="px");if(!h||!("set"in h)||(d=h.set(a,d,e))!==b)try{j[c]=d}catch(k){}},css:function(a,c,d,e){var f,g,h,i=p.camelCase(c);return c=p.cssProps[i]||(p.cssProps[i]=bX(a.style,i)),h=p.cssHooks[c]||p.cssHooks[i],h&&"get"in h&&(f=h.get(a,!0,e)),f===b&&(f=bH(a,c)),f==="normal"&&c in bT&&(f=bT[c]),d||e!==b?(g=parseFloat(f),d||p.isNumeric(g)?g||0:f):f},swap:function(a,b,c){var d,e,f={};for(e in b)f[e]=a.style[e],a.style[e]=b[e];d=c.call(a);for(e in b)a.style[e]=f[e];return d}}),a.getComputedStyle?bH=function(a,b){var c,d,e,f,g=getComputedStyle(a,null),h=a.style;return g&&(c=g[b],c===""&&!p.contains(a.ownerDocument.documentElement,a)&&(c=p.style(a,b)),bP.test(c)&&bN.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=c,c=g.width,h.width=d,h.minWidth=e,h.maxWidth=f)),c}:e.documentElement.currentStyle&&(bH=function(a,b){var c,d,e=a.currentStyle&&a.currentStyle[b],f=a.style;return e==null&&f&&f[b]&&(e=f[b]),bP.test(e)&&!bM.test(b)&&(c=f.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),f.left=b==="fontSize"?"1em":e,e=f.pixelLeft+"px",f.left=c,d&&(a.runtimeStyle.left=d)),e===""?"auto":e}),p.each(["height","width"],function(a,b){p.cssHooks[b]={get:function(a,c,d){if(c)return a.offsetWidth!==0||bH(a,"display")!=="none"?ca(a,b,d):p.swap(a,bS,function(){return ca(a,b,d)})},set:function(a,c,d){return b$(a,c,d?b_(a,b,d,p.support.boxSizing&&p.css(a,"boxSizing")==="border-box"):0)}}}),p.support.opacity||(p.cssHooks.opacity={get:function(a,b){return bL.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=p.isNumeric(b)?"alpha(opacity="+b*100+")":"",f=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&p.trim(f.replace(bK,""))===""&&c.removeAttribute){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bK.test(f)?f.replace(bK,e):f+" "+e}}),p(function(){p.support.reliableMarginRight||(p.cssHooks.marginRight={get:function(a,b){return p.swap(a,{display:"inline-block"},function(){if(b)return bH(a,"marginRight")})}}),!p.support.pixelPosition&&p.fn.position&&p.each(["top","left"],function(a,b){p.cssHooks[b]={get:function(a,c){if(c){var d=bH(a,b);return bP.test(d)?p(a).position()[b]+"px":d}}}})}),p.expr&&p.expr.filters&&(p.expr.filters.hidden=function(a){return a.offsetWidth===0&&a.offsetHeight===0||!p.support.reliableHiddenOffsets&&(a.style&&a.style.display||bH(a,"display"))==="none"},p.expr.filters.visible=function(a){return!p.expr.filters.hidden(a)}),p.each({margin:"",padding:"",border:"Width"},function(a,b){p.cssHooks[a+b]={expand:function(c){var d,e=typeof c=="string"?c.split(" "):[c],f={};for(d=0;d<4;d++)f[a+bU[d]+b]=e[d]||e[d-2]||e[0];return f}},bN.test(a)||(p.cssHooks[a+b].set=b$)});var cc=/%20/g,cd=/\[\]$/,ce=/\r?\n/g,cf=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,cg=/^(?:select|textarea)/i;p.fn.extend({serialize:function(){return p.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?p.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||cg.test(this.nodeName)||cf.test(this.type))}).map(function(a,b){var c=p(this).val();return c==null?null:p.isArray(c)?p.map(c,function(a,c){return{name:b.name,value:a.replace(ce,"\r\n")}}):{name:b.name,value:c.replace(ce,"\r\n")}}).get()}}),p.param=function(a,c){var d,e=[],f=function(a,b){b=p.isFunction(b)?b():b==null?"":b,e[e.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=p.ajaxSettings&&p.ajaxSettings.traditional);if(p.isArray(a)||a.jquery&&!p.isPlainObject(a))p.each(a,function(){f(this.name,this.value)});else for(d in a)ch(d,a[d],c,f);return e.join("&").replace(cc,"+")};var ci,cj,ck=/#.*$/,cl=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,cm=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,cn=/^(?:GET|HEAD)$/,co=/^\/\//,cp=/\?/,cq=/)<[^<]*)*<\/script>/gi,cr=/([?&])_=[^&]*/,cs=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,ct=p.fn.load,cu={},cv={},cw=["*/"]+["*"];try{ci=f.href}catch(cx){ci=e.createElement("a"),ci.href="",ci=ci.href}cj=cs.exec(ci.toLowerCase())||[],p.fn.load=function(a,c,d){if(typeof a!="string"&&ct)return ct.apply(this,arguments);if(!this.length)return this;var e,f,g,h=this,i=a.indexOf(" ");return i>=0&&(e=a.slice(i,a.length),a=a.slice(0,i)),p.isFunction(c)?(d=c,c=b):typeof c=="object"&&(f="POST"),p.ajax({url:a,type:f,dataType:"html",data:c,complete:function(a,b){d&&h.each(d,g||[a.responseText,b,a])}}).done(function(a){g=arguments,h.html(e?p("
    ").append(a.replace(cq,"")).find(e):a)}),this},p.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){p.fn[b]=function(a){return this.on(b,a)}}),p.each(["get","post"],function(a,c){p[c]=function(a,d,e,f){return p.isFunction(d)&&(f=f||e,e=d,d=b),p.ajax({type:c,url:a,data:d,success:e,dataType:f})}}),p.extend({getScript:function(a,c){return p.get(a,b,c,"script")},getJSON:function(a,b,c){return p.get(a,b,c,"json")},ajaxSetup:function(a,b){return b?cA(a,p.ajaxSettings):(b=a,a=p.ajaxSettings),cA(a,b),a},ajaxSettings:{url:ci,isLocal:cm.test(cj[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded; charset=UTF-8",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":cw},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":p.parseJSON,"text xml":p.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:cy(cu),ajaxTransport:cy(cv),ajax:function(a,c){function y(a,c,f,i){var k,s,t,u,w,y=c;if(v===2)return;v=2,h&&clearTimeout(h),g=b,e=i||"",x.readyState=a>0?4:0,f&&(u=cB(l,x,f));if(a>=200&&a<300||a===304)l.ifModified&&(w=x.getResponseHeader("Last-Modified"),w&&(p.lastModified[d]=w),w=x.getResponseHeader("Etag"),w&&(p.etag[d]=w)),a===304?(y="notmodified",k=!0):(k=cC(l,u),y=k.state,s=k.data,t=k.error,k=!t);else{t=y;if(!y||a)y="error",a<0&&(a=0)}x.status=a,x.statusText=""+(c||y),k?o.resolveWith(m,[s,y,x]):o.rejectWith(m,[x,y,t]),x.statusCode(r),r=b,j&&n.trigger("ajax"+(k?"Success":"Error"),[x,l,k?s:t]),q.fireWith(m,[x,y]),j&&(n.trigger("ajaxComplete",[x,l]),--p.active||p.event.trigger("ajaxStop"))}typeof a=="object"&&(c=a,a=b),c=c||{};var d,e,f,g,h,i,j,k,l=p.ajaxSetup({},c),m=l.context||l,n=m!==l&&(m.nodeType||m instanceof p)?p(m):p.event,o=p.Deferred(),q=p.Callbacks("once memory"),r=l.statusCode||{},t={},u={},v=0,w="canceled",x={readyState:0,setRequestHeader:function(a,b){if(!v){var c=a.toLowerCase();a=u[c]=u[c]||a,t[a]=b}return this},getAllResponseHeaders:function(){return v===2?e:null},getResponseHeader:function(a){var c;if(v===2){if(!f){f={};while(c=cl.exec(e))f[c[1].toLowerCase()]=c[2]}c=f[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){return v||(l.mimeType=a),this},abort:function(a){return a=a||w,g&&g.abort(a),y(0,a),this}};o.promise(x),x.success=x.done,x.error=x.fail,x.complete=q.add,x.statusCode=function(a){if(a){var b;if(v<2)for(b in a)r[b]=[r[b],a[b]];else b=a[x.status],x.always(b)}return this},l.url=((a||l.url)+"").replace(ck,"").replace(co,cj[1]+"//"),l.dataTypes=p.trim(l.dataType||"*").toLowerCase().split(s),l.crossDomain==null&&(i=cs.exec(l.url.toLowerCase()),l.crossDomain=!(!i||i[1]==cj[1]&&i[2]==cj[2]&&(i[3]||(i[1]==="http:"?80:443))==(cj[3]||(cj[1]==="http:"?80:443)))),l.data&&l.processData&&typeof l.data!="string"&&(l.data=p.param(l.data,l.traditional)),cz(cu,l,c,x);if(v===2)return x;j=l.global,l.type=l.type.toUpperCase(),l.hasContent=!cn.test(l.type),j&&p.active++===0&&p.event.trigger("ajaxStart");if(!l.hasContent){l.data&&(l.url+=(cp.test(l.url)?"&":"?")+l.data,delete l.data),d=l.url;if(l.cache===!1){var z=p.now(),A=l.url.replace(cr,"$1_="+z);l.url=A+(A===l.url?(cp.test(l.url)?"&":"?")+"_="+z:"")}}(l.data&&l.hasContent&&l.contentType!==!1||c.contentType)&&x.setRequestHeader("Content-Type",l.contentType),l.ifModified&&(d=d||l.url,p.lastModified[d]&&x.setRequestHeader("If-Modified-Since",p.lastModified[d]),p.etag[d]&&x.setRequestHeader("If-None-Match",p.etag[d])),x.setRequestHeader("Accept",l.dataTypes[0]&&l.accepts[l.dataTypes[0]]?l.accepts[l.dataTypes[0]]+(l.dataTypes[0]!=="*"?", "+cw+"; q=0.01":""):l.accepts["*"]);for(k in l.headers)x.setRequestHeader(k,l.headers[k]);if(!l.beforeSend||l.beforeSend.call(m,x,l)!==!1&&v!==2){w="abort";for(k in{success:1,error:1,complete:1})x[k](l[k]);g=cz(cv,l,c,x);if(!g)y(-1,"No Transport");else{x.readyState=1,j&&n.trigger("ajaxSend",[x,l]),l.async&&l.timeout>0&&(h=setTimeout(function(){x.abort("timeout")},l.timeout));try{v=1,g.send(t,y)}catch(B){if(v<2)y(-1,B);else throw B}}return x}return x.abort()},active:0,lastModified:{},etag:{}});var cD=[],cE=/\?/,cF=/(=)\?(?=&|$)|\?\?/,cG=p.now();p.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=cD.pop()||p.expando+"_"+cG++;return this[a]=!0,a}}),p.ajaxPrefilter("json jsonp",function(c,d,e){var f,g,h,i=c.data,j=c.url,k=c.jsonp!==!1,l=k&&cF.test(j),m=k&&!l&&typeof i=="string"&&!(c.contentType||"").indexOf("application/x-www-form-urlencoded")&&cF.test(i);if(c.dataTypes[0]==="jsonp"||l||m)return f=c.jsonpCallback=p.isFunction(c.jsonpCallback)?c.jsonpCallback():c.jsonpCallback,g=a[f],l?c.url=j.replace(cF,"$1"+f):m?c.data=i.replace(cF,"$1"+f):k&&(c.url+=(cE.test(j)?"&":"?")+c.jsonp+"="+f),c.converters["script json"]=function(){return h||p.error(f+" was not called"),h[0]},c.dataTypes[0]="json",a[f]=function(){h=arguments},e.always(function(){a[f]=g,c[f]&&(c.jsonpCallback=d.jsonpCallback,cD.push(f)),h&&p.isFunction(g)&&g(h[0]),h=g=b}),"script"}),p.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){return p.globalEval(a),a}}}),p.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),p.ajaxTransport("script",function(a){if(a.crossDomain){var c,d=e.head||e.getElementsByTagName("head")[0]||e.documentElement;return{send:function(f,g){c=e.createElement("script"),c.async="async",a.scriptCharset&&(c.charset=a.scriptCharset),c.src=a.url,c.onload=c.onreadystatechange=function(a,e){if(e||!c.readyState||/loaded|complete/.test(c.readyState))c.onload=c.onreadystatechange=null,d&&c.parentNode&&d.removeChild(c),c=b,e||g(200,"success")},d.insertBefore(c,d.firstChild)},abort:function(){c&&c.onload(0,1)}}}});var cH,cI=a.ActiveXObject?function(){for(var a in cH)cH[a](0,1)}:!1,cJ=0;p.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&cK()||cL()}:cK,function(a){p.extend(p.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(p.ajaxSettings.xhr()),p.support.ajax&&p.ajaxTransport(function(c){if(!c.crossDomain||p.support.cors){var d;return{send:function(e,f){var g,h,i=c.xhr();c.username?i.open(c.type,c.url,c.async,c.username,c.password):i.open(c.type,c.url,c.async);if(c.xhrFields)for(h in c.xhrFields)i[h]=c.xhrFields[h];c.mimeType&&i.overrideMimeType&&i.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(h in e)i.setRequestHeader(h,e[h])}catch(j){}i.send(c.hasContent&&c.data||null),d=function(a,e){var h,j,k,l,m;try{if(d&&(e||i.readyState===4)){d=b,g&&(i.onreadystatechange=p.noop,cI&&delete cH[g]);if(e)i.readyState!==4&&i.abort();else{h=i.status,k=i.getAllResponseHeaders(),l={},m=i.responseXML,m&&m.documentElement&&(l.xml=m);try{l.text=i.responseText}catch(a){}try{j=i.statusText}catch(n){j=""}!h&&c.isLocal&&!c.crossDomain?h=l.text?200:404:h===1223&&(h=204)}}}catch(o){e||f(-1,o)}l&&f(h,j,l,k)},c.async?i.readyState===4?setTimeout(d,0):(g=++cJ,cI&&(cH||(cH={},p(a).unload(cI)),cH[g]=d),i.onreadystatechange=d):d()},abort:function(){d&&d(0,1)}}}});var cM,cN,cO=/^(?:toggle|show|hide)$/,cP=new RegExp("^(?:([-+])=|)("+q+")([a-z%]*)$","i"),cQ=/queueHooks$/,cR=[cX],cS={"*":[function(a,b){var c,d,e,f=this.createTween(a,b),g=cP.exec(b),h=f.cur(),i=+h||0,j=1;if(g){c=+g[2],d=g[3]||(p.cssNumber[a]?"":"px");if(d!=="px"&&i){i=p.css(f.elem,a,!0)||c||1;do e=j=j||".5",i=i/j,p.style(f.elem,a,i+d),j=f.cur()/h;while(j!==1&&j!==e)}f.unit=d,f.start=i,f.end=g[1]?i+(g[1]+1)*c:c}return f}]};p.Animation=p.extend(cV,{tweener:function(a,b){p.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");var c,d=0,e=a.length;for(;d-1,j={},k={},l,m;i?(k=e.position(),l=k.top,m=k.left):(l=parseFloat(g)||0,m=parseFloat(h)||0),p.isFunction(b)&&(b=b.call(a,c,f)),b.top!=null&&(j.top=b.top-f.top+l),b.left!=null&&(j.left=b.left-f.left+m),"using"in b?b.using.call(a,j):e.css(j)}},p.fn.extend({position:function(){if(!this[0])return;var a=this[0],b=this.offsetParent(),c=this.offset(),d=c$.test(b[0].nodeName)?{top:0,left:0}:b.offset();return c.top-=parseFloat(p.css(a,"marginTop"))||0,c.left-=parseFloat(p.css(a,"marginLeft"))||0,d.top+=parseFloat(p.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(p.css(b[0],"borderLeftWidth"))||0,{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||e.body;while(a&&!c$.test(a.nodeName)&&p.css(a,"position")==="static")a=a.offsetParent;return a||e.body})}}),p.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(a,c){var d=/Y/.test(c);p.fn[a]=function(e){return p.access(this,function(a,e,f){var g=c_(a);if(f===b)return g?c in g?g[c]:g.document.documentElement[e]:a[e];g?g.scrollTo(d?p(g).scrollLeft():f,d?f:p(g).scrollTop()):a[e]=f},a,e,arguments.length,null)}}),p.each({Height:"height",Width:"width"},function(a,c){p.each({padding:"inner"+a,content:c,"":"outer"+a},function(d,e){p.fn[e]=function(e,f){var g=arguments.length&&(d||typeof e!="boolean"),h=d||(e===!0||f===!0?"margin":"border");return p.access(this,function(c,d,e){var f;return p.isWindow(c)?c.document.documentElement["client"+a]:c.nodeType===9?(f=c.documentElement,Math.max(c.body["scroll"+a],f["scroll"+a],c.body["offset"+a],f["offset"+a],f["client"+a])):e===b?p.css(c,d,e,h):p.style(c,d,e,h)},c,g?e:b,g)}})}),a.jQuery=a.$=p,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return p})})(window); \ No newline at end of file diff --git a/docs/js/vendor/modernizr-2.6.1-respond-1.1.0.min.js b/docs/js/vendor/modernizr-2.6.1-respond-1.1.0.min.js new file mode 100644 index 000000000000..8e708949c079 --- /dev/null +++ b/docs/js/vendor/modernizr-2.6.1-respond-1.1.0.min.js @@ -0,0 +1,11 @@ +/* Modernizr 2.6.1 (Custom Build) | MIT & BSD + * Build: http://modernizr.com/download/#-fontface-backgroundsize-borderimage-borderradius-boxshadow-flexbox-hsla-multiplebgs-opacity-rgba-textshadow-cssanimations-csscolumns-generatedcontent-cssgradients-cssreflections-csstransforms-csstransforms3d-csstransitions-applicationcache-canvas-canvastext-draganddrop-hashchange-history-audio-video-indexeddb-input-inputtypes-localstorage-postmessage-sessionstorage-websockets-websqldatabase-webworkers-geolocation-inlinesvg-smil-svg-svgclippaths-touch-webgl-shiv-mq-cssclasses-addtest-prefixed-teststyles-testprop-testallprops-hasevent-prefixes-domprefixes-load + */ +;window.Modernizr=function(a,b,c){function D(a){j.cssText=a}function E(a,b){return D(n.join(a+";")+(b||""))}function F(a,b){return typeof a===b}function G(a,b){return!!~(""+a).indexOf(b)}function H(a,b){for(var d in a){var e=a[d];if(!G(e,"-")&&j[e]!==c)return b=="pfx"?e:!0}return!1}function I(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:F(f,"function")?f.bind(d||b):f}return!1}function J(a,b,c){var d=a.charAt(0).toUpperCase()+a.slice(1),e=(a+" "+p.join(d+" ")+d).split(" ");return F(b,"string")||F(b,"undefined")?H(e,b):(e=(a+" "+q.join(d+" ")+d).split(" "),I(e,b,c))}function K(){e.input=function(c){for(var d=0,e=c.length;d',a,""].join(""),k.id=h,(l?k:m).innerHTML+=f,m.appendChild(k),l||(m.style.background="",g.appendChild(m)),i=c(k,a),l?k.parentNode.removeChild(k):m.parentNode.removeChild(m),!!i},z=function(b){var c=a.matchMedia||a.msMatchMedia;if(c)return c(b).matches;var d;return y("@media "+b+" { #"+h+" { position: absolute; } }",function(b){d=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle)["position"]=="absolute"}),d},A=function(){function d(d,e){e=e||b.createElement(a[d]||"div"),d="on"+d;var f=d in e;return f||(e.setAttribute||(e=b.createElement("div")),e.setAttribute&&e.removeAttribute&&(e.setAttribute(d,""),f=F(e[d],"function"),F(e[d],"undefined")||(e[d]=c),e.removeAttribute(d))),e=null,f}var a={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return d}(),B={}.hasOwnProperty,C;!F(B,"undefined")&&!F(B.call,"undefined")?C=function(a,b){return B.call(a,b)}:C=function(a,b){return b in a&&F(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=w.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(w.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(w.call(arguments)))};return e}),s.flexbox=function(){return J("flexWrap")},s.canvas=function(){var a=b.createElement("canvas");return!!a.getContext&&!!a.getContext("2d")},s.canvastext=function(){return!!e.canvas&&!!F(b.createElement("canvas").getContext("2d").fillText,"function")},s.webgl=function(){return!!a.WebGLRenderingContext},s.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:y(["@media (",n.join("touch-enabled),("),h,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c},s.geolocation=function(){return"geolocation"in navigator},s.postmessage=function(){return!!a.postMessage},s.websqldatabase=function(){return!!a.openDatabase},s.indexedDB=function(){return!!J("indexedDB",a)},s.hashchange=function(){return A("hashchange",a)&&(b.documentMode===c||b.documentMode>7)},s.history=function(){return!!a.history&&!!history.pushState},s.draganddrop=function(){var a=b.createElement("div");return"draggable"in a||"ondragstart"in a&&"ondrop"in a},s.websockets=function(){return"WebSocket"in a||"MozWebSocket"in a},s.rgba=function(){return D("background-color:rgba(150,255,150,.5)"),G(j.backgroundColor,"rgba")},s.hsla=function(){return D("background-color:hsla(120,40%,100%,.5)"),G(j.backgroundColor,"rgba")||G(j.backgroundColor,"hsla")},s.multiplebgs=function(){return D("background:url(https://),url(https://),red url(https://)"),/(url\s*\(.*?){3}/.test(j.background)},s.backgroundsize=function(){return J("backgroundSize")},s.borderimage=function(){return J("borderImage")},s.borderradius=function(){return J("borderRadius")},s.boxshadow=function(){return J("boxShadow")},s.textshadow=function(){return b.createElement("div").style.textShadow===""},s.opacity=function(){return E("opacity:.55"),/^0.55$/.test(j.opacity)},s.cssanimations=function(){return J("animationName")},s.csscolumns=function(){return J("columnCount")},s.cssgradients=function(){var a="background-image:",b="gradient(linear,left top,right bottom,from(#9f9),to(white));",c="linear-gradient(left top,#9f9, white);";return D((a+"-webkit- ".split(" ").join(b+a)+n.join(c+a)).slice(0,-a.length)),G(j.backgroundImage,"gradient")},s.cssreflections=function(){return J("boxReflect")},s.csstransforms=function(){return!!J("transform")},s.csstransforms3d=function(){var a=!!J("perspective");return a&&"webkitPerspective"in g.style&&y("@media (transform-3d),(-webkit-transform-3d){#modernizr{left:9px;position:absolute;height:3px;}}",function(b,c){a=b.offsetLeft===9&&b.offsetHeight===3}),a},s.csstransitions=function(){return J("transition")},s.fontface=function(){var a;return y('@font-face {font-family:"font";src:url("https://")}',function(c,d){var e=b.getElementById("smodernizr"),f=e.sheet||e.styleSheet,g=f?f.cssRules&&f.cssRules[0]?f.cssRules[0].cssText:f.cssText||"":"";a=/src/i.test(g)&&g.indexOf(d.split(" ")[0])===0}),a},s.generatedcontent=function(){var a;return y(['#modernizr:after{content:"',l,'";visibility:hidden}'].join(""),function(b){a=b.offsetHeight>=1}),a},s.video=function(){var a=b.createElement("video"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/,""),c.h264=a.canPlayType('video/mp4; codecs="avc1.42E01E"').replace(/^no$/,""),c.webm=a.canPlayType('video/webm; codecs="vp8, vorbis"').replace(/^no$/,"")}catch(d){}return c},s.audio=function(){var a=b.createElement("audio"),c=!1;try{if(c=!!a.canPlayType)c=new Boolean(c),c.ogg=a.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),c.mp3=a.canPlayType("audio/mpeg;").replace(/^no$/,""),c.wav=a.canPlayType('audio/wav; codecs="1"').replace(/^no$/,""),c.m4a=(a.canPlayType("audio/x-m4a;")||a.canPlayType("audio/aac;")).replace(/^no$/,"")}catch(d){}return c},s.localstorage=function(){try{return localStorage.setItem(h,h),localStorage.removeItem(h),!0}catch(a){return!1}},s.sessionstorage=function(){try{return sessionStorage.setItem(h,h),sessionStorage.removeItem(h),!0}catch(a){return!1}},s.webworkers=function(){return!!a.Worker},s.applicationcache=function(){return!!a.applicationCache},s.svg=function(){return!!b.createElementNS&&!!b.createElementNS(r.svg,"svg").createSVGRect},s.inlinesvg=function(){var a=b.createElement("div");return a.innerHTML="",(a.firstChild&&a.firstChild.namespaceURI)==r.svg},s.smil=function(){return!!b.createElementNS&&/SVGAnimate/.test(m.call(b.createElementNS(r.svg,"animate")))},s.svgclippaths=function(){return!!b.createElementNS&&/SVGClipPath/.test(m.call(b.createElementNS(r.svg,"clipPath")))};for(var L in s)C(s,L)&&(x=L.toLowerCase(),e[x]=s[L](),v.push((e[x]?"":"no-")+x));return e.input||K(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)C(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,f&&(g.className+=" "+(b?"":"no-")+a),e[a]=b}return e},D(""),i=k=null,function(a,b){function k(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x",d.insertBefore(c.lastChild,d.firstChild)}function l(){var a=r.elements;return typeof a=="string"?a.split(" "):a}function m(a){var b=i[a[g]];return b||(b={},h++,a[g]=h,i[h]=b),b}function n(a,c,f){c||(c=b);if(j)return c.createElement(a);f||(f=m(c));var g;return f.cache[a]?g=f.cache[a].cloneNode():e.test(a)?g=(f.cache[a]=f.createElem(a)).cloneNode():g=f.createElem(a),g.canHaveChildren&&!d.test(a)?f.frag.appendChild(g):g}function o(a,c){a||(a=b);if(j)return a.createDocumentFragment();c=c||m(a);var d=c.frag.cloneNode(),e=0,f=l(),g=f.length;for(;e",f="hidden"in a,j=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){f=!0,j=!0}})();var r={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,supportsUnknownElements:j,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:q,createElement:n,createDocumentFragment:o};a.html5=r,q(b)}(this,b),e._version=d,e._prefixes=n,e._domPrefixes=q,e._cssomPrefixes=p,e.mq=z,e.hasEvent=A,e.testProp=function(a){return H([a])},e.testAllProps=J,e.testStyles=y,e.prefixed=function(a,b,c){return b?J(a,b,c):J(a,"pfx")},g.className=g.className.replace(/(^|\s)no-js(\s|$)/,"$1$2")+(f?" js "+v.join(" "):""),e}(this,this.document),function(a,b,c){function d(a){return o.call(a)=="[object Function]"}function e(a){return typeof a=="string"}function f(){}function g(a){return!a||a=="loaded"||a=="complete"||a=="uninitialized"}function h(){var a=p.shift();q=1,a?a.t?m(function(){(a.t=="c"?B.injectCss:B.injectJs)(a.s,0,a.a,a.x,a.e,1)},0):(a(),h()):q=0}function i(a,c,d,e,f,i,j){function k(b){if(!o&&g(l.readyState)&&(u.r=o=1,!q&&h(),l.onload=l.onreadystatechange=null,b)){a!="img"&&m(function(){t.removeChild(l)},50);for(var d in y[c])y[c].hasOwnProperty(d)&&y[c][d].onload()}}var j=j||B.errorTimeout,l={},o=0,r=0,u={t:d,s:c,e:f,a:i,x:j};y[c]===1&&(r=1,y[c]=[],l=b.createElement(a)),a=="object"?l.data=c:(l.src=c,l.type=a),l.width=l.height="0",l.onerror=l.onload=l.onreadystatechange=function(){k.call(this,r)},p.splice(e,0,u),a!="img"&&(r||y[c]===2?(t.insertBefore(l,s?null:n),m(k,j)):y[c].push(l))}function j(a,b,c,d,f){return q=0,b=b||"j",e(a)?i(b=="c"?v:u,a,b,this.i++,c,d,f):(p.splice(this.i++,0,a),p.length==1&&h()),this}function k(){var a=B;return a.loader={load:j,i:0},a}var l=b.documentElement,m=a.setTimeout,n=b.getElementsByTagName("script")[0],o={}.toString,p=[],q=0,r="MozAppearance"in l.style,s=r&&!!b.createRange().compareNode,t=s?l:n.parentNode,l=a.opera&&o.call(a.opera)=="[object Opera]",l=!!b.attachEvent&&!l,u=r?"object":l?"script":"img",v=l?"script":u,w=Array.isArray||function(a){return o.call(a)=="[object Array]"},x=[],y={},z={timeout:function(a,b){return b.length&&(a.timeout=b[0]),a}},A,B;B=function(a){function b(a){var a=a.split("!"),b=x.length,c=a.pop(),d=a.length,c={url:c,origUrl:c,prefixes:a},e,f,g;for(f=0;f #mq-test-1 { width: 42px; }';a.insertBefore(d,b);c=g.offsetWidth==42;a.removeChild(d);return{matches:c,media:h}}})(document); + +/*! Respond.js v1.1.0: min/max-width media query polyfill. (c) Scott Jehl. MIT/GPLv2 Lic. j.mp/respondjs */ +(function(e){e.respond={};respond.update=function(){};respond.mediaQueriesSupported=e.matchMedia&&e.matchMedia("only all").matches;if(respond.mediaQueriesSupported){return}var w=e.document,s=w.documentElement,i=[],k=[],q=[],o={},h=30,f=w.getElementsByTagName("head")[0]||s,g=w.getElementsByTagName("base")[0],b=f.getElementsByTagName("link"),d=[],a=function(){var D=b,y=D.length,B=0,A,z,C,x;for(;B-1,minw:F.match(/\(min\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:F.match(/\(max\-width:[\s]*([\s]*[0-9\.]+)(px|em)[\s]*\)/)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}}j()},l,r,v=function(){var z,A=w.createElement("div"),x=w.body,y=false;A.style.cssText="position:absolute;font-size:1em;width:1em";if(!x){x=y=w.createElement("body");x.style.background="none"}x.appendChild(A);s.insertBefore(x,s.firstChild);z=A.offsetWidth;if(y){s.removeChild(x)}else{x.removeChild(A)}z=p=parseFloat(z);return z},p,j=function(I){var x="clientWidth",B=s[x],H=w.compatMode==="CSS1Compat"&&B||w.body[x]||B,D={},G=b[b.length-1],z=(new Date()).getTime();if(I&&l&&z-l-1?(p||v()):1)}if(!!J){J=parseFloat(J)*(J.indexOf(y)>-1?(p||v()):1)}if(!K.hasquery||(!A||!L)&&(A||H>=C)&&(L||H<=J)){if(!D[K.media]){D[K.media]=[]}D[K.media].push(k[K.rules])}}for(var E in q){if(q[E]&&q[E].parentNode===f){f.removeChild(q[E])}}for(var E in D){var M=w.createElement("style"),F=D[E].join("\n");M.type="text/css";M.media=E;f.insertBefore(M,G.nextSibling);if(M.styleSheet){M.styleSheet.cssText=F}else{M.appendChild(w.createTextNode(F))}q.push(M)}},n=function(x,z){var y=c();if(!y){return}y.open("GET",x,true);y.onreadystatechange=function(){if(y.readyState!=4||y.status!=200&&y.status!=304){return}z(y.responseText)};if(y.readyState==4){return}y.send(null)},c=(function(){var x=false;try{x=new XMLHttpRequest()}catch(y){x=new ActiveXObject("Microsoft.XMLHTTP")}return function(){return x}})();a();respond.update=a;function t(){j(true)}if(e.addEventListener){e.addEventListener("resize",t,false)}else{if(e.attachEvent){e.attachEvent("onresize",t)}}})(this); \ No newline at end of file diff --git a/docs/resources/tachyon-code-formatter-eclipse.xml b/docs/resources/tachyon-code-formatter-eclipse.xml new file mode 100644 index 000000000000..2eeb6a7b4008 --- /dev/null +++ b/docs/resources/tachyon-code-formatter-eclipse.xml @@ -0,0 +1,291 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/libexec/tachyon-config.sh b/libexec/tachyon-config.sh index 71a49d255cbe..04519b013b44 100755 --- a/libexec/tachyon-config.sh +++ b/libexec/tachyon-config.sh @@ -42,11 +42,11 @@ if [ -z "$TACHYON_SYSTEM_INSTALLATION" ]; then export TACHYON_HOME=${TACHYON_PREFIX} export TACHYON_CONF_DIR="$TACHYON_HOME/conf" export TACHYON_LOGS_DIR="$TACHYON_HOME/logs" - export TACHYON_JAR=$TACHYON_HOME/target/tachyon-0.4.0-SNAPSHOT-jar-with-dependencies.jar + export TACHYON_JAR=$TACHYON_HOME/target/tachyon-0.5.0-SNAPSHOT-jar-with-dependencies.jar export JAVA="$JAVA_HOME/bin/java" fi -# Environment settings should override * and are adminstrator controlled. +# Environment settings should override * and are administrator controlled. if [ -e $TACHYON_CONF_DIR/tachyon-env.sh ] ; then . $TACHYON_CONF_DIR/tachyon-env.sh -fi \ No newline at end of file +fi diff --git a/pom.xml b/pom.xml index 808ed5091113..a6df8d05d9f4 100644 --- a/pom.xml +++ b/pom.xml @@ -19,13 +19,14 @@ 4.0.0 org.tachyonproject tachyon - 0.4.0-SNAPSHOT + 0.5.0-SNAPSHOT jar - Tachyon Project POM + Tachyon: Reliable File Sharing at Memory Speed Across Cluster Frameworks + Tachyon Project Main http://tachyonproject.org/ - BSD License + Apache License https://github.com/amplab/tachyon/blob/master/LICENSE repo @@ -34,7 +35,7 @@ scm:git:git@github.com:amplab/tachyon.git scm:git:git@github.com:amplab/tachyon.git scm:git:git@github.com:amplab/tachyon.git - v0.3.0 + v0.4.1 @@ -59,12 +60,13 @@ UTF-8 - 1.7 + 1.6 1.0.4 - 0.7.0 + 0.9.0 2.7.0 7.6.8.v20121106 1.7.2 + 1.5.4 1.2.17 2.1.0-incubating @@ -87,37 +89,6 @@ - - org.apache.hadoop - hadoop-client - ${hadoop.version} - - - asm - asm - - - org.jboss.netty - netty - - - org.codehaus.jackson - jackson-core-asl - - - org.codehaus.jackson - jackson-mapper-asl - - - org.codehaus.jackson - jackson-jaxrs - - - org.codehaus.jackson - jackson-xc - - - org.apache.ant ant @@ -153,6 +124,18 @@ 4.10 test + + org.powermock + powermock-module-junit4 + ${powermock.version} + test + + + org.powermock + powermock-api-mockito + ${powermock.version} + test + org.slf4j slf4j-api @@ -208,6 +191,120 @@ + + + integrationTest + + + integration + + + + tachyon.LocalMiniDFSCluster + + + + org.apache.hadoop + hadoop-minicluster + ${hadoop.version} + + + asm + asm + + + org.jboss.netty + netty + + + org.codehaus.jackson + jackson-core-asl + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-jaxrs + + + org.codehaus.jackson + jackson-xc + + + + + + + default + + + !integration + + true + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + + default-testCompile + test-compile + + + **/LocalMiniDFSCluster.java + + + + testCompile + + + + + + + + + org.apache.hadoop + hadoop-client + ${hadoop.version} + + + asm + asm + + + org.jboss.netty + netty + + + org.codehaus.jackson + jackson-core-asl + + + org.codehaus.jackson + jackson-mapper-asl + + + org.codehaus.jackson + jackson-jaxrs + + + org.codehaus.jackson + jackson-xc + + + + + + + @@ -251,6 +348,8 @@ maven-surefire-plugin 2.14 + -Dufs=${ufs} + true file:src/test/resources/log4j.properties @@ -284,6 +383,25 @@ maven-release-plugin 2.4.1 + + org.apache.maven.plugins + maven-jar-plugin + 2.4 + + + + true + + + + + + + test-jar + + + + diff --git a/src/main/java/tachyon/Constants.java b/src/main/java/tachyon/Constants.java index a27e3fab09f7..4f3a0a069b7e 100644 --- a/src/main/java/tachyon/Constants.java +++ b/src/main/java/tachyon/Constants.java @@ -25,12 +25,23 @@ public class Constants { public static final int GB = MB * 1024; public static final long TB = GB * 1024L; + public static final String ANSI_RESET = "\u001B[0m"; + public static final String ANSI_BLACK = "\u001B[30m"; + public static final String ANSI_RED = "\u001B[31m"; + public static final String ANSI_GREEN = "\u001B[32m"; + public static final String ANSI_YELLOW = "\u001B[33m"; + public static final String ANSI_BLUE = "\u001B[34m"; + public static final String ANSI_PURPLE = "\u001B[35m"; + public static final String ANSI_CYAN = "\u001B[36m"; + public static final String ANSI_WHITE = "\u001B[37m"; + public static final long SECOND_MS = 1000; public static final long MINUTE_MS = SECOND_MS * 60; public static final long HOUR_MS = MINUTE_MS * 60; public static final long DAY_MS = HOUR_MS * 24; - - public static final String FT_HEADER = "tachyon_ft://"; + + public static final String HEADER = "tachyon://"; + public static final String HEADER_FT = "tachyon-ft://"; public static final int DEFAULT_MASTER_PORT = 19998; public static final int DEFAULT_MASTER_WEB_PORT = DEFAULT_MASTER_PORT + 1; @@ -40,12 +51,11 @@ public class Constants { public static final int DEFAULT_BLOCK_SIZE_BYTE = 512 * MB; public static final String PATH_SEPARATOR = "/"; - public static final int MAX_COLUMNS = 1000; - public static final int MAX_TABLE_METADATA_BYTE = MB * 5; - public static final int WORKER_FILES_QUEUE_SIZE = 10000; + + public static final int WORKER_BLOCKS_QUEUE_SIZE = 10000; public static final String LOGGER_TYPE = System.getProperty("tachyon.logger.type", ""); public static final boolean DEBUG = Boolean.valueOf(System.getProperty("tachyon.debug", "false")); - + public static final int JOURNAL_VERSION = 1; // The version keeps increasing. } diff --git a/src/main/java/tachyon/Format.java b/src/main/java/tachyon/Format.java index fa687d51afb6..3218a1036dca 100644 --- a/src/main/java/tachyon/Format.java +++ b/src/main/java/tachyon/Format.java @@ -20,40 +20,64 @@ import tachyon.conf.CommonConf; import tachyon.conf.MasterConf; +import tachyon.conf.WorkerConf; +import tachyon.util.CommonUtils; /** * Format Tachyon File System. */ public class Format { + private static final String USAGE = "java -cp target/tachyon-" + Version.VERSION + + "-jar-with-dependencies.jar tachyon.Format "; + public static void main(String[] args) throws IOException { - if (args.length != 0) { - System.out.println("java -cp target/tachyon-" + Version.VERSION + - "-jar-with-dependencies.jar tachyon.Format"); + if (args.length != 1) { + System.out.println(USAGE); System.exit(-1); } - MasterConf masterConf = MasterConf.get(); - UnderFileSystem ufs = UnderFileSystem.get(masterConf.JOURNAL_FOLDER); - System.out.println("Deleting " + masterConf.JOURNAL_FOLDER); - if (ufs.exists(masterConf.JOURNAL_FOLDER) && !ufs.delete(masterConf.JOURNAL_FOLDER, true)) { - System.out.println("Failed to remove " + masterConf.JOURNAL_FOLDER); - } - ufs.mkdirs(masterConf.JOURNAL_FOLDER, true); + if (args[0].toUpperCase().equals("MASTER")) { + MasterConf masterConf = MasterConf.get(); + String folder = masterConf.JOURNAL_FOLDER; + UnderFileSystem ufs = UnderFileSystem.get(folder); + System.out.println("Formatting JOURNAL_FOLDER: " + folder); + if (ufs.exists(folder) && !ufs.delete(folder, true)) { + System.out.println("Failed to remove JOURNAL_FOLDER: " + folder); + } + if (!ufs.mkdirs(folder, true)) { + System.out.println("Failed to create JOURNAL_FOLDER: " + folder); + } + CommonUtils.touch(folder + "/" + masterConf.FORMAT_FILE_PREFIX + System.currentTimeMillis()); - CommonConf commonConf = CommonConf.get(); - String folder = commonConf.UNDERFS_DATA_FOLDER; - ufs = UnderFileSystem.get(folder); - System.out.println("Formatting " + folder); - ufs.delete(folder, true); - if (!ufs.mkdirs(folder, true)) { - System.out.println("Failed to create " + folder); - } - - folder = commonConf.UNDERFS_WORKERS_FOLDER; - System.out.println("Formatting " + folder); - ufs.delete(folder, true); - if (!ufs.mkdirs(folder, true)) { - System.out.println("Failed to create " + folder); + CommonConf commonConf = CommonConf.get(); + folder = commonConf.UNDERFS_DATA_FOLDER; + ufs = UnderFileSystem.get(folder); + System.out.println("Formatting UNDERFS_DATA_FOLDER: " + folder); + ufs.delete(folder, true); + if (!ufs.mkdirs(folder, true)) { + System.out.println("Failed to create UNDERFS_DATA_FOLDER: " + folder); + } + commonConf = CommonConf.get(); + folder = commonConf.UNDERFS_WORKERS_FOLDER; + System.out.println("Formatting UNDERFS_WORKERS_FOLDER: " + folder); + ufs.delete(folder, true); + if (!ufs.mkdirs(folder, true)) { + System.out.println("Failed to create UNDERFS_WORKERS_FOLDER: " + folder); + } + } else if (args[0].toUpperCase().equals("WORKER")) { + WorkerConf workerConf = WorkerConf.get(); + String localFolder = workerConf.DATA_FOLDER; + UnderFileSystem ufs = UnderFileSystem.get(localFolder); + System.out.println("Removing local data under folder: " + localFolder); + if (ufs.exists(localFolder)) { + String[] files = ufs.list(localFolder); + for (String file : files) { + ufs.delete(localFolder + "/" + file, true); + } + } + } else { + System.out.println(USAGE); + System.exit(-1); } } } \ No newline at end of file diff --git a/src/main/java/tachyon/HeartbeatExecutor.java b/src/main/java/tachyon/HeartbeatExecutor.java index e4fd388005f4..1b3a4f08a483 100644 --- a/src/main/java/tachyon/HeartbeatExecutor.java +++ b/src/main/java/tachyon/HeartbeatExecutor.java @@ -17,8 +17,8 @@ package tachyon; /** - * The interface for a periodical heartbeat. HeartbeatThread calls the - * heartbeat() method. + * The interface for a periodical heartbeat. HeartbeatThread calls the + * heartbeat() method. */ public interface HeartbeatExecutor { public void heartbeat(); diff --git a/src/main/java/tachyon/HeartbeatThread.java b/src/main/java/tachyon/HeartbeatThread.java index e88ba30007c7..ecba02bf4b79 100644 --- a/src/main/java/tachyon/HeartbeatThread.java +++ b/src/main/java/tachyon/HeartbeatThread.java @@ -32,15 +32,17 @@ public class HeartbeatThread extends Thread { /** * @param threadName * @param hbExecutor - * @param fixedExecutionIntervalMs Sleep time between different heartbeat. + * @param fixedExecutionIntervalMs + * Sleep time between different heartbeat. */ - public HeartbeatThread(String threadName, HeartbeatExecutor hbExecutor, + public HeartbeatThread(String threadName, HeartbeatExecutor hbExecutor, long fixedExecutionIntervalMs) { THREAD_NAME = threadName; EXECUTOR = hbExecutor; FIXED_EXECUTION_INTERVAL_MS = fixedExecutionIntervalMs; } + @Override public void run() { while (!mIsShutdown) { long lastMs = System.currentTimeMillis(); @@ -48,8 +50,8 @@ public void run() { try { long executionTimeMs = System.currentTimeMillis() - lastMs; if (executionTimeMs > FIXED_EXECUTION_INTERVAL_MS) { - LOG.error(THREAD_NAME + " last execution took " + executionTimeMs + " ms. Longer than " + - " the FIXED_EXECUTION_INTERVAL_MS "+ FIXED_EXECUTION_INTERVAL_MS); + LOG.error(THREAD_NAME + " last execution took " + executionTimeMs + " ms. Longer than " + + " the FIXED_EXECUTION_INTERVAL_MS " + FIXED_EXECUTION_INTERVAL_MS); } else { Thread.sleep(FIXED_EXECUTION_INTERVAL_MS - executionTimeMs); } diff --git a/src/main/java/tachyon/LeaderInquireClient.java b/src/main/java/tachyon/LeaderInquireClient.java index 84aff4a31513..efbd3057de08 100644 --- a/src/main/java/tachyon/LeaderInquireClient.java +++ b/src/main/java/tachyon/LeaderInquireClient.java @@ -30,12 +30,21 @@ * Utility to get leader from zookeeper. */ public class LeaderInquireClient { - private final static int MAX_TRY = 10; + private static final int MAX_TRY = 10; - private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); + public static synchronized LeaderInquireClient getClient(String zookeeperAddress, + String leaderPath) { + String key = zookeeperAddress + leaderPath; + if (!createdClients.containsKey(key)) { + createdClients.put(key, new LeaderInquireClient(zookeeperAddress, leaderPath)); + } + return createdClients.get(key); + } + private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); private final String ZOOKEEPER_ADDRESS; private final String LEADER_PATH; + private final CuratorFramework CLIENT; private static HashMap createdClients = @@ -45,20 +54,11 @@ private LeaderInquireClient(String zookeeperAddress, String leaderPath) { ZOOKEEPER_ADDRESS = zookeeperAddress; LEADER_PATH = leaderPath; - CLIENT = CuratorFrameworkFactory.newClient( - ZOOKEEPER_ADDRESS, new ExponentialBackoffRetry(1000, 3)); + CLIENT = + CuratorFrameworkFactory.newClient(ZOOKEEPER_ADDRESS, new ExponentialBackoffRetry(1000, 3)); CLIENT.start(); } - public static synchronized LeaderInquireClient - getClient(String zookeeperAddress, String leaderPath) { - String key = zookeeperAddress + leaderPath; - if (!createdClients.containsKey(key)) { - createdClients.put(key, new LeaderInquireClient(zookeeperAddress, leaderPath)); - } - return createdClients.get(key); - } - public synchronized String getMasterAddress() { int tried = 0; try { @@ -73,7 +73,7 @@ public synchronized String getMasterAddress() { long maxTime = 0; String leader = ""; - for (String master: masters) { + for (String master : masters) { Stat stat = CLIENT.checkExists().forPath(LEADER_PATH + "/" + master); if (stat != null && stat.getCtime() > maxTime) { maxTime = stat.getCtime(); @@ -83,7 +83,7 @@ public synchronized String getMasterAddress() { return leader; } } else { - LOG.info(LEADER_PATH + " does not exist (" + (++ tried) + ")"); + LOG.info(LEADER_PATH + " does not exist (" + ( ++tried) + ")"); } CommonUtils.sleepMs(LOG, 1000); } diff --git a/src/main/java/tachyon/LeaderSelectorClient.java b/src/main/java/tachyon/LeaderSelectorClient.java index 07a8cd113641..1f3547286f5c 100644 --- a/src/main/java/tachyon/LeaderSelectorClient.java +++ b/src/main/java/tachyon/LeaderSelectorClient.java @@ -61,8 +61,8 @@ public LeaderSelectorClient(String zookeeperAddress, String electionPath, String // create a leader selector using the given path for management // all participants in a given leader selection must use the same path // ExampleClient here is also a LeaderSelectorListener but this isn't required - CuratorFramework client = CuratorFrameworkFactory.newClient( - ZOOKEEPER_ADDRESS, new ExponentialBackoffRetry(1000, 3)); + CuratorFramework client = + CuratorFrameworkFactory.newClient(ZOOKEEPER_ADDRESS, new ExponentialBackoffRetry(1000, 3)); client.start(); LEADER_SELECTOR = new LeaderSelector(client, ELECTION_PATH, this); LEADER_SELECTOR.setId(name); @@ -71,12 +71,13 @@ public LeaderSelectorClient(String zookeeperAddress, String electionPath, String LEADER_SELECTOR.autoRequeue(); } - public void start() throws IOException { - LEADER_SELECTOR.start(); - } + @Override + public void close() throws IOException { + if (mCurrentMasterThread != null) { + mCurrentMasterThread.interrupt(); + } - public boolean isLeader() { - return mIsLeader.get(); + LEADER_SELECTOR.close(); } public String getName() { @@ -85,7 +86,7 @@ public String getName() { public List getParticipants() { try { - List participants = + List participants = new ArrayList(LEADER_SELECTOR.getParticipants()); List results = new ArrayList(); for (Participant part : participants) { @@ -98,13 +99,38 @@ public List getParticipants() { } } + public boolean isLeader() { + return mIsLeader.get(); + } + + /** + * Set the current master thread. + * + * @param currentMasterThread + */ + public void setCurrentMasterThread(Thread currentMasterThread) { + mCurrentMasterThread = currentMasterThread; + } + + public void start() throws IOException { + LEADER_SELECTOR.start(); + } + @Override - public void close() throws IOException { - if (mCurrentMasterThread != null) { - mCurrentMasterThread.interrupt(); - } + public void stateChanged(CuratorFramework client, ConnectionState newState) { + mIsLeader.set(false); - LEADER_SELECTOR.close(); + if ((newState == ConnectionState.LOST) || (newState == ConnectionState.SUSPENDED)) { + if (mCurrentMasterThread != null) { + mCurrentMasterThread.interrupt(); + } + } else { + try { + LOG.info("The current leader is " + LEADER_SELECTOR.getLeader().getId()); + } catch (Exception e) { + LOG.error(e.getMessage(), e); + } + } } @Override @@ -130,29 +156,4 @@ public void takeLeadership(CuratorFramework client) throws Exception { LOG.info("All partitations: " + LEADER_SELECTOR.getParticipants()); client.delete().forPath(LEADER_FOLDER + NAME); } - - @Override - public void stateChanged(CuratorFramework client, ConnectionState newState) { - mIsLeader.set(false); - - if ((newState == ConnectionState.LOST) || (newState == ConnectionState.SUSPENDED)) { - if (mCurrentMasterThread != null) { - mCurrentMasterThread.interrupt(); - } - } else { - try { - LOG.info("The current leader is " + LEADER_SELECTOR.getLeader().getId()); - } catch (Exception e) { - LOG.error(e.getMessage(), e); - } - } - } - - /** - * Set the current master thread. - * @param currentMasterThread - */ - public void setCurrentMasterThread(Thread currentMasterThread) { - mCurrentMasterThread = currentMasterThread; - } } diff --git a/src/main/java/tachyon/Log4jFileAppender.java b/src/main/java/tachyon/Log4jFileAppender.java index f8d0af015ae3..7223882c98f5 100644 --- a/src/main/java/tachyon/Log4jFileAppender.java +++ b/src/main/java/tachyon/Log4jFileAppender.java @@ -31,9 +31,8 @@ import tachyon.util.CommonUtils; /** - * Custom log4j appender which preserves old logs on system restart, rolls over logs based on - * both size and day. Also implements batch deletion of logs when the maximum backup index is - * reached. + * Custom log4j appender which preserves old logs on system restart, rolls over logs based on both + * size and day. Also implements batch deletion of logs when the maximum backup index is reached. */ public class Log4jFileAppender extends FileAppender { private int mMaxBackupIndex = 1; @@ -44,22 +43,6 @@ public class Log4jFileAppender extends FileAppender { private String mOriginalFileName = ""; private String mLastDate = ""; - public void setMaxBackupIndex(int maxBackups) { - mMaxBackupIndex = maxBackups; - } - - public void setMaxFileSize(int maxFileSizeMB) { - mMaxFileSizeBytes = maxFileSizeMB * Constants.MB; - } - - public void setDeletionPercentage(int deletionPercentage) { - if (deletionPercentage > 0 && deletionPercentage <= 100) { - mDeletionPercentage = deletionPercentage; - } else { - throw new RuntimeException("Log4j configuration error, invalid deletionPercentage"); - } - } - /** * Called when a new log attempt is made, either due to server restart or rollover. The filename * is modified to identify the logging node in getNewFileName. @@ -76,76 +59,16 @@ public void activateOptions() { fileName = getNewLogFileName(fileName); setFile(fileName, fileAppend, bufferedIO, bufferSize); } catch (Exception e) { - errorHandler.error("Error while activating log options", e, - ErrorCode.FILE_OPEN_FAILURE); - } - } - } - - /** - * Creates a LazyFileOutputStream so logs are only created when a message is logged. - * @param fileName - * @param append - * @param bufferedIO - * @param bufferSize - */ - @Override - public synchronized void setFile(String fileName, boolean append, boolean bufferedIO, - int bufferSize) throws IOException { - // It does not make sense to have immediate flush and bufferedIO. - if (bufferedIO) { - setImmediateFlush(false); - } - - reset(); - - //Creation of the LazyFileOutputStream object (the responsible of the log writing operations) - LazyFileOutputStream ostream = new LazyFileOutputStream(fileName, append); - - Writer fw = createWriter(ostream); - if (bufferedIO) { - fw = new BufferedWriter(fw, bufferSize); - } - setQWForFiles(fw); - this.fileName = fileName; - this.fileAppend = append; - this.bufferedIO = bufferedIO; - this.bufferSize = bufferSize; - writeHeader(); - } - - /** - * Called whenever a new message is logged. Checks both the date and size to determine if - * rollover is necessary. - * @param event - */ - @Override - public synchronized void subAppend(LoggingEvent event) { - File currentLog = new File(mCurrentFileName); - if (currentLog.length() > mMaxFileSizeBytes || - !CommonUtils.convertMsToSimpleDate(System.currentTimeMillis()).equals(mLastDate)) { - activateOptions(); - } - if (currentLog.exists()) { - super.subAppend(event); - } else { - String parentName = currentLog.getParent(); - if (parentName != null) { - File parent = new File(parentName); - if (parent.exists()) { - super.subAppend(event); - } else { - if (parent.mkdirs()) { - super.subAppend(event); - } - } + errorHandler.error("Error while activating log options", e, ErrorCode.FILE_OPEN_FAILURE); } } } /** * Gets a log file name which includes the logger's host address and the date. - * @param fileName The base filename + * + * @param fileName + * The base filename * @return A new filename string */ private String getNewLogFileName(String fileName) { @@ -157,8 +80,8 @@ private String getNewLogFileName(String fileName) { } catch (UnknownHostException uhe) { address = "@UnknownHost"; } - newFileName = fileName + address + "_" - + CommonUtils.convertMsToSimpleDate(System.currentTimeMillis()); + newFileName = + fileName + address + "_" + CommonUtils.convertMsToSimpleDate(System.currentTimeMillis()); File file = new File(newFileName); if (file.exists()) { rotateLogs(newFileName); @@ -175,7 +98,9 @@ private String getNewLogFileName(String fileName) { * Rotates logs. The previous current log is set to the next available index. If the index has * reached the maximum backup index, a percent of backup logs will be deleted, started from the * earliest first. Then all rolledover logs will be moved up. - * @param fileName The fileName of the new current log. + * + * @param fileName + * The fileName of the new current log. */ private void rotateLogs(String fileName) { if (mCurrentFileBackupIndex == -1) { @@ -188,14 +113,14 @@ private void rotateLogs(String fileName) { break; } if (new File(fileName + "_" + mid).exists()) { - if (new File(fileName + "_" + (mid+1)).exists()) { + if (new File(fileName + "_" + (mid + 1)).exists()) { lo = mid; } else { mCurrentFileBackupIndex = mid + 1; break; } } else { - if (new File(fileName + "_" + (mid-1)).exists()) { + if (new File(fileName + "_" + (mid - 1)).exists()) { mCurrentFileBackupIndex = mid; break; } else { @@ -207,17 +132,95 @@ private void rotateLogs(String fileName) { File oldFile = new File(fileName); if (mCurrentFileBackupIndex >= mMaxBackupIndex) { - int deleteToIndex = (int) Math.ceil(mMaxBackupIndex*mDeletionPercentage/100.0); + int deleteToIndex = (int) Math.ceil(mMaxBackupIndex * mDeletionPercentage / 100.0); for (int i = 1; i < deleteToIndex; i ++) { new File(fileName + "_" + i).delete(); } for (int i = deleteToIndex + 1; i <= mMaxBackupIndex; i ++) { - new File(fileName + "_" + i).renameTo( - new File(fileName + "_" + (i - deleteToIndex))); + new File(fileName + "_" + i).renameTo(new File(fileName + "_" + (i - deleteToIndex))); } mCurrentFileBackupIndex = mCurrentFileBackupIndex - deleteToIndex; } oldFile.renameTo(new File(fileName + "_" + mCurrentFileBackupIndex)); mCurrentFileBackupIndex ++; } + + public void setDeletionPercentage(int deletionPercentage) { + if (deletionPercentage > 0 && deletionPercentage <= 100) { + mDeletionPercentage = deletionPercentage; + } else { + throw new RuntimeException("Log4j configuration error, invalid deletionPercentage"); + } + } + + /** + * Creates a LazyFileOutputStream so logs are only created when a message is logged. + * + * @param fileName + * @param append + * @param bufferedIO + * @param bufferSize + */ + @Override + public synchronized void setFile(String fileName, boolean append, boolean bufferedIO, + int bufferSize) throws IOException { + // It does not make sense to have immediate flush and bufferedIO. + if (bufferedIO) { + setImmediateFlush(false); + } + + reset(); + + // Creation of the LazyFileOutputStream object (the responsible of the log writing operations) + LazyFileOutputStream ostream = new LazyFileOutputStream(fileName, append); + + Writer fw = createWriter(ostream); + if (bufferedIO) { + fw = new BufferedWriter(fw, bufferSize); + } + setQWForFiles(fw); + this.fileName = fileName; + this.fileAppend = append; + this.bufferedIO = bufferedIO; + this.bufferSize = bufferSize; + writeHeader(); + } + + public void setMaxBackupIndex(int maxBackups) { + mMaxBackupIndex = maxBackups; + } + + public void setMaxFileSize(int maxFileSizeMB) { + mMaxFileSizeBytes = maxFileSizeMB * Constants.MB; + } + + /** + * Called whenever a new message is logged. Checks both the date and size to determine if rollover + * is necessary. + * + * @param event + */ + @Override + public synchronized void subAppend(LoggingEvent event) { + File currentLog = new File(mCurrentFileName); + if (currentLog.length() > mMaxFileSizeBytes + || !CommonUtils.convertMsToSimpleDate(System.currentTimeMillis()).equals(mLastDate)) { + activateOptions(); + } + if (currentLog.exists()) { + super.subAppend(event); + } else { + String parentName = currentLog.getParent(); + if (parentName != null) { + File parent = new File(parentName); + if (parent.exists()) { + super.subAppend(event); + } else { + if (parent.mkdirs()) { + super.subAppend(event); + } + } + } + } + } } \ No newline at end of file diff --git a/src/main/java/tachyon/Pair.java b/src/main/java/tachyon/Pair.java index 693301355c91..ca51c883d32a 100644 --- a/src/main/java/tachyon/Pair.java +++ b/src/main/java/tachyon/Pair.java @@ -19,8 +19,10 @@ /** * A pair representation defined by two elements (of type First and type Second). * - * @param the first element of the Pair. - * @param the second element of the Pair. + * @param + * the first element of the Pair. + * @param + * the second element of the Pair. */ public class Pair { private First mFirst; @@ -28,14 +30,26 @@ public class Pair { /** * Constructs and initializes a Pair specified by the two input elements. - * @param first the first element of the pair (of type First) - * @param second the second element of the pair (of type Second) + * + * @param first + * the first element of the pair (of type First) + * @param second + * the second element of the pair (of type Second) */ public Pair(First first, Second second) { mFirst = first; mSecond = second; } + @Override + public synchronized boolean equals(Object o) { + if (!(o instanceof Pair)) { + return false; + } + return mFirst.equals(((Pair) o).getFirst()) + && mSecond.equals(((Pair) o).getSecond()); + } + /** * @return the first element of the pair. */ @@ -49,13 +63,4 @@ public First getFirst() { public Second getSecond() { return mSecond; } - - @Override - public synchronized boolean equals(Object o) { - if (!(o instanceof Pair)) { - return false; - } - return mFirst.equals(((Pair) o).getFirst()) - && mSecond.equals(((Pair) o).getSecond()); - } } \ No newline at end of file diff --git a/src/main/java/tachyon/PrefixList.java b/src/main/java/tachyon/PrefixList.java index 2ac416a464f9..409aa03b8db6 100644 --- a/src/main/java/tachyon/PrefixList.java +++ b/src/main/java/tachyon/PrefixList.java @@ -26,7 +26,7 @@ import com.google.common.collect.ImmutableList; /** - * Prefix list is used by PinList and WhiteList to do file filtering. + * Prefix list is used by PinList and WhiteList to do file filtering. */ public class PrefixList { private final List LIST; @@ -40,7 +40,7 @@ public PrefixList(List prefixList) { } public PrefixList(String prefixes, String separator) { - Validate.notNull(separator); + Validate.notNull(separator); if (prefixes == null) { LIST = new ArrayList(0); } else { @@ -48,11 +48,15 @@ public PrefixList(String prefixes, String separator) { } } + public List getList() { + return ImmutableList.copyOf(LIST); + } + public boolean inList(String path) { - if (Strings.isNullOrEmpty(path)) { - return false; - } - + if (Strings.isNullOrEmpty(path)) { + return false; + } + for (int k = 0; k < LIST.size(); k ++) { if (path.startsWith(LIST.get(k))) { return true; @@ -65,8 +69,4 @@ public boolean inList(String path) { public boolean outList(String path) { return !inList(path); } - - public List getList() { - return ImmutableList.copyOf(LIST); - } } \ No newline at end of file diff --git a/src/main/java/tachyon/UnderFileSystem.java b/src/main/java/tachyon/UnderFileSystem.java index b99867d5bddd..43da084e39a7 100644 --- a/src/main/java/tachyon/UnderFileSystem.java +++ b/src/main/java/tachyon/UnderFileSystem.java @@ -24,8 +24,8 @@ import tachyon.util.CommonUtils; /** - * Tachyon stores data into an under layer file system. Any file system implementing - * this interface can be a valid under layer file system + * Tachyon stores data into an under layer file system. Any file system implementing this interface + * can be a valid under layer file system */ public abstract class UnderFileSystem { public enum SpaceType { @@ -48,8 +48,8 @@ public int getValue() { } public static UnderFileSystem get(String path) { - if (path.startsWith("hdfs://") || path.startsWith("file://") || - path.startsWith("s3://") || path.startsWith("s3n://")) { + if (path.startsWith("hdfs://") || path.startsWith("file://") || path.startsWith("s3://") + || path.startsWith("s3n://")) { return UnderFileSystemHdfs.getClient(path); } else if (path.startsWith("/")) { return UnderFileSystemSingleLocal.getClient(); @@ -58,8 +58,6 @@ public static UnderFileSystem get(String path) { return null; } - public abstract void changeToFullPermission(String path); - public abstract void close() throws IOException; public abstract OutputStream create(String path) throws IOException; @@ -73,7 +71,7 @@ public abstract OutputStream create(String path, short replication, int blockSiz public abstract boolean exists(String path) throws IOException; - public abstract String[] list(String path) throws IOException; + public abstract long getBlockSizeByte(String path) throws IOException; public abstract List getFileLocations(String path) throws IOException; @@ -81,17 +79,27 @@ public abstract OutputStream create(String path, short replication, int blockSiz public abstract long getFileSize(String path) throws IOException; - public abstract long getBlockSizeByte(String path) throws IOException; - public abstract long getModificationTimeMs(String path) throws IOException; public abstract long getSpace(String path, SpaceType type) throws IOException; public abstract boolean isFile(String path) throws IOException; + /** + * List all the files in the folder. + * + * @param path + * the path to list. + * @return all the file names under the path. + * @throws IOException + */ + public abstract String[] list(String path) throws IOException; + public abstract boolean mkdirs(String path, boolean createParent) throws IOException; public abstract InputStream open(String path) throws IOException; public abstract boolean rename(String src, String dst) throws IOException; + + public abstract void toFullPermission(String path) throws IOException; } diff --git a/src/main/java/tachyon/UnderFileSystemHdfs.java b/src/main/java/tachyon/UnderFileSystemHdfs.java index cabf26adbe84..20f3a8d3c4b4 100644 --- a/src/main/java/tachyon/UnderFileSystemHdfs.java +++ b/src/main/java/tachyon/UnderFileSystemHdfs.java @@ -33,6 +33,7 @@ import org.apache.hadoop.hdfs.DistributedFileSystem; import org.apache.log4j.Logger; +import tachyon.conf.CommonConf; import tachyon.util.CommonUtils; /** @@ -44,9 +45,9 @@ public class UnderFileSystemHdfs extends UnderFileSystem { private FileSystem mFs = null; private String mUfsPrefix = null; - //TODO add sticky bit and narrow down the permission in hadoop 2 - private static final FsPermission PERMISSION = - new FsPermission((short) 0777).applyUMask(FsPermission.createImmutable((short)0000)); + // TODO add sticky bit and narrow down the permission in hadoop 2 + private static final FsPermission PERMISSION = new FsPermission((short) 0777) + .applyUMask(FsPermission.createImmutable((short) 0000)); public static UnderFileSystemHdfs getClient(String path) { return new UnderFileSystemHdfs(path); @@ -57,8 +58,14 @@ private UnderFileSystemHdfs(String fsDefaultName) { mUfsPrefix = fsDefaultName; Configuration tConf = new Configuration(); tConf.set("fs.defaultFS", fsDefaultName); - tConf.set("fs.hdfs.impl", System.getProperty("tachyon.underfs.hdfs.impl", - "org.apache.hadoop.hdfs.DistributedFileSystem")); + tConf.set("fs.hdfs.impl", CommonConf.get().UNDERFS_HDFS_IMPL); + + // To disable the instance cache for hdfs client, otherwise it causes the + // FileSystem closed exception. Being configurable for unit/integration + // test only, and not expose to the end-user currently. + tConf.set("fs.hdfs.impl.disable.cache", + System.getProperty("fs.hdfs.impl.disable.cache", "false")); + if (System.getProperty("fs.s3n.awsAccessKeyId") != null) { tConf.set("fs.s3n.awsAccessKeyId", System.getProperty("fs.s3n.awsAccessKeyId")); } @@ -74,18 +81,6 @@ private UnderFileSystemHdfs(String fsDefaultName) { } } - @Override - public void changeToFullPermission(String path) { - try { - FileStatus fileStatus = mFs.getFileStatus(new Path(path)); - LOG.info("Changing file '" + fileStatus.getPath() + "' permissions from: " + - fileStatus.getPermission() + " to 777"); - mFs.setPermission(fileStatus.getPath(), PERMISSION); - } catch (IOException e) { - LOG.error(e); - } - } - @Override public void close() throws IOException { mFs.close(); @@ -98,7 +93,7 @@ public FSDataOutputStream create(String path) throws IOException { while (cnt < MAX_TRY) { try { LOG.debug("Creating HDFS file at " + path); - return FileSystem.create(mFs,new Path(path), PERMISSION); + return FileSystem.create(mFs, new Path(path), PERMISSION); } catch (IOException e) { cnt ++; LOG.error(cnt + " : " + e.getMessage(), e); @@ -111,9 +106,10 @@ public FSDataOutputStream create(String path) throws IOException { @Override // BlockSize should be a multiple of 512 - public FSDataOutputStream create(String path, int blockSizeByte) throws IOException { + public + FSDataOutputStream create(String path, int blockSizeByte) throws IOException { // TODO Fix this - //return create(path, (short) Math.min(3, mFs.getDefaultReplication()), blockSizeByte); + // return create(path, (short) Math.min(3, mFs.getDefaultReplication()), blockSizeByte); return create(path); } @@ -121,22 +117,22 @@ public FSDataOutputStream create(String path, int blockSizeByte) throws IOExcept public FSDataOutputStream create(String path, short replication, int blockSizeByte) throws IOException { // TODO Fix this - //return create(path, (short) Math.min(3, mFs.getDefaultReplication()), blockSizeByte); + // return create(path, (short) Math.min(3, mFs.getDefaultReplication()), blockSizeByte); return create(path); - // LOG.info(path + " " + replication + " " + blockSizeByte); - // IOException te = null; - // int cnt = 0; - // while (cnt < MAX_TRY) { - // try { - // return mFs.create(new Path(path), true, 4096, replication, blockSizeByte); - // } catch (IOException e) { - // cnt ++; - // LOG.error(cnt + " : " + e.getMessage(), e); - // te = e; - // continue; - // } - // } - // throw te; + // LOG.info(path + " " + replication + " " + blockSizeByte); + // IOException te = null; + // int cnt = 0; + // while (cnt < MAX_TRY) { + // try { + // return mFs.create(new Path(path), true, 4096, replication, blockSizeByte); + // } catch (IOException e) { + // cnt ++; + // LOG.error(cnt + " : " + e.getMessage(), e); + // te = e; + // continue; + // } + // } + // throw te; } @Override @@ -176,18 +172,13 @@ public boolean exists(String path) { } @Override - public String[] list(String path) throws IOException { - FileStatus[] files = mFs.listStatus(new Path(path)); - if (files != null) { - String[] rtn = new String[files.length]; - int i = 0; - for (FileStatus status : files) { - rtn[i ++] = status.getPath().toString().substring(mUfsPrefix.length()); - } - return rtn; - } else { - return null; + public long getBlockSizeByte(String path) throws IOException { + Path tPath = new Path(path); + if (!mFs.exists(tPath)) { + throw new FileNotFoundException(path); } + FileStatus fs = mFs.getFileStatus(tPath); + return fs.getBlockSize(); } @Override @@ -228,16 +219,6 @@ public long getFileSize(String path) { return -1; } - @Override - public long getBlockSizeByte(String path) throws IOException { - Path tPath = new Path(path); - if (!mFs.exists(tPath)) { - throw new FileNotFoundException(path); - } - FileStatus fs = mFs.getFileStatus(tPath); - return fs.getBlockSize(); - } - @Override public long getModificationTimeMs(String path) throws IOException { Path tPath = new Path(path); @@ -253,7 +234,7 @@ public long getSpace(String path, SpaceType type) throws IOException { // Ignoring the path given, will give information for entire cluster // as Tachyon can load/store data out of entire HDFS cluster if (mFs instanceof DistributedFileSystem) { - switch(type) { + switch (type) { case SPACE_TOTAL: return ((DistributedFileSystem) mFs).getDiskStatus().getCapacity(); case SPACE_USED: @@ -270,6 +251,21 @@ public boolean isFile(String path) throws IOException { return mFs.isFile(new Path(path)); } + @Override + public String[] list(String path) throws IOException { + FileStatus[] files = mFs.listStatus(new Path(path)); + if (files != null) { + String[] rtn = new String[files.length]; + int i = 0; + for (FileStatus status : files) { + rtn[i ++] = status.getPath().toString().substring(mUfsPrefix.length()); + } + return rtn; + } else { + return null; + } + } + @Override public boolean mkdirs(String path, boolean createParent) { IOException te = null; @@ -335,4 +331,16 @@ public boolean rename(String src, String dst) { CommonUtils.runtimeException(te); return false; } + + @Override + public void toFullPermission(String path) { + try { + FileStatus fileStatus = mFs.getFileStatus(new Path(path)); + LOG.info("Changing file '" + fileStatus.getPath() + "' permissions from: " + + fileStatus.getPermission() + " to 777"); + mFs.setPermission(fileStatus.getPath(), PERMISSION); + } catch (IOException e) { + LOG.error(e); + } + } } diff --git a/src/main/java/tachyon/UnderFileSystemSingleLocal.java b/src/main/java/tachyon/UnderFileSystemSingleLocal.java index 0bd1d46fe213..7290479ebb17 100644 --- a/src/main/java/tachyon/UnderFileSystemSingleLocal.java +++ b/src/main/java/tachyon/UnderFileSystemSingleLocal.java @@ -31,7 +31,7 @@ /** * Single node UnderFilesystem implementation. - * + * * This only works for single machine. It is for local unit test and single machine mode. */ public class UnderFileSystemSingleLocal extends UnderFileSystem { @@ -40,12 +40,6 @@ public static UnderFileSystem getClient() { return new UnderFileSystemSingleLocal(); } - @Override - public void changeToFullPermission(String path) { - CommonUtils.changeLocalFileToFullPermission(path); - CommonUtils.setLocalFileStickyBit(path); - } - @Override public void close() throws IOException { } @@ -53,7 +47,7 @@ public void close() throws IOException { @Override public OutputStream create(String path) throws IOException { FileOutputStream stream = new FileOutputStream(path); - changeToFullPermission(path); + toFullPermission(path); return stream; } @@ -63,11 +57,10 @@ public OutputStream create(String path, int blockSizeByte) throws IOException { } @Override - public OutputStream create(String path, short replication, int blockSizeByte) - throws IOException { + public OutputStream create(String path, short replication, int blockSizeByte) throws IOException { if (replication != 1) { - throw new IOException("UnderFileSystemSingleLocal does not provide more than one" + - " replication factor"); + throw new IOException("UnderFileSystemSingleLocal does not provide more than one" + + " replication factor"); } return create(path); } @@ -93,19 +86,12 @@ public boolean exists(String path) throws IOException { } @Override - public String[] list(String path) throws IOException { + public long getBlockSizeByte(String path) throws IOException { File file = new File(path); - File[] files = file.listFiles(); - if (files != null) { - String[] rtn = new String[files.length]; - int i = 0; - for (File f : files) { - rtn[i ++] = f.getAbsolutePath(); - } - return rtn; - } else { - return null; + if (!file.exists()) { + throw new FileNotFoundException(path); } + return Constants.GB * 2L; } @Override @@ -126,15 +112,6 @@ public long getFileSize(String path) throws IOException { return file.length(); } - @Override - public long getBlockSizeByte(String path) throws IOException { - File file = new File(path); - if (!file.exists()) { - throw new FileNotFoundException(path); - } - return Constants.GB * 2L; - } - @Override public long getModificationTimeMs(String path) throws IOException { File file = new File(path); @@ -161,11 +138,27 @@ public boolean isFile(String path) throws IOException { return file.isFile(); } + @Override + public String[] list(String path) throws IOException { + File file = new File(path); + File[] files = file.listFiles(); + if (files != null) { + String[] rtn = new String[files.length]; + int i = 0; + for (File f : files) { + rtn[i ++] = f.getName(); + } + return rtn; + } else { + return null; + } + } + @Override public boolean mkdirs(String path, boolean createParent) throws IOException { File file = new File(path); boolean created = createParent ? file.mkdirs() : file.mkdir(); - changeToFullPermission(path); + toFullPermission(path); return created; } @@ -179,4 +172,10 @@ public boolean rename(String src, String dst) throws IOException { File file = new File(src); return file.renameTo(new File(dst)); } + + @Override + public void toFullPermission(String path) throws IOException { + CommonUtils.changeLocalFileToFullPermission(path); + CommonUtils.setLocalFileStickyBit(path); + } } diff --git a/src/main/java/tachyon/Users.java b/src/main/java/tachyon/Users.java index 504b0b903165..c1e566a7f62b 100644 --- a/src/main/java/tachyon/Users.java +++ b/src/main/java/tachyon/Users.java @@ -60,20 +60,9 @@ public void addOwnBytes(long userId, long newBytes) { tUser.addOwnBytes(newBytes); } - /** - * Get how much space quote does a user own. - * @param userId The queried user. - * @return Bytes the user owns. - */ - public long ownBytes(long userId) { - synchronized (USERS) { - UserInfo tUser = USERS.get(userId); - return tUser == null ? 0 : tUser.getOwnBytes(); - } - } - /** * Check the status of the users pool. + * * @return the list of timeout users. */ public List checkStatus() { @@ -97,9 +86,25 @@ public String getUserUnderfsTempFolder(long userId) { return USER_UNDERFS_FOLDER + "/" + userId; } + /** + * Get how much space quote does a user own. + * + * @param userId + * The queried user. + * @return Bytes the user owns. + */ + public long ownBytes(long userId) { + synchronized (USERS) { + UserInfo tUser = USERS.get(userId); + return tUser == null ? 0 : tUser.getOwnBytes(); + } + } + /** * Remove userId from user pool. - * @param userId The user to be removed. + * + * @param userId + * The user to be removed. * @return The space quote the removed user occupied in bytes. */ public synchronized long removeUser(long userId) { @@ -117,8 +122,8 @@ public synchronized long removeUser(long userId) { } else { returnedBytes = tUser.getOwnBytes(); String folder = getUserTempFolder(userId); - sb.append(" The user returns " + returnedBytes + " bytes. Remove the user's folder " + - folder + " ;"); + sb.append(" The user returns " + returnedBytes + " bytes. Remove the user's folder " + + folder + " ;"); try { FileUtils.deleteDirectory(new File(folder)); } catch (IOException e) { diff --git a/src/main/java/tachyon/Version.java b/src/main/java/tachyon/Version.java index 61e0a7a2e1a1..dcb862988554 100644 --- a/src/main/java/tachyon/Version.java +++ b/src/main/java/tachyon/Version.java @@ -25,9 +25,10 @@ * The version of the current build. */ public class Version { - private static Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); public static final String VERSION; + private static Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); + static { InputStream in = null; Properties p = new Properties(); @@ -40,11 +41,15 @@ public class Version { } finally { try { in.close(); - } catch (Exception e){ + } catch (Exception e) { LOG.error(e.getMessage(), e); } } VERSION = p.getProperty("tachyon.version", "UNDEFINED"); } + + public static void main(String[] args) { + System.out.println("Tachyon version: " + VERSION); + } } diff --git a/src/main/java/tachyon/client/BlockInStream.java b/src/main/java/tachyon/client/BlockInStream.java index 75f1e595a1d5..14fd9796002e 100644 --- a/src/main/java/tachyon/client/BlockInStream.java +++ b/src/main/java/tachyon/client/BlockInStream.java @@ -20,11 +20,22 @@ /** * InputStream interface implementation of TachyonFile. It can only be gotten by - * calling the methods in tachyon.client.TachyonFile, but can not be initialized by - * the client code. + * calling the methods in tachyon.client.TachyonFile, but can not be initialized by the + * client code. */ public abstract class BlockInStream extends InStream { + public static BlockInStream get(TachyonFile tachyonFile, ReadType readType, int blockIndex) + throws IOException { + TachyonByteBuffer buf = tachyonFile.readLocalByteBuffer(blockIndex); + if (buf != null) { + return new LocalBlockInStream(tachyonFile, readType, blockIndex, buf); + } + + return new RemoteBlockInStream(tachyonFile, readType, blockIndex); + } + protected final int BLOCK_INDEX; + protected boolean mClosed = false; /** @@ -37,14 +48,4 @@ public abstract class BlockInStream extends InStream { super(file, readType); BLOCK_INDEX = blockIndex; } - - public static BlockInStream get(TachyonFile tachyonFile, ReadType readType, int blockIndex) - throws IOException { - TachyonByteBuffer buf = tachyonFile.readLocalByteBuffer(blockIndex); - if (buf != null) { - return new LocalBlockInStream(tachyonFile, readType, blockIndex, buf); - } - - return new RemoteBlockInStream(tachyonFile, readType, blockIndex); - } } diff --git a/src/main/java/tachyon/client/BlockOutStream.java b/src/main/java/tachyon/client/BlockOutStream.java index fdfb8001ff2f..340e99892b53 100644 --- a/src/main/java/tachyon/client/BlockOutStream.java +++ b/src/main/java/tachyon/client/BlockOutStream.java @@ -85,22 +85,23 @@ public class BlockOutStream extends OutStream { mLocalFilePath = localFolder.getPath() + "/" + BLOCK_ID; mLocalFile = new RandomAccessFile(mLocalFilePath, "rw"); mLocalFileChannel = mLocalFile.getChannel(); - //change the permission of the temporary file in order that the worker can move it. + // change the permission of the temporary file in order that the worker can move it. CommonUtils.changeLocalFileToFullPermission(mLocalFilePath); - //use the sticky bit, only the client and the worker can write to the block + // use the sticky bit, only the client and the worker can write to the block CommonUtils.setLocalFileStickyBit(mLocalFilePath); LOG.info(mLocalFilePath + " was created!"); mBuffer = ByteBuffer.allocate(USER_CONF.FILE_BUFFER_BYTES + 4); } - private synchronized void appendCurrentBuffer(byte[] buf, int offset, - int length) throws IOException { + private synchronized void appendCurrentBuffer(byte[] buf, int offset, int length) + throws IOException { if (!TFS.requestSpace(length)) { mCanWrite = false; - String msg = "Local tachyon worker does not have enough " + - "space (" + length + ") or no worker for " + FILE.FID + " " + BLOCK_ID; + String msg = + "Local tachyon worker does not have enough " + "space (" + length + + ") or no worker for " + FILE.FID + " " + BLOCK_ID; if (PIN) { TFS.outOfMemoryForPinFile(FILE.FID); throw new IOException(msg); @@ -115,21 +116,51 @@ private synchronized void appendCurrentBuffer(byte[] buf, int offset, } @Override - public void write(int b) throws IOException { - if (!mCanWrite) { - throw new IOException("Can not write cache."); - } - if (mWrittenBytes + 1 > BLOCK_CAPACITY_BYTE) { - throw new IOException("Out of capacity."); - } + public void cancel() throws IOException { + mCancel = true; + close(); + } - if (mBuffer.position() >= USER_CONF.FILE_BUFFER_BYTES) { - appendCurrentBuffer(mBuffer.array(), 0, mBuffer.position()); - mBuffer.clear(); + public boolean canWrite() { + return !mClosed && mCanWrite; + } + + @Override + public void close() throws IOException { + if (!mClosed) { + if (!mCancel && mBuffer.position() > 0) { + appendCurrentBuffer(mBuffer.array(), 0, mBuffer.position()); + } + + if (mLocalFileChannel != null) { + mLocalFileChannel.close(); + mLocalFile.close(); + } + + if (mCancel) { + TFS.releaseSpace(mWrittenBytes - mBuffer.position()); + } else { + TFS.cacheBlock(BLOCK_ID); + } } + mClosed = true; + } - mBuffer.put((byte) (b & 0xFF)); - mWrittenBytes ++; + @Override + public void flush() throws IOException { + // Since this only writes to memory memory, this flush is not outside visible. + } + + public long getBlockId() { + return BLOCK_ID; + } + + public long getBlockOffset() { + return BLOCK_OFFSET; + } + + public long getRemainingSpaceByte() { + return BLOCK_CAPACITY_BYTE - mWrittenBytes; } @Override @@ -141,10 +172,10 @@ public void write(byte[] b) throws IOException { public void write(byte[] b, int off, int len) throws IOException { if (b == null) { throw new NullPointerException(); - } else if ((off < 0) || (off > b.length) || (len < 0) || - ((off + len) > b.length) || ((off + len) < 0)) { - throw new IndexOutOfBoundsException(String.format( - "Buffer length (%d), offset(%d), len(%d)", b.length, off, len)); + } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) + || ((off + len) < 0)) { + throw new IndexOutOfBoundsException(String.format("Buffer length (%d), offset(%d), len(%d)", + b.length, off, len)); } if (!mCanWrite) { @@ -171,50 +202,20 @@ public void write(byte[] b, int off, int len) throws IOException { } @Override - public void flush() throws IOException { - // Since this only writes to memory memory, this flush is not outside visible. - } - - @Override - public void close() throws IOException { - if (!mClosed) { - if (!mCancel && mBuffer.position() > 0) { - appendCurrentBuffer(mBuffer.array(), 0, mBuffer.position()); - } - - if (mLocalFileChannel != null) { - mLocalFileChannel.close(); - mLocalFile.close(); - } - - if (mCancel) { - TFS.releaseSpace(mWrittenBytes - mBuffer.position()); - } else { - TFS.cacheBlock(BLOCK_ID); - } + public void write(int b) throws IOException { + if (!mCanWrite) { + throw new IOException("Can not write cache."); + } + if (mWrittenBytes + 1 > BLOCK_CAPACITY_BYTE) { + throw new IOException("Out of capacity."); } - mClosed = true; - } - - @Override - public void cancel() throws IOException { - mCancel = true; - close(); - } - - public boolean canWrite() { - return !mClosed && mCanWrite; - } - - public long getRemainingSpaceByte() { - return BLOCK_CAPACITY_BYTE - mWrittenBytes; - } - public long getBlockId() { - return BLOCK_ID; - } + if (mBuffer.position() >= USER_CONF.FILE_BUFFER_BYTES) { + appendCurrentBuffer(mBuffer.array(), 0, mBuffer.position()); + mBuffer.clear(); + } - public long getBlockOffset() { - return BLOCK_OFFSET; + mBuffer.put((byte) (b & 0xFF)); + mWrittenBytes ++; } } \ No newline at end of file diff --git a/src/main/java/tachyon/client/EmptyBlockInStream.java b/src/main/java/tachyon/client/EmptyBlockInStream.java index 2c1ee1b7bddb..fc4b414a7ebe 100644 --- a/src/main/java/tachyon/client/EmptyBlockInStream.java +++ b/src/main/java/tachyon/client/EmptyBlockInStream.java @@ -26,6 +26,10 @@ public class EmptyBlockInStream extends InStream { super(file, readType); } + @Override + public void close() throws IOException { + } + @Override public int read() throws IOException { return -1; @@ -42,18 +46,14 @@ public int read(byte[] b, int off, int len) throws IOException { } @Override - public void close() throws IOException { + public void seek(long pos) throws IOException { + if (pos < 0) { + throw new IOException("pos is negative: " + pos); + } } @Override public long skip(long n) throws IOException { return 0; } - - @Override - public void seek(long pos) throws IOException { - if (pos < 0) { - throw new IOException("pos is negative: " + pos); - } - } } \ No newline at end of file diff --git a/src/main/java/tachyon/client/FileInStream.java b/src/main/java/tachyon/client/FileInStream.java index 0c2c773f4b1c..d6379bf1fa4d 100644 --- a/src/main/java/tachyon/client/FileInStream.java +++ b/src/main/java/tachyon/client/FileInStream.java @@ -44,10 +44,6 @@ public FileInStream(TachyonFile file, ReadType opType) throws IOException { mCurrentBlockLeft = 0; } - private int getCurrentBlockIndex() { - return (int) (mCurrentPosition / BLOCK_CAPACITY); - } - private void checkAndAdvanceBlockInStream() throws IOException { if (mCurrentBlockLeft == 0) { if (mCurrentBlockInStream != null) { @@ -60,6 +56,19 @@ private void checkAndAdvanceBlockInStream() throws IOException { } } + @Override + public void close() throws IOException { + if (!mClosed && mCurrentBlockInStream != null) { + mCurrentBlockInStream.close(); + } + + mClosed = true; + } + + private int getCurrentBlockIndex() { + return (int) (mCurrentPosition / BLOCK_CAPACITY); + } + @Override public int read() throws IOException { if (mCurrentPosition >= FILE_LENGTH) { @@ -95,6 +104,10 @@ public int read(byte[] b, int off, int len) throws IOException { checkAndAdvanceBlockInStream(); int tRead = mCurrentBlockInStream.read(b, tOff, tLen); + if (tRead == -1) { + // mCurrentBlockInStream has reached its block boundary + continue; + } mCurrentPosition += tRead; mCurrentBlockLeft -= tRead; @@ -106,12 +119,24 @@ public int read(byte[] b, int off, int len) throws IOException { } @Override - public void close() throws IOException { - if (!mClosed && mCurrentBlockInStream != null) { - mCurrentBlockInStream.close(); + public void seek(long pos) throws IOException { + if (mCurrentPosition == pos) { + return; + } + if (pos < 0) { + throw new IOException("pos is negative: " + pos); } - mClosed = true; + if ((int) (pos / BLOCK_CAPACITY) != mCurrentBlockIndex) { + mCurrentBlockIndex = (int) (pos / BLOCK_CAPACITY); + if (mCurrentBlockInStream != null) { + mCurrentBlockInStream.close(); + } + mCurrentBlockInStream = BlockInStream.get(FILE, READ_TYPE, mCurrentBlockIndex); + } + mCurrentBlockInStream.seek(pos % BLOCK_CAPACITY); + mCurrentPosition = pos; + mCurrentBlockLeft = BLOCK_CAPACITY - (pos % BLOCK_CAPACITY); } @Override @@ -140,38 +165,17 @@ public long skip(long n) throws IOException { long skip = mCurrentBlockInStream.skip(shouldSkip); mCurrentBlockLeft = BLOCK_CAPACITY - skip; if (skip != shouldSkip) { - throw new IOException("The underlayer BlockInStream only skip " + skip + - " instead of " + shouldSkip); + throw new IOException("The underlayer BlockInStream only skip " + skip + " instead of " + + shouldSkip); } } else { long skip = mCurrentBlockInStream.skip(ret); if (skip != ret) { - throw new IOException("The underlayer BlockInStream only skip " + skip + - " instead of " + ret); + throw new IOException("The underlayer BlockInStream only skip " + skip + " instead of " + + ret); } } return ret; } - - @Override - public void seek(long pos) throws IOException { - if (mCurrentPosition == pos) { - return; - } - if (pos < 0) { - throw new IOException("pos is negative: " + pos); - } - - if ((int) (pos / BLOCK_CAPACITY) != mCurrentBlockIndex){ - mCurrentBlockIndex = (int) (pos / BLOCK_CAPACITY); - if (mCurrentBlockInStream != null) { - mCurrentBlockInStream.close(); - } - mCurrentBlockInStream = BlockInStream.get(FILE, READ_TYPE, mCurrentBlockIndex); - } - mCurrentBlockInStream.seek(pos % BLOCK_CAPACITY); - mCurrentPosition = pos; - mCurrentBlockLeft = BLOCK_CAPACITY - (pos % BLOCK_CAPACITY); - } } \ No newline at end of file diff --git a/src/main/java/tachyon/client/FileOutStream.java b/src/main/java/tachyon/client/FileOutStream.java index 7b1406be9f14..45e355d410b5 100644 --- a/src/main/java/tachyon/client/FileOutStream.java +++ b/src/main/java/tachyon/client/FileOutStream.java @@ -72,6 +72,73 @@ public class FileOutStream extends OutStream { } } + @Override + public void cancel() throws IOException { + mCancel = true; + close(); + } + + @Override + public void close() throws IOException { + if (!mClosed) { + if (mCurrentBlockOutStream != null) { + mPreviousBlockOutStreams.add(mCurrentBlockOutStream); + } + + Boolean canComplete = false; + if (WRITE_TYPE.isThrough()) { + if (mCancel) { + mCheckpointOutputStream.close(); + UnderFileSystem underFsClient = UnderFileSystem.get(mUnderFsFile); + underFsClient.delete(mUnderFsFile, false); + } else { + mCheckpointOutputStream.flush(); + mCheckpointOutputStream.close(); + TFS.addCheckpoint(FILE.FID); + canComplete = true; + } + } + + if (WRITE_TYPE.isCache()) { + try { + if (mCancel) { + for (BlockOutStream bos : mPreviousBlockOutStreams) { + bos.cancel(); + } + } else { + for (BlockOutStream bos : mPreviousBlockOutStreams) { + bos.close(); + } + canComplete = true; + } + } catch (IOException ioe) { + if (WRITE_TYPE.isMustCache()) { + LOG.error(ioe.getMessage()); + throw new IOException("Fail to cache: " + WRITE_TYPE); + } else { + LOG.warn("Fail to cache for: " + ioe.getMessage()); + } + } + } + + if (canComplete) { + if (WRITE_TYPE.isAsync()) { + TFS.asyncCheckpoint(FILE.FID); + } + TFS.completeFile(FILE.FID); + } + } + + mClosed = true; + } + + @Override + public void flush() throws IOException { + // We only flush the checkpoint output stream. + // TODO flushing for RAMFS block streams. + mCheckpointOutputStream.flush(); + } + private void getNextBlock() throws IOException { if (mCurrentBlockId != -1) { if (mCurrentBlockLeftByte != 0) { @@ -89,29 +156,9 @@ private void getNextBlock() throws IOException { } } - @Override - public void write(int b) throws IOException { - if (WRITE_TYPE.isCache()) { - try { - if (mCurrentBlockId == -1 || mCurrentBlockLeftByte == 0) { - getNextBlock(); - } - // TODO Cache the exception here. - mCurrentBlockOutStream.write(b); - mCurrentBlockLeftByte --; - mCachedBytes ++; - } catch (IOException ioe) { - if (WRITE_TYPE.isMustCache()) { - LOG.error(ioe.getMessage()); - throw new IOException("Fail to cache: " + WRITE_TYPE); - } else { - LOG.warn("Fail to cache for: " + ioe.getMessage()); - } - } - } - - if (WRITE_TYPE.isThrough()) { - mCheckpointOutputStream.write(b); + public void write(ArrayList bufs) throws IOException { + for (int k = 0; k < bufs.size(); k ++) { + write(bufs.get(k)); } } @@ -124,8 +171,8 @@ public void write(byte[] b) throws IOException { public void write(byte[] b, int off, int len) throws IOException { if (b == null) { throw new NullPointerException(); - } else if ((off < 0) || (off > b.length) || (len < 0) || - ((off + len) > b.length) || ((off + len) < 0)) { + } else if ((off < 0) || (off > b.length) || (len < 0) || ((off + len) > b.length) + || ((off + len) < 0)) { throw new IndexOutOfBoundsException(); } @@ -136,8 +183,11 @@ public void write(byte[] b, int off, int len) throws IOException { while (tLen > 0) { if (mCurrentBlockLeftByte == 0) { getNextBlock(); + } else if (mCurrentBlockLeftByte < 0 || mCurrentBlockOutStream == null) { + throw new IOException("mCurrentBlockLeftByte " + mCurrentBlockLeftByte + " " + + mCurrentBlockOutStream); } - if (mCurrentBlockLeftByte > tLen) { + if (mCurrentBlockLeftByte >= tLen) { mCurrentBlockOutStream.write(b, tOff, tLen); mCurrentBlockLeftByte -= tLen; mCachedBytes += tLen; @@ -170,73 +220,29 @@ public void write(ByteBuffer buf) throws IOException { write(buf.array(), buf.position(), buf.limit() - buf.position()); } - public void write(ArrayList bufs) throws IOException { - for (int k = 0; k < bufs.size(); k ++) { - write(bufs.get(k)); - } - } - - @Override - public void flush() throws IOException { - // We only flush the checkpoint output stream. - // TODO flushing for RAMFS block streams. - mCheckpointOutputStream.flush(); - } - @Override - public void close() throws IOException { - if (!mClosed) { - if (mCurrentBlockOutStream != null) { - mPreviousBlockOutStreams.add(mCurrentBlockOutStream); - } - - Boolean canComplete = false; - if (WRITE_TYPE.isThrough()) { - if (mCancel) { - mCheckpointOutputStream.close(); - UnderFileSystem underFsClient = UnderFileSystem.get(mUnderFsFile); - underFsClient.delete(mUnderFsFile, false); - } else { - mCheckpointOutputStream.flush(); - mCheckpointOutputStream.close(); - TFS.addCheckpoint(FILE.FID); - canComplete = true; + public void write(int b) throws IOException { + if (WRITE_TYPE.isCache()) { + try { + if (mCurrentBlockId == -1 || mCurrentBlockLeftByte == 0) { + getNextBlock(); } - } - - if (WRITE_TYPE.isCache()) { - try { - if(mCancel){ - for (BlockOutStream bos : mPreviousBlockOutStreams) { - bos.cancel(); - } - }else { - for (BlockOutStream bos : mPreviousBlockOutStreams) { - bos.close(); - } - canComplete = true; - } - } catch (IOException ioe) { - if (WRITE_TYPE.isMustCache()) { - LOG.error(ioe.getMessage()); - throw new IOException("Fail to cache: " + WRITE_TYPE); - } else { - LOG.warn("Fail to cache for: " + ioe.getMessage()); - } + // TODO Cache the exception here. + mCurrentBlockOutStream.write(b); + mCurrentBlockLeftByte --; + mCachedBytes ++; + } catch (IOException ioe) { + if (WRITE_TYPE.isMustCache()) { + LOG.error(ioe.getMessage()); + throw new IOException("Fail to cache: " + WRITE_TYPE); + } else { + LOG.warn("Fail to cache for: " + ioe.getMessage()); } - } - - if (canComplete) { - TFS.completeFile(FILE.FID); } } - mClosed = true; - } - - @Override - public void cancel() throws IOException { - mCancel = true; - close(); + if (WRITE_TYPE.isThrough()) { + mCheckpointOutputStream.write(b); + } } } diff --git a/src/main/java/tachyon/client/InStream.java b/src/main/java/tachyon/client/InStream.java index b885ec7e92b0..56618a6ec6aa 100644 --- a/src/main/java/tachyon/client/InStream.java +++ b/src/main/java/tachyon/client/InStream.java @@ -38,6 +38,9 @@ public abstract class InStream extends InputStream { READ_TYPE = readType; } + @Override + public abstract void close() throws IOException; + @Override public abstract int read() throws IOException; @@ -47,18 +50,18 @@ public abstract class InStream extends InputStream { @Override public abstract int read(byte b[], int off, int len) throws IOException; - @Override - public abstract void close() throws IOException; - - @Override - public abstract long skip(long n) throws IOException; - /** * Sets the stream pointer offset, measured from the beginning of this stream, at which the next * read or write occurs. The offset may be set beyond the end of the stream. - * @param pos the offset position, measured in bytes from the beginning of the InStream, at which - * to set the stream pointer. - * @throws IOException if pos is less than 0 or if an I/O error occurs. + * + * @param pos + * the offset position, measured in bytes from the beginning of the InStream, at which + * to set the stream pointer. + * @throws IOException + * if pos is less than 0 or if an I/O error occurs. */ public abstract void seek(long pos) throws IOException; + + @Override + public abstract long skip(long n) throws IOException; } \ No newline at end of file diff --git a/src/main/java/tachyon/client/LocalBlockInStream.java b/src/main/java/tachyon/client/LocalBlockInStream.java index 7a6497f5b121..a725ca31177b 100644 --- a/src/main/java/tachyon/client/LocalBlockInStream.java +++ b/src/main/java/tachyon/client/LocalBlockInStream.java @@ -34,6 +34,14 @@ public class LocalBlockInStream extends BlockInStream { mBuffer = mTachyonBuffer.DATA; } + @Override + public void close() throws IOException { + if (!mClosed) { + mTachyonBuffer.close(); + } + mClosed = true; + } + @Override public int read() throws IOException { if (mBuffer.remaining() == 0) { @@ -68,11 +76,11 @@ public int read(byte b[], int off, int len) throws IOException { } @Override - public void close() throws IOException { - if (!mClosed) { - mTachyonBuffer.close(); + public void seek(long pos) throws IOException { + if (pos < 0) { + throw new IOException("pos is negative: " + pos); } - mClosed = true; + mBuffer.position((int) pos); } @Override @@ -88,12 +96,4 @@ public long skip(long n) throws IOException { mBuffer.position(mBuffer.position() + ret); return ret; } - - @Override - public void seek(long pos) throws IOException { - if (pos < 0) { - throw new IOException("pos is negative: " + pos); - } - mBuffer.position((int) pos); - } } diff --git a/src/main/java/tachyon/client/OutStream.java b/src/main/java/tachyon/client/OutStream.java index 970f11c55cb9..cf6ae7ed366d 100644 --- a/src/main/java/tachyon/client/OutStream.java +++ b/src/main/java/tachyon/client/OutStream.java @@ -38,20 +38,20 @@ public abstract class OutStream extends OutputStream { WRITE_TYPE = writeType; } - @Override - public abstract void write(int b) throws IOException; + public abstract void cancel() throws IOException; @Override - public abstract void write(byte b[]) throws IOException; + public abstract void close() throws IOException; @Override - public abstract void write(byte b[], int off, int len) throws IOException; + public abstract void flush() throws IOException; @Override - public abstract void flush() throws IOException; + public abstract void write(byte b[]) throws IOException; @Override - public abstract void close() throws IOException; + public abstract void write(byte b[], int off, int len) throws IOException; - public abstract void cancel() throws IOException; + @Override + public abstract void write(int b) throws IOException; } \ No newline at end of file diff --git a/src/main/java/tachyon/client/ReadType.java b/src/main/java/tachyon/client/ReadType.java index 733ebe1ba1f0..8c8d5dc1a580 100644 --- a/src/main/java/tachyon/client/ReadType.java +++ b/src/main/java/tachyon/client/ReadType.java @@ -19,14 +19,28 @@ import java.io.IOException; /** - * Different read types for a TachyonFile. + * Different read types for a TachyonFile. */ public enum ReadType { - // Read the file and but do not cache it explicitly. + /** + * Read the file and but do not cache it explicitly. + */ NO_CACHE(1), - // Read the file and cache it. + /** + * Read the file and cache it. + */ CACHE(2); + public static ReadType getOpType(String op) throws IOException { + if (op.equals("NO_CACHE")) { + return NO_CACHE; + } else if (op.equals("CACHE")) { + return CACHE; + } + + throw new IOException("Unknown ReadType : " + op); + } + private final int mValue; private ReadType(int value) { @@ -40,14 +54,4 @@ public int getValue() { public boolean isCache() { return mValue == CACHE.mValue; } - - public static ReadType getOpType(String op) throws IOException { - if (op.equals("NO_CACHE")) { - return NO_CACHE; - } else if (op.equals("CACHE")) { - return CACHE; - } - - throw new IOException("Unknown ReadType : " + op); - } } diff --git a/src/main/java/tachyon/client/RemoteBlockInStream.java b/src/main/java/tachyon/client/RemoteBlockInStream.java index 381a986416b6..6f74c6a99c9f 100644 --- a/src/main/java/tachyon/client/RemoteBlockInStream.java +++ b/src/main/java/tachyon/client/RemoteBlockInStream.java @@ -27,11 +27,11 @@ import org.apache.log4j.Logger; import tachyon.Constants; -import tachyon.DataServerMessage; import tachyon.UnderFileSystem; import tachyon.conf.UserConf; import tachyon.thrift.ClientBlockInfo; import tachyon.thrift.NetAddress; +import tachyon.worker.DataServerMessage; /** * BlockInStream for remote block. @@ -71,131 +71,24 @@ public class RemoteBlockInStream extends BlockInStream { setupStreamFromUnderFs(mBlockInfo.offset); if (mCheckpointInputStream == null) { - throw new IOException("Can not find the block " + FILE + " " + BLOCK_INDEX); - } - } - } + TFS.reportLostFile(FILE.FID); - private void setupStreamFromUnderFs(long offset) { - String checkpointPath = TFS.getCheckpointPath(FILE.FID); - if (!checkpointPath.equals("")) { - LOG.info("May stream from underlayer fs: " + checkpointPath); - UnderFileSystem underfsClient = UnderFileSystem.get(checkpointPath); - try { - mCheckpointInputStream = underfsClient.open(checkpointPath); - while (offset > 0) { - long skipped = mCheckpointInputStream.skip(offset); - offset -= skipped; - if (skipped == 0) { - throw new IOException("Failed to find the start position " + offset + - " for block " + mBlockInfo); - } - } - } catch (IOException e) { - LOG.error("Failed to read from checkpoint " + checkpointPath + " for File " + FILE.FID + - "\n" + e); - mCheckpointInputStream = null; + throw new IOException("Can not find the block " + FILE + " " + BLOCK_INDEX); } } } - private void updateCurrentBuffer() throws IOException { - long length = BUFFER_SIZE; - if (mBufferStartPosition + length > mBlockInfo.length) { - length = mBlockInfo.length - mBufferStartPosition; - } - - LOG.info(String.format("Try to find remote worker and read block %d from %d, with len %d", - mBlockInfo.blockId, mBufferStartPosition, length)); - - mCurrentBuffer = readRemoteByteBuffer(mBlockInfo, mBufferStartPosition, length); - - if (mCurrentBuffer == null) { - mBlockInfo = TFS.getClientBlockInfo(FILE.FID, BLOCK_INDEX); - mCurrentBuffer = readRemoteByteBuffer(mBlockInfo, mBufferStartPosition, length); - } - } - - private ByteBuffer readRemoteByteBuffer(ClientBlockInfo blockInfo, long offset, long len) { - ByteBuffer buf = null; - - try { - List blockLocations = blockInfo.getLocations(); - LOG.info("Block locations:" + blockLocations); - - for (int k = 0; k < blockLocations.size(); k ++) { - String host = blockLocations.get(k).mHost; - int port = blockLocations.get(k).mPort; - - // The data is not in remote machine's memory if port == -1. - if (port == -1) { - continue; - } - if (host.equals(InetAddress.getLocalHost().getHostName()) - || host.equals(InetAddress.getLocalHost().getHostAddress())) { - String localFileName = TFS.getRootFolder() + "/" + blockInfo.blockId; - LOG.warn("Master thinks the local machine has data " + localFileName + "! But not!"); - } - LOG.info(host + ":" + (port + 1) + - " current host is " + InetAddress.getLocalHost().getHostName() + " " + - InetAddress.getLocalHost().getHostAddress()); - - try { - buf = retrieveByteBufferFromRemoteMachine( - new InetSocketAddress(host, port + 1), blockInfo.blockId, offset, len); - if (buf != null) { - break; - } - } catch (IOException e) { - LOG.error(e.getMessage()); - buf = null; - } + @Override + public void close() throws IOException { + if (!mClosed) { + if (mRecache) { + mBlockOutStream.cancel(); } - } catch (IOException e) { - LOG.error("Failed to get read data from remote " + e.getMessage()); - buf = null; - } - - return buf; - } - - private ByteBuffer retrieveByteBufferFromRemoteMachine(InetSocketAddress address, - long blockId, long offset, long length) throws IOException { - SocketChannel socketChannel = SocketChannel.open(); - socketChannel.connect(address); - - LOG.info("Connected to remote machine " + address + " sent"); - DataServerMessage sendMsg = - DataServerMessage.createBlockRequestMessage(blockId, offset, length); - while (!sendMsg.finishSending()) { - sendMsg.send(socketChannel); - } - - LOG.info("Data " + blockId + " to remote machine " + address + " sent"); - - DataServerMessage recvMsg = - DataServerMessage.createBlockResponseMessage(false, blockId); - while (!recvMsg.isMessageReady()) { - int numRead = recvMsg.recv(socketChannel); - if (numRead == -1) { - LOG.warn("Read nothing"); + if (mCheckpointInputStream != null) { + mCheckpointInputStream.close(); } } - LOG.info("Data " + blockId + " from remote machine " + address + " received"); - - socketChannel.close(); - - if (!recvMsg.isMessageReady()) { - LOG.info("Data " + blockId + " from remote machine is not ready."); - return null; - } - - if (recvMsg.getBlockId() < 0) { - LOG.info("Data " + recvMsg.getBlockId() + " is not in remote machine."); - return null; - } - - return recvMsg.getReadOnlyData(); + mClosed = true; } private void doneRecache() throws IOException { @@ -218,7 +111,7 @@ public int read() throws IOException { updateCurrentBuffer(); } if (mCurrentBuffer != null) { - int ret = mCurrentBuffer.get(); + int ret = mCurrentBuffer.get() & 0xFF; if (mRecache) { mBlockOutStream.write(ret); } @@ -227,7 +120,7 @@ public int read() throws IOException { setupStreamFromUnderFs(mBlockInfo.offset + mReadByte - 1); } - int ret = mCheckpointInputStream.read(); + int ret = mCheckpointInputStream.read() & 0xFF; if (mRecache) { mBlockOutStream.write(ret); } @@ -291,17 +184,132 @@ public int read(byte b[], int off, int len) throws IOException { return (int) ret; } + private ByteBuffer readRemoteByteBuffer(ClientBlockInfo blockInfo, long offset, long len) { + ByteBuffer buf = null; + + try { + List blockLocations = blockInfo.getLocations(); + LOG.info("Block locations:" + blockLocations); + + for (int k = 0; k < blockLocations.size(); k ++) { + String host = blockLocations.get(k).mHost; + int port = blockLocations.get(k).mPort; + + // The data is not in remote machine's memory if port == -1. + if (port == -1) { + continue; + } + if (host.equals(InetAddress.getLocalHost().getHostName()) + || host.equals(InetAddress.getLocalHost().getHostAddress())) { + String localFileName = TFS.getRootFolder() + "/" + blockInfo.blockId; + LOG.warn("Master thinks the local machine has data " + localFileName + "! But not!"); + } + LOG.info(host + ":" + (port + 1) + " current host is " + + InetAddress.getLocalHost().getHostName() + " " + + InetAddress.getLocalHost().getHostAddress()); + + try { + buf = + retrieveByteBufferFromRemoteMachine(new InetSocketAddress(host, port + 1), + blockInfo.blockId, offset, len); + if (buf != null) { + break; + } + } catch (IOException e) { + LOG.error(e.getMessage()); + buf = null; + } + } + } catch (IOException e) { + LOG.error("Failed to get read data from remote " + e.getMessage()); + buf = null; + } + + return buf; + } + + private ByteBuffer retrieveByteBufferFromRemoteMachine(InetSocketAddress address, long blockId, + long offset, long length) throws IOException { + SocketChannel socketChannel = SocketChannel.open(); + socketChannel.connect(address); + + LOG.info("Connected to remote machine " + address + " sent"); + DataServerMessage sendMsg = + DataServerMessage.createBlockRequestMessage(blockId, offset, length); + while (!sendMsg.finishSending()) { + sendMsg.send(socketChannel); + } + + LOG.info("Data " + blockId + " to remote machine " + address + " sent"); + + DataServerMessage recvMsg = DataServerMessage.createBlockResponseMessage(false, blockId); + while (!recvMsg.isMessageReady()) { + int numRead = recvMsg.recv(socketChannel); + if (numRead == -1) { + LOG.warn("Read nothing"); + } + } + LOG.info("Data " + blockId + " from remote machine " + address + " received"); + + socketChannel.close(); + + if (!recvMsg.isMessageReady()) { + LOG.info("Data " + blockId + " from remote machine is not ready."); + return null; + } + + if (recvMsg.getBlockId() < 0) { + LOG.info("Data " + recvMsg.getBlockId() + " is not in remote machine."); + return null; + } + + return recvMsg.getReadOnlyData(); + } + @Override - public void close() throws IOException { - if (!mClosed) { - if (mRecache) { - mBlockOutStream.cancel(); + public void seek(long pos) throws IOException { + if (pos < 0) { + throw new IOException("pos is negative: " + pos); + } + mRecache = false; + if (mCurrentBuffer != null) { + mReadByte = pos; + if (mBufferStartPosition <= pos && pos < mBufferStartPosition + mCurrentBuffer.limit()) { + mCurrentBuffer.position((int) (pos - mBufferStartPosition)); + } else { + mBufferStartPosition = pos; + updateCurrentBuffer(); } + } else { if (mCheckpointInputStream != null) { mCheckpointInputStream.close(); } + + setupStreamFromUnderFs(mBlockInfo.offset + pos); + } + } + + private void setupStreamFromUnderFs(long offset) { + String checkpointPath = TFS.getCheckpointPath(FILE.FID); + if (!checkpointPath.equals("")) { + LOG.info("May stream from underlayer fs: " + checkpointPath); + UnderFileSystem underfsClient = UnderFileSystem.get(checkpointPath); + try { + mCheckpointInputStream = underfsClient.open(checkpointPath); + while (offset > 0) { + long skipped = mCheckpointInputStream.skip(offset); + offset -= skipped; + if (skipped == 0) { + throw new IOException("Failed to find the start position " + offset + " for block " + + mBlockInfo); + } + } + } catch (IOException e) { + LOG.error("Failed to read from checkpoint " + checkpointPath + " for File " + FILE.FID + + "\n" + e); + mCheckpointInputStream = null; + } } - mClosed = true; } @Override @@ -345,20 +353,20 @@ public long skip(long n) throws IOException { return ret; } - @Override - public void seek(long pos) throws IOException { - if (pos < 0) { - throw new IOException("pos is negative: " + pos); + private void updateCurrentBuffer() throws IOException { + long length = BUFFER_SIZE; + if (mBufferStartPosition + length > mBlockInfo.length) { + length = mBlockInfo.length - mBufferStartPosition; } - mRecache = false; - if (mCurrentBuffer != null) { - mCurrentBuffer.position((int) pos); - } else { - if (mCheckpointInputStream != null) { - mCheckpointInputStream.close(); - } - setupStreamFromUnderFs(mBlockInfo.offset + pos); + LOG.info(String.format("Try to find remote worker and read block %d from %d, with len %d", + mBlockInfo.blockId, mBufferStartPosition, length)); + + mCurrentBuffer = readRemoteByteBuffer(mBlockInfo, mBufferStartPosition, length); + + if (mCurrentBuffer == null) { + mBlockInfo = TFS.getClientBlockInfo(FILE.FID, BLOCK_INDEX); + mCurrentBuffer = readRemoteByteBuffer(mBlockInfo, mBufferStartPosition, length); } } } diff --git a/src/main/java/tachyon/client/TachyonByteBuffer.java b/src/main/java/tachyon/client/TachyonByteBuffer.java index b98921c14202..49230205223c 100644 --- a/src/main/java/tachyon/client/TachyonByteBuffer.java +++ b/src/main/java/tachyon/client/TachyonByteBuffer.java @@ -25,7 +25,7 @@ public class TachyonByteBuffer { // ByteBuffer contains data. public final ByteBuffer DATA; - private final long BLOCK_ID; + private final long BLOCK_ID; private final int BLOCK_LOCK_ID; diff --git a/src/main/java/tachyon/client/TachyonFS.java b/src/main/java/tachyon/client/TachyonFS.java index 0b90379d3d05..2340c0fd9566 100644 --- a/src/main/java/tachyon/client/TachyonFS.java +++ b/src/main/java/tachyon/client/TachyonFS.java @@ -25,6 +25,7 @@ import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; +import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -37,30 +38,56 @@ import tachyon.Constants; import tachyon.UnderFileSystem; -import tachyon.MasterClient; -import tachyon.WorkerClient; import tachyon.client.table.RawTable; +import tachyon.conf.CommonConf; import tachyon.conf.UserConf; +import tachyon.master.MasterClient; import tachyon.thrift.BlockInfoException; import tachyon.thrift.ClientBlockInfo; +import tachyon.thrift.ClientDependencyInfo; import tachyon.thrift.ClientFileInfo; import tachyon.thrift.ClientRawTableInfo; import tachyon.thrift.ClientWorkerInfo; import tachyon.thrift.FileDoesNotExistException; import tachyon.thrift.NetAddress; import tachyon.thrift.NoWorkerException; +import tachyon.thrift.TachyonException; import tachyon.util.CommonUtils; +import tachyon.worker.WorkerClient; /** * Tachyon's user client API. It contains a MasterClient and several WorkerClients * depending on how many workers the client program is interacting with. */ public class TachyonFS { - private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); + public static synchronized TachyonFS get(String tachyonAddress) throws IOException { + boolean zookeeperMode = false; + String tempAddress = tachyonAddress; + if (tachyonAddress.startsWith(Constants.HEADER)) { + tempAddress = tachyonAddress.substring(Constants.HEADER.length()); + } else if (tachyonAddress.startsWith(Constants.HEADER_FT)) { + zookeeperMode = true; + tempAddress = tachyonAddress.substring(Constants.HEADER_FT.length()); + } else { + throw new IOException("Invalid Path: " + tachyonAddress + ". Use " + Constants.HEADER + + "host:port/ ," + Constants.HEADER_FT + "host:port/" + " , or /file"); + } + String masterAddress = tempAddress; + if (tempAddress.contains("/")) { + masterAddress = tempAddress.substring(0, tempAddress.indexOf("/")); + } + if (masterAddress.split(":").length != 2) { + CommonUtils.illegalArgumentException("Illegal Tachyon Master Address: " + tachyonAddress); + } + String masterHost = masterAddress.split(":")[0]; + int masterPort = Integer.parseInt(masterAddress.split(":")[1]); + return new TachyonFS(new InetSocketAddress(masterHost, masterPort), zookeeperMode); + } + private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); private final long USER_QUOTA_UNIT_BYTES = UserConf.get().QUOTA_UNIT_BYTES; - private final int USER_FAILED_SPACE_REQUEST_LIMITS = UserConf.get().FAILED_SPACE_REQUEST_LIMITS; + private final int USER_FAILED_SPACE_REQUEST_LIMITS = UserConf.get().FAILED_SPACE_REQUEST_LIMITS; // The RPC client talks to the system master. private MasterClient mMasterClient = null; // The Master address. @@ -72,7 +99,7 @@ public class TachyonFS { new HashMap(); private Map mClientFileInfos = new HashMap(); // Cached ClientBlockInfo - // private Map mClientBlockInfos = new HashMap(); + // private Map mClientBlockInfos = new HashMap(); // The RPC client talks to the local worker if there is one. private WorkerClient mWorkerClient = null; // The local root data folder. @@ -83,13 +110,14 @@ public class TachyonFS { private String mUserTempFolder = null; // The HDFS data folder private String mUserUnderfsTempFolder = null; + private UnderFileSystem mUnderFileSystem = null; // The user id of the client. private long mUserId = 0; - // All Blocks has been locked. private Map> mLockedBlockIds = new HashMap>(); + // Each user facing block has a unique block lock id. private AtomicInteger mBlockLockId = new AtomicInteger(0); @@ -104,28 +132,6 @@ private TachyonFS(InetSocketAddress masterAddress, boolean zookeeperMode) { mAvailableSpaceBytes = 0L; } - public static synchronized TachyonFS get(InetSocketAddress tachyonAddress) { - return get(tachyonAddress, false); - } - - public static synchronized TachyonFS get(InetSocketAddress tachyonAddress, boolean zookeeper) { - return new TachyonFS(tachyonAddress, zookeeper); - } - - public static synchronized TachyonFS get(String tachyonAddress) { - boolean zookeeperMode = false; - String tempAddress = tachyonAddress; - if (tachyonAddress.startsWith(Constants.FT_HEADER)) { - zookeeperMode = true; - tempAddress = tachyonAddress.substring(12); - } - String[] address = tempAddress.split(":"); - if (address.length != 2) { - CommonUtils.illegalArgumentException("Illegal Tachyon Master Address: " + tachyonAddress); - } - return get(new InetSocketAddress(address[0], Integer.parseInt(address[1])), zookeeperMode); - } - public synchronized void accessLocalBlock(long blockId) { connect(); if (mWorkerClient != null && mIsWorkerLocal) { @@ -157,7 +163,19 @@ public synchronized void addCheckpoint(int fid) throws IOException { } } - public synchronized void cacheBlock(long blockId) throws IOException { + public synchronized boolean asyncCheckpoint(int fid) throws IOException { + connect(); + try { + return mWorkerClient.asyncCheckpoint(fid); + } catch (TachyonException e) { + throw new IOException(e); + } catch (TException e) { + mConnected = false; + throw new IOException(e); + } + } + + public synchronized void cacheBlock(long blockId) throws IOException { connect(); if (!mConnected) { return; @@ -179,12 +197,22 @@ public synchronized void close() throws TException { mMasterClient.cleanConnect(); } - if (mWorkerClient != null) { + if (mWorkerClient != null && mWorkerClient.isConnected()) { mWorkerClient.returnSpace(mUserId, mAvailableSpaceBytes); mWorkerClient.close(); } } + public synchronized void completeFile(int fId) throws IOException { + connect(); + try { + mMasterClient.user_completeFile(fId); + } catch (TException e) { + mConnected = false; + throw new IOException(e); + } + } + // Lazy connection TODO This should be removed since the Thrift server has been fixed. public synchronized void connect() { if (mMasterClient != null) { @@ -249,8 +277,8 @@ public synchronized void connect() { LOG.info("Connecting " + (mIsWorkerLocal ? "local" : "remote") + " worker @ " + workerAddress); mWorkerClient = new WorkerClient(workerAddress, mUserId); if (!mWorkerClient.open()) { - LOG.error("Failed to connect " + (mIsWorkerLocal ? "local" : "remote") + - " worker @ " + workerAddress); + LOG.error("Failed to connect " + (mIsWorkerLocal ? "local" : "remote") + " worker @ " + + workerAddress); mWorkerClient = null; return; } @@ -268,17 +296,7 @@ public synchronized void connect() { } } - public synchronized void completeFile(int fId) throws IOException { - connect(); - try { - mMasterClient.user_completeFile(fId); - } catch (TException e) { - mConnected = false; - throw new IOException(e); - } - } - - public synchronized File createAndGetUserTempFolder() { + public synchronized File createAndGetUserTempFolder() throws IOException { connect(); if (mUserTempFolder == null) { @@ -316,29 +334,16 @@ public synchronized String createAndGetUserUnderfsTempFolder() throws IOExceptio return mUserUnderfsTempFolder; } - public synchronized int createRawTable(String path, int columns) throws IOException { - return createRawTable(path, columns, ByteBuffer.allocate(0)); - } - - public synchronized int createRawTable(String path, int columns, ByteBuffer metadata) - throws IOException { + public synchronized int createDependency(List parents, List children, + String commandPrefix, List data, String comment, String framework, + String frameworkVersion, int dependencyType, long childrenBlockSizeByte) throws IOException { connect(); - if (!mConnected) { - return -1; - } - path = CommonUtils.cleanPath(path); - - if (columns < 1 || columns > Constants.MAX_COLUMNS) { - throw new IOException("Column count " + columns + " is smaller than 1 or " + - "bigger than " + Constants.MAX_COLUMNS); - } - try { - return mMasterClient.user_createRawTable(path, columns, metadata); + return mMasterClient.user_createDependency(parents, children, commandPrefix, data, comment, + framework, frameworkVersion, dependencyType, childrenBlockSizeByte); } catch (TException e) { - LOG.error(e.getMessage()); mConnected = false; - return -1; + throw new IOException(e); } } @@ -382,6 +387,32 @@ public synchronized int createFile(String path, String checkpointPath) throws IO return fid; } + public synchronized int createRawTable(String path, int columns) throws IOException { + return createRawTable(path, columns, ByteBuffer.allocate(0)); + } + + public synchronized int createRawTable(String path, int columns, ByteBuffer metadata) + throws IOException { + connect(); + if (!mConnected) { + return -1; + } + path = CommonUtils.cleanPath(path); + + if (columns < 1 || columns > CommonConf.get().MAX_COLUMNS) { + throw new IOException("Column count " + columns + " is smaller than 1 or " + "bigger than " + + CommonConf.get().MAX_COLUMNS); + } + + try { + return mMasterClient.user_createRawTable(path, columns, metadata); + } catch (TException e) { + LOG.error(e.getMessage()); + mConnected = false; + return -1; + } + } + public synchronized boolean delete(int fid, boolean recursive) throws IOException { connect(); if (!mConnected) { @@ -396,8 +427,7 @@ public synchronized boolean delete(int fid, boolean recursive) throws IOExceptio } } - public synchronized boolean delete(String path, boolean recursive) - throws IOException { + public synchronized boolean delete(String path, boolean recursive) throws IOException { connect(); if (!mConnected) { return false; @@ -414,6 +444,26 @@ public synchronized boolean exist(String path) throws IOException { return getFileId(path) != -1; } + private synchronized ClientFileInfo fetchClientFileInfo(int fid) { + connect(); + if (!mConnected) { + return null; + } + ClientFileInfo ret = null; + try { + ret = mMasterClient.getClientFileInfoById(fid); + } catch (IOException e) { + LOG.info(e.getMessage() + fid); + return null; + } catch (TException e) { + LOG.error(e.getMessage()); + mConnected = false; + return null; + } + + return ret; + } + public synchronized long getBlockId(int fId, int blockIndex) throws IOException { ClientFileInfo info = mClientFileInfos.get(fId); if (info == null) { @@ -437,8 +487,7 @@ public synchronized long getBlockId(int fId, int blockIndex) throws IOException } } - public synchronized long getBlockIdBasedOnOffset(int fId, long offset) - throws IOException { + public synchronized long getBlockIdBasedOnOffset(int fId, long offset) throws IOException { ClientFileInfo info; if (!mClientFileInfos.containsKey(fId)) { info = fetchClientFileInfo(fId); @@ -451,6 +500,24 @@ public synchronized long getBlockIdBasedOnOffset(int fId, long offset) return getBlockId(fId, index); } + public int getBlockLockId() { + return mBlockLockId.getAndIncrement(); + } + + public synchronized long getBlockSizeByte(int fId) { + return mClientFileInfos.get(fId).getBlockSizeByte(); + } + + synchronized String getCheckpointPath(int fid) { + ClientFileInfo info = mClientFileInfos.get(fid); + if (info == null || !info.getCheckpointPath().equals("")) { + info = fetchClientFileInfo(fid); + mClientFileInfos.put(fid, info); + } + + return info.getCheckpointPath(); + } + public synchronized ClientBlockInfo getClientBlockInfo(int fId, int blockIndex) throws IOException { boolean fetch = false; @@ -483,9 +550,21 @@ public synchronized ClientBlockInfo getClientBlockInfo(int fId, int blockIndex) try { return mMasterClient.user_getClientBlockInfo(info.blockIds.get(blockIndex)); - } catch (FileDoesNotExistException | BlockInfoException e) { + } catch (FileDoesNotExistException e) { + throw new IOException(e); + } catch (BlockInfoException e) { + throw new IOException(e); + } catch (TException e) { throw new IOException(e); + } + } + + public synchronized ClientDependencyInfo getClientDependencyInfo(int did) throws IOException { + connect(); + try { + return mMasterClient.getClientDependencyInfo(did); } catch (TException e) { + mConnected = false; throw new IOException(e); } } @@ -522,42 +601,49 @@ private synchronized ClientFileInfo getClientFileInfo(String path, boolean useCa return ret; } - private synchronized ClientFileInfo fetchClientFileInfo(int fid) { - connect(); - if (!mConnected) { - return null; - } - ClientFileInfo ret = null; - try { - ret = mMasterClient.user_getClientFileInfoById(fid); - } catch (IOException e) { - LOG.info(e.getMessage() + fid); - return null; - } catch (TException e) { - LOG.error(e.getMessage()); - mConnected = false; - return null; - } - - return ret; - } - - public synchronized long getBlockSizeByte(int fId) { - return mClientFileInfos.get(fId).getBlockSizeByte(); + public synchronized long getCreationTimeMs(int fId) { + return mClientFileInfos.get(fId).getCreationTimeMs(); } - synchronized String getCheckpointPath(int fid) { - ClientFileInfo info = mClientFileInfos.get(fid); - if (info == null || !info.getCheckpointPath().equals("")) { - info = fetchClientFileInfo(fid); - mClientFileInfos.put(fid, info); + /** + * Get TachyonFile based on the file id. + * + * @param fid + * file id. + * @return TachyonFile of the file id, or null if the first does not exist. + */ + public synchronized TachyonFile getFile(int fid) { + if (!mClientFileInfos.containsKey(fid)) { + ClientFileInfo clientFileInfo = fetchClientFileInfo(fid); + if (clientFileInfo == null) { + return null; + } + mClientFileInfos.put(fid, clientFileInfo); } + return new TachyonFile(this, fid); + } - return info.getCheckpointPath(); + /** + * Get TachyonFile based on the path. + * + * @param path + * file path. + * @return TachyonFile of the path, or null if the file does not exist. + * @throws IOException + */ + public synchronized TachyonFile getFile(String path) throws IOException { + return getFile(path, false); } - public synchronized long getCreationTimeMs(int fId) { - return mClientFileInfos.get(fId).getCreationTimeMs(); + public synchronized TachyonFile getFile(String path, boolean useCachedMetadata) + throws IOException { + path = CommonUtils.cleanPath(path); + ClientFileInfo clientFileInfo = getClientFileInfo(path, useCachedMetadata); + if (clientFileInfo == null) { + return null; + } + mClientFileInfos.put(clientFileInfo.getId(), clientFileInfo); + return new TachyonFile(this, clientFileInfo.getId()); } public synchronized List getFileBlockIdList(int fId) throws IOException { @@ -576,8 +662,7 @@ public synchronized List getFileBlockIdList(int fId) throws IOException { return info.blockIds; } - public synchronized List getFileBlocks(int fid) - throws IOException { + public synchronized List getFileBlocks(int fid) throws IOException { // TODO Should read from mClientFileInfos if possible. Should add timeout to improve this. connect(); if (!mConnected) { @@ -592,41 +677,22 @@ public synchronized List getFileBlocks(int fid) } } - /** - * Get TachyonFile based on the path. - * @param path file path. - * @return TachyonFile of the path, or null if the file does not exist. - * @throws IOException - */ - public synchronized TachyonFile getFile(String path) throws IOException { - return getFile(path, false); - } - - public synchronized TachyonFile getFile(String path, boolean useCachedMetadata) - throws IOException { - path = CommonUtils.cleanPath(path); - ClientFileInfo clientFileInfo = getClientFileInfo(path, useCachedMetadata); - if (clientFileInfo == null) { + public synchronized List getFileHosts(int fileId) throws IOException { + connect(); + if (!mConnected) { return null; } - mClientFileInfos.put(clientFileInfo.getId(), clientFileInfo); - return new TachyonFile(this, clientFileInfo.getId()); - } - /** - * Get TachyonFile based on the file id. - * @param fid file id. - * @return TachyonFile of the file id, or null if the first does not exist. - */ - public synchronized TachyonFile getFile(int fid) { - if (!mClientFileInfos.containsKey(fid)) { - ClientFileInfo clientFileInfo = fetchClientFileInfo(fid); - if (clientFileInfo == null) { - return null; + List adresses = getFileNetAddresses(fileId); + List ret = new ArrayList(adresses.size()); + for (NetAddress address : adresses) { + ret.add(address.mHost); + if (address.mHost.endsWith(".ec2.internal")) { + ret.add(address.mHost.substring(0, address.mHost.length() - 13)); } - mClientFileInfos.put(fid, clientFileInfo); } - return new TachyonFile(this, fid); + + return ret; } public synchronized int getFileId(String path) throws IOException { @@ -654,6 +720,68 @@ synchronized long getFileLength(int fid) { return mClientFileInfos.get(fid).getLength(); } + public synchronized List getFileNetAddresses(int fileId) throws IOException { + connect(); + if (!mConnected) { + return null; + } + + List ret = new ArrayList(); + try { + List blocks = mMasterClient.user_getFileBlocks(fileId); + Set locationSet = new HashSet(); + for (ClientBlockInfo info : blocks) { + locationSet.addAll(info.getLocations()); + } + ret.addAll(locationSet); + } catch (TException e) { + mConnected = false; + throw new IOException(e); + } + return ret; + } + + public synchronized List> getFilesHosts(List fileIds) throws IOException { + List> ret = new ArrayList>(); + for (int k = 0; k < fileIds.size(); k ++) { + ret.add(getFileHosts(fileIds.get(k))); + } + + return ret; + } + + public synchronized List> getFilesNetAddresses(List fileIds) + throws IOException { + List> ret = new ArrayList>(); + for (int k = 0; k < fileIds.size(); k ++) { + ret.add(getFileNetAddresses(fileIds.get(k))); + } + + return ret; + } + + /** + * Returns the local filename for the block if that file exists on the local file system. This is + * an alpha power-api feature for applications that want short-circuit-read files directly. There + * is no guarantee that the file still exists after this call returns, as Tachyon may evict blocks + * from memory at any time. + * + * @param blockId + * The id of the block. + * @return filename on local file system or null if file not present on local file system. + */ + String getLocalFilename(long blockId) { + String rootFolder = getRootFolder(); + if (rootFolder != null) { + String localFileName = rootFolder + Constants.PATH_SEPARATOR + blockId; + File file = new File(localFileName); + if (file.exists()) { + return localFileName; + } + } + return null; + } + synchronized long getNextBlockId(int fId) throws IOException { connect(); try { @@ -676,8 +804,7 @@ synchronized int getNumberOfBlocks(int fId) throws IOException { return info.getBlockIds().size(); } - public synchronized int getNumberOfFiles(String folderPath) - throws IOException { + public synchronized int getNumberOfFiles(String folderPath) throws IOException { connect(); try { return mMasterClient.user_getNumberOfFiles(folderPath); @@ -691,13 +818,11 @@ synchronized String getPath(int fid) { return mClientFileInfos.get(fid).getPath(); } - public synchronized RawTable getRawTable(String path) - throws IOException { + public synchronized RawTable getRawTable(int id) throws IOException { connect(); - path = CommonUtils.cleanPath(path); - ClientRawTableInfo clientRawTableInfo; + ClientRawTableInfo clientRawTableInfo = null; try { - clientRawTableInfo = mMasterClient.user_getClientRawTableInfoByPath(path); + clientRawTableInfo = mMasterClient.user_getClientRawTableInfoById(id); } catch (TException e) { mConnected = false; throw new IOException(e); @@ -705,11 +830,12 @@ public synchronized RawTable getRawTable(String path) return new RawTable(this, clientRawTableInfo); } - public synchronized RawTable getRawTable(int id) throws IOException { + public synchronized RawTable getRawTable(String path) throws IOException { connect(); - ClientRawTableInfo clientRawTableInfo = null; + path = CommonUtils.cleanPath(path); + ClientRawTableInfo clientRawTableInfo; try { - clientRawTableInfo = mMasterClient.user_getClientRawTableInfoById(id); + clientRawTableInfo = mMasterClient.user_getClientRawTableInfoByPath(path); } catch (TException e) { mConnected = false; throw new IOException(e); @@ -722,10 +848,6 @@ public synchronized String getRootFolder() { return mLocalDataFolder; } - public int getBlockLockId() { - return mBlockLockId.getAndIncrement(); - } - public synchronized String getUnderfsAddress() throws IOException { connect(); try { @@ -750,6 +872,13 @@ public synchronized boolean hasLocalWorker() { return (mIsWorkerLocal && mWorkerClient != null); } + synchronized boolean isComplete(int fid) { + if (!mClientFileInfos.get(fid).isComplete()) { + mClientFileInfos.put(fid, fetchClientFileInfo(fid)); + } + return mClientFileInfos.get(fid).isComplete(); + } + public synchronized boolean isConnected() { return mConnected; } @@ -768,13 +897,6 @@ synchronized boolean isNeedPin(int fid) { return mClientFileInfos.get(fid).isNeedPin(); } - synchronized boolean isComplete(int fid) { - if (!mClientFileInfos.get(fid).isComplete()) { - mClientFileInfos.put(fid, fetchClientFileInfo(fid)); - } - return mClientFileInfos.get(fid).isComplete(); - } - public synchronized List listFiles(String path, boolean recursive) throws IOException { connect(); try { @@ -788,12 +910,13 @@ public synchronized List listFiles(String path, boolean recursive) thro /** * If the path is a directory, return all the direct entries in it. If the * path is a file, return its ClientFileInfo. - * @param path the target directory/file path + * + * @param path + * the target directory/file path * @return A list of ClientFileInfo * @throws IOException */ - public synchronized List listStatus(String path) - throws IOException { + public synchronized List listStatus(String path) throws IOException { connect(); try { return mMasterClient.listStatus(path); @@ -803,21 +926,13 @@ public synchronized List listStatus(String path) } } - public synchronized List ls(String path, boolean recursive) throws IOException { - connect(); - try { - return mMasterClient.user_ls(path, recursive); - } catch (TException e) { - mConnected = false; - throw new IOException(e); - } - } - /** * Lock a block in the current TachyonFS. - * @param blockId The id of the block to lock. blockId must be positive. - * @param blockLockId The block lock id of the block of lock. - * blockLockId must be non-negative. + * + * @param blockId + * The id of the block to lock. blockId must be positive. + * @param blockLockId + * The block lock id of the block of lock. blockLockId must be non-negative. * @return true if successfully lock the block, false otherwise (or invalid parameter). */ synchronized boolean lockBlock(long blockId, int blockLockId) { @@ -846,9 +961,21 @@ synchronized boolean lockBlock(long blockId, int blockLockId) { return true; } + public synchronized List ls(String path, boolean recursive) throws IOException { + connect(); + try { + return mMasterClient.user_ls(path, recursive); + } catch (TException e) { + mConnected = false; + throw new IOException(e); + } + } + /** * Create a directory if it does not exist. - * @param path Directory path. + * + * @param path + * Directory path. * @return true if the folder is created succeefully. faluse otherwise. * @throws IOException */ @@ -878,7 +1005,9 @@ public synchronized void outOfMemoryForPinFile(int fid) { /** * Read the whole local block. - * @param blockId The id of the block to read. + * + * @param blockId + * The id of the block to read. * @return TachyonByteBuffer containing the whole block. * @throws IOException */ @@ -888,9 +1017,13 @@ TachyonByteBuffer readLocalByteBuffer(long blockId) throws IOException { /** * Read local block return a TachyonByteBuffer - * @param blockId The id of the block. - * @param offset The start position to read. - * @param len The length to read. -1 represents read the whole block. + * + * @param blockId + * The id of the block. + * @param offset + * The start position to read. + * @param len + * The length to read. -1 represents read the whole block. * @return TachyonByteBuffer containing the block. * @throws IOException */ @@ -906,9 +1039,8 @@ TachyonByteBuffer readLocalByteBuffer(long blockId, long offset, long len) throw if (!lockBlock(blockId, blockLockId)) { return null; } - String rootFolder = getRootFolder(); - if (rootFolder != null) { - String localFileName = rootFolder + Constants.PATH_SEPARATOR + blockId; + String localFileName = getLocalFilename(blockId); + if (localFileName != null) { try { RandomAccessFile localFile = new RandomAccessFile(localFileName, "r"); @@ -918,8 +1050,9 @@ TachyonByteBuffer readLocalByteBuffer(long blockId, long offset, long len) throw error = String.format("Offset(%d) is larger than file length(%d)", offset, fileLength); } if (error == null && len != -1 && offset + len > fileLength) { - error = String.format("Offset(%d) plus length(%d) is larger than file length(%d)", - offset, len, fileLength); + error = + String.format("Offset(%d) plus length(%d) is larger than file length(%d)", offset, + len, fileLength); } if (error != null) { localFile.close(); @@ -951,19 +1084,14 @@ public synchronized void releaseSpace(long releaseSpaceBytes) { mAvailableSpaceBytes += releaseSpaceBytes; } - public synchronized boolean rename(String srcPath, String dstPath) - throws IOException { + public synchronized boolean rename(int fId, String path) throws IOException { connect(); if (!mConnected) { return false; } try { - if (srcPath.equals(dstPath) && exist(srcPath)) { - return true; - } - - mMasterClient.user_rename(srcPath, dstPath); + mMasterClient.user_renameTo(fId, path); } catch (TException e) { LOG.error(e.getMessage()); return false; @@ -972,14 +1100,18 @@ public synchronized boolean rename(String srcPath, String dstPath) return true; } - public synchronized boolean rename(int fId, String path) throws IOException { + public synchronized boolean rename(String srcPath, String dstPath) throws IOException { connect(); if (!mConnected) { return false; } try { - mMasterClient.user_renameTo(fId, path); + if (srcPath.equals(dstPath) && exist(srcPath)) { + return true; + } + + mMasterClient.user_rename(srcPath, dstPath); } catch (TException e) { LOG.error(e.getMessage()); return false; @@ -988,6 +1120,26 @@ public synchronized boolean rename(int fId, String path) throws IOException { return true; } + public synchronized void reportLostFile(int fileId) throws IOException { + connect(); + try { + mMasterClient.user_reportLostFile(fileId); + } catch (TException e) { + mConnected = false; + throw new IOException(e); + } + } + + public synchronized void requestFilesInDependency(int depId) throws IOException { + connect(); + try { + mMasterClient.user_requestFilesInDependency(depId); + } catch (TException e) { + mConnected = false; + throw new IOException(e); + } + } + public synchronized boolean requestSpace(long requestSpaceBytes) { connect(); if (mWorkerClient == null || !mIsWorkerLocal) { @@ -1005,8 +1157,8 @@ public synchronized boolean requestSpace(long requestSpaceBytes) { if (mWorkerClient.requestSpace(mUserId, toRequestSpaceBytes)) { mAvailableSpaceBytes += toRequestSpaceBytes; } else { - LOG.info("Failed to request " + toRequestSpaceBytes + " bytes local space. " + - "Time " + (failedTimes ++)); + LOG.info("Failed to request " + toRequestSpaceBytes + " bytes local space. " + "Time " + + (failedTimes ++)); if (failedTimes == USER_FAILED_SPACE_REQUEST_LIMITS) { return false; } @@ -1027,29 +1179,16 @@ public synchronized boolean requestSpace(long requestSpaceBytes) { return true; } - public synchronized boolean unpinFile(int fid) throws IOException { - connect(); - if (!mConnected) { - return false; - } - - try { - mMasterClient.user_unpinFile(fid); - } catch (TException e) { - LOG.error(e.getMessage()); - return false; - } - - return true; - } - /** * Unlock a block in the current TachyonFS. - * @param blockId The id of the block to unlock. blockId must be positive. - * @param blockLockId The block lock id of the block of unlock. - * blockLockId must be non-negative. + * + * @param blockId + * The id of the block to unlock. blockId must be positive. + * @param blockLockId + * The block lock id of the block of unlock. blockLockId must be + * non-negative. * @return true if successfully unlock the block with blockLockId, - * false otherwise (or invalid parameter). + * false otherwise (or invalid parameter). */ synchronized boolean unlockBlock(long blockId, int blockLockId) { if (blockId <= 0 || blockLockId < 0) { @@ -1079,8 +1218,23 @@ synchronized boolean unlockBlock(long blockId, int blockLockId) { return true; } - public synchronized void updateRawTableMetadata(int id, ByteBuffer metadata) - throws IOException { + public synchronized boolean unpinFile(int fid) throws IOException { + connect(); + if (!mConnected) { + return false; + } + + try { + mMasterClient.user_unpinFile(fid); + } catch (TException e) { + LOG.error(e.getMessage()); + return false; + } + + return true; + } + + public synchronized void updateRawTableMetadata(int id, ByteBuffer metadata) throws IOException { connect(); try { mMasterClient.user_updateRawTableMetadata(id, metadata); diff --git a/src/main/java/tachyon/client/TachyonFile.java b/src/main/java/tachyon/client/TachyonFile.java index 1271d673b39c..8af54d7235f9 100644 --- a/src/main/java/tachyon/client/TachyonFile.java +++ b/src/main/java/tachyon/client/TachyonFile.java @@ -28,11 +28,11 @@ import org.apache.log4j.Logger; import tachyon.Constants; -import tachyon.DataServerMessage; import tachyon.UnderFileSystem; import tachyon.conf.UserConf; import tachyon.thrift.ClientBlockInfo; import tachyon.thrift.NetAddress; +import tachyon.worker.DataServerMessage; /** * Tachyon File. @@ -49,6 +49,40 @@ public class TachyonFile implements Comparable { FID = fid; } + @Override + public int compareTo(TachyonFile o) { + return getPath().compareTo(o.getPath()); + } + + @Override + public boolean equals(Object obj) { + if ((obj != null) && (obj instanceof TachyonFile)) { + return compareTo((TachyonFile) obj) == 0; + } + return false; + } + + public long getBlockId(int blockIndex) throws IOException { + return TFS.getBlockId(FID, blockIndex); + } + + public long getBlockSizeByte() { + return TFS.getBlockSizeByte(FID); + } + + String getCheckpointPath() { + return TFS.getCheckpointPath(FID); + } + + public long getCreationTimeMs() { + return TFS.getCreationTimeMs(FID); + } + + public int getDiskReplication() { + // TODO Implement it. + return 3; + } + public InStream getInStream(ReadType readType) throws IOException { if (readType == null) { throw new IOException("ReadType can not be null."); @@ -69,16 +103,21 @@ public InStream getInStream(ReadType readType) throws IOException { return new FileInStream(this, readType); } - public OutStream getOutStream(WriteType writeType) throws IOException { - if (writeType == null) { - throw new IOException("WriteType can not be null."); - } - - return new FileOutStream(this, writeType); - } + /** + * Returns the local filename for the block if that file exists on the local file system. This is + * an alpha power-api feature for applications that want short-circuit-read files directly. There + * is no guarantee that the file still exists after this call returns, as Tachyon may evict blocks + * from memory at any time. + * + * @param blockId + * The id of the block. + * @return filename on local file system or null if file not present on local file system. + * @throws IOException + */ + public String getLocalFilename(int blockIndex) throws IOException { + ClientBlockInfo blockInfo = TFS.getClientBlockInfo(FID, blockIndex); - public String getPath() { - return TFS.getPath(FID); + return TFS.getLocalFilename(blockInfo.getBlockId()); } public List getLocationHosts() throws IOException { @@ -93,14 +132,39 @@ public List getLocationHosts() throws IOException { return ret; } - public boolean isFile() { - return !TFS.isDirectory(FID); + public int getNumberOfBlocks() throws IOException { + return TFS.getNumberOfBlocks(FID); + } + + public OutStream getOutStream(WriteType writeType) throws IOException { + if (writeType == null) { + throw new IOException("WriteType can not be null."); + } + + return new FileOutStream(this, writeType); + } + + public String getPath() { + return TFS.getPath(FID); + } + + @Override + public int hashCode() { + return getPath().hashCode() ^ 1234321; + } + + public boolean isComplete() { + return TFS.isComplete(FID); } public boolean isDirectory() { return TFS.isDirectory(FID); } + public boolean isFile() { + return !TFS.isDirectory(FID); + } + public boolean isInLocalMemory() { throw new RuntimeException("Unsupported"); } @@ -109,20 +173,12 @@ public boolean isInMemory() { return TFS.isInMemory(FID); } - public boolean isComplete() { - return TFS.isComplete(FID); - } - public long length() { return TFS.getFileLength(FID); } - public int getNumberOfBlocks() throws IOException { - return TFS.getNumberOfBlocks(FID); - } - - public long getBlockSizeByte() { - return TFS.getBlockSizeByte(FID); + public boolean needPin() { + return TFS.isNeedPin(FID); } public TachyonByteBuffer readByteBuffer() throws IOException { @@ -138,7 +194,7 @@ TachyonByteBuffer readByteBuffer(int blockIndex) throws IOException { return null; } - ClientBlockInfo blockInfo = TFS.getClientBlockInfo(FID, blockIndex); + ClientBlockInfo blockInfo = TFS.getClientBlockInfo(FID, blockIndex); TachyonByteBuffer ret = readLocalByteBuffer(blockIndex); if (ret == null) { @@ -151,7 +207,9 @@ TachyonByteBuffer readByteBuffer(int blockIndex) throws IOException { /** * Get the the whole block. - * @param blockIndex The block index of the current file to read. + * + * @param blockIndex + * The block index of the current file to read. * @return TachyonByteBuffer containing the block. * @throws IOException */ @@ -175,18 +233,19 @@ TachyonByteBuffer readRemoteByteBuffer(ClientBlockInfo blockInfo) { if (port == -1) { continue; } - if (host.equals(InetAddress.getLocalHost().getHostName()) + if (host.equals(InetAddress.getLocalHost().getHostName()) || host.equals(InetAddress.getLocalHost().getHostAddress())) { String localFileName = TFS.getRootFolder() + "/" + FID; LOG.warn("Master thinks the local machine has data " + localFileName + "! But not!"); } else { - LOG.info(host + ":" + (port + 1) + - " current host is " + InetAddress.getLocalHost().getHostName() + " " + - InetAddress.getLocalHost().getHostAddress()); + LOG.info(host + ":" + (port + 1) + " current host is " + + InetAddress.getLocalHost().getHostName() + " " + + InetAddress.getLocalHost().getHostAddress()); try { - buf = retrieveByteBufferFromRemoteMachine( - new InetSocketAddress(host, port + 1), blockInfo); + buf = + retrieveByteBufferFromRemoteMachine(new InetSocketAddress(host, port + 1), + blockInfo); if (buf != null) { break; } @@ -268,7 +327,7 @@ public boolean rename(String path) throws IOException { return TFS.rename(FID, path); } - private ByteBuffer retrieveByteBufferFromRemoteMachine(InetSocketAddress address, + private ByteBuffer retrieveByteBufferFromRemoteMachine(InetSocketAddress address, ClientBlockInfo blockInfo) throws IOException { SocketChannel socketChannel = SocketChannel.open(); socketChannel.connect(address); @@ -306,47 +365,8 @@ private ByteBuffer retrieveByteBufferFromRemoteMachine(InetSocketAddress address return recvMsg.getReadOnlyData(); } - @Override - public int hashCode() { - return getPath().hashCode() ^ 1234321; - } - - @Override - public boolean equals(Object obj) { - if ((obj != null) && (obj instanceof TachyonFile)) { - return compareTo((TachyonFile)obj) == 0; - } - return false; - } - - @Override - public int compareTo(TachyonFile o) { - return getPath().compareTo(o.getPath()); - } - @Override public String toString() { return getPath(); } - - public long getBlockId(int blockIndex) throws IOException { - return TFS.getBlockId(FID, blockIndex); - } - - public boolean needPin() { - return TFS.isNeedPin(FID); - } - - public int getDiskReplication() { - // TODO Implement it. - return 3; - } - - public long getCreationTimeMs() { - return TFS.getCreationTimeMs(FID); - } - - String getCheckpointPath() { - return TFS.getCheckpointPath(FID); - } } \ No newline at end of file diff --git a/src/main/java/tachyon/client/WriteType.java b/src/main/java/tachyon/client/WriteType.java index cb44fc969cc6..dc6c858727cd 100644 --- a/src/main/java/tachyon/client/WriteType.java +++ b/src/main/java/tachyon/client/WriteType.java @@ -19,17 +19,45 @@ import java.io.IOException; /** - * Different write types for a TachyonFile. + * Different write types for a TachyonFile. */ public enum WriteType { - // Write the file and must cache it. + /** + * Write the file and must cache it. + */ MUST_CACHE(1), - // Write the file and try to cache it. + /** + * Write the file and try to cache it. + */ TRY_CACHE(2), - // Write the file synchronously to the under fs, and also try to cache it, + /** + * Write the file synchronously to the under fs, and also try to cache it, + */ CACHE_THROUGH(3), - // Write the file synchronously to the under fs, no cache. - THROUGH(4); + /** + * Write the file synchronously to the under fs, no cache. + */ + THROUGH(4), + /** + * Write the file asynchronously to the under fs (either must cache or must through). + */ + ASYNC_THROUGH(5); + + public static WriteType getOpType(String op) throws IOException { + if (op.equals("MUST_CACHE")) { + return MUST_CACHE; + } else if (op.equals("TRY_CACHE")) { + return TRY_CACHE; + } else if (op.equals("CACHE_THROUGH")) { + return CACHE_THROUGH; + } else if (op.equals("THROUGH")) { + return THROUGH; + } else if (op.equals("ASYNC_THROUGH")) { + return ASYNC_THROUGH; + } + + throw new IOException("Unknown WriteType : " + op); + } private final int mValue; @@ -41,31 +69,20 @@ public int getValue() { return mValue; } - public boolean isThrough() { - return (mValue == CACHE_THROUGH.mValue) || (mValue == THROUGH.mValue); + public boolean isAsync() { + return mValue == ASYNC_THROUGH.mValue; } public boolean isCache() { - return (mValue == MUST_CACHE.mValue) - || (mValue == CACHE_THROUGH.mValue) - || (mValue == TRY_CACHE.mValue); + return (mValue == MUST_CACHE.mValue) || (mValue == CACHE_THROUGH.mValue) + || (mValue == TRY_CACHE.mValue) || (mValue == ASYNC_THROUGH.mValue); } public boolean isMustCache() { - return mValue == MUST_CACHE.mValue; + return (mValue == MUST_CACHE.mValue) || (mValue == ASYNC_THROUGH.mValue); } - public static WriteType getOpType(String op) throws IOException { - if (op.equals("MUST_CACHE")) { - return MUST_CACHE; - } else if (op.equals("TRY_CACHE")) { - return TRY_CACHE; - } else if (op.equals("CACHE_THROUGH")) { - return CACHE_THROUGH; - } else if (op.equals("THROUGH")) { - return THROUGH; - } - - throw new IOException("Unknown WriteType : " + op); + public boolean isThrough() { + return (mValue == CACHE_THROUGH.mValue) || (mValue == THROUGH.mValue); } } diff --git a/src/main/java/tachyon/client/table/RawColumn.java b/src/main/java/tachyon/client/table/RawColumn.java index 1f76fb9f6411..8fdcb2d2002b 100644 --- a/src/main/java/tachyon/client/table/RawColumn.java +++ b/src/main/java/tachyon/client/table/RawColumn.java @@ -19,9 +19,9 @@ import java.io.IOException; import tachyon.Constants; -import tachyon.MasterInfo; import tachyon.client.TachyonFS; import tachyon.client.TachyonFile; +import tachyon.master.MasterInfo; /** * The column of a RawTable. @@ -39,8 +39,8 @@ public class RawColumn { // TODO creating file here should be based on id. public boolean createPartition(int pId) throws IOException { - return TFS.createFile(RAW_TABLE.getPath() + Constants.PATH_SEPARATOR + - MasterInfo.COL + COLUMN_INDEX + Constants.PATH_SEPARATOR + pId) > 0; + return TFS.createFile(RAW_TABLE.getPath() + Constants.PATH_SEPARATOR + MasterInfo.COL + + COLUMN_INDEX + Constants.PATH_SEPARATOR + pId) > 0; } // TODO creating file here should be based on id. @@ -50,13 +50,13 @@ public TachyonFile getPartition(int pId) throws IOException { // TODO creating file here should be based on id. public TachyonFile getPartition(int pId, boolean cachedMetadata) throws IOException { - return TFS.getFile(RAW_TABLE.getPath() + Constants.PATH_SEPARATOR + MasterInfo.COL + - COLUMN_INDEX + Constants.PATH_SEPARATOR + pId, cachedMetadata); + return TFS.getFile(RAW_TABLE.getPath() + Constants.PATH_SEPARATOR + MasterInfo.COL + + COLUMN_INDEX + Constants.PATH_SEPARATOR + pId, cachedMetadata); } // TODO creating file here should be based on id. public int partitions() throws IOException { - return TFS.getNumberOfFiles(RAW_TABLE.getPath() + Constants.PATH_SEPARATOR + - MasterInfo.COL + COLUMN_INDEX); + return TFS.getNumberOfFiles(RAW_TABLE.getPath() + Constants.PATH_SEPARATOR + MasterInfo.COL + + COLUMN_INDEX); } } \ No newline at end of file diff --git a/src/main/java/tachyon/client/table/RawTable.java b/src/main/java/tachyon/client/table/RawTable.java index 3116c417b549..c400fe454911 100644 --- a/src/main/java/tachyon/client/table/RawTable.java +++ b/src/main/java/tachyon/client/table/RawTable.java @@ -44,6 +44,10 @@ public int getId() { return CLIENT_RAW_TABLE_INFO.getId(); } + public ByteBuffer getMetadata() { + return CommonUtils.cloneByteBuffer(CLIENT_RAW_TABLE_INFO.metadata); + } + public String getName() { return CLIENT_RAW_TABLE_INFO.getName(); } @@ -52,14 +56,10 @@ public String getPath() { return CLIENT_RAW_TABLE_INFO.getPath(); } - public ByteBuffer getMetadata() { - return CommonUtils.cloneByteBuffer(CLIENT_RAW_TABLE_INFO.metadata); - } - public RawColumn getRawColumn(int columnIndex) { if (columnIndex < 0 || columnIndex >= CLIENT_RAW_TABLE_INFO.getColumns()) { - CommonUtils.runtimeException(CLIENT_RAW_TABLE_INFO.getPath() + " does not have column " + - columnIndex + ". It has " + CLIENT_RAW_TABLE_INFO.getColumns() + " columns."); + CommonUtils.runtimeException(CLIENT_RAW_TABLE_INFO.getPath() + " does not have column " + + columnIndex + ". It has " + CLIENT_RAW_TABLE_INFO.getColumns() + " columns."); } return new RawColumn(TACHYON_CLIENT, this, columnIndex); diff --git a/src/main/java/tachyon/command/TFsShell.java b/src/main/java/tachyon/command/TFsShell.java index bf85309533fe..a69dc4409e1d 100644 --- a/src/main/java/tachyon/command/TFsShell.java +++ b/src/main/java/tachyon/command/TFsShell.java @@ -21,15 +21,15 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; -import java.net.InetSocketAddress; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import java.util.Collections; import java.util.List; +import org.apache.commons.io.FilenameUtils; import org.apache.thrift.TException; -import tachyon.client.FileOutStream; +import tachyon.Constants; import tachyon.client.InStream; import tachyon.client.OutStream; import tachyon.client.ReadType; @@ -44,12 +44,22 @@ * Class for handling command line inputs. */ public class TFsShell { - public void printUsage(String cmd) {} - public void close() {} + /** + * Main method, starts a new TFsShell + * + * @param argv + * [] Array of arguments given by the user's input from the terminal + */ + public static void main(String argv[]) throws TException { + TFsShell shell = new TFsShell(); + System.exit(shell.run(argv)); + } /** * Prints the file's contents to the console. - * @param argv[] Array of arguments given by the user's input from the terminal + * + * @param argv + * [] Array of arguments given by the user's input from the terminal * @return 0 if command is successful, -1 if an error occurred. * @throws IOException */ @@ -59,11 +69,12 @@ public int cat(String argv[]) throws IOException { } String path = argv[1]; String file = Utils.getFilePath(path); - TachyonFS tachyonClient = TachyonFS.get(Utils.getTachyonMasterAddress(path)); + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); TachyonFile tFile = tachyonClient.getFile(file); if (tFile == null) { - throw new IOException(file); + System.out.println(file + " does not exist."); + return -1; } if (tFile.isFile()) { InStream is = tFile.getInStream(ReadType.NO_CACHE); @@ -80,9 +91,113 @@ public int cat(String argv[]) throws IOException { } } + /** + * Copies a file or directory specified by argv from the local filesystem to the filesystem. Will + * fail if the path given already exists in the filesystem. + * + * @param argv + * [] Array of arguments given by the user's input from the terminal + * @return 0 if command is successful, -1 if an error occurred. + * @throws IOException + */ + public int copyFromLocal(String argv[]) throws IOException { + if (argv.length != 3) { + System.out.println("Usage: tfs copyFromLocal "); + return -1; + } + + String srcPath = argv[1]; + String dstPath = argv[2]; + File src = new File(srcPath); + if (!src.exists()) { + System.out.println("Local path " + srcPath + " does not exist."); + return -1; + } + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(dstPath)); + String file = Utils.getFilePath(dstPath); + int ret = copyPath(src, tachyonClient, file); + if (ret == 0) { + System.out.println("Copied " + src.getPath() + " to " + dstPath); + } + return ret; + } + + private int copyPath(File src, TachyonFS tachyonClient, String dstPath) throws IOException { + if (!src.isDirectory()) { + int fileId = tachyonClient.createFile(dstPath); + if (fileId == -1) { + return -1; + } + TachyonFile tFile = tachyonClient.getFile(fileId); + OutStream os = tFile.getOutStream(WriteType.CACHE_THROUGH); + FileInputStream in = new FileInputStream(src); + FileChannel channel = in.getChannel(); + ByteBuffer buf = ByteBuffer.allocate(1024); + while (channel.read(buf) != -1) { + buf.flip(); + os.write(buf.array(), 0, buf.limit()); + } + os.close(); + channel.close(); + in.close(); + return 0; + } else { + tachyonClient.mkdir(dstPath); + for (String file : src.list()) { + String newPath = FilenameUtils.concat(dstPath, file); + File srcFile = new File(src, file); + if (copyPath(srcFile, tachyonClient, newPath) == -1) { + return -1; + } + } + } + return 0; + } + + /** + * Copies a file specified by argv from the filesystem to the local filesystem. + * + * @param argv + * [] Array of arguments given by the user's input from the terminal + * @return 0 if command is successful, -1 if an error occurred. + * @throws IOException + */ + public int copyToLocal(String argv[]) throws IOException { + if (argv.length != 3) { + System.out.println("Usage: tfs copyToLocal "); + return -1; + } + + String srcPath = argv[1]; + String dstPath = argv[2]; + String folder = Utils.getFilePath(srcPath); + File dst = new File(dstPath); + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(srcPath)); + TachyonFile tFile = tachyonClient.getFile(folder); + + // tachyonClient.getFile() catches FileDoesNotExist exceptions and returns null + if (tFile == null) { + throw new IOException(folder); + } + + InStream is = tFile.getInStream(ReadType.NO_CACHE); + FileOutputStream out = new FileOutputStream(dst); + byte[] buf = new byte[512]; + int t = is.read(buf); + while (t != -1) { + out.write(buf, 0, t); + t = is.read(buf); + } + out.close(); + System.out.println("Copied " + srcPath + " to " + dstPath); + return 0; + } + /** * Displays the number of folders and files matching the specified prefix in argv. - * @param argv[] Array of arguments given by the user's input from the terminal + * + * @param argv + * [] Array of arguments given by the user's input from the terminal * @return 0 if command is successful, -1 if an error occurred. * @throws IOException */ @@ -100,15 +215,15 @@ public int count(String argv[]) throws IOException { } private long[] countHelper(String path) throws IOException { - TachyonFS tachyonClient = TachyonFS.get(Utils.getTachyonMasterAddress(path)); + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); String folder = Utils.getFilePath(path); TachyonFile tFile = tachyonClient.getFile(folder); if (tFile.isFile()) { - return new long[] {1L, 0L, tFile.length()}; + return new long[] { 1L, 0L, tFile.length() }; } - long[] rtn = new long[] {0L, 1L, 0L}; + long[] rtn = new long[] { 0L, 1L, 0L }; List files = tachyonClient.listStatus(folder); Collections.sort(files); @@ -121,9 +236,61 @@ private long[] countHelper(String path) throws IOException { return rtn; } + /** + * Displays the file's all blocks info + * + * @param argv + * [] Array of arguments given by the user's input from the terminal + * @return 0 if command is successful, -1 if an error occurred. + * @throws IOException + */ + public int fileinfo(String argv[]) throws IOException { + if (argv.length != 2) { + System.out.println("Usage: tfs fileinfo "); + return -1; + } + String path = argv[1]; + String file = Utils.getFilePath(path); + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); + int fileId = tachyonClient.getFileId(file); + List blocks = tachyonClient.getFileBlocks(fileId); + System.out.println(file + " with file id " + fileId + " have following blocks: "); + for (ClientBlockInfo block : blocks) { + System.out.println(block); + } + return 0; + } + + /** + * Displays a list of hosts that have the file specified in argv stored. + * + * @param argv + * [] Array of arguments given by the user's input from the terminal + * @return 0 if command is successful, -1 if an error occurred. + * @throws IOException + */ + public int location(String argv[]) throws IOException { + if (argv.length != 2) { + System.out.println("Usage: tfs location "); + return -1; + } + String path = argv[1]; + String file = Utils.getFilePath(path); + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); + int fileId = tachyonClient.getFileId(file); + List hosts = tachyonClient.getFile(fileId).getLocationHosts(); + System.out.println(file + " with file id " + fileId + " are on nodes: "); + for (String host : hosts) { + System.out.println(host); + } + return 0; + } + /** * Displays information for all directories and files directly under the path specified in argv. - * @param argv[] Array of arguments given by the user's input from the terminal + * + * @param argv + * [] Array of arguments given by the user's input from the terminal * @return 0 if command is successful, -1 if an error occurred. * @throws IOException */ @@ -134,14 +301,14 @@ public int ls(String argv[]) throws IOException { } String path = argv[1]; String folder = Utils.getFilePath(path); - TachyonFS tachyonClient = TachyonFS.get(Utils.getTachyonMasterAddress(path)); + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); List files = tachyonClient.listStatus(folder); Collections.sort(files); String format = "%-10s%-25s%-15s%-5s\n"; for (ClientFileInfo file : files) { - System.out.format(format, CommonUtils.getSizeFromBytes(file.getLength()), - CommonUtils.convertMsToDate(file.getCreationTimeMs()), - file.isInMemory() ? "In Memory" : "Not In Memory", file.getPath()); + System.out.format(format, CommonUtils.getSizeFromBytes(file.getLength()), CommonUtils + .convertMsToDate(file.getCreationTimeMs()), file.isInMemory() ? "In Memory" + : "Not In Memory", file.getPath()); } return 0; } @@ -149,7 +316,9 @@ public int ls(String argv[]) throws IOException { /** * Displays information for all directories and files under the path specified in argv * recursively. - * @param argv[] Array of arguments given by the user's input from the terminal + * + * @param argv + * [] Array of arguments given by the user's input from the terminal * @return 0 if command is successful, -1 if an error occurred. * @throws IOException */ @@ -160,16 +329,16 @@ public int lsr(String argv[]) throws IOException { } String path = argv[1]; String folder = Utils.getFilePath(path); - TachyonFS tachyonClient = TachyonFS.get(Utils.getTachyonMasterAddress(path)); + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); List files = tachyonClient.listStatus(folder); Collections.sort(files); String format = "%-10s%-25s%-15s%-5s\n"; for (ClientFileInfo file : files) { - System.out.format(format, CommonUtils.getSizeFromBytes(file.getLength()), - CommonUtils.convertMsToDate(file.getCreationTimeMs()), - file.isInMemory() ? "In Memory" : "Not In Memory", file.getPath()); + System.out.format(format, CommonUtils.getSizeFromBytes(file.getLength()), CommonUtils + .convertMsToDate(file.getCreationTimeMs()), file.isInMemory() ? "In Memory" + : "Not In Memory", file.getPath()); if (file.isFolder()) { - lsr(new String[]{"lsr", file.getPath()}); + lsr(new String[] { "lsr", file.getPath() }); } } return 0; @@ -178,7 +347,9 @@ public int lsr(String argv[]) throws IOException { /** * Creates a new directory specified by the path in argv, including any parent folders that * are required. This method fails if a directory or file with the same path already exists. - * @param argv[] Array of arguments given by the user's input from the terminal + * + * @param argv + * [] Array of arguments given by the user's input from the terminal * @return 0 if command is successful, -1 if an error occurred. * @throws IOException */ @@ -189,7 +360,7 @@ public int mkdir(String argv[]) throws IOException { } String path = argv[1]; String folder = Utils.getFilePath(path); - TachyonFS tachyonClient = TachyonFS.get(Utils.getTachyonMasterAddress(path)); + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); if (tachyonClient.mkdir(folder)) { System.out.println("Successfully created directory " + folder); return 0; @@ -199,90 +370,33 @@ public int mkdir(String argv[]) throws IOException { } /** - * Removes the file or directory specified by argv. Will remove all files and directories in - * the directory if a directory is specified. - * @param argv[] Array of arguments given by the user's input from the terminal - * @return 0 if command is successful, -1 if an error occurred. - * @throws IOException - */ - public int rm(String argv[]) throws IOException { - if (argv.length != 2) { - System.out.println("Usage: tfs rm "); - return -1; - } - String path = argv[1]; - String file = Utils.getFilePath(path); - TachyonFS tachyonClient = TachyonFS.get(Utils.getTachyonMasterAddress(path)); - if (tachyonClient.delete(file, true)) { - System.out.println(file + " has been removed"); - return 0; - } else { - return -1; - } - } - - /** - * Prints the file's last 1KB of contents to the console. - * @param argv[] Array of arguments given by the user's input from the terminal - * @return 0 if command is successful, -1 if an error occurred. - * @throws IOException - */ - public int tail(String argv[]) throws IOException { - if (argv.length != 2) { - System.out.println("Usage: tfs tail "); - } - String path = argv[1]; - String file = Utils.getFilePath(path); - TachyonFS tachyonClient = TachyonFS.get(Utils.getTachyonMasterAddress(path)); - TachyonFile tFile = tachyonClient.getFile(file); - - if (tFile == null) { - throw new IOException(file); - } - if (tFile.isFile()) { - InStream is = tFile.getInStream(ReadType.NO_CACHE); - byte[] buf = new byte[1024]; - long bytesToRead = 0L; - if (tFile.length() > 1024) { - bytesToRead = 1024; - } else { - bytesToRead = tFile.length(); - } - is.skip(tFile.length() - bytesToRead); - int read = is.read(buf); - System.out.write(buf, 0, read); - return 0; - } else { - System.out.println(file + " is not a file."); - return -1; - } - } - - /** - * Creates a 0 byte file specified by argv. - * @param argv[] Array of arguments given by the user's input from the terminal - * @return 0 if command if sucessful, -1 if an error occurred. - * @throws IOException + * Method which prints the method to use all the commands. */ - public int touch(String argv[]) throws IOException { - if (argv.length != 2) { - System.out.println("Usage: tfs touch "); - return -1; - } - String path = argv[1]; - String file = Utils.getFilePath(path); - TachyonFS tachyonClient = TachyonFS.get(Utils.getTachyonMasterAddress(path)); - TachyonFile tFile = tachyonClient.getFile(tachyonClient.createFile(path)); - OutputStream out = tFile.getOutStream(WriteType.THROUGH); - out.close(); - System.out.println(file + " has been created"); - return 0; + public void printUsage() { + System.out.println("Usage: java TFsShell"); + System.out.println(" [cat ]"); + System.out.println(" [count ]"); + System.out.println(" [ls ]"); + System.out.println(" [lsr ]"); + System.out.println(" [mkdir ]"); + System.out.println(" [rm ]"); + System.out.println(" [tail ]"); + System.out.println(" [touch ]"); + System.out.println(" [mv ]"); + System.out.println(" [copyFromLocal ]"); + System.out.println(" [copyToLocal ]"); + System.out.println(" [fileinfo ]"); + System.out.println(" [location ]"); + System.out.println(" [report ]"); + System.out.println(" [request ]"); } /** * Renames a file or directory specified by argv. Will fail if the new path name already * exists. - * @param argv[] Array of arguments given by the user's input from the terminal + * + * @param argv + * [] Array of arguments given by the user's input from the terminal * @return 0 if command is successful, -1 if an error occurred. * @throws TException */ @@ -293,10 +407,9 @@ public int rename(String argv[]) throws IOException { } String srcPath = argv[1]; String dstPath = argv[2]; - InetSocketAddress srcMasterAddr = Utils.getTachyonMasterAddress(srcPath); - InetSocketAddress dstMasterAddr = Utils.getTachyonMasterAddress(dstPath); - if (!srcMasterAddr.getHostName().equals(dstMasterAddr.getHostName()) || - srcMasterAddr.getPort() != dstMasterAddr.getPort()) { + String srcMasterAddr = Utils.validatePath(srcPath); + String dstMasterAddr = Utils.validatePath(dstPath); + if (!srcMasterAddr.startsWith(dstMasterAddr.substring(0, Constants.HEADER.length()))) { throw new IOException("The file system of source and destination must be the same"); } String srcFile = Utils.getFilePath(srcPath); @@ -310,165 +423,65 @@ public int rename(String argv[]) throws IOException { } } - /** - * Copies a file specified by argv from the filesystem to the local filesystem. - * @param argv[] Array of arguments given by the user's input from the terminal - * @return 0 if command is successful, -1 if an error occurred. - * @throws IOException - */ - public int copyToLocal(String argv[]) throws IOException { - if (argv.length != 3) { - System.out.println("Usage: tfs copyToLocal "); - return -1; - } - - String srcPath = argv[1]; - String dstPath = argv[2]; - String folder = Utils.getFilePath(srcPath); - File dst = new File(dstPath); - TachyonFS tachyonClient = TachyonFS.get(Utils.getTachyonMasterAddress(srcPath)); - TachyonFile tFile = tachyonClient.getFile(folder); - - // tachyonClient.getFile() catches FileDoesNotExist exceptions and returns null - if (tFile == null) { - throw new IOException(folder); - } - - InStream is = tFile.getInStream(ReadType.NO_CACHE); - FileOutputStream out = new FileOutputStream(dst); - byte[] buf = new byte[512]; - int t = is.read(buf); - while (t != -1) { - out.write(buf, 0, t); - t = is.read(buf); - } - out.close(); - System.out.println("Copied " + srcPath + " to " + dstPath); - return 0; - } - - /** - * Displays the file's all blocks info - * @param argv[] Array of arguments given by the user's input from the terminal - * @return 0 if command is successful, -1 if an error occurred. - * @throws IOException - */ - public int fileinfo(String argv[]) throws IOException { + public int report(String argv[]) throws IOException { if (argv.length != 2) { - System.out.println("Usage: tfs fileinfo "); + System.out.println("Usage: tfs report "); return -1; } String path = argv[1]; String file = Utils.getFilePath(path); - TachyonFS tachyonClient = TachyonFS.get(Utils.getTachyonMasterAddress(path)); + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); int fileId = tachyonClient.getFileId(file); - List blocks = tachyonClient.getFileBlocks(fileId); - System.out.println(file + " with file id " + fileId + " have following blocks: "); - for (ClientBlockInfo block: blocks) { - System.out.println(block); - } + tachyonClient.reportLostFile(fileId); + System.out.println(file + " with file id " + fileId + " has reported been report lost."); return 0; } - /** - * Copies a file specified by argv from the local filesystem to the filesystem. Will fail if - * the path given already exists in the filesystem. - * @param argv[] Array of arguments given by the user's input from the terminal - * @return 0 if command is successful, -1 if an error occurred. - * @throws IOException - */ - public int copyFromLocal(String argv[]) throws IOException { + public int request(String argv[]) throws IOException { if (argv.length != 3) { - System.out.println("Usage: tfs copyFromLocal "); - return -1; - } - - String srcPath = argv[1]; - String dstPath = argv[2]; - String dstFile = Utils.getFilePath(dstPath); - File src = new File(srcPath); - if (!src.exists()) { - System.out.println("Local file " + srcPath + " does not exist."); - return -1; - } - TachyonFS tachyonClient = TachyonFS.get(Utils.getTachyonMasterAddress(dstPath)); - int fileId = tachyonClient.createFile(dstFile); - if (fileId == -1) { + System.out.println("Usage: tfs request "); return -1; } - TachyonFile tFile = tachyonClient.getFile(fileId); - OutStream os = (FileOutStream) tFile.getOutStream(WriteType.THROUGH); - FileInputStream in = new FileInputStream(src); - FileChannel channel = in.getChannel(); - ByteBuffer buf = ByteBuffer.allocate(1024); - while (channel.read(buf) != -1) { - buf.flip(); - os.write(buf.array(), 0, buf.limit()); - } - os.close(); - channel.close(); - in.close(); - System.out.println("Copied " + srcPath + " to " + dstPath); + String path = argv[1]; + int depId = Integer.parseInt(argv[2]); + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); + tachyonClient.requestFilesInDependency(depId); + System.out.println("Dependency with ID " + depId + " has been requested."); return 0; } /** - * Displays a list of hosts that have the file specified in argv stored. - * @param argv[] Array of arguments given by the user's input from the terminal + * Removes the file or directory specified by argv. Will remove all files and directories in + * the directory if a directory is specified. + * + * @param argv + * [] Array of arguments given by the user's input from the terminal * @return 0 if command is successful, -1 if an error occurred. * @throws IOException */ - public int location(String argv[]) throws IOException { + public int rm(String argv[]) throws IOException { if (argv.length != 2) { - System.out.println("Usage: tfs location "); + System.out.println("Usage: tfs rm "); return -1; } String path = argv[1]; String file = Utils.getFilePath(path); - TachyonFS tachyonClient = TachyonFS.get(Utils.getTachyonMasterAddress(path)); - int fileId = tachyonClient.getFileId(file); - List hosts = tachyonClient.getFile(fileId).getLocationHosts(); - System.out.println(file + " with file id " + fileId + " are on nodes: "); - for (String host: hosts) { - System.out.println(host); + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); + if (tachyonClient.delete(file, true)) { + System.out.println(file + " has been removed"); + return 0; + } else { + return -1; } - return 0; - } - - /** - * Method which prints the method to use all the commands. - */ - public void printUsage() { - System.out.println("Usage: java TFsShell"); - System.out.println(" [cat ]"); - System.out.println(" [count ]"); - System.out.println(" [ls ]"); - System.out.println(" [lsr ]"); - System.out.println(" [mkdir ]"); - System.out.println(" [rm ]"); - System.out.println(" [tail ]"); - System.out.println(" [touch ]"); - System.out.println(" [mv ]"); - System.out.println(" [copyFromLocal ]"); - System.out.println(" [copyToLocal ]"); - System.out.println(" [fileinfo ]"); - System.out.println(" [location ]"); - } - - /** - * Main method, starts a new TFsShell - * @param argv[] Array of arguments given by the user's input from the terminal - */ - public static void main(String argv[]) throws TException{ - TFsShell shell = new TFsShell(); - System.exit(shell.run(argv)); } /** * Method which determines how to handle the user's request, will display usage help to the * user if command format is incorrect. - * @param argv[] Array of arguments given by the user's input from the terminal - * @return 0 if command is successful, -1 if an error occured + * + * @param argv + * [] Array of arguments given by the user's input from the terminal + * @return 0 if command is successful, -1 if an error occurred * @throws TException */ public int run(String argv[]) throws TException { @@ -506,15 +519,82 @@ public int run(String argv[]) throws TException { exitCode = fileinfo(argv); } else if (cmd.equals("location")) { exitCode = location(argv); + } else if (cmd.equals("report")) { + exitCode = report(argv); + } else if (cmd.equals("request")) { + exitCode = request(argv); } else { printUsage(); return -1; } } catch (IOException ioe) { - System.out.println(ioe.getMessage()); + System.out.println(ioe.getMessage()); } finally { } return exitCode; } -} \ No newline at end of file + + /** + * Prints the file's last 1KB of contents to the console. + * + * @param argv + * [] Array of arguments given by the user's input from the terminal + * @return 0 if command is successful, -1 if an error occurred.f + * @throws IOException + */ + public int tail(String argv[]) throws IOException { + if (argv.length != 2) { + System.out.println("Usage: tfs tail "); + } + String path = argv[1]; + String file = Utils.getFilePath(path); + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); + TachyonFile tFile = tachyonClient.getFile(file); + + if (tFile == null) { + System.out.println(file + " does not exist."); + return -1; + } + if (tFile.isFile()) { + InStream is = tFile.getInStream(ReadType.NO_CACHE); + byte[] buf = new byte[1024]; + long bytesToRead = 0L; + if (tFile.length() > 1024) { + bytesToRead = 1024; + } else { + bytesToRead = tFile.length(); + } + is.skip(tFile.length() - bytesToRead); + int read = is.read(buf); + System.out.write(buf, 0, read); + return 0; + } else { + System.out.println(file + " is not a file."); + return -1; + } + } + + /** + * Creates a 0 byte file specified by argv. + * + * @param argv + * [] Array of arguments given by the user's input from the terminal + * @return 0 if command if successful, -1 if an error occurred. + * @throws IOException + */ + public int touch(String argv[]) throws IOException { + if (argv.length != 2) { + System.out.println("Usage: tfs touch "); + return -1; + } + String path = argv[1]; + String file = Utils.getFilePath(path); + TachyonFS tachyonClient = TachyonFS.get(Utils.validatePath(path)); + TachyonFile tFile = tachyonClient.getFile(tachyonClient.createFile(file)); + OutputStream out = tFile.getOutStream(WriteType.THROUGH); + out.close(); + System.out.println(path + " has been created"); + return 0; + } +} diff --git a/src/main/java/tachyon/command/Utils.java b/src/main/java/tachyon/command/Utils.java index ce437b221136..e431836bf87a 100644 --- a/src/main/java/tachyon/command/Utils.java +++ b/src/main/java/tachyon/command/Utils.java @@ -17,60 +17,57 @@ package tachyon.command; import java.io.IOException; -import java.net.InetSocketAddress; import tachyon.Constants; +import tachyon.conf.CommonConf; /** * Class for convenience methods used by TFsShell. */ public class Utils { - private static final String HEADER = "tachyon://"; + /** + * Removes Constants.HEADER / Constants.HEADER_FT and hostname:port information from a path, + * leaving only the local file path. + * + * @param path + * The path to obtain the local path from + * @return The local path in string format + * @throws IOException + */ + public static String getFilePath(String path) throws IOException { + path = validatePath(path); + if (path.startsWith(Constants.HEADER)) { + path = path.substring(Constants.HEADER.length()); + } else if (path.startsWith(Constants.HEADER_FT)) { + path = path.substring(Constants.HEADER_FT.length()); + } + String ret = path.substring(path.indexOf("/")); + return ret; + } /** - * Validates the path, verifying that it contains the header and a hostname:port specified. - * @param path The path to be verified. - * @throws IOException + * Validates the path, verifying that it contains the Constants.HEADER or + * Constants.HEADER_FT and a hostname:port specified. + * + * @param path + * The path to be verified. + * @throws IOException */ - public static String validateTachyonPath(String path) throws IOException { - if (path.startsWith(HEADER)) { + public static String validatePath(String path) throws IOException { + if (path.startsWith(Constants.HEADER) || path.startsWith(Constants.HEADER_FT)) { if (!path.contains(":")) { - throw new IOException("Invalid Path: " + path + "\n Use tachyon://host:port/ or /file"); + throw new IOException("Invalid Path: " + path + ". Use " + Constants.HEADER + + "host:port/ ," + Constants.HEADER_FT + "host:port/" + " , or /file"); } else { return path; } } else { String HOSTNAME = System.getProperty("tachyon.master.hostname", "localhost"); String PORT = System.getProperty("tachyon.master.port", "" + Constants.DEFAULT_MASTER_PORT); - return HEADER + HOSTNAME + ":" + PORT + path; + if (CommonConf.get().USE_ZOOKEEPER) { + return Constants.HEADER_FT + HOSTNAME + ":" + PORT + path; + } + return Constants.HEADER + HOSTNAME + ":" + PORT + path; } } - - /** - * Removes header and hostname:port information from a path, leaving only the local file path. - * @param path The path to obtain the local path from - * @return The local path in string format - * @throws IOException - */ - public static String getFilePath(String path) throws IOException { - path = validateTachyonPath(path); - path = path.substring(HEADER.length()); - String ret = path.substring(path.indexOf("/")); - return ret; - } - - /** - * Obtains the InetSocketAddress from a path by parsing the hostname:port portion of the path. - * @param path The path to obtain the InetSocketAddress from. - * @return The InetSocketAddress of the master node. - * @throws IOException - */ - public static InetSocketAddress getTachyonMasterAddress(String path) throws IOException { - path = validateTachyonPath(path); - path = path.substring(HEADER.length()); - String masterAddress = path.substring(0, path.indexOf("/")); - String masterHost = masterAddress.split(":")[0]; - int masterPort = Integer.parseInt(masterAddress.split(":")[1]); - return new InetSocketAddress(masterHost, masterPort); - } } \ No newline at end of file diff --git a/src/main/java/tachyon/conf/CommonConf.java b/src/main/java/tachyon/conf/CommonConf.java index 58daf3652439..781f5d38aa55 100644 --- a/src/main/java/tachyon/conf/CommonConf.java +++ b/src/main/java/tachyon/conf/CommonConf.java @@ -16,28 +16,72 @@ */ package tachyon.conf; +import java.io.File; + +import org.apache.log4j.Logger; + +import tachyon.Constants; + /** * Configurations shared by master and workers. */ public class CommonConf extends Utils { + private static final Logger LOG = Logger.getLogger(""); + private static CommonConf COMMON_CONF = null; + /** + * This is for unit test only. DO NOT use it for other purpose. + */ + public static synchronized void clear() { + COMMON_CONF = null; + } + + public static synchronized CommonConf get() { + if (COMMON_CONF == null) { + COMMON_CONF = new CommonConf(); + } + + return COMMON_CONF; + } + public final String TACHYON_HOME; public final String UNDERFS_ADDRESS; public final String UNDERFS_DATA_FOLDER; public final String UNDERFS_WORKERS_FOLDER; + public final String UNDERFS_HDFS_IMPL; + public final String WEB_RESOURCES; public final boolean USE_ZOOKEEPER; public final String ZOOKEEPER_ADDRESS; + public final String ZOOKEEPER_ELECTION_PATH; + public final String ZOOKEEPER_LEADER_PATH; + public final boolean ASYNC_ENABLED; + + public final int MAX_COLUMNS; + + public final int MAX_TABLE_METADATA_BYTE; + private CommonConf() { - TACHYON_HOME = getProperty("tachyon.home"); - UNDERFS_ADDRESS = getProperty("tachyon.underfs.address", TACHYON_HOME); - UNDERFS_DATA_FOLDER = UNDERFS_ADDRESS + getProperty("tachyon.data.folder", "/tachyon/data"); - UNDERFS_WORKERS_FOLDER = - UNDERFS_ADDRESS + getProperty("tachyon.workers.folder", "/tachyon/workers"); + if (System.getProperty("tachyon.home") == null) { + LOG.warn("tachyon.home is not set. Using /mnt/tachyon_default_home as the default value."); + File file = new File("/mnt/tachyon_default_home"); + if (!file.exists()) { + file.mkdirs(); + } + } + TACHYON_HOME = getProperty("tachyon.home", "/mnt/tachyon_default_home"); + WEB_RESOURCES = + getProperty("tachyon.web.resources", TACHYON_HOME + "/src/main/webapp"); + UNDERFS_ADDRESS = getProperty("tachyon.underfs.address", TACHYON_HOME + "/underfs"); + UNDERFS_DATA_FOLDER = getProperty("tachyon.data.folder", UNDERFS_ADDRESS + "/tachyon/data"); + UNDERFS_WORKERS_FOLDER = + getProperty("tachyon.workers.folder", UNDERFS_ADDRESS + "/tachyon/workers"); + UNDERFS_HDFS_IMPL = + getProperty("tachyon.underfs.hdfs.impl", "org.apache.hadoop.hdfs.DistributedFileSystem"); USE_ZOOKEEPER = getBooleanProperty("tachyon.usezookeeper", false); if (USE_ZOOKEEPER) { @@ -49,20 +93,10 @@ private CommonConf() { ZOOKEEPER_ELECTION_PATH = null; ZOOKEEPER_LEADER_PATH = null; } - } - - public static synchronized CommonConf get() { - if (COMMON_CONF == null) { - COMMON_CONF = new CommonConf(); - } - return COMMON_CONF; - } - - /** - * This is for unit test only. DO NOT use it for other purpose. - */ - public static synchronized void clear() { - COMMON_CONF = null; + ASYNC_ENABLED = getBooleanProperty("tachyon.async.enabled", false); + + MAX_COLUMNS = getIntProperty("tachyon.max.columns", 1000); + MAX_TABLE_METADATA_BYTE = getIntProperty("tachyon.max.table.metadata.byte", Constants.MB * 5); } } diff --git a/src/main/java/tachyon/conf/MasterConf.java b/src/main/java/tachyon/conf/MasterConf.java index e80fb87e6f10..e356bceb68ee 100644 --- a/src/main/java/tachyon/conf/MasterConf.java +++ b/src/main/java/tachyon/conf/MasterConf.java @@ -27,27 +27,48 @@ public class MasterConf extends Utils { private static MasterConf MASTER_CONF = null; + /** + * This is for unit test only. DO NOT use it for other purpose. + */ + public static synchronized void clear() { + MASTER_CONF = null; + } + + public static synchronized MasterConf get() { + if (MASTER_CONF == null) { + MASTER_CONF = new MasterConf(); + } + + return MASTER_CONF; + } + public final String JOURNAL_FOLDER; + public final String FORMAT_FILE_PREFIX; public final String HOSTNAME; public final int PORT; - public final int WEB_PORT; + public final int WEB_PORT; + public final String TEMPORARY_FOLDER; public final int HEARTBEAT_INTERVAL_MS; public final int SELECTOR_THREADS; public final int QUEUE_SIZE_PER_SELECTOR; + public final int SERVER_THREADS; public final int WORKER_TIMEOUT_MS; public final ArrayList WHITELIST = new ArrayList(); + public final ArrayList PINLIST = new ArrayList(); private MasterConf() { - JOURNAL_FOLDER = getProperty("tachyon.master.journal.folder", - CommonConf.get().TACHYON_HOME + "/journal/"); + JOURNAL_FOLDER = + getProperty("tachyon.master.journal.folder", CommonConf.get().TACHYON_HOME + "/journal/"); + FORMAT_FILE_PREFIX = "_format_"; HOSTNAME = getProperty("tachyon.master.hostname", "localhost"); PORT = getIntProperty("tachyon.master.port", Constants.DEFAULT_MASTER_PORT); WEB_PORT = getIntProperty("tachyon.master.web.port", Constants.DEFAULT_MASTER_WEB_PORT); + TEMPORARY_FOLDER = getProperty("tachyon.master.temporary.folder", "/tmp"); HEARTBEAT_INTERVAL_MS = getIntProperty("tachyon.master.heartbeat.interval.ms", 1000); SELECTOR_THREADS = getIntProperty("tachyon.master.selector.threads", 3); @@ -61,19 +82,4 @@ private MasterConf() { PINLIST.addAll(Arrays.asList(tPinList.split(";"))); } } - - public static synchronized MasterConf get() { - if (MASTER_CONF == null) { - MASTER_CONF = new MasterConf(); - } - - return MASTER_CONF; - } - - /** - * This is for unit test only. DO NOT use it for other purpose. - */ - public static synchronized void clear() { - MASTER_CONF = null; - } } diff --git a/src/main/java/tachyon/conf/UserConf.java b/src/main/java/tachyon/conf/UserConf.java index f5c9a406df75..cd1f3dc7652d 100644 --- a/src/main/java/tachyon/conf/UserConf.java +++ b/src/main/java/tachyon/conf/UserConf.java @@ -21,12 +21,29 @@ public class UserConf extends Utils { private static UserConf USER_CONF = null; + /** + * This is for unit test only. DO NOT use it for other purpose. + */ + public static synchronized void clear() { + USER_CONF = null; + } + + public static synchronized UserConf get() { + if (USER_CONF == null) { + USER_CONF = new UserConf(); + } + + return USER_CONF; + } + public final int FAILED_SPACE_REQUEST_LIMITS; public final long QUOTA_UNIT_BYTES; public final int FILE_BUFFER_BYTES; public final long HEARTBEAT_INTERVAL_MS; public final long MASTER_CLIENT_TIMEOUT_MS; + public final long DEFAULT_BLOCK_SIZE_BYTE; + public final int REMOTE_READ_BUFFER_SIZE_BYTE; private UserConf() { @@ -40,19 +57,4 @@ private UserConf() { REMOTE_READ_BUFFER_SIZE_BYTE = getIntProperty("tachyon.user.remote.read.buffer.size.byte", Constants.MB); } - - public static synchronized UserConf get() { - if (USER_CONF == null) { - USER_CONF = new UserConf(); - } - - return USER_CONF; - } - - /** - * This is for unit test only. DO NOT use it for other purpose. - */ - public static synchronized void clear() { - USER_CONF = null; - } } diff --git a/src/main/java/tachyon/conf/Utils.java b/src/main/java/tachyon/conf/Utils.java index 0bd46e02f07d..7ad6eec2426f 100644 --- a/src/main/java/tachyon/conf/Utils.java +++ b/src/main/java/tachyon/conf/Utils.java @@ -26,27 +26,6 @@ class Utils { private static final Logger LOG = Logger.getLogger(""); - public static String getProperty(String property) { - String ret = System.getProperty(property); - if (ret == null) { - CommonUtils.illegalArgumentException(property + " is not configured."); - } else { - LOG.debug(property + " : " + ret); - } - return ret; - } - - public static String getProperty(String property, String defaultValue) { - String ret = System.getProperty(property); - String msg = ""; - if (ret == null) { - ret = defaultValue; - msg = " uses the default value"; - } - LOG.debug(property + msg + " : " + ret); - return ret; - } - public static boolean getBooleanProperty(String property) { return Boolean.valueOf(getProperty(property)); } @@ -71,4 +50,25 @@ public static long getLongProperty(String property, int defaultValue) { return Long.valueOf(getProperty(property, defaultValue + "")); } + public static String getProperty(String property) { + String ret = System.getProperty(property); + if (ret == null) { + CommonUtils.illegalArgumentException(property + " is not configured."); + } else { + LOG.debug(property + " : " + ret); + } + return ret; + } + + public static String getProperty(String property, String defaultValue) { + String ret = System.getProperty(property); + String msg = ""; + if (ret == null) { + ret = defaultValue; + msg = " uses the default value"; + } + LOG.debug(property + msg + " : " + ret); + return ret; + } + } diff --git a/src/main/java/tachyon/conf/WorkerConf.java b/src/main/java/tachyon/conf/WorkerConf.java index 22474dc547a2..9c895a8a4555 100644 --- a/src/main/java/tachyon/conf/WorkerConf.java +++ b/src/main/java/tachyon/conf/WorkerConf.java @@ -22,9 +22,23 @@ public class WorkerConf extends Utils { private static WorkerConf WORKER_CONF = null; + /** + * This is for unit test only. DO NOT use it for other purpose. + */ + public static synchronized void clear() { + WORKER_CONF = null; + } + + public static synchronized WorkerConf get() { + if (WORKER_CONF == null) { + WORKER_CONF = new WorkerConf(); + } + + return WORKER_CONF; + } + public final String MASTER_HOSTNAME; public final int MASTER_PORT; - public final int PORT; public final int DATA_PORT; public final String DATA_FOLDER; @@ -34,9 +48,14 @@ public class WorkerConf extends Utils { public final int SELECTOR_THREADS; public final int QUEUE_SIZE_PER_SELECTOR; public final int SERVER_THREADS; + public final int USER_TIMEOUT_MS; public final String USER_TEMP_RELATIVE_FOLDER = "users"; + public final int WORKER_CHECKPOINT_THREADS; + + public final int WORKER_PER_THREAD_CHECKPOINT_CAP_MB_SEC; + private WorkerConf() { MASTER_HOSTNAME = getProperty("tachyon.master.hostname", "localhost"); MASTER_PORT = getIntProperty("tachyon.master.port", Constants.DEFAULT_MASTER_PORT); @@ -45,8 +64,9 @@ private WorkerConf() { DATA_PORT = getIntProperty("tachyon.worker.data.port", Constants.DEFAULT_WORKER_DATA_SERVER_PORT); DATA_FOLDER = getProperty("tachyon.worker.data.folder", "/mnt/ramdisk"); - MEMORY_SIZE = CommonUtils.parseMemorySize( - getProperty("tachyon.worker.memory.size", (128 * Constants.MB) + "")); + MEMORY_SIZE = + CommonUtils.parseMemorySize(getProperty("tachyon.worker.memory.size", (128 * Constants.MB) + + "")); HEARTBEAT_TIMEOUT_MS = getIntProperty("tachyon.worker.heartbeat.timeout.ms", 10 * 1000); TO_MASTER_HEARTBEAT_INTERVAL_MS = getIntProperty("tachyon.worker.to.master.heartbeat.interval.ms", 1000); @@ -54,20 +74,9 @@ private WorkerConf() { QUEUE_SIZE_PER_SELECTOR = getIntProperty("tachyon.worker.queue.size.per.selector", 3000); SERVER_THREADS = getIntProperty("tachyon.worker.server.threads", 128); USER_TIMEOUT_MS = getIntProperty("tachyon.worker.user.timeout.ms", 10 * 1000); - } - - public static synchronized WorkerConf get() { - if (WORKER_CONF == null) { - WORKER_CONF = new WorkerConf(); - } - return WORKER_CONF; - } - - /** - * This is for unit test only. DO NOT use it for other purpose. - */ - public static synchronized void clear() { - WORKER_CONF = null; + WORKER_CHECKPOINT_THREADS = getIntProperty("tachyon.worker.checkpoint.threads", 1); + WORKER_PER_THREAD_CHECKPOINT_CAP_MB_SEC = + getIntProperty("tachyon.worker.per.thread.checkpoint.cap.mb.sec", 1000); } } diff --git a/src/main/java/tachyon/examples/BasicCheckpoint.java b/src/main/java/tachyon/examples/BasicCheckpoint.java new file mode 100644 index 000000000000..5a03f4348c9b --- /dev/null +++ b/src/main/java/tachyon/examples/BasicCheckpoint.java @@ -0,0 +1,102 @@ +package tachyon.examples; + +import java.io.IOException; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.util.ArrayList; +import java.util.List; + +import org.apache.log4j.Logger; +import org.apache.thrift.TException; + +import tachyon.Constants; +import tachyon.Version; +import tachyon.client.TachyonByteBuffer; +import tachyon.client.TachyonFS; +import tachyon.client.TachyonFile; +import tachyon.client.WriteType; +import tachyon.master.DependencyType; +import tachyon.util.CommonUtils; + +/** + * An example to show to how use Tachyon's API + */ +public class BasicCheckpoint { + private static Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); + + private static TachyonFS sTachyonClient; + private static String sFileFolder = null; + private static int sFiles; + private static int sNumbers = 20; + private static boolean sPass = true; + + public static void createDependency() throws IOException { + long startTimeMs = CommonUtils.getCurrentMs(); + List children = new ArrayList(); + for (int k = 0; k < sFiles; k ++) { + children.add(sFileFolder + "/part-" + k); + } + List data = new ArrayList(); + data.add(ByteBuffer.allocate(10)); + int depId = + sTachyonClient.createDependency(new ArrayList(), children, "fake command", data, + "BasicCheckpoint Dependency", "Tachyon Examples", "0.3", + DependencyType.Narrow.getValue(), 512 * Constants.MB); + + CommonUtils.printTimeTakenMs(startTimeMs, LOG, "createDependency with depId " + depId); + } + + public static void main(String[] args) throws IOException, TException { + if (args.length != 3) { + System.out.println("java -cp target/tachyon-" + Version.VERSION + + "-jar-with-dependencies.jar " + + "tachyon.examples.BasicCheckpoint "); + System.exit(-1); + } + sTachyonClient = TachyonFS.get(args[0]); + sFileFolder = args[1]; + sFiles = Integer.parseInt(args[2]); + createDependency(); + writeFile(); + readFile(); + Utils.printPassInfo(sPass); + System.exit(0); + } + + public static void readFile() throws IOException { + for (int i = 0; i < sFiles; i ++) { + String filePath = sFileFolder + "/part-" + i; + LOG.debug("Reading data from " + filePath); + TachyonFile file = sTachyonClient.getFile(filePath); + TachyonByteBuffer buf = file.readByteBuffer(); + if (buf == null) { + file.recache(); + buf = file.readByteBuffer(); + } + buf.DATA.order(ByteOrder.nativeOrder()); + for (int k = 0; k < sNumbers; k ++) { + sPass = sPass && (buf.DATA.getInt() == k); + } + buf.close(); + } + } + + public static void writeFile() throws IOException { + for (int i = 0; i < sFiles; i ++) { + String filePath = sFileFolder + "/part-" + i; + TachyonFile file = sTachyonClient.getFile(filePath); + OutputStream os = file.getOutStream(WriteType.ASYNC_THROUGH); + + ByteBuffer buf = ByteBuffer.allocate(80); + buf.order(ByteOrder.nativeOrder()); + for (int k = 0; k < sNumbers; k ++) { + buf.putInt(k); + } + buf.flip(); + LOG.debug("Writing data to " + filePath); + os.write(buf.array()); + os.close(); + } + } +} \ No newline at end of file diff --git a/src/main/java/tachyon/examples/BasicOperations.java b/src/main/java/tachyon/examples/BasicOperations.java index 74c654e49d1f..3ebdc40b6c7a 100644 --- a/src/main/java/tachyon/examples/BasicOperations.java +++ b/src/main/java/tachyon/examples/BasicOperations.java @@ -29,9 +29,6 @@ import tachyon.client.TachyonFS; import tachyon.client.TachyonFile; import tachyon.client.WriteType; -import tachyon.thrift.FileAlreadyExistException; -import tachyon.thrift.InvalidPathException; -import tachyon.thrift.SuspectedFileSizeException; import tachyon.util.CommonUtils; public class BasicOperations { @@ -40,6 +37,8 @@ public class BasicOperations { private static TachyonFS sTachyonClient; private static String sFilePath = null; private static WriteType sWriteType = null; + private static int sNumbers = 20; + private static boolean sPass = true; public static void createFile() throws IOException { long startTimeMs = CommonUtils.getCurrentMs(); @@ -47,28 +46,25 @@ public static void createFile() throws IOException { CommonUtils.printTimeTakenMs(startTimeMs, LOG, "createFile with fileId " + fileId); } - public static void writeFile() - throws SuspectedFileSizeException, InvalidPathException, IOException { - ByteBuffer buf = ByteBuffer.allocate(80); - buf.order(ByteOrder.nativeOrder()); - for (int k = 0; k < 20; k ++) { - buf.putInt(k); + public static void main(String[] args) throws IOException { + if (args.length != 3) { + System.out.println("java -cp target/tachyon-" + Version.VERSION + + "-jar-with-dependencies.jar " + + "tachyon.examples.BasicOperations "); + System.exit(-1); } - - buf.flip(); - LOG.info("Writing data..."); - CommonUtils.printByteBuffer(LOG, buf); - buf.flip(); - - TachyonFile file = sTachyonClient.getFile(sFilePath); - OutStream os = file.getOutStream(sWriteType); - os.write(buf.array()); - os.close(); + sTachyonClient = TachyonFS.get(args[0]); + sFilePath = args[1]; + sWriteType = WriteType.getOpType(args[2]); + createFile(); + writeFile(); + readFile(); + Utils.printPassInfo(sPass); + System.exit(0); } - public static void readFile() - throws SuspectedFileSizeException, InvalidPathException, IOException { - LOG.info("Reading data..."); + public static void readFile() throws IOException { + LOG.debug("Reading data..."); TachyonFile file = sTachyonClient.getFile(sFilePath); TachyonByteBuffer buf = file.readByteBuffer(); if (buf == null) { @@ -76,25 +72,26 @@ public static void readFile() buf = file.readByteBuffer(); } buf.DATA.order(ByteOrder.nativeOrder()); - CommonUtils.printByteBuffer(LOG, buf.DATA); + for (int k = 0; k < sNumbers; k ++) { + sPass = sPass && (buf.DATA.getInt() == k); + } buf.close(); } - public static void main(String[] args) - throws SuspectedFileSizeException, InvalidPathException, IOException, - FileAlreadyExistException { - if (args.length != 3) { - System.out.println("java -cp target/tachyon-" + Version.VERSION + - "-jar-with-dependencies.jar " + - "tachyon.examples.BasicOperations "); - System.exit(-1); + public static void writeFile() throws IOException { + ByteBuffer buf = ByteBuffer.allocate(sNumbers * 4); + buf.order(ByteOrder.nativeOrder()); + for (int k = 0; k < sNumbers; k ++) { + buf.putInt(k); } - sTachyonClient = TachyonFS.get(args[0]); - sFilePath = args[1]; - sWriteType = WriteType.getOpType(args[2]); - createFile(); - writeFile(); - readFile(); - System.exit(0); + + buf.flip(); + LOG.debug("Writing data..."); + buf.flip(); + + TachyonFile file = sTachyonClient.getFile(sFilePath); + OutStream os = file.getOutStream(sWriteType); + os.write(buf.array()); + os.close(); } } \ No newline at end of file diff --git a/src/main/java/tachyon/examples/BasicRawTableOperations.java b/src/main/java/tachyon/examples/BasicRawTableOperations.java index 10ae4a0e7f5e..4a63ed5a1c60 100644 --- a/src/main/java/tachyon/examples/BasicRawTableOperations.java +++ b/src/main/java/tachyon/examples/BasicRawTableOperations.java @@ -20,7 +20,6 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; -import org.apache.thrift.TException; import org.apache.log4j.Logger; import tachyon.Constants; @@ -32,11 +31,6 @@ import tachyon.client.WriteType; import tachyon.client.table.RawColumn; import tachyon.client.table.RawTable; -import tachyon.thrift.FileAlreadyExistException; -import tachyon.thrift.InvalidPathException; -import tachyon.thrift.OutOfMemoryForPinFileException; -import tachyon.thrift.TableColumnException; -import tachyon.thrift.TableDoesNotExistException; import tachyon.util.CommonUtils; public class BasicRawTableOperations { @@ -47,58 +41,46 @@ public class BasicRawTableOperations { private static String sTablePath = null; private static int mId; private static WriteType sWriteType = null; + private static int sDataLength = 20; + private static int sMetadataLength = 5; + private static boolean sPass = true; public static void createRawTable() throws IOException { - long startTimeMs = CommonUtils.getCurrentMs(); - ByteBuffer data = ByteBuffer.allocate(12); + ByteBuffer data = ByteBuffer.allocate(sMetadataLength * 4); data.order(ByteOrder.nativeOrder()); - data.putInt(-1); - data.putInt(-2); - data.putInt(-3); + for (int k = -sMetadataLength; k < 0; k ++) { + data.putInt(k); + } data.flip(); mId = sTachyonClient.createRawTable(sTablePath, 3, data); - CommonUtils.printTimeTakenMs(startTimeMs, LOG, "createRawTable with id " + mId); } - public static void writeParition() - throws IOException, TableDoesNotExistException, InvalidPathException, - FileAlreadyExistException, TException { - RawTable rawTable = sTachyonClient.getRawTable(sTablePath); - - LOG.info("Writing data..."); - for (int column = 0; column < COLS; column ++) { - RawColumn rawColumn = rawTable.getRawColumn(column); - if (!rawColumn.createPartition(0)) { - CommonUtils.runtimeException("Failed to create partition in table " + sTablePath + - " under column " + column); - } - - ByteBuffer buf = ByteBuffer.allocate(80); - buf.order(ByteOrder.nativeOrder()); - for (int k = 0; k < 20; k ++) { - buf.putInt(k); - } - buf.flip(); - CommonUtils.printByteBuffer(LOG, buf); - buf.flip(); - - TachyonFile tFile = rawColumn.getPartition(0); - OutStream os = tFile.getOutStream(sWriteType); - os.write(buf.array()); - os.close(); + public static void main(String[] args) throws IOException { + if (args.length != 3) { + System.out.println("java -cp target/tachyon-" + Version.VERSION + + "-jar-with-dependencies.jar " + + "tachyon.examples.BasicRawTableOperations "); + System.exit(-1); } + sTachyonClient = TachyonFS.get(args[0]); + sTablePath = args[1]; + sWriteType = WriteType.getOpType(args[2]); + createRawTable(); + write(); + read(); + Utils.printPassInfo(sPass); + System.exit(0); } - public static void readPartition() - throws IOException, TableDoesNotExistException, InvalidPathException, TException { - LOG.info("Reading data..."); + public static void read() throws IOException { + LOG.debug("Reading data..."); RawTable rawTable = sTachyonClient.getRawTable(mId); ByteBuffer metadata = rawTable.getMetadata(); - LOG.info("Metadata: "); + LOG.debug("Metadata: "); metadata.order(ByteOrder.nativeOrder()); - LOG.info(metadata.getInt() + " "); - LOG.info(metadata.getInt() + " "); - LOG.info(metadata.getInt() + " "); + for (int k = -sMetadataLength; k < 0; k ++) { + sPass = sPass && (metadata.getInt() == k); + } for (int column = 0; column < COLS; column ++) { RawColumn rawColumn = rawTable.getRawColumn(column); @@ -110,26 +92,35 @@ public static void readPartition() buf = tFile.readByteBuffer(); } buf.DATA.order(ByteOrder.nativeOrder()); - CommonUtils.printByteBuffer(LOG, buf.DATA); + for (int k = 0; k < sDataLength; k ++) { + sPass = sPass && (buf.DATA.getInt() == k); + } buf.close(); } } - public static void main(String[] args) - throws IOException, TableDoesNotExistException, OutOfMemoryForPinFileException, - InvalidPathException, FileAlreadyExistException, TableColumnException, TException { - if (args.length != 3) { - System.out.println("java -cp target/tachyon-" + Version.VERSION + - "-jar-with-dependencies.jar " + - "tachyon.examples.BasicRawTableOperations "); - System.exit(-1); + public static void write() throws IOException { + RawTable rawTable = sTachyonClient.getRawTable(sTablePath); + + LOG.debug("Writing data..."); + for (int column = 0; column < COLS; column ++) { + RawColumn rawColumn = rawTable.getRawColumn(column); + if (!rawColumn.createPartition(0)) { + CommonUtils.runtimeException("Failed to create partition in table " + sTablePath + + " under column " + column); + } + + ByteBuffer buf = ByteBuffer.allocate(80); + buf.order(ByteOrder.nativeOrder()); + for (int k = 0; k < sDataLength; k ++) { + buf.putInt(k); + } + buf.flip(); + + TachyonFile tFile = rawColumn.getPartition(0); + OutStream os = tFile.getOutStream(sWriteType); + os.write(buf.array()); + os.close(); } - sTachyonClient = TachyonFS.get(args[0]); - sTablePath = args[1]; - sWriteType = WriteType.getOpType(args[2]); - createRawTable(); - writeParition(); - readPartition(); - System.exit(0); } } \ No newline at end of file diff --git a/src/main/java/tachyon/examples/Performance.java b/src/main/java/tachyon/examples/Performance.java index 4a7216249a72..7113b90544e2 100644 --- a/src/main/java/tachyon/examples/Performance.java +++ b/src/main/java/tachyon/examples/Performance.java @@ -17,26 +17,28 @@ package tachyon.examples; import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.io.RandomAccessFile; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; import java.nio.channels.FileChannel.MapMode; +import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.fs.FileSystem; +import org.apache.hadoop.fs.Path; import org.apache.log4j.Logger; -import org.apache.thrift.TException; import tachyon.Constants; import tachyon.Version; import tachyon.client.OutStream; +import tachyon.client.ReadType; import tachyon.client.TachyonByteBuffer; import tachyon.client.TachyonFS; import tachyon.client.TachyonFile; import tachyon.client.WriteType; import tachyon.conf.UserConf; -import tachyon.thrift.FileAlreadyExistException; -import tachyon.thrift.InvalidPathException; -import tachyon.thrift.SuspectedFileSizeException; import tachyon.util.CommonUtils; public class Performance { @@ -49,16 +51,18 @@ public class Performance { private static String MASTER_ADDRESS = null; private static String FILE_NAME = null; private static int BLOCK_SIZE_BYTES = -1; - private static int BLOCKS_PER_FILE = -1; + private static long BLOCKS_PER_FILE = -1; private static int THREADS = -1; private static int FILES = -1; private static boolean DEBUG_MODE = false; - private static int FILE_BYTES = -1; + private static long FILE_BYTES = -1; private static long FILES_BYTES = -1; private static String RESULT_PREFIX = null; private static long[] Results = new long[RESULT_ARRAY_SIZE]; private static int BASE_FILE_NUMBER = 0; + private static boolean TACHYON_STREAMING_READ = false; + public static void createFiles() throws IOException { long startTimeMs = CommonUtils.getCurrentMs(); for (int k = 0; k < THREADS; k ++) { @@ -70,8 +74,7 @@ public static void createFiles() throws IOException { public static void logPerIteration(long startTimeMs, int times, String msg, int workerId) { long takenTimeMs = System.currentTimeMillis() - startTimeMs; double result = 1000L * FILE_BYTES / takenTimeMs / 1024 / 1024; - LOG.info(times + msg + workerId + " : " + result + " Mb/sec. Took " + - takenTimeMs + " ms. "); + LOG.info(times + msg + workerId + " : " + result + " Mb/sec. Took " + takenTimeMs + " ms. "); } public static abstract class Worker extends Thread { @@ -114,7 +117,7 @@ public void memoryCopyParition() throws IOException { ByteBuffer dst = null; RandomAccessFile file = null; if (mMemoryOnly) { - dst = ByteBuffer.allocateDirect(FILE_BYTES); + dst = ByteBuffer.allocateDirect((int) FILE_BYTES); } for (int times = mLeft; times < mRight; times ++) { long startTimeMs = System.currentTimeMillis(); @@ -139,7 +142,7 @@ public void memoryCopyParition() throws IOException { ByteBuffer dst = null; RandomAccessFile file = null; if (mMemoryOnly) { - dst = ByteBuffer.allocateDirect(FILE_BYTES); + dst = ByteBuffer.allocateDirect((int) FILE_BYTES); } for (int times = mLeft; times < mRight; times ++) { long startTimeMs = System.currentTimeMillis(); @@ -176,13 +179,12 @@ public void run() { public static class TachyonWriterWorker extends Worker { private TachyonFS mTC; - public TachyonWriterWorker(int id, int left, int right, ByteBuffer buf) { + public TachyonWriterWorker(int id, int left, int right, ByteBuffer buf) throws IOException { super(id, left, right, buf); mTC = TachyonFS.get(MASTER_ADDRESS); } - public void writeParition() - throws IOException, SuspectedFileSizeException, InvalidPathException, TException { + public void writeParition() throws IOException { if (DEBUG_MODE) { mBuf.flip(); CommonUtils.printByteBuffer(LOG, mBuf); @@ -216,13 +218,12 @@ public void run() { public static class TachyonReadWorker extends Worker { private TachyonFS mTC; - public TachyonReadWorker(int id, int left, int right, ByteBuffer buf) { + public TachyonReadWorker(int id, int left, int right, ByteBuffer buf) throws IOException { super(id, left, right, buf); mTC = TachyonFS.get(MASTER_ADDRESS); } - public void readPartition() - throws IOException, SuspectedFileSizeException, InvalidPathException, TException { + public void readPartition() throws IOException { TachyonByteBuffer buf; if (DEBUG_MODE) { LOG.info("Verifying the reading data..."); @@ -247,22 +248,41 @@ public void readPartition() } long sum = 0; - for (int pId = mLeft; pId < mRight; pId ++) { - long startTimeMs = System.currentTimeMillis(); - TachyonFile file = mTC.getFile(FILE_NAME + (mWorkerId + BASE_FILE_NUMBER)); - buf = file.readByteBuffer(); - for (int i = 0; i < BLOCKS_PER_FILE; i ++) { - buf.DATA.get(mBuf.array()); + if (TACHYON_STREAMING_READ) { + for (int pId = mLeft; pId < mRight; pId ++) { + long startTimeMs = System.currentTimeMillis(); + TachyonFile file = mTC.getFile(FILE_NAME + (mWorkerId + BASE_FILE_NUMBER)); + InputStream is = file.getInStream(ReadType.CACHE); + long len = BLOCKS_PER_FILE * BLOCK_SIZE_BYTES; + + while (len > 0) { + int r = is.read(mBuf.array()); + len -= r; + if (r == -1) { + CommonUtils.runtimeException("R == -1"); + } + } + is.close(); + logPerIteration(startTimeMs, pId, "th ReadTachyonFile @ Worker ", pId); } - sum += mBuf.get(pId % 16); + } else { + for (int pId = mLeft; pId < mRight; pId ++) { + long startTimeMs = System.currentTimeMillis(); + TachyonFile file = mTC.getFile(FILE_NAME + (mWorkerId + BASE_FILE_NUMBER)); + buf = file.readByteBuffer(); + for (int i = 0; i < BLOCKS_PER_FILE; i ++) { + buf.DATA.get(mBuf.array()); + } + sum += mBuf.get(pId % 16); - if (DEBUG_MODE) { - buf.DATA.flip(); - CommonUtils.printByteBuffer(LOG, buf.DATA); + if (DEBUG_MODE) { + buf.DATA.flip(); + CommonUtils.printByteBuffer(LOG, buf.DATA); + } + buf.DATA.clear(); + logPerIteration(startTimeMs, pId, "th ReadTachyonFile @ Worker ", pId); + buf.close(); } - buf.DATA.clear(); - logPerIteration(startTimeMs, pId, "th ReadTachyonFile @ Worker ", pId); - buf.close(); } Results[mWorkerId] = sum; } @@ -278,6 +298,87 @@ public void run() { } } + public static class HdfsWorker extends Worker { + private boolean mWrite; + private String mMsg; + private FileSystem mHdfsFs; + + public HdfsWorker(int id, int left, int right, ByteBuffer buf, boolean write, String msg) + throws IOException { + super(id, left, right, buf); + mWrite = write; + mMsg = msg; + + Configuration tConf = new Configuration(); + tConf.set("fs.default.name", FILE_NAME); + tConf.set("fs.defaultFS", FILE_NAME); + tConf.set("fs.hdfs.impl", "org.apache.hadoop.hdfs.DistributedFileSystem"); + + tConf.set("dfs.client.read.shortcircuit", "true"); + tConf.set("dfs.domain.socket.path", "/var/lib/hadoop-hdfs/dn_socket"); + tConf.set("dfs.client.read.shortcircuit.skip.checksum", "true"); + + // tConf.addResource("/root/hadoop-2.3.0/etc/hadoop/core-site.xml"); + // tConf.addResource("/root/hadoop-2.3.0/etc/hadoop/hdfs-site.xml"); + // System.loadLibrary("hdfs"); + // System.loadLibrary("hadoop"); + + mHdfsFs = FileSystem.get(tConf); + } + + public void io() throws IOException { + if (DEBUG_MODE) { + mBuf.flip(); + CommonUtils.printByteBuffer(LOG, mBuf); + } + mBuf.flip(); + long sum = 0; + String str = "th " + mMsg + " @ Worker "; + + if (mWrite) { + for (int times = mLeft; times < mRight; times ++) { + long startTimeMs = System.currentTimeMillis(); + String filePath = FILE_NAME + (mWorkerId + BASE_FILE_NUMBER); + OutputStream os = mHdfsFs.create(new Path(filePath)); + for (int k = 0; k < BLOCKS_PER_FILE; k ++) { + mBuf.array()[0] = (byte) (k + mWorkerId); + os.write(mBuf.array()); + } + os.close(); + logPerIteration(startTimeMs, times, str, mWorkerId); + } + } else { + for (int times = mLeft; times < mRight; times ++) { + long startTimeMs = System.currentTimeMillis(); + String filePath = FILE_NAME + (mWorkerId + BASE_FILE_NUMBER); + InputStream is = mHdfsFs.open(new Path(filePath)); + long len = BLOCKS_PER_FILE * BLOCK_SIZE_BYTES; + + while (len > 0) { + int r = is.read(mBuf.array()); + len -= r; + if (r == -1) { + CommonUtils.runtimeException("R == -1"); + } + } + is.close(); + logPerIteration(startTimeMs, times, str, mWorkerId); + } + } + Results[mWorkerId] = sum; + } + + @Override + public void run() { + try { + io(); + } catch (IOException e) { + CommonUtils.runtimeException(e); + } + LOG.info(mMsg + mWorkerId + " just finished."); + } + } + private static void memoryCopyTest(boolean write, boolean memoryOnly) { ByteBuffer[] bufs = new ByteBuffer[THREADS]; @@ -295,8 +396,9 @@ private static void memoryCopyTest(boolean write, boolean memoryOnly) { GeneralWorker[] WWs = new GeneralWorker[THREADS]; int t = FILES / THREADS; for (int thread = 0; thread < THREADS; thread ++) { - WWs[thread] = new GeneralWorker( - thread, t * thread, t * (thread + 1), bufs[thread], write, memoryOnly, msg); + WWs[thread] = + new GeneralWorker(thread, t * thread, t * (thread + 1), bufs[thread], write, memoryOnly, + msg); } long startTimeMs = System.currentTimeMillis(); @@ -313,11 +415,11 @@ private static void memoryCopyTest(boolean write, boolean memoryOnly) { long takenTimeMs = System.currentTimeMillis() - startTimeMs; double result = 1000L * FILES_BYTES / takenTimeMs / 1024 / 1024; - LOG.info(result + " Mb/sec. " + RESULT_PREFIX + "Entire " + msg + " Test : " + " Took " + - takenTimeMs + " ms. Current System Time: " + System.currentTimeMillis()); + LOG.info(result + " Mb/sec. " + RESULT_PREFIX + "Entire " + msg + " Test : " + " Took " + + takenTimeMs + " ms. Current System Time: " + System.currentTimeMillis()); } - private static void TachyonTest(boolean write) { + private static void TachyonTest(boolean write) throws IOException { ByteBuffer[] bufs = new ByteBuffer[THREADS]; for (int thread = 0; thread < THREADS; thread ++) { @@ -352,30 +454,62 @@ private static void TachyonTest(boolean write) { } long takenTimeMs = System.currentTimeMillis() - startTimeMs; double result = FILES_BYTES * 1000L / takenTimeMs / 1024 / 1024; - LOG.info(result + " Mb/sec. " + RESULT_PREFIX + "Entire " + (write ? "Write ": "Read ") + - " Took " + takenTimeMs + " ms. Current System Time: " + System.currentTimeMillis()); + LOG.info(result + " Mb/sec. " + RESULT_PREFIX + "Entire " + (write ? "Write " : "Read ") + + " Took " + takenTimeMs + " ms. Current System Time: " + System.currentTimeMillis()); + } + + private static void HdfsTest(boolean write) throws IOException { + ByteBuffer[] bufs = new ByteBuffer[THREADS]; + + for (int thread = 0; thread < THREADS; thread ++) { + ByteBuffer sRawData = ByteBuffer.allocate(BLOCK_SIZE_BYTES); + sRawData.order(ByteOrder.nativeOrder()); + for (int k = 0; k < BLOCK_SIZE_BYTES / 4; k ++) { + sRawData.putInt(k); + } + bufs[thread] = sRawData; + } + + Worker[] WWs = new Worker[THREADS]; + int t = FILES / THREADS; + String msg = (write ? "Write " : "Read "); + for (int thread = 0; thread < THREADS; thread ++) { + WWs[thread] = new HdfsWorker(thread, t * thread, t * (thread + 1), bufs[thread], write, msg); + } + + long startTimeMs = System.currentTimeMillis(); + for (int thread = 0; thread < THREADS; thread ++) { + WWs[thread].start(); + } + for (int thread = 0; thread < THREADS; thread ++) { + try { + WWs[thread].join(); + } catch (InterruptedException e) { + CommonUtils.runtimeException(e); + } + } + long takenTimeMs = System.currentTimeMillis() - startTimeMs; + double result = FILES_BYTES * 1000L / takenTimeMs / 1024 / 1024; + LOG.info(result + " Mb/sec. " + RESULT_PREFIX + "Entire " + (write ? "Write " : "Read ") + + " Took " + takenTimeMs + " ms. Current System Time: " + System.currentTimeMillis()); } - public static void main(String[] args) - throws IOException, InvalidPathException, FileAlreadyExistException { + public static void main(String[] args) throws IOException { if (args.length != 9) { - System.out.println("java -cp target/tachyon-" + Version.VERSION + - "-jar-with-dependencies.jar tachyon.examples.Performance " + - " " + - " \n" + - "1: Files Write Test\n" + - "2: Files Read Test\n" + - "3: RamFile Write Test \n" + - "4: RamFile Read Test \n" + - "5: ByteBuffer Write Test \n" + - "6: ByteBuffer Read Test \n"); + System.out.println("java -cp target/tachyon-" + Version.VERSION + + "-jar-with-dependencies.jar tachyon.examples.Performance " + + " " + + " " + + "\n" + "1: Files Write Test\n" + "2: Files Read Test\n" + + "3: RamFile Write Test \n" + "4: RamFile Read Test \n" + "5: ByteBuffer Write Test \n" + + "6: ByteBuffer Read Test \n"); System.exit(-1); } MASTER_ADDRESS = args[0]; FILE_NAME = args[1]; BLOCK_SIZE_BYTES = Integer.parseInt(args[2]); - BLOCKS_PER_FILE = Integer.parseInt(args[3]); + BLOCKS_PER_FILE = Long.parseLong(args[3]); DEBUG_MODE = ("true".equals(args[4])); THREADS = Integer.parseInt(args[5]); FILES = Integer.parseInt(args[6]) * THREADS; @@ -385,12 +519,16 @@ public static void main(String[] args) FILE_BYTES = BLOCKS_PER_FILE * BLOCK_SIZE_BYTES; FILES_BYTES = 1L * FILE_BYTES * FILES; - RESULT_PREFIX = String.format("Threads %d FilesPerThread %d TotalFiles %d " + - "BLOCK_SIZE_KB %d BLOCKS_PER_FILE %d FILE_SIZE_MB %d " + - "Tachyon_WRITE_BUFFER_SIZE_KB %d BaseFileNumber %d : ", - THREADS, FILES / THREADS, FILES, BLOCK_SIZE_BYTES / 1024, - BLOCKS_PER_FILE, CommonUtils.getMB(FILE_BYTES), - UserConf.get().FILE_BUFFER_BYTES / 1024, BASE_FILE_NUMBER); + RESULT_PREFIX = + String.format("Threads %d FilesPerThread %d TotalFiles %d " + + "BLOCK_SIZE_KB %d BLOCKS_PER_FILE %d FILE_SIZE_MB %d " + + "Tachyon_WRITE_BUFFER_SIZE_KB %d BaseFileNumber %d : ", THREADS, FILES / THREADS, + FILES, BLOCK_SIZE_BYTES / 1024, BLOCKS_PER_FILE, CommonUtils.getMB(FILE_BYTES), + UserConf.get().FILE_BUFFER_BYTES / 1024, BASE_FILE_NUMBER); + + for (int k = 0; k < 10000000; k ++) { + // Warmup + } if (testCase == 1) { RESULT_PREFIX = "TachyonFilesWriteTest " + RESULT_PREFIX; @@ -398,10 +536,11 @@ public static void main(String[] args) MTC = TachyonFS.get(MASTER_ADDRESS); createFiles(); TachyonTest(true); - } else if (testCase == 2) { + } else if (testCase == 2 || testCase == 9) { RESULT_PREFIX = "TachyonFilesReadTest " + RESULT_PREFIX; LOG.info(RESULT_PREFIX); MTC = TachyonFS.get(MASTER_ADDRESS); + TACHYON_STREAMING_READ = (9 == testCase); TachyonTest(false); } else if (testCase == 3) { RESULT_PREFIX = "RamFile Write " + RESULT_PREFIX; @@ -419,6 +558,14 @@ public static void main(String[] args) RESULT_PREFIX = "ByteBuffer Read Test " + RESULT_PREFIX; LOG.info(RESULT_PREFIX); memoryCopyTest(false, true); + } else if (testCase == 7) { + RESULT_PREFIX = "HdfsFilesWriteTest " + RESULT_PREFIX; + LOG.info(RESULT_PREFIX); + HdfsTest(true); + } else if (testCase == 8) { + RESULT_PREFIX = "HdfsFilesReadTest " + RESULT_PREFIX; + LOG.info(RESULT_PREFIX); + HdfsTest(false); } else { CommonUtils.runtimeException("No Test Case " + testCase); } diff --git a/src/main/java/tachyon/examples/Utils.java b/src/main/java/tachyon/examples/Utils.java new file mode 100644 index 000000000000..5e4aa08b91fa --- /dev/null +++ b/src/main/java/tachyon/examples/Utils.java @@ -0,0 +1,29 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package tachyon.examples; + +import tachyon.Constants; + +public class Utils { + public static void printPassInfo(boolean pass) { + if (pass) { + System.out.println(Constants.ANSI_GREEN + "Passed the test!" + Constants.ANSI_RESET); + } else { + System.out.println(Constants.ANSI_RED + "Failed the test!" + Constants.ANSI_RESET); + } + } +} diff --git a/src/main/java/tachyon/hadoop/HdfsFileInputStream.java b/src/main/java/tachyon/hadoop/HdfsFileInputStream.java index 752fba9a9f32..ba069f3bee0a 100644 --- a/src/main/java/tachyon/hadoop/HdfsFileInputStream.java +++ b/src/main/java/tachyon/hadoop/HdfsFileInputStream.java @@ -16,6 +16,7 @@ */ package tachyon.hadoop; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStream; @@ -53,9 +54,9 @@ public class HdfsFileInputStream extends InputStream implements Seekable, Positi private byte mBuffer[] = new byte[UserConf.get().FILE_BUFFER_BYTES * 4]; public HdfsFileInputStream(TachyonFS tfs, int fileId, Path hdfsPath, Configuration conf, - int bufferSize) { - LOG.debug("PartitionInputStreamHdfs(" + tfs + ", " + fileId + ", " + hdfsPath + ", " + - conf + ", " + bufferSize + ")"); + int bufferSize) throws IOException { + LOG.debug("PartitionInputStreamHdfs(" + tfs + ", " + fileId + ", " + hdfsPath + ", " + conf + + ", " + bufferSize + ")"); mCurrentPosition = 0; mTFS = tfs; mFileId = fileId; @@ -64,44 +65,25 @@ public HdfsFileInputStream(TachyonFS tfs, int fileId, Path hdfsPath, Configurati mHadoopBufferSize = bufferSize; TachyonFile tachyonFile = mTFS.getFile(mFileId); + if (tachyonFile == null) { + throw new FileNotFoundException("File " + hdfsPath + " with FID " + fileId + + " is not found."); + } try { mTachyonFileInputStream = tachyonFile.getInStream(ReadType.CACHE); } catch (IOException e) { LOG.error(e.getMessage()); - return; } } - /** - * Read upto the specified number of bytes, from a given position within a file, and return the - * number of bytes read. This does not change the current offset of a file, and is thread-safe. - */ - @Override - public int read(long position, byte[] buffer, int offset, int length) throws IOException { - throw new IOException("Not supported"); - // TODO Auto-generated method stub - // return 0; - } - - /** - * Read number of bytes equalt to the length of the buffer, from a given position within a file. - * This does not change the current offset of a file, and is thread-safe. - */ - @Override - public void readFully(long position, byte[] buffer) throws IOException { - // TODO Auto-generated method stub - throw new IOException("Not supported"); - } - - /** - * Read the specified number of bytes, from a given position within a file. This does not - * change the current offset of a file, and is thread-safe. - */ @Override - public void readFully(long position, byte[] buffer, int offset, int length) - throws IOException { - // TODO Auto-generated method stub - throw new IOException("Not supported"); + public void close() throws IOException { + if (mTachyonFileInputStream != null) { + mTachyonFileInputStream.close(); + } + if (mHdfsInputStream != null) { + mHdfsInputStream.close(); + } } /** @@ -112,38 +94,6 @@ public long getPos() throws IOException { return mCurrentPosition; } - /** - * Seek to the given offset from the start of the file. - * The next read() will be from that location. Can't seek past the end of the file. - */ - @Override - public void seek(long pos) throws IOException { - if (pos == mCurrentPosition) { - return; - } - if (mTachyonFileInputStream != null) { - mTachyonFileInputStream.seek(pos); - } else if (mHdfsInputStream != null) { - mHdfsInputStream.seek(pos); - } else { - FileSystem fs = mHdfsPath.getFileSystem(mHadoopConf); - mHdfsInputStream = fs.open(mHdfsPath, mHadoopBufferSize); - mHdfsInputStream.seek(pos); - } - - mCurrentPosition = pos; - } - - /** - * Seeks a different copy of the data. Returns true if found a new source, false otherwise. - */ - @Override - public boolean seekToNewSource(long targetPos) throws IOException { - throw new IOException("Not supported"); - // TODO Auto-generated method stub - // return false; - } - @Override public int read() throws IOException { if (mTachyonFileInputStream != null) { @@ -207,13 +157,25 @@ public int read(byte b[], int off, int len) throws IOException { return 1; } + /** + * Read upto the specified number of bytes, from a given position within a + * file, and return the number of bytes read. This does not change the current + * offset of a file, and is thread-safe. + */ + @Override + public int read(long position, byte[] buffer, int offset, int length) throws IOException { + throw new IOException("Not supported"); + // TODO Auto-generated method stub + // return 0; + } + private int readFromHdfsBuffer() throws IOException { if (mBufferPosition < mBufferLimit) { return mBuffer[mBufferPosition ++]; } LOG.error("Reading from HDFS directly"); while ((mBufferLimit = mHdfsInputStream.read(mBuffer)) == 0) { - LOG.error("Read 0 bytes in readFromHdfsBuffer for " + mHdfsPath); + LOG.error("Read 0 bytes in readFromHdfsBuffer for " + mHdfsPath); } if (mBufferLimit == -1) { return -1; @@ -222,13 +184,57 @@ private int readFromHdfsBuffer() throws IOException { return mBuffer[mBufferPosition ++]; } + /** + * Read number of bytes equalt to the length of the buffer, from a given + * position within a file. This does not change the current offset of a file, + * and is thread-safe. + */ @Override - public void close() throws IOException { - if (mTachyonFileInputStream != null) { - mTachyonFileInputStream.close(); + public void readFully(long position, byte[] buffer) throws IOException { + // TODO Auto-generated method stub + throw new IOException("Not supported"); + } + + /** + * Read the specified number of bytes, from a given position within a file. + * This does not change the current offset of a file, and is thread-safe. + */ + @Override + public void readFully(long position, byte[] buffer, int offset, int length) throws IOException { + // TODO Auto-generated method stub + throw new IOException("Not supported"); + } + + /** + * Seek to the given offset from the start of the file. The next read() will + * be from that location. Can't seek past the end of the file. + */ + @Override + public void seek(long pos) throws IOException { + if (pos == mCurrentPosition) { + return; } - if (mHdfsInputStream != null) { - mHdfsInputStream.close(); + if (mTachyonFileInputStream != null) { + mTachyonFileInputStream.seek(pos); + } else if (mHdfsInputStream != null) { + mHdfsInputStream.seek(pos); + } else { + FileSystem fs = mHdfsPath.getFileSystem(mHadoopConf); + mHdfsInputStream = fs.open(mHdfsPath, mHadoopBufferSize); + mHdfsInputStream.seek(pos); } + + mCurrentPosition = pos; + } + + /** + * Seeks a different copy of the data. Returns true if found a new source, + * false otherwise. + */ + @Override + public boolean seekToNewSource(long targetPos) throws IOException { + throw new IOException("Not supported"); + // TODO Auto-generated method stub + // return false; } } \ No newline at end of file diff --git a/src/main/java/tachyon/hadoop/HdfsFileOutputStream.java b/src/main/java/tachyon/hadoop/HdfsFileOutputStream.java index b01aa63cc377..ed9306e76193 100644 --- a/src/main/java/tachyon/hadoop/HdfsFileOutputStream.java +++ b/src/main/java/tachyon/hadoop/HdfsFileOutputStream.java @@ -24,45 +24,45 @@ import tachyon.client.TachyonFile; import tachyon.client.WriteType; -public class HdfsFileOutputStream extends OutputStream { // implements Syncable { +public class HdfsFileOutputStream extends OutputStream { // implements Syncable HdfsFileOutputStream(TachyonFile file, WriteType writeType) { // TODO Auto-generated constructor stub } -// @Override -// public void sync() throws IOException { -// // TODO Auto-generated method stub -// -// } + // @Override + // public void sync() throws IOException { + // // TODO Auto-generated method stub + // + // } @Override - public void write(int b) throws IOException { + public void close() throws IOException { // TODO Auto-generated method stub - + } @Override - public void write(byte[] b) throws IOException { + public void flush() throws IOException { // TODO Auto-generated method stub - + } @Override - public void write(byte[] b, int off, int len) throws IOException { + public void write(byte[] b) throws IOException { // TODO Auto-generated method stub - + } @Override - public void flush() throws IOException { + public void write(byte[] b, int off, int len) throws IOException { // TODO Auto-generated method stub - + } @Override - public void close() throws IOException { + public void write(int b) throws IOException { // TODO Auto-generated method stub - + } } diff --git a/src/main/java/tachyon/hadoop/TFS.java b/src/main/java/tachyon/hadoop/TFS.java index e92d8d58d8cb..1d88ea45805a 100644 --- a/src/main/java/tachyon/hadoop/TFS.java +++ b/src/main/java/tachyon/hadoop/TFS.java @@ -18,7 +18,6 @@ import java.io.FileNotFoundException; import java.io.IOException; -import java.net.InetSocketAddress; import java.net.URI; import java.util.ArrayList; import java.util.List; @@ -39,18 +38,23 @@ import tachyon.client.TachyonFS; import tachyon.client.TachyonFile; import tachyon.client.WriteType; +import tachyon.conf.CommonConf; import tachyon.thrift.ClientBlockInfo; +import tachyon.thrift.ClientDependencyInfo; import tachyon.thrift.ClientFileInfo; import tachyon.thrift.NetAddress; import tachyon.util.CommonUtils; import tachyon.util.UnderfsUtil; /** - * An Hadoop FileSystem interface implementation. Any program working with Hadoop HDFS can work - * with Tachyon transparently by using this class. However, it is not as efficient as using - * the Tachyon API in tachyon.client package. + * An Hadoop FileSystem interface implementation. Any program working with Hadoop HDFS can work with + * Tachyon transparently by using this class. However, it is not as efficient as using the Tachyon + * API in tachyon.client package. */ public class TFS extends FileSystem { + public static final String FIRST_COM_PATH = "tachyon_dep/"; + public static final String RECOMPUTE_PATH = "tachyon_recompute/"; + public static String UNDERFS_ADDRESS; private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); @@ -60,16 +64,6 @@ public class TFS extends FileSystem { private TachyonFS mTFS = null; private String mTachyonHeader = null; - private void fromHdfsToTachyon(String path) throws IOException { - if (!mTFS.exist(path)) { - Path hdfsPath = Utils.getHDFSPath(path); - FileSystem fs = hdfsPath.getFileSystem(getConf()); - if (fs.exists(hdfsPath)) { - UnderfsUtil.getInfo(mTFS, UNDERFS_ADDRESS, path, new PrefixList(null)); - } - } - } - @Override public FSDataOutputStream append(Path cPath, int bufferSize, Progressable progress) throws IOException { @@ -89,15 +83,81 @@ public FSDataOutputStream append(Path cPath, int bufferSize, Progressable progre @Override public FSDataOutputStream create(Path cPath, FsPermission permission, boolean overwrite, - int bufferSize, short replication, long blockSize, Progressable progress) - throws IOException { - LOG.info("create(" + cPath + ", " + permission + ", " + overwrite + - ", " + bufferSize + ", " + replication + ", " + blockSize + ", " + progress + ")"); + int bufferSize, short replication, long blockSize, Progressable progress) throws IOException { + LOG.info("create(" + cPath + ", " + permission + ", " + overwrite + ", " + bufferSize + ", " + + replication + ", " + blockSize + ", " + progress + ")"); + + if (!CommonConf.get().ASYNC_ENABLED) { + String path = Utils.getPathWithoutScheme(cPath); + if (mTFS.exist(path)) { + if (!mTFS.delete(path, false)) { + throw new IOException("Failed to delete existing data " + cPath); + } + } + int fileId = mTFS.createFile(path, blockSize); + TachyonFile file = mTFS.getFile(fileId); + return new FSDataOutputStream(file.getOutStream(WriteType.CACHE_THROUGH), null); + } - String path = Utils.getPathWithoutScheme(cPath); - int fileId = mTFS.createFile(path, blockSize); - TachyonFile file = mTFS.getFile(fileId); - return new FSDataOutputStream(file.getOutStream(WriteType.CACHE_THROUGH), null); + if (cPath.toString().contains(FIRST_COM_PATH) && !cPath.toString().contains("SUCCESS")) { + String path = Utils.getPathWithoutScheme(cPath); + mTFS.createFile(path, blockSize); + path = path.substring(path.indexOf(FIRST_COM_PATH) + FIRST_COM_PATH.length()); + path = path.substring(0, path.indexOf("/")); + int depId = Integer.parseInt(path); + LOG.info("create(" + cPath + ") : " + path + " " + depId); + path = Utils.getPathWithoutScheme(cPath); + path = path.substring(path.indexOf("part-") + 5); + int index = Integer.parseInt(path); + ClientDependencyInfo info = mTFS.getClientDependencyInfo(depId); + int fileId = info.getChildren().get(index); + LOG.info("create(" + cPath + ") : " + path + " " + index + " " + info + " " + fileId); + + TachyonFile file = mTFS.getFile(fileId); + // if (file.getBlockSizeByte() != blockSize) { + // throw new IOException("File already exist with a different blocksize " + // file.getBlockSizeByte() + " != " + blockSize); + // } + return new FSDataOutputStream(file.getOutStream(WriteType.ASYNC_THROUGH), null); + } + if (cPath.toString().contains(RECOMPUTE_PATH) && !cPath.toString().contains("SUCCESS")) { + String path = Utils.getPathWithoutScheme(cPath); + mTFS.createFile(path, blockSize); + path = path.substring(path.indexOf(RECOMPUTE_PATH) + RECOMPUTE_PATH.length()); + path = path.substring(0, path.indexOf("/")); + int depId = Integer.parseInt(path); + LOG.info("create(" + cPath + ") : " + path + " " + depId); + path = Utils.getPathWithoutScheme(cPath); + path = path.substring(path.indexOf("part-") + 5); + int index = Integer.parseInt(path); + ClientDependencyInfo info = mTFS.getClientDependencyInfo(depId); + int fileId = info.getChildren().get(index); + LOG.info("create(" + cPath + ") : " + path + " " + index + " " + info + " " + fileId); + + TachyonFile file = mTFS.getFile(fileId); + // if (file.getBlockSizeByte() != blockSize) { + // throw new IOException("File already exist with a different blocksize " + // file.getBlockSizeByte() + " != " + blockSize); + // } + return new FSDataOutputStream(file.getOutStream(WriteType.ASYNC_THROUGH), null); + } else { + String path = Utils.getPathWithoutScheme(cPath); + int fileId; + WriteType type = WriteType.CACHE_THROUGH; + if (mTFS.exist(path)) { + fileId = mTFS.getFileId(path); + type = WriteType.MUST_CACHE; + } else { + fileId = mTFS.createFile(path, blockSize); + } + + TachyonFile file = mTFS.getFile(fileId); + // if (file.getBlockSizeByte() != blockSize) { + // throw new IOException("File already exist with a different blocksize " + // file.getBlockSizeByte() + " != " + blockSize); + // } + return new FSDataOutputStream(file.getOutStream(type), null); + } } @Override @@ -114,41 +174,14 @@ public boolean delete(Path path, boolean recursive) throws IOException { return mTFS.delete(tPath, recursive); } - @Override - /** - * Return the status of a single file. - * - * If the file does not exist in Tachyon, query it from HDFS. - */ - public FileStatus getFileStatus(Path path) throws IOException { - String tPath = Utils.getPathWithoutScheme(path); - Path hdfsPath = Utils.getHDFSPath(tPath); - - LOG.info("getFileStatus(" + path + "): HDFS Path: " + hdfsPath + " TPath: " + - mTachyonHeader + tPath); - - fromHdfsToTachyon(tPath); - TachyonFile file = mTFS.getFile(tPath); - if (file == null) { - LOG.info("File does not exist: " + path); - throw new FileNotFoundException("File does not exist: " + path); + private void fromHdfsToTachyon(String path) throws IOException { + if (!mTFS.exist(path)) { + Path hdfsPath = Utils.getHDFSPath(path); + FileSystem fs = hdfsPath.getFileSystem(getConf()); + if (fs.exists(hdfsPath)) { + UnderfsUtil.getInfo(mTFS, UNDERFS_ADDRESS, path, new PrefixList(null)); + } } - - FileStatus ret = new FileStatus(file.length(), file.isDirectory(), file.getDiskReplication(), - file.getBlockSizeByte(), file.getCreationTimeMs(), file.getCreationTimeMs(), - null, null, null, new Path(mTachyonHeader + tPath)); - return ret; - } - - @Override - public URI getUri() { - return mUri; - } - - @Override - public Path getWorkingDirectory() { - LOG.info("getWorkingDirectory: " + mWorkingDir); - return mWorkingDir; } @Override @@ -172,16 +205,15 @@ public BlockLocation[] getFileBlockLocations(FileStatus file, long start, long l ClientBlockInfo info = blocks.get(k); long offset = info.getOffset(); long end = offset + info.getLength(); - if ((offset >= start && offset <= start + len) || - (end >= start && end <= start + len)) { + if ((offset >= start && offset <= start + len) || (end >= start && end <= start + len)) { ArrayList names = new ArrayList(); ArrayList hosts = new ArrayList(); for (NetAddress addr : info.getLocations()) { names.add(addr.mHost); hosts.add(addr.mHost); } - blockLocations.add(new BlockLocation(CommonUtils.toStringArray(names), - CommonUtils.toStringArray(hosts), offset, info.getLength())); + blockLocations.add(new BlockLocation(CommonUtils.toStringArray(names), CommonUtils + .toStringArray(hosts), offset, info.getLength())); } } @@ -192,14 +224,60 @@ public BlockLocation[] getFileBlockLocations(FileStatus file, long start, long l return ret; } + @Override + /** + * Return the status of a single file. If the file does not exist in Tachyon, query it from HDFS. + */ + public FileStatus getFileStatus(Path path) throws IOException { + String tPath = Utils.getPathWithoutScheme(path); + Path hdfsPath = Utils.getHDFSPath(tPath); + + LOG.info("getFileStatus(" + path + "): HDFS Path: " + hdfsPath + " TPath: " + mTachyonHeader + + tPath); + + fromHdfsToTachyon(tPath); + TachyonFile file = mTFS.getFile(tPath); + if (file == null) { + LOG.info("File does not exist: " + path); + throw new FileNotFoundException("File does not exist: " + path); + } + + FileStatus ret = + new FileStatus(file.length(), file.isDirectory(), file.getDiskReplication(), + file.getBlockSizeByte(), file.getCreationTimeMs(), file.getCreationTimeMs(), null, + null, null, new Path(mTachyonHeader + tPath)); + return ret; + } + + /** + * Returns an object implementing the Tachyon-specific client API. + * + * @return null if initialize() hasn't been called. + */ + public TachyonFS getTachyonFS() { + return mTFS; + } + + @Override + public URI getUri() { + return mUri; + } + + @Override + public Path getWorkingDirectory() { + LOG.info("getWorkingDirectory: " + mWorkingDir); + return mWorkingDir; + } + /** * Initialize the class, have a lazy connection with Tachyon through mTFS. */ @Override public void initialize(URI uri, Configuration conf) throws IOException { + super.initialize(uri, conf); LOG.info("initialize(" + uri + ", " + conf + "). Connecting to Tachyon: " + uri.toString()); - mTFS = TachyonFS.get(new InetSocketAddress(uri.getHost(), uri.getPort())); - mTachyonHeader = "tachyon://" + uri.getHost() + ":" + uri.getPort(); + mTachyonHeader = uri.getScheme() + "://" + uri.getHost() + ":" + uri.getPort(); + mTFS = TachyonFS.get(mTachyonHeader); mUri = URI.create(mTachyonHeader); UNDERFS_ADDRESS = mTFS.getUnderfsAddress(); LOG.info(mTachyonHeader + " " + mUri + " " + UNDERFS_ADDRESS); @@ -224,15 +302,16 @@ public FileStatus[] listStatus(Path path) throws IOException { for (int k = 0; k < files.size(); k ++) { ClientFileInfo info = files.get(k); // TODO replicate 3 with the number of disk replications. - ret[k] = new FileStatus(info.getLength(), info.isFolder(), 3, info.getBlockSizeByte(), - info.getCreationTimeMs(), info.getCreationTimeMs(), - null, null, null, new Path(mTachyonHeader + info.getPath())); + ret[k] = + new FileStatus(info.getLength(), info.isFolder(), 3, info.getBlockSizeByte(), + info.getCreationTimeMs(), info.getCreationTimeMs(), null, null, null, new Path( + mTachyonHeader + info.getPath())); } return ret; } @Override - public boolean mkdirs(Path cPath, FsPermission permission) throws IOException { + public boolean mkdirs(Path cPath, FsPermission permission) throws IOException { LOG.info("mkdirs(" + cPath + ", " + permission + ")"); return mTFS.mkdir(Utils.getPathWithoutScheme(cPath)); } @@ -248,8 +327,8 @@ public FSDataInputStream open(Path cPath, int bufferSize) throws IOException { fromHdfsToTachyon(path); int fileId = mTFS.getFileId(path); - return new FSDataInputStream(new HdfsFileInputStream(mTFS, fileId, - Utils.getHDFSPath(path), getConf(), bufferSize)); + return new FSDataInputStream(new HdfsFileInputStream(mTFS, fileId, Utils.getHDFSPath(path), + getConf(), bufferSize)); } @Override diff --git a/src/main/java/tachyon/hadoop/Utils.java b/src/main/java/tachyon/hadoop/Utils.java index 9b26b941f8f0..c20df2361ad2 100644 --- a/src/main/java/tachyon/hadoop/Utils.java +++ b/src/main/java/tachyon/hadoop/Utils.java @@ -30,23 +30,6 @@ public final class Utils { private static final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); private static final boolean DEBUG = Constants.DEBUG; - public static String getTachyonFileName(String path) { - if (path.isEmpty()) { - return "/"; - } - - while (path.contains(":")) { - int index = path.indexOf(":"); - path = path.substring(index + 1); - } - - while (!path.startsWith("/")) { - path = path.substring(1); - } - - return path; - } - public static Path getHDFSPath(String path) { path = getTachyonFileName(path); @@ -78,19 +61,21 @@ public static String getPathWithoutScheme(Path path) { return ret; } - public static String toStringHadoopFileStatus(FileStatus fs) { - StringBuilder sb = new StringBuilder(); - sb.append("HadoopFileStatus: Path: ").append(fs.getPath()); - sb.append(" , Length: ").append(fs.getLen()); - sb.append(" , IsDir: ").append(fs.isDir()); - sb.append(" , BlockReplication: ").append(fs.getReplication()); - sb.append(" , BlockSize: ").append(fs.getBlockSize()); - sb.append(" , ModificationTime: ").append(fs.getModificationTime()); - sb.append(" , AccessTime: ").append(fs.getAccessTime()); - sb.append(" , Permission: ").append(fs.getPermission()); - sb.append(" , Owner: ").append(fs.getOwner()); - sb.append(" , Group: ").append(fs.getGroup()); - return sb.toString(); + public static String getTachyonFileName(String path) { + if (path.isEmpty()) { + return "/"; + } + + while (path.contains(":")) { + int index = path.indexOf(":"); + path = path.substring(index + 1); + } + + while (!path.startsWith("/")) { + path = path.substring(1); + } + + return path; } public static String toStringHadoopFileSplit(FileSplit fs) { @@ -104,21 +89,36 @@ public static String toStringHadoopFileSplit(FileSplit fs) { locs = fs.getLocations(); } catch (IOException e) { LOG.error(e.getMessage()); - locs = new String[]{}; + locs = new String[] {}; } - for (String loc: locs) { + for (String loc : locs) { sb.append(loc).append("; "); } return sb.toString(); } + public static String toStringHadoopFileStatus(FileStatus fs) { + StringBuilder sb = new StringBuilder(); + sb.append("HadoopFileStatus: Path: ").append(fs.getPath()); + sb.append(" , Length: ").append(fs.getLen()); + sb.append(" , IsDir: ").append(fs.isDir()); + sb.append(" , BlockReplication: ").append(fs.getReplication()); + sb.append(" , BlockSize: ").append(fs.getBlockSize()); + sb.append(" , ModificationTime: ").append(fs.getModificationTime()); + sb.append(" , AccessTime: ").append(fs.getAccessTime()); + sb.append(" , Permission: ").append(fs.getPermission()); + sb.append(" , Owner: ").append(fs.getOwner()); + sb.append(" , Group: ").append(fs.getGroup()); + return sb.toString(); + } + public static String toStringHadoopInputSplit(InputSplit is) { StringBuilder sb = new StringBuilder("HadoopInputSplit: "); try { sb.append(" Length: ").append(is.getLength()); sb.append(" , Locations: "); - for (String loc: is.getLocations()) { + for (String loc : is.getLocations()) { sb.append(loc).append(" ; "); } } catch (IOException e) { diff --git a/src/main/java/tachyon/io/ByteBufferReader.java b/src/main/java/tachyon/io/ByteBufferReader.java index 7bbce2579227..7dd8bcd8b408 100644 --- a/src/main/java/tachyon/io/ByteBufferReader.java +++ b/src/main/java/tachyon/io/ByteBufferReader.java @@ -24,25 +24,27 @@ * Reader for bytebuffer. */ public abstract class ByteBufferReader { - protected ByteBuffer mBuf; - /** * Get most efficient ByteBufferReader for the ByteBuffer. - * @param buf the ByteBuffer to read. + * + * @param buf + * the ByteBuffer to read. * @return The most efficient ByteBufferReader for buf. - * @throws IOException + * @throws IOException */ public static ByteBufferReader getByteBufferReader(ByteBuffer buf) throws IOException { - if (buf.order() == ByteOrder.nativeOrder()) { - if (buf.isDirect()) { - return new UnsafeDirectByteBufferReader(buf); - } else { - return new UnsafeHeapByteBufferReader(buf); - } - } + // if (buf.order() == ByteOrder.nativeOrder()) { + // if (buf.isDirect()) { + // return new UnsafeDirectByteBufferReader(buf); + // } else { + // return new UnsafeHeapByteBufferReader(buf); + // } + // } return new JavaByteBufferReader(buf); } + protected ByteBuffer mBuf; + ByteBufferReader(ByteBuffer buf) throws IOException { if (buf == null) { throw new IOException("ByteBuffer is null"); @@ -69,10 +71,6 @@ public static ByteBufferReader getByteBufferReader(ByteBuffer buf) throws IOExce public abstract short getShort(); - public abstract int position(); - - public abstract void position(int newPosition); - public ByteOrder order() { return mBuf.order(); } @@ -80,4 +78,8 @@ public ByteOrder order() { public void order(ByteOrder bo) { mBuf.order(bo); } + + public abstract int position(); + + public abstract void position(int newPosition); } diff --git a/src/main/java/tachyon/io/ByteBufferWriter.java b/src/main/java/tachyon/io/ByteBufferWriter.java index e5c9be46f409..49724234634d 100644 --- a/src/main/java/tachyon/io/ByteBufferWriter.java +++ b/src/main/java/tachyon/io/ByteBufferWriter.java @@ -24,25 +24,27 @@ * Writer for bytebuffer. */ public abstract class ByteBufferWriter { - protected ByteBuffer mBuf; - /** * Get most efficient ByteBufferWriter for the ByteBuffer. - * @param buf the ByteBuffer to write. + * + * @param buf + * the ByteBuffer to write. * @return The most efficient ByteBufferWriter for buf. - * @throws IOException + * @throws IOException */ public static ByteBufferWriter getByteBufferWriter(ByteBuffer buf) throws IOException { - if (buf.order() == ByteOrder.nativeOrder()) { - if (buf.isDirect()) { - return new UnsafeDirectByteBufferWriter(buf); - } else { - return new UnsafeHeapByteBufferWriter(buf); - } - } + // if (buf.order() == ByteOrder.nativeOrder()) { + // if (buf.isDirect()) { + // return new UnsafeDirectByteBufferWriter(buf); + // } else { + // return new UnsafeHeapByteBufferWriter(buf); + // } + // } return new JavaByteBufferWriter(buf); } + protected ByteBuffer mBuf; + ByteBufferWriter(ByteBuffer buf) throws IOException { if (buf == null) { throw new IOException("ByteBuffer is null"); @@ -51,10 +53,18 @@ public static ByteBufferWriter getByteBufferWriter(ByteBuffer buf) throws IOExce mBuf = buf; } + public abstract ByteBuffer getByteBuffer(); + + public ByteOrder order() { + return mBuf.order(); + } + /** * Writes the given byte into this buffer at the current position, and then increments the * position. - * @param b The byte to be written + * + * @param b + * The byte to be written */ public abstract void put(Byte b); @@ -62,8 +72,11 @@ public static ByteBufferWriter getByteBufferWriter(ByteBuffer buf) throws IOExce * This method transfers the entire content of the given source byte array into this buffer. An * invocation of this method of the form dst.put(a) behaves in exactly the same way as * the invocation - *
     
    -   * dst.put(a, 0, a.length) 
    + * + *
    +   * dst.put(a, 0, a.length)
    +   * 
    + * * @param src */ public final void put(byte[] src) { @@ -83,10 +96,4 @@ public final void put(byte[] src) { public abstract void putLong(long value); public abstract void putShort(short value); - - public ByteOrder order() { - return mBuf.order(); - } - - public abstract ByteBuffer getByteBuffer(); } diff --git a/src/main/java/tachyon/io/JavaByteBufferWriter.java b/src/main/java/tachyon/io/JavaByteBufferWriter.java index ca463194e1b1..0a65744e9e3a 100644 --- a/src/main/java/tachyon/io/JavaByteBufferWriter.java +++ b/src/main/java/tachyon/io/JavaByteBufferWriter.java @@ -28,6 +28,15 @@ public JavaByteBufferWriter(ByteBuffer buf) throws IOException { super(buf); } + @Override + public ByteBuffer getByteBuffer() { + ByteBuffer buf = mBuf.duplicate(); + buf.position(0); + buf.limit(mBuf.position()); + buf.order(mBuf.order()); + return buf; + } + @Override public void put(Byte b) { mBuf.put(b); @@ -67,13 +76,4 @@ public void putLong(long value) { public void putShort(short value) { mBuf.putShort(value); } - - @Override - public ByteBuffer getByteBuffer() { - ByteBuffer buf = mBuf.duplicate(); - buf.position(0); - buf.limit(mBuf.position()); - buf.order(mBuf.order()); - return buf; - } } diff --git a/src/main/java/tachyon/io/UnsafeDirectByteBufferReader.java b/src/main/java/tachyon/io/UnsafeDirectByteBufferReader.java deleted file mode 100644 index 5168b5fbcdb6..000000000000 --- a/src/main/java/tachyon/io/UnsafeDirectByteBufferReader.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package tachyon.io; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.nio.Buffer; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import sun.misc.Unsafe; - -/** - * Unsafe reader for direct bytebuffer. - */ -public class UnsafeDirectByteBufferReader extends ByteBufferReader { - private Unsafe mUnsafe; - private long mBaseOffset; - private long mOffset; - - public UnsafeDirectByteBufferReader(ByteBuffer buf) throws IOException { - super(buf); - - if (!buf.isDirect()) { - throw new IOException("ByteBuffer " + buf + " is not Direct ByteBuffer"); - } - if (buf.order() != ByteOrder.nativeOrder()) { - throw new IOException("ByteBuffer " + buf + " has non-native ByteOrder"); - } - - try { - mUnsafe = UnsafeUtils.getUnsafe(); - - Field addressField = Buffer.class.getDeclaredField("address"); - addressField.setAccessible(true); - mBaseOffset = (long) addressField.get(buf); - mOffset = mBaseOffset; - } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | - IllegalAccessException e) { - throw new IOException(e); - } - } - - @Override - public byte get() { - return mUnsafe.getByte(mOffset ++); - } - - @Override - public void get(byte[] dst) { - mUnsafe.copyMemory(null, mOffset, dst, UnsafeUtils.sByteArrayBaseOffset, dst.length); - mOffset += dst.length; - } - - @Override - public void get(byte[] dst, int offset, int length) { - mUnsafe.copyMemory(null, mOffset, dst, UnsafeUtils.sByteArrayBaseOffset + offset, length); - mOffset += length; - } - - @Override - public char getChar() { - mOffset += 2; - return mUnsafe.getChar(mOffset - 2); - } - - @Override - public double getDouble() { - mOffset += 8; - return mUnsafe.getDouble(mOffset - 8); - } - - @Override - public float getFloat() { - mOffset += 4; - return mUnsafe.getFloat(mOffset - 4); - } - - @Override - public int getInt() { - mOffset += 4; - return mUnsafe.getInt(mOffset - 4); - } - - @Override - public long getLong() { - mOffset += 8; - return mUnsafe.getLong(mOffset - 8); - } - - @Override - public short getShort() { - mOffset += 2; - return mUnsafe.getShort(mOffset - 2); - } - - @Override - public int position() { - return (int) (mOffset - mBaseOffset); - } - - @Override - public void position(int newPosition) { - mOffset = mBaseOffset + newPosition; - } -} diff --git a/src/main/java/tachyon/io/UnsafeDirectByteBufferWriter.java b/src/main/java/tachyon/io/UnsafeDirectByteBufferWriter.java deleted file mode 100644 index 442887306de3..000000000000 --- a/src/main/java/tachyon/io/UnsafeDirectByteBufferWriter.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package tachyon.io; - -import java.io.IOException; -import java.lang.reflect.Field; -import java.nio.Buffer; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import sun.misc.Unsafe; - -/** - * Unsafe writer for direct bytebuffer. - */ -public class UnsafeDirectByteBufferWriter extends ByteBufferWriter { - private Unsafe mUnsafe; - private long mBaseOffset; - private long mOffset; - - public UnsafeDirectByteBufferWriter(ByteBuffer buf) throws IOException { - super(buf); - - if (!buf.isDirect()) { - throw new IOException("ByteBuffer " + buf + " is not Direct ByteBuffer"); - } - if (buf.order() != ByteOrder.nativeOrder()) { - throw new IOException("ByteBuffer " + buf + " has non-native ByteOrder"); - } - - try { - mUnsafe = UnsafeUtils.getUnsafe(); - - Field addressField = Buffer.class.getDeclaredField("address"); - addressField.setAccessible(true); - mBaseOffset = (long) addressField.get(buf); - mOffset = mBaseOffset; - } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | - IllegalAccessException e) { - throw new IOException(e); - } - } - - @Override - public void put(Byte b) { - mUnsafe.putByte(mOffset ++, b); - } - - @Override - public void put(byte[] src, int offset, int length) { - mUnsafe.copyMemory(src, UnsafeUtils.sByteArrayBaseOffset + offset, null, mOffset, length); - mOffset += length; - } - - @Override - public void putChar(char value) { - mUnsafe.putChar(mOffset, value); - mOffset += 2; - } - - @Override - public void putDouble(double value) { - mUnsafe.putDouble(mOffset, value); - mOffset += 8; - } - - @Override - public void putFloat(float value) { - mUnsafe.putFloat(mOffset, value); - mOffset += 4; - } - - @Override - public void putInt(int value) { - mUnsafe.putInt(mOffset, value); - mOffset += 4; - } - - @Override - public void putLong(long value) { - mUnsafe.putLong(mOffset, value); - mOffset += 8; - } - - @Override - public void putShort(short value) { - mUnsafe.putShort(mOffset, value); - mOffset += 2; - } - - @Override - public ByteBuffer getByteBuffer() { - ByteBuffer buf = mBuf.duplicate(); - buf.position(0); - buf.limit((int) (mOffset - mBaseOffset)); - buf.order(mBuf.order()); - return buf; - } -} diff --git a/src/main/java/tachyon/io/UnsafeHeapByteBufferReader.java b/src/main/java/tachyon/io/UnsafeHeapByteBufferReader.java deleted file mode 100644 index 5950c9d5bd04..000000000000 --- a/src/main/java/tachyon/io/UnsafeHeapByteBufferReader.java +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package tachyon.io; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import sun.misc.Unsafe; - -/** - * Unsafe reader for bytebuffer with backing array. - */ -public class UnsafeHeapByteBufferReader extends ByteBufferReader { - private Unsafe mUnsafe; - private long mBaseOffset; - private long mOffset; - private byte[] mArr; - - public UnsafeHeapByteBufferReader(ByteBuffer buf) throws IOException { - super(buf); - - if (!buf.hasArray()) { - throw new IOException("ByteBuffer " + buf + " does not have backing array"); - } - if (buf.order() != ByteOrder.nativeOrder()) { - throw new IOException("ByteBuffer " + buf + " has non-native ByteOrder"); - } - - mArr = buf.array(); - - try { - mUnsafe = UnsafeUtils.getUnsafe(); - } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | - IllegalAccessException e) { - throw new IOException(e); - } - - mBaseOffset = mUnsafe.arrayBaseOffset(byte[].class); - mOffset = mBaseOffset; - } - - @Override - public byte get() { - return mUnsafe.getByte(mArr, mOffset ++); - } - - @Override - public void get(byte[] dst) { - mUnsafe.copyMemory(mArr, mOffset, dst, mBaseOffset, dst.length); - mOffset += dst.length; - } - - @Override - public void get(byte[] dst, int offset, int length) { - mUnsafe.copyMemory(mArr, mOffset, dst, mBaseOffset + offset, length); - mOffset += length; - } - - @Override - public char getChar() { - mOffset += 2; - return mUnsafe.getChar(mArr, mOffset - 2); - } - - @Override - public double getDouble() { - mOffset += 8; - return mUnsafe.getDouble(mArr, mOffset - 8); - } - - @Override - public float getFloat() { - mOffset += 4; - return mUnsafe.getFloat(mArr, mOffset - 4); - } - - @Override - public int getInt() { - mOffset += 4; - return mUnsafe.getInt(mArr, mOffset - 4); - } - - @Override - public long getLong() { - mOffset += 8; - return mUnsafe.getLong(mArr, mOffset - 8); - } - - @Override - public short getShort() { - mOffset += 2; - return mUnsafe.getShort(mArr, mOffset - 2); - } - - @Override - public int position() { - return (int) (mOffset - mBaseOffset); - } - - @Override - public void position(int newPosition) { - mOffset = mBaseOffset + newPosition; - } -} diff --git a/src/main/java/tachyon/io/UnsafeHeapByteBufferWriter.java b/src/main/java/tachyon/io/UnsafeHeapByteBufferWriter.java deleted file mode 100644 index ac958d0fe541..000000000000 --- a/src/main/java/tachyon/io/UnsafeHeapByteBufferWriter.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package tachyon.io; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.ByteOrder; - -import sun.misc.Unsafe; - -/** - * Unsafe writer for bytebuffer with backing array. - */ -public class UnsafeHeapByteBufferWriter extends ByteBufferWriter { - private Unsafe mUnsafe; - private long mBaseOffset; - private long mOffset; - private byte[] mArr; - - UnsafeHeapByteBufferWriter(ByteBuffer buf) throws IOException { - super(buf); - - if (!buf.hasArray()) { - throw new IOException("ByteBuffer " + buf + " does not have backing array"); - } - if (buf.order() != ByteOrder.nativeOrder()) { - throw new IOException("ByteBuffer " + buf + " has non-native ByteOrder"); - } - - mArr = buf.array(); - - try { - mUnsafe = UnsafeUtils.getUnsafe(); - } catch (NoSuchFieldException | SecurityException | IllegalArgumentException | - IllegalAccessException e) { - throw new IOException(e); - } - - mBaseOffset = mUnsafe.arrayBaseOffset(byte[].class); - mOffset = mBaseOffset; - } - - @Override - public void put(Byte b) { - mUnsafe.putByte(mArr, mOffset ++, b); - } - - @Override - public void put(byte[] src, int offset, int length) { - mUnsafe.copyMemory(src, mBaseOffset + offset, mArr, mOffset, length); - mOffset += length; - } - - @Override - public void putChar(char value) { - mUnsafe.putChar(mArr, mOffset, value); - mOffset += 2; - } - - @Override - public void putDouble(double value) { - mUnsafe.putDouble(mArr, mOffset, value); - mOffset += 8; - } - - @Override - public void putFloat(float value) { - mUnsafe.putFloat(mArr, mOffset, value); - mOffset += 4; - } - - @Override - public void putInt(int value) { - mUnsafe.putInt(mArr, mOffset, value); - mOffset += 4; - } - - @Override - public void putLong(long value) { - mUnsafe.putLong(mArr, mOffset, value); - mOffset += 8; - } - - @Override - public void putShort(short value) { - mUnsafe.putShort(mArr, mOffset, value); - mOffset += 2; - } - - @Override - public ByteBuffer getByteBuffer() { - ByteBuffer buf = mBuf.duplicate(); - buf.position(0); - buf.limit((int) (mOffset - mBaseOffset)); - buf.order(mBuf.order()); - return buf; - } -} diff --git a/src/main/java/tachyon/io/Utils.java b/src/main/java/tachyon/io/Utils.java index 61341ed843e1..0888aa331f93 100644 --- a/src/main/java/tachyon/io/Utils.java +++ b/src/main/java/tachyon/io/Utils.java @@ -20,18 +20,50 @@ import java.io.DataOutputStream; import java.io.IOException; import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.List; /** * Utilities to do ser/de String, and ByteBuffer */ public class Utils { - public static void writeString(String str, DataOutputStream os) throws IOException { - if (str == null) { - os.writeInt(-1); - } else { - os.writeInt(str.length()); - os.writeChars(str); + public static ByteBuffer readByteBuffer(DataInputStream is) throws IOException { + int len = is.readInt(); + if (len == -1) { + return null; + } + + byte[] arr = new byte[len]; + for (int k = 0; k < len; k ++) { + arr[k] = is.readByte(); + } + + return ByteBuffer.wrap(arr); + } + + public static List readByteBufferList(DataInputStream is) throws IOException { + int size = is.readInt(); + if (size == -1) { + return null; + } + + List ret = new ArrayList(size); + for (int k = 0; k < size; k ++) { + ret.add(readByteBuffer(is)); + } + return ret; + } + + public static List readIntegerList(DataInputStream is) throws IOException { + int size = is.readInt(); + if (size == -1) { + return null; + } + List ret = new ArrayList(size); + for (int k = 0; k < size; k ++) { + ret.add(is.readInt()); } + return ret; } public static String readString(DataInputStream is) throws IOException { @@ -51,6 +83,20 @@ public static String readString(DataInputStream is) throws IOException { } + public static List readStringList(DataInputStream is) throws IOException { + int size = is.readInt(); + + if (size == -1) { + return null; + } + + List ret = new ArrayList(size); + for (int k = 0; k < size; k ++) { + ret.add(readString(is)); + } + return ret; + } + public static void writeByteBuffer(ByteBuffer buf, DataOutputStream os) throws IOException { if (buf == null) { os.writeInt(-1); @@ -61,17 +107,47 @@ public static void writeByteBuffer(ByteBuffer buf, DataOutputStream os) throws I os.write(buf.array(), buf.position(), len); } - public static ByteBuffer readByteBuffer(DataInputStream is) throws IOException { - int len = is.readInt(); - if (len == -1) { - return null; + public static void writeByteBufferList(List list, DataOutputStream os) + throws IOException { + if (list == null) { + os.writeInt(-1); + return; + } + os.writeInt(list.size()); + for (int k = 0; k < list.size(); k ++) { + writeByteBuffer(list.get(k), os); } + } - byte[] arr = new byte[len]; - for (int k = 0; k < len ; k ++) { - arr[k] = is.readByte(); + public static void writeIntegerList(List list, DataOutputStream os) throws IOException { + if (list == null) { + os.writeInt(-1); + return; } - return ByteBuffer.wrap(arr); + os.writeInt(list.size()); + for (int k = 0; k < list.size(); k ++) { + os.writeInt(list.get(k)); + } + } + + public static void writeString(String str, DataOutputStream os) throws IOException { + if (str == null) { + os.writeInt(-1); + } else { + os.writeInt(str.length()); + os.writeChars(str); + } + } + + public static void writeStringList(List list, DataOutputStream os) throws IOException { + if (list == null) { + os.writeInt(-1); + return; + } + os.writeInt(list.size()); + for (int k = 0; k < list.size(); k ++) { + writeString(list.get(k), os); + } } } diff --git a/src/main/java/tachyon/BlockInfo.java b/src/main/java/tachyon/master/BlockInfo.java similarity index 92% rename from src/main/java/tachyon/BlockInfo.java rename to src/main/java/tachyon/master/BlockInfo.java index f0f72eb347d6..10d1e37d6285 100644 --- a/src/main/java/tachyon/BlockInfo.java +++ b/src/main/java/tachyon/master/BlockInfo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import java.io.IOException; import java.util.ArrayList; @@ -22,6 +22,8 @@ import java.util.List; import java.util.Map; +import tachyon.Pair; +import tachyon.UnderFileSystem; import tachyon.thrift.ClientBlockInfo; import tachyon.thrift.NetAddress; @@ -29,11 +31,26 @@ * Block info on the master side. */ public class BlockInfo { + public static long computeBlockId(int inodeId, int blockIndex) { + return ((long) inodeId << 30) + blockIndex; + } + + public static int computeBlockIndex(long blockId) { + return (int) (blockId & 0x3fffffff); + } + + public static int computeInodeId(long blockId) { + return (int) (blockId >> 30); + } + private final InodeFile INODE_FILE; public final int BLOCK_INDEX; + public final long BLOCK_ID; + public final long OFFSET; + public final long LENGTH; private Map mLocations = new HashMap(5); @@ -41,13 +58,14 @@ public class BlockInfo { /** * @param inodeFile * @param blockIndex - * @param length Can not be no bigger than 2^31 - 1 + * @param length + * Can not be no bigger than 2^31 - 1 */ BlockInfo(InodeFile inodeFile, int blockIndex, long length) { INODE_FILE = inodeFile; BLOCK_INDEX = blockIndex; BLOCK_ID = computeBlockId(INODE_FILE.getId(), BLOCK_INDEX); - OFFSET = (long) inodeFile.getBlockSizeByte() * blockIndex; + OFFSET = inodeFile.getBlockSizeByte() * blockIndex; LENGTH = length; } @@ -55,6 +73,25 @@ public synchronized void addLocation(long workerId, NetAddress workerAddress) { mLocations.put(workerId, workerAddress); } + public synchronized ClientBlockInfo generateClientBlockInfo() { + ClientBlockInfo ret = new ClientBlockInfo(); + + ret.blockId = BLOCK_ID; + ret.offset = OFFSET; + ret.length = LENGTH; + ret.locations = getLocations(); + + return ret; + } + + public synchronized List> getBlockIdWorkerIdPairs() { + List> ret = new ArrayList>(mLocations.size()); + for (long workerId : mLocations.keySet()) { + ret.add(new Pair(BLOCK_ID, workerId)); + } + return ret; + } + public synchronized InodeFile getInodeFile() { return INODE_FILE; } @@ -71,7 +108,7 @@ public synchronized List getLocations() { return ret; } if (locs != null) { - for (String loc: locs) { + for (String loc : locs) { ret.add(new NetAddress(loc, -1)); } } @@ -79,25 +116,6 @@ public synchronized List getLocations() { return ret; } - public synchronized ClientBlockInfo generateClientBlockInfo() { - ClientBlockInfo ret = new ClientBlockInfo(); - - ret.blockId = BLOCK_ID; - ret.offset = OFFSET; - ret.length = LENGTH; - ret.locations = getLocations(); - - return ret; - } - - public synchronized List> getBlockIdWorkerIdPairs() { - List> ret = new ArrayList>(mLocations.size()); - for (long workerId: mLocations.keySet()) { - ret.add(new Pair(BLOCK_ID, workerId)); - } - return ret; - } - public synchronized boolean isInMemory() { return mLocations.size() > 0; } @@ -106,6 +124,7 @@ public synchronized void removeLocation(long workerId) { mLocations.remove(workerId); } + @Override public synchronized String toString() { StringBuilder sb = new StringBuilder("BlockInfo(BLOCK_INDEX: "); sb.append(BLOCK_INDEX); @@ -115,16 +134,4 @@ public synchronized String toString() { sb.append(", mLocations: ").append(mLocations).append(")"); return sb.toString(); } - - public static long computeBlockId(int inodeId, int blockIndex) { - return ((long) inodeId << 30) + blockIndex; - } - - public static int computeBlockIndex(long blockId) { - return (int) (blockId & 0x3fffffff); - } - - public static int computeInodeId(long blockId) { - return (int) (blockId >> 30); - } } diff --git a/src/main/java/tachyon/CheckpointInfo.java b/src/main/java/tachyon/master/CheckpointInfo.java similarity index 74% rename from src/main/java/tachyon/CheckpointInfo.java rename to src/main/java/tachyon/master/CheckpointInfo.java index 4772a588b292..b9a199f3c1aa 100644 --- a/src/main/java/tachyon/CheckpointInfo.java +++ b/src/main/java/tachyon/master/CheckpointInfo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import java.io.Serializable; @@ -26,26 +26,12 @@ public class CheckpointInfo implements Serializable, Comparable private int mInodeCounter; private long mEditTransactionId; + private int mDependencyCounter; - public CheckpointInfo(int inodeCounter, long editTransactionId) { + public CheckpointInfo(int inodeCounter, long editTransactionId, int dependencyCounter) { mInodeCounter = inodeCounter; mEditTransactionId = editTransactionId; - } - - public synchronized void updateInodeCounter(int inodeCounter) { - mInodeCounter = Math.max(mInodeCounter, inodeCounter); - } - - public synchronized void updateEditTransactionCounter(long id) { - mEditTransactionId = Math.max(mEditTransactionId, id); - } - - public synchronized int getInodeCounter() { - return mInodeCounter; - } - - public synchronized long getEditTransactionCounter() { - return mEditTransactionId; + mDependencyCounter = dependencyCounter; } @Override @@ -53,10 +39,13 @@ public synchronized int compareTo(CheckpointInfo o) { if (mInodeCounter != o.mInodeCounter) { return mInodeCounter - o.mInodeCounter; } - if (mEditTransactionId == o.mEditTransactionId) { + if (mEditTransactionId != o.mEditTransactionId) { + return mEditTransactionId > o.mEditTransactionId ? 1 : -1; + } + if (mDependencyCounter == o.mDependencyCounter) { return 0; } - return mEditTransactionId > o.mEditTransactionId ? 1 : -1; + return mDependencyCounter > o.mDependencyCounter ? 1 : -1; } @Override @@ -64,11 +53,35 @@ public synchronized boolean equals(Object o) { if (!(o instanceof CheckpointInfo)) { return false; } - return compareTo((CheckpointInfo)o) == 0; + return compareTo((CheckpointInfo) o) == 0; + } + + public synchronized int getDependencyCounter() { + return mDependencyCounter; + } + + public synchronized long getEditTransactionCounter() { + return mEditTransactionId; + } + + public synchronized int getInodeCounter() { + return mInodeCounter; } @Override public synchronized int hashCode() { - return (int) (mInodeCounter + mEditTransactionId); + return (int) (mInodeCounter + mEditTransactionId + mDependencyCounter); + } + + public synchronized void updateDependencyCounter(int dependencyCounter) { + mDependencyCounter = Math.max(mDependencyCounter, dependencyCounter); + } + + public synchronized void updateEditTransactionCounter(long id) { + mEditTransactionId = Math.max(mEditTransactionId, id); + } + + public synchronized void updateInodeCounter(int inodeCounter) { + mInodeCounter = Math.max(mInodeCounter, inodeCounter); } } \ No newline at end of file diff --git a/src/main/java/tachyon/master/Dependency.java b/src/main/java/tachyon/master/Dependency.java new file mode 100644 index 000000000000..f57f61d60036 --- /dev/null +++ b/src/main/java/tachyon/master/Dependency.java @@ -0,0 +1,169 @@ +package tachyon.master; + +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.apache.log4j.Logger; + +import tachyon.Constants; +import tachyon.thrift.ClientDependencyInfo; +import tachyon.util.CommonUtils; + +public class Dependency { + private static final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); + + public final int ID; + public final long CREATION_TIME_MS; + + public final List PARENT_FILES; + public final List CHILDREN_FILES; + private final Set UNCHECKPOINTED_CHILDREN_FILES; + public final String COMMAND_PREFIX; + public final List DATA; + + public final String COMMENT; + public final String FRAMEWORK; + public final String FRAMEWORK_VERSION; + + public final DependencyType TYPE; + + public final List PARENT_DEPENDENCIES; + private List mChildrenDependencies; + private Set mLostFileIds; + + public Dependency(int id, List parents, List children, String commandPrefix, + List data, String comment, String framework, String frameworkVersion, + DependencyType type, Collection parentDependencies, long creationTimeMs) { + ID = id; + CREATION_TIME_MS = creationTimeMs; + + PARENT_FILES = new ArrayList(parents.size()); + PARENT_FILES.addAll(parents); + CHILDREN_FILES = new ArrayList(children.size()); + CHILDREN_FILES.addAll(children); + UNCHECKPOINTED_CHILDREN_FILES = new HashSet(); + UNCHECKPOINTED_CHILDREN_FILES.addAll(CHILDREN_FILES); + COMMAND_PREFIX = commandPrefix; + DATA = CommonUtils.cloneByteBufferList(data); + + COMMENT = comment; + FRAMEWORK = framework; + FRAMEWORK_VERSION = frameworkVersion; + + TYPE = type; + + PARENT_DEPENDENCIES = new ArrayList(parentDependencies.size()); + PARENT_DEPENDENCIES.addAll(parentDependencies); + mChildrenDependencies = new ArrayList(0); + mLostFileIds = new HashSet(0); + } + + public synchronized void addChildrenDependency(int childDependencyId) { + for (int dependencyId : mChildrenDependencies) { + if (dependencyId == childDependencyId) { + return; + } + } + mChildrenDependencies.add(childDependencyId); + } + + public synchronized void addLostFile(int fileId) { + mLostFileIds.add(fileId); + } + + public synchronized void childCheckpointed(int childFileId) { + UNCHECKPOINTED_CHILDREN_FILES.remove(childFileId); + LOG.debug("Child got checkpointed " + childFileId + " : " + toString()); + } + + public ClientDependencyInfo generateClientDependencyInfo() { + ClientDependencyInfo ret = new ClientDependencyInfo(); + ret.id = ID; + ret.parents = new ArrayList(PARENT_FILES.size()); + ret.parents.addAll(PARENT_FILES); + ret.children = new ArrayList(CHILDREN_FILES.size()); + ret.children.addAll(CHILDREN_FILES); + ret.data = CommonUtils.cloneByteBufferList(DATA); + return ret; + } + + public synchronized List getChildrenDependency() { + List ret = new ArrayList(mChildrenDependencies.size()); + ret.addAll(mChildrenDependencies); + return ret; + } + + public synchronized String getCommand() { + // TODO We should support different types of command in the future. + // For now, assume there is only one command model. + StringBuilder sb = new StringBuilder(parseCommandPrefix()); + sb.append(" ").append(ID); + for (int k = 0; k < CHILDREN_FILES.size(); k ++) { + int id = CHILDREN_FILES.get(k); + if (mLostFileIds.contains(id)) { + sb.append(" ").append(k); + } + } + mLostFileIds.clear(); + return sb.toString(); + } + + public synchronized List getLostFiles() { + List ret = new ArrayList(); + ret.addAll(mLostFileIds); + return ret; + } + + synchronized List getUncheckpointedChildrenFiles() { + List ret = new ArrayList(UNCHECKPOINTED_CHILDREN_FILES.size()); + ret.addAll(UNCHECKPOINTED_CHILDREN_FILES); + return ret; + } + + public synchronized boolean hasCheckpointed() { + return UNCHECKPOINTED_CHILDREN_FILES.size() == 0; + } + + public synchronized boolean hasChildrenDependency() { + return !mChildrenDependencies.isEmpty(); + } + + public synchronized boolean hasLostFile() { + return !mLostFileIds.isEmpty(); + } + + String parseCommandPrefix() { + String rtn = COMMAND_PREFIX; + for (String s : DependencyVariables.sVariables.keySet()) { + rtn = rtn.replace("$" + s, DependencyVariables.sVariables.get(s)); + } + return rtn; + } + + synchronized void resetUncheckpointedChildrenFiles( + Collection uncheckpointedChildrenFiles) { + UNCHECKPOINTED_CHILDREN_FILES.clear(); + UNCHECKPOINTED_CHILDREN_FILES.addAll(uncheckpointedChildrenFiles); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("Dependency["); + sb.append("ID:").append(ID).append(", CREATION_TIME_MS:").append(CREATION_TIME_MS); + sb.append(", Parents:").append(PARENT_FILES).append(", Children:").append(CHILDREN_FILES); + sb.append(", COMMAND_PREFIX:").append(COMMAND_PREFIX); + sb.append(", PARSED_COMMAND_PREFIX:").append(parseCommandPrefix()); + sb.append(", COMMENT:").append(COMMENT); + sb.append(", FRAMEWORK:").append(FRAMEWORK); + sb.append(", FRAMEWORK_VERSION:").append(FRAMEWORK_VERSION); + sb.append(", PARENT_DEPENDENCIES:").append(PARENT_DEPENDENCIES); + sb.append(", ChildrenDependencies:").append(mChildrenDependencies); + sb.append(", UncheckpointedChildrenFiles:").append(UNCHECKPOINTED_CHILDREN_FILES); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/src/main/java/tachyon/master/DependencyType.java b/src/main/java/tachyon/master/DependencyType.java new file mode 100644 index 000000000000..c13956b0b3b5 --- /dev/null +++ b/src/main/java/tachyon/master/DependencyType.java @@ -0,0 +1,31 @@ +package tachyon.master; + +import java.io.IOException; + +public enum DependencyType { + Wide(1), + Narrow(2); + + public static DependencyType getDependencyType(int value) throws IOException { + if (value == 1) { + return Wide; + } else if (value == 2) { + return Narrow; + } + + throw new IOException("Unknown DependencyType value " + value); + } + + private final int mValue; + + private DependencyType(int value) { + mValue = value; + } + + /** + * Get the integer value of this enum value. + */ + public int getValue() { + return mValue; + } +} \ No newline at end of file diff --git a/src/main/java/tachyon/master/DependencyVariables.java b/src/main/java/tachyon/master/DependencyVariables.java new file mode 100644 index 000000000000..e7b1bd96ec8e --- /dev/null +++ b/src/main/java/tachyon/master/DependencyVariables.java @@ -0,0 +1,12 @@ +package tachyon.master; + +import java.util.Hashtable; + +import tachyon.conf.MasterConf; + +public class DependencyVariables { + public static final String MASTER_HOSTNAME = MasterConf.get().HOSTNAME; + public static final int MASTER_PORT = MasterConf.get().PORT; + + public static Hashtable sVariables = new Hashtable(); +} diff --git a/src/main/java/tachyon/EditLog.java b/src/main/java/tachyon/master/EditLog.java similarity index 76% rename from src/main/java/tachyon/EditLog.java rename to src/main/java/tachyon/master/EditLog.java index 4d08feb43596..445a1bd51b71 100644 --- a/src/main/java/tachyon/EditLog.java +++ b/src/main/java/tachyon/master/EditLog.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import java.io.DataInputStream; import java.io.DataOutputStream; @@ -22,10 +22,14 @@ import java.io.IOException; import java.io.OutputStream; import java.nio.ByteBuffer; +import java.util.List; import org.apache.log4j.Logger; import org.apache.hadoop.fs.FSDataOutputStream; +import tachyon.Constants; +import tachyon.Pair; +import tachyon.UnderFileSystem; import tachyon.io.Utils; import tachyon.thrift.BlockInfoException; import tachyon.thrift.FileAlreadyExistException; @@ -49,36 +53,45 @@ public class EditLog { static final byte OP_UNPIN_FILE = 5; static final byte OP_UPDATE_RAW_TABLE_METADATA = 6; static final byte OP_COMPLETE_FILE = 7; + static final byte OP_CREATE_DEPENDENCY = 8; private final static Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); + public static void deleteCompletedLogs(String path, int upTo) { + UnderFileSystem ufs = UnderFileSystem.get(path); + String folder = path.substring(0, path.lastIndexOf("/")) + "/completed"; + try { + for (int i = 0; i < upTo; i ++) { + String toDelete = folder + "/" + i + ".editLog"; + LOG.info("Deleting editlog " + toDelete); + ufs.delete(toDelete, true); + } + } catch (IOException e) { + CommonUtils.runtimeException(e); + } + } + // When a master is replaying an edit log, make the current edit log as an INACTIVE one. private final boolean INACTIVE; - private final String PATH; + private final String PATH; private static int mBackUpLogStartNum = -1; - private static long mCurrentTId = 0; - - private UnderFileSystem UFS; - private DataOutputStream DOS; - private OutputStream OS; - // Starting from 1. - private long mFlushedTransactionId = 0; - private long mTransactionId = 0; - private int mCurrentLogFileNum = 0; - private int mMaxLogSize = Constants.MB; + private static long mCurrentTId = 0; /** * Load edit log. - * @param info The Master Info. - * @param path The path of the edit logs. - * @param currentLogFileNum The smallest completed log number that this master has not loaded + * + * @param info + * The Master Info. + * @param path + * The path of the edit logs. + * @param currentLogFileNum + * The smallest completed log number that this master has not loaded * @return The last transaction id. * @throws IOException */ - public static long load(MasterInfo info, String path, int currentLogFileNum) - throws IOException { + public static long load(MasterInfo info, String path, int currentLogFileNum) throws IOException { UnderFileSystem ufs = UnderFileSystem.get(path); if (!ufs.exists(path)) { LOG.info("Edit Log " + path + " does not exist."); @@ -163,12 +176,29 @@ public static void loadSingleLog(MasterInfo info, String path) throws IOExceptio info.completeFile(is.readInt()); break; } + case OP_CREATE_DEPENDENCY: { + info._createDependency(Utils.readIntegerList(is), Utils.readIntegerList(is), + Utils.readString(is), Utils.readByteBufferList(is), Utils.readString(is), + Utils.readString(is), Utils.readString(is), + DependencyType.getDependencyType(is.readInt()), is.readInt(), is.readLong()); + break; + } default: throw new IOException("Invalid op type " + op); } - } catch (SuspectedFileSizeException | BlockInfoException | FileDoesNotExistException | - FileAlreadyExistException | InvalidPathException | TachyonException | - TableDoesNotExistException e) { + } catch (SuspectedFileSizeException e) { + throw new IOException(e); + } catch (BlockInfoException e) { + throw new IOException(e); + } catch (FileDoesNotExistException e) { + throw new IOException(e); + } catch (FileAlreadyExistException e) { + throw new IOException(e); + } catch (InvalidPathException e) { + throw new IOException(e); + } catch (TachyonException e) { + throw new IOException(e); + } catch (TableDoesNotExistException e) { throw new IOException(e); } } @@ -177,6 +207,37 @@ public static void loadSingleLog(MasterInfo info, String path) throws IOExceptio ufs.close(); } + public static void markUpToDate(String path) { + UnderFileSystem ufs = UnderFileSystem.get(path); + String folder = path.substring(0, path.lastIndexOf("/")) + "/completed"; + try { + // delete all loaded editlogs since mBackupLogStartNum. + String toDelete = folder + "/" + mBackUpLogStartNum + ".editLog"; + while (ufs.exists(toDelete)) { + LOG.info("Deleting editlog " + toDelete); + ufs.delete(toDelete, true); + mBackUpLogStartNum ++; + toDelete = folder + "/" + mBackUpLogStartNum + ".editLog"; + } + } catch (IOException e) { + CommonUtils.runtimeException(e); + } + mBackUpLogStartNum = -1; + } + + private UnderFileSystem UFS; + private DataOutputStream DOS; + private OutputStream OS; + + // Starting from 1. + private long mFlushedTransactionId = 0; + + private long mTransactionId = 0; + + private int mCurrentLogFileNum = 0; + + private int mMaxLogSize = Constants.MB; + public EditLog(String path, boolean inactive, long transactionId) throws IOException { INACTIVE = inactive; @@ -205,6 +266,12 @@ public EditLog(String path, boolean inactive, long transactionId) throws IOExcep } mBackUpLogStartNum = -1; } + + // In case this file is created by different dfs-clients, which has been + // fixed in HDFS-3755 since 3.0.0, 2.0.2-alpha + if (UFS.exists(path)) { + UFS.delete(path, true); + } OS = UFS.create(path); DOS = new DataOutputStream(OS); LOG.info("Created file " + path); @@ -218,41 +285,33 @@ public EditLog(String path, boolean inactive, long transactionId) throws IOExcep } } - public static void deleteCompletedLogs(String path, int upTo) { - UnderFileSystem ufs = UnderFileSystem.get(path); - String folder = path.substring(0, path.lastIndexOf("/")) + "/completed"; + /** + * Only close those outputStreams. + */ + private synchronized void _close() { try { - for (int i = 0; i < upTo; i ++) { - String toDelete = folder + "/" + i + ".editLog"; - LOG.info("Deleting editlog " + toDelete); - ufs.delete(toDelete, true); + if (DOS != null) { + DOS.close(); + } + if (OS != null) { + OS.close(); } } catch (IOException e) { CommonUtils.runtimeException(e); } } - public static void markUpToDate() { - mBackUpLogStartNum = -1; - } - - public void rotateEditLog(String path) { + public synchronized void addBlock(int fileId, int blockIndex, long blockLength) { if (INACTIVE) { return; } - close(); - LOG.info("Edit log max size reached, rotating edit log"); - String pathPrefix = path.substring(0, path.lastIndexOf("/")) + "/completed"; + try { - if (!UFS.exists(pathPrefix)) { - UFS.mkdirs(pathPrefix, true); - } - String newPath = pathPrefix + "/" + (mCurrentLogFileNum ++) + ".editLog"; - UFS.rename(path, newPath); - LOG.info("Renamed " + path + " to " + newPath); - OS = UFS.create(path); - DOS = new DataOutputStream(OS); - LOG.info("Created new log file " + path); + DOS.writeLong( ++mTransactionId); + DOS.writeByte(OP_ADD_BLOCK); + DOS.writeInt(fileId); + DOS.writeInt(blockIndex); + DOS.writeLong(blockLength); } catch (IOException e) { CommonUtils.runtimeException(e); } @@ -264,7 +323,7 @@ public synchronized void addCheckpoint(int fileId, long length, String checkpoin } try { - DOS.writeLong(++ mTransactionId); + DOS.writeLong( ++mTransactionId); DOS.writeByte(OP_ADD_CHECKPOINT); DOS.writeInt(fileId); DOS.writeLong(length); @@ -274,17 +333,55 @@ public synchronized void addCheckpoint(int fileId, long length, String checkpoin } } - public synchronized void addBlock(int fileId, int blockIndex, long blockLength) { + /** + * Close the log. + */ + public synchronized void close() { + if (INACTIVE) { + return; + } + try { + _close(); + UFS.close(); + } catch (IOException e) { + CommonUtils.runtimeException(e); + } + } + + public synchronized void completeFile(int fileId) { if (INACTIVE) { return; } try { - DOS.writeLong(++ mTransactionId); - DOS.writeByte(OP_ADD_BLOCK); + DOS.writeLong( ++mTransactionId); + DOS.writeByte(OP_COMPLETE_FILE); DOS.writeInt(fileId); - DOS.writeInt(blockIndex); - DOS.writeLong(blockLength); + } catch (IOException e) { + CommonUtils.runtimeException(e); + } + } + + public synchronized void createDependency(List parents, List children, + String commandPrefix, List data, String comment, String framework, + String frameworkVersion, DependencyType dependencyType, int depId, long creationTimeMs) { + if (INACTIVE) { + return; + } + + try { + DOS.writeLong( ++mTransactionId); + DOS.writeByte(OP_CREATE_DEPENDENCY); + Utils.writeIntegerList(parents, DOS); + Utils.writeIntegerList(children, DOS); + Utils.writeString(commandPrefix, DOS); + Utils.writeByteBufferList(data, DOS); + Utils.writeString(comment, DOS); + Utils.writeString(framework, DOS); + Utils.writeString(frameworkVersion, DOS); + DOS.writeInt(dependencyType.getValue()); + DOS.writeInt(depId); + DOS.writeLong(creationTimeMs); } catch (IOException e) { CommonUtils.runtimeException(e); } @@ -297,7 +394,7 @@ public synchronized void createFile(boolean recursive, String path, boolean dire } try { - DOS.writeLong(++ mTransactionId); + DOS.writeLong( ++mTransactionId); DOS.writeByte(OP_CREATE_FILE); DOS.writeBoolean(recursive); Utils.writeString(path, DOS); @@ -317,7 +414,7 @@ public synchronized void delete(int fileId, boolean recursive) { } try { - DOS.writeLong(++ mTransactionId); + DOS.writeLong( ++mTransactionId); DOS.writeByte(OP_DELETE); DOS.writeInt(fileId); DOS.writeBoolean(recursive); @@ -326,117 +423,111 @@ public synchronized void delete(int fileId, boolean recursive) { } } - public synchronized void rename(int fileId, String dstPath) { + /** + * Flush the log onto the storage. + */ + public synchronized void flush() { if (INACTIVE) { return; } try { - DOS.writeLong(++ mTransactionId); - DOS.writeByte(OP_RENAME); - DOS.writeInt(fileId); - Utils.writeString(dstPath, DOS); + DOS.flush(); + if (OS instanceof FSDataOutputStream) { + ((FSDataOutputStream) OS).sync(); + } + if (DOS.size() > mMaxLogSize) { + rotateEditLog(PATH); + } } catch (IOException e) { CommonUtils.runtimeException(e); } - } - public synchronized void unpinFile(int fileId) { - if (INACTIVE) { - return; - } + mFlushedTransactionId = mTransactionId; + } - try { - DOS.writeLong(++ mTransactionId); - DOS.writeByte(OP_UNPIN_FILE); - DOS.writeInt(fileId); - } catch (IOException e) { - CommonUtils.runtimeException(e); - } + /** + * Get the current TransactionId and FlushedTransactionId + * + * @return (TransactionId, FlushedTransactionId) + */ + public synchronized Pair getTransactionIds() { + return new Pair(mTransactionId, mFlushedTransactionId); } - public synchronized void updateRawTableMetadata(int tableId, ByteBuffer metadata) { + public synchronized void rename(int fileId, String dstPath) { if (INACTIVE) { return; } try { - DOS.writeLong(++ mTransactionId); - DOS.writeByte(OP_UPDATE_RAW_TABLE_METADATA); - DOS.writeInt(tableId); - Utils.writeByteBuffer(metadata, DOS); + DOS.writeLong( ++mTransactionId); + DOS.writeByte(OP_RENAME); + DOS.writeInt(fileId); + Utils.writeString(dstPath, DOS); } catch (IOException e) { CommonUtils.runtimeException(e); } } - public synchronized void completeFile(int fileId) { + public void rotateEditLog(String path) { if (INACTIVE) { return; } - + _close(); + LOG.info("Edit log max size reached, rotating edit log"); + String pathPrefix = path.substring(0, path.lastIndexOf("/")) + "/completed"; + LOG.info("path: " + path + " prefix: " + pathPrefix); try { - DOS.writeLong(++ mTransactionId); - DOS.writeByte(OP_COMPLETE_FILE); - DOS.writeInt(fileId); + if (!UFS.exists(pathPrefix)) { + UFS.mkdirs(pathPrefix, true); + } + String newPath = pathPrefix + "/" + (mCurrentLogFileNum ++) + ".editLog"; + UFS.rename(path, newPath); + LOG.info("Renamed " + path + " to " + newPath); + OS = UFS.create(path); + DOS = new DataOutputStream(OS); + LOG.info("Created new log file " + path); } catch (IOException e) { CommonUtils.runtimeException(e); } } /** - * Get the current TransactionId and FlushedTransactionId - * - * @return (TransactionId, FlushedTransactionId) + * Changes the max log size for testing purposes. + * + * @param size */ - public synchronized Pair getTransactionIds() { - return new Pair(mTransactionId, mFlushedTransactionId); + public void setMaxLogSize(int size) { + mMaxLogSize = size; } - /** - * Flush the log onto the storage. - */ - public synchronized void flush() { + public synchronized void unpinFile(int fileId) { if (INACTIVE) { return; } try { - DOS.flush(); - if (OS instanceof FSDataOutputStream) { - ((FSDataOutputStream) OS).sync(); - } - if (DOS.size() > mMaxLogSize) { - rotateEditLog(PATH); - } + DOS.writeLong( ++mTransactionId); + DOS.writeByte(OP_UNPIN_FILE); + DOS.writeInt(fileId); } catch (IOException e) { CommonUtils.runtimeException(e); } - - mFlushedTransactionId = mTransactionId; } - /** - * Close the log. - */ - public synchronized void close() { + public synchronized void updateRawTableMetadata(int tableId, ByteBuffer metadata) { if (INACTIVE) { return; } + try { - DOS.close(); - OS.close(); - UFS.close(); + DOS.writeLong( ++mTransactionId); + DOS.writeByte(OP_UPDATE_RAW_TABLE_METADATA); + DOS.writeInt(tableId); + Utils.writeByteBuffer(metadata, DOS); } catch (IOException e) { CommonUtils.runtimeException(e); } } - - /** - * Changes the max log size for testing purposes. - * @param size - */ - public void setMaxLogSize(int size) { - mMaxLogSize = size; - } } diff --git a/src/main/java/tachyon/EditLogProcessor.java b/src/main/java/tachyon/master/EditLogProcessor.java similarity index 89% rename from src/main/java/tachyon/EditLogProcessor.java rename to src/main/java/tachyon/master/EditLogProcessor.java index 31199a4c131d..873286e59d08 100644 --- a/src/main/java/tachyon/EditLogProcessor.java +++ b/src/main/java/tachyon/master/EditLogProcessor.java @@ -1,9 +1,11 @@ -package tachyon; +package tachyon.master; import java.io.IOException; import org.apache.log4j.Logger; +import tachyon.Constants; +import tachyon.UnderFileSystem; import tachyon.util.CommonUtils; /** @@ -38,7 +40,7 @@ public void run() { UnderFileSystem ufs = UnderFileSystem.get(mPath); while (mIsStandby) { try { - synchronized(mJournal) { + synchronized (mJournal) { long lastImageModTime = mJournal.getImageModTime(); if (mLoadedImageModTime != lastImageModTime) { LOG.info("The last loaded image is out of date. Loading updated image."); @@ -60,10 +62,10 @@ public void run() { } LOG.info("Edit log with " + path + " was not found."); if (mLastImageFileNum != mCurrentLogFileNum) { - LOG.info("Last image was updated with log number: " + mLastImageFileNum + - " writing new image up to log number " + mCurrentLogFileNum); - mJournal.createImage(mMasterInfo, mPath + mMasterInfo.getMasterAddress().getHostName() + - mMasterInfo.getMasterAddress().getPort() + "/standby.image"); + LOG.info("Last image was updated with log number: " + mLastImageFileNum + + " writing new image up to log number " + mCurrentLogFileNum); + mJournal.createImage(mMasterInfo, mPath + mMasterInfo.getMasterAddress().getHostName() + + mMasterInfo.getMasterAddress().getPort() + "/standby.image"); LOG.info("Finished creating image"); mLastImageFileNum = mCurrentLogFileNum; } diff --git a/src/main/java/tachyon/Image.java b/src/main/java/tachyon/master/Image.java similarity index 90% rename from src/main/java/tachyon/Image.java rename to src/main/java/tachyon/master/Image.java index ab14eed6087a..3c1a39a1ad9a 100644 --- a/src/main/java/tachyon/Image.java +++ b/src/main/java/tachyon/master/Image.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import java.io.DataInputStream; import java.io.DataOutputStream; @@ -23,6 +23,9 @@ import org.apache.log4j.Logger; +import tachyon.Constants; +import tachyon.UnderFileSystem; + /** * Master data image. */ @@ -32,33 +35,17 @@ public class Image { static final byte T_INODE_FILE = 1; static final byte T_INODE_FOLDER = 2; static final byte T_INODE_RAW_TABLE = 3; + static final byte T_DEPENDENCY = 4; private final static Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); - public static void load(MasterInfo info, String path) throws IOException { - UnderFileSystem ufs = UnderFileSystem.get(path); - if (!ufs.exists(path)) { - LOG.info("Image " + path + " does not exist."); - return; - } - LOG.info("Loading image " + path); - DataInputStream imageIs = new DataInputStream(ufs.open(path)); - - int tVersion = imageIs.readInt(); - if (tVersion != Constants.JOURNAL_VERSION) { - throw new IOException("Image " + path + " has journal version " + tVersion + " ." + - "The system has verion " + Constants.JOURNAL_VERSION); - } - - info.loadImage(imageIs); - imageIs.close(); - ufs.close(); - } - /** * Write a new image to path. This method assumes having a lock on the master info. - * @param info the master info to generate the image - * @param path the new image path + * + * @param info + * the master info to generate the image + * @param path + * the new image path * @throws IOException */ public static void create(MasterInfo info, String path) throws IOException { @@ -87,6 +74,26 @@ public static void create(MasterInfo info, String path) throws IOException { ufs.close(); } + public static void load(MasterInfo info, String path) throws IOException { + UnderFileSystem ufs = UnderFileSystem.get(path); + if (!ufs.exists(path)) { + LOG.info("Image " + path + " does not exist."); + return; + } + LOG.info("Loading image " + path); + DataInputStream imageIs = new DataInputStream(ufs.open(path)); + + int tVersion = imageIs.readInt(); + if (tVersion != Constants.JOURNAL_VERSION) { + throw new IOException("Image " + path + " has journal version " + tVersion + " ." + + "The system has verion " + Constants.JOURNAL_VERSION); + } + + info.loadImage(imageIs); + imageIs.close(); + ufs.close(); + } + public static void rename(String src, String dst) throws IOException { UnderFileSystem ufs = UnderFileSystem.get(src); ufs.rename(src, dst); diff --git a/src/main/java/tachyon/Inode.java b/src/main/java/tachyon/master/Inode.java similarity index 97% rename from src/main/java/tachyon/Inode.java rename to src/main/java/tachyon/master/Inode.java index 6a401b75a86e..1212fd9cc30f 100644 --- a/src/main/java/tachyon/Inode.java +++ b/src/main/java/tachyon/master/Inode.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import tachyon.thrift.ClientFileInfo; @@ -49,52 +49,52 @@ public synchronized boolean equals(Object o) { if (!(o instanceof Inode)) { return false; } - return mId == ((Inode)o).mId; + return mId == ((Inode) o).mId; } - @Override - public synchronized int hashCode() { - return mId; + public abstract ClientFileInfo generateClientFileInfo(String path); + + public long getCreationTimeMs() { + return CREATION_TIME_MS; } - public boolean isDirectory() { - return TYPE != InodeType.File; + public synchronized int getId() { + return mId; } - public boolean isFile() { - return TYPE == InodeType.File; + public InodeType getInodeType() { + return TYPE; } - public long getCreationTimeMs() { - return CREATION_TIME_MS; + public synchronized String getName() { + return mName; } - public InodeType getInodeType() { - return TYPE; + public synchronized int getParentId() { + return mParentId; } - public synchronized int getId() { + @Override + public synchronized int hashCode() { return mId; } - public abstract ClientFileInfo generateClientFileInfo(String path); + public boolean isDirectory() { + return TYPE != InodeType.File; + } - public synchronized void reverseId() { - mId = - mId; + public boolean isFile() { + return TYPE == InodeType.File; } - public synchronized String getName() { - return mName; + public synchronized void reverseId() { + mId = -mId; } public synchronized void setName(String name) { mName = name; } - public synchronized int getParentId() { - return mParentId; - } - public synchronized void setParentId(int parentId) { mParentId = parentId; } diff --git a/src/main/java/tachyon/InodeFile.java b/src/main/java/tachyon/master/InodeFile.java similarity index 87% rename from src/main/java/tachyon/InodeFile.java rename to src/main/java/tachyon/master/InodeFile.java index fcfdd9f36516..53b7e09430c2 100644 --- a/src/main/java/tachyon/InodeFile.java +++ b/src/main/java/tachyon/master/InodeFile.java @@ -14,11 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import java.util.ArrayList; import java.util.List; +import tachyon.Pair; import tachyon.thrift.BlockInfoException; import tachyon.thrift.ClientBlockInfo; import tachyon.thrift.ClientFileInfo; @@ -38,65 +39,12 @@ public class InodeFile extends Inode { private String mCheckpointPath = ""; private List mBlocks = new ArrayList(3); + private int mDependencyId; + public InodeFile(String name, int id, int parentId, long blockSizeByte, long creationTimeMs) { super(name, id, parentId, InodeType.File, creationTimeMs); BLOCK_SIZE_BYTE = blockSizeByte; - } - - public synchronized long getLength() { - return mLength; - } - - public synchronized void setLength(long length) - throws SuspectedFileSizeException, BlockInfoException { - if (isComplete()) { - throw new SuspectedFileSizeException("InodeFile length was set previously."); - } - if (length < 0) { - throw new SuspectedFileSizeException("InodeFile new length " + length + " is illegal."); - } - mLength = 0; - while (length >= BLOCK_SIZE_BYTE) { - addBlock(new BlockInfo(this, mBlocks.size(), BLOCK_SIZE_BYTE)); - length -= BLOCK_SIZE_BYTE; - } - if (length > 0) { - addBlock(new BlockInfo(this, mBlocks.size(), (int) length)); - } - mIsComplete = true; - } - - public synchronized boolean isComplete() { - return mIsComplete; - } - - public synchronized void setComplete() { - mIsComplete = true; - } - - public synchronized void setComplete(boolean complete) { - mIsComplete = complete; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("InodeFile("); - sb.append(super.toString()).append(", LENGTH: ").append(mLength); - sb.append(", CheckpointPath: ").append(mCheckpointPath); - sb.append(", mBlocks: ").append(mBlocks).append(")"); - return sb.toString(); - } - - public synchronized void setCheckpointPath(String checkpointPath) { - mCheckpointPath = checkpointPath; - } - - public synchronized String getCheckpointPath() { - return mCheckpointPath; - } - - public synchronized long getNewBlockId() { - return BlockInfo.computeBlockId(getId(), mBlocks.size()); + mDependencyId = -1; } public synchronized void addBlock(BlockInfo blockInfo) throws BlockInfoException { @@ -104,8 +52,8 @@ public synchronized void addBlock(BlockInfo blockInfo) throws BlockInfoException throw new BlockInfoException("The file is complete: " + this); } if (mBlocks.size() > 0 && mBlocks.get(mBlocks.size() - 1).LENGTH != BLOCK_SIZE_BYTE) { - throw new BlockInfoException("BLOCK_SIZE_BYTE is " + BLOCK_SIZE_BYTE + ", but the " + - "previous block size is " + mBlocks.get(mBlocks.size() - 1).LENGTH); + throw new BlockInfoException("BLOCK_SIZE_BYTE is " + BLOCK_SIZE_BYTE + ", but the " + + "previous block size is " + mBlocks.get(mBlocks.size() - 1).LENGTH); } if (blockInfo.getInodeFile() != this) { throw new BlockInfoException("InodeFile unmatch: " + this + " != " + blockInfo); @@ -113,9 +61,9 @@ public synchronized void addBlock(BlockInfo blockInfo) throws BlockInfoException if (blockInfo.BLOCK_INDEX != mBlocks.size()) { throw new BlockInfoException("BLOCK_INDEX unmatch: " + mBlocks.size() + " != " + blockInfo); } - if (blockInfo.OFFSET != (long) mBlocks.size() * BLOCK_SIZE_BYTE) { - throw new BlockInfoException("OFFSET unmatch: " + (long) mBlocks.size() * BLOCK_SIZE_BYTE + - " != " + blockInfo); + if (blockInfo.OFFSET != mBlocks.size() * BLOCK_SIZE_BYTE) { + throw new BlockInfoException("OFFSET unmatch: " + mBlocks.size() * BLOCK_SIZE_BYTE + " != " + + blockInfo); } if (blockInfo.LENGTH > BLOCK_SIZE_BYTE) { throw new BlockInfoException("LENGTH too big: " + BLOCK_SIZE_BYTE + " " + blockInfo); @@ -124,7 +72,7 @@ public synchronized void addBlock(BlockInfo blockInfo) throws BlockInfoException mBlocks.add(blockInfo); } - public synchronized void addLocation(int blockIndex, long workerId, NetAddress workerAddress) + public synchronized void addLocation(int blockIndex, long workerId, NetAddress workerAddress) throws BlockInfoException { if (blockIndex < 0 || blockIndex >= mBlocks.size()) { throw new BlockInfoException("BlockIndex " + blockIndex + " out of bounds." + toString()); @@ -132,11 +80,27 @@ public synchronized void addLocation(int blockIndex, long workerId, NetAddress w mBlocks.get(blockIndex).addLocation(workerId, workerAddress); } - public synchronized void removeLocation(int blockIndex, long workerId) throws BlockInfoException { - if (blockIndex < 0 || blockIndex >= mBlocks.size()) { - throw new BlockInfoException("BlockIndex " + blockIndex + " out of bounds." + toString()); - } - mBlocks.get(blockIndex).removeLocation(workerId); + @Override + public ClientFileInfo generateClientFileInfo(String path) { + ClientFileInfo ret = new ClientFileInfo(); + + ret.id = getId(); + ret.name = getName(); + ret.path = path; + ret.checkpointPath = mCheckpointPath; + ret.length = mLength; + ret.blockSizeByte = BLOCK_SIZE_BYTE; + ret.creationTimeMs = getCreationTimeMs(); + ret.complete = isComplete(); + ret.folder = false; + ret.inMemory = isFullyInMemory(); + ret.needPin = mPin; + ret.needCache = mCache; + ret.blockIds = getBlockIds(); + ret.dependencyId = mDependencyId; + ret.inMemoryPercentage = getInMemoryPercentage(); + + return ret; } public long getBlockIdBasedOnOffset(long offset) { @@ -144,8 +108,24 @@ public long getBlockIdBasedOnOffset(long offset) { return BlockInfo.computeBlockId(getId(), index); } - public long getBlockSizeByte() { - return BLOCK_SIZE_BYTE; + public synchronized List getBlockIds() { + List ret = new ArrayList(mBlocks.size()); + for (int k = 0; k < mBlocks.size(); k ++) { + ret.add(mBlocks.get(k).BLOCK_ID); + } + return ret; + } + + public synchronized List> getBlockIdWorkerIdPairs() { + List> ret = new ArrayList>(); + for (BlockInfo info : mBlocks) { + ret.addAll(info.getBlockIdWorkerIdPairs()); + } + return ret; + } + + public List getBlockList() { + return mBlocks; } public synchronized List getBlockLocations(int blockIndex) throws BlockInfoException { @@ -156,6 +136,14 @@ public synchronized List getBlockLocations(int blockIndex) throws Bl return mBlocks.get(blockIndex).getLocations(); } + public long getBlockSizeByte() { + return BLOCK_SIZE_BYTE; + } + + public synchronized String getCheckpointPath() { + return mCheckpointPath; + } + public synchronized ClientBlockInfo getClientBlockInfo(int blockIndex) throws BlockInfoException { if (blockIndex < 0 || blockIndex > mBlocks.size()) { throw new BlockInfoException("BlockIndex is out of the boundry: " + blockIndex); @@ -166,18 +154,19 @@ public synchronized ClientBlockInfo getClientBlockInfo(int blockIndex) throws Bl /** * Get file's all blocks' ClientBlockInfo information. + * * @return all blocks ClientBlockInfo */ public synchronized List getClientBlockInfos() { List ret = new ArrayList(mBlocks.size()); - for (BlockInfo tInfo: mBlocks) { + for (BlockInfo tInfo : mBlocks) { ret.add(tInfo.generateClientBlockInfo()); } return ret; } - public synchronized boolean isFullyInMemory() { - return getInMemoryPercentage() == 100; + public synchronized int getDependencyId() { + return mDependencyId; } private synchronized int getInMemoryPercentage() { @@ -186,7 +175,7 @@ private synchronized int getInMemoryPercentage() { } long inMemoryLength = 0; - for (BlockInfo info: mBlocks) { + for (BlockInfo info : mBlocks) { if (info.isInMemory()) { inMemoryLength += info.LENGTH; } @@ -194,64 +183,95 @@ private synchronized int getInMemoryPercentage() { return (int) (inMemoryLength * 100 / mLength); } - public synchronized void setPin(boolean pin) { - mPin = pin; + public synchronized long getLength() { + return mLength; + } + + public synchronized long getNewBlockId() { + return BlockInfo.computeBlockId(getId(), mBlocks.size()); + } + + public synchronized int getNumberOfBlocks() { + return mBlocks.size(); + } + + public synchronized boolean hasCheckpointed() { + return !mCheckpointPath.equals(""); + } + + public synchronized boolean isCache() { + return mCache; + } + + public synchronized boolean isComplete() { + return mIsComplete; + } + + public synchronized boolean isFullyInMemory() { + return getInMemoryPercentage() == 100; } public synchronized boolean isPin() { return mPin; } + public synchronized void removeLocation(int blockIndex, long workerId) throws BlockInfoException { + if (blockIndex < 0 || blockIndex >= mBlocks.size()) { + throw new BlockInfoException("BlockIndex " + blockIndex + " out of bounds." + toString()); + } + mBlocks.get(blockIndex).removeLocation(workerId); + } + public synchronized void setCache(boolean cache) { mCache = cache; } - public synchronized boolean isCache() { - return mCache; + public synchronized void setCheckpointPath(String checkpointPath) { + mCheckpointPath = checkpointPath; } - public synchronized boolean hasCheckpointed() { - return !mCheckpointPath.equals(""); + public synchronized void setComplete() { + mIsComplete = true; } - public synchronized List getBlockIds() { - List ret = new ArrayList(mBlocks.size()); - for (int k = 0; k < mBlocks.size(); k ++) { - ret.add(mBlocks.get(k).BLOCK_ID); - } - return ret; + public synchronized void setComplete(boolean complete) { + mIsComplete = complete; } - public synchronized int getNumberOfBlocks() { - return mBlocks.size(); + public synchronized void setDependencyId(int dependencyId) { + mDependencyId = dependencyId; } - public synchronized List> getBlockIdWorkerIdPairs() { - List> ret = new ArrayList>(); - for (BlockInfo info: mBlocks) { - ret.addAll(info.getBlockIdWorkerIdPairs()); + public synchronized void setLength(long length) throws SuspectedFileSizeException, + BlockInfoException { + if (isComplete()) { + throw new SuspectedFileSizeException("InodeFile length was set previously."); } - return ret; + if (length < 0) { + throw new SuspectedFileSizeException("InodeFile new length " + length + " is illegal."); + } + mLength = 0; + while (length >= BLOCK_SIZE_BYTE) { + addBlock(new BlockInfo(this, mBlocks.size(), BLOCK_SIZE_BYTE)); + length -= BLOCK_SIZE_BYTE; + } + if (length > 0) { + addBlock(new BlockInfo(this, mBlocks.size(), (int) length)); + } + mIsComplete = true; } - @Override - public ClientFileInfo generateClientFileInfo(String path) { - ClientFileInfo ret = new ClientFileInfo(); - - ret.id = getId(); - ret.name = getName(); - ret.path = path; - ret.checkpointPath = mCheckpointPath; - ret.length = mLength; - ret.blockSizeByte = BLOCK_SIZE_BYTE; - ret.creationTimeMs = getCreationTimeMs(); - ret.complete = isComplete(); - ret.folder = false; - ret.inMemory = isFullyInMemory(); - ret.needPin = mPin; - ret.needCache = mCache; - ret.blockIds = getBlockIds(); + public synchronized void setPin(boolean pin) { + mPin = pin; + } - return ret; + @Override + public String toString() { + StringBuilder sb = new StringBuilder("InodeFile("); + sb.append(super.toString()).append(", LENGTH: ").append(mLength); + sb.append(", CheckpointPath: ").append(mCheckpointPath); + sb.append(", mBlocks: ").append(mBlocks); + sb.append(", DependencyId:").append(mDependencyId).append(")"); + return sb.toString(); } } \ No newline at end of file diff --git a/src/main/java/tachyon/InodeFolder.java b/src/main/java/tachyon/master/InodeFolder.java similarity index 95% rename from src/main/java/tachyon/InodeFolder.java rename to src/main/java/tachyon/master/InodeFolder.java index 4d43e7a69ec8..812a4ce77964 100644 --- a/src/main/java/tachyon/InodeFolder.java +++ b/src/main/java/tachyon/master/InodeFolder.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import java.util.ArrayList; import java.util.HashSet; @@ -25,30 +25,52 @@ import tachyon.thrift.ClientFileInfo; /** - * Tachyon file system's folder representation in master. + * Tachyon file system's folder representation in master. */ public class InodeFolder extends Inode { private Set mChildren; - public InodeFolder(String name, int id, int parentId, long creationTimeMs) { - this(name, id, parentId, InodeType.Folder, creationTimeMs); - } - public InodeFolder(String name, int id, int parentId, InodeType type, long creationTimeMs) { super(name, id, parentId, type, creationTimeMs); mChildren = new HashSet(); } + public InodeFolder(String name, int id, int parentId, long creationTimeMs) { + this(name, id, parentId, InodeType.Folder, creationTimeMs); + } + public synchronized void addChild(int childId) { mChildren.add(childId); } - public synchronized void addChildren(int [] childrenIds) { + public synchronized void addChildren(int[] childrenIds) { for (int k = 0; k < childrenIds.length; k ++) { addChild(childrenIds[k]); } } + @Override + public ClientFileInfo generateClientFileInfo(String path) { + ClientFileInfo ret = new ClientFileInfo(); + + ret.id = getId(); + ret.name = getName(); + ret.path = path; + ret.checkpointPath = ""; + ret.length = 0; + ret.blockSizeByte = 0; + ret.creationTimeMs = getCreationTimeMs(); + ret.complete = true; + ret.folder = true; + ret.inMemory = true; + ret.needPin = false; + ret.needCache = false; + ret.blockIds = null; + ret.dependencyId = -1; + + return ret; + } + public synchronized Inode getChild(String name, Map allInodes) { Inode tInode = null; for (int childId : mChildren) { @@ -70,6 +92,10 @@ public synchronized int getNumberOfChildren() { return mChildren.size(); } + public boolean isRawTable() { + return TYPE == InodeType.RawTable; + } + public synchronized void removeChild(int id) { mChildren.remove(id); } @@ -86,35 +112,10 @@ public synchronized boolean removeChild(String name, Map allInod return false; } - public boolean isRawTable() { - return TYPE == InodeType.RawTable; - } - @Override public String toString() { StringBuilder sb = new StringBuilder("InodeFolder("); sb.append(super.toString()).append(",").append(mChildren).append(")"); return sb.toString(); } - - @Override - public ClientFileInfo generateClientFileInfo(String path) { - ClientFileInfo ret = new ClientFileInfo(); - - ret.id = getId(); - ret.name = getName(); - ret.path = path; - ret.checkpointPath = ""; - ret.length = 0; - ret.blockSizeByte = 0; - ret.creationTimeMs = getCreationTimeMs(); - ret.complete = true; - ret.folder = true; - ret.inMemory = true; - ret.needPin = false; - ret.needCache = false; - ret.blockIds = null; - - return ret; - } } \ No newline at end of file diff --git a/src/main/java/tachyon/InodeRawTable.java b/src/main/java/tachyon/master/InodeRawTable.java similarity index 93% rename from src/main/java/tachyon/InodeRawTable.java rename to src/main/java/tachyon/master/InodeRawTable.java index 9e3e20675b23..1407c95af76f 100644 --- a/src/main/java/tachyon/InodeRawTable.java +++ b/src/main/java/tachyon/master/InodeRawTable.java @@ -14,10 +14,11 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import java.nio.ByteBuffer; +import tachyon.conf.CommonConf; import tachyon.thrift.TachyonException; /** @@ -39,20 +40,6 @@ public int getColumns() { return COLUMNS; } - // TODO add version number. - public synchronized void updateMetadata(ByteBuffer metadata) throws TachyonException { - if (metadata == null) { - mMetadata = ByteBuffer.allocate(0); - } else { - if (metadata.limit() - metadata.position() >= Constants.MAX_TABLE_METADATA_BYTE) { - throw new TachyonException("Too big table metadata: " + metadata.toString()); - } - mMetadata = ByteBuffer.allocate(metadata.limit() - metadata.position()); - mMetadata.put(metadata.array(), metadata.position(), metadata.limit() - metadata.position()); - mMetadata.flip(); - } - } - public synchronized ByteBuffer getMetadata() { ByteBuffer ret = ByteBuffer.allocate(mMetadata.capacity()); ret.put(mMetadata.array()); @@ -67,4 +54,18 @@ public String toString() { sb.append(mMetadata).append(")"); return sb.toString(); } + + // TODO add version number. + public synchronized void updateMetadata(ByteBuffer metadata) throws TachyonException { + if (metadata == null) { + mMetadata = ByteBuffer.allocate(0); + } else { + if (metadata.limit() - metadata.position() >= CommonConf.get().MAX_TABLE_METADATA_BYTE) { + throw new TachyonException("Too big table metadata: " + metadata.toString()); + } + mMetadata = ByteBuffer.allocate(metadata.limit() - metadata.position()); + mMetadata.put(metadata.array(), metadata.position(), metadata.limit() - metadata.position()); + mMetadata.flip(); + } + } } \ No newline at end of file diff --git a/src/main/java/tachyon/InodeType.java b/src/main/java/tachyon/master/InodeType.java similarity index 97% rename from src/main/java/tachyon/InodeType.java rename to src/main/java/tachyon/master/InodeType.java index 8d70d6c04e62..67b37408b374 100644 --- a/src/main/java/tachyon/InodeType.java +++ b/src/main/java/tachyon/master/InodeType.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; /** * Different Inodes in Tachyon Filesystem's master. diff --git a/src/main/java/tachyon/Journal.java b/src/main/java/tachyon/master/Journal.java similarity index 94% rename from src/main/java/tachyon/Journal.java rename to src/main/java/tachyon/master/Journal.java index a0a4fd0d6888..027f8c0b0266 100644 --- a/src/main/java/tachyon/Journal.java +++ b/src/main/java/tachyon/master/Journal.java @@ -14,10 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import java.io.IOException; +import tachyon.UnderFileSystem; + /** * The Journal manages Tachyon image and journal log. */ @@ -37,37 +39,21 @@ public Journal(String folder, String imageFileName, String editLogFileName) thro mEditLogPath = folder + editLogFileName; } - public long getImageModTime() throws IOException { - UnderFileSystem ufs = UnderFileSystem.get(mImagePath); - if (!ufs.exists(mImagePath)) { - return -1; + /* Close down the edit log */ + public void close() { + if (mEditLog != null) { + mEditLog.close(); } - return ufs.getModificationTimeMs(mImagePath); - } - - public void loadImage(MasterInfo info) throws IOException { - Image.load(info, mImagePath); - } - - /** - * Load edit log. - * @param info The Master Info. - * @return The last transaction id. - * @throws IOException - */ - public long loadEditLog(MasterInfo info) throws IOException { - return EditLog.load(info, mEditLogPath, mCurrentLogFileNum); } - public void loadSingleLogFile(MasterInfo info, String path) throws IOException { - EditLog.loadSingleLog(info, path); - mCurrentLogFileNum ++; + public void createEditLog(long transactionId) throws IOException { + mEditLog = new EditLog(mEditLogPath, false, transactionId); } public void createImage(MasterInfo info) throws IOException { if (mStandbyImagePath == "") { Image.create(info, mImagePath); - EditLog.markUpToDate(); + EditLog.markUpToDate(mEditLogPath); } else { Image.rename(mStandbyImagePath, mImagePath); } @@ -78,23 +64,42 @@ public void createImage(MasterInfo info, String imagePath) throws IOException { mStandbyImagePath = imagePath; } - public void createEditLog(long transactionId) throws IOException { - mEditLog = new EditLog(mEditLogPath, false, transactionId); - } - public EditLog getEditLog() { return mEditLog; } - /* Close down the edit log */ - public void close() { - if (mEditLog != null) { - mEditLog.close(); + public long getImageModTime() throws IOException { + UnderFileSystem ufs = UnderFileSystem.get(mImagePath); + if (!ufs.exists(mImagePath)) { + return -1; } + return ufs.getModificationTimeMs(mImagePath); + } + + /** + * Load edit log. + * + * @param info + * The Master Info. + * @return The last transaction id. + * @throws IOException + */ + public long loadEditLog(MasterInfo info) throws IOException { + return EditLog.load(info, mEditLogPath, mCurrentLogFileNum); + } + + public void loadImage(MasterInfo info) throws IOException { + Image.load(info, mImagePath); + } + + public void loadSingleLogFile(MasterInfo info, String path) throws IOException { + EditLog.loadSingleLog(info, path); + mCurrentLogFileNum ++; } /** * Changes the max edit log size for testing purposes + * * @param size */ public void setMaxLogSize(int size) { diff --git a/src/main/java/tachyon/MasterClient.java b/src/main/java/tachyon/master/MasterClient.java similarity index 71% rename from src/main/java/tachyon/MasterClient.java rename to src/main/java/tachyon/master/MasterClient.java index 7381d41938e3..554a87a31091 100644 --- a/src/main/java/tachyon/MasterClient.java +++ b/src/main/java/tachyon/master/MasterClient.java @@ -14,11 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import java.io.IOException; import java.net.InetSocketAddress; import java.nio.ByteBuffer; +import java.util.ArrayList; import java.util.List; import java.util.Set; @@ -30,14 +31,19 @@ import org.apache.thrift.transport.TTransportException; import org.apache.log4j.Logger; +import tachyon.Constants; +import tachyon.HeartbeatThread; +import tachyon.LeaderInquireClient; import tachyon.conf.CommonConf; import tachyon.conf.UserConf; import tachyon.thrift.BlockInfoException; import tachyon.thrift.ClientBlockInfo; +import tachyon.thrift.ClientDependencyInfo; import tachyon.thrift.ClientFileInfo; import tachyon.thrift.ClientRawTableInfo; import tachyon.thrift.ClientWorkerInfo; import tachyon.thrift.Command; +import tachyon.thrift.DependencyDoesNotExistException; import tachyon.thrift.FileAlreadyExistException; import tachyon.thrift.FileDoesNotExistException; import tachyon.thrift.InvalidPathException; @@ -52,7 +58,7 @@ /** * The master server client side. - * + * * Since MasterService.Client is not thread safe, this class has to guarantee thread safe. */ public class MasterClient { @@ -82,25 +88,9 @@ public MasterClient(InetSocketAddress masterAddress, boolean useZookeeper) { mIsShutdown = false; } - private InetSocketAddress getMasterAddress() { - if (!mUseZookeeper) { - return mMasterAddress; - } - - LeaderInquireClient leaderInquireClient = LeaderInquireClient.getClient( - CommonConf.get().ZOOKEEPER_ADDRESS, CommonConf.get().ZOOKEEPER_LEADER_PATH); - try { - String temp = leaderInquireClient.getMasterAddress(); - return CommonUtils.parseInetSocketAddress(temp); - } catch (IOException e) { - LOG.error(e.getMessage(), e); - CommonUtils.runtimeException(e); - } - return null; - } - /** - * @param workerId if -1, means the checkpoint is added directly by the client from underlayer fs. + * @param workerId + * if -1, means the checkpoint is added directly by the client from underlayer fs. * @param fileId * @param length * @param checkpointPath @@ -111,14 +101,13 @@ private InetSocketAddress getMasterAddress() { * @throws TException */ public synchronized boolean addCheckpoint(long workerId, int fileId, long length, - String checkpointPath) - throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, - TException { + String checkpointPath) throws FileDoesNotExistException, SuspectedFileSizeException, + BlockInfoException, TException { while (!mIsShutdown) { connect(); try { return mClient.addCheckpoint(workerId, fileId, length, checkpointPath); - } catch (TTransportException e) { + } catch (TException e) { LOG.error(e.getMessage()); mIsConnected = false; } @@ -126,8 +115,26 @@ public synchronized boolean addCheckpoint(long workerId, int fileId, long length return false; } + /** + * Clean the connect. E.g. if the client has not connect the master for a while, the connection + * should be shut down. + */ + public synchronized void cleanConnect() { + if (mIsConnected) { + LOG.info("Disconnecting from the master " + mMasterAddress); + mIsConnected = false; + } + if (mProtocol != null) { + mProtocol.getTransport().close(); + } + if (mHeartbeatThread != null) { + mHeartbeatThread.shutdown(); + } + } + /** * Try to connect to the master + * * @return true if connection succeed, false otherwise. */ public synchronized boolean connect() { @@ -143,21 +150,23 @@ public synchronized boolean connect() { int tries = 0; while (tries ++ < MAX_CONNECT_TRY) { mMasterAddress = getMasterAddress(); - mProtocol = new TBinaryProtocol(new TFramedTransport( - new TSocket(mMasterAddress.getHostName(), mMasterAddress.getPort()))); + mProtocol = + new TBinaryProtocol(new TFramedTransport(new TSocket(mMasterAddress.getHostName(), + mMasterAddress.getPort()))); mClient = new MasterService.Client(mProtocol); mLastAccessedMs = System.currentTimeMillis(); if (!mIsConnected && !mIsShutdown) { try { mProtocol.getTransport().open(); - mHeartbeatThread = new HeartbeatThread("Master_Client Heartbeat", - new MasterClientHeartbeatExecutor(this, UserConf.get().MASTER_CLIENT_TIMEOUT_MS), - UserConf.get().MASTER_CLIENT_TIMEOUT_MS / 2); + mHeartbeatThread = + new HeartbeatThread("Master_Client Heartbeat", new MasterClientHeartbeatExecutor( + this, UserConf.get().MASTER_CLIENT_TIMEOUT_MS), + UserConf.get().MASTER_CLIENT_TIMEOUT_MS / 2); mHeartbeatThread.start(); } catch (TTransportException e) { - LOG.error("Failed to connect (" +tries + ") to master " + mMasterAddress + - " : " + e.getMessage()); + LOG.error("Failed to connect (" + tries + ") to master " + mMasterAddress + " : " + + e.getMessage()); CommonUtils.sleepMs(LOG, 1000); continue; } @@ -169,27 +178,58 @@ public synchronized boolean connect() { return mIsConnected; } - /** - * Clean the connect. E.g. if the client has not connect the master for a while, the connection - * should be shut down. - */ - public synchronized void cleanConnect() { - if (mIsConnected) { - LOG.info("Disconnecting from the master " + mMasterAddress); - mIsConnected = false; - } - if (mProtocol != null) { - mProtocol.getTransport().close(); + public ClientDependencyInfo getClientDependencyInfo(int did) throws IOException, TException { + while (!mIsShutdown) { + connect(); + try { + return mClient.user_getClientDependencyInfo(did); + } catch (DependencyDoesNotExistException e) { + throw new IOException(e); + } catch (TTransportException e) { + LOG.error(e.getMessage()); + mIsConnected = false; + } } - if (mHeartbeatThread != null) { - mHeartbeatThread.shutdown(); + return null; + } + + public synchronized ClientFileInfo getClientFileInfoById(int id) throws IOException, TException { + while (!mIsShutdown) { + connect(); + try { + return mClient.getClientFileInfoById(id); + } catch (FileDoesNotExistException e) { + throw new IOException(e); + } catch (TException e) { + LOG.error(e.getMessage()); + mIsConnected = false; + } } + return null; } synchronized long getLastAccessedMs() { return mLastAccessedMs; } + private InetSocketAddress getMasterAddress() { + if (!mUseZookeeper) { + return mMasterAddress; + } + + LeaderInquireClient leaderInquireClient = + LeaderInquireClient.getClient(CommonConf.get().ZOOKEEPER_ADDRESS, + CommonConf.get().ZOOKEEPER_LEADER_PATH); + try { + String temp = leaderInquireClient.getMasterAddress(); + return CommonUtils.parseInetSocketAddress(temp); + } catch (IOException e) { + LOG.error(e.getMessage(), e); + CommonUtils.runtimeException(e); + } + return null; + } + public synchronized long getUserId() throws TException { while (!mIsShutdown) { connect(); @@ -222,6 +262,23 @@ public synchronized boolean isConnected() { return mIsConnected; } + public synchronized List listStatus(String path) throws IOException, TException { + while (!mIsShutdown) { + connect(); + try { + return mClient.liststatus(path); + } catch (InvalidPathException e) { + throw new IOException(e); + } catch (FileDoesNotExistException e) { + throw new IOException(e); + } catch (TException e) { + LOG.error(e.getMessage()); + mIsConnected = false; + } + } + return null; + } + public void shutdown() { mIsShutdown = true; if (mProtocol != null) { @@ -230,45 +287,59 @@ public void shutdown() { cleanConnect(); } - public synchronized List listStatus(String path) - throws IOException, TException { + public synchronized void user_completeFile(int fId) throws IOException, TException { while (!mIsShutdown) { connect(); try { - return mClient.liststatus(path); - } catch (InvalidPathException | FileDoesNotExistException e) { + mClient.user_completeFile(fId); + return; + } catch (FileDoesNotExistException e) { throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); mIsConnected = false; } } - return null; } - public synchronized void user_completeFile(int fId) - throws IOException, TException { + public synchronized int user_createDependency(List parents, List children, + String commandPrefix, List data, String comment, String framework, + String frameworkVersion, int dependencyType, long childrenBlockSizeByte) throws IOException, + TException { while (!mIsShutdown) { connect(); try { - mClient.user_completeFile(fId); - return; + return mClient.user_createDependency(parents, children, commandPrefix, data, comment, + framework, frameworkVersion, dependencyType, childrenBlockSizeByte); + } catch (InvalidPathException e) { + throw new IOException(e); } catch (FileDoesNotExistException e) { throw new IOException(e); + } catch (FileAlreadyExistException e) { + throw new IOException(e); + } catch (BlockInfoException e) { + throw new IOException(e); + } catch (TachyonException e) { + throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); mIsConnected = false; } } + return -1; } - public synchronized int user_createFile(String path, long blockSizeByte) - throws IOException, TException { + public synchronized int user_createFile(String path, long blockSizeByte) throws IOException, + TException { while (!mIsShutdown) { connect(); try { return mClient.user_createFile(path, blockSizeByte); - } catch (FileAlreadyExistException | InvalidPathException | BlockInfoException e) { + } catch (FileAlreadyExistException e) { + throw new IOException(e); + } catch (InvalidPathException e) { + throw new IOException(e); + } catch (BlockInfoException e) { throw new IOException(e); } catch (TachyonException e) { throw new IOException(e); @@ -280,14 +351,21 @@ public synchronized int user_createFile(String path, long blockSizeByte) return -1; } - public int user_createFileOnCheckpoint(String path, String checkpointPath) - throws IOException, TException { + public int user_createFileOnCheckpoint(String path, String checkpointPath) throws IOException, + TException { while (!mIsShutdown) { connect(); try { return mClient.user_createFileOnCheckpoint(path, checkpointPath); - } catch (FileAlreadyExistException | InvalidPathException | SuspectedFileSizeException | - BlockInfoException | TachyonException e) { + } catch (FileAlreadyExistException e) { + throw new IOException(e); + } catch (InvalidPathException e) { + throw new IOException(e); + } catch (SuspectedFileSizeException e) { + throw new IOException(e); + } catch (BlockInfoException e) { + throw new IOException(e); + } catch (TachyonException e) { throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); @@ -321,8 +399,13 @@ public synchronized int user_createRawTable(String path, int columns, ByteBuffer connect(); try { return mClient.user_createRawTable(path, columns, metadata); - } catch (FileAlreadyExistException | InvalidPathException | TableColumnException | - TachyonException e) { + } catch (FileAlreadyExistException e) { + throw new IOException(e); + } catch (InvalidPathException e) { + throw new IOException(e); + } catch (TableColumnException e) { + throw new IOException(e); + } catch (TachyonException e) { throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); @@ -332,12 +415,12 @@ public synchronized int user_createRawTable(String path, int columns, ByteBuffer return -1; } - public synchronized boolean user_delete(String path, boolean recursive) - throws IOException, TException { + public synchronized boolean user_delete(int fileId, boolean recursive) throws IOException, + TException { while (!mIsShutdown) { connect(); try { - return mClient.user_deleteByPath(path, recursive); + return mClient.user_deleteById(fileId, recursive); } catch (TachyonException e) { throw new IOException(e); } catch (TTransportException e) { @@ -348,12 +431,12 @@ public synchronized boolean user_delete(String path, boolean recursive) return false; } - public synchronized boolean user_delete(int fileId, boolean recursive) - throws IOException, TException { + public synchronized boolean user_delete(String path, boolean recursive) throws IOException, + TException { while (!mIsShutdown) { connect(); try { - return mClient.user_deleteById(fileId, recursive); + return mClient.user_deleteByPath(path, recursive); } catch (TachyonException e) { throw new IOException(e); } catch (TTransportException e) { @@ -364,8 +447,7 @@ public synchronized boolean user_delete(int fileId, boolean recursive) return false; } - public synchronized long user_getBlockId(int fId, int index) - throws IOException, TException { + public synchronized long user_getBlockId(int fId, int index) throws IOException, TException { while (!mIsShutdown) { connect(); try { @@ -380,8 +462,8 @@ public synchronized long user_getBlockId(int fId, int index) return -1; } - public ClientBlockInfo user_getClientBlockInfo(long blockId) - throws FileDoesNotExistException, BlockInfoException, TException { + public ClientBlockInfo user_getClientBlockInfo(long blockId) throws FileDoesNotExistException, + BlockInfoException, TException { while (!mIsShutdown) { connect(); try { @@ -394,13 +476,15 @@ public ClientBlockInfo user_getClientBlockInfo(long blockId) return null; } - public synchronized ClientFileInfo user_getClientFileInfoByPath(String path) - throws IOException, TException { + public synchronized ClientFileInfo user_getClientFileInfoByPath(String path) throws IOException, + TException { while (!mIsShutdown) { connect(); try { return mClient.user_getClientFileInfoByPath(path); - } catch (FileDoesNotExistException | InvalidPathException e) { + } catch (FileDoesNotExistException e) { + throw new IOException(e); + } catch (InvalidPathException e) { throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); @@ -410,13 +494,15 @@ public synchronized ClientFileInfo user_getClientFileInfoByPath(String path) return null; } - public synchronized ClientFileInfo user_getClientFileInfoById(int id) + public synchronized ClientRawTableInfo user_getClientRawTableInfoById(int id) throws IOException, TException { while (!mIsShutdown) { connect(); try { - return mClient.user_getClientFileInfoById(id); - } catch (FileDoesNotExistException e) { + ClientRawTableInfo ret = mClient.user_getClientRawTableInfoById(id); + ret.setMetadata(CommonUtils.generateNewByteBufferFromThriftRPCResults(ret.metadata)); + return ret; + } catch (TableDoesNotExistException e) { throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); @@ -426,26 +512,16 @@ public synchronized ClientFileInfo user_getClientFileInfoById(int id) return null; } - public synchronized int user_getFileId(String path) throws IOException, TException { + public synchronized ClientRawTableInfo user_getClientRawTableInfoByPath(String path) + throws IOException, TException { while (!mIsShutdown) { connect(); try { - return mClient.user_getFileId(path); - } catch (InvalidPathException e) { + ClientRawTableInfo ret = mClient.user_getClientRawTableInfoByPath(path); + ret.setMetadata(CommonUtils.generateNewByteBufferFromThriftRPCResults(ret.metadata)); + return ret; + } catch (TableDoesNotExistException e) { throw new IOException(e); - } catch (TTransportException e) { - LOG.error(e.getMessage()); - mIsConnected = false; - } - } - return -1; - } - - public synchronized int user_getRawTableId(String path) throws IOException, TException { - while (!mIsShutdown) { - connect(); - try { - return mClient.user_getRawTableId(path); } catch (InvalidPathException e) { throw new IOException(e); } catch (TTransportException e) { @@ -453,11 +529,11 @@ public synchronized int user_getRawTableId(String path) throws IOException, TExc mIsConnected = false; } } - return -1; + return null; } - public synchronized List user_getFileBlocks(int id) - throws IOException, TException { + public synchronized List user_getFileBlocks(int id) throws IOException, + TException { while (!mIsShutdown) { connect(); try { @@ -472,77 +548,72 @@ public synchronized List user_getFileBlocks(int id) return null; } - public synchronized NetAddress user_getWorker(boolean random, String hostname) - throws NoWorkerException, TException { + public synchronized int user_getFileId(String path) throws IOException, TException { while (!mIsShutdown) { connect(); try { - return mClient.user_getWorker(random, hostname); + return mClient.user_getFileId(path); + } catch (InvalidPathException e) { + throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); mIsConnected = false; } } - return null; + return -1; } - public synchronized ClientRawTableInfo user_getClientRawTableInfoByPath(String path) - throws IOException, TException { + public synchronized int user_getNumberOfFiles(String folderPath) throws IOException, TException { while (!mIsShutdown) { connect(); try { - ClientRawTableInfo ret = mClient.user_getClientRawTableInfoByPath(path); - ret.setMetadata(CommonUtils.generateNewByteBufferFromThriftRPCResults(ret.metadata)); - return ret; - } catch (TableDoesNotExistException | InvalidPathException e) { + return mClient.user_getNumberOfFiles(folderPath); + } catch (FileDoesNotExistException e) { + throw new IOException(e); + } catch (InvalidPathException e) { throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); mIsConnected = false; } } - return null; + return -1; } - public synchronized ClientRawTableInfo user_getClientRawTableInfoById(int id) - throws IOException, TException { + public synchronized int user_getRawTableId(String path) throws IOException, TException { while (!mIsShutdown) { connect(); try { - ClientRawTableInfo ret = mClient.user_getClientRawTableInfoById(id); - ret.setMetadata(CommonUtils.generateNewByteBufferFromThriftRPCResults(ret.metadata)); - return ret; - } catch (TableDoesNotExistException e) { + return mClient.user_getRawTableId(path); + } catch (InvalidPathException e) { throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); mIsConnected = false; } } - return null; + return -1; } - public synchronized int user_getNumberOfFiles(String folderPath) - throws IOException, TException { + public synchronized String user_getUnderfsAddress() throws TException { while (!mIsShutdown) { connect(); try { - return mClient.user_getNumberOfFiles(folderPath); - } catch (FileDoesNotExistException | InvalidPathException e) { - throw new IOException(e); + return mClient.user_getUnderfsAddress(); } catch (TTransportException e) { LOG.error(e.getMessage()); mIsConnected = false; } } - return -1; + return null; } - public synchronized String user_getUnderfsAddress() throws TException { + public synchronized NetAddress user_getWorker(boolean random, String hostname) + throws NoWorkerException, TException { while (!mIsShutdown) { connect(); try { - return mClient.user_getUnderfsAddress(); + return mClient.user_getWorker(random, hostname); } catch (TTransportException e) { LOG.error(e.getMessage()); mIsConnected = false; @@ -557,7 +628,9 @@ public synchronized List user_listFiles(String path, boolean recursive) connect(); try { return mClient.user_listFiles(path, recursive); - } catch (FileDoesNotExistException | InvalidPathException e) { + } catch (FileDoesNotExistException e) { + throw new IOException(e); + } catch (InvalidPathException e) { throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); @@ -567,13 +640,15 @@ public synchronized List user_listFiles(String path, boolean recursive) return null; } - public synchronized List user_ls(String path, boolean recursive) - throws IOException, TException { + public synchronized List user_ls(String path, boolean recursive) throws IOException, + TException { while (!mIsShutdown) { connect(); try { return mClient.user_ls(path, recursive); - } catch (FileDoesNotExistException | InvalidPathException e) { + } catch (FileDoesNotExistException e) { + throw new IOException(e); + } catch (InvalidPathException e) { throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); @@ -583,13 +658,16 @@ public synchronized List user_ls(String path, boolean recursive) return null; } - public synchronized boolean user_mkdir(String path) - throws IOException, TException { + public synchronized boolean user_mkdir(String path) throws IOException, TException { while (!mIsShutdown) { connect(); try { return mClient.user_mkdir(path); - } catch (FileAlreadyExistException | InvalidPathException | TachyonException e) { + } catch (FileAlreadyExistException e) { + throw new IOException(e); + } catch (InvalidPathException e) { + throw new IOException(e); + } catch (TachyonException e) { throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); @@ -612,14 +690,18 @@ public synchronized void user_outOfMemoryForPinFile(int fileId) throws TExceptio } } - public synchronized void user_rename(String srcPath, String dstPath) - throws IOException, TException{ + public synchronized void user_rename(String srcPath, String dstPath) throws IOException, + TException { while (!mIsShutdown) { connect(); try { mClient.user_rename(srcPath, dstPath); return; - } catch (FileAlreadyExistException | FileDoesNotExistException | InvalidPathException e) { + } catch (FileAlreadyExistException e) { + throw new IOException(e); + } catch (FileDoesNotExistException e) { + throw new IOException(e); + } catch (InvalidPathException e) { throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); @@ -634,7 +716,41 @@ public void user_renameTo(int fId, String path) throws IOException, TException { try { mClient.user_renameTo(fId, path); return; - } catch (FileAlreadyExistException | FileDoesNotExistException | InvalidPathException e) { + } catch (FileAlreadyExistException e) { + throw new IOException(e); + } catch (FileDoesNotExistException e) { + throw new IOException(e); + } catch (InvalidPathException e) { + throw new IOException(e); + } catch (TTransportException e) { + LOG.error(e.getMessage()); + mIsConnected = false; + } + } + } + + public synchronized void user_reportLostFile(int fileId) throws IOException, TException { + while (!mIsShutdown) { + connect(); + try { + mClient.user_reportLostFile(fileId); + return; + } catch (FileDoesNotExistException e) { + throw new IOException(e); + } catch (TTransportException e) { + LOG.error(e.getMessage()); + mIsConnected = false; + } + } + } + + public synchronized void user_requestFilesInDependency(int depId) throws IOException, TException { + while (!mIsShutdown) { + connect(); + try { + mClient.user_requestFilesInDependency(depId); + return; + } catch (DependencyDoesNotExistException e) { throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); @@ -665,7 +781,9 @@ public synchronized void user_updateRawTableMetadata(int id, ByteBuffer metadata try { mClient.user_updateRawTableMetadata(id, metadata); return; - } catch (TableDoesNotExistException | TachyonException e) { + } catch (TableDoesNotExistException e) { + throw new IOException(e); + } catch (TachyonException e) { throw new IOException(e); } catch (TTransportException e) { LOG.error(e.getMessage()); @@ -675,8 +793,8 @@ public synchronized void user_updateRawTableMetadata(int id, ByteBuffer metadata } public synchronized void worker_cacheBlock(long workerId, long workerUsedBytes, long blockId, - long length) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, - TException { + long length) throws FileDoesNotExistException, SuspectedFileSizeException, + BlockInfoException, TException { while (!mIsShutdown) { connect(); try { @@ -689,12 +807,11 @@ public synchronized void worker_cacheBlock(long workerId, long workerUsedBytes, } } - public synchronized Command worker_heartbeat(long workerId, long usedBytes, - List removedPartitionList) throws BlockInfoException, TException { + public synchronized Set worker_getPinIdList() throws TException { while (!mIsShutdown) { connect(); try { - return mClient.worker_heartbeat(workerId, usedBytes, removedPartitionList); + return mClient.worker_getPinIdList(); } catch (TTransportException e) { LOG.error(e.getMessage()); mIsConnected = false; @@ -703,11 +820,25 @@ public synchronized Command worker_heartbeat(long workerId, long usedBytes, return null; } - public synchronized Set worker_getPinIdList() throws TException { + public synchronized List worker_getPriorityDependencyList() throws TException { while (!mIsShutdown) { connect(); try { - return mClient.worker_getPinIdList(); + return mClient.worker_getPriorityDependencyList(); + } catch (TTransportException e) { + LOG.error(e.getMessage()); + mIsConnected = false; + } + } + return new ArrayList(); + } + + public synchronized Command worker_heartbeat(long workerId, long usedBytes, + List removedPartitionList) throws BlockInfoException, TException { + while (!mIsShutdown) { + connect(); + try { + return mClient.worker_heartbeat(workerId, usedBytes, removedPartitionList); } catch (TTransportException e) { LOG.error(e.getMessage()); mIsConnected = false; @@ -718,10 +849,15 @@ public synchronized Set worker_getPinIdList() throws TException { /** * Register the worker to the master. - * @param workerNetAddress Worker's NetAddress - * @param totalBytes Worker's capacity - * @param usedBytes Worker's used storage - * @param currentBlockList Blocks in worker's space. + * + * @param workerNetAddress + * Worker's NetAddress + * @param totalBytes + * Worker's capacity + * @param usedBytes + * Worker's used storage + * @param currentBlockList + * Blocks in worker's space. * @return the worker id assigned by the master. * @throws BlockInfoException * @throws TException @@ -733,8 +869,8 @@ public synchronized long worker_register(NetAddress workerNetAddress, long total try { long ret = mClient.worker_register(workerNetAddress, totalBytes, usedBytes, currentBlockList); - LOG.info("Registered at the master " + mMasterAddress + " from worker " + workerNetAddress + - " , got WorkerId " + ret); + LOG.info("Registered at the master " + mMasterAddress + " from worker " + workerNetAddress + + " , got WorkerId " + ret); return ret; } catch (TTransportException e) { LOG.error(e.getMessage()); diff --git a/src/main/java/tachyon/MasterClientHeartbeatExecutor.java b/src/main/java/tachyon/master/MasterClientHeartbeatExecutor.java similarity index 94% rename from src/main/java/tachyon/MasterClientHeartbeatExecutor.java rename to src/main/java/tachyon/master/MasterClientHeartbeatExecutor.java index f539b998d1e9..5a83d559c714 100644 --- a/src/main/java/tachyon/MasterClientHeartbeatExecutor.java +++ b/src/main/java/tachyon/master/MasterClientHeartbeatExecutor.java @@ -14,10 +14,13 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import org.apache.log4j.Logger; +import tachyon.Constants; +import tachyon.HeartbeatExecutor; + /** * Heartbeat executor for master client. */ diff --git a/src/main/java/tachyon/MasterInfo.java b/src/main/java/tachyon/master/MasterInfo.java similarity index 58% rename from src/main/java/tachyon/MasterInfo.java rename to src/main/java/tachyon/master/MasterInfo.java index 778c5f4efabb..fa798b4d60f2 100644 --- a/src/main/java/tachyon/MasterInfo.java +++ b/src/main/java/tachyon/master/MasterInfo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import java.io.BufferedReader; import java.io.BufferedWriter; @@ -45,17 +45,25 @@ import org.apache.log4j.Logger; +import tachyon.Constants; +import tachyon.HeartbeatExecutor; +import tachyon.HeartbeatThread; +import tachyon.Pair; +import tachyon.PrefixList; +import tachyon.UnderFileSystem; import tachyon.UnderFileSystem.SpaceType; import tachyon.conf.CommonConf; import tachyon.conf.MasterConf; import tachyon.io.Utils; import tachyon.thrift.BlockInfoException; import tachyon.thrift.ClientBlockInfo; +import tachyon.thrift.ClientDependencyInfo; import tachyon.thrift.ClientFileInfo; import tachyon.thrift.ClientRawTableInfo; import tachyon.thrift.ClientWorkerInfo; import tachyon.thrift.Command; import tachyon.thrift.CommandType; +import tachyon.thrift.DependencyDoesNotExistException; import tachyon.thrift.FileAlreadyExistException; import tachyon.thrift.FileDoesNotExistException; import tachyon.thrift.InvalidPathException; @@ -70,39 +78,6 @@ * A global view of filesystem in master. */ public class MasterInfo { - public static final String COL = "COL_"; - - private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); - - private final InetSocketAddress MASTER_ADDRESS; - private final long START_TIME_NS_PREFIX; - private final long START_TIME_MS; - - private final MasterConf MASTER_CONF; - - private CheckpointInfo mCheckpointInfo = new CheckpointInfo(0, 0); - private AtomicInteger mInodeCounter = new AtomicInteger(0); - private AtomicInteger mUserCounter = new AtomicInteger(0); - private AtomicInteger mWorkerCounter = new AtomicInteger(0); - - // Root Inode's id must be 1. - private InodeFolder mRoot; - - private Map mInodes = new HashMap(); - - private Map mWorkers = new HashMap(); - private Map mWorkerAddressToId = new HashMap(); - private BlockingQueue mLostWorkers = new ArrayBlockingQueue(32); - - // TODO Check the logic related to this two lists. - private PrefixList mWhiteList; - private PrefixList mPinList; - private Set mFileIdPinList; - - private Journal mJournal; - - private HeartbeatThread mHeartbeatThread; - /** * Master info periodical status check. */ @@ -114,15 +89,14 @@ public void heartbeat() { Set lostWorkers = new HashSet(); synchronized (mWorkers) { - for (Entry worker: mWorkers.entrySet()) { - if (CommonUtils.getCurrentMs() - worker.getValue().getLastUpdatedTimeMs() - > MASTER_CONF.WORKER_TIMEOUT_MS) { + for (Entry worker : mWorkers.entrySet()) { + if (CommonUtils.getCurrentMs() - worker.getValue().getLastUpdatedTimeMs() > MASTER_CONF.WORKER_TIMEOUT_MS) { LOG.error("The worker " + worker.getValue() + " got timed out!"); mLostWorkers.add(worker.getValue()); lostWorkers.add(worker.getKey()); } } - for (long workerId: lostWorkers) { + for (long workerId : lostWorkers) { MasterWorkerInfo workerInfo = mWorkers.get(workerId); mWorkerAddressToId.remove(workerInfo.getAddress()); mWorkers.remove(workerId); @@ -135,25 +109,41 @@ public void heartbeat() { hadFailedWorker = true; MasterWorkerInfo worker = mLostWorkers.poll(); - // TODO these a lock is not efficient. Since node failure is rare, this is fine for now. + // TODO these two locks are not efficient. Since node failure is rare, + // this is fine for now synchronized (mRoot) { - try { - for (long blockId: worker.getBlocks()) { - int fileId = BlockInfo.computeInodeId(blockId); - InodeFile tFile = (InodeFile) mInodes.get(fileId); - if (tFile != null) { - int blockIndex = BlockInfo.computeBlockIndex(blockId); - tFile.removeLocation(blockIndex, worker.getId()); - if (!tFile.hasCheckpointed() && tFile.getBlockLocations(blockIndex).size() == 0) { - LOG.info("Block " + blockId + " got lost from worker " + worker.getId() + " ."); - } else { - LOG.info("Block " + blockId + " only lost an in memory copy from worker " + - worker.getId()); + synchronized (mDependencies) { + try { + for (long blockId : worker.getBlocks()) { + int fileId = BlockInfo.computeInodeId(blockId); + InodeFile tFile = (InodeFile) mInodes.get(fileId); + if (tFile != null) { + int blockIndex = BlockInfo.computeBlockIndex(blockId); + tFile.removeLocation(blockIndex, worker.getId()); + if (!tFile.hasCheckpointed() && tFile.getBlockLocations(blockIndex).size() == 0) { + LOG.info("Block " + blockId + " got lost from worker " + worker.getId() + " ."); + int depId = tFile.getDependencyId(); + if (depId == -1) { + LOG.error("Permanent Data loss: " + tFile); + } else { + mLostFiles.add(tFile.getId()); + Dependency dep = mDependencies.get(depId); + dep.addLostFile(tFile.getId()); + LOG.info("File " + tFile.getId() + " got lost from worker " + worker.getId() + + " . Trying to recompute it using dependency " + dep.ID); + if (!getPath(tFile).startsWith(MASTER_CONF.TEMPORARY_FOLDER)) { + mMustRecomputeDependencies.add(depId); + } + } + } else { + LOG.info("Block " + blockId + " only lost an in memory copy from worker " + + worker.getId()); + } } } + } catch (BlockInfoException e) { + LOG.error(e); } - } catch (BlockInfoException e) { - LOG.error(e); } } } @@ -161,8 +151,8 @@ public void heartbeat() { if (hadFailedWorker) { LOG.warn("Restarting failed workers."); try { - java.lang.Runtime.getRuntime().exec(CommonConf.get().TACHYON_HOME + - "/bin/tachyon-start.sh restart_workers"); + java.lang.Runtime.getRuntime().exec( + CommonConf.get().TACHYON_HOME + "/bin/tachyon-start.sh restart_workers"); } catch (IOException e) { LOG.error(e.getMessage()); } @@ -170,6 +160,71 @@ public void heartbeat() { } } + public class RecomputationScheduler implements Runnable { + @Override + public void run() { + while (true) { + boolean hasLostFiles = false; + boolean launched = false; + List cmds = new ArrayList(); + synchronized (mRoot) { + synchronized (mDependencies) { + if (!mMustRecomputeDependencies.isEmpty()) { + List recomputeList = new ArrayList(); + Queue checkQueue = new LinkedList(); + + checkQueue.addAll(mMustRecomputeDependencies); + while (!checkQueue.isEmpty()) { + int depId = checkQueue.poll(); + Dependency dep = mDependencies.get(depId); + boolean canLaunch = true; + for (int k = 0; k < dep.PARENT_FILES.size(); k ++) { + int fildId = dep.PARENT_FILES.get(k); + if (mLostFiles.contains(fildId)) { + canLaunch = false; + InodeFile iFile = (InodeFile) mInodes.get(fildId); + if (!mBeingRecomputedFiles.contains(fildId)) { + int tDepId = iFile.getDependencyId(); + if (tDepId != -1 && !mMustRecomputeDependencies.contains(tDepId)) { + mMustRecomputeDependencies.add(tDepId); + checkQueue.add(tDepId); + } + } + } + } + if (canLaunch) { + recomputeList.add(depId); + } + } + hasLostFiles = !mMustRecomputeDependencies.isEmpty(); + launched = (recomputeList.size() > 0); + + for (int k = 0; k < recomputeList.size(); k ++) { + mMustRecomputeDependencies.remove(recomputeList.get(k)); + Dependency dep = mDependencies.get(recomputeList.get(k)); + mBeingRecomputedFiles.addAll(dep.getLostFiles()); + cmds.add(dep.getCommand()); + } + } + } + } + + for (String cmd : cmds) { + String filePath = + CommonConf.get().TACHYON_HOME + "/logs/rerun-" + mRerunCounter.incrementAndGet(); + new Thread(new RecomputeCmd(cmd, filePath)).start(); + } + + if (!launched) { + if (hasLostFiles) { + LOG.info("HasLostFiles, but no job can be launched."); + } + CommonUtils.sleepMs(LOG, 1000); + } + } + } + } + public class RecomputeCmd implements Runnable { private final String CMD; private final String FILE_PATH; @@ -210,6 +265,84 @@ public void run() { } } + public static final String COL = "COL_"; + + /** + * Get the name of the file at a path. + * + * @param path + * The path + * @return the name of the file + */ + private static String getName(String path) throws InvalidPathException { + String[] pathNames = getPathNames(path); + return pathNames[pathNames.length - 1]; + } + + /** + * Get the path components of the given path. + * + * @param path + * The path to split + * @return the path split into components + */ + private static String[] getPathNames(String path) throws InvalidPathException { + CommonUtils.validatePath(path); + if (path.length() == 1 && path.equals(Constants.PATH_SEPARATOR)) { + String[] ret = new String[1]; + ret[0] = ""; + return ret; + } + return path.split(Constants.PATH_SEPARATOR); + } + + private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); + private final InetSocketAddress MASTER_ADDRESS; + private final long START_TIME_NS_PREFIX; + private final long START_TIME_MS; + private final MasterConf MASTER_CONF; + private CheckpointInfo mCheckpointInfo = new CheckpointInfo(0, 0, 0); + + private AtomicInteger mInodeCounter = new AtomicInteger(0); + + private AtomicInteger mDependencyCounter = new AtomicInteger(0); + private AtomicInteger mRerunCounter = new AtomicInteger(0); + + private AtomicInteger mUserCounter = new AtomicInteger(0); + private AtomicInteger mWorkerCounter = new AtomicInteger(0); + // Root Inode's id must be 1. + private InodeFolder mRoot; + // A map from file ID's to Inodes. All operations on it are currently synchronized on mRoot. + private Map mInodes = new HashMap(); + private Map mDependencies = new HashMap(); + + // TODO add initialization part for master failover or restart. + // All operations on these members are synchronized on mDependencies. + private Set mUncheckpointedDependencies = new HashSet(); + private Set mPriorityDependencies = new HashSet(); + private Set mLostFiles = new HashSet(); + + private Set mBeingRecomputedFiles = new HashSet(); + private Set mMustRecomputeDependencies = new HashSet(); + private Map mWorkers = new HashMap(); + + private Map mWorkerAddressToId = new HashMap(); + + private BlockingQueue mLostWorkers = new ArrayBlockingQueue( + 32); + // TODO Check the logic related to this two lists. + private PrefixList mWhiteList; + + private PrefixList mPinList; + + private Set mFileIdPinList; + + private Journal mJournal; + + private HeartbeatThread mHeartbeatThread; + + private Thread mRecomputeThread; + public MasterInfo(InetSocketAddress address, Journal journal) throws IOException { MASTER_CONF = MasterConf.get(); @@ -229,156 +362,67 @@ public MasterInfo(InetSocketAddress address, Journal journal) throws IOException mJournal.loadImage(this); } - public void init() throws IOException { - mCheckpointInfo.updateEditTransactionCounter(mJournal.loadEditLog(this)); - - mJournal.createImage(this); - mJournal.createEditLog(mCheckpointInfo.getEditTransactionCounter()); - - mHeartbeatThread = new HeartbeatThread("Master Heartbeat", - new MasterInfoHeartbeatExecutor(), MASTER_CONF.HEARTBEAT_INTERVAL_MS); - mHeartbeatThread.start(); - } - - /** - * Add a checkpoint to a file. - * @param workerId The worker which submitted the request. -1 if the request is not from a worker. - * @param fileId The file to add the checkpoint. - * @param length The length of the checkpoint. - * @param checkpointPath The path of the checkpoint. - * @return true if the checkpoint is added successfully, false if not. - * @throws FileNotFoundException - * @throws SuspectedFileSizeException - * @throws BlockInfoException - */ - public boolean addCheckpoint(long workerId, int fileId, long length, String checkpointPath) - throws FileNotFoundException, SuspectedFileSizeException, BlockInfoException { - LOG.info(CommonUtils.parametersToString(workerId, fileId, length, checkpointPath)); - - if (workerId != -1) { - MasterWorkerInfo tWorkerInfo = getWorkerInfo(workerId); - tWorkerInfo.updateLastUpdatedTimeMs(); - } - + int + _createDependency(List parentsIdList, List childrenIdList, + String commandPrefix, List data, String comment, String framework, + String frameworkVersion, DependencyType dependencyType, int dependencyId, + long creationTimeMs) throws InvalidPathException, FileDoesNotExistException { + Dependency dep = null; synchronized (mRoot) { - Inode inode = mInodes.get(fileId); - - if (inode == null) { - throw new FileNotFoundException("File " + fileId + " does not exist."); - } - if (inode.isDirectory()) { - throw new FileNotFoundException("File " + fileId + " is a folder."); - } - - InodeFile tFile = (InodeFile) inode; - boolean needLog = false; - - if (tFile.isComplete()) { - if (tFile.getLength() != length) { - throw new SuspectedFileSizeException(fileId + ". Original Size: " + - tFile.getLength() + ". New Size: " + length); + Set parentDependencyIds = new HashSet(); + for (int k = 0; k < parentsIdList.size(); k ++) { + int parentId = parentsIdList.get(k); + Inode inode = mInodes.get(parentId); + if (inode.isFile()) { + LOG.info("PARENT DEPENDENCY ID IS " + ((InodeFile) inode).getDependencyId() + " " + + (inode)); + if (((InodeFile) inode).getDependencyId() != -1) { + parentDependencyIds.add(((InodeFile) inode).getDependencyId()); + } + } else { + throw new InvalidPathException("Parent " + parentId + " is not a file."); } - } else { - tFile.setLength(length); - needLog = true; - } - - if (!tFile.hasCheckpointed()) { - tFile.setCheckpointPath(checkpointPath); - needLog = true; - } - - tFile.setComplete(); - - if (needLog) { - mJournal.getEditLog().addCheckpoint(fileId, length, checkpointPath); - mJournal.getEditLog().flush(); } - return true; - } - } - - /** - * A worker cache a block in its memory. - * - * @param workerId - * @param workerUsedBytes - * @param blockId - * @param length - * @throws FileDoesNotExistException - * @throws SuspectedFileSizeException - * @throws BlockInfoException - */ - public void cacheBlock(long workerId, long workerUsedBytes, long blockId, long length) - throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException { - LOG.debug(CommonUtils.parametersToString(workerId, workerUsedBytes, blockId, length)); - - MasterWorkerInfo tWorkerInfo = getWorkerInfo(workerId); - tWorkerInfo.updateBlock(true, blockId); - tWorkerInfo.updateUsedBytes(workerUsedBytes); - tWorkerInfo.updateLastUpdatedTimeMs(); - int fileId = BlockInfo.computeInodeId(blockId); - int blockIndex = BlockInfo.computeBlockIndex(blockId); - synchronized (mRoot) { - Inode inode = mInodes.get(fileId); - - if (inode == null) { - throw new FileDoesNotExistException("File " + fileId + " does not exist."); - } - if (inode.isDirectory()) { - throw new FileDoesNotExistException("File " + fileId + " is a folder."); - } + dep = + new Dependency(dependencyId, parentsIdList, childrenIdList, commandPrefix, data, + comment, framework, frameworkVersion, dependencyType, parentDependencyIds, + creationTimeMs); - InodeFile tFile = (InodeFile) inode; - if (tFile.getNumberOfBlocks() <= blockIndex) { - addBlock(tFile, new BlockInfo(tFile, blockIndex, length)); + List childrenInodeList = new ArrayList(); + for (int k = 0; k < childrenIdList.size(); k ++) { + InodeFile inode = (InodeFile) mInodes.get(childrenIdList.get(k)); + inode.setDependencyId(dep.ID); + childrenInodeList.add(inode); + if (inode.hasCheckpointed()) { + dep.childCheckpointed(inode.getId()); + } } - - InetSocketAddress address = tWorkerInfo.ADDRESS; - tFile.addLocation(blockIndex, workerId, - new NetAddress(address.getHostName(), address.getPort())); } - } - - /** - * Called by edit log only. - * @param fileId - * @param blockIndex - * @param blockLength - * @throws FileDoesNotExistException - * @throws BlockInfoException - */ - void opAddBlock(int fileId, int blockIndex, long blockLength) - throws FileDoesNotExistException, BlockInfoException { - synchronized (mRoot) { - Inode inode = mInodes.get(fileId); - if (inode == null) { - throw new FileDoesNotExistException("File " + fileId + " does not exist."); + synchronized (mDependencies) { + mDependencies.put(dep.ID, dep); + if (!dep.hasCheckpointed()) { + mUncheckpointedDependencies.add(dep.ID); } - if (inode.isDirectory()) { - throw new FileDoesNotExistException("File " + fileId + " is a folder."); + for (int parentDependencyId : dep.PARENT_DEPENDENCIES) { + mDependencies.get(parentDependencyId).addChildrenDependency(dep.ID); } - - addBlock((InodeFile) inode, new BlockInfo((InodeFile) inode, blockIndex, blockLength)); } - } - private void addBlock(InodeFile tFile, BlockInfo blockInfo) throws BlockInfoException { - tFile.addBlock(blockInfo); - mJournal.getEditLog().addBlock(tFile.getId(), blockInfo.BLOCK_INDEX, blockInfo.LENGTH); + mJournal.getEditLog().createDependency(parentsIdList, childrenIdList, commandPrefix, data, + comment, framework, frameworkVersion, dependencyType, dependencyId, creationTimeMs); mJournal.getEditLog().flush(); - } - public int createFile(String path, long blockSizeByte) - throws FileAlreadyExistException, InvalidPathException, BlockInfoException, TachyonException { - return createFile(true, path, false, -1, null, blockSizeByte); + LOG.info("Dependency created: " + dep); + + return dep.ID; } // TODO Make this API better. /** * Internal API. + * * @param recursive * @param path * @param directory @@ -394,8 +438,7 @@ public int createFile(String path, long blockSizeByte) */ int _createFile(boolean recursive, String path, boolean directory, int columns, ByteBuffer metadata, long blockSizeByte, long creationTimeMs) - throws FileAlreadyExistException, InvalidPathException, BlockInfoException, - TachyonException { + throws FileAlreadyExistException, InvalidPathException, BlockInfoException, TachyonException { if (!directory && blockSizeByte < 1) { throw new BlockInfoException("Invalid block size " + blockSizeByte); } @@ -428,33 +471,35 @@ int _createFile(boolean recursive, String path, boolean directory, int columns, succeed = createFile(true, folderPath, true, -1, null, blockSizeByte); } if (!recursive || succeed <= 0) { - LOG.info("InvalidPathException: File " + path + " creation failed. Folder " - + folderPath + " does not exist."); - throw new InvalidPathException("InvalidPathException: File " + path + " creation " + - "failed. Folder " + folderPath + " does not exist."); + LOG.info("InvalidPathException: File " + path + " creation failed. Folder " + folderPath + + " does not exist."); + throw new InvalidPathException("InvalidPathException: File " + path + " creation " + + "failed. Folder " + folderPath + " does not exist."); } else { inode = mInodes.get(succeed); } } else if (inode.isFile()) { - LOG.info("InvalidPathException: File " + path + " creation failed. " - + folderPath + " is a file."); - throw new InvalidPathException("File " + path + " creation failed. " - + folderPath + " is a file"); + LOG.info("InvalidPathException: File " + path + " creation failed. " + folderPath + + " is a file."); + throw new InvalidPathException("File " + path + " creation failed. " + folderPath + + " is a file"); } Inode ret = null; if (directory) { if (columns != -1) { - ret = new InodeRawTable(name, mInodeCounter.incrementAndGet(), inode.getId(), - columns, metadata, creationTimeMs); + ret = + new InodeRawTable(name, mInodeCounter.incrementAndGet(), inode.getId(), columns, + metadata, creationTimeMs); } else { - ret = new InodeFolder( - name, mInodeCounter.incrementAndGet(), inode.getId(), creationTimeMs); + ret = + new InodeFolder(name, mInodeCounter.incrementAndGet(), inode.getId(), creationTimeMs); } } else { - ret = new InodeFile( - name, mInodeCounter.incrementAndGet(), inode.getId(), blockSizeByte, creationTimeMs); + ret = + new InodeFile(name, mInodeCounter.incrementAndGet(), inode.getId(), blockSizeByte, + creationTimeMs); String curPath = getPath(ret); if (mPinList.inList(curPath)) { synchronized (mFileIdPinList) { @@ -475,40 +520,307 @@ int _createFile(boolean recursive, String path, boolean directory, int columns, } } - /** - * Create a file. - * // TODO Make this API better. - * @param recursive - * @param path - * @param directory - * @param columns - * @param metadata - * @param blockSizeByte - * @return - * @throws FileAlreadyExistException - * @throws InvalidPathException - * @throws BlockInfoException - * @throws TachyonException - */ - public int createFile(boolean recursive, String path, boolean directory, int columns, - ByteBuffer metadata, long blockSizeByte) - throws FileAlreadyExistException, InvalidPathException, BlockInfoException, - TachyonException { - long creationTimeMs = System.currentTimeMillis(); + private boolean _delete(int fileId, boolean recursive) throws TachyonException { + LOG.info("delete(" + fileId + ")"); + boolean succeed = true; synchronized (mRoot) { - int ret = - _createFile(recursive, path, directory, columns, metadata, blockSizeByte, creationTimeMs); - mJournal.getEditLog().createFile( - recursive, path, directory, columns, metadata, blockSizeByte, creationTimeMs); - mJournal.getEditLog().flush(); - return ret; - } - } + Inode inode = mInodes.get(fileId); - public void createImage(DataOutputStream os) throws IOException { + if (inode == null) { + return true; + } + + if (inode.isDirectory()) { + List childrenIds = ((InodeFolder) inode).getChildrenIds(); + + if (!recursive && childrenIds.size() != 0) { + return false; + } + for (int childId : childrenIds) { + succeed = succeed && delete(childId, recursive); + } + } + + InodeFolder parent = (InodeFolder) mInodes.get(inode.getParentId()); + parent.removeChild(inode.getId()); + mInodes.remove(inode.getId()); + if (inode.isFile()) { + String checkpointPath = ((InodeFile) inode).getCheckpointPath(); + if (!checkpointPath.equals("")) { + UnderFileSystem ufs = UnderFileSystem.get(checkpointPath); + + try { + if (!ufs.delete(checkpointPath, true)) { + return false; + } + } catch (IOException e) { + throw new TachyonException(e.getMessage()); + } + } + + List> blockIdWorkerIdList = ((InodeFile) inode).getBlockIdWorkerIdPairs(); + synchronized (mWorkers) { + for (Pair blockIdWorkerId : blockIdWorkerIdList) { + MasterWorkerInfo workerInfo = mWorkers.get(blockIdWorkerId.getSecond()); + if (workerInfo != null) { + workerInfo.updateToRemovedBlock(true, blockIdWorkerId.getFirst()); + } + } + } + + if (((InodeFile) inode).isPin()) { + synchronized (mFileIdPinList) { + mFileIdPinList.remove(inode.getId()); + } + } + } + inode.reverseId(); + + return succeed; + } + } + + private void addBlock(InodeFile tFile, BlockInfo blockInfo) throws BlockInfoException { + tFile.addBlock(blockInfo); + mJournal.getEditLog().addBlock(tFile.getId(), blockInfo.BLOCK_INDEX, blockInfo.LENGTH); + mJournal.getEditLog().flush(); + } + + /** + * Add a checkpoint to a file. + * + * @param workerId + * The worker which submitted the request. -1 if the request is not from a worker. + * @param fileId + * The file to add the checkpoint. + * @param length + * The length of the checkpoint. + * @param checkpointPath + * The path of the checkpoint. + * @return true if the checkpoint is added successfully, false if not. + * @throws FileNotFoundException + * @throws SuspectedFileSizeException + * @throws BlockInfoException + */ + public boolean addCheckpoint(long workerId, int fileId, long length, String checkpointPath) + throws FileNotFoundException, SuspectedFileSizeException, BlockInfoException { + LOG.info(CommonUtils.parametersToString(workerId, fileId, length, checkpointPath)); + + if (workerId != -1) { + MasterWorkerInfo tWorkerInfo = getWorkerInfo(workerId); + tWorkerInfo.updateLastUpdatedTimeMs(); + } + + synchronized (mRoot) { + Inode inode = mInodes.get(fileId); + + if (inode == null) { + throw new FileNotFoundException("File " + fileId + " does not exist."); + } + if (inode.isDirectory()) { + throw new FileNotFoundException("File " + fileId + " is a folder."); + } + + InodeFile tFile = (InodeFile) inode; + boolean needLog = false; + + if (tFile.isComplete()) { + if (tFile.getLength() != length) { + throw new SuspectedFileSizeException(fileId + ". Original Size: " + tFile.getLength() + + ". New Size: " + length); + } + } else { + tFile.setLength(length); + needLog = true; + } + + if (!tFile.hasCheckpointed()) { + tFile.setCheckpointPath(checkpointPath); + needLog = true; + + synchronized (mDependencies) { + int depId = tFile.getDependencyId(); + if (depId != -1) { + Dependency dep = mDependencies.get(depId); + dep.childCheckpointed(tFile.getId()); + if (dep.hasCheckpointed()) { + mUncheckpointedDependencies.remove(dep.ID); + mPriorityDependencies.remove(dep.ID); + } + } + } + } + addFile(fileId, tFile.getDependencyId()); + tFile.setComplete(); + + if (needLog) { + mJournal.getEditLog().addCheckpoint(fileId, length, checkpointPath); + mJournal.getEditLog().flush(); + } + return true; + } + } + + /** + * Removes a checkpointed file from the set of lost or being-recomputed files if it's there + * + * @param fileId + * The file to examine + */ + private void addFile(int fileId, int dependencyId) { + synchronized (mDependencies) { + if (mLostFiles.contains(fileId)) { + mLostFiles.remove(fileId); + } + if (mBeingRecomputedFiles.contains(fileId)) { + mBeingRecomputedFiles.remove(fileId); + } + } + } + + /** + * A worker cache a block in its memory. + * + * @param workerId + * @param workerUsedBytes + * @param blockId + * @param length + * @return the dependency id of the file if it has not been checkpointed. -1 + * means the file either does not have dependency or has already been checkpointed. + * @throws FileDoesNotExistException + * @throws SuspectedFileSizeException + * @throws BlockInfoException + */ + public int cacheBlock(long workerId, long workerUsedBytes, long blockId, long length) + throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException { + LOG.debug(CommonUtils.parametersToString(workerId, workerUsedBytes, blockId, length)); + + MasterWorkerInfo tWorkerInfo = getWorkerInfo(workerId); + tWorkerInfo.updateBlock(true, blockId); + tWorkerInfo.updateUsedBytes(workerUsedBytes); + tWorkerInfo.updateLastUpdatedTimeMs(); + + int fileId = BlockInfo.computeInodeId(blockId); + int blockIndex = BlockInfo.computeBlockIndex(blockId); + synchronized (mRoot) { + Inode inode = mInodes.get(fileId); + + if (inode == null) { + throw new FileDoesNotExistException("File " + fileId + " does not exist."); + } + if (inode.isDirectory()) { + throw new FileDoesNotExistException("File " + fileId + " is a folder."); + } + + InodeFile tFile = (InodeFile) inode; + if (tFile.getNumberOfBlocks() <= blockIndex) { + addBlock(tFile, new BlockInfo(tFile, blockIndex, length)); + } + + InetSocketAddress address = tWorkerInfo.ADDRESS; + tFile.addLocation(blockIndex, workerId, + new NetAddress(address.getHostName(), address.getPort())); + + if (tFile.hasCheckpointed()) { + return -1; + } else { + return tFile.getDependencyId(); + } + } + } + + /** + * Completes the checkpointing of a file. + * + * @param fileId + * The id of the file + */ + public void completeFile(int fileId) throws FileDoesNotExistException { + synchronized (mRoot) { + Inode inode = mInodes.get(fileId); + + if (inode == null) { + throw new FileDoesNotExistException("File " + fileId + " does not exit."); + } + if (!inode.isFile()) { + throw new FileDoesNotExistException("File " + fileId + " is not a file."); + } + + addFile(fileId, ((InodeFile) inode).getDependencyId()); + + ((InodeFile) inode).setComplete(); + mJournal.getEditLog().completeFile(fileId); + mJournal.getEditLog().flush(); + } + } + + public int createDependency(List parents, List children, String commandPrefix, + List data, String comment, String framework, String frameworkVersion, + DependencyType dependencyType) throws InvalidPathException, FileDoesNotExistException { + synchronized (mRoot) { + LOG.info("ParentList: " + CommonUtils.listToString(parents)); + List parentsIdList = getFilesIds(parents); + List childrenIdList = getFilesIds(children); + + int depId = mDependencyCounter.incrementAndGet(); + long creationTimeMs = System.currentTimeMillis(); + int ret = + _createDependency(parentsIdList, childrenIdList, commandPrefix, data, comment, + framework, frameworkVersion, dependencyType, depId, creationTimeMs); + + return ret; + } + } + + /** + * Create a file. // TODO Make this API better. + * + * @param recursive + * @param path + * @param directory + * @param columns + * @param metadata + * @param blockSizeByte + * @param creationTimeMs + * @return + * @throws FileAlreadyExistException + * @throws InvalidPathException + * @throws BlockInfoException + * @throws TachyonException + */ + public int createFile(boolean recursive, String path, boolean directory, int columns, + ByteBuffer metadata, long blockSizeByte) throws FileAlreadyExistException, + InvalidPathException, BlockInfoException, TachyonException { + long creationTimeMs = System.currentTimeMillis(); + synchronized (mRoot) { + int ret = + _createFile(recursive, path, directory, columns, metadata, blockSizeByte, creationTimeMs); + mJournal.getEditLog().createFile(recursive, path, directory, columns, metadata, + blockSizeByte, creationTimeMs); + mJournal.getEditLog().flush(); + return ret; + } + } + + public int createFile(String path, long blockSizeByte) throws FileAlreadyExistException, + InvalidPathException, BlockInfoException, TachyonException { + return createFile(true, path, false, -1, null, blockSizeByte); + } + + /** + * Create an image of the dependencies and filesystem tree. + * + * @param os + * The output stream to write the image to + */ + public void createImage(DataOutputStream os) throws IOException { Queue nodesQueue = new LinkedList(); synchronized (mRoot) { + for (Dependency dep : mDependencies.values()) { + createImageDependencyWriter(dep, os); + } + createImageInodeWriter(mRoot, os); nodesQueue.add(mRoot); while (!nodesQueue.isEmpty()) { @@ -531,98 +843,42 @@ public void createImage(DataOutputStream os) throws IOException { os.writeByte(Image.T_CHECKPOINT); os.writeInt(mInodeCounter.get()); os.writeLong(mCheckpointInfo.getEditTransactionCounter()); + os.writeInt(mCheckpointInfo.getDependencyCounter()); } } /** - * Load the image from is. Assume this blocks the whole MasterInfo. - * @param is the inputstream to load the image. - * @throws IOException + * Writes a dependency to the image. + * + * @param dep + * The dependency to write + * @param os + * The output stream to write the dependency to */ - public void loadImage(DataInputStream is) throws IOException { - while (true) { - byte type = -1; - try { - type = is.readByte(); - } catch (EOFException e) { - return; - } - - if (type == Image.T_CHECKPOINT) { - mInodeCounter.set(is.readInt()); - mCheckpointInfo.updateEditTransactionCounter(is.readLong()); - } else { - if (type > Image.T_INODE_RAW_TABLE) { - throw new IOException("Corrupted image with unknown element type: " + type); - } - - long creationTimeMs = is.readLong(); - int fileId = is.readInt(); - String fileName = Utils.readString(is); - int parentId = is.readInt(); - - Inode inode = null; - - if (type == Image.T_INODE_FILE) { - long blockSizeByte = is.readLong(); - long length = is.readLong(); - boolean isComplete = is.readBoolean(); - boolean isPin = is.readBoolean(); - boolean isCache = is.readBoolean(); - String checkpointPath = Utils.readString(is); - - InodeFile tInode = - new InodeFile(fileName, fileId, parentId, blockSizeByte, creationTimeMs); - - try { - tInode.setLength(length); - } catch (Exception e) { - throw new IOException(e); - } - tInode.setComplete(isComplete); - tInode.setPin(isPin); - tInode.setCache(isCache); - tInode.setCheckpointPath(checkpointPath); - inode = tInode; - } else { - int numberOfChildren = is.readInt(); - int[] children = new int[numberOfChildren]; - for (int k = 0; k < numberOfChildren; k ++) { - children[k] = is.readInt(); - } - - if (type == Image.T_INODE_FOLDER) { - InodeFolder folder = new InodeFolder(fileName, fileId, parentId, creationTimeMs); - folder.addChildren(children); - inode = folder; - } else { - int columns = is.readInt(); - ByteBuffer metadata = Utils.readByteBuffer(is); - - try { - InodeRawTable table = new InodeRawTable( - fileName, fileId, parentId, columns, metadata, creationTimeMs); - table.addChildren(children); - inode = table; - } catch (TachyonException e) { - throw new IOException(e); - } - } - } - - LOG.info("Putting " + inode); - if (inode.getId() > mInodeCounter.get()) { - mInodeCounter.set(inode.getId()); - } - - if (inode.getId() == 1) { - mRoot = (InodeFolder) inode; - } - mInodes.put(inode.getId(), inode); - } - } + private void createImageDependencyWriter(Dependency dep, DataOutputStream os) throws IOException { + os.writeByte(Image.T_DEPENDENCY); + os.writeInt(dep.ID); + Utils.writeIntegerList(dep.PARENT_FILES, os); + Utils.writeIntegerList(dep.CHILDREN_FILES, os); + Utils.writeString(dep.COMMAND_PREFIX, os); + Utils.writeByteBufferList(dep.DATA, os); + Utils.writeString(dep.COMMENT, os); + Utils.writeString(dep.FRAMEWORK, os); + Utils.writeString(dep.FRAMEWORK_VERSION, os); + os.writeInt(dep.TYPE.getValue()); + Utils.writeIntegerList(dep.PARENT_DEPENDENCIES, os); + os.writeLong(dep.CREATION_TIME_MS); + Utils.writeIntegerList(dep.getUncheckpointedChildrenFiles(), os); } + /** + * Writes an inode to the image. + * + * @param inode + * The inode to write + * @param os + * The output stream to write the inode to + */ private void createImageInodeWriter(Inode inode, DataOutputStream os) throws IOException { if (inode.isFile()) { InodeFile file = (InodeFile) inode; @@ -638,6 +894,7 @@ private void createImageInodeWriter(Inode inode, DataOutputStream os) throws IOE os.writeBoolean(file.isPin()); os.writeBoolean(file.isCache()); Utils.writeString(file.getCheckpointPath(), os); + os.writeInt(file.getDependencyId()); } else { InodeFolder folder = (InodeFolder) inode; if (folder.isRawTable()) { @@ -665,6 +922,12 @@ private void createImageInodeWriter(Inode inode, DataOutputStream os) throws IOE } } + /** + * Creates a new block for the given file. + * + * @param fileId + * The id of the file + */ public long createNewBlock(int fileId) throws FileDoesNotExistException { synchronized (mRoot) { Inode inode = mInodes.get(fileId); @@ -673,118 +936,55 @@ public long createNewBlock(int fileId) throws FileDoesNotExistException { throw new FileDoesNotExistException("File " + fileId + " does not exit."); } if (!inode.isFile()) { - throw new FileDoesNotExistException("File " + fileId + " is not a file."); - } - - return ((InodeFile) inode).getNewBlockId(); - } - } - - public void completeFile(int fileId) throws FileDoesNotExistException { - synchronized (mRoot) { - Inode inode = mInodes.get(fileId); - - if (inode == null) { - throw new FileDoesNotExistException("File " + fileId + " does not exit."); - } - if (!inode.isFile()) { - throw new FileDoesNotExistException("File " + fileId + " is not a file."); - } - - ((InodeFile) inode).setComplete(); - mJournal.getEditLog().completeFile(fileId); - mJournal.getEditLog().flush(); - } - } - - public int createRawTable(String path, int columns, ByteBuffer metadata) - throws FileAlreadyExistException, InvalidPathException, TableColumnException, - TachyonException { - LOG.info("createRawTable" + CommonUtils.parametersToString(path, columns)); - - if (columns <= 0 || columns >= Constants.MAX_COLUMNS) { - throw new TableColumnException("Column " + columns + " should between 0 to " + - Constants.MAX_COLUMNS); - } - - int id; - try { - id = createFile(true, path, true, columns, metadata, 0); - } catch (BlockInfoException e) { - throw new FileAlreadyExistException(e.getMessage()); - } - - for (int k = 0; k < columns; k ++) { - mkdir(path + Constants.PATH_SEPARATOR + COL + k); - } - - return id; - } - - private boolean _delete(int fileId, boolean recursive) throws TachyonException { - LOG.info("delete(" + fileId + ")"); - boolean succeed = true; - synchronized (mRoot) { - Inode inode = mInodes.get(fileId); - - if (inode == null) { - return true; - } - - if (inode.isDirectory()) { - List childrenIds = ((InodeFolder) inode).getChildrenIds(); - - if (!recursive && childrenIds.size() != 0) { - return false; - } - for (int childId : childrenIds) { - succeed = succeed && delete(childId, recursive); - } + throw new FileDoesNotExistException("File " + fileId + " is not a file."); } - InodeFolder parent = (InodeFolder) mInodes.get(inode.getParentId()); - parent.removeChild(inode.getId()); - mInodes.remove(inode.getId()); - if (inode.isFile()) { - String checkpointPath = ((InodeFile) inode).getCheckpointPath(); - if (!checkpointPath.equals("")) { - UnderFileSystem ufs = UnderFileSystem.get(checkpointPath); + return ((InodeFile) inode).getNewBlockId(); + } + } - try { - if (!ufs.delete(checkpointPath, true)) { - return false; - } - } catch (IOException e) { - throw new TachyonException(e.getMessage()); - } - } + /** + * Creates a raw table. + * + * @param path + * The path to place the table at + * @param columns + * The number of columns in the table + * @param metadata + * Additional metadata about the table + * @return the file id of the table + */ + public int createRawTable(String path, int columns, ByteBuffer metadata) + throws FileAlreadyExistException, InvalidPathException, TableColumnException, + TachyonException { + LOG.info("createRawTable" + CommonUtils.parametersToString(path, columns)); - List> blockIdWorkerIdList = ((InodeFile) inode).getBlockIdWorkerIdPairs(); - synchronized (mWorkers) { - for (Pair blockIdWorkerId: blockIdWorkerIdList) { - MasterWorkerInfo workerInfo = mWorkers.get(blockIdWorkerId.getSecond()); - if (workerInfo != null) { - workerInfo.updateToRemovedBlock(true, blockIdWorkerId.getFirst()); - } - } - } + if (columns <= 0 || columns >= CommonConf.get().MAX_COLUMNS) { + throw new TableColumnException("Column " + columns + " should between 0 to " + + CommonConf.get().MAX_COLUMNS); + } - if (((InodeFile) inode).isPin()) { - synchronized (mFileIdPinList) { - mFileIdPinList.remove(inode.getId()); - } - } - } - inode.reverseId(); + int id; + try { + id = createFile(true, path, true, columns, metadata, 0); + } catch (BlockInfoException e) { + throw new FileAlreadyExistException(e.getMessage()); + } - return succeed; + for (int k = 0; k < columns; k ++) { + mkdir(path + Constants.PATH_SEPARATOR + COL + k); } + + return id; } /** * Delete a file based on the file's ID. - * @param fileId the file to be deleted. - * @param recursive whether delete the file recursively or not. + * + * @param fileId + * the file to be deleted. + * @param recursive + * whether delete the file recursively or not. * @return succeed or not * @throws TachyonException */ @@ -799,8 +999,11 @@ public boolean delete(int fileId, boolean recursive) throws TachyonException { /** * Delete a file based on the file's path. - * @param path The file to be deleted. - * @param recursive whether delete the file recursively or not. + * + * @param path + * The file to be deleted. + * @param recursive + * whether delete the file recursively or not. * @return succeed or not * @throws TachyonException */ @@ -834,8 +1037,31 @@ public long getBlockIdBasedOnOffset(int fileId, long offset) throws FileDoesNotE } } + /** + * Get the list of blocks of an InodeFile determined by path. + * + * @param path + * The file. + * @return The list of the blocks of the file. + * @throws InvalidPathException + * @throws FileDoesNotExistException + */ + public List getBlockList(String path) throws InvalidPathException, + FileDoesNotExistException { + Inode inode = getInode(path); + if (inode == null) { + throw new FileDoesNotExistException(path + " does not exist."); + } + if (!inode.isFile()) { + throw new FileDoesNotExistException(path + " is not a file."); + } + InodeFile inodeFile = (InodeFile) inode; + return inodeFile.getBlockList(); + } + /** * Get the capacity of the whole system. + * * @return the system's capacity in bytes. */ public long getCapacityBytes() { @@ -848,8 +1074,15 @@ public long getCapacityBytes() { return ret; } - public ClientBlockInfo getClientBlockInfo(long blockId) - throws FileDoesNotExistException, IOException, BlockInfoException { + /** + * Get the block info associated with the given id. + * + * @param blockId + * The id of the block return + * @return the block info + */ + public ClientBlockInfo getClientBlockInfo(long blockId) throws FileDoesNotExistException, + IOException, BlockInfoException { int fileId = BlockInfo.computeInodeId(blockId); synchronized (mRoot) { Inode inode = mInodes.get(fileId); @@ -863,6 +1096,32 @@ public ClientBlockInfo getClientBlockInfo(long blockId) } } + /** + * Get the dependency info associated with the given id. + * + * @param dependencyId + * The id of the dependency + * @return the dependency info + */ + public ClientDependencyInfo getClientDependencyInfo(int dependencyId) + throws DependencyDoesNotExistException { + Dependency dep = null; + synchronized (mDependencies) { + dep = mDependencies.get(dependencyId); + if (dep == null) { + throw new DependencyDoesNotExistException("No dependency with id " + dependencyId); + } + } + return dep.generateClientDependencyInfo(); + } + + /** + * Get the file info associated with the given id. + * + * @param fid + * The id of the file + * @return the file info + */ public ClientFileInfo getClientFileInfo(int fid) throws FileDoesNotExistException { synchronized (mRoot) { Inode inode = mInodes.get(fid); @@ -871,13 +1130,20 @@ public ClientFileInfo getClientFileInfo(int fid) throws FileDoesNotExistExceptio } ClientFileInfo ret = inode.generateClientFileInfo(getPath(inode)); - LOG.debug("getClientFileInfo(" + fid + "): " + ret); + LOG.debug("getClientFileInfo(" + fid + "): " + ret); return ret; } } - public ClientFileInfo getClientFileInfo(String path) - throws FileDoesNotExistException, InvalidPathException { + /** + * Get the file info for the file at the given path + * + * @param path + * The path of the file + * @return the file info + */ + public ClientFileInfo getClientFileInfo(String path) throws FileDoesNotExistException, + InvalidPathException { LOG.info("getClientFileInfo(" + path + ")"); synchronized (mRoot) { Inode inode = getInode(path); @@ -888,6 +1154,13 @@ public ClientFileInfo getClientFileInfo(String path) } } + /** + * Get the raw table info associated with the given id. + * + * @param id + * The id of the table + * @return the table info + */ public ClientRawTableInfo getClientRawTableInfo(int id) throws TableDoesNotExistException { LOG.info("getClientRawTableInfo(" + id + ")"); synchronized (mRoot) { @@ -905,8 +1178,15 @@ public ClientRawTableInfo getClientRawTableInfo(int id) throws TableDoesNotExist } } - public ClientRawTableInfo getClientRawTableInfo(String path) - throws TableDoesNotExistException, InvalidPathException { + /** + * Get the raw table info for the table at the given path + * + * @param path + * The path of the table + * @return the table info + */ + public ClientRawTableInfo getClientRawTableInfo(String path) throws TableDoesNotExistException, + InvalidPathException { LOG.info("getClientRawTableInfo(" + path + ")"); synchronized (mRoot) { Inode inode = getInode(path); @@ -918,15 +1198,111 @@ public ClientRawTableInfo getClientRawTableInfo(String path) } /** - * If the path is a directory, return all the direct entries in it. If the - * path is a file, return its ClientFileInfo. - * @param path the target directory/file path + * Get the file id of the file. + * + * @param path + * The path of the file + * @return The file id of the file. -1 if the file does not exist. + * @throws InvalidPathException + */ + public int getFileId(String path) throws InvalidPathException { + LOG.debug("getFileId(" + path + ")"); + Inode inode = getInode(path); + int ret = -1; + if (inode != null) { + ret = inode.getId(); + } + LOG.debug("getFileId(" + path + "): " + ret); + return ret; + } + + /** + * Get the block infos of a file with the given id. Throws an exception if the id names a + * directory. + * + * @param fileId + * The id of the file to look up + * @return the block infos of the file + */ + public List getFileLocations(int fileId) throws FileDoesNotExistException, + IOException { + synchronized (mRoot) { + Inode inode = mInodes.get(fileId); + if (inode == null || inode.isDirectory()) { + throw new FileDoesNotExistException("FileId " + fileId + " does not exist."); + } + List ret = ((InodeFile) inode).getClientBlockInfos(); + LOG.debug("getFileLocations: " + fileId + ret); + return ret; + } + } + + /** + * Get the block infos of a file with the given path. Throws an exception if the path names a + * directory. + * + * @param path + * The path of the file to look up + * @return the block infos of the file + */ + public List getFileLocations(String path) throws FileDoesNotExistException, + InvalidPathException, IOException { + LOG.info("getFileLocations: " + path); + synchronized (mRoot) { + Inode inode = getInode(path); + if (inode == null) { + throw new FileDoesNotExistException(path); + } + return getFileLocations(inode.getId()); + } + } + + /** + * Get the path of a file with the given id + * + * @param fileId + * The id of the file to look up + * @return the path of the file + */ + public String getFileNameById(int fileId) throws FileDoesNotExistException { + synchronized (mRoot) { + Inode inode = mInodes.get(fileId); + if (inode == null) { + throw new FileDoesNotExistException("FileId " + fileId + " does not exist"); + } + return getPath(inode); + } + } + + /** + * Get the file id's of the given paths. It recursively scans directories for the file id's inside + * of them. + * + * @param pathList + * The list of paths to look at + * @return the file id's of the files. + */ + private List getFilesIds(List pathList) throws InvalidPathException, + FileDoesNotExistException { + List ret = new ArrayList(pathList.size()); + for (int k = 0; k < pathList.size(); k ++) { + ret.addAll(listFiles(pathList.get(k), true)); + } + return ret; + } + + /** + * If the path is a directory, return all the direct entries in + * it. If the path is a file, return its ClientFileInfo. + * + * @param path + * the target directory/file path * @return A list of ClientFileInfo * @throws FileDoesNotExistException * @throws InvalidPathException */ - public List getFilesInfo(String path) - throws FileDoesNotExistException, InvalidPathException { + public List getFilesInfo(String path) throws FileDoesNotExistException, + InvalidPathException { List ret = new ArrayList(); Inode inode = getInode(path); @@ -953,62 +1329,55 @@ public List getFilesInfo(String path) return ret; } - public String getFileNameById(int fileId) throws FileDoesNotExistException { - synchronized (mRoot) { - Inode inode = mInodes.get(fileId); - if (inode == null) { - throw new FileDoesNotExistException("FileId " + fileId + " does not exist"); - } - return getPath(inode); - } - } - - public List getFileLocations(int fileId) - throws FileDoesNotExistException, IOException { + /** + * Get absolute paths of all in memory files. + * + * @return absolute paths of all in memory files. + */ + public List getInMemoryFiles() { + List ret = new ArrayList(); + LOG.info("getInMemoryFiles()"); + Queue> nodesQueue = new LinkedList>(); synchronized (mRoot) { - Inode inode = mInodes.get(fileId); - if (inode == null || inode.isDirectory()) { - throw new FileDoesNotExistException("FileId " + fileId + " does not exist."); - } - List ret = ((InodeFile) inode).getClientBlockInfos(); - LOG.debug("getFileLocations: " + fileId + ret); - return ret; - } - } + nodesQueue.add(new Pair(mRoot, "")); + while (!nodesQueue.isEmpty()) { + Pair tPair = nodesQueue.poll(); + InodeFolder tFolder = tPair.getFirst(); + String curPath = tPair.getSecond(); - public List getFileLocations(String path) - throws FileDoesNotExistException, InvalidPathException, IOException { - LOG.info("getFileLocations: " + path); - synchronized (mRoot) { - Inode inode = getInode(path); - if (inode == null) { - throw new FileDoesNotExistException(path); + List childrenIds = tFolder.getChildrenIds(); + for (int id : childrenIds) { + Inode tInode = mInodes.get(id); + String newPath = curPath + Constants.PATH_SEPARATOR + tInode.getName(); + if (tInode.isDirectory()) { + nodesQueue.add(new Pair((InodeFolder) tInode, newPath)); + } else if (((InodeFile) tInode).isFullyInMemory()) { + ret.add(newPath); + } + } } - return getFileLocations(inode.getId()); } + return ret; } /** - * Get the file id of the file. - * @param path The path of the file - * @return The file id of the file. -1 if the file does not exist. - * @throws InvalidPathException + * Get the inode of the file at the given path. + * + * @param path + * The path to search for + * @return the inode of the file at the given path, or null if the file does not exist */ - public int getFileId(String path) throws InvalidPathException { - LOG.debug("getFileId(" + path + ")"); - Inode inode = getInode(path); - int ret = -1; - if (inode != null) { - ret = inode.getId(); - } - LOG.debug("getFileId(" + path + "): " + ret); - return ret; - } - private Inode getInode(String path) throws InvalidPathException { return getInode(getPathNames(path)); } + /** + * Get the inode at the given path. + * + * @param pathNames + * The path to search for, broken into components + * @return the inode of the file at the given path, or null if the file does not exist + */ private Inode getInode(String[] pathNames) throws InvalidPathException { if (pathNames == null || pathNames.length == 0) { return null; @@ -1038,49 +1407,40 @@ private Inode getInode(String[] pathNames) throws InvalidPathException { } /** - * Get absolute paths of all in memory files. - * - * @return absolute paths of all in memory files. + * Get Journal instance for MasterInfo for Unit test only + * + * @return Journal instance */ - public List getInMemoryFiles() { - List ret = new ArrayList(); - LOG.info("getInMemoryFiles()"); - Queue> nodesQueue = new LinkedList>(); - synchronized (mRoot) { - nodesQueue.add(new Pair(mRoot, "")); - while (!nodesQueue.isEmpty()) { - Pair tPair = nodesQueue.poll(); - InodeFolder tFolder = tPair.getFirst(); - String curPath = tPair.getSecond(); - - List childrenIds = tFolder.getChildrenIds(); - for (int id : childrenIds) { - Inode tInode = mInodes.get(id); - String newPath = curPath + Constants.PATH_SEPARATOR + tInode.getName(); - if (tInode.isDirectory()) { - nodesQueue.add(new Pair((InodeFolder) tInode, newPath)); - } else if (((InodeFile) tInode).isFullyInMemory()) { - ret.add(newPath); - } - } - } - } - return ret; + public Journal getJournal() { + return mJournal; } + /** + * Get the master address. + * + * @return the master address + */ public InetSocketAddress getMasterAddress() { return MASTER_ADDRESS; } - private static String getName(String path) throws InvalidPathException { - String[] pathNames = getPathNames(path); - return pathNames[pathNames.length - 1]; - } - + /** + * Get a new user id + * + * @return a new user id + */ public long getNewUserId() { return mUserCounter.incrementAndGet(); } + /** + * Get the number of files at a given path. + * + * @param path + * The path to look at + * @return The number of files at the path. Returns 1 if the path specifies a file. If it's a + * directory, returns the number of items in the directory. + */ public int getNumberOfFiles(String path) throws InvalidPathException, FileDoesNotExistException { Inode inode = getInode(path); if (inode == null) { @@ -1092,6 +1452,13 @@ public int getNumberOfFiles(String path) throws InvalidPathException, FileDoesNo return ((InodeFolder) inode).getNumberOfChildren(); } + /** + * Get the file path specified by a given inode. + * + * @param inode + * The inode + * @return the path of the inode + */ private String getPath(Inode inode) { synchronized (mRoot) { if (inode.getId() == 1) { @@ -1100,34 +1467,80 @@ private String getPath(Inode inode) { if (inode.getParentId() == 1) { return Constants.PATH_SEPARATOR + inode.getName(); } - return getPath(mInodes.get(inode.getParentId())) + Constants.PATH_SEPARATOR + inode.getName(); + return getPath(mInodes.get(inode.getParentId())) + Constants.PATH_SEPARATOR + + inode.getName(); } } - private static String[] getPathNames(String path) throws InvalidPathException { - CommonUtils.validatePath(path); - if (path.length() == 1 && path.equals(Constants.PATH_SEPARATOR)) { - String[] ret = new String[1]; - ret[0] = ""; + /** + * Get a list of the pin id's. + * + * @return a list of pin id's + */ + public List getPinIdList() { + synchronized (mFileIdPinList) { + List ret = new ArrayList(); + for (int id : mFileIdPinList) { + ret.add(id); + } return ret; } - return path.split(Constants.PATH_SEPARATOR); } + /** + * Get the pin list. + * + * @return the pin list + */ public List getPinList() { return mPinList.getList(); } - public List getPinIdList() { - synchronized (mFileIdPinList) { - List ret = new ArrayList(); - for (int id : mFileIdPinList) { - ret.add(id); + /** + * Creates a list of high priority dependencies, which don't yet have checkpoints. + * + * @return the list of dependency ids + */ + public List getPriorityDependencyList() { + synchronized (mDependencies) { + int earliestDepId = -1; + if (mPriorityDependencies.isEmpty()) { + long earliest = Long.MAX_VALUE; + for (int depId : mUncheckpointedDependencies) { + Dependency dep = mDependencies.get(depId); + if (!dep.hasChildrenDependency()) { + mPriorityDependencies.add(dep.ID); + } else { + } + if (dep.CREATION_TIME_MS < earliest) { + earliest = dep.CREATION_TIME_MS; + earliestDepId = dep.ID; + } + } + + if (!mPriorityDependencies.isEmpty()) { + LOG.info("New computed priority dependency list " + mPriorityDependencies); + } } + + if (mPriorityDependencies.isEmpty() && earliestDepId != -1) { + mPriorityDependencies.add(earliestDepId); + LOG.info("Priority dependency list by earliest creation time: " + mPriorityDependencies); + } + + List ret = new ArrayList(mPriorityDependencies.size()); + ret.addAll(mPriorityDependencies); return ret; } } + /** + * Get the id of the table at the given path. + * + * @param path + * The path of the table + * @return the id of the table + */ public int getRawTableId(String path) throws InvalidPathException { Inode inode = getInode(path); if (inode == null || inode.isFile() || !((InodeFolder) inode).isRawTable()) { @@ -1136,25 +1549,50 @@ public int getRawTableId(String path) throws InvalidPathException { return inode.getId(); } + /** + * Get the master start time in milliseconds. + * + * @return the master start time in milliseconds + */ public long getStarttimeMs() { return START_TIME_MS; } + /** + * Get the capacity of the under file system. + * + * @return the capacity in bytes + */ public long getUnderFsCapacityBytes() throws IOException { UnderFileSystem ufs = UnderFileSystem.get(CommonConf.get().UNDERFS_DATA_FOLDER); return ufs.getSpace(CommonConf.get().UNDERFS_DATA_FOLDER, SpaceType.SPACE_TOTAL); } - public long getUnderFsUsedBytes() throws IOException { + /** + * Get the amount of free space in the under file system. + * + * @return the free space in bytes + */ + public long getUnderFsFreeBytes() throws IOException { UnderFileSystem ufs = UnderFileSystem.get(CommonConf.get().UNDERFS_DATA_FOLDER); - return ufs.getSpace(CommonConf.get().UNDERFS_DATA_FOLDER, SpaceType.SPACE_USED); + return ufs.getSpace(CommonConf.get().UNDERFS_DATA_FOLDER, SpaceType.SPACE_FREE); } - public long getUnderFsFreeBytes() throws IOException { + /** + * Get the amount of space used in the under file system. + * + * @return the space used in bytes + */ + public long getUnderFsUsedBytes() throws IOException { UnderFileSystem ufs = UnderFileSystem.get(CommonConf.get().UNDERFS_DATA_FOLDER); - return ufs.getSpace(CommonConf.get().UNDERFS_DATA_FOLDER, SpaceType.SPACE_FREE); + return ufs.getSpace(CommonConf.get().UNDERFS_DATA_FOLDER, SpaceType.SPACE_USED); } + /** + * Get the amount of space used by the workers. + * + * @return the amount of space used in bytes + */ public long getUsedBytes() { long ret = 0; synchronized (mWorkers) { @@ -1165,6 +1603,24 @@ public long getUsedBytes() { return ret; } + /** + * Get the white list. + * + * @return the white list + */ + public List getWhiteList() { + return mWhiteList.getList(); + } + + /** + * Get the address of a worker. + * + * @param random + * If true, select a random worker + * @param host + * If random is false, select a worker on this host + * @return the address of the selected worker + */ public NetAddress getWorker(boolean random, String host) { synchronized (mWorkers) { if (mWorkerAddressToId.isEmpty()) { @@ -1172,19 +1628,19 @@ public NetAddress getWorker(boolean random, String host) { } if (random) { int index = new Random(mWorkerAddressToId.size()).nextInt(mWorkerAddressToId.size()); - for (InetSocketAddress address: mWorkerAddressToId.keySet()) { + for (InetSocketAddress address : mWorkerAddressToId.keySet()) { if (index == 0) { LOG.debug("getRandomWorker: " + address); return new NetAddress(address.getHostName(), address.getPort()); } index --; } - for (InetSocketAddress address: mWorkerAddressToId.keySet()) { + for (InetSocketAddress address : mWorkerAddressToId.keySet()) { LOG.debug("getRandomWorker: " + address); return new NetAddress(address.getHostName(), address.getPort()); } } else { - for (InetSocketAddress address: mWorkerAddressToId.keySet()) { + for (InetSocketAddress address : mWorkerAddressToId.keySet()) { if (address.getHostName().equals(host) || address.getAddress().getHostAddress().equals(host) || address.getAddress().getCanonicalHostName().equals(host)) { @@ -1198,12 +1654,24 @@ public NetAddress getWorker(boolean random, String host) { return null; } + /** + * Get the number of workers. + * + * @return the number of workers + */ public int getWorkerCount() { synchronized (mWorkers) { return mWorkers.size(); } } + /** + * Get info about a worker. + * + * @param workerId + * The id of the worker to look at + * @return the info about the worker + */ private MasterWorkerInfo getWorkerInfo(long workerId) { MasterWorkerInfo ret = null; synchronized (mWorkers) { @@ -1216,6 +1684,11 @@ private MasterWorkerInfo getWorkerInfo(long workerId) { return ret; } + /** + * Get info about all the workers. + * + * @return a list of worker infos + */ public List getWorkersInfo() { List ret = new ArrayList(); @@ -1228,12 +1701,32 @@ public List getWorkersInfo() { return ret; } - public List getWhiteList() { - return mWhiteList.getList(); + public void init() throws IOException { + mCheckpointInfo.updateEditTransactionCounter(mJournal.loadEditLog(this)); + + mJournal.createImage(this); + mJournal.createEditLog(mCheckpointInfo.getEditTransactionCounter()); + + mHeartbeatThread = + new HeartbeatThread("Master Heartbeat", new MasterInfoHeartbeatExecutor(), + MASTER_CONF.HEARTBEAT_INTERVAL_MS); + mHeartbeatThread.start(); + + mRecomputeThread = new Thread(new RecomputationScheduler()); + mRecomputeThread.start(); } - public List listFiles(String path, boolean recursive) - throws InvalidPathException, FileDoesNotExistException { + /** + * Get the id of the file at the given path. If recursive, it scans the subdirectories as well. + * + * @param path + * The path to start looking at + * @param recursive + * If true, recursively scan the subdirectories at the given path as well + * @return the list of the inode id's at the path + */ + public List listFiles(String path, boolean recursive) throws InvalidPathException, + FileDoesNotExistException { List ret = new ArrayList(); synchronized (mRoot) { Inode inode = getInode(path); @@ -1263,8 +1756,125 @@ public List listFiles(String path, boolean recursive) return ret; } - public List ls(String path, boolean recursive) - throws InvalidPathException, FileDoesNotExistException { + /** + * Load the image from is. Assume this blocks the whole MasterInfo. + * + * @param is + * the inputstream to load the image. + * @throws IOException + */ + public void loadImage(DataInputStream is) throws IOException { + while (true) { + byte type = -1; + try { + type = is.readByte(); + } catch (EOFException e) { + return; + } + + if (type == Image.T_CHECKPOINT) { + mInodeCounter.set(is.readInt()); + mCheckpointInfo.updateEditTransactionCounter(is.readLong()); + mCheckpointInfo.updateDependencyCounter(is.readInt()); + } else if (type == Image.T_DEPENDENCY) { + Dependency dep = + new Dependency(is.readInt(), Utils.readIntegerList(is), Utils.readIntegerList(is), + Utils.readString(is), Utils.readByteBufferList(is), Utils.readString(is), + Utils.readString(is), Utils.readString(is), DependencyType.getDependencyType(is + .readInt()), Utils.readIntegerList(is), is.readLong()); + dep.resetUncheckpointedChildrenFiles(Utils.readIntegerList(is)); + + mDependencies.put(dep.ID, dep); + if (!dep.hasCheckpointed()) { + mUncheckpointedDependencies.add(dep.ID); + } + for (int parentDependencyId : dep.PARENT_DEPENDENCIES) { + mDependencies.get(parentDependencyId).addChildrenDependency(dep.ID); + } + } else { + if (type > Image.T_INODE_RAW_TABLE) { + throw new IOException("Corrupted image with unknown element type: " + type); + } + + long creationTimeMs = is.readLong(); + int fileId = is.readInt(); + String fileName = Utils.readString(is); + int parentId = is.readInt(); + + Inode inode = null; + + if (type == Image.T_INODE_FILE) { + long blockSizeByte = is.readLong(); + long length = is.readLong(); + boolean isComplete = is.readBoolean(); + boolean isPin = is.readBoolean(); + boolean isCache = is.readBoolean(); + String checkpointPath = Utils.readString(is); + + InodeFile tInode = + new InodeFile(fileName, fileId, parentId, blockSizeByte, creationTimeMs); + + try { + tInode.setLength(length); + } catch (Exception e) { + throw new IOException(e); + } + tInode.setComplete(isComplete); + tInode.setPin(isPin); + tInode.setCache(isCache); + tInode.setCheckpointPath(checkpointPath); + tInode.setDependencyId(is.readInt()); + inode = tInode; + } else { + int numberOfChildren = is.readInt(); + int[] children = new int[numberOfChildren]; + for (int k = 0; k < numberOfChildren; k ++) { + children[k] = is.readInt(); + } + + if (type == Image.T_INODE_FOLDER) { + InodeFolder folder = new InodeFolder(fileName, fileId, parentId, creationTimeMs); + folder.addChildren(children); + inode = folder; + } else { + int columns = is.readInt(); + ByteBuffer metadata = Utils.readByteBuffer(is); + + try { + InodeRawTable table = + new InodeRawTable(fileName, fileId, parentId, columns, metadata, creationTimeMs); + table.addChildren(children); + inode = table; + } catch (TachyonException e) { + throw new IOException(e); + } + } + } + + LOG.info("Putting " + inode); + if (inode.getId() > mInodeCounter.get()) { + mInodeCounter.set(inode.getId()); + } + + if (inode.getId() == 1) { + mRoot = (InodeFolder) inode; + } + mInodes.put(inode.getId(), inode); + } + } + } + + /** + * Get the names of the subdirectories at the given path. + * + * @param path + * The path to look at + * @param recursive + * If true, recursively add the paths of the subdirectories + * @return the list of paths + */ + public List ls(String path, boolean recursive) throws InvalidPathException, + FileDoesNotExistException { List ret = new ArrayList(); Inode inode = getInode(path); @@ -1276,7 +1886,7 @@ public List ls(String path, boolean recursive) if (inode.isFile()) { ret.add(path); } else { - List childernIds = ((InodeFolder) inode).getChildrenIds(); + List childrenIds = ((InodeFolder) inode).getChildrenIds(); if (!path.endsWith("/")) { path += "/"; @@ -1284,7 +1894,7 @@ public List ls(String path, boolean recursive) ret.add(path); synchronized (mRoot) { - for (int k : childernIds) { + for (int k : childrenIds) { inode = mInodes.get(k); if (inode != null) { if (recursive) { @@ -1300,8 +1910,15 @@ public List ls(String path, boolean recursive) return ret; } - public boolean mkdir(String path) - throws FileAlreadyExistException, InvalidPathException, TachyonException { + /** + * Create a directory at the given path. + * + * @param path + * The path to create a directory at + * @return true if the creation was successful and false if it wasn't + */ + public boolean mkdir(String path) throws FileAlreadyExistException, InvalidPathException, + TachyonException { try { return createFile(true, path, true, -1, null, 0) > 0; } catch (BlockInfoException e) { @@ -1309,8 +1926,47 @@ public boolean mkdir(String path) } } - public long registerWorker(NetAddress workerNetAddress, long totalBytes, - long usedBytes, List currentBlockIds) throws BlockInfoException { + /** + * Called by edit log only. + * + * @param fileId + * @param blockIndex + * @param blockLength + * @throws FileDoesNotExistException + * @throws BlockInfoException + */ + void opAddBlock(int fileId, int blockIndex, long blockLength) throws FileDoesNotExistException, + BlockInfoException { + synchronized (mRoot) { + Inode inode = mInodes.get(fileId); + + if (inode == null) { + throw new FileDoesNotExistException("File " + fileId + " does not exist."); + } + if (inode.isDirectory()) { + throw new FileDoesNotExistException("File " + fileId + " is a folder."); + } + + addBlock((InodeFile) inode, new BlockInfo((InodeFile) inode, blockIndex, blockLength)); + } + } + + /** + * Register a worker at the given address, setting it up and associating it with a given list of + * blocks. + * + * @param workerNetAddress + * The address of the worker to register + * @param totalBytes + * The capacity of the worker in bytes + * @param usedBytes + * The number of bytes already used in the worker + * @param currentBlockIds + * The id's of the blocks held by the worker + * @return the new id of the registered worker + */ + public long registerWorker(NetAddress workerNetAddress, long totalBytes, long usedBytes, + List currentBlockIds) throws BlockInfoException { long id = 0; InetSocketAddress workerAddress = new InetSocketAddress(workerNetAddress.mHost, workerNetAddress.mPort); @@ -1339,7 +1995,7 @@ public long registerWorker(NetAddress workerNetAddress, long totalBytes, } synchronized (mRoot) { - for (long blockId: currentBlockIds) { + for (long blockId : currentBlockIds) { int fileId = BlockInfo.computeInodeId(blockId); int blockIndex = BlockInfo.computeBlockIndex(blockId); Inode inode = mInodes.get(fileId); @@ -1354,8 +2010,16 @@ public long registerWorker(NetAddress workerNetAddress, long totalBytes, return id; } - private void rename(Inode srcInode, String dstPath) - throws FileAlreadyExistException, InvalidPathException, FileDoesNotExistException { + /** + * Rename an inode to the given path. + * + * @param srcInode + * The inode to rename + * @param dstPath + * The new path of the inode + */ + private void rename(Inode srcInode, String dstPath) throws FileAlreadyExistException, + InvalidPathException, FileDoesNotExistException { if (getInode(dstPath) != null) { throw new FileAlreadyExistException("Failed to rename: " + dstPath + " already exist"); } @@ -1370,8 +2034,8 @@ private void rename(Inode srcInode, String dstPath) Inode dstFolderInode = getInode(dstFolderPath); if (dstFolderInode == null || dstFolderInode.isFile()) { - throw new FileDoesNotExistException("Failed to rename: " + dstFolderPath + - " does not exist."); + throw new FileDoesNotExistException("Failed to rename: " + dstFolderPath + + " does not exist."); } srcInode.setName(dstName); @@ -1384,8 +2048,16 @@ private void rename(Inode srcInode, String dstPath) mJournal.getEditLog().flush(); } - public void rename(int fileId, String dstPath) - throws FileDoesNotExistException, FileAlreadyExistException, InvalidPathException { + /** + * Rename a file to the given path. + * + * @param fileId + * The id of the file to rename + * @param dstPath + * The new path of the file + */ + public void rename(int fileId, String dstPath) throws FileDoesNotExistException, + FileAlreadyExistException, InvalidPathException { synchronized (mRoot) { Inode inode = mInodes.get(fileId); if (inode == null) { @@ -1396,8 +2068,16 @@ public void rename(int fileId, String dstPath) } } - public void rename(String srcPath, String dstPath) - throws FileAlreadyExistException, FileDoesNotExistException, InvalidPathException { + /** + * Rename a file to the given path. + * + * @param srcPath + * The path of the file to rename + * @param dstPath + * The new path of the file + */ + public void rename(String srcPath, String dstPath) throws FileAlreadyExistException, + FileDoesNotExistException, InvalidPathException { synchronized (mRoot) { Inode inode = getInode(srcPath); if (inode == null) { @@ -1408,6 +2088,71 @@ public void rename(String srcPath, String dstPath) } } + /** + * Logs a lost file and sets it to be recovered. + * + * @param fileId + * The id of the file to be recovered + */ + public void reportLostFile(int fileId) { + synchronized (mRoot) { + Inode inode = mInodes.get(fileId); + if (inode == null) { + LOG.warn("Tachyon does not have file " + fileId); + } else if (inode.isDirectory()) { + LOG.warn("Reported file is a directory " + inode); + } else { + InodeFile iFile = (InodeFile) inode; + int depId = iFile.getDependencyId(); + synchronized (mDependencies) { + mLostFiles.add(fileId); + if (depId == -1) { + LOG.error("There is no dependency info for " + iFile + " . No recovery on that"); + } else { + LOG.info("Reported file loss. Tachyon will recompute it: " + iFile.toString()); + + Dependency dep = mDependencies.get(depId); + dep.addLostFile(fileId); + mMustRecomputeDependencies.add(depId); + } + } + } + } + } + + /** + * Request that the files for the given dependency be recomputed. + * + * @param depId + * The dependency whose files are to be recomputed + */ + public void requestFilesInDependency(int depId) { + synchronized (mDependencies) { + if (mDependencies.containsKey(depId)) { + Dependency dep = mDependencies.get(depId); + LOG.info("Request files in dependency " + dep); + if (dep.hasLostFile()) { + mMustRecomputeDependencies.add(depId); + } + } else { + LOG.error("There is no dependency with id " + depId); + } + } + } + + /** + * Stops the heartbeat thread. + */ + public void stop() { + mHeartbeatThread.shutdown(); + } + + /** + * Unpin the file with the given id. + * + * @param fileId + * The id of the file to unpin + */ public void unpinFile(int fileId) throws FileDoesNotExistException { // TODO Change meta data only. Data will be evicted from worker based on data replacement // policy. TODO May change it to be active from V0.2 @@ -1429,6 +2174,14 @@ public void unpinFile(int fileId) throws FileDoesNotExistException { } } + /** + * Update the metadata of a table. + * + * @param tableId + * The id of the table to update + * @param metadata + * The new metadata to update the table with + */ public void updateRawTableMetadata(int tableId, ByteBuffer metadata) throws TableDoesNotExistException, TachyonException { synchronized (mRoot) { @@ -1445,6 +2198,18 @@ public void updateRawTableMetadata(int tableId, ByteBuffer metadata) } } + /** + * The heartbeat of the worker. It updates the information of the worker and removes the given + * block id's. + * + * @param workerId + * The id of the worker to deal with + * @param usedBytes + * The number of bytes used in the worker + * @param removedBlockIds + * The id's of the blocks that have been removed + * @return a command specifying an action to take + */ public Command workerHeartbeat(long workerId, long usedBytes, List removedBlockIds) throws BlockInfoException { LOG.debug("WorkerId: " + workerId); @@ -1453,8 +2218,8 @@ public Command workerHeartbeat(long workerId, long usedBytes, List removed MasterWorkerInfo tWorkerInfo = mWorkers.get(workerId); if (tWorkerInfo == null) { - LOG.info("worker_heartbeat(): Does not contain worker with ID " + workerId + - " . Send command to let it re-register."); + LOG.info("worker_heartbeat(): Does not contain worker with ID " + workerId + + " . Send command to let it re-register."); return new Command(CommandType.Register, new ArrayList()); } @@ -1471,8 +2236,8 @@ public Command workerHeartbeat(long workerId, long usedBytes, List removed LOG.error("File " + fileId + " does not exist"); } else if (inode.isFile()) { ((InodeFile) inode).removeLocation(blockIndex, workerId); - LOG.debug("File " + fileId + " block " + blockIndex + - " was evicted from worker " + workerId); + LOG.debug("File " + fileId + " block " + blockIndex + " was evicted from worker " + + workerId); } } @@ -1485,8 +2250,4 @@ public Command workerHeartbeat(long workerId, long usedBytes, List removed return new Command(CommandType.Nothing, new ArrayList()); } - - public void stop() { - mHeartbeatThread.shutdown(); - } } diff --git a/src/main/java/tachyon/MasterServiceHandler.java b/src/main/java/tachyon/master/MasterServiceHandler.java similarity index 71% rename from src/main/java/tachyon/MasterServiceHandler.java rename to src/main/java/tachyon/master/MasterServiceHandler.java index 3abc5fb57ab2..6b030ed0779b 100644 --- a/src/main/java/tachyon/MasterServiceHandler.java +++ b/src/main/java/tachyon/master/MasterServiceHandler.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import java.io.FileNotFoundException; import java.io.IOException; @@ -26,13 +26,17 @@ import org.apache.thrift.TException; import org.apache.log4j.Logger; +import tachyon.Constants; +import tachyon.UnderFileSystem; import tachyon.conf.CommonConf; import tachyon.thrift.BlockInfoException; import tachyon.thrift.ClientBlockInfo; +import tachyon.thrift.ClientDependencyInfo; import tachyon.thrift.ClientFileInfo; import tachyon.thrift.ClientRawTableInfo; import tachyon.thrift.ClientWorkerInfo; import tachyon.thrift.Command; +import tachyon.thrift.DependencyDoesNotExistException; import tachyon.thrift.FileAlreadyExistException; import tachyon.thrift.FileDoesNotExistException; import tachyon.thrift.InvalidPathException; @@ -47,7 +51,7 @@ /** * The Master server program. - * + * * It maintains the state of each worker. It never keeps the state of any user. */ public class MasterServiceHandler implements MasterService.Iface { @@ -60,8 +64,10 @@ public MasterServiceHandler(MasterInfo masterInfo) { } @Override - public boolean addCheckpoint(long workerId, int fileId, long fileSizeBytes, String checkpointPath) - throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, TException { + public boolean + addCheckpoint(long workerId, int fileId, long fileSizeBytes, String checkpointPath) + throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, + TException { try { return mMasterInfo.addCheckpoint(workerId, fileId, fileSizeBytes, checkpointPath); } catch (FileNotFoundException e) { @@ -70,9 +76,8 @@ public boolean addCheckpoint(long workerId, int fileId, long fileSizeBytes, Stri } @Override - public List liststatus(String path) - throws InvalidPathException, FileDoesNotExistException, TException { - return mMasterInfo.getFilesInfo(path); + public ClientFileInfo getClientFileInfoById(int id) throws FileDoesNotExistException, TException { + return mMasterInfo.getClientFileInfo(id); } @Override @@ -81,15 +86,36 @@ public List getWorkersInfo() throws TException { } @Override - public void user_completeFile(int fileId) throws FileDoesNotExistException, - TException { + public List liststatus(String path) throws InvalidPathException, + FileDoesNotExistException, TException { + return mMasterInfo.getFilesInfo(path); + } + + @Override + public void user_completeFile(int fileId) throws FileDoesNotExistException, TException { mMasterInfo.completeFile(fileId); } @Override - public int user_createFile(String path, long blockSizeByte) - throws FileAlreadyExistException, InvalidPathException, BlockInfoException, TachyonException, - TException { + public int user_createDependency(List parents, List children, + String commandPrefix, List data, String comment, String framework, + String frameworkVersion, int dependencyType, long childrenBlockSizeByte) + throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException, + BlockInfoException, TachyonException, TException { + try { + for (int k = 0; k < children.size(); k ++) { + mMasterInfo.createFile(children.get(k), childrenBlockSizeByte); + } + return mMasterInfo.createDependency(parents, children, commandPrefix, data, comment, + framework, frameworkVersion, DependencyType.getDependencyType(dependencyType)); + } catch (IOException e) { + throw new FileDoesNotExistException(e.getMessage()); + } + } + + @Override + public int user_createFile(String path, long blockSizeByte) throws FileAlreadyExistException, + InvalidPathException, BlockInfoException, TachyonException, TException { return mMasterInfo.createFile(path, blockSizeByte); } @@ -120,8 +146,8 @@ public long user_createNewBlock(int fileId) throws FileDoesNotExistException, TE public int user_createRawTable(String path, int columns, ByteBuffer metadata) throws FileAlreadyExistException, InvalidPathException, TableColumnException, TachyonException, TException { - return mMasterInfo.createRawTable( - path, columns, CommonUtils.generateNewByteBufferFromThriftRPCResults(metadata)); + return mMasterInfo.createRawTable(path, columns, + CommonUtils.generateNewByteBufferFromThriftRPCResults(metadata)); } @Override @@ -130,35 +156,32 @@ public boolean user_deleteById(int id, boolean recursive) throws TachyonExceptio } @Override - public boolean user_deleteByPath(String path, boolean recursive) - throws TachyonException, TException { + public boolean user_deleteByPath(String path, boolean recursive) throws TachyonException, + TException { return mMasterInfo.delete(path, recursive); } @Override - public NetAddress user_getWorker(boolean random, String host) - throws NoWorkerException, TException { - NetAddress ret = mMasterInfo.getWorker(random, host); - if (ret == null) { - if (random) { - throw new NoWorkerException("No worker in the system"); - } else { - throw new NoWorkerException("No local worker on " + host); - } - } - return ret; + public long user_getBlockId(int fileId, int index) throws FileDoesNotExistException, TException { + return BlockInfo.computeBlockId(fileId, index); } @Override - public long user_getBlockId(int fileId, int index) - throws FileDoesNotExistException, TException { - return BlockInfo.computeBlockId(fileId, index); + public ClientBlockInfo user_getClientBlockInfo(long blockId) throws FileDoesNotExistException, + BlockInfoException, TException { + ClientBlockInfo ret = null; + try { + ret = mMasterInfo.getClientBlockInfo(blockId); + } catch (IOException e) { + throw new FileDoesNotExistException(e.getMessage()); + } + return ret; } @Override - public ClientFileInfo user_getClientFileInfoById(int id) - throws FileDoesNotExistException, TException { - return mMasterInfo.getClientFileInfo(id); + public ClientDependencyInfo user_getClientDependencyInfo(int dependencyId) + throws DependencyDoesNotExistException, TException { + return mMasterInfo.getClientDependencyInfo(dependencyId); } @Override @@ -168,15 +191,15 @@ public ClientFileInfo user_getClientFileInfoByPath(String path) } @Override - public ClientBlockInfo user_getClientBlockInfo(long blockId) - throws FileDoesNotExistException, BlockInfoException, TException { - ClientBlockInfo ret = null; - try { - ret = mMasterInfo.getClientBlockInfo(blockId); - } catch (IOException e) { - throw new FileDoesNotExistException(e.getMessage()); - } - return ret; + public ClientRawTableInfo user_getClientRawTableInfoById(int id) + throws TableDoesNotExistException, TException { + return mMasterInfo.getClientRawTableInfo(id); + } + + @Override + public ClientRawTableInfo user_getClientRawTableInfoByPath(String path) + throws TableDoesNotExistException, InvalidPathException, TException { + return mMasterInfo.getClientRawTableInfo(path); } @Override @@ -209,20 +232,19 @@ public int user_getFileId(String filePath) throws InvalidPathException, TExcepti } @Override - public int user_getRawTableId(String path) throws InvalidPathException, TException { - return mMasterInfo.getRawTableId(path); + public int user_getNumberOfFiles(String path) throws FileDoesNotExistException, + InvalidPathException, TException { + return mMasterInfo.getNumberOfFiles(path); } @Override - public ClientRawTableInfo user_getClientRawTableInfoById(int id) - throws TableDoesNotExistException, TException { - return mMasterInfo.getClientRawTableInfo(id); + public int user_getRawTableId(String path) throws InvalidPathException, TException { + return mMasterInfo.getRawTableId(path); } @Override - public ClientRawTableInfo user_getClientRawTableInfoByPath(String path) - throws TableDoesNotExistException, InvalidPathException, TException { - return mMasterInfo.getClientRawTableInfo(path); + public String user_getUnderfsAddress() throws TException { + return CommonConf.get().UNDERFS_ADDRESS; } @Override @@ -231,14 +253,17 @@ public long user_getUserId() throws TException { } @Override - public int user_getNumberOfFiles(String path) - throws FileDoesNotExistException, InvalidPathException, TException { - return mMasterInfo.getNumberOfFiles(path); - } - - @Override - public String user_getUnderfsAddress() throws TException { - return CommonConf.get().UNDERFS_ADDRESS; + public NetAddress user_getWorker(boolean random, String host) throws NoWorkerException, + TException { + NetAddress ret = mMasterInfo.getWorker(random, host); + if (ret == null) { + if (random) { + throw new NoWorkerException("No worker in the system"); + } else { + throw new NoWorkerException("No local worker on " + host); + } + } + return ret; } @Override @@ -248,14 +273,14 @@ public List user_listFiles(String path, boolean recursive) } @Override - public List user_ls(String path, boolean recursive) - throws FileDoesNotExistException, InvalidPathException, TException { + public List user_ls(String path, boolean recursive) throws FileDoesNotExistException, + InvalidPathException, TException { return mMasterInfo.ls(path, recursive); } @Override - public boolean user_mkdir(String path) - throws FileAlreadyExistException, InvalidPathException, TachyonException, TException { + public boolean user_mkdir(String path) throws FileAlreadyExistException, InvalidPathException, + TachyonException, TException { return mMasterInfo.mkdir(path); } @@ -265,17 +290,28 @@ public void user_outOfMemoryForPinFile(int fileId) throws TException { } @Override - public void user_rename(String srcPath, String dstPath) - throws FileAlreadyExistException, FileDoesNotExistException, InvalidPathException, TException{ + public void user_rename(String srcPath, String dstPath) throws FileAlreadyExistException, + FileDoesNotExistException, InvalidPathException, TException { mMasterInfo.rename(srcPath, dstPath); } @Override - public void user_renameTo(int fileId, String dstPath) - throws FileAlreadyExistException, FileDoesNotExistException, InvalidPathException, TException{ + public void user_renameTo(int fileId, String dstPath) throws FileAlreadyExistException, + FileDoesNotExistException, InvalidPathException, TException { mMasterInfo.rename(fileId, dstPath); } + @Override + public void user_reportLostFile(int fileId) throws FileDoesNotExistException, TException { + mMasterInfo.reportLostFile(fileId); + } + + @Override + public void user_requestFilesInDependency(int depId) throws DependencyDoesNotExistException, + TException { + mMasterInfo.requestFilesInDependency(depId); + } + @Override public void user_unpinFile(int fileId) throws FileDoesNotExistException, TException { mMasterInfo.unpinFile(fileId); @@ -300,6 +336,11 @@ public Set worker_getPinIdList() throws TException { return new HashSet(ret); } + @Override + public List worker_getPriorityDependencyList() throws TException { + return mMasterInfo.getPriorityDependencyList(); + } + @Override public Command worker_heartbeat(long workerId, long usedBytes, List removedBlockIds) throws BlockInfoException, TException { diff --git a/src/main/java/tachyon/MasterWorkerInfo.java b/src/main/java/tachyon/master/MasterWorkerInfo.java similarity index 98% rename from src/main/java/tachyon/MasterWorkerInfo.java rename to src/main/java/tachyon/master/MasterWorkerInfo.java index 59da25139a09..54d88cb29a8c 100644 --- a/src/main/java/tachyon/MasterWorkerInfo.java +++ b/src/main/java/tachyon/master/MasterWorkerInfo.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import java.net.InetSocketAddress; import java.util.ArrayList; @@ -53,6 +53,18 @@ public MasterWorkerInfo(long id, InetSocketAddress address, long capacityBytes) mLastUpdatedTimeMs = System.currentTimeMillis(); } + public synchronized ClientWorkerInfo generateClientWorkerInfo() { + ClientWorkerInfo ret = new ClientWorkerInfo(); + ret.id = mId; + ret.address = new NetAddress(ADDRESS.getHostName(), ADDRESS.getPort()); + ret.lastContactSec = (int) ((CommonUtils.getCurrentMs() - mLastUpdatedTimeMs) / 1000); + ret.state = "In Service"; + ret.capacityBytes = CAPACITY_BYTES; + ret.usedBytes = mUsedBytes; + ret.starttimeMs = START_TIME_MS; + return ret; + } + public InetSocketAddress getAddress() { return ADDRESS; } @@ -61,6 +73,15 @@ public synchronized long getAvailableBytes() { return CAPACITY_BYTES - mUsedBytes; } + /** + * Get all blocks in the worker's memory. + * + * @return ids of the blocks. + */ + public synchronized Set getBlocks() { + return new HashSet(mBlocks); + } + public long getCapacityBytes() { return CAPACITY_BYTES; } @@ -73,16 +94,9 @@ public synchronized long getLastUpdatedTimeMs() { return mLastUpdatedTimeMs; } - /** - * Get all blocks in the worker's memory. - * @return ids of the blocks. - */ - public synchronized Set getBlocks() { - return new HashSet(mBlocks); - } - /** * Get all blocks in the worker's memory need to be removed. + * * @return ids of the blocks need to be removed. */ public synchronized List getToRemovedBlocks() { @@ -126,6 +140,10 @@ public synchronized void updateBlocks(boolean add, Collection blockIds) { } } + public synchronized void updateLastUpdatedTimeMs() { + mLastUpdatedTimeMs = System.currentTimeMillis(); + } + public synchronized void updateToRemovedBlock(boolean add, long blockId) { if (add) { if (mBlocks.contains(blockId)) { @@ -137,28 +155,12 @@ public synchronized void updateToRemovedBlock(boolean add, long blockId) { } public synchronized void updateToRemovedBlocks(boolean add, Collection blockIds) { - for (long blockId: blockIds) { + for (long blockId : blockIds) { updateToRemovedBlock(add, blockId); } } - public synchronized void updateLastUpdatedTimeMs() { - mLastUpdatedTimeMs = System.currentTimeMillis(); - } - public synchronized void updateUsedBytes(long usedBytes) { mUsedBytes = usedBytes; } - - public synchronized ClientWorkerInfo generateClientWorkerInfo() { - ClientWorkerInfo ret = new ClientWorkerInfo(); - ret.id = mId; - ret.address = new NetAddress(ADDRESS.getHostName(), ADDRESS.getPort()); - ret.lastContactSec = (int) ((CommonUtils.getCurrentMs() - mLastUpdatedTimeMs) / 1000); - ret.state = "In Service"; - ret.capacityBytes = CAPACITY_BYTES; - ret.usedBytes = mUsedBytes; - ret.starttimeMs = START_TIME_MS; - return ret; - } } \ No newline at end of file diff --git a/src/main/java/tachyon/Master.java b/src/main/java/tachyon/master/TachyonMaster.java similarity index 69% rename from src/main/java/tachyon/Master.java rename to src/main/java/tachyon/master/TachyonMaster.java index b56e7162418d..29f45a3f8603 100644 --- a/src/main/java/tachyon/Master.java +++ b/src/main/java/tachyon/master/TachyonMaster.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.master; import java.io.IOException; import java.net.InetSocketAddress; @@ -25,6 +25,10 @@ import org.apache.thrift.transport.TTransportException; import org.apache.log4j.Logger; +import tachyon.Constants; +import tachyon.LeaderSelectorClient; +import tachyon.UnderFileSystem; +import tachyon.Version; import tachyon.conf.CommonConf; import tachyon.conf.MasterConf; import tachyon.thrift.MasterService; @@ -34,9 +38,22 @@ /** * Entry point for the Master program. */ -public class Master { +public class TachyonMaster { private static final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); + public static void main(String[] args) { + if (args.length != 0) { + LOG.info("java -cp target/tachyon-" + Version.VERSION + "-jar-with-dependencies.jar " + + "tachyon.Master"); + System.exit(-1); + } + MasterConf mConf = MasterConf.get(); + TachyonMaster master = + new TachyonMaster(new InetSocketAddress(mConf.HOSTNAME, mConf.PORT), mConf.WEB_PORT, + mConf.SELECTOR_THREADS, mConf.QUEUE_SIZE_PER_SELECTOR, mConf.SERVER_THREADS); + master.start(); + } + private boolean mIsStarted; private MasterInfo mMasterInfo; private InetSocketAddress mMasterAddress; @@ -46,14 +63,14 @@ public class Master { private Journal mJournal; private EditLogProcessor mEditLogProcessor; private int mWebPort; - private int mWorkerThreads; + private int mWorkerThreads; private boolean mZookeeperMode = false; + private LeaderSelectorClient mLeaderSelectorClient = null; - public Master(InetSocketAddress address, int webPort, int selectorThreads, + public TachyonMaster(InetSocketAddress address, int webPort, int selectorThreads, int acceptQueueSizePerThreads, int workerThreads) { - // String imageFileName, String editLogFileName) { if (CommonConf.get().USE_ZOOKEEPER) { mZookeeperMode = true; } @@ -65,13 +82,18 @@ public Master(InetSocketAddress address, int webPort, int selectorThreads, try { mMasterAddress = address; String journalFolder = MasterConf.get().JOURNAL_FOLDER; + if (!isFormatted(MasterConf.get().JOURNAL_FOLDER, MasterConf.get().FORMAT_FILE_PREFIX)) { + LOG.error("Tachyon was not formatted!"); + System.exit(-1); + } mJournal = new Journal(journalFolder, "image.data", "log.data"); mMasterInfo = new MasterInfo(mMasterAddress, mJournal); if (mZookeeperMode) { CommonConf conf = CommonConf.get(); - mLeaderSelectorClient = new LeaderSelectorClient(conf.ZOOKEEPER_ADDRESS, - conf.ZOOKEEPER_ELECTION_PATH, conf.ZOOKEEPER_LEADER_PATH, address.getHostName() + ":" + address.getPort()); + mLeaderSelectorClient = + new LeaderSelectorClient(conf.ZOOKEEPER_ADDRESS, conf.ZOOKEEPER_ELECTION_PATH, + conf.ZOOKEEPER_LEADER_PATH, address.getHostName() + ":" + address.getPort()); mEditLogProcessor = new EditLogProcessor(mJournal, journalFolder, mMasterInfo); Thread logProcessor = new Thread(mEditLogProcessor); logProcessor.start(); @@ -82,28 +104,74 @@ public Master(InetSocketAddress address, int webPort, int selectorThreads, } } + /** + * Get MasterInfo instance for Unit Test + * + * @return MasterInfo of the Master + */ + MasterInfo getMasterInfo() { + return mMasterInfo; + } + + private boolean isFormatted(String folder, String path) throws IOException { + if (!folder.endsWith(Constants.PATH_SEPARATOR)) { + folder += Constants.PATH_SEPARATOR; + } + UnderFileSystem ufs = UnderFileSystem.get(folder); + String[] files = ufs.list(folder); + if (files == null) { + return false; + } + for (String file : files) { + if (file.startsWith(path)) { + return true; + } + } + return false; + } + + /** + * Get wehether the system is the leader under zookeeper mode, for unit test only. + * + * @return true if the system is the leader under zookeeper mode, false otherwise. + */ + boolean isStarted() { + return mIsStarted; + } + + /** + * Get whether the system is for zookeeper mode, for unit test only. + * + * @return true if the master is under zookeeper mode, false otherwise. + */ + boolean isZookeeperMode() { + return mZookeeperMode; + } + private void setup() throws IOException, TTransportException { if (mZookeeperMode) { mEditLogProcessor.stop(); } mMasterInfo.init(); - mWebServer = new UIWebServer("Tachyon Master Server", - new InetSocketAddress(mMasterAddress.getHostName(), mWebPort), mMasterInfo); + mWebServer = + new UIWebServer("Tachyon Master Server", new InetSocketAddress( + mMasterAddress.getHostName(), mWebPort), mMasterInfo); mMasterServiceHandler = new MasterServiceHandler(mMasterInfo); MasterService.Processor masterServiceProcessor = new MasterService.Processor(mMasterServiceHandler); // TODO This is for Thrift 0.8 or newer. - // mServer = new TThreadedSelectorServer(new TThreadedSelectorServer - // .Args(new TNonblockingServerSocket(address)).processor(processor) - // .selectorThreads(selectorThreads).acceptQueueSizePerThread(acceptQueueSizePerThreads) - // .workerThreads(workerThreads)); + // mServer = new TThreadedSelectorServer(new TThreadedSelectorServer + // .Args(new TNonblockingServerSocket(address)).processor(processor) + // .selectorThreads(selectorThreads).acceptQueueSizePerThread(acceptQueueSizePerThreads) + // .workerThreads(workerThreads)); // This is for Thrift 0.7.0, for Hive compatibility. - mMasterServiceServer = new THsHaServer(new THsHaServer.Args(new TNonblockingServerSocket( - mMasterAddress)).processor(masterServiceProcessor).workerThreads(mWorkerThreads)); + mMasterServiceServer = + new THsHaServer(new THsHaServer.Args(new TNonblockingServerSocket(mMasterAddress)) + .processor(masterServiceProcessor).workerThreads(mWorkerThreads)); mIsStarted = true; } @@ -126,7 +194,10 @@ public void start() { running = true; try { setup(); - } catch (TTransportException | IOException e) { + } catch (IOException e) { + LOG.error(e.getMessage(), e); + System.exit(-1); + } catch (TTransportException e) { LOG.error(e.getMessage(), e); System.exit(-1); } @@ -148,7 +219,10 @@ public void start() { } else { try { setup(); - } catch (TTransportException | IOException e) { + } catch (IOException e) { + LOG.error(e.getMessage(), e); + System.exit(-1); + } catch (TTransportException e) { LOG.error(e.getMessage(), e); System.exit(-1); } @@ -165,48 +239,15 @@ public void stop() throws Exception { mWebServer.shutdownWebServer(); mMasterInfo.stop(); mMasterServiceServer.stop(); - - if (mZookeeperMode) { + mIsStarted = false; + } + if (mZookeeperMode) { + if (mLeaderSelectorClient != null) { mLeaderSelectorClient.close(); } - - mIsStarted = false; - } - } - - public static void main(String[] args) { - if (args.length != 0) { - LOG.info("java -cp target/tachyon-" + Version.VERSION + "-jar-with-dependencies.jar " + - "tachyon.Master"); - System.exit(-1); + if (mEditLogProcessor != null) { + mEditLogProcessor.stop(); + } } - MasterConf mConf = MasterConf.get(); - Master master = new Master(new InetSocketAddress(mConf.HOSTNAME, mConf.PORT), mConf.WEB_PORT, - mConf.SELECTOR_THREADS, mConf.QUEUE_SIZE_PER_SELECTOR, mConf.SERVER_THREADS); - master.start(); - } - - /** - * Get MasterInfo instance for Unit Test - * @return MasterInfo of the Master - */ - MasterInfo getMasterInfo() { - return mMasterInfo; - } - - /** - * Get whether the system is for zookeeper mode, for unit test only. - * @return true if the master is under zookeeper mode, false otherwise. - */ - boolean isZookeeperMode() { - return mZookeeperMode; - } - - /** - * Get wehether the system is the leader under zookeeper mode, for unit test only. - * @return true if the system is the leader under zookeeper mode, false otherwise. - */ - boolean isStarted() { - return mIsStarted; } -} +} \ No newline at end of file diff --git a/src/main/java/tachyon/thrift/BlockInfoException.java b/src/main/java/tachyon/thrift/BlockInfoException.java index 21443ee19408..41a03040f6a3 100644 --- a/src/main/java/tachyon/thrift/BlockInfoException.java +++ b/src/main/java/tachyon/thrift/BlockInfoException.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -20,11 +30,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class BlockInfoException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class BlockInfoException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("BlockInfoException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new BlockInfoExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new BlockInfoExceptionTupleSchemeFactory()); + } + public String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -86,7 +102,6 @@ public String getFieldName() { } // 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); @@ -239,44 +254,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MESSAGE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.message = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(this.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -297,6 +279,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -315,5 +298,89 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class BlockInfoExceptionStandardSchemeFactory implements SchemeFactory { + public BlockInfoExceptionStandardScheme getScheme() { + return new BlockInfoExceptionStandardScheme(); + } + } + + private static class BlockInfoExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, BlockInfoException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, BlockInfoException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class BlockInfoExceptionTupleSchemeFactory implements SchemeFactory { + public BlockInfoExceptionTupleScheme getScheme() { + return new BlockInfoExceptionTupleScheme(); + } + } + + private static class BlockInfoExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, BlockInfoException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, BlockInfoException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/ClientBlockInfo.java b/src/main/java/tachyon/thrift/ClientBlockInfo.java index 6e15e3c512c2..016428ddb599 100644 --- a/src/main/java/tachyon/thrift/ClientBlockInfo.java +++ b/src/main/java/tachyon/thrift/ClientBlockInfo.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -28,6 +38,12 @@ public class ClientBlockInfo implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ClientBlockInfoStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ClientBlockInfoTupleSchemeFactory()); + } + public long blockId; // required public long offset; // required public long length; // required @@ -104,8 +120,7 @@ public String getFieldName() { private static final int __BLOCKID_ISSET_ID = 0; private static final int __OFFSET_ISSET_ID = 1; private static final int __LENGTH_ISSET_ID = 2; - private BitSet __isset_bit_vector = new BitSet(3); - + private byte __isset_bitfield = 0; 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); @@ -145,8 +160,7 @@ public ClientBlockInfo( * Performs a deep copy on other. */ public ClientBlockInfo(ClientBlockInfo other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.blockId = other.blockId; this.offset = other.offset; this.length = other.length; @@ -185,16 +199,16 @@ public ClientBlockInfo setBlockId(long blockId) { } public void unsetBlockId() { - __isset_bit_vector.clear(__BLOCKID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID); } /** Returns true if field blockId is set (has been assigned a value) and false otherwise */ public boolean isSetBlockId() { - return __isset_bit_vector.get(__BLOCKID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID); } public void setBlockIdIsSet(boolean value) { - __isset_bit_vector.set(__BLOCKID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value); } public long getOffset() { @@ -208,16 +222,16 @@ public ClientBlockInfo setOffset(long offset) { } public void unsetOffset() { - __isset_bit_vector.clear(__OFFSET_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __OFFSET_ISSET_ID); } /** Returns true if field offset is set (has been assigned a value) and false otherwise */ public boolean isSetOffset() { - return __isset_bit_vector.get(__OFFSET_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __OFFSET_ISSET_ID); } public void setOffsetIsSet(boolean value) { - __isset_bit_vector.set(__OFFSET_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __OFFSET_ISSET_ID, value); } public long getLength() { @@ -231,16 +245,16 @@ public ClientBlockInfo setLength(long length) { } public void unsetLength() { - __isset_bit_vector.clear(__LENGTH_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LENGTH_ISSET_ID); } /** Returns true if field length is set (has been assigned a value) and false otherwise */ public boolean isSetLength() { - return __isset_bit_vector.get(__LENGTH_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __LENGTH_ISSET_ID); } public void setLengthIsSet(boolean value) { - __isset_bit_vector.set(__LENGTH_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LENGTH_ISSET_ID, value); } public int getLocationsSize() { @@ -469,95 +483,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // BLOCK_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.blockId = iprot.readI64(); - setBlockIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // OFFSET - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.offset = iprot.readI64(); - setOffsetIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // LENGTH - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.length = iprot.readI64(); - setLengthIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // LOCATIONS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); - this.locations = new ArrayList(_list0.size); - for (int _i1 = 0; _i1 < _list0.size; ++_i1) - { - NetAddress _elem2; // required - _elem2 = new NetAddress(); - _elem2.read(iprot); - this.locations.add(_elem2); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); - oprot.writeI64(this.blockId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(OFFSET_FIELD_DESC); - oprot.writeI64(this.offset); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(LENGTH_FIELD_DESC); - oprot.writeI64(this.length); - oprot.writeFieldEnd(); - if (this.locations != null) { - oprot.writeFieldBegin(LOCATIONS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.locations.size())); - for (NetAddress _iter3 : this.locations) - { - _iter3.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -590,6 +520,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -603,12 +534,193 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class ClientBlockInfoStandardSchemeFactory implements SchemeFactory { + public ClientBlockInfoStandardScheme getScheme() { + return new ClientBlockInfoStandardScheme(); + } + } + + private static class ClientBlockInfoStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ClientBlockInfo struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // BLOCK_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // OFFSET + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.offset = iprot.readI64(); + struct.setOffsetIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // LENGTH + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.length = iprot.readI64(); + struct.setLengthIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // LOCATIONS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list0 = iprot.readListBegin(); + struct.locations = new ArrayList(_list0.size); + for (int _i1 = 0; _i1 < _list0.size; ++_i1) + { + NetAddress _elem2; // required + _elem2 = new NetAddress(); + _elem2.read(iprot); + struct.locations.add(_elem2); + } + iprot.readListEnd(); + } + struct.setLocationsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, ClientBlockInfo struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); + oprot.writeI64(struct.blockId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(OFFSET_FIELD_DESC); + oprot.writeI64(struct.offset); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(LENGTH_FIELD_DESC); + oprot.writeI64(struct.length); + oprot.writeFieldEnd(); + if (struct.locations != null) { + oprot.writeFieldBegin(LOCATIONS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.locations.size())); + for (NetAddress _iter3 : struct.locations) + { + _iter3.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ClientBlockInfoTupleSchemeFactory implements SchemeFactory { + public ClientBlockInfoTupleScheme getScheme() { + return new ClientBlockInfoTupleScheme(); + } + } + + private static class ClientBlockInfoTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ClientBlockInfo struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetBlockId()) { + optionals.set(0); + } + if (struct.isSetOffset()) { + optionals.set(1); + } + if (struct.isSetLength()) { + optionals.set(2); + } + if (struct.isSetLocations()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetBlockId()) { + oprot.writeI64(struct.blockId); + } + if (struct.isSetOffset()) { + oprot.writeI64(struct.offset); + } + if (struct.isSetLength()) { + oprot.writeI64(struct.length); + } + if (struct.isSetLocations()) { + { + oprot.writeI32(struct.locations.size()); + for (NetAddress _iter4 : struct.locations) + { + _iter4.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ClientBlockInfo struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } + if (incoming.get(1)) { + struct.offset = iprot.readI64(); + struct.setOffsetIsSet(true); + } + if (incoming.get(2)) { + struct.length = iprot.readI64(); + struct.setLengthIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TList _list5 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.locations = new ArrayList(_list5.size); + for (int _i6 = 0; _i6 < _list5.size; ++_i6) + { + NetAddress _elem7; // required + _elem7 = new NetAddress(); + _elem7.read(iprot); + struct.locations.add(_elem7); + } + } + struct.setLocationsIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/ClientDependencyInfo.java b/src/main/java/tachyon/thrift/ClientDependencyInfo.java new file mode 100644 index 000000000000..69f5d18a8971 --- /dev/null +++ b/src/main/java/tachyon/thrift/ClientDependencyInfo.java @@ -0,0 +1,842 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package tachyon.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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class ClientDependencyInfo implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("ClientDependencyInfo"); + + private static final org.apache.thrift.protocol.TField ID_FIELD_DESC = new org.apache.thrift.protocol.TField("id", org.apache.thrift.protocol.TType.I32, (short)1); + private static final org.apache.thrift.protocol.TField PARENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("parents", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final org.apache.thrift.protocol.TField CHILDREN_FIELD_DESC = new org.apache.thrift.protocol.TField("children", org.apache.thrift.protocol.TType.LIST, (short)3); + private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.LIST, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ClientDependencyInfoStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ClientDependencyInfoTupleSchemeFactory()); + } + + public int id; // required + public List parents; // required + public List children; // required + public List data; // 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 { + ID((short)1, "id"), + PARENTS((short)2, "parents"), + CHILDREN((short)3, "children"), + DATA((short)4, "data"); + + 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: // ID + return ID; + case 2: // PARENTS + return PARENTS; + case 3: // CHILDREN + return CHILDREN; + case 4: // DATA + return DATA; + 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 + private static final int __ID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.ID, new org.apache.thrift.meta_data.FieldMetaData("id", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.PARENTS, new org.apache.thrift.meta_data.FieldMetaData("parents", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); + tmpMap.put(_Fields.CHILDREN, new org.apache.thrift.meta_data.FieldMetaData("children", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); + tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ClientDependencyInfo.class, metaDataMap); + } + + public ClientDependencyInfo() { + } + + public ClientDependencyInfo( + int id, + List parents, + List children, + List data) + { + this(); + this.id = id; + setIdIsSet(true); + this.parents = parents; + this.children = children; + this.data = data; + } + + /** + * Performs a deep copy on other. + */ + public ClientDependencyInfo(ClientDependencyInfo other) { + __isset_bitfield = other.__isset_bitfield; + this.id = other.id; + if (other.isSetParents()) { + List __this__parents = new ArrayList(); + for (Integer other_element : other.parents) { + __this__parents.add(other_element); + } + this.parents = __this__parents; + } + if (other.isSetChildren()) { + List __this__children = new ArrayList(); + for (Integer other_element : other.children) { + __this__children.add(other_element); + } + this.children = __this__children; + } + if (other.isSetData()) { + List __this__data = new ArrayList(); + for (ByteBuffer other_element : other.data) { + ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element); +; + __this__data.add(temp_binary_element); + } + this.data = __this__data; + } + } + + public ClientDependencyInfo deepCopy() { + return new ClientDependencyInfo(this); + } + + @Override + public void clear() { + setIdIsSet(false); + this.id = 0; + this.parents = null; + this.children = null; + this.data = null; + } + + public int getId() { + return this.id; + } + + public ClientDependencyInfo setId(int id) { + this.id = id; + setIdIsSet(true); + return this; + } + + public void unsetId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); + } + + /** Returns true if field id is set (has been assigned a value) and false otherwise */ + public boolean isSetId() { + return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); + } + + public void setIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); + } + + public int getParentsSize() { + return (this.parents == null) ? 0 : this.parents.size(); + } + + public java.util.Iterator getParentsIterator() { + return (this.parents == null) ? null : this.parents.iterator(); + } + + public void addToParents(int elem) { + if (this.parents == null) { + this.parents = new ArrayList(); + } + this.parents.add(elem); + } + + public List getParents() { + return this.parents; + } + + public ClientDependencyInfo setParents(List parents) { + this.parents = parents; + return this; + } + + public void unsetParents() { + this.parents = null; + } + + /** Returns true if field parents is set (has been assigned a value) and false otherwise */ + public boolean isSetParents() { + return this.parents != null; + } + + public void setParentsIsSet(boolean value) { + if (!value) { + this.parents = null; + } + } + + public int getChildrenSize() { + return (this.children == null) ? 0 : this.children.size(); + } + + public java.util.Iterator getChildrenIterator() { + return (this.children == null) ? null : this.children.iterator(); + } + + public void addToChildren(int elem) { + if (this.children == null) { + this.children = new ArrayList(); + } + this.children.add(elem); + } + + public List getChildren() { + return this.children; + } + + public ClientDependencyInfo setChildren(List children) { + this.children = children; + return this; + } + + public void unsetChildren() { + this.children = null; + } + + /** Returns true if field children is set (has been assigned a value) and false otherwise */ + public boolean isSetChildren() { + return this.children != null; + } + + public void setChildrenIsSet(boolean value) { + if (!value) { + this.children = null; + } + } + + public int getDataSize() { + return (this.data == null) ? 0 : this.data.size(); + } + + public java.util.Iterator getDataIterator() { + return (this.data == null) ? null : this.data.iterator(); + } + + public void addToData(ByteBuffer elem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(elem); + } + + public List getData() { + return this.data; + } + + public ClientDependencyInfo setData(List data) { + this.data = data; + return this; + } + + public void unsetData() { + this.data = null; + } + + /** Returns true if field data is set (has been assigned a value) and false otherwise */ + public boolean isSetData() { + return this.data != null; + } + + public void setDataIsSet(boolean value) { + if (!value) { + this.data = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case ID: + if (value == null) { + unsetId(); + } else { + setId((Integer)value); + } + break; + + case PARENTS: + if (value == null) { + unsetParents(); + } else { + setParents((List)value); + } + break; + + case CHILDREN: + if (value == null) { + unsetChildren(); + } else { + setChildren((List)value); + } + break; + + case DATA: + if (value == null) { + unsetData(); + } else { + setData((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case ID: + return Integer.valueOf(getId()); + + case PARENTS: + return getParents(); + + case CHILDREN: + return getChildren(); + + case DATA: + return getData(); + + } + 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 ID: + return isSetId(); + case PARENTS: + return isSetParents(); + case CHILDREN: + return isSetChildren(); + case DATA: + return isSetData(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof ClientDependencyInfo) + return this.equals((ClientDependencyInfo)that); + return false; + } + + public boolean equals(ClientDependencyInfo that) { + if (that == null) + return false; + + boolean this_present_id = true; + boolean that_present_id = true; + if (this_present_id || that_present_id) { + if (!(this_present_id && that_present_id)) + return false; + if (this.id != that.id) + return false; + } + + boolean this_present_parents = true && this.isSetParents(); + boolean that_present_parents = true && that.isSetParents(); + if (this_present_parents || that_present_parents) { + if (!(this_present_parents && that_present_parents)) + return false; + if (!this.parents.equals(that.parents)) + return false; + } + + boolean this_present_children = true && this.isSetChildren(); + boolean that_present_children = true && that.isSetChildren(); + if (this_present_children || that_present_children) { + if (!(this_present_children && that_present_children)) + return false; + if (!this.children.equals(that.children)) + return false; + } + + boolean this_present_data = true && this.isSetData(); + boolean that_present_data = true && that.isSetData(); + if (this_present_data || that_present_data) { + if (!(this_present_data && that_present_data)) + return false; + if (!this.data.equals(that.data)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(ClientDependencyInfo other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + ClientDependencyInfo typedOther = (ClientDependencyInfo)other; + + lastComparison = Boolean.valueOf(isSetId()).compareTo(typedOther.isSetId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.id, typedOther.id); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetParents()).compareTo(typedOther.isSetParents()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParents()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parents, typedOther.parents); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetChildren()).compareTo(typedOther.isSetChildren()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetChildren()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.children, typedOther.children); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetData()).compareTo(typedOther.isSetData()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetData()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, typedOther.data); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("ClientDependencyInfo("); + boolean first = true; + + sb.append("id:"); + sb.append(this.id); + first = false; + if (!first) sb.append(", "); + sb.append("parents:"); + if (this.parents == null) { + sb.append("null"); + } else { + sb.append(this.parents); + } + first = false; + if (!first) sb.append(", "); + sb.append("children:"); + if (this.children == null) { + sb.append("null"); + } else { + sb.append(this.children); + } + first = false; + if (!first) sb.append(", "); + sb.append("data:"); + if (this.data == null) { + sb.append("null"); + } else { + sb.append(this.data); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class ClientDependencyInfoStandardSchemeFactory implements SchemeFactory { + public ClientDependencyInfoStandardScheme getScheme() { + return new ClientDependencyInfoStandardScheme(); + } + } + + private static class ClientDependencyInfoStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ClientDependencyInfo struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.id = iprot.readI32(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // PARENTS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(); + struct.parents = new ArrayList(_list16.size); + for (int _i17 = 0; _i17 < _list16.size; ++_i17) + { + int _elem18; // required + _elem18 = iprot.readI32(); + struct.parents.add(_elem18); + } + iprot.readListEnd(); + } + struct.setParentsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // CHILDREN + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list19 = iprot.readListBegin(); + struct.children = new ArrayList(_list19.size); + for (int _i20 = 0; _i20 < _list19.size; ++_i20) + { + int _elem21; // required + _elem21 = iprot.readI32(); + struct.children.add(_elem21); + } + iprot.readListEnd(); + } + struct.setChildrenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // DATA + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list22 = iprot.readListBegin(); + struct.data = new ArrayList(_list22.size); + for (int _i23 = 0; _i23 < _list22.size; ++_i23) + { + ByteBuffer _elem24; // required + _elem24 = iprot.readBinary(); + struct.data.add(_elem24); + } + iprot.readListEnd(); + } + struct.setDataIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, ClientDependencyInfo struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeI32(struct.id); + oprot.writeFieldEnd(); + if (struct.parents != null) { + oprot.writeFieldBegin(PARENTS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.parents.size())); + for (int _iter25 : struct.parents) + { + oprot.writeI32(_iter25); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.children != null) { + oprot.writeFieldBegin(CHILDREN_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.children.size())); + for (int _iter26 : struct.children) + { + oprot.writeI32(_iter26); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.data != null) { + oprot.writeFieldBegin(DATA_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.data.size())); + for (ByteBuffer _iter27 : struct.data) + { + oprot.writeBinary(_iter27); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ClientDependencyInfoTupleSchemeFactory implements SchemeFactory { + public ClientDependencyInfoTupleScheme getScheme() { + return new ClientDependencyInfoTupleScheme(); + } + } + + private static class ClientDependencyInfoTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ClientDependencyInfo struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetParents()) { + optionals.set(1); + } + if (struct.isSetChildren()) { + optionals.set(2); + } + if (struct.isSetData()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetId()) { + oprot.writeI32(struct.id); + } + if (struct.isSetParents()) { + { + oprot.writeI32(struct.parents.size()); + for (int _iter28 : struct.parents) + { + oprot.writeI32(_iter28); + } + } + } + if (struct.isSetChildren()) { + { + oprot.writeI32(struct.children.size()); + for (int _iter29 : struct.children) + { + oprot.writeI32(_iter29); + } + } + } + if (struct.isSetData()) { + { + oprot.writeI32(struct.data.size()); + for (ByteBuffer _iter30 : struct.data) + { + oprot.writeBinary(_iter30); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ClientDependencyInfo struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.id = iprot.readI32(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list31 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.parents = new ArrayList(_list31.size); + for (int _i32 = 0; _i32 < _list31.size; ++_i32) + { + int _elem33; // required + _elem33 = iprot.readI32(); + struct.parents.add(_elem33); + } + } + struct.setParentsIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list34 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.children = new ArrayList(_list34.size); + for (int _i35 = 0; _i35 < _list34.size; ++_i35) + { + int _elem36; // required + _elem36 = iprot.readI32(); + struct.children.add(_elem36); + } + } + struct.setChildrenIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TList _list37 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.data = new ArrayList(_list37.size); + for (int _i38 = 0; _i38 < _list37.size; ++_i38) + { + ByteBuffer _elem39; // required + _elem39 = iprot.readBinary(); + struct.data.add(_elem39); + } + } + struct.setDataIsSet(true); + } + } + } + +} + diff --git a/src/main/java/tachyon/thrift/ClientFileInfo.java b/src/main/java/tachyon/thrift/ClientFileInfo.java index 3100b34bf75b..65522d2a083f 100644 --- a/src/main/java/tachyon/thrift/ClientFileInfo.java +++ b/src/main/java/tachyon/thrift/ClientFileInfo.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -36,6 +46,14 @@ public class ClientFileInfo implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ClientFileInfoStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ClientFileInfoTupleSchemeFactory()); + } public int id; // required public String name; // required @@ -50,6 +68,8 @@ public class ClientFileInfo implements org.apache.thrift.TBase blockIds; // required + public int dependencyId; // required + public int inMemoryPercentage; // 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 { @@ -65,7 +85,9 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { IN_MEMORY((short)10, "inMemory"), NEED_PIN((short)11, "needPin"), NEED_CACHE((short)12, "needCache"), - BLOCK_IDS((short)13, "blockIds"); + BLOCK_IDS((short)13, "blockIds"), + DEPENDENCY_ID((short)14, "dependencyId"), + IN_MEMORY_PERCENTAGE((short)15, "inMemoryPercentage"); private static final Map byName = new HashMap(); @@ -106,6 +128,10 @@ public static _Fields findByThriftId(int fieldId) { return NEED_CACHE; case 13: // BLOCK_IDS return BLOCK_IDS; + case 14: // DEPENDENCY_ID + return DEPENDENCY_ID; + case 15: // IN_MEMORY_PERCENTAGE + return IN_MEMORY_PERCENTAGE; default: return null; } @@ -155,8 +181,9 @@ public String getFieldName() { private static final int __INMEMORY_ISSET_ID = 6; private static final int __NEEDPIN_ISSET_ID = 7; private static final int __NEEDCACHE_ISSET_ID = 8; - private BitSet __isset_bit_vector = new BitSet(9); - + private static final int __DEPENDENCYID_ISSET_ID = 9; + private static final int __INMEMORYPERCENTAGE_ISSET_ID = 10; + private short __isset_bitfield = 0; 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); @@ -187,6 +214,10 @@ public String getFieldName() { tmpMap.put(_Fields.BLOCK_IDS, new org.apache.thrift.meta_data.FieldMetaData("blockIds", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64)))); + tmpMap.put(_Fields.DEPENDENCY_ID, new org.apache.thrift.meta_data.FieldMetaData("dependencyId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.IN_MEMORY_PERCENTAGE, new org.apache.thrift.meta_data.FieldMetaData("inMemoryPercentage", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(ClientFileInfo.class, metaDataMap); } @@ -207,7 +238,9 @@ public ClientFileInfo( boolean inMemory, boolean needPin, boolean needCache, - List blockIds) + List blockIds, + int dependencyId, + int inMemoryPercentage) { this(); this.id = id; @@ -232,14 +265,17 @@ public ClientFileInfo( this.needCache = needCache; setNeedCacheIsSet(true); this.blockIds = blockIds; + this.dependencyId = dependencyId; + setDependencyIdIsSet(true); + this.inMemoryPercentage = inMemoryPercentage; + setInMemoryPercentageIsSet(true); } /** * Performs a deep copy on other. */ public ClientFileInfo(ClientFileInfo other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.id = other.id; if (other.isSetName()) { this.name = other.name; @@ -265,6 +301,8 @@ public ClientFileInfo(ClientFileInfo other) { } this.blockIds = __this__blockIds; } + this.dependencyId = other.dependencyId; + this.inMemoryPercentage = other.inMemoryPercentage; } public ClientFileInfo deepCopy() { @@ -295,6 +333,10 @@ public void clear() { setNeedCacheIsSet(false); this.needCache = false; this.blockIds = null; + setDependencyIdIsSet(false); + this.dependencyId = 0; + setInMemoryPercentageIsSet(false); + this.inMemoryPercentage = 0; } public int getId() { @@ -308,16 +350,16 @@ public ClientFileInfo setId(int id) { } public void unsetId() { - __isset_bit_vector.clear(__ID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); } /** Returns true if field id is set (has been assigned a value) and false otherwise */ public boolean isSetId() { - return __isset_bit_vector.get(__ID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); } public void setIdIsSet(boolean value) { - __isset_bit_vector.set(__ID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); } public String getName() { @@ -403,16 +445,16 @@ public ClientFileInfo setLength(long length) { } public void unsetLength() { - __isset_bit_vector.clear(__LENGTH_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LENGTH_ISSET_ID); } /** Returns true if field length is set (has been assigned a value) and false otherwise */ public boolean isSetLength() { - return __isset_bit_vector.get(__LENGTH_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __LENGTH_ISSET_ID); } public void setLengthIsSet(boolean value) { - __isset_bit_vector.set(__LENGTH_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LENGTH_ISSET_ID, value); } public long getBlockSizeByte() { @@ -426,16 +468,16 @@ public ClientFileInfo setBlockSizeByte(long blockSizeByte) { } public void unsetBlockSizeByte() { - __isset_bit_vector.clear(__BLOCKSIZEBYTE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKSIZEBYTE_ISSET_ID); } /** Returns true if field blockSizeByte is set (has been assigned a value) and false otherwise */ public boolean isSetBlockSizeByte() { - return __isset_bit_vector.get(__BLOCKSIZEBYTE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __BLOCKSIZEBYTE_ISSET_ID); } public void setBlockSizeByteIsSet(boolean value) { - __isset_bit_vector.set(__BLOCKSIZEBYTE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKSIZEBYTE_ISSET_ID, value); } public long getCreationTimeMs() { @@ -449,16 +491,16 @@ public ClientFileInfo setCreationTimeMs(long creationTimeMs) { } public void unsetCreationTimeMs() { - __isset_bit_vector.clear(__CREATIONTIMEMS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CREATIONTIMEMS_ISSET_ID); } /** Returns true if field creationTimeMs is set (has been assigned a value) and false otherwise */ public boolean isSetCreationTimeMs() { - return __isset_bit_vector.get(__CREATIONTIMEMS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __CREATIONTIMEMS_ISSET_ID); } public void setCreationTimeMsIsSet(boolean value) { - __isset_bit_vector.set(__CREATIONTIMEMS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CREATIONTIMEMS_ISSET_ID, value); } public boolean isComplete() { @@ -472,16 +514,16 @@ public ClientFileInfo setComplete(boolean complete) { } public void unsetComplete() { - __isset_bit_vector.clear(__COMPLETE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COMPLETE_ISSET_ID); } /** Returns true if field complete is set (has been assigned a value) and false otherwise */ public boolean isSetComplete() { - return __isset_bit_vector.get(__COMPLETE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __COMPLETE_ISSET_ID); } public void setCompleteIsSet(boolean value) { - __isset_bit_vector.set(__COMPLETE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COMPLETE_ISSET_ID, value); } public boolean isFolder() { @@ -495,16 +537,16 @@ public ClientFileInfo setFolder(boolean folder) { } public void unsetFolder() { - __isset_bit_vector.clear(__FOLDER_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FOLDER_ISSET_ID); } /** Returns true if field folder is set (has been assigned a value) and false otherwise */ public boolean isSetFolder() { - return __isset_bit_vector.get(__FOLDER_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __FOLDER_ISSET_ID); } public void setFolderIsSet(boolean value) { - __isset_bit_vector.set(__FOLDER_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FOLDER_ISSET_ID, value); } public boolean isInMemory() { @@ -518,16 +560,16 @@ public ClientFileInfo setInMemory(boolean inMemory) { } public void unsetInMemory() { - __isset_bit_vector.clear(__INMEMORY_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INMEMORY_ISSET_ID); } /** Returns true if field inMemory is set (has been assigned a value) and false otherwise */ public boolean isSetInMemory() { - return __isset_bit_vector.get(__INMEMORY_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __INMEMORY_ISSET_ID); } public void setInMemoryIsSet(boolean value) { - __isset_bit_vector.set(__INMEMORY_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INMEMORY_ISSET_ID, value); } public boolean isNeedPin() { @@ -541,16 +583,16 @@ public ClientFileInfo setNeedPin(boolean needPin) { } public void unsetNeedPin() { - __isset_bit_vector.clear(__NEEDPIN_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NEEDPIN_ISSET_ID); } /** Returns true if field needPin is set (has been assigned a value) and false otherwise */ public boolean isSetNeedPin() { - return __isset_bit_vector.get(__NEEDPIN_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __NEEDPIN_ISSET_ID); } public void setNeedPinIsSet(boolean value) { - __isset_bit_vector.set(__NEEDPIN_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NEEDPIN_ISSET_ID, value); } public boolean isNeedCache() { @@ -564,16 +606,16 @@ public ClientFileInfo setNeedCache(boolean needCache) { } public void unsetNeedCache() { - __isset_bit_vector.clear(__NEEDCACHE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __NEEDCACHE_ISSET_ID); } /** Returns true if field needCache is set (has been assigned a value) and false otherwise */ public boolean isSetNeedCache() { - return __isset_bit_vector.get(__NEEDCACHE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __NEEDCACHE_ISSET_ID); } public void setNeedCacheIsSet(boolean value) { - __isset_bit_vector.set(__NEEDCACHE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __NEEDCACHE_ISSET_ID, value); } public int getBlockIdsSize() { @@ -615,6 +657,52 @@ public void setBlockIdsIsSet(boolean value) { } } + public int getDependencyId() { + return this.dependencyId; + } + + public ClientFileInfo setDependencyId(int dependencyId) { + this.dependencyId = dependencyId; + setDependencyIdIsSet(true); + return this; + } + + public void unsetDependencyId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEPENDENCYID_ISSET_ID); + } + + /** Returns true if field dependencyId is set (has been assigned a value) and false otherwise */ + public boolean isSetDependencyId() { + return EncodingUtils.testBit(__isset_bitfield, __DEPENDENCYID_ISSET_ID); + } + + public void setDependencyIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEPENDENCYID_ISSET_ID, value); + } + + public int getInMemoryPercentage() { + return this.inMemoryPercentage; + } + + public ClientFileInfo setInMemoryPercentage(int inMemoryPercentage) { + this.inMemoryPercentage = inMemoryPercentage; + setInMemoryPercentageIsSet(true); + return this; + } + + public void unsetInMemoryPercentage() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INMEMORYPERCENTAGE_ISSET_ID); + } + + /** Returns true if field inMemoryPercentage is set (has been assigned a value) and false otherwise */ + public boolean isSetInMemoryPercentage() { + return EncodingUtils.testBit(__isset_bitfield, __INMEMORYPERCENTAGE_ISSET_ID); + } + + public void setInMemoryPercentageIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INMEMORYPERCENTAGE_ISSET_ID, value); + } + public void setFieldValue(_Fields field, Object value) { switch (field) { case ID: @@ -721,6 +809,22 @@ public void setFieldValue(_Fields field, Object value) { } break; + case DEPENDENCY_ID: + if (value == null) { + unsetDependencyId(); + } else { + setDependencyId((Integer)value); + } + break; + + case IN_MEMORY_PERCENTAGE: + if (value == null) { + unsetInMemoryPercentage(); + } else { + setInMemoryPercentage((Integer)value); + } + break; + } } @@ -765,6 +869,12 @@ public Object getFieldValue(_Fields field) { case BLOCK_IDS: return getBlockIds(); + case DEPENDENCY_ID: + return Integer.valueOf(getDependencyId()); + + case IN_MEMORY_PERCENTAGE: + return Integer.valueOf(getInMemoryPercentage()); + } throw new IllegalStateException(); } @@ -802,6 +912,10 @@ public boolean isSet(_Fields field) { return isSetNeedCache(); case BLOCK_IDS: return isSetBlockIds(); + case DEPENDENCY_ID: + return isSetDependencyId(); + case IN_MEMORY_PERCENTAGE: + return isSetInMemoryPercentage(); } throw new IllegalStateException(); } @@ -936,6 +1050,24 @@ public boolean equals(ClientFileInfo that) { return false; } + boolean this_present_dependencyId = true; + boolean that_present_dependencyId = true; + if (this_present_dependencyId || that_present_dependencyId) { + if (!(this_present_dependencyId && that_present_dependencyId)) + return false; + if (this.dependencyId != that.dependencyId) + return false; + } + + boolean this_present_inMemoryPercentage = true; + boolean that_present_inMemoryPercentage = true; + if (this_present_inMemoryPercentage || that_present_inMemoryPercentage) { + if (!(this_present_inMemoryPercentage && that_present_inMemoryPercentage)) + return false; + if (this.inMemoryPercentage != that.inMemoryPercentage) + return false; + } + return true; } @@ -1082,6 +1214,26 @@ public int compareTo(ClientFileInfo other) { return lastComparison; } } + lastComparison = Boolean.valueOf(isSetDependencyId()).compareTo(typedOther.isSetDependencyId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDependencyId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dependencyId, typedOther.dependencyId); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetInMemoryPercentage()).compareTo(typedOther.isSetInMemoryPercentage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetInMemoryPercentage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.inMemoryPercentage, typedOther.inMemoryPercentage); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -1090,196 +1242,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.id = iprot.readI32(); - setIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.name = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CHECKPOINT_PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.checkpointPath = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 5: // LENGTH - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.length = iprot.readI64(); - setLengthIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 6: // BLOCK_SIZE_BYTE - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.blockSizeByte = iprot.readI64(); - setBlockSizeByteIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 7: // CREATION_TIME_MS - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.creationTimeMs = iprot.readI64(); - setCreationTimeMsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 8: // COMPLETE - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.complete = iprot.readBool(); - setCompleteIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 9: // FOLDER - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.folder = iprot.readBool(); - setFolderIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 10: // IN_MEMORY - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.inMemory = iprot.readBool(); - setInMemoryIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 11: // NEED_PIN - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.needPin = iprot.readBool(); - setNeedPinIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 12: // NEED_CACHE - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.needCache = iprot.readBool(); - setNeedCacheIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 13: // BLOCK_IDS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list4 = iprot.readListBegin(); - this.blockIds = new ArrayList(_list4.size); - for (int _i5 = 0; _i5 < _list4.size; ++_i5) - { - long _elem6; // required - _elem6 = iprot.readI64(); - this.blockIds.add(_elem6); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeI32(this.id); - oprot.writeFieldEnd(); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - if (this.checkpointPath != null) { - oprot.writeFieldBegin(CHECKPOINT_PATH_FIELD_DESC); - oprot.writeString(this.checkpointPath); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(LENGTH_FIELD_DESC); - oprot.writeI64(this.length); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(BLOCK_SIZE_BYTE_FIELD_DESC); - oprot.writeI64(this.blockSizeByte); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(CREATION_TIME_MS_FIELD_DESC); - oprot.writeI64(this.creationTimeMs); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(COMPLETE_FIELD_DESC); - oprot.writeBool(this.complete); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(FOLDER_FIELD_DESC); - oprot.writeBool(this.folder); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(IN_MEMORY_FIELD_DESC); - oprot.writeBool(this.inMemory); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(NEED_PIN_FIELD_DESC); - oprot.writeBool(this.needPin); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(NEED_CACHE_FIELD_DESC); - oprot.writeBool(this.needCache); - oprot.writeFieldEnd(); - if (this.blockIds != null) { - oprot.writeFieldBegin(BLOCK_IDS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.blockIds.size())); - for (long _iter7 : this.blockIds) - { - oprot.writeI64(_iter7); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -1354,12 +1321,21 @@ public String toString() { sb.append(this.blockIds); } first = false; + if (!first) sb.append(", "); + sb.append("dependencyId:"); + sb.append(this.dependencyId); + first = false; + if (!first) sb.append(", "); + sb.append("inMemoryPercentage:"); + sb.append(this.inMemoryPercentage); + first = false; sb.append(")"); return sb.toString(); } public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -1373,12 +1349,428 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class ClientFileInfoStandardSchemeFactory implements SchemeFactory { + public ClientFileInfoStandardScheme getScheme() { + return new ClientFileInfoStandardScheme(); + } + } + + private static class ClientFileInfoStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ClientFileInfo struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.id = iprot.readI32(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CHECKPOINT_PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.checkpointPath = iprot.readString(); + struct.setCheckpointPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // LENGTH + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.length = iprot.readI64(); + struct.setLengthIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // BLOCK_SIZE_BYTE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.blockSizeByte = iprot.readI64(); + struct.setBlockSizeByteIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // CREATION_TIME_MS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.creationTimeMs = iprot.readI64(); + struct.setCreationTimeMsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // COMPLETE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.complete = iprot.readBool(); + struct.setCompleteIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // FOLDER + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.folder = iprot.readBool(); + struct.setFolderIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 10: // IN_MEMORY + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.inMemory = iprot.readBool(); + struct.setInMemoryIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 11: // NEED_PIN + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.needPin = iprot.readBool(); + struct.setNeedPinIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 12: // NEED_CACHE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.needCache = iprot.readBool(); + struct.setNeedCacheIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 13: // BLOCK_IDS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); + struct.blockIds = new ArrayList(_list8.size); + for (int _i9 = 0; _i9 < _list8.size; ++_i9) + { + long _elem10; // required + _elem10 = iprot.readI64(); + struct.blockIds.add(_elem10); + } + iprot.readListEnd(); + } + struct.setBlockIdsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 14: // DEPENDENCY_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.dependencyId = iprot.readI32(); + struct.setDependencyIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 15: // IN_MEMORY_PERCENTAGE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.inMemoryPercentage = iprot.readI32(); + struct.setInMemoryPercentageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, ClientFileInfo struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeI32(struct.id); + oprot.writeFieldEnd(); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + if (struct.checkpointPath != null) { + oprot.writeFieldBegin(CHECKPOINT_PATH_FIELD_DESC); + oprot.writeString(struct.checkpointPath); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(LENGTH_FIELD_DESC); + oprot.writeI64(struct.length); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(BLOCK_SIZE_BYTE_FIELD_DESC); + oprot.writeI64(struct.blockSizeByte); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(CREATION_TIME_MS_FIELD_DESC); + oprot.writeI64(struct.creationTimeMs); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(COMPLETE_FIELD_DESC); + oprot.writeBool(struct.complete); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(FOLDER_FIELD_DESC); + oprot.writeBool(struct.folder); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IN_MEMORY_FIELD_DESC); + oprot.writeBool(struct.inMemory); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(NEED_PIN_FIELD_DESC); + oprot.writeBool(struct.needPin); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(NEED_CACHE_FIELD_DESC); + oprot.writeBool(struct.needCache); + oprot.writeFieldEnd(); + if (struct.blockIds != null) { + oprot.writeFieldBegin(BLOCK_IDS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.blockIds.size())); + for (long _iter11 : struct.blockIds) + { + oprot.writeI64(_iter11); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(DEPENDENCY_ID_FIELD_DESC); + oprot.writeI32(struct.dependencyId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(IN_MEMORY_PERCENTAGE_FIELD_DESC); + oprot.writeI32(struct.inMemoryPercentage); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ClientFileInfoTupleSchemeFactory implements SchemeFactory { + public ClientFileInfoTupleScheme getScheme() { + return new ClientFileInfoTupleScheme(); + } + } + + private static class ClientFileInfoTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ClientFileInfo struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetName()) { + optionals.set(1); + } + if (struct.isSetPath()) { + optionals.set(2); + } + if (struct.isSetCheckpointPath()) { + optionals.set(3); + } + if (struct.isSetLength()) { + optionals.set(4); + } + if (struct.isSetBlockSizeByte()) { + optionals.set(5); + } + if (struct.isSetCreationTimeMs()) { + optionals.set(6); + } + if (struct.isSetComplete()) { + optionals.set(7); + } + if (struct.isSetFolder()) { + optionals.set(8); + } + if (struct.isSetInMemory()) { + optionals.set(9); + } + if (struct.isSetNeedPin()) { + optionals.set(10); + } + if (struct.isSetNeedCache()) { + optionals.set(11); + } + if (struct.isSetBlockIds()) { + optionals.set(12); + } + if (struct.isSetDependencyId()) { + optionals.set(13); + } + if (struct.isSetInMemoryPercentage()) { + optionals.set(14); + } + oprot.writeBitSet(optionals, 15); + if (struct.isSetId()) { + oprot.writeI32(struct.id); + } + if (struct.isSetName()) { + oprot.writeString(struct.name); + } + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + if (struct.isSetCheckpointPath()) { + oprot.writeString(struct.checkpointPath); + } + if (struct.isSetLength()) { + oprot.writeI64(struct.length); + } + if (struct.isSetBlockSizeByte()) { + oprot.writeI64(struct.blockSizeByte); + } + if (struct.isSetCreationTimeMs()) { + oprot.writeI64(struct.creationTimeMs); + } + if (struct.isSetComplete()) { + oprot.writeBool(struct.complete); + } + if (struct.isSetFolder()) { + oprot.writeBool(struct.folder); + } + if (struct.isSetInMemory()) { + oprot.writeBool(struct.inMemory); + } + if (struct.isSetNeedPin()) { + oprot.writeBool(struct.needPin); + } + if (struct.isSetNeedCache()) { + oprot.writeBool(struct.needCache); + } + if (struct.isSetBlockIds()) { + { + oprot.writeI32(struct.blockIds.size()); + for (long _iter12 : struct.blockIds) + { + oprot.writeI64(_iter12); + } + } + } + if (struct.isSetDependencyId()) { + oprot.writeI32(struct.dependencyId); + } + if (struct.isSetInMemoryPercentage()) { + oprot.writeI32(struct.inMemoryPercentage); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ClientFileInfo struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(15); + if (incoming.get(0)) { + struct.id = iprot.readI32(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } + if (incoming.get(2)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + if (incoming.get(3)) { + struct.checkpointPath = iprot.readString(); + struct.setCheckpointPathIsSet(true); + } + if (incoming.get(4)) { + struct.length = iprot.readI64(); + struct.setLengthIsSet(true); + } + if (incoming.get(5)) { + struct.blockSizeByte = iprot.readI64(); + struct.setBlockSizeByteIsSet(true); + } + if (incoming.get(6)) { + struct.creationTimeMs = iprot.readI64(); + struct.setCreationTimeMsIsSet(true); + } + if (incoming.get(7)) { + struct.complete = iprot.readBool(); + struct.setCompleteIsSet(true); + } + if (incoming.get(8)) { + struct.folder = iprot.readBool(); + struct.setFolderIsSet(true); + } + if (incoming.get(9)) { + struct.inMemory = iprot.readBool(); + struct.setInMemoryIsSet(true); + } + if (incoming.get(10)) { + struct.needPin = iprot.readBool(); + struct.setNeedPinIsSet(true); + } + if (incoming.get(11)) { + struct.needCache = iprot.readBool(); + struct.setNeedCacheIsSet(true); + } + if (incoming.get(12)) { + { + org.apache.thrift.protocol.TList _list13 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + struct.blockIds = new ArrayList(_list13.size); + for (int _i14 = 0; _i14 < _list13.size; ++_i14) + { + long _elem15; // required + _elem15 = iprot.readI64(); + struct.blockIds.add(_elem15); + } + } + struct.setBlockIdsIsSet(true); + } + if (incoming.get(13)) { + struct.dependencyId = iprot.readI32(); + struct.setDependencyIdIsSet(true); + } + if (incoming.get(14)) { + struct.inMemoryPercentage = iprot.readI32(); + struct.setInMemoryPercentageIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/ClientRawTableInfo.java b/src/main/java/tachyon/thrift/ClientRawTableInfo.java index 6f3b1b157d25..a5f69bb8e0b4 100644 --- a/src/main/java/tachyon/thrift/ClientRawTableInfo.java +++ b/src/main/java/tachyon/thrift/ClientRawTableInfo.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -29,6 +39,12 @@ public class ClientRawTableInfo implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ClientRawTableInfoStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ClientRawTableInfoTupleSchemeFactory()); + } + public int id; // required public String name; // required public String path; // required @@ -108,8 +124,7 @@ public String getFieldName() { // isset id assignments private static final int __ID_ISSET_ID = 0; private static final int __COLUMNS_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private byte __isset_bitfield = 0; 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); @@ -151,8 +166,7 @@ public ClientRawTableInfo( * Performs a deep copy on other. */ public ClientRawTableInfo(ClientRawTableInfo other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.id = other.id; if (other.isSetName()) { this.name = other.name; @@ -193,16 +207,16 @@ public ClientRawTableInfo setId(int id) { } public void unsetId() { - __isset_bit_vector.clear(__ID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); } /** Returns true if field id is set (has been assigned a value) and false otherwise */ public boolean isSetId() { - return __isset_bit_vector.get(__ID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); } public void setIdIsSet(boolean value) { - __isset_bit_vector.set(__ID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); } public String getName() { @@ -264,16 +278,16 @@ public ClientRawTableInfo setColumns(int columns) { } public void unsetColumns() { - __isset_bit_vector.clear(__COLUMNS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COLUMNS_ISSET_ID); } /** Returns true if field columns is set (has been assigned a value) and false otherwise */ public boolean isSetColumns() { - return __isset_bit_vector.get(__COLUMNS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __COLUMNS_ISSET_ID); } public void setColumnsIsSet(boolean value) { - __isset_bit_vector.set(__COLUMNS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COLUMNS_ISSET_ID, value); } public byte[] getMetadata() { @@ -529,90 +543,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.id = iprot.readI32(); - setIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // NAME - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.name = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // COLUMNS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.columns = iprot.readI32(); - setColumnsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 5: // METADATA - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.metadata = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeI32(this.id); - oprot.writeFieldEnd(); - if (this.name != null) { - oprot.writeFieldBegin(NAME_FIELD_DESC); - oprot.writeString(this.name); - oprot.writeFieldEnd(); - } - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(COLUMNS_FIELD_DESC); - oprot.writeI32(this.columns); - oprot.writeFieldEnd(); - if (this.metadata != null) { - oprot.writeFieldBegin(METADATA_FIELD_DESC); - oprot.writeBinary(this.metadata); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -657,6 +592,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -670,12 +606,184 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class ClientRawTableInfoStandardSchemeFactory implements SchemeFactory { + public ClientRawTableInfoStandardScheme getScheme() { + return new ClientRawTableInfoStandardScheme(); + } + } + + private static class ClientRawTableInfoStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ClientRawTableInfo struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.id = iprot.readI32(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // NAME + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.columns = iprot.readI32(); + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // METADATA + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.metadata = iprot.readBinary(); + struct.setMetadataIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, ClientRawTableInfo struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeI32(struct.id); + oprot.writeFieldEnd(); + if (struct.name != null) { + oprot.writeFieldBegin(NAME_FIELD_DESC); + oprot.writeString(struct.name); + oprot.writeFieldEnd(); + } + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + oprot.writeI32(struct.columns); + oprot.writeFieldEnd(); + if (struct.metadata != null) { + oprot.writeFieldBegin(METADATA_FIELD_DESC); + oprot.writeBinary(struct.metadata); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ClientRawTableInfoTupleSchemeFactory implements SchemeFactory { + public ClientRawTableInfoTupleScheme getScheme() { + return new ClientRawTableInfoTupleScheme(); + } + } + + private static class ClientRawTableInfoTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ClientRawTableInfo struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetName()) { + optionals.set(1); + } + if (struct.isSetPath()) { + optionals.set(2); + } + if (struct.isSetColumns()) { + optionals.set(3); + } + if (struct.isSetMetadata()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetId()) { + oprot.writeI32(struct.id); + } + if (struct.isSetName()) { + oprot.writeString(struct.name); + } + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + if (struct.isSetColumns()) { + oprot.writeI32(struct.columns); + } + if (struct.isSetMetadata()) { + oprot.writeBinary(struct.metadata); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ClientRawTableInfo struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.id = iprot.readI32(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.name = iprot.readString(); + struct.setNameIsSet(true); + } + if (incoming.get(2)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + if (incoming.get(3)) { + struct.columns = iprot.readI32(); + struct.setColumnsIsSet(true); + } + if (incoming.get(4)) { + struct.metadata = iprot.readBinary(); + struct.setMetadataIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/ClientWorkerInfo.java b/src/main/java/tachyon/thrift/ClientWorkerInfo.java index 3c165639df12..9cb8d26b3789 100644 --- a/src/main/java/tachyon/thrift/ClientWorkerInfo.java +++ b/src/main/java/tachyon/thrift/ClientWorkerInfo.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -31,6 +41,12 @@ public class ClientWorkerInfo implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new ClientWorkerInfoStandardSchemeFactory()); + schemes.put(TupleScheme.class, new ClientWorkerInfoTupleSchemeFactory()); + } + public long id; // required public NetAddress address; // required public int lastContactSec; // required @@ -121,8 +137,7 @@ public String getFieldName() { private static final int __CAPACITYBYTES_ISSET_ID = 2; private static final int __USEDBYTES_ISSET_ID = 3; private static final int __STARTTIMEMS_ISSET_ID = 4; - private BitSet __isset_bit_vector = new BitSet(5); - + private byte __isset_bitfield = 0; 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); @@ -175,8 +190,7 @@ public ClientWorkerInfo( * Performs a deep copy on other. */ public ClientWorkerInfo(ClientWorkerInfo other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.id = other.id; if (other.isSetAddress()) { this.address = new NetAddress(other.address); @@ -221,16 +235,16 @@ public ClientWorkerInfo setId(long id) { } public void unsetId() { - __isset_bit_vector.clear(__ID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __ID_ISSET_ID); } /** Returns true if field id is set (has been assigned a value) and false otherwise */ public boolean isSetId() { - return __isset_bit_vector.get(__ID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __ID_ISSET_ID); } public void setIdIsSet(boolean value) { - __isset_bit_vector.set(__ID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __ID_ISSET_ID, value); } public NetAddress getAddress() { @@ -268,16 +282,16 @@ public ClientWorkerInfo setLastContactSec(int lastContactSec) { } public void unsetLastContactSec() { - __isset_bit_vector.clear(__LASTCONTACTSEC_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LASTCONTACTSEC_ISSET_ID); } /** Returns true if field lastContactSec is set (has been assigned a value) and false otherwise */ public boolean isSetLastContactSec() { - return __isset_bit_vector.get(__LASTCONTACTSEC_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __LASTCONTACTSEC_ISSET_ID); } public void setLastContactSecIsSet(boolean value) { - __isset_bit_vector.set(__LASTCONTACTSEC_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LASTCONTACTSEC_ISSET_ID, value); } public String getState() { @@ -315,16 +329,16 @@ public ClientWorkerInfo setCapacityBytes(long capacityBytes) { } public void unsetCapacityBytes() { - __isset_bit_vector.clear(__CAPACITYBYTES_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CAPACITYBYTES_ISSET_ID); } /** Returns true if field capacityBytes is set (has been assigned a value) and false otherwise */ public boolean isSetCapacityBytes() { - return __isset_bit_vector.get(__CAPACITYBYTES_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __CAPACITYBYTES_ISSET_ID); } public void setCapacityBytesIsSet(boolean value) { - __isset_bit_vector.set(__CAPACITYBYTES_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CAPACITYBYTES_ISSET_ID, value); } public long getUsedBytes() { @@ -338,16 +352,16 @@ public ClientWorkerInfo setUsedBytes(long usedBytes) { } public void unsetUsedBytes() { - __isset_bit_vector.clear(__USEDBYTES_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } /** Returns true if field usedBytes is set (has been assigned a value) and false otherwise */ public boolean isSetUsedBytes() { - return __isset_bit_vector.get(__USEDBYTES_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } public void setUsedBytesIsSet(boolean value) { - __isset_bit_vector.set(__USEDBYTES_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USEDBYTES_ISSET_ID, value); } public long getStarttimeMs() { @@ -361,16 +375,16 @@ public ClientWorkerInfo setStarttimeMs(long starttimeMs) { } public void unsetStarttimeMs() { - __isset_bit_vector.clear(__STARTTIMEMS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __STARTTIMEMS_ISSET_ID); } /** Returns true if field starttimeMs is set (has been assigned a value) and false otherwise */ public boolean isSetStarttimeMs() { - return __isset_bit_vector.get(__STARTTIMEMS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __STARTTIMEMS_ISSET_ID); } public void setStarttimeMsIsSet(boolean value) { - __isset_bit_vector.set(__STARTTIMEMS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __STARTTIMEMS_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -656,112 +670,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.id = iprot.readI64(); - setIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // ADDRESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.address = new NetAddress(); - this.address.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // LAST_CONTACT_SEC - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.lastContactSec = iprot.readI32(); - setLastContactSecIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // STATE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.state = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 5: // CAPACITY_BYTES - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.capacityBytes = iprot.readI64(); - setCapacityBytesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 6: // USED_BYTES - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.usedBytes = iprot.readI64(); - setUsedBytesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 7: // STARTTIME_MS - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.starttimeMs = iprot.readI64(); - setStarttimeMsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(ID_FIELD_DESC); - oprot.writeI64(this.id); - oprot.writeFieldEnd(); - if (this.address != null) { - oprot.writeFieldBegin(ADDRESS_FIELD_DESC); - this.address.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(LAST_CONTACT_SEC_FIELD_DESC); - oprot.writeI32(this.lastContactSec); - oprot.writeFieldEnd(); - if (this.state != null) { - oprot.writeFieldBegin(STATE_FIELD_DESC); - oprot.writeString(this.state); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(CAPACITY_BYTES_FIELD_DESC); - oprot.writeI64(this.capacityBytes); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(USED_BYTES_FIELD_DESC); - oprot.writeI64(this.usedBytes); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(STARTTIME_MS_FIELD_DESC); - oprot.writeI64(this.starttimeMs); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -810,6 +723,10 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (address != null) { + address.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -823,12 +740,226 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class ClientWorkerInfoStandardSchemeFactory implements SchemeFactory { + public ClientWorkerInfoStandardScheme getScheme() { + return new ClientWorkerInfoStandardScheme(); + } + } + + private static class ClientWorkerInfoStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, ClientWorkerInfo struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.id = iprot.readI64(); + struct.setIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // ADDRESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.address = new NetAddress(); + struct.address.read(iprot); + struct.setAddressIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // LAST_CONTACT_SEC + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.lastContactSec = iprot.readI32(); + struct.setLastContactSecIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // STATE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.state = iprot.readString(); + struct.setStateIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // CAPACITY_BYTES + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.capacityBytes = iprot.readI64(); + struct.setCapacityBytesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // USED_BYTES + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.usedBytes = iprot.readI64(); + struct.setUsedBytesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // STARTTIME_MS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.starttimeMs = iprot.readI64(); + struct.setStarttimeMsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, ClientWorkerInfo struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(ID_FIELD_DESC); + oprot.writeI64(struct.id); + oprot.writeFieldEnd(); + if (struct.address != null) { + oprot.writeFieldBegin(ADDRESS_FIELD_DESC); + struct.address.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(LAST_CONTACT_SEC_FIELD_DESC); + oprot.writeI32(struct.lastContactSec); + oprot.writeFieldEnd(); + if (struct.state != null) { + oprot.writeFieldBegin(STATE_FIELD_DESC); + oprot.writeString(struct.state); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(CAPACITY_BYTES_FIELD_DESC); + oprot.writeI64(struct.capacityBytes); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(USED_BYTES_FIELD_DESC); + oprot.writeI64(struct.usedBytes); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(STARTTIME_MS_FIELD_DESC); + oprot.writeI64(struct.starttimeMs); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class ClientWorkerInfoTupleSchemeFactory implements SchemeFactory { + public ClientWorkerInfoTupleScheme getScheme() { + return new ClientWorkerInfoTupleScheme(); + } + } + + private static class ClientWorkerInfoTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, ClientWorkerInfo struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetId()) { + optionals.set(0); + } + if (struct.isSetAddress()) { + optionals.set(1); + } + if (struct.isSetLastContactSec()) { + optionals.set(2); + } + if (struct.isSetState()) { + optionals.set(3); + } + if (struct.isSetCapacityBytes()) { + optionals.set(4); + } + if (struct.isSetUsedBytes()) { + optionals.set(5); + } + if (struct.isSetStarttimeMs()) { + optionals.set(6); + } + oprot.writeBitSet(optionals, 7); + if (struct.isSetId()) { + oprot.writeI64(struct.id); + } + if (struct.isSetAddress()) { + struct.address.write(oprot); + } + if (struct.isSetLastContactSec()) { + oprot.writeI32(struct.lastContactSec); + } + if (struct.isSetState()) { + oprot.writeString(struct.state); + } + if (struct.isSetCapacityBytes()) { + oprot.writeI64(struct.capacityBytes); + } + if (struct.isSetUsedBytes()) { + oprot.writeI64(struct.usedBytes); + } + if (struct.isSetStarttimeMs()) { + oprot.writeI64(struct.starttimeMs); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, ClientWorkerInfo struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(7); + if (incoming.get(0)) { + struct.id = iprot.readI64(); + struct.setIdIsSet(true); + } + if (incoming.get(1)) { + struct.address = new NetAddress(); + struct.address.read(iprot); + struct.setAddressIsSet(true); + } + if (incoming.get(2)) { + struct.lastContactSec = iprot.readI32(); + struct.setLastContactSecIsSet(true); + } + if (incoming.get(3)) { + struct.state = iprot.readString(); + struct.setStateIsSet(true); + } + if (incoming.get(4)) { + struct.capacityBytes = iprot.readI64(); + struct.setCapacityBytesIsSet(true); + } + if (incoming.get(5)) { + struct.usedBytes = iprot.readI64(); + struct.setUsedBytesIsSet(true); + } + if (incoming.get(6)) { + struct.starttimeMs = iprot.readI64(); + struct.setStarttimeMsIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/Command.java b/src/main/java/tachyon/thrift/Command.java index 87b6137e3554..52b7d4709333 100644 --- a/src/main/java/tachyon/thrift/Command.java +++ b/src/main/java/tachyon/thrift/Command.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -26,6 +36,12 @@ public class Command implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new CommandStandardSchemeFactory()); + schemes.put(TupleScheme.class, new CommandTupleSchemeFactory()); + } + /** * * @see CommandType @@ -99,7 +115,6 @@ public String getFieldName() { } // 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); @@ -344,73 +359,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // M_COMMAND_TYPE - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.mCommandType = CommandType.findByValue(iprot.readI32()); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // M_DATA - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list8 = iprot.readListBegin(); - this.mData = new ArrayList(_list8.size); - for (int _i9 = 0; _i9 < _list8.size; ++_i9) - { - long _elem10; // required - _elem10 = iprot.readI64(); - this.mData.add(_elem10); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.mCommandType != null) { - oprot.writeFieldBegin(M_COMMAND_TYPE_FIELD_DESC); - oprot.writeI32(this.mCommandType.getValue()); - oprot.writeFieldEnd(); - } - if (this.mData != null) { - oprot.writeFieldBegin(M_DATA_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.mData.size())); - for (long _iter11 : this.mData) - { - oprot.writeI64(_iter11); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -439,6 +392,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -457,5 +411,144 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class CommandStandardSchemeFactory implements SchemeFactory { + public CommandStandardScheme getScheme() { + return new CommandStandardScheme(); + } + } + + private static class CommandStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, Command struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // M_COMMAND_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.mCommandType = CommandType.findByValue(iprot.readI32()); + struct.setMCommandTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // M_DATA + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list40 = iprot.readListBegin(); + struct.mData = new ArrayList(_list40.size); + for (int _i41 = 0; _i41 < _list40.size; ++_i41) + { + long _elem42; // required + _elem42 = iprot.readI64(); + struct.mData.add(_elem42); + } + iprot.readListEnd(); + } + struct.setMDataIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, Command struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.mCommandType != null) { + oprot.writeFieldBegin(M_COMMAND_TYPE_FIELD_DESC); + oprot.writeI32(struct.mCommandType.getValue()); + oprot.writeFieldEnd(); + } + if (struct.mData != null) { + oprot.writeFieldBegin(M_DATA_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.mData.size())); + for (long _iter43 : struct.mData) + { + oprot.writeI64(_iter43); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class CommandTupleSchemeFactory implements SchemeFactory { + public CommandTupleScheme getScheme() { + return new CommandTupleScheme(); + } + } + + private static class CommandTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, Command struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMCommandType()) { + optionals.set(0); + } + if (struct.isSetMData()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetMCommandType()) { + oprot.writeI32(struct.mCommandType.getValue()); + } + if (struct.isSetMData()) { + { + oprot.writeI32(struct.mData.size()); + for (long _iter44 : struct.mData) + { + oprot.writeI64(_iter44); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, Command struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.mCommandType = CommandType.findByValue(iprot.readI32()); + struct.setMCommandTypeIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list45 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + struct.mData = new ArrayList(_list45.size); + for (int _i46 = 0; _i46 < _list45.size; ++_i46) + { + long _elem47; // required + _elem47 = iprot.readI64(); + struct.mData.add(_elem47); + } + } + struct.setMDataIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/CommandType.java b/src/main/java/tachyon/thrift/CommandType.java index 41fe31a55405..0d57bd4429df 100644 --- a/src/main/java/tachyon/thrift/CommandType.java +++ b/src/main/java/tachyon/thrift/CommandType.java @@ -1,7 +1,8 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.thrift; diff --git a/src/main/java/tachyon/thrift/CoordinatorService.java b/src/main/java/tachyon/thrift/CoordinatorService.java deleted file mode 100644 index a1459965a98d..000000000000 --- a/src/main/java/tachyon/thrift/CoordinatorService.java +++ /dev/null @@ -1,1562 +0,0 @@ -/** - * Autogenerated by Thrift Compiler (0.7.0) - * - * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING - */ -package tachyon.thrift; - -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 org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class CoordinatorService { - - public interface Iface { - - /** - * Get the max transaction id of one master. - * @return max transaction of the master - */ - public long getMaxTransactionId() throws org.apache.thrift.TException; - - /** - * Send transactions. - * @return max transaction id. - * - * @param leftTransactionId - * @param rightTransactionId - * @param transactions - */ - public long sendNewTransactions(long leftTransactionId, long rightTransactionId, List transactions) throws org.apache.thrift.TException; - - } - - public interface AsyncIface { - - public void getMaxTransactionId(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - public void sendNewTransactions(long leftTransactionId, long rightTransactionId, List transactions, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - - } - - public static class Client extends org.apache.thrift.TServiceClient 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 long getMaxTransactionId() throws org.apache.thrift.TException - { - send_getMaxTransactionId(); - return recv_getMaxTransactionId(); - } - - public void send_getMaxTransactionId() throws org.apache.thrift.TException - { - getMaxTransactionId_args args = new getMaxTransactionId_args(); - sendBase("getMaxTransactionId", args); - } - - public long recv_getMaxTransactionId() throws org.apache.thrift.TException - { - getMaxTransactionId_result result = new getMaxTransactionId_result(); - receiveBase(result, "getMaxTransactionId"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getMaxTransactionId failed: unknown result"); - } - - public long sendNewTransactions(long leftTransactionId, long rightTransactionId, List transactions) throws org.apache.thrift.TException - { - send_sendNewTransactions(leftTransactionId, rightTransactionId, transactions); - return recv_sendNewTransactions(); - } - - public void send_sendNewTransactions(long leftTransactionId, long rightTransactionId, List transactions) throws org.apache.thrift.TException - { - sendNewTransactions_args args = new sendNewTransactions_args(); - args.setLeftTransactionId(leftTransactionId); - args.setRightTransactionId(rightTransactionId); - args.setTransactions(transactions); - sendBase("sendNewTransactions", args); - } - - public long recv_sendNewTransactions() throws org.apache.thrift.TException - { - sendNewTransactions_result result = new sendNewTransactions_result(); - receiveBase(result, "sendNewTransactions"); - if (result.isSetSuccess()) { - return result.success; - } - throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "sendNewTransactions failed: unknown result"); - } - - } - public static class AsyncClient extends org.apache.thrift.async.TAsyncClient 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 getMaxTransactionId(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - getMaxTransactionId_call method_call = new getMaxTransactionId_call(resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class getMaxTransactionId_call extends org.apache.thrift.async.TAsyncMethodCall { - public getMaxTransactionId_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("getMaxTransactionId", org.apache.thrift.protocol.TMessageType.CALL, 0)); - getMaxTransactionId_args args = new getMaxTransactionId_args(); - args.write(prot); - prot.writeMessageEnd(); - } - - public long 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_getMaxTransactionId(); - } - } - - public void sendNewTransactions(long leftTransactionId, long rightTransactionId, List transactions, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { - checkReady(); - sendNewTransactions_call method_call = new sendNewTransactions_call(leftTransactionId, rightTransactionId, transactions, resultHandler, this, ___protocolFactory, ___transport); - this.___currentMethod = method_call; - ___manager.call(method_call); - } - - public static class sendNewTransactions_call extends org.apache.thrift.async.TAsyncMethodCall { - private long leftTransactionId; - private long rightTransactionId; - private List transactions; - public sendNewTransactions_call(long leftTransactionId, long rightTransactionId, List transactions, 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.leftTransactionId = leftTransactionId; - this.rightTransactionId = rightTransactionId; - this.transactions = transactions; - } - - public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { - prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("sendNewTransactions", org.apache.thrift.protocol.TMessageType.CALL, 0)); - sendNewTransactions_args args = new sendNewTransactions_args(); - args.setLeftTransactionId(leftTransactionId); - args.setRightTransactionId(rightTransactionId); - args.setTransactions(transactions); - args.write(prot); - prot.writeMessageEnd(); - } - - public long 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_sendNewTransactions(); - } - } - - } - - public static class Processor extends org.apache.thrift.TBaseProcessor 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("getMaxTransactionId", new getMaxTransactionId()); - processMap.put("sendNewTransactions", new sendNewTransactions()); - return processMap; - } - - private static class getMaxTransactionId extends org.apache.thrift.ProcessFunction { - public getMaxTransactionId() { - super("getMaxTransactionId"); - } - - protected getMaxTransactionId_args getEmptyArgsInstance() { - return new getMaxTransactionId_args(); - } - - protected getMaxTransactionId_result getResult(I iface, getMaxTransactionId_args args) throws org.apache.thrift.TException { - getMaxTransactionId_result result = new getMaxTransactionId_result(); - result.success = iface.getMaxTransactionId(); - result.setSuccessIsSet(true); - return result; - } - } - - private static class sendNewTransactions extends org.apache.thrift.ProcessFunction { - public sendNewTransactions() { - super("sendNewTransactions"); - } - - protected sendNewTransactions_args getEmptyArgsInstance() { - return new sendNewTransactions_args(); - } - - protected sendNewTransactions_result getResult(I iface, sendNewTransactions_args args) throws org.apache.thrift.TException { - sendNewTransactions_result result = new sendNewTransactions_result(); - result.success = iface.sendNewTransactions(args.leftTransactionId, args.rightTransactionId, args.transactions); - result.setSuccessIsSet(true); - return result; - } - } - - } - - public static class getMaxTransactionId_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMaxTransactionId_args"); - - - - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { -; - - 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) { - 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; - } - } - 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); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getMaxTransactionId_args.class, metaDataMap); - } - - public getMaxTransactionId_args() { - } - - /** - * Performs a deep copy on other. - */ - public getMaxTransactionId_args(getMaxTransactionId_args other) { - } - - public getMaxTransactionId_args deepCopy() { - return new getMaxTransactionId_args(this); - } - - @Override - public void clear() { - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - } - 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) { - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getMaxTransactionId_args) - return this.equals((getMaxTransactionId_args)that); - return false; - } - - public boolean equals(getMaxTransactionId_args that) { - if (that == null) - return false; - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getMaxTransactionId_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getMaxTransactionId_args typedOther = (getMaxTransactionId_args)other; - - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getMaxTransactionId_args("); - boolean first = true; - - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - - public static class getMaxTransactionId_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getMaxTransactionId_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); - - public long success; // 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 { - SUCCESS((short)0, "success"); - - 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 0: // SUCCESS - return SUCCESS; - 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 - private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getMaxTransactionId_result.class, metaDataMap); - } - - public getMaxTransactionId_result() { - } - - public getMaxTransactionId_result( - long success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public getMaxTransactionId_result(getMaxTransactionId_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.success = other.success; - } - - public getMaxTransactionId_result deepCopy() { - return new getMaxTransactionId_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = 0; - } - - public long getSuccess() { - return this.success; - } - - public getMaxTransactionId_result setSuccess(long success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Long)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Long.valueOf(getSuccess()); - - } - 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 SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof getMaxTransactionId_result) - return this.equals((getMaxTransactionId_result)that); - return false; - } - - public boolean equals(getMaxTransactionId_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(getMaxTransactionId_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - getMaxTransactionId_result typedOther = (getMaxTransactionId_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.success = iprot.readI64(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(this.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("getMaxTransactionId_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - - public static class sendNewTransactions_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sendNewTransactions_args"); - - private static final org.apache.thrift.protocol.TField LEFT_TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("leftTransactionId", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField RIGHT_TRANSACTION_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("rightTransactionId", org.apache.thrift.protocol.TType.I64, (short)2); - private static final org.apache.thrift.protocol.TField TRANSACTIONS_FIELD_DESC = new org.apache.thrift.protocol.TField("transactions", org.apache.thrift.protocol.TType.LIST, (short)3); - - public long leftTransactionId; // required - public long rightTransactionId; // required - public List transactions; // 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 { - LEFT_TRANSACTION_ID((short)1, "leftTransactionId"), - RIGHT_TRANSACTION_ID((short)2, "rightTransactionId"), - TRANSACTIONS((short)3, "transactions"); - - 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: // LEFT_TRANSACTION_ID - return LEFT_TRANSACTION_ID; - case 2: // RIGHT_TRANSACTION_ID - return RIGHT_TRANSACTION_ID; - case 3: // TRANSACTIONS - return TRANSACTIONS; - 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 - private static final int __LEFTTRANSACTIONID_ISSET_ID = 0; - private static final int __RIGHTTRANSACTIONID_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - - 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.LEFT_TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("leftTransactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.RIGHT_TRANSACTION_ID, new org.apache.thrift.meta_data.FieldMetaData("rightTransactionId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.TRANSACTIONS, new org.apache.thrift.meta_data.FieldMetaData("transactions", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sendNewTransactions_args.class, metaDataMap); - } - - public sendNewTransactions_args() { - } - - public sendNewTransactions_args( - long leftTransactionId, - long rightTransactionId, - List transactions) - { - this(); - this.leftTransactionId = leftTransactionId; - setLeftTransactionIdIsSet(true); - this.rightTransactionId = rightTransactionId; - setRightTransactionIdIsSet(true); - this.transactions = transactions; - } - - /** - * Performs a deep copy on other. - */ - public sendNewTransactions_args(sendNewTransactions_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.leftTransactionId = other.leftTransactionId; - this.rightTransactionId = other.rightTransactionId; - if (other.isSetTransactions()) { - List __this__transactions = new ArrayList(); - for (ByteBuffer other_element : other.transactions) { - ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element); -; - __this__transactions.add(temp_binary_element); - } - this.transactions = __this__transactions; - } - } - - public sendNewTransactions_args deepCopy() { - return new sendNewTransactions_args(this); - } - - @Override - public void clear() { - setLeftTransactionIdIsSet(false); - this.leftTransactionId = 0; - setRightTransactionIdIsSet(false); - this.rightTransactionId = 0; - this.transactions = null; - } - - public long getLeftTransactionId() { - return this.leftTransactionId; - } - - public sendNewTransactions_args setLeftTransactionId(long leftTransactionId) { - this.leftTransactionId = leftTransactionId; - setLeftTransactionIdIsSet(true); - return this; - } - - public void unsetLeftTransactionId() { - __isset_bit_vector.clear(__LEFTTRANSACTIONID_ISSET_ID); - } - - /** Returns true if field leftTransactionId is set (has been assigned a value) and false otherwise */ - public boolean isSetLeftTransactionId() { - return __isset_bit_vector.get(__LEFTTRANSACTIONID_ISSET_ID); - } - - public void setLeftTransactionIdIsSet(boolean value) { - __isset_bit_vector.set(__LEFTTRANSACTIONID_ISSET_ID, value); - } - - public long getRightTransactionId() { - return this.rightTransactionId; - } - - public sendNewTransactions_args setRightTransactionId(long rightTransactionId) { - this.rightTransactionId = rightTransactionId; - setRightTransactionIdIsSet(true); - return this; - } - - public void unsetRightTransactionId() { - __isset_bit_vector.clear(__RIGHTTRANSACTIONID_ISSET_ID); - } - - /** Returns true if field rightTransactionId is set (has been assigned a value) and false otherwise */ - public boolean isSetRightTransactionId() { - return __isset_bit_vector.get(__RIGHTTRANSACTIONID_ISSET_ID); - } - - public void setRightTransactionIdIsSet(boolean value) { - __isset_bit_vector.set(__RIGHTTRANSACTIONID_ISSET_ID, value); - } - - public int getTransactionsSize() { - return (this.transactions == null) ? 0 : this.transactions.size(); - } - - public java.util.Iterator getTransactionsIterator() { - return (this.transactions == null) ? null : this.transactions.iterator(); - } - - public void addToTransactions(ByteBuffer elem) { - if (this.transactions == null) { - this.transactions = new ArrayList(); - } - this.transactions.add(elem); - } - - public List getTransactions() { - return this.transactions; - } - - public sendNewTransactions_args setTransactions(List transactions) { - this.transactions = transactions; - return this; - } - - public void unsetTransactions() { - this.transactions = null; - } - - /** Returns true if field transactions is set (has been assigned a value) and false otherwise */ - public boolean isSetTransactions() { - return this.transactions != null; - } - - public void setTransactionsIsSet(boolean value) { - if (!value) { - this.transactions = null; - } - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case LEFT_TRANSACTION_ID: - if (value == null) { - unsetLeftTransactionId(); - } else { - setLeftTransactionId((Long)value); - } - break; - - case RIGHT_TRANSACTION_ID: - if (value == null) { - unsetRightTransactionId(); - } else { - setRightTransactionId((Long)value); - } - break; - - case TRANSACTIONS: - if (value == null) { - unsetTransactions(); - } else { - setTransactions((List)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case LEFT_TRANSACTION_ID: - return Long.valueOf(getLeftTransactionId()); - - case RIGHT_TRANSACTION_ID: - return Long.valueOf(getRightTransactionId()); - - case TRANSACTIONS: - return getTransactions(); - - } - 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 LEFT_TRANSACTION_ID: - return isSetLeftTransactionId(); - case RIGHT_TRANSACTION_ID: - return isSetRightTransactionId(); - case TRANSACTIONS: - return isSetTransactions(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof sendNewTransactions_args) - return this.equals((sendNewTransactions_args)that); - return false; - } - - public boolean equals(sendNewTransactions_args that) { - if (that == null) - return false; - - boolean this_present_leftTransactionId = true; - boolean that_present_leftTransactionId = true; - if (this_present_leftTransactionId || that_present_leftTransactionId) { - if (!(this_present_leftTransactionId && that_present_leftTransactionId)) - return false; - if (this.leftTransactionId != that.leftTransactionId) - return false; - } - - boolean this_present_rightTransactionId = true; - boolean that_present_rightTransactionId = true; - if (this_present_rightTransactionId || that_present_rightTransactionId) { - if (!(this_present_rightTransactionId && that_present_rightTransactionId)) - return false; - if (this.rightTransactionId != that.rightTransactionId) - return false; - } - - boolean this_present_transactions = true && this.isSetTransactions(); - boolean that_present_transactions = true && that.isSetTransactions(); - if (this_present_transactions || that_present_transactions) { - if (!(this_present_transactions && that_present_transactions)) - return false; - if (!this.transactions.equals(that.transactions)) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(sendNewTransactions_args other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - sendNewTransactions_args typedOther = (sendNewTransactions_args)other; - - lastComparison = Boolean.valueOf(isSetLeftTransactionId()).compareTo(typedOther.isSetLeftTransactionId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetLeftTransactionId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.leftTransactionId, typedOther.leftTransactionId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetRightTransactionId()).compareTo(typedOther.isSetRightTransactionId()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetRightTransactionId()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.rightTransactionId, typedOther.rightTransactionId); - if (lastComparison != 0) { - return lastComparison; - } - } - lastComparison = Boolean.valueOf(isSetTransactions()).compareTo(typedOther.isSetTransactions()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetTransactions()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.transactions, typedOther.transactions); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // LEFT_TRANSACTION_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.leftTransactionId = iprot.readI64(); - setLeftTransactionIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // RIGHT_TRANSACTION_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.rightTransactionId = iprot.readI64(); - setRightTransactionIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // TRANSACTIONS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list12 = iprot.readListBegin(); - this.transactions = new ArrayList(_list12.size); - for (int _i13 = 0; _i13 < _list12.size; ++_i13) - { - ByteBuffer _elem14; // required - _elem14 = iprot.readBinary(); - this.transactions.add(_elem14); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(LEFT_TRANSACTION_ID_FIELD_DESC); - oprot.writeI64(this.leftTransactionId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(RIGHT_TRANSACTION_ID_FIELD_DESC); - oprot.writeI64(this.rightTransactionId); - oprot.writeFieldEnd(); - if (this.transactions != null) { - oprot.writeFieldBegin(TRANSACTIONS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.transactions.size())); - for (ByteBuffer _iter15 : this.transactions) - { - oprot.writeBinary(_iter15); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("sendNewTransactions_args("); - boolean first = true; - - sb.append("leftTransactionId:"); - sb.append(this.leftTransactionId); - first = false; - if (!first) sb.append(", "); - sb.append("rightTransactionId:"); - sb.append(this.rightTransactionId); - first = false; - if (!first) sb.append(", "); - sb.append("transactions:"); - if (this.transactions == null) { - sb.append("null"); - } else { - sb.append(this.transactions); - } - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - - public static class sendNewTransactions_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("sendNewTransactions_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); - - public long success; // 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 { - SUCCESS((short)0, "success"); - - 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 0: // SUCCESS - return SUCCESS; - 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 - private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - - 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(sendNewTransactions_result.class, metaDataMap); - } - - public sendNewTransactions_result() { - } - - public sendNewTransactions_result( - long success) - { - this(); - this.success = success; - setSuccessIsSet(true); - } - - /** - * Performs a deep copy on other. - */ - public sendNewTransactions_result(sendNewTransactions_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); - this.success = other.success; - } - - public sendNewTransactions_result deepCopy() { - return new sendNewTransactions_result(this); - } - - @Override - public void clear() { - setSuccessIsSet(false); - this.success = 0; - } - - public long getSuccess() { - return this.success; - } - - public sendNewTransactions_result setSuccess(long success) { - this.success = success; - setSuccessIsSet(true); - return this; - } - - public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); - } - - /** Returns true if field success is set (has been assigned a value) and false otherwise */ - public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); - } - - public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); - } - - public void setFieldValue(_Fields field, Object value) { - switch (field) { - case SUCCESS: - if (value == null) { - unsetSuccess(); - } else { - setSuccess((Long)value); - } - break; - - } - } - - public Object getFieldValue(_Fields field) { - switch (field) { - case SUCCESS: - return Long.valueOf(getSuccess()); - - } - 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 SUCCESS: - return isSetSuccess(); - } - throw new IllegalStateException(); - } - - @Override - public boolean equals(Object that) { - if (that == null) - return false; - if (that instanceof sendNewTransactions_result) - return this.equals((sendNewTransactions_result)that); - return false; - } - - public boolean equals(sendNewTransactions_result that) { - if (that == null) - return false; - - boolean this_present_success = true; - boolean that_present_success = true; - if (this_present_success || that_present_success) { - if (!(this_present_success && that_present_success)) - return false; - if (this.success != that.success) - return false; - } - - return true; - } - - @Override - public int hashCode() { - return 0; - } - - public int compareTo(sendNewTransactions_result other) { - if (!getClass().equals(other.getClass())) { - return getClass().getName().compareTo(other.getClass().getName()); - } - - int lastComparison = 0; - sendNewTransactions_result typedOther = (sendNewTransactions_result)other; - - lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); - if (lastComparison != 0) { - return lastComparison; - } - if (isSetSuccess()) { - lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); - if (lastComparison != 0) { - return lastComparison; - } - } - return 0; - } - - public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.success = iprot.readI64(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(this.success); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder("sendNewTransactions_result("); - boolean first = true; - - sb.append("success:"); - sb.append(this.success); - first = false; - sb.append(")"); - return sb.toString(); - } - - public void validate() throws org.apache.thrift.TException { - // check for required fields - } - - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); - } - } - - } - -} diff --git a/src/main/java/tachyon/thrift/DependencyDoesNotExistException.java b/src/main/java/tachyon/thrift/DependencyDoesNotExistException.java new file mode 100644 index 000000000000..79e32e8896cc --- /dev/null +++ b/src/main/java/tachyon/thrift/DependencyDoesNotExistException.java @@ -0,0 +1,386 @@ +/** + * Autogenerated by Thrift Compiler (0.9.0) + * + * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated + */ +package tachyon.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 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 org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public class DependencyDoesNotExistException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("DependencyDoesNotExistException"); + + private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new DependencyDoesNotExistExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new DependencyDoesNotExistExceptionTupleSchemeFactory()); + } + + public String message; // 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 { + MESSAGE((short)1, "message"); + + 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: // MESSAGE + return MESSAGE; + 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.MESSAGE, new org.apache.thrift.meta_data.FieldMetaData("message", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(DependencyDoesNotExistException.class, metaDataMap); + } + + public DependencyDoesNotExistException() { + } + + public DependencyDoesNotExistException( + String message) + { + this(); + this.message = message; + } + + /** + * Performs a deep copy on other. + */ + public DependencyDoesNotExistException(DependencyDoesNotExistException other) { + if (other.isSetMessage()) { + this.message = other.message; + } + } + + public DependencyDoesNotExistException deepCopy() { + return new DependencyDoesNotExistException(this); + } + + @Override + public void clear() { + this.message = null; + } + + public String getMessage() { + return this.message; + } + + public DependencyDoesNotExistException setMessage(String message) { + this.message = message; + return this; + } + + public void unsetMessage() { + this.message = null; + } + + /** Returns true if field message is set (has been assigned a value) and false otherwise */ + public boolean isSetMessage() { + return this.message != null; + } + + public void setMessageIsSet(boolean value) { + if (!value) { + this.message = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case MESSAGE: + if (value == null) { + unsetMessage(); + } else { + setMessage((String)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case MESSAGE: + return getMessage(); + + } + 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 MESSAGE: + return isSetMessage(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof DependencyDoesNotExistException) + return this.equals((DependencyDoesNotExistException)that); + return false; + } + + public boolean equals(DependencyDoesNotExistException that) { + if (that == null) + return false; + + boolean this_present_message = true && this.isSetMessage(); + boolean that_present_message = true && that.isSetMessage(); + if (this_present_message || that_present_message) { + if (!(this_present_message && that_present_message)) + return false; + if (!this.message.equals(that.message)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(DependencyDoesNotExistException other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + DependencyDoesNotExistException typedOther = (DependencyDoesNotExistException)other; + + lastComparison = Boolean.valueOf(isSetMessage()).compareTo(typedOther.isSetMessage()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetMessage()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.message, typedOther.message); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("DependencyDoesNotExistException("); + boolean first = true; + + sb.append("message:"); + if (this.message == null) { + sb.append("null"); + } else { + sb.append(this.message); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class DependencyDoesNotExistExceptionStandardSchemeFactory implements SchemeFactory { + public DependencyDoesNotExistExceptionStandardScheme getScheme() { + return new DependencyDoesNotExistExceptionStandardScheme(); + } + } + + private static class DependencyDoesNotExistExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, DependencyDoesNotExistException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, DependencyDoesNotExistException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class DependencyDoesNotExistExceptionTupleSchemeFactory implements SchemeFactory { + public DependencyDoesNotExistExceptionTupleScheme getScheme() { + return new DependencyDoesNotExistExceptionTupleScheme(); + } + } + + private static class DependencyDoesNotExistExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, DependencyDoesNotExistException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, DependencyDoesNotExistException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + +} + diff --git a/src/main/java/tachyon/thrift/FailedToCheckpointException.java b/src/main/java/tachyon/thrift/FailedToCheckpointException.java index a66532441d30..ff0927f9df8d 100644 --- a/src/main/java/tachyon/thrift/FailedToCheckpointException.java +++ b/src/main/java/tachyon/thrift/FailedToCheckpointException.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -20,11 +30,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class FailedToCheckpointException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class FailedToCheckpointException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FailedToCheckpointException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new FailedToCheckpointExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new FailedToCheckpointExceptionTupleSchemeFactory()); + } + public String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -86,7 +102,6 @@ public String getFieldName() { } // 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); @@ -239,44 +254,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MESSAGE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.message = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(this.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -297,6 +279,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -315,5 +298,89 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class FailedToCheckpointExceptionStandardSchemeFactory implements SchemeFactory { + public FailedToCheckpointExceptionStandardScheme getScheme() { + return new FailedToCheckpointExceptionStandardScheme(); + } + } + + private static class FailedToCheckpointExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, FailedToCheckpointException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, FailedToCheckpointException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class FailedToCheckpointExceptionTupleSchemeFactory implements SchemeFactory { + public FailedToCheckpointExceptionTupleScheme getScheme() { + return new FailedToCheckpointExceptionTupleScheme(); + } + } + + private static class FailedToCheckpointExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, FailedToCheckpointException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, FailedToCheckpointException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/FileAlreadyExistException.java b/src/main/java/tachyon/thrift/FileAlreadyExistException.java index 8faaac5b4e06..0e21de0ec3c8 100644 --- a/src/main/java/tachyon/thrift/FileAlreadyExistException.java +++ b/src/main/java/tachyon/thrift/FileAlreadyExistException.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -20,11 +30,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class FileAlreadyExistException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class FileAlreadyExistException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FileAlreadyExistException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new FileAlreadyExistExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new FileAlreadyExistExceptionTupleSchemeFactory()); + } + public String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -86,7 +102,6 @@ public String getFieldName() { } // 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); @@ -239,44 +254,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MESSAGE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.message = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(this.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -297,6 +279,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -315,5 +298,89 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class FileAlreadyExistExceptionStandardSchemeFactory implements SchemeFactory { + public FileAlreadyExistExceptionStandardScheme getScheme() { + return new FileAlreadyExistExceptionStandardScheme(); + } + } + + private static class FileAlreadyExistExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, FileAlreadyExistException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, FileAlreadyExistException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class FileAlreadyExistExceptionTupleSchemeFactory implements SchemeFactory { + public FileAlreadyExistExceptionTupleScheme getScheme() { + return new FileAlreadyExistExceptionTupleScheme(); + } + } + + private static class FileAlreadyExistExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, FileAlreadyExistException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, FileAlreadyExistException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/FileDoesNotExistException.java b/src/main/java/tachyon/thrift/FileDoesNotExistException.java index 09fe955fdc53..7cccd3d7a8e4 100644 --- a/src/main/java/tachyon/thrift/FileDoesNotExistException.java +++ b/src/main/java/tachyon/thrift/FileDoesNotExistException.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -20,11 +30,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class FileDoesNotExistException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class FileDoesNotExistException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("FileDoesNotExistException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new FileDoesNotExistExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new FileDoesNotExistExceptionTupleSchemeFactory()); + } + public String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -86,7 +102,6 @@ public String getFieldName() { } // 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); @@ -239,44 +254,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MESSAGE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.message = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(this.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -297,6 +279,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -315,5 +298,89 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class FileDoesNotExistExceptionStandardSchemeFactory implements SchemeFactory { + public FileDoesNotExistExceptionStandardScheme getScheme() { + return new FileDoesNotExistExceptionStandardScheme(); + } + } + + private static class FileDoesNotExistExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, FileDoesNotExistException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, FileDoesNotExistException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class FileDoesNotExistExceptionTupleSchemeFactory implements SchemeFactory { + public FileDoesNotExistExceptionTupleScheme getScheme() { + return new FileDoesNotExistExceptionTupleScheme(); + } + } + + private static class FileDoesNotExistExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, FileDoesNotExistException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, FileDoesNotExistException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/InvalidPathException.java b/src/main/java/tachyon/thrift/InvalidPathException.java index 4f607ca13ff7..4d41c2877f78 100644 --- a/src/main/java/tachyon/thrift/InvalidPathException.java +++ b/src/main/java/tachyon/thrift/InvalidPathException.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -20,11 +30,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class InvalidPathException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class InvalidPathException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("InvalidPathException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new InvalidPathExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new InvalidPathExceptionTupleSchemeFactory()); + } + public String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -86,7 +102,6 @@ public String getFieldName() { } // 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); @@ -239,44 +254,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MESSAGE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.message = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(this.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -297,6 +279,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -315,5 +298,89 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class InvalidPathExceptionStandardSchemeFactory implements SchemeFactory { + public InvalidPathExceptionStandardScheme getScheme() { + return new InvalidPathExceptionStandardScheme(); + } + } + + private static class InvalidPathExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, InvalidPathException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, InvalidPathException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class InvalidPathExceptionTupleSchemeFactory implements SchemeFactory { + public InvalidPathExceptionTupleScheme getScheme() { + return new InvalidPathExceptionTupleScheme(); + } + } + + private static class InvalidPathExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, InvalidPathException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, InvalidPathException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/MasterService.java b/src/main/java/tachyon/thrift/MasterService.java index aa9b7eab9acf..73a41f7430a3 100644 --- a/src/main/java/tachyon/thrift/MasterService.java +++ b/src/main/java/tachyon/thrift/MasterService.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -31,7 +41,8 @@ public interface Iface { public List liststatus(String path) throws InvalidPathException, FileDoesNotExistException, org.apache.thrift.TException; /** - * Worker register. Returned value rv % 100,000 is really workerId, rv / 1000,000 is master started time. + * Worker register. + * @return value rv % 100,000 is really workerId, rv / 1000,000 is master started time. * * @param workerNetAddress * @param totalBytes @@ -46,6 +57,16 @@ public interface Iface { public Set worker_getPinIdList() throws org.apache.thrift.TException; + public List worker_getPriorityDependencyList() throws org.apache.thrift.TException; + + public int user_createDependency(List parents, List children, String commandPrefix, List data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte) throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException, BlockInfoException, TachyonException, org.apache.thrift.TException; + + public ClientDependencyInfo user_getClientDependencyInfo(int dependencyId) throws DependencyDoesNotExistException, org.apache.thrift.TException; + + public void user_reportLostFile(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException; + + public void user_requestFilesInDependency(int depId) throws DependencyDoesNotExistException, org.apache.thrift.TException; + public int user_createFile(String path, long blockSizeByte) throws FileAlreadyExistException, InvalidPathException, BlockInfoException, TachyonException, org.apache.thrift.TException; public int user_createFileOnCheckpoint(String path, String checkpointPath) throws FileAlreadyExistException, InvalidPathException, SuspectedFileSizeException, BlockInfoException, TachyonException, org.apache.thrift.TException; @@ -73,7 +94,7 @@ public interface Iface { */ public NetAddress user_getWorker(boolean random, String host) throws NoWorkerException, org.apache.thrift.TException; - public ClientFileInfo user_getClientFileInfoById(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException; + public ClientFileInfo getClientFileInfoById(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException; public ClientFileInfo user_getClientFileInfoByPath(String path) throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException; @@ -148,6 +169,16 @@ public interface AsyncIface { public void worker_getPinIdList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void worker_getPriorityDependencyList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void user_createDependency(List parents, List children, String commandPrefix, List data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void user_getClientDependencyInfo(int dependencyId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void user_reportLostFile(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + + public void user_requestFilesInDependency(int depId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void user_createFile(String path, long blockSizeByte, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_createFileOnCheckpoint(String path, String checkpointPath, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -164,7 +195,7 @@ public interface AsyncIface { public void user_getWorker(boolean random, String host, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; - public void user_getClientFileInfoById(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void getClientFileInfoById(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void user_getClientFileInfoByPath(String path, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -425,6 +456,146 @@ public Set recv_worker_getPinIdList() throws org.apache.thrift.TExcepti throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "worker_getPinIdList failed: unknown result"); } + public List worker_getPriorityDependencyList() throws org.apache.thrift.TException + { + send_worker_getPriorityDependencyList(); + return recv_worker_getPriorityDependencyList(); + } + + public void send_worker_getPriorityDependencyList() throws org.apache.thrift.TException + { + worker_getPriorityDependencyList_args args = new worker_getPriorityDependencyList_args(); + sendBase("worker_getPriorityDependencyList", args); + } + + public List recv_worker_getPriorityDependencyList() throws org.apache.thrift.TException + { + worker_getPriorityDependencyList_result result = new worker_getPriorityDependencyList_result(); + receiveBase(result, "worker_getPriorityDependencyList"); + if (result.isSetSuccess()) { + return result.success; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "worker_getPriorityDependencyList failed: unknown result"); + } + + public int user_createDependency(List parents, List children, String commandPrefix, List data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte) throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException, BlockInfoException, TachyonException, org.apache.thrift.TException + { + send_user_createDependency(parents, children, commandPrefix, data, comment, framework, frameworkVersion, dependencyType, childrenBlockSizeByte); + return recv_user_createDependency(); + } + + public void send_user_createDependency(List parents, List children, String commandPrefix, List data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte) throws org.apache.thrift.TException + { + user_createDependency_args args = new user_createDependency_args(); + args.setParents(parents); + args.setChildren(children); + args.setCommandPrefix(commandPrefix); + args.setData(data); + args.setComment(comment); + args.setFramework(framework); + args.setFrameworkVersion(frameworkVersion); + args.setDependencyType(dependencyType); + args.setChildrenBlockSizeByte(childrenBlockSizeByte); + sendBase("user_createDependency", args); + } + + public int recv_user_createDependency() throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException, BlockInfoException, TachyonException, org.apache.thrift.TException + { + user_createDependency_result result = new user_createDependency_result(); + receiveBase(result, "user_createDependency"); + if (result.isSetSuccess()) { + return result.success; + } + if (result.eI != null) { + throw result.eI; + } + if (result.eF != null) { + throw result.eF; + } + if (result.eA != null) { + throw result.eA; + } + if (result.eB != null) { + throw result.eB; + } + if (result.eT != null) { + throw result.eT; + } + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_createDependency failed: unknown result"); + } + + public ClientDependencyInfo user_getClientDependencyInfo(int dependencyId) throws DependencyDoesNotExistException, org.apache.thrift.TException + { + send_user_getClientDependencyInfo(dependencyId); + return recv_user_getClientDependencyInfo(); + } + + public void send_user_getClientDependencyInfo(int dependencyId) throws org.apache.thrift.TException + { + user_getClientDependencyInfo_args args = new user_getClientDependencyInfo_args(); + args.setDependencyId(dependencyId); + sendBase("user_getClientDependencyInfo", args); + } + + public ClientDependencyInfo recv_user_getClientDependencyInfo() throws DependencyDoesNotExistException, org.apache.thrift.TException + { + user_getClientDependencyInfo_result result = new user_getClientDependencyInfo_result(); + receiveBase(result, "user_getClientDependencyInfo"); + 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, "user_getClientDependencyInfo failed: unknown result"); + } + + public void user_reportLostFile(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException + { + send_user_reportLostFile(fileId); + recv_user_reportLostFile(); + } + + public void send_user_reportLostFile(int fileId) throws org.apache.thrift.TException + { + user_reportLostFile_args args = new user_reportLostFile_args(); + args.setFileId(fileId); + sendBase("user_reportLostFile", args); + } + + public void recv_user_reportLostFile() throws FileDoesNotExistException, org.apache.thrift.TException + { + user_reportLostFile_result result = new user_reportLostFile_result(); + receiveBase(result, "user_reportLostFile"); + if (result.e != null) { + throw result.e; + } + return; + } + + public void user_requestFilesInDependency(int depId) throws DependencyDoesNotExistException, org.apache.thrift.TException + { + send_user_requestFilesInDependency(depId); + recv_user_requestFilesInDependency(); + } + + public void send_user_requestFilesInDependency(int depId) throws org.apache.thrift.TException + { + user_requestFilesInDependency_args args = new user_requestFilesInDependency_args(); + args.setDepId(depId); + sendBase("user_requestFilesInDependency", args); + } + + public void recv_user_requestFilesInDependency() throws DependencyDoesNotExistException, org.apache.thrift.TException + { + user_requestFilesInDependency_result result = new user_requestFilesInDependency_result(); + receiveBase(result, "user_requestFilesInDependency"); + if (result.e != null) { + throw result.e; + } + return; + } + public int user_createFile(String path, long blockSizeByte) throws FileAlreadyExistException, InvalidPathException, BlockInfoException, TachyonException, org.apache.thrift.TException { send_user_createFile(path, blockSizeByte); @@ -651,30 +822,30 @@ public NetAddress recv_user_getWorker() throws NoWorkerException, org.apache.thr throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "user_getWorker failed: unknown result"); } - public ClientFileInfo user_getClientFileInfoById(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException + public ClientFileInfo getClientFileInfoById(int fileId) throws FileDoesNotExistException, org.apache.thrift.TException { - send_user_getClientFileInfoById(fileId); - return recv_user_getClientFileInfoById(); + send_getClientFileInfoById(fileId); + return recv_getClientFileInfoById(); } - public void send_user_getClientFileInfoById(int fileId) throws org.apache.thrift.TException + public void send_getClientFileInfoById(int fileId) throws org.apache.thrift.TException { - user_getClientFileInfoById_args args = new user_getClientFileInfoById_args(); + getClientFileInfoById_args args = new getClientFileInfoById_args(); args.setFileId(fileId); - sendBase("user_getClientFileInfoById", args); + sendBase("getClientFileInfoById", args); } - public ClientFileInfo recv_user_getClientFileInfoById() throws FileDoesNotExistException, org.apache.thrift.TException + public ClientFileInfo recv_getClientFileInfoById() throws FileDoesNotExistException, org.apache.thrift.TException { - user_getClientFileInfoById_result result = new user_getClientFileInfoById_result(); - receiveBase(result, "user_getClientFileInfoById"); + getClientFileInfoById_result result = new getClientFileInfoById_result(); + receiveBase(result, "getClientFileInfoById"); 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, "user_getClientFileInfoById failed: unknown result"); + throw new org.apache.thrift.TApplicationException(org.apache.thrift.TApplicationException.MISSING_RESULT, "getClientFileInfoById failed: unknown result"); } public ClientFileInfo user_getClientFileInfoByPath(String path) throws FileDoesNotExistException, InvalidPathException, org.apache.thrift.TException @@ -1504,6 +1675,187 @@ public Set getResult() throws org.apache.thrift.TException { } } + public void worker_getPriorityDependencyList(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + worker_getPriorityDependencyList_call method_call = new worker_getPriorityDependencyList_call(resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class worker_getPriorityDependencyList_call extends org.apache.thrift.async.TAsyncMethodCall { + public worker_getPriorityDependencyList_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("worker_getPriorityDependencyList", org.apache.thrift.protocol.TMessageType.CALL, 0)); + worker_getPriorityDependencyList_args args = new worker_getPriorityDependencyList_args(); + args.write(prot); + prot.writeMessageEnd(); + } + + public List 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_worker_getPriorityDependencyList(); + } + } + + public void user_createDependency(List parents, List children, String commandPrefix, List data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + user_createDependency_call method_call = new user_createDependency_call(parents, children, commandPrefix, data, comment, framework, frameworkVersion, dependencyType, childrenBlockSizeByte, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class user_createDependency_call extends org.apache.thrift.async.TAsyncMethodCall { + private List parents; + private List children; + private String commandPrefix; + private List data; + private String comment; + private String framework; + private String frameworkVersion; + private int dependencyType; + private long childrenBlockSizeByte; + public user_createDependency_call(List parents, List children, String commandPrefix, List data, String comment, String framework, String frameworkVersion, int dependencyType, long childrenBlockSizeByte, 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.parents = parents; + this.children = children; + this.commandPrefix = commandPrefix; + this.data = data; + this.comment = comment; + this.framework = framework; + this.frameworkVersion = frameworkVersion; + this.dependencyType = dependencyType; + this.childrenBlockSizeByte = childrenBlockSizeByte; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_createDependency", org.apache.thrift.protocol.TMessageType.CALL, 0)); + user_createDependency_args args = new user_createDependency_args(); + args.setParents(parents); + args.setChildren(children); + args.setCommandPrefix(commandPrefix); + args.setData(data); + args.setComment(comment); + args.setFramework(framework); + args.setFrameworkVersion(frameworkVersion); + args.setDependencyType(dependencyType); + args.setChildrenBlockSizeByte(childrenBlockSizeByte); + args.write(prot); + prot.writeMessageEnd(); + } + + public int getResult() throws InvalidPathException, FileDoesNotExistException, FileAlreadyExistException, BlockInfoException, TachyonException, 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_user_createDependency(); + } + } + + public void user_getClientDependencyInfo(int dependencyId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + user_getClientDependencyInfo_call method_call = new user_getClientDependencyInfo_call(dependencyId, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class user_getClientDependencyInfo_call extends org.apache.thrift.async.TAsyncMethodCall { + private int dependencyId; + public user_getClientDependencyInfo_call(int dependencyId, 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.dependencyId = dependencyId; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_getClientDependencyInfo", org.apache.thrift.protocol.TMessageType.CALL, 0)); + user_getClientDependencyInfo_args args = new user_getClientDependencyInfo_args(); + args.setDependencyId(dependencyId); + args.write(prot); + prot.writeMessageEnd(); + } + + public ClientDependencyInfo getResult() throws DependencyDoesNotExistException, 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_user_getClientDependencyInfo(); + } + } + + public void user_reportLostFile(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + user_reportLostFile_call method_call = new user_reportLostFile_call(fileId, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class user_reportLostFile_call extends org.apache.thrift.async.TAsyncMethodCall { + private int fileId; + public user_reportLostFile_call(int 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("user_reportLostFile", org.apache.thrift.protocol.TMessageType.CALL, 0)); + user_reportLostFile_args args = new user_reportLostFile_args(); + args.setFileId(fileId); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws FileDoesNotExistException, 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_user_reportLostFile(); + } + } + + public void user_requestFilesInDependency(int depId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + user_requestFilesInDependency_call method_call = new user_requestFilesInDependency_call(depId, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class user_requestFilesInDependency_call extends org.apache.thrift.async.TAsyncMethodCall { + private int depId; + public user_requestFilesInDependency_call(int depId, 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.depId = depId; + } + + public void write_args(org.apache.thrift.protocol.TProtocol prot) throws org.apache.thrift.TException { + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("user_requestFilesInDependency", org.apache.thrift.protocol.TMessageType.CALL, 0)); + user_requestFilesInDependency_args args = new user_requestFilesInDependency_args(); + args.setDepId(depId); + args.write(prot); + prot.writeMessageEnd(); + } + + public void getResult() throws DependencyDoesNotExistException, 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_user_requestFilesInDependency(); + } + } + public void user_createFile(String path, long blockSizeByte, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); user_createFile_call method_call = new user_createFile_call(path, blockSizeByte, resultHandler, this, ___protocolFactory, ___transport); @@ -1769,23 +2121,23 @@ public NetAddress getResult() throws NoWorkerException, org.apache.thrift.TExcep } } - public void user_getClientFileInfoById(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + public void getClientFileInfoById(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); - user_getClientFileInfoById_call method_call = new user_getClientFileInfoById_call(fileId, resultHandler, this, ___protocolFactory, ___transport); + getClientFileInfoById_call method_call = new getClientFileInfoById_call(fileId, resultHandler, this, ___protocolFactory, ___transport); this.___currentMethod = method_call; ___manager.call(method_call); } - public static class user_getClientFileInfoById_call extends org.apache.thrift.async.TAsyncMethodCall { + public static class getClientFileInfoById_call extends org.apache.thrift.async.TAsyncMethodCall { private int fileId; - public user_getClientFileInfoById_call(int 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 { + public getClientFileInfoById_call(int 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("user_getClientFileInfoById", org.apache.thrift.protocol.TMessageType.CALL, 0)); - user_getClientFileInfoById_args args = new user_getClientFileInfoById_args(); + prot.writeMessageBegin(new org.apache.thrift.protocol.TMessage("getClientFileInfoById", org.apache.thrift.protocol.TMessageType.CALL, 0)); + getClientFileInfoById_args args = new getClientFileInfoById_args(); args.setFileId(fileId); args.write(prot); prot.writeMessageEnd(); @@ -1797,7 +2149,7 @@ public ClientFileInfo getResult() throws FileDoesNotExistException, org.apache.t } 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_user_getClientFileInfoById(); + return (new Client(prot)).recv_getClientFileInfoById(); } } @@ -2467,7 +2819,7 @@ public String getResult() throws org.apache.thrift.TException { } - public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(I iface) { super(iface, getProcessMap(new HashMap>())); @@ -2485,6 +2837,11 @@ protected Processor(I iface, Map extends org.apache.thrift.ProcessFunction { + public static class addCheckpoint extends org.apache.thrift.ProcessFunction { public addCheckpoint() { super("addCheckpoint"); } - protected addCheckpoint_args getEmptyArgsInstance() { + public addCheckpoint_args getEmptyArgsInstance() { return new addCheckpoint_args(); } - protected addCheckpoint_result getResult(I iface, addCheckpoint_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public addCheckpoint_result getResult(I iface, addCheckpoint_args args) throws org.apache.thrift.TException { addCheckpoint_result result = new addCheckpoint_result(); try { result.success = iface.addCheckpoint(args.workerId, args.fileId, args.length, args.checkpointPath); @@ -2542,32 +2903,40 @@ protected addCheckpoint_result getResult(I iface, addCheckpoint_args args) throw } } - private static class getWorkersInfo extends org.apache.thrift.ProcessFunction { + public static class getWorkersInfo extends org.apache.thrift.ProcessFunction { public getWorkersInfo() { super("getWorkersInfo"); } - protected getWorkersInfo_args getEmptyArgsInstance() { + public getWorkersInfo_args getEmptyArgsInstance() { return new getWorkersInfo_args(); } - protected getWorkersInfo_result getResult(I iface, getWorkersInfo_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public getWorkersInfo_result getResult(I iface, getWorkersInfo_args args) throws org.apache.thrift.TException { getWorkersInfo_result result = new getWorkersInfo_result(); result.success = iface.getWorkersInfo(); return result; } } - private static class liststatus extends org.apache.thrift.ProcessFunction { + public static class liststatus extends org.apache.thrift.ProcessFunction { public liststatus() { super("liststatus"); } - protected liststatus_args getEmptyArgsInstance() { + public liststatus_args getEmptyArgsInstance() { return new liststatus_args(); } - protected liststatus_result getResult(I iface, liststatus_args args) throws org.apache.thrift.TException { + 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); @@ -2580,16 +2949,20 @@ protected liststatus_result getResult(I iface, liststatus_args args) throws org. } } - private static class worker_register extends org.apache.thrift.ProcessFunction { + public static class worker_register extends org.apache.thrift.ProcessFunction { public worker_register() { super("worker_register"); } - protected worker_register_args getEmptyArgsInstance() { + public worker_register_args getEmptyArgsInstance() { return new worker_register_args(); } - protected worker_register_result getResult(I iface, worker_register_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public worker_register_result getResult(I iface, worker_register_args args) throws org.apache.thrift.TException { worker_register_result result = new worker_register_result(); try { result.success = iface.worker_register(args.workerNetAddress, args.totalBytes, args.usedBytes, args.currentBlocks); @@ -2601,16 +2974,20 @@ protected worker_register_result getResult(I iface, worker_register_args args) t } } - private static class worker_heartbeat extends org.apache.thrift.ProcessFunction { + public static class worker_heartbeat extends org.apache.thrift.ProcessFunction { public worker_heartbeat() { super("worker_heartbeat"); } - protected worker_heartbeat_args getEmptyArgsInstance() { + public worker_heartbeat_args getEmptyArgsInstance() { return new worker_heartbeat_args(); } - protected worker_heartbeat_result getResult(I iface, worker_heartbeat_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public worker_heartbeat_result getResult(I iface, worker_heartbeat_args args) throws org.apache.thrift.TException { worker_heartbeat_result result = new worker_heartbeat_result(); try { result.success = iface.worker_heartbeat(args.workerId, args.usedBytes, args.removedBlocks); @@ -2621,16 +2998,20 @@ protected worker_heartbeat_result getResult(I iface, worker_heartbeat_args args) } } - private static class worker_cacheBlock extends org.apache.thrift.ProcessFunction { + public static class worker_cacheBlock extends org.apache.thrift.ProcessFunction { public worker_cacheBlock() { super("worker_cacheBlock"); } - protected worker_cacheBlock_args getEmptyArgsInstance() { + public worker_cacheBlock_args getEmptyArgsInstance() { return new worker_cacheBlock_args(); } - protected worker_cacheBlock_result getResult(I iface, worker_cacheBlock_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public worker_cacheBlock_result getResult(I iface, worker_cacheBlock_args args) throws org.apache.thrift.TException { worker_cacheBlock_result result = new worker_cacheBlock_result(); try { iface.worker_cacheBlock(args.workerId, args.workerUsedBytes, args.blockId, args.length); @@ -2645,69 +3026,70 @@ protected worker_cacheBlock_result getResult(I iface, worker_cacheBlock_args arg } } - private static class worker_getPinIdList extends org.apache.thrift.ProcessFunction { + public static class worker_getPinIdList extends org.apache.thrift.ProcessFunction { public worker_getPinIdList() { super("worker_getPinIdList"); } - protected worker_getPinIdList_args getEmptyArgsInstance() { + public worker_getPinIdList_args getEmptyArgsInstance() { return new worker_getPinIdList_args(); } - protected worker_getPinIdList_result getResult(I iface, worker_getPinIdList_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public worker_getPinIdList_result getResult(I iface, worker_getPinIdList_args args) throws org.apache.thrift.TException { worker_getPinIdList_result result = new worker_getPinIdList_result(); result.success = iface.worker_getPinIdList(); return result; } } - private static class user_createFile extends org.apache.thrift.ProcessFunction { - public user_createFile() { - super("user_createFile"); + public static class worker_getPriorityDependencyList extends org.apache.thrift.ProcessFunction { + public worker_getPriorityDependencyList() { + super("worker_getPriorityDependencyList"); } - protected user_createFile_args getEmptyArgsInstance() { - return new user_createFile_args(); + public worker_getPriorityDependencyList_args getEmptyArgsInstance() { + return new worker_getPriorityDependencyList_args(); } - protected user_createFile_result getResult(I iface, user_createFile_args args) throws org.apache.thrift.TException { - user_createFile_result result = new user_createFile_result(); - try { - result.success = iface.user_createFile(args.path, args.blockSizeByte); - result.setSuccessIsSet(true); - } catch (FileAlreadyExistException eR) { - result.eR = eR; - } catch (InvalidPathException eI) { - result.eI = eI; - } catch (BlockInfoException eB) { - result.eB = eB; - } catch (TachyonException eT) { - result.eT = eT; - } + protected boolean isOneway() { + return false; + } + + public worker_getPriorityDependencyList_result getResult(I iface, worker_getPriorityDependencyList_args args) throws org.apache.thrift.TException { + worker_getPriorityDependencyList_result result = new worker_getPriorityDependencyList_result(); + result.success = iface.worker_getPriorityDependencyList(); return result; } } - private static class user_createFileOnCheckpoint extends org.apache.thrift.ProcessFunction { - public user_createFileOnCheckpoint() { - super("user_createFileOnCheckpoint"); + public static class user_createDependency extends org.apache.thrift.ProcessFunction { + public user_createDependency() { + super("user_createDependency"); } - protected user_createFileOnCheckpoint_args getEmptyArgsInstance() { - return new user_createFileOnCheckpoint_args(); + public user_createDependency_args getEmptyArgsInstance() { + return new user_createDependency_args(); } - protected user_createFileOnCheckpoint_result getResult(I iface, user_createFileOnCheckpoint_args args) throws org.apache.thrift.TException { - user_createFileOnCheckpoint_result result = new user_createFileOnCheckpoint_result(); + protected boolean isOneway() { + return false; + } + + public user_createDependency_result getResult(I iface, user_createDependency_args args) throws org.apache.thrift.TException { + user_createDependency_result result = new user_createDependency_result(); try { - result.success = iface.user_createFileOnCheckpoint(args.path, args.checkpointPath); + result.success = iface.user_createDependency(args.parents, args.children, args.commandPrefix, args.data, args.comment, args.framework, args.frameworkVersion, args.dependencyType, args.childrenBlockSizeByte); result.setSuccessIsSet(true); - } catch (FileAlreadyExistException eR) { - result.eR = eR; } catch (InvalidPathException eI) { result.eI = eI; - } catch (SuspectedFileSizeException eS) { - result.eS = eS; + } catch (FileDoesNotExistException eF) { + result.eF = eF; + } catch (FileAlreadyExistException eA) { + result.eA = eA; } catch (BlockInfoException eB) { result.eB = eB; } catch (TachyonException eT) { @@ -2717,16 +3099,156 @@ protected user_createFileOnCheckpoint_result getResult(I iface, user_createFileO } } - private static class user_createNewBlock extends org.apache.thrift.ProcessFunction { - public user_createNewBlock() { + public static class user_getClientDependencyInfo extends org.apache.thrift.ProcessFunction { + public user_getClientDependencyInfo() { + super("user_getClientDependencyInfo"); + } + + public user_getClientDependencyInfo_args getEmptyArgsInstance() { + return new user_getClientDependencyInfo_args(); + } + + protected boolean isOneway() { + return false; + } + + public user_getClientDependencyInfo_result getResult(I iface, user_getClientDependencyInfo_args args) throws org.apache.thrift.TException { + user_getClientDependencyInfo_result result = new user_getClientDependencyInfo_result(); + try { + result.success = iface.user_getClientDependencyInfo(args.dependencyId); + } catch (DependencyDoesNotExistException e) { + result.e = e; + } + return result; + } + } + + public static class user_reportLostFile extends org.apache.thrift.ProcessFunction { + public user_reportLostFile() { + super("user_reportLostFile"); + } + + public user_reportLostFile_args getEmptyArgsInstance() { + return new user_reportLostFile_args(); + } + + protected boolean isOneway() { + return false; + } + + public user_reportLostFile_result getResult(I iface, user_reportLostFile_args args) throws org.apache.thrift.TException { + user_reportLostFile_result result = new user_reportLostFile_result(); + try { + iface.user_reportLostFile(args.fileId); + } catch (FileDoesNotExistException e) { + result.e = e; + } + return result; + } + } + + public static class user_requestFilesInDependency extends org.apache.thrift.ProcessFunction { + public user_requestFilesInDependency() { + super("user_requestFilesInDependency"); + } + + public user_requestFilesInDependency_args getEmptyArgsInstance() { + return new user_requestFilesInDependency_args(); + } + + protected boolean isOneway() { + return false; + } + + public user_requestFilesInDependency_result getResult(I iface, user_requestFilesInDependency_args args) throws org.apache.thrift.TException { + user_requestFilesInDependency_result result = new user_requestFilesInDependency_result(); + try { + iface.user_requestFilesInDependency(args.depId); + } catch (DependencyDoesNotExistException e) { + result.e = e; + } + return result; + } + } + + public static class user_createFile extends org.apache.thrift.ProcessFunction { + public user_createFile() { + super("user_createFile"); + } + + public user_createFile_args getEmptyArgsInstance() { + return new user_createFile_args(); + } + + protected boolean isOneway() { + return false; + } + + public user_createFile_result getResult(I iface, user_createFile_args args) throws org.apache.thrift.TException { + user_createFile_result result = new user_createFile_result(); + try { + result.success = iface.user_createFile(args.path, args.blockSizeByte); + result.setSuccessIsSet(true); + } catch (FileAlreadyExistException eR) { + result.eR = eR; + } catch (InvalidPathException eI) { + result.eI = eI; + } catch (BlockInfoException eB) { + result.eB = eB; + } catch (TachyonException eT) { + result.eT = eT; + } + return result; + } + } + + public static class user_createFileOnCheckpoint extends org.apache.thrift.ProcessFunction { + public user_createFileOnCheckpoint() { + super("user_createFileOnCheckpoint"); + } + + public user_createFileOnCheckpoint_args getEmptyArgsInstance() { + return new user_createFileOnCheckpoint_args(); + } + + protected boolean isOneway() { + return false; + } + + public user_createFileOnCheckpoint_result getResult(I iface, user_createFileOnCheckpoint_args args) throws org.apache.thrift.TException { + user_createFileOnCheckpoint_result result = new user_createFileOnCheckpoint_result(); + try { + result.success = iface.user_createFileOnCheckpoint(args.path, args.checkpointPath); + result.setSuccessIsSet(true); + } catch (FileAlreadyExistException eR) { + result.eR = eR; + } catch (InvalidPathException eI) { + result.eI = eI; + } catch (SuspectedFileSizeException eS) { + result.eS = eS; + } catch (BlockInfoException eB) { + result.eB = eB; + } catch (TachyonException eT) { + result.eT = eT; + } + return result; + } + } + + public static class user_createNewBlock extends org.apache.thrift.ProcessFunction { + public user_createNewBlock() { super("user_createNewBlock"); } - protected user_createNewBlock_args getEmptyArgsInstance() { + public user_createNewBlock_args getEmptyArgsInstance() { return new user_createNewBlock_args(); } - protected user_createNewBlock_result getResult(I iface, user_createNewBlock_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_createNewBlock_result getResult(I iface, user_createNewBlock_args args) throws org.apache.thrift.TException { user_createNewBlock_result result = new user_createNewBlock_result(); try { result.success = iface.user_createNewBlock(args.fileId); @@ -2738,16 +3260,20 @@ protected user_createNewBlock_result getResult(I iface, user_createNewBlock_args } } - private static class user_completeFile extends org.apache.thrift.ProcessFunction { + public static class user_completeFile extends org.apache.thrift.ProcessFunction { public user_completeFile() { super("user_completeFile"); } - protected user_completeFile_args getEmptyArgsInstance() { + public user_completeFile_args getEmptyArgsInstance() { return new user_completeFile_args(); } - protected user_completeFile_result getResult(I iface, user_completeFile_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_completeFile_result getResult(I iface, user_completeFile_args args) throws org.apache.thrift.TException { user_completeFile_result result = new user_completeFile_result(); try { iface.user_completeFile(args.fileId); @@ -2758,16 +3284,20 @@ protected user_completeFile_result getResult(I iface, user_completeFile_args arg } } - private static class user_getFileId extends org.apache.thrift.ProcessFunction { + public static class user_getFileId extends org.apache.thrift.ProcessFunction { public user_getFileId() { super("user_getFileId"); } - protected user_getFileId_args getEmptyArgsInstance() { + public user_getFileId_args getEmptyArgsInstance() { return new user_getFileId_args(); } - protected user_getFileId_result getResult(I iface, user_getFileId_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_getFileId_result getResult(I iface, user_getFileId_args args) throws org.apache.thrift.TException { user_getFileId_result result = new user_getFileId_result(); try { result.success = iface.user_getFileId(args.path); @@ -2779,16 +3309,20 @@ protected user_getFileId_result getResult(I iface, user_getFileId_args args) thr } } - private static class user_getUserId extends org.apache.thrift.ProcessFunction { + public static class user_getUserId extends org.apache.thrift.ProcessFunction { public user_getUserId() { super("user_getUserId"); } - protected user_getUserId_args getEmptyArgsInstance() { + public user_getUserId_args getEmptyArgsInstance() { return new user_getUserId_args(); } - protected user_getUserId_result getResult(I iface, user_getUserId_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_getUserId_result getResult(I iface, user_getUserId_args args) throws org.apache.thrift.TException { user_getUserId_result result = new user_getUserId_result(); result.success = iface.user_getUserId(); result.setSuccessIsSet(true); @@ -2796,16 +3330,20 @@ protected user_getUserId_result getResult(I iface, user_getUserId_args args) thr } } - private static class user_getBlockId extends org.apache.thrift.ProcessFunction { + public static class user_getBlockId extends org.apache.thrift.ProcessFunction { public user_getBlockId() { super("user_getBlockId"); } - protected user_getBlockId_args getEmptyArgsInstance() { + public user_getBlockId_args getEmptyArgsInstance() { return new user_getBlockId_args(); } - protected user_getBlockId_result getResult(I iface, user_getBlockId_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_getBlockId_result getResult(I iface, user_getBlockId_args args) throws org.apache.thrift.TException { user_getBlockId_result result = new user_getBlockId_result(); try { result.success = iface.user_getBlockId(args.fileId, args.index); @@ -2817,16 +3355,20 @@ protected user_getBlockId_result getResult(I iface, user_getBlockId_args args) t } } - private static class user_getWorker extends org.apache.thrift.ProcessFunction { + public static class user_getWorker extends org.apache.thrift.ProcessFunction { public user_getWorker() { super("user_getWorker"); } - protected user_getWorker_args getEmptyArgsInstance() { + public user_getWorker_args getEmptyArgsInstance() { return new user_getWorker_args(); } - protected user_getWorker_result getResult(I iface, user_getWorker_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_getWorker_result getResult(I iface, user_getWorker_args args) throws org.apache.thrift.TException { user_getWorker_result result = new user_getWorker_result(); try { result.success = iface.user_getWorker(args.random, args.host); @@ -2837,19 +3379,23 @@ protected user_getWorker_result getResult(I iface, user_getWorker_args args) thr } } - private static class user_getClientFileInfoById extends org.apache.thrift.ProcessFunction { - public user_getClientFileInfoById() { - super("user_getClientFileInfoById"); + public static class getClientFileInfoById extends org.apache.thrift.ProcessFunction { + public getClientFileInfoById() { + super("getClientFileInfoById"); + } + + public getClientFileInfoById_args getEmptyArgsInstance() { + return new getClientFileInfoById_args(); } - protected user_getClientFileInfoById_args getEmptyArgsInstance() { - return new user_getClientFileInfoById_args(); + protected boolean isOneway() { + return false; } - protected user_getClientFileInfoById_result getResult(I iface, user_getClientFileInfoById_args args) throws org.apache.thrift.TException { - user_getClientFileInfoById_result result = new user_getClientFileInfoById_result(); + public getClientFileInfoById_result getResult(I iface, getClientFileInfoById_args args) throws org.apache.thrift.TException { + getClientFileInfoById_result result = new getClientFileInfoById_result(); try { - result.success = iface.user_getClientFileInfoById(args.fileId); + result.success = iface.getClientFileInfoById(args.fileId); } catch (FileDoesNotExistException e) { result.e = e; } @@ -2857,16 +3403,20 @@ protected user_getClientFileInfoById_result getResult(I iface, user_getClientFil } } - private static class user_getClientFileInfoByPath extends org.apache.thrift.ProcessFunction { + public static class user_getClientFileInfoByPath extends org.apache.thrift.ProcessFunction { public user_getClientFileInfoByPath() { super("user_getClientFileInfoByPath"); } - protected user_getClientFileInfoByPath_args getEmptyArgsInstance() { + public user_getClientFileInfoByPath_args getEmptyArgsInstance() { return new user_getClientFileInfoByPath_args(); } - protected user_getClientFileInfoByPath_result getResult(I iface, user_getClientFileInfoByPath_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_getClientFileInfoByPath_result getResult(I iface, user_getClientFileInfoByPath_args args) throws org.apache.thrift.TException { user_getClientFileInfoByPath_result result = new user_getClientFileInfoByPath_result(); try { result.success = iface.user_getClientFileInfoByPath(args.path); @@ -2879,16 +3429,20 @@ protected user_getClientFileInfoByPath_result getResult(I iface, user_getClientF } } - private static class user_getClientBlockInfo extends org.apache.thrift.ProcessFunction { + public static class user_getClientBlockInfo extends org.apache.thrift.ProcessFunction { public user_getClientBlockInfo() { super("user_getClientBlockInfo"); } - protected user_getClientBlockInfo_args getEmptyArgsInstance() { + public user_getClientBlockInfo_args getEmptyArgsInstance() { return new user_getClientBlockInfo_args(); } - protected user_getClientBlockInfo_result getResult(I iface, user_getClientBlockInfo_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_getClientBlockInfo_result getResult(I iface, user_getClientBlockInfo_args args) throws org.apache.thrift.TException { user_getClientBlockInfo_result result = new user_getClientBlockInfo_result(); try { result.success = iface.user_getClientBlockInfo(args.blockId); @@ -2901,16 +3455,20 @@ protected user_getClientBlockInfo_result getResult(I iface, user_getClientBlockI } } - private static class user_getFileBlocksById extends org.apache.thrift.ProcessFunction { + public static class user_getFileBlocksById extends org.apache.thrift.ProcessFunction { public user_getFileBlocksById() { super("user_getFileBlocksById"); } - protected user_getFileBlocksById_args getEmptyArgsInstance() { + public user_getFileBlocksById_args getEmptyArgsInstance() { return new user_getFileBlocksById_args(); } - protected user_getFileBlocksById_result getResult(I iface, user_getFileBlocksById_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_getFileBlocksById_result getResult(I iface, user_getFileBlocksById_args args) throws org.apache.thrift.TException { user_getFileBlocksById_result result = new user_getFileBlocksById_result(); try { result.success = iface.user_getFileBlocksById(args.fileId); @@ -2921,16 +3479,20 @@ protected user_getFileBlocksById_result getResult(I iface, user_getFileBlocksByI } } - private static class user_getFileBlocksByPath extends org.apache.thrift.ProcessFunction { + public static class user_getFileBlocksByPath extends org.apache.thrift.ProcessFunction { public user_getFileBlocksByPath() { super("user_getFileBlocksByPath"); } - protected user_getFileBlocksByPath_args getEmptyArgsInstance() { + public user_getFileBlocksByPath_args getEmptyArgsInstance() { return new user_getFileBlocksByPath_args(); } - protected user_getFileBlocksByPath_result getResult(I iface, user_getFileBlocksByPath_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_getFileBlocksByPath_result getResult(I iface, user_getFileBlocksByPath_args args) throws org.apache.thrift.TException { user_getFileBlocksByPath_result result = new user_getFileBlocksByPath_result(); try { result.success = iface.user_getFileBlocksByPath(args.path); @@ -2943,16 +3505,20 @@ protected user_getFileBlocksByPath_result getResult(I iface, user_getFileBlocksB } } - private static class user_listFiles extends org.apache.thrift.ProcessFunction { + public static class user_listFiles extends org.apache.thrift.ProcessFunction { public user_listFiles() { super("user_listFiles"); } - protected user_listFiles_args getEmptyArgsInstance() { + public user_listFiles_args getEmptyArgsInstance() { return new user_listFiles_args(); } - protected user_listFiles_result getResult(I iface, user_listFiles_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_listFiles_result getResult(I iface, user_listFiles_args args) throws org.apache.thrift.TException { user_listFiles_result result = new user_listFiles_result(); try { result.success = iface.user_listFiles(args.path, args.recursive); @@ -2965,16 +3531,20 @@ protected user_listFiles_result getResult(I iface, user_listFiles_args args) thr } } - private static class user_ls extends org.apache.thrift.ProcessFunction { + public static class user_ls extends org.apache.thrift.ProcessFunction { public user_ls() { super("user_ls"); } - protected user_ls_args getEmptyArgsInstance() { + public user_ls_args getEmptyArgsInstance() { return new user_ls_args(); } - protected user_ls_result getResult(I iface, user_ls_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_ls_result getResult(I iface, user_ls_args args) throws org.apache.thrift.TException { user_ls_result result = new user_ls_result(); try { result.success = iface.user_ls(args.path, args.recursive); @@ -2987,16 +3557,20 @@ protected user_ls_result getResult(I iface, user_ls_args args) throws org.apache } } - private static class user_deleteById extends org.apache.thrift.ProcessFunction { + public static class user_deleteById extends org.apache.thrift.ProcessFunction { public user_deleteById() { super("user_deleteById"); } - protected user_deleteById_args getEmptyArgsInstance() { + public user_deleteById_args getEmptyArgsInstance() { return new user_deleteById_args(); } - protected user_deleteById_result getResult(I iface, user_deleteById_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_deleteById_result getResult(I iface, user_deleteById_args args) throws org.apache.thrift.TException { user_deleteById_result result = new user_deleteById_result(); try { result.success = iface.user_deleteById(args.fileId, args.recursive); @@ -3008,16 +3582,20 @@ protected user_deleteById_result getResult(I iface, user_deleteById_args args) t } } - private static class user_deleteByPath extends org.apache.thrift.ProcessFunction { + public static class user_deleteByPath extends org.apache.thrift.ProcessFunction { public user_deleteByPath() { super("user_deleteByPath"); } - protected user_deleteByPath_args getEmptyArgsInstance() { + public user_deleteByPath_args getEmptyArgsInstance() { return new user_deleteByPath_args(); } - protected user_deleteByPath_result getResult(I iface, user_deleteByPath_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_deleteByPath_result getResult(I iface, user_deleteByPath_args args) throws org.apache.thrift.TException { user_deleteByPath_result result = new user_deleteByPath_result(); try { result.success = iface.user_deleteByPath(args.path, args.recursive); @@ -3029,32 +3607,40 @@ protected user_deleteByPath_result getResult(I iface, user_deleteByPath_args arg } } - private static class user_outOfMemoryForPinFile extends org.apache.thrift.ProcessFunction { + public static class user_outOfMemoryForPinFile extends org.apache.thrift.ProcessFunction { public user_outOfMemoryForPinFile() { super("user_outOfMemoryForPinFile"); } - protected user_outOfMemoryForPinFile_args getEmptyArgsInstance() { + public user_outOfMemoryForPinFile_args getEmptyArgsInstance() { return new user_outOfMemoryForPinFile_args(); } - protected user_outOfMemoryForPinFile_result getResult(I iface, user_outOfMemoryForPinFile_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_outOfMemoryForPinFile_result getResult(I iface, user_outOfMemoryForPinFile_args args) throws org.apache.thrift.TException { user_outOfMemoryForPinFile_result result = new user_outOfMemoryForPinFile_result(); iface.user_outOfMemoryForPinFile(args.fileId); return result; } } - private static class user_rename extends org.apache.thrift.ProcessFunction { + public static class user_rename extends org.apache.thrift.ProcessFunction { public user_rename() { super("user_rename"); } - protected user_rename_args getEmptyArgsInstance() { + public user_rename_args getEmptyArgsInstance() { return new user_rename_args(); } - protected user_rename_result getResult(I iface, user_rename_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_rename_result getResult(I iface, user_rename_args args) throws org.apache.thrift.TException { user_rename_result result = new user_rename_result(); try { iface.user_rename(args.srcPath, args.dstPath); @@ -3069,16 +3655,20 @@ protected user_rename_result getResult(I iface, user_rename_args args) throws or } } - private static class user_renameTo extends org.apache.thrift.ProcessFunction { + public static class user_renameTo extends org.apache.thrift.ProcessFunction { public user_renameTo() { super("user_renameTo"); } - protected user_renameTo_args getEmptyArgsInstance() { + public user_renameTo_args getEmptyArgsInstance() { return new user_renameTo_args(); } - protected user_renameTo_result getResult(I iface, user_renameTo_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_renameTo_result getResult(I iface, user_renameTo_args args) throws org.apache.thrift.TException { user_renameTo_result result = new user_renameTo_result(); try { iface.user_renameTo(args.fileId, args.dstPath); @@ -3093,16 +3683,20 @@ protected user_renameTo_result getResult(I iface, user_renameTo_args args) throw } } - private static class user_unpinFile extends org.apache.thrift.ProcessFunction { + public static class user_unpinFile extends org.apache.thrift.ProcessFunction { public user_unpinFile() { super("user_unpinFile"); } - protected user_unpinFile_args getEmptyArgsInstance() { + public user_unpinFile_args getEmptyArgsInstance() { return new user_unpinFile_args(); } - protected user_unpinFile_result getResult(I iface, user_unpinFile_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_unpinFile_result getResult(I iface, user_unpinFile_args args) throws org.apache.thrift.TException { user_unpinFile_result result = new user_unpinFile_result(); try { iface.user_unpinFile(args.fileId); @@ -3113,16 +3707,20 @@ protected user_unpinFile_result getResult(I iface, user_unpinFile_args args) thr } } - private static class user_mkdir extends org.apache.thrift.ProcessFunction { + public static class user_mkdir extends org.apache.thrift.ProcessFunction { public user_mkdir() { super("user_mkdir"); } - protected user_mkdir_args getEmptyArgsInstance() { + public user_mkdir_args getEmptyArgsInstance() { return new user_mkdir_args(); } - protected user_mkdir_result getResult(I iface, user_mkdir_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_mkdir_result getResult(I iface, user_mkdir_args args) throws org.apache.thrift.TException { user_mkdir_result result = new user_mkdir_result(); try { result.success = iface.user_mkdir(args.path); @@ -3138,16 +3736,20 @@ protected user_mkdir_result getResult(I iface, user_mkdir_args args) throws org. } } - private static class user_createRawTable extends org.apache.thrift.ProcessFunction { + public static class user_createRawTable extends org.apache.thrift.ProcessFunction { public user_createRawTable() { super("user_createRawTable"); } - protected user_createRawTable_args getEmptyArgsInstance() { + public user_createRawTable_args getEmptyArgsInstance() { return new user_createRawTable_args(); } - protected user_createRawTable_result getResult(I iface, user_createRawTable_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_createRawTable_result getResult(I iface, user_createRawTable_args args) throws org.apache.thrift.TException { user_createRawTable_result result = new user_createRawTable_result(); try { result.success = iface.user_createRawTable(args.path, args.columns, args.metadata); @@ -3165,16 +3767,20 @@ protected user_createRawTable_result getResult(I iface, user_createRawTable_args } } - private static class user_getRawTableId extends org.apache.thrift.ProcessFunction { + public static class user_getRawTableId extends org.apache.thrift.ProcessFunction { public user_getRawTableId() { super("user_getRawTableId"); } - protected user_getRawTableId_args getEmptyArgsInstance() { + public user_getRawTableId_args getEmptyArgsInstance() { return new user_getRawTableId_args(); } - protected user_getRawTableId_result getResult(I iface, user_getRawTableId_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_getRawTableId_result getResult(I iface, user_getRawTableId_args args) throws org.apache.thrift.TException { user_getRawTableId_result result = new user_getRawTableId_result(); try { result.success = iface.user_getRawTableId(args.path); @@ -3186,16 +3792,20 @@ protected user_getRawTableId_result getResult(I iface, user_getRawTableId_args a } } - private static class user_getClientRawTableInfoById extends org.apache.thrift.ProcessFunction { + public static class user_getClientRawTableInfoById extends org.apache.thrift.ProcessFunction { public user_getClientRawTableInfoById() { super("user_getClientRawTableInfoById"); } - protected user_getClientRawTableInfoById_args getEmptyArgsInstance() { + public user_getClientRawTableInfoById_args getEmptyArgsInstance() { return new user_getClientRawTableInfoById_args(); } - protected user_getClientRawTableInfoById_result getResult(I iface, user_getClientRawTableInfoById_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_getClientRawTableInfoById_result getResult(I iface, user_getClientRawTableInfoById_args args) throws org.apache.thrift.TException { user_getClientRawTableInfoById_result result = new user_getClientRawTableInfoById_result(); try { result.success = iface.user_getClientRawTableInfoById(args.tableId); @@ -3206,16 +3816,20 @@ protected user_getClientRawTableInfoById_result getResult(I iface, user_getClien } } - private static class user_getClientRawTableInfoByPath extends org.apache.thrift.ProcessFunction { + public static class user_getClientRawTableInfoByPath extends org.apache.thrift.ProcessFunction { public user_getClientRawTableInfoByPath() { super("user_getClientRawTableInfoByPath"); } - protected user_getClientRawTableInfoByPath_args getEmptyArgsInstance() { + public user_getClientRawTableInfoByPath_args getEmptyArgsInstance() { return new user_getClientRawTableInfoByPath_args(); } - protected user_getClientRawTableInfoByPath_result getResult(I iface, user_getClientRawTableInfoByPath_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_getClientRawTableInfoByPath_result getResult(I iface, user_getClientRawTableInfoByPath_args args) throws org.apache.thrift.TException { user_getClientRawTableInfoByPath_result result = new user_getClientRawTableInfoByPath_result(); try { result.success = iface.user_getClientRawTableInfoByPath(args.tablePath); @@ -3228,16 +3842,20 @@ protected user_getClientRawTableInfoByPath_result getResult(I iface, user_getCli } } - private static class user_updateRawTableMetadata extends org.apache.thrift.ProcessFunction { + public static class user_updateRawTableMetadata extends org.apache.thrift.ProcessFunction { public user_updateRawTableMetadata() { super("user_updateRawTableMetadata"); } - protected user_updateRawTableMetadata_args getEmptyArgsInstance() { + public user_updateRawTableMetadata_args getEmptyArgsInstance() { return new user_updateRawTableMetadata_args(); } - protected user_updateRawTableMetadata_result getResult(I iface, user_updateRawTableMetadata_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_updateRawTableMetadata_result getResult(I iface, user_updateRawTableMetadata_args args) throws org.apache.thrift.TException { user_updateRawTableMetadata_result result = new user_updateRawTableMetadata_result(); try { iface.user_updateRawTableMetadata(args.tableId, args.metadata); @@ -3250,16 +3868,20 @@ protected user_updateRawTableMetadata_result getResult(I iface, user_updateRawTa } } - private static class user_getNumberOfFiles extends org.apache.thrift.ProcessFunction { + public static class user_getNumberOfFiles extends org.apache.thrift.ProcessFunction { public user_getNumberOfFiles() { super("user_getNumberOfFiles"); } - protected user_getNumberOfFiles_args getEmptyArgsInstance() { + public user_getNumberOfFiles_args getEmptyArgsInstance() { return new user_getNumberOfFiles_args(); } - protected user_getNumberOfFiles_result getResult(I iface, user_getNumberOfFiles_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_getNumberOfFiles_result getResult(I iface, user_getNumberOfFiles_args args) throws org.apache.thrift.TException { user_getNumberOfFiles_result result = new user_getNumberOfFiles_result(); try { result.success = iface.user_getNumberOfFiles(args.path); @@ -3273,16 +3895,20 @@ protected user_getNumberOfFiles_result getResult(I iface, user_getNumberOfFiles_ } } - private static class user_getUnderfsAddress extends org.apache.thrift.ProcessFunction { + public static class user_getUnderfsAddress extends org.apache.thrift.ProcessFunction { public user_getUnderfsAddress() { super("user_getUnderfsAddress"); } - protected user_getUnderfsAddress_args getEmptyArgsInstance() { + public user_getUnderfsAddress_args getEmptyArgsInstance() { return new user_getUnderfsAddress_args(); } - protected user_getUnderfsAddress_result getResult(I iface, user_getUnderfsAddress_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public user_getUnderfsAddress_result getResult(I iface, user_getUnderfsAddress_args args) throws org.apache.thrift.TException { user_getUnderfsAddress_result result = new user_getUnderfsAddress_result(); result.success = iface.user_getUnderfsAddress(); return result; @@ -3299,6 +3925,12 @@ public static class addCheckpoint_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new addCheckpoint_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new addCheckpoint_argsTupleSchemeFactory()); + } + public long workerId; // required public int fileId; // required public long length; // required @@ -3375,8 +4007,7 @@ public String getFieldName() { private static final int __WORKERID_ISSET_ID = 0; private static final int __FILEID_ISSET_ID = 1; private static final int __LENGTH_ISSET_ID = 2; - private BitSet __isset_bit_vector = new BitSet(3); - + private byte __isset_bitfield = 0; 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); @@ -3415,8 +4046,7 @@ public addCheckpoint_args( * Performs a deep copy on other. */ public addCheckpoint_args(addCheckpoint_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.workerId = other.workerId; this.fileId = other.fileId; this.length = other.length; @@ -3451,16 +4081,16 @@ public addCheckpoint_args setWorkerId(long workerId) { } public void unsetWorkerId() { - __isset_bit_vector.clear(__WORKERID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WORKERID_ISSET_ID); } /** Returns true if field workerId is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerId() { - return __isset_bit_vector.get(__WORKERID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __WORKERID_ISSET_ID); } public void setWorkerIdIsSet(boolean value) { - __isset_bit_vector.set(__WORKERID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WORKERID_ISSET_ID, value); } public int getFileId() { @@ -3474,16 +4104,16 @@ public addCheckpoint_args setFileId(int fileId) { } public void unsetFileId() { - __isset_bit_vector.clear(__FILEID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { - return __isset_bit_vector.get(__FILEID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { - __isset_bit_vector.set(__FILEID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public long getLength() { @@ -3497,16 +4127,16 @@ public addCheckpoint_args setLength(long length) { } public void unsetLength() { - __isset_bit_vector.clear(__LENGTH_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LENGTH_ISSET_ID); } /** Returns true if field length is set (has been assigned a value) and false otherwise */ public boolean isSetLength() { - return __isset_bit_vector.get(__LENGTH_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __LENGTH_ISSET_ID); } public void setLengthIsSet(boolean value) { - __isset_bit_vector.set(__LENGTH_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LENGTH_ISSET_ID, value); } public String getCheckpointPath() { @@ -3720,77 +4350,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // WORKER_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.workerId = iprot.readI64(); - setWorkerIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // FILE_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.fileId = iprot.readI32(); - setFileIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // LENGTH - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.length = iprot.readI64(); - setLengthIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CHECKPOINT_PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.checkpointPath = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(WORKER_ID_FIELD_DESC); - oprot.writeI64(this.workerId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(FILE_ID_FIELD_DESC); - oprot.writeI32(this.fileId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(LENGTH_FIELD_DESC); - oprot.writeI64(this.length); - oprot.writeFieldEnd(); - if (this.checkpointPath != null) { - oprot.writeFieldBegin(CHECKPOINT_PATH_FIELD_DESC); - oprot.writeString(this.checkpointPath); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -3823,6 +4387,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -3836,13 +4401,160 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class addCheckpoint_argsStandardSchemeFactory implements SchemeFactory { + public addCheckpoint_argsStandardScheme getScheme() { + return new addCheckpoint_argsStandardScheme(); + } + } + + private static class addCheckpoint_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, addCheckpoint_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // WORKER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.workerId = iprot.readI64(); + struct.setWorkerIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // FILE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // LENGTH + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.length = iprot.readI64(); + struct.setLengthIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CHECKPOINT_PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.checkpointPath = iprot.readString(); + struct.setCheckpointPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, addCheckpoint_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(WORKER_ID_FIELD_DESC); + oprot.writeI64(struct.workerId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(FILE_ID_FIELD_DESC); + oprot.writeI32(struct.fileId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(LENGTH_FIELD_DESC); + oprot.writeI64(struct.length); + oprot.writeFieldEnd(); + if (struct.checkpointPath != null) { + oprot.writeFieldBegin(CHECKPOINT_PATH_FIELD_DESC); + oprot.writeString(struct.checkpointPath); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class addCheckpoint_argsTupleSchemeFactory implements SchemeFactory { + public addCheckpoint_argsTupleScheme getScheme() { + return new addCheckpoint_argsTupleScheme(); + } + } + + private static class addCheckpoint_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetWorkerId()) { + optionals.set(0); + } + if (struct.isSetFileId()) { + optionals.set(1); + } + if (struct.isSetLength()) { + optionals.set(2); + } + if (struct.isSetCheckpointPath()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetWorkerId()) { + oprot.writeI64(struct.workerId); + } + if (struct.isSetFileId()) { + oprot.writeI32(struct.fileId); + } + if (struct.isSetLength()) { + oprot.writeI64(struct.length); + } + if (struct.isSetCheckpointPath()) { + oprot.writeString(struct.checkpointPath); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.workerId = iprot.readI64(); + struct.setWorkerIdIsSet(true); + } + if (incoming.get(1)) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } + if (incoming.get(2)) { + struct.length = iprot.readI64(); + struct.setLengthIsSet(true); + } + if (incoming.get(3)) { + struct.checkpointPath = iprot.readString(); + struct.setCheckpointPathIsSet(true); + } + } + } + } public static class addCheckpoint_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -3853,6 +4565,12 @@ public static class addCheckpoint_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new addCheckpoint_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new addCheckpoint_resultTupleSchemeFactory()); + } + public boolean success; // required public FileDoesNotExistException eP; // required public SuspectedFileSizeException eS; // required @@ -3927,8 +4645,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -3965,8 +4682,7 @@ public addCheckpoint_result( * Performs a deep copy on other. */ public addCheckpoint_result(addCheckpoint_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetEP()) { this.eP = new FileDoesNotExistException(other.eP); @@ -4003,16 +4719,16 @@ public addCheckpoint_result setSuccess(boolean success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileDoesNotExistException getEP() { @@ -4274,81 +4990,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.success = iprot.readBool(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E_P - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eP = new FileDoesNotExistException(); - this.eP.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_S - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eS = new SuspectedFileSizeException(); - this.eS.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // E_B - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eB = new BlockInfoException(); - this.eB.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetEP()) { - oprot.writeFieldBegin(E_P_FIELD_DESC); - this.eP.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetES()) { - oprot.writeFieldBegin(E_S_FIELD_DESC); - this.eS.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEB()) { - oprot.writeFieldBegin(E_B_FIELD_DESC); - this.eB.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -4388,6 +5035,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -4400,18 +5048,185 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class addCheckpoint_resultStandardSchemeFactory implements SchemeFactory { + public addCheckpoint_resultStandardScheme getScheme() { + return new addCheckpoint_resultStandardScheme(); + } + } + + private static class addCheckpoint_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, addCheckpoint_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_P + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eP = new FileDoesNotExistException(); + struct.eP.read(iprot); + struct.setEPIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_S + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eS = new SuspectedFileSizeException(); + struct.eS.read(iprot); + struct.setESIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // E_B + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, addCheckpoint_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + if (struct.eP != null) { + oprot.writeFieldBegin(E_P_FIELD_DESC); + struct.eP.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eS != null) { + oprot.writeFieldBegin(E_S_FIELD_DESC); + struct.eS.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eB != null) { + oprot.writeFieldBegin(E_B_FIELD_DESC); + struct.eB.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class addCheckpoint_resultTupleSchemeFactory implements SchemeFactory { + public addCheckpoint_resultTupleScheme getScheme() { + return new addCheckpoint_resultTupleScheme(); + } + } + + private static class addCheckpoint_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEP()) { + optionals.set(1); + } + if (struct.isSetES()) { + optionals.set(2); + } + if (struct.isSetEB()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetEP()) { + struct.eP.write(oprot); + } + if (struct.isSetES()) { + struct.eS.write(oprot); + } + if (struct.isSetEB()) { + struct.eB.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eP = new FileDoesNotExistException(); + struct.eP.read(iprot); + struct.setEPIsSet(true); + } + if (incoming.get(2)) { + struct.eS = new SuspectedFileSizeException(); + struct.eS.read(iprot); + struct.setESIsSet(true); + } + if (incoming.get(3)) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } + } + } + } public static class getWorkersInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getWorkersInfo_args"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getWorkersInfo_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getWorkersInfo_argsTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -4551,32 +5366,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -4590,6 +5384,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -4608,6 +5403,64 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class getWorkersInfo_argsStandardSchemeFactory implements SchemeFactory { + public getWorkersInfo_argsStandardScheme getScheme() { + return new getWorkersInfo_argsStandardScheme(); + } + } + + private static class getWorkersInfo_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getWorkersInfo_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getWorkersInfo_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getWorkersInfo_argsTupleSchemeFactory implements SchemeFactory { + public getWorkersInfo_argsTupleScheme getScheme() { + return new getWorkersInfo_argsTupleScheme(); + } + } + + private static class getWorkersInfo_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getWorkersInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getWorkersInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class getWorkersInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -4615,6 +5468,12 @@ public static class getWorkersInfo_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getWorkersInfo_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getWorkersInfo_resultTupleSchemeFactory()); + } + public List success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -4676,7 +5535,6 @@ public String getFieldName() { } // 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); @@ -4849,62 +5707,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list16 = iprot.readListBegin(); - this.success = new ArrayList(_list16.size); - for (int _i17 = 0; _i17 < _list16.size; ++_i17) - { - ClientWorkerInfo _elem18; // required - _elem18 = new ClientWorkerInfo(); - _elem18.read(iprot); - this.success.add(_elem18); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (ClientWorkerInfo _iter19 : this.success) - { - _iter19.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -4924,6 +5732,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -4942,6 +5751,124 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class getWorkersInfo_resultStandardSchemeFactory implements SchemeFactory { + public getWorkersInfo_resultStandardScheme getScheme() { + return new getWorkersInfo_resultStandardScheme(); + } + } + + private static class getWorkersInfo_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getWorkersInfo_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list48 = iprot.readListBegin(); + struct.success = new ArrayList(_list48.size); + for (int _i49 = 0; _i49 < _list48.size; ++_i49) + { + ClientWorkerInfo _elem50; // required + _elem50 = new ClientWorkerInfo(); + _elem50.read(iprot); + struct.success.add(_elem50); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getWorkersInfo_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (ClientWorkerInfo _iter51 : struct.success) + { + _iter51.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getWorkersInfo_resultTupleSchemeFactory implements SchemeFactory { + public getWorkersInfo_resultTupleScheme getScheme() { + return new getWorkersInfo_resultTupleScheme(); + } + } + + private static class getWorkersInfo_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getWorkersInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (ClientWorkerInfo _iter52 : struct.success) + { + _iter52.write(oprot); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getWorkersInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list53 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list53.size); + for (int _i54 = 0; _i54 < _list53.size; ++_i54) + { + ClientWorkerInfo _elem55; // required + _elem55 = new ClientWorkerInfo(); + _elem55.read(iprot); + struct.success.add(_elem55); + } + } + struct.setSuccessIsSet(true); + } + } + } + } public static class liststatus_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -4949,6 +5876,12 @@ public static class liststatus_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new liststatus_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new liststatus_argsTupleSchemeFactory()); + } + public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -5010,7 +5943,6 @@ public String getFieldName() { } // 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); @@ -5163,44 +6095,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -5221,6 +6120,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -5239,6 +6139,90 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class liststatus_argsStandardSchemeFactory implements SchemeFactory { + public liststatus_argsStandardScheme getScheme() { + return new liststatus_argsStandardScheme(); + } + } + + private static class liststatus_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, liststatus_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, liststatus_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class liststatus_argsTupleSchemeFactory implements SchemeFactory { + public liststatus_argsTupleScheme getScheme() { + return new liststatus_argsTupleScheme(); + } + } + + private static class liststatus_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, liststatus_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, liststatus_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + } + } + } public static class liststatus_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -5248,6 +6232,12 @@ public static class liststatus_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new liststatus_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new liststatus_resultTupleSchemeFactory()); + } + public List success; // required public InvalidPathException eI; // required public FileDoesNotExistException eF; // required @@ -5317,7 +6307,6 @@ public String getFieldName() { } // 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); @@ -5618,86 +6607,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list20 = iprot.readListBegin(); - this.success = new ArrayList(_list20.size); - for (int _i21 = 0; _i21 < _list20.size; ++_i21) - { - ClientFileInfo _elem22; // required - _elem22 = new ClientFileInfo(); - _elem22.read(iprot); - this.success.add(_elem22); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E_I - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eI = new InvalidPathException(); - this.eI.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_F - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eF = new FileDoesNotExistException(); - this.eF.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (ClientFileInfo _iter23 : this.success) - { - _iter23.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetEI()) { - oprot.writeFieldBegin(E_I_FIELD_DESC); - this.eI.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEF()) { - oprot.writeFieldBegin(E_F_FIELD_DESC); - this.eF.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -5733,6 +6648,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -5751,15 +6667,189 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - } + private static class liststatus_resultStandardSchemeFactory implements SchemeFactory { + public liststatus_resultStandardScheme getScheme() { + return new liststatus_resultStandardScheme(); + } + } - public static class worker_register_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_register_args"); + private static class liststatus_resultStandardScheme extends StandardScheme { - private static final org.apache.thrift.protocol.TField WORKER_NET_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("workerNetAddress", org.apache.thrift.protocol.TType.STRUCT, (short)1); - private static final org.apache.thrift.protocol.TField TOTAL_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("totalBytes", org.apache.thrift.protocol.TType.I64, (short)2); - private static final org.apache.thrift.protocol.TField USED_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("usedBytes", org.apache.thrift.protocol.TType.I64, (short)3); - private static final org.apache.thrift.protocol.TField CURRENT_BLOCKS_FIELD_DESC = new org.apache.thrift.protocol.TField("currentBlocks", org.apache.thrift.protocol.TType.LIST, (short)4); + public void read(org.apache.thrift.protocol.TProtocol iprot, liststatus_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list56 = iprot.readListBegin(); + struct.success = new ArrayList(_list56.size); + for (int _i57 = 0; _i57 < _list56.size; ++_i57) + { + ClientFileInfo _elem58; // required + _elem58 = new ClientFileInfo(); + _elem58.read(iprot); + struct.success.add(_elem58); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_F + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, liststatus_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (ClientFileInfo _iter59 : struct.success) + { + _iter59.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eF != null) { + oprot.writeFieldBegin(E_F_FIELD_DESC); + struct.eF.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class liststatus_resultTupleSchemeFactory implements SchemeFactory { + public liststatus_resultTupleScheme getScheme() { + return new liststatus_resultTupleScheme(); + } + } + + private static class liststatus_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, liststatus_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEI()) { + optionals.set(1); + } + if (struct.isSetEF()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (ClientFileInfo _iter60 : struct.success) + { + _iter60.write(oprot); + } + } + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + if (struct.isSetEF()) { + struct.eF.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, liststatus_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list61 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list61.size); + for (int _i62 = 0; _i62 < _list61.size; ++_i62) + { + ClientFileInfo _elem63; // required + _elem63 = new ClientFileInfo(); + _elem63.read(iprot); + struct.success.add(_elem63); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + if (incoming.get(2)) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } + } + } + + } + + public static class worker_register_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_register_args"); + + private static final org.apache.thrift.protocol.TField WORKER_NET_ADDRESS_FIELD_DESC = new org.apache.thrift.protocol.TField("workerNetAddress", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField TOTAL_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("totalBytes", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField USED_BYTES_FIELD_DESC = new org.apache.thrift.protocol.TField("usedBytes", org.apache.thrift.protocol.TType.I64, (short)3); + private static final org.apache.thrift.protocol.TField CURRENT_BLOCKS_FIELD_DESC = new org.apache.thrift.protocol.TField("currentBlocks", org.apache.thrift.protocol.TType.LIST, (short)4); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new worker_register_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new worker_register_argsTupleSchemeFactory()); + } public NetAddress workerNetAddress; // required public long totalBytes; // required @@ -5836,8 +6926,7 @@ public String getFieldName() { // isset id assignments private static final int __TOTALBYTES_ISSET_ID = 0; private static final int __USEDBYTES_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private byte __isset_bitfield = 0; 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); @@ -5876,8 +6965,7 @@ public worker_register_args( * Performs a deep copy on other. */ public worker_register_args(worker_register_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetWorkerNetAddress()) { this.workerNetAddress = new NetAddress(other.workerNetAddress); } @@ -5941,16 +7029,16 @@ public worker_register_args setTotalBytes(long totalBytes) { } public void unsetTotalBytes() { - __isset_bit_vector.clear(__TOTALBYTES_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TOTALBYTES_ISSET_ID); } /** Returns true if field totalBytes is set (has been assigned a value) and false otherwise */ public boolean isSetTotalBytes() { - return __isset_bit_vector.get(__TOTALBYTES_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __TOTALBYTES_ISSET_ID); } public void setTotalBytesIsSet(boolean value) { - __isset_bit_vector.set(__TOTALBYTES_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TOTALBYTES_ISSET_ID, value); } public long getUsedBytes() { @@ -5964,16 +7052,16 @@ public worker_register_args setUsedBytes(long usedBytes) { } public void unsetUsedBytes() { - __isset_bit_vector.clear(__USEDBYTES_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } /** Returns true if field usedBytes is set (has been assigned a value) and false otherwise */ public boolean isSetUsedBytes() { - return __isset_bit_vector.get(__USEDBYTES_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } public void setUsedBytesIsSet(boolean value) { - __isset_bit_vector.set(__USEDBYTES_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USEDBYTES_ISSET_ID, value); } public int getCurrentBlocksSize() { @@ -6202,96 +7290,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // WORKER_NET_ADDRESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.workerNetAddress = new NetAddress(); - this.workerNetAddress.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // TOTAL_BYTES - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.totalBytes = iprot.readI64(); - setTotalBytesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // USED_BYTES - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.usedBytes = iprot.readI64(); - setUsedBytesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // CURRENT_BLOCKS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list24 = iprot.readListBegin(); - this.currentBlocks = new ArrayList(_list24.size); - for (int _i25 = 0; _i25 < _list24.size; ++_i25) - { - long _elem26; // required - _elem26 = iprot.readI64(); - this.currentBlocks.add(_elem26); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.workerNetAddress != null) { - oprot.writeFieldBegin(WORKER_NET_ADDRESS_FIELD_DESC); - this.workerNetAddress.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(TOTAL_BYTES_FIELD_DESC); - oprot.writeI64(this.totalBytes); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(USED_BYTES_FIELD_DESC); - oprot.writeI64(this.usedBytes); - oprot.writeFieldEnd(); - if (this.currentBlocks != null) { - oprot.writeFieldBegin(CURRENT_BLOCKS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.currentBlocks.size())); - for (long _iter27 : this.currentBlocks) - { - oprot.writeI64(_iter27); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -6328,6 +7331,10 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (workerNetAddress != null) { + workerNetAddress.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -6341,13 +7348,196 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class worker_register_argsStandardSchemeFactory implements SchemeFactory { + public worker_register_argsStandardScheme getScheme() { + return new worker_register_argsStandardScheme(); + } + } + + private static class worker_register_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, worker_register_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // WORKER_NET_ADDRESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.workerNetAddress = new NetAddress(); + struct.workerNetAddress.read(iprot); + struct.setWorkerNetAddressIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // TOTAL_BYTES + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.totalBytes = iprot.readI64(); + struct.setTotalBytesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // USED_BYTES + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.usedBytes = iprot.readI64(); + struct.setUsedBytesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // CURRENT_BLOCKS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list64 = iprot.readListBegin(); + struct.currentBlocks = new ArrayList(_list64.size); + for (int _i65 = 0; _i65 < _list64.size; ++_i65) + { + long _elem66; // required + _elem66 = iprot.readI64(); + struct.currentBlocks.add(_elem66); + } + iprot.readListEnd(); + } + struct.setCurrentBlocksIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, worker_register_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.workerNetAddress != null) { + oprot.writeFieldBegin(WORKER_NET_ADDRESS_FIELD_DESC); + struct.workerNetAddress.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(TOTAL_BYTES_FIELD_DESC); + oprot.writeI64(struct.totalBytes); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(USED_BYTES_FIELD_DESC); + oprot.writeI64(struct.usedBytes); + oprot.writeFieldEnd(); + if (struct.currentBlocks != null) { + oprot.writeFieldBegin(CURRENT_BLOCKS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.currentBlocks.size())); + for (long _iter67 : struct.currentBlocks) + { + oprot.writeI64(_iter67); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class worker_register_argsTupleSchemeFactory implements SchemeFactory { + public worker_register_argsTupleScheme getScheme() { + return new worker_register_argsTupleScheme(); + } + } + + private static class worker_register_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, worker_register_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetWorkerNetAddress()) { + optionals.set(0); + } + if (struct.isSetTotalBytes()) { + optionals.set(1); + } + if (struct.isSetUsedBytes()) { + optionals.set(2); + } + if (struct.isSetCurrentBlocks()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetWorkerNetAddress()) { + struct.workerNetAddress.write(oprot); + } + if (struct.isSetTotalBytes()) { + oprot.writeI64(struct.totalBytes); + } + if (struct.isSetUsedBytes()) { + oprot.writeI64(struct.usedBytes); + } + if (struct.isSetCurrentBlocks()) { + { + oprot.writeI32(struct.currentBlocks.size()); + for (long _iter68 : struct.currentBlocks) + { + oprot.writeI64(_iter68); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, worker_register_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.workerNetAddress = new NetAddress(); + struct.workerNetAddress.read(iprot); + struct.setWorkerNetAddressIsSet(true); + } + if (incoming.get(1)) { + struct.totalBytes = iprot.readI64(); + struct.setTotalBytesIsSet(true); + } + if (incoming.get(2)) { + struct.usedBytes = iprot.readI64(); + struct.setUsedBytesIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TList _list69 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + struct.currentBlocks = new ArrayList(_list69.size); + for (int _i70 = 0; _i70 < _list69.size; ++_i70) + { + long _elem71; // required + _elem71 = iprot.readI64(); + struct.currentBlocks.add(_elem71); + } + } + struct.setCurrentBlocksIsSet(true); + } + } + } + } public static class worker_register_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -6356,6 +7546,12 @@ public static class worker_register_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new worker_register_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new worker_register_resultTupleSchemeFactory()); + } + public long success; // required public BlockInfoException e; // required @@ -6422,8 +7618,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -6452,8 +7647,7 @@ public worker_register_result( * Performs a deep copy on other. */ public worker_register_result(worker_register_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new BlockInfoException(other.e); @@ -6482,16 +7676,16 @@ public worker_register_result setSuccess(long success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public BlockInfoException getE() { @@ -6641,57 +7835,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.success = iprot.readI64(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new BlockInfoException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -6715,6 +7864,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -6727,12 +7877,123 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class worker_register_resultStandardSchemeFactory implements SchemeFactory { + public worker_register_resultStandardScheme getScheme() { + return new worker_register_resultStandardScheme(); + } + } + + private static class worker_register_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, worker_register_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new BlockInfoException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, worker_register_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI64(struct.success); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class worker_register_resultTupleSchemeFactory implements SchemeFactory { + public worker_register_resultTupleScheme getScheme() { + return new worker_register_resultTupleScheme(); + } + } + + private static class worker_register_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, worker_register_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeI64(struct.success); + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, worker_register_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new BlockInfoException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + } public static class worker_heartbeat_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -6742,6 +8003,12 @@ public static class worker_heartbeat_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new worker_heartbeat_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new worker_heartbeat_argsTupleSchemeFactory()); + } + public long workerId; // required public long usedBytes; // required public List removedBlocks; // required @@ -6813,8 +8080,7 @@ public String getFieldName() { // isset id assignments private static final int __WORKERID_ISSET_ID = 0; private static final int __USEDBYTES_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private byte __isset_bitfield = 0; 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); @@ -6849,8 +8115,7 @@ public worker_heartbeat_args( * Performs a deep copy on other. */ public worker_heartbeat_args(worker_heartbeat_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.workerId = other.workerId; this.usedBytes = other.usedBytes; if (other.isSetRemovedBlocks()) { @@ -6886,16 +8151,16 @@ public worker_heartbeat_args setWorkerId(long workerId) { } public void unsetWorkerId() { - __isset_bit_vector.clear(__WORKERID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WORKERID_ISSET_ID); } /** Returns true if field workerId is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerId() { - return __isset_bit_vector.get(__WORKERID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __WORKERID_ISSET_ID); } public void setWorkerIdIsSet(boolean value) { - __isset_bit_vector.set(__WORKERID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WORKERID_ISSET_ID, value); } public long getUsedBytes() { @@ -6909,16 +8174,16 @@ public worker_heartbeat_args setUsedBytes(long usedBytes) { } public void unsetUsedBytes() { - __isset_bit_vector.clear(__USEDBYTES_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } /** Returns true if field usedBytes is set (has been assigned a value) and false otherwise */ public boolean isSetUsedBytes() { - return __isset_bit_vector.get(__USEDBYTES_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __USEDBYTES_ISSET_ID); } public void setUsedBytesIsSet(boolean value) { - __isset_bit_vector.set(__USEDBYTES_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USEDBYTES_ISSET_ID, value); } public int getRemovedBlocksSize() { @@ -7115,83 +8380,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // WORKER_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.workerId = iprot.readI64(); - setWorkerIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // USED_BYTES - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.usedBytes = iprot.readI64(); - setUsedBytesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // REMOVED_BLOCKS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list28 = iprot.readListBegin(); - this.removedBlocks = new ArrayList(_list28.size); - for (int _i29 = 0; _i29 < _list28.size; ++_i29) - { - long _elem30; // required - _elem30 = iprot.readI64(); - this.removedBlocks.add(_elem30); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(WORKER_ID_FIELD_DESC); - oprot.writeI64(this.workerId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(USED_BYTES_FIELD_DESC); - oprot.writeI64(this.usedBytes); - oprot.writeFieldEnd(); - if (this.removedBlocks != null) { - oprot.writeFieldBegin(REMOVED_BLOCKS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, this.removedBlocks.size())); - for (long _iter31 : this.removedBlocks) - { - oprot.writeI64(_iter31); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -7220,6 +8413,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -7233,41 +8427,205 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } - } - - public static class worker_heartbeat_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_heartbeat_result"); + private static class worker_heartbeat_argsStandardSchemeFactory implements SchemeFactory { + public worker_heartbeat_argsStandardScheme getScheme() { + return new worker_heartbeat_argsStandardScheme(); + } + } - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); - private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static class worker_heartbeat_argsStandardScheme extends StandardScheme { - public Command success; // required - public BlockInfoException e; // required + public void read(org.apache.thrift.protocol.TProtocol iprot, worker_heartbeat_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // WORKER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.workerId = iprot.readI64(); + struct.setWorkerIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // USED_BYTES + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.usedBytes = iprot.readI64(); + struct.setUsedBytesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // REMOVED_BLOCKS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list72 = iprot.readListBegin(); + struct.removedBlocks = new ArrayList(_list72.size); + for (int _i73 = 0; _i73 < _list72.size; ++_i73) + { + long _elem74; // required + _elem74 = iprot.readI64(); + struct.removedBlocks.add(_elem74); + } + iprot.readListEnd(); + } + struct.setRemovedBlocksIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ - public enum _Fields implements org.apache.thrift.TFieldIdEnum { - SUCCESS((short)0, "success"), - E((short)1, "e"); + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } - private static final Map byName = new HashMap(); + public void write(org.apache.thrift.protocol.TProtocol oprot, worker_heartbeat_args struct) throws org.apache.thrift.TException { + struct.validate(); - static { - for (_Fields field : EnumSet.allOf(_Fields.class)) { - byName.put(field.getFieldName(), field); + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(WORKER_ID_FIELD_DESC); + oprot.writeI64(struct.workerId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(USED_BYTES_FIELD_DESC); + oprot.writeI64(struct.usedBytes); + oprot.writeFieldEnd(); + if (struct.removedBlocks != null) { + oprot.writeFieldBegin(REMOVED_BLOCKS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, struct.removedBlocks.size())); + for (long _iter75 : struct.removedBlocks) + { + oprot.writeI64(_iter75); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); } + oprot.writeFieldStop(); + oprot.writeStructEnd(); } - /** - * Find the _Fields constant that matches fieldId, or null if its not found. - */ - public static _Fields findByThriftId(int fieldId) { + } + + private static class worker_heartbeat_argsTupleSchemeFactory implements SchemeFactory { + public worker_heartbeat_argsTupleScheme getScheme() { + return new worker_heartbeat_argsTupleScheme(); + } + } + + private static class worker_heartbeat_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, worker_heartbeat_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetWorkerId()) { + optionals.set(0); + } + if (struct.isSetUsedBytes()) { + optionals.set(1); + } + if (struct.isSetRemovedBlocks()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetWorkerId()) { + oprot.writeI64(struct.workerId); + } + if (struct.isSetUsedBytes()) { + oprot.writeI64(struct.usedBytes); + } + if (struct.isSetRemovedBlocks()) { + { + oprot.writeI32(struct.removedBlocks.size()); + for (long _iter76 : struct.removedBlocks) + { + oprot.writeI64(_iter76); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, worker_heartbeat_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.workerId = iprot.readI64(); + struct.setWorkerIdIsSet(true); + } + if (incoming.get(1)) { + struct.usedBytes = iprot.readI64(); + struct.setUsedBytesIsSet(true); + } + if (incoming.get(2)) { + { + org.apache.thrift.protocol.TList _list77 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I64, iprot.readI32()); + struct.removedBlocks = new ArrayList(_list77.size); + for (int _i78 = 0; _i78 < _list77.size; ++_i78) + { + long _elem79; // required + _elem79 = iprot.readI64(); + struct.removedBlocks.add(_elem79); + } + } + struct.setRemovedBlocksIsSet(true); + } + } + } + + } + + public static class worker_heartbeat_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_heartbeat_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new worker_heartbeat_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new worker_heartbeat_resultTupleSchemeFactory()); + } + + public Command success; // required + public BlockInfoException e; // 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 { + SUCCESS((short)0, "success"), + E((short)1, "e"); + + 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 0: // SUCCESS return SUCCESS; @@ -7313,7 +8671,6 @@ public String getFieldName() { } // 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); @@ -7530,57 +8887,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new Command(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new BlockInfoException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -7608,6 +8920,10 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -7626,6 +8942,117 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class worker_heartbeat_resultStandardSchemeFactory implements SchemeFactory { + public worker_heartbeat_resultStandardScheme getScheme() { + return new worker_heartbeat_resultStandardScheme(); + } + } + + private static class worker_heartbeat_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, worker_heartbeat_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new Command(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new BlockInfoException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, worker_heartbeat_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class worker_heartbeat_resultTupleSchemeFactory implements SchemeFactory { + public worker_heartbeat_resultTupleScheme getScheme() { + return new worker_heartbeat_resultTupleScheme(); + } + } + + private static class worker_heartbeat_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, worker_heartbeat_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, worker_heartbeat_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new Command(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new BlockInfoException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + } public static class worker_cacheBlock_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -7636,6 +9063,12 @@ public static class worker_cacheBlock_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new worker_cacheBlock_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new worker_cacheBlock_argsTupleSchemeFactory()); + } + public long workerId; // required public long workerUsedBytes; // required public long blockId; // required @@ -7713,8 +9146,7 @@ public String getFieldName() { private static final int __WORKERUSEDBYTES_ISSET_ID = 1; private static final int __BLOCKID_ISSET_ID = 2; private static final int __LENGTH_ISSET_ID = 3; - private BitSet __isset_bit_vector = new BitSet(4); - + private byte __isset_bitfield = 0; 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); @@ -7754,8 +9186,7 @@ public worker_cacheBlock_args( * Performs a deep copy on other. */ public worker_cacheBlock_args(worker_cacheBlock_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.workerId = other.workerId; this.workerUsedBytes = other.workerUsedBytes; this.blockId = other.blockId; @@ -7789,16 +9220,16 @@ public worker_cacheBlock_args setWorkerId(long workerId) { } public void unsetWorkerId() { - __isset_bit_vector.clear(__WORKERID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WORKERID_ISSET_ID); } /** Returns true if field workerId is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerId() { - return __isset_bit_vector.get(__WORKERID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __WORKERID_ISSET_ID); } public void setWorkerIdIsSet(boolean value) { - __isset_bit_vector.set(__WORKERID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WORKERID_ISSET_ID, value); } public long getWorkerUsedBytes() { @@ -7812,16 +9243,16 @@ public worker_cacheBlock_args setWorkerUsedBytes(long workerUsedBytes) { } public void unsetWorkerUsedBytes() { - __isset_bit_vector.clear(__WORKERUSEDBYTES_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __WORKERUSEDBYTES_ISSET_ID); } /** Returns true if field workerUsedBytes is set (has been assigned a value) and false otherwise */ public boolean isSetWorkerUsedBytes() { - return __isset_bit_vector.get(__WORKERUSEDBYTES_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __WORKERUSEDBYTES_ISSET_ID); } public void setWorkerUsedBytesIsSet(boolean value) { - __isset_bit_vector.set(__WORKERUSEDBYTES_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __WORKERUSEDBYTES_ISSET_ID, value); } public long getBlockId() { @@ -7835,16 +9266,16 @@ public worker_cacheBlock_args setBlockId(long blockId) { } public void unsetBlockId() { - __isset_bit_vector.clear(__BLOCKID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID); } /** Returns true if field blockId is set (has been assigned a value) and false otherwise */ public boolean isSetBlockId() { - return __isset_bit_vector.get(__BLOCKID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID); } public void setBlockIdIsSet(boolean value) { - __isset_bit_vector.set(__BLOCKID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value); } public long getLength() { @@ -7858,16 +9289,16 @@ public worker_cacheBlock_args setLength(long length) { } public void unsetLength() { - __isset_bit_vector.clear(__LENGTH_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __LENGTH_ISSET_ID); } /** Returns true if field length is set (has been assigned a value) and false otherwise */ public boolean isSetLength() { - return __isset_bit_vector.get(__LENGTH_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __LENGTH_ISSET_ID); } public void setLengthIsSet(boolean value) { - __isset_bit_vector.set(__LENGTH_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __LENGTH_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -8057,76 +9488,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // WORKER_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.workerId = iprot.readI64(); - setWorkerIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // WORKER_USED_BYTES - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.workerUsedBytes = iprot.readI64(); - setWorkerUsedBytesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // BLOCK_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.blockId = iprot.readI64(); - setBlockIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // LENGTH - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.length = iprot.readI64(); - setLengthIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(WORKER_ID_FIELD_DESC); - oprot.writeI64(this.workerId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(WORKER_USED_BYTES_FIELD_DESC); - oprot.writeI64(this.workerUsedBytes); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); - oprot.writeI64(this.blockId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(LENGTH_FIELD_DESC); - oprot.writeI64(this.length); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -8155,6 +9521,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -8168,13 +9535,158 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class worker_cacheBlock_argsStandardSchemeFactory implements SchemeFactory { + public worker_cacheBlock_argsStandardScheme getScheme() { + return new worker_cacheBlock_argsStandardScheme(); + } + } + + private static class worker_cacheBlock_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, worker_cacheBlock_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // WORKER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.workerId = iprot.readI64(); + struct.setWorkerIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // WORKER_USED_BYTES + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.workerUsedBytes = iprot.readI64(); + struct.setWorkerUsedBytesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // BLOCK_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // LENGTH + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.length = iprot.readI64(); + struct.setLengthIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, worker_cacheBlock_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(WORKER_ID_FIELD_DESC); + oprot.writeI64(struct.workerId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(WORKER_USED_BYTES_FIELD_DESC); + oprot.writeI64(struct.workerUsedBytes); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); + oprot.writeI64(struct.blockId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(LENGTH_FIELD_DESC); + oprot.writeI64(struct.length); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class worker_cacheBlock_argsTupleSchemeFactory implements SchemeFactory { + public worker_cacheBlock_argsTupleScheme getScheme() { + return new worker_cacheBlock_argsTupleScheme(); + } + } + + private static class worker_cacheBlock_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, worker_cacheBlock_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetWorkerId()) { + optionals.set(0); + } + if (struct.isSetWorkerUsedBytes()) { + optionals.set(1); + } + if (struct.isSetBlockId()) { + optionals.set(2); + } + if (struct.isSetLength()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetWorkerId()) { + oprot.writeI64(struct.workerId); + } + if (struct.isSetWorkerUsedBytes()) { + oprot.writeI64(struct.workerUsedBytes); + } + if (struct.isSetBlockId()) { + oprot.writeI64(struct.blockId); + } + if (struct.isSetLength()) { + oprot.writeI64(struct.length); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, worker_cacheBlock_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.workerId = iprot.readI64(); + struct.setWorkerIdIsSet(true); + } + if (incoming.get(1)) { + struct.workerUsedBytes = iprot.readI64(); + struct.setWorkerUsedBytesIsSet(true); + } + if (incoming.get(2)) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } + if (incoming.get(3)) { + struct.length = iprot.readI64(); + struct.setLengthIsSet(true); + } + } + } + } public static class worker_cacheBlock_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -8184,6 +9696,12 @@ public static class worker_cacheBlock_result implements org.apache.thrift.TBase< private static final org.apache.thrift.protocol.TField E_S_FIELD_DESC = new org.apache.thrift.protocol.TField("eS", org.apache.thrift.protocol.TType.STRUCT, (short)2); private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new worker_cacheBlock_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new worker_cacheBlock_resultTupleSchemeFactory()); + } + public FileDoesNotExistException eP; // required public SuspectedFileSizeException eS; // required public BlockInfoException eB; // required @@ -8253,7 +9771,6 @@ public String getFieldName() { } // 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); @@ -8534,69 +10051,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // E_P - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eP = new FileDoesNotExistException(); - this.eP.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_S - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eS = new SuspectedFileSizeException(); - this.eS.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // E_B - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eB = new BlockInfoException(); - this.eB.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetEP()) { - oprot.writeFieldBegin(E_P_FIELD_DESC); - this.eP.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetES()) { - oprot.writeFieldBegin(E_S_FIELD_DESC); - this.eS.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEB()) { - oprot.writeFieldBegin(E_B_FIELD_DESC); - this.eB.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -8632,6 +10092,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -8650,12 +10111,154 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class worker_cacheBlock_resultStandardSchemeFactory implements SchemeFactory { + public worker_cacheBlock_resultStandardScheme getScheme() { + return new worker_cacheBlock_resultStandardScheme(); + } + } + + private static class worker_cacheBlock_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, worker_cacheBlock_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // E_P + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eP = new FileDoesNotExistException(); + struct.eP.read(iprot); + struct.setEPIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_S + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eS = new SuspectedFileSizeException(); + struct.eS.read(iprot); + struct.setESIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // E_B + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, worker_cacheBlock_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.eP != null) { + oprot.writeFieldBegin(E_P_FIELD_DESC); + struct.eP.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eS != null) { + oprot.writeFieldBegin(E_S_FIELD_DESC); + struct.eS.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eB != null) { + oprot.writeFieldBegin(E_B_FIELD_DESC); + struct.eB.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class worker_cacheBlock_resultTupleSchemeFactory implements SchemeFactory { + public worker_cacheBlock_resultTupleScheme getScheme() { + return new worker_cacheBlock_resultTupleScheme(); + } + } + + private static class worker_cacheBlock_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, worker_cacheBlock_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetEP()) { + optionals.set(0); + } + if (struct.isSetES()) { + optionals.set(1); + } + if (struct.isSetEB()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetEP()) { + struct.eP.write(oprot); + } + if (struct.isSetES()) { + struct.eS.write(oprot); + } + if (struct.isSetEB()) { + struct.eB.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, worker_cacheBlock_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.eP = new FileDoesNotExistException(); + struct.eP.read(iprot); + struct.setEPIsSet(true); + } + if (incoming.get(1)) { + struct.eS = new SuspectedFileSizeException(); + struct.eS.read(iprot); + struct.setESIsSet(true); + } + if (incoming.get(2)) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } + } + } + } public static class worker_getPinIdList_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_getPinIdList_args"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new worker_getPinIdList_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new worker_getPinIdList_argsTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -8795,32 +10398,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -8834,6 +10416,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -8852,16 +10435,80 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } - } - - public static class worker_getPinIdList_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_getPinIdList_result"); - - private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.SET, (short)0); + private static class worker_getPinIdList_argsStandardSchemeFactory implements SchemeFactory { + public worker_getPinIdList_argsStandardScheme getScheme() { + return new worker_getPinIdList_argsStandardScheme(); + } + } - public Set success; // required + private static class worker_getPinIdList_argsStandardScheme extends StandardScheme { - /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public void read(org.apache.thrift.protocol.TProtocol iprot, worker_getPinIdList_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, worker_getPinIdList_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class worker_getPinIdList_argsTupleSchemeFactory implements SchemeFactory { + public worker_getPinIdList_argsTupleScheme getScheme() { + return new worker_getPinIdList_argsTupleScheme(); + } + } + + private static class worker_getPinIdList_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, worker_getPinIdList_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, worker_getPinIdList_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class worker_getPinIdList_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_getPinIdList_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.SET, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new worker_getPinIdList_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new worker_getPinIdList_resultTupleSchemeFactory()); + } + + public Set success; // 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 { SUCCESS((short)0, "success"); @@ -8920,7 +10567,6 @@ public String getFieldName() { } // 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); @@ -9093,95 +10739,5212 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.SET) { - { - org.apache.thrift.protocol.TSet _set32 = iprot.readSetBegin(); - this.success = new HashSet(2*_set32.size); - for (int _i33 = 0; _i33 < _set32.size; ++_i33) + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("worker_getPinIdList_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class worker_getPinIdList_resultStandardSchemeFactory implements SchemeFactory { + public worker_getPinIdList_resultStandardScheme getScheme() { + return new worker_getPinIdList_resultStandardScheme(); + } + } + + private static class worker_getPinIdList_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, worker_getPinIdList_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.SET) { { - int _elem34; // required - _elem34 = iprot.readI32(); - this.success.add(_elem34); + org.apache.thrift.protocol.TSet _set80 = iprot.readSetBegin(); + struct.success = new HashSet(2*_set80.size); + for (int _i81 = 0; _i81 < _set80.size; ++_i81) + { + int _elem82; // required + _elem82 = iprot.readI32(); + struct.success.add(_elem82); + } + iprot.readSetEnd(); } - iprot.readSetEnd(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, worker_getPinIdList_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, struct.success.size())); + for (int _iter83 : struct.success) + { + oprot.writeI32(_iter83); } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); + oprot.writeSetEnd(); + } + oprot.writeFieldEnd(); } - iprot.readFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); } - iprot.readStructEnd(); - // check for required fields of primitive type, which can't be checked in the validate method - validate(); } - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); + private static class worker_getPinIdList_resultTupleSchemeFactory implements SchemeFactory { + public worker_getPinIdList_resultTupleScheme getScheme() { + return new worker_getPinIdList_resultTupleScheme(); + } + } - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeSetBegin(new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, this.success.size())); - for (int _iter35 : this.success) + private static class worker_getPinIdList_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, worker_getPinIdList_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { { - oprot.writeI32(_iter35); + oprot.writeI32(struct.success.size()); + for (int _iter84 : struct.success) + { + oprot.writeI32(_iter84); + } } - oprot.writeSetEnd(); } - oprot.writeFieldEnd(); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, worker_getPinIdList_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TSet _set85 = new org.apache.thrift.protocol.TSet(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.success = new HashSet(2*_set85.size); + for (int _i86 = 0; _i86 < _set85.size; ++_i86) + { + int _elem87; // required + _elem87 = iprot.readI32(); + struct.success.add(_elem87); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class worker_getPriorityDependencyList_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_getPriorityDependencyList_args"); + + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new worker_getPriorityDependencyList_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new worker_getPriorityDependencyList_argsTupleSchemeFactory()); + } + + + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ + public enum _Fields implements org.apache.thrift.TFieldIdEnum { +; + + 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) { + 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; + } + } + 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); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_getPriorityDependencyList_args.class, metaDataMap); + } + + public worker_getPriorityDependencyList_args() { + } + + /** + * Performs a deep copy on other. + */ + public worker_getPriorityDependencyList_args(worker_getPriorityDependencyList_args other) { + } + + public worker_getPriorityDependencyList_args deepCopy() { + return new worker_getPriorityDependencyList_args(this); + } + + @Override + public void clear() { + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + } + 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) { + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof worker_getPriorityDependencyList_args) + return this.equals((worker_getPriorityDependencyList_args)that); + return false; + } + + public boolean equals(worker_getPriorityDependencyList_args that) { + if (that == null) + return false; + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(worker_getPriorityDependencyList_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + worker_getPriorityDependencyList_args typedOther = (worker_getPriorityDependencyList_args)other; + + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { - StringBuilder sb = new StringBuilder("worker_getPinIdList_result("); + StringBuilder sb = new StringBuilder("worker_getPriorityDependencyList_args("); boolean first = true; - sb.append("success:"); - if (this.success == null) { - sb.append("null"); - } else { - sb.append(this.success); + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class worker_getPriorityDependencyList_argsStandardSchemeFactory implements SchemeFactory { + public worker_getPriorityDependencyList_argsStandardScheme getScheme() { + return new worker_getPriorityDependencyList_argsStandardScheme(); + } + } + + private static class worker_getPriorityDependencyList_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, worker_getPriorityDependencyList_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, worker_getPriorityDependencyList_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class worker_getPriorityDependencyList_argsTupleSchemeFactory implements SchemeFactory { + public worker_getPriorityDependencyList_argsTupleScheme getScheme() { + return new worker_getPriorityDependencyList_argsTupleScheme(); + } + } + + private static class worker_getPriorityDependencyList_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, worker_getPriorityDependencyList_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, worker_getPriorityDependencyList_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + + } + + public static class worker_getPriorityDependencyList_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("worker_getPriorityDependencyList_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new worker_getPriorityDependencyList_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new worker_getPriorityDependencyList_resultTupleSchemeFactory()); + } + + public List success; // 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 { + SUCCESS((short)0, "success"); + + 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 0: // SUCCESS + return SUCCESS; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32)))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(worker_getPriorityDependencyList_result.class, metaDataMap); + } + + public worker_getPriorityDependencyList_result() { + } + + public worker_getPriorityDependencyList_result( + List success) + { + this(); + this.success = success; + } + + /** + * Performs a deep copy on other. + */ + public worker_getPriorityDependencyList_result(worker_getPriorityDependencyList_result other) { + if (other.isSetSuccess()) { + List __this__success = new ArrayList(); + for (Integer other_element : other.success) { + __this__success.add(other_element); + } + this.success = __this__success; + } + } + + public worker_getPriorityDependencyList_result deepCopy() { + return new worker_getPriorityDependencyList_result(this); + } + + @Override + public void clear() { + this.success = null; + } + + public int getSuccessSize() { + return (this.success == null) ? 0 : this.success.size(); + } + + public java.util.Iterator getSuccessIterator() { + return (this.success == null) ? null : this.success.iterator(); + } + + public void addToSuccess(int elem) { + if (this.success == null) { + this.success = new ArrayList(); + } + this.success.add(elem); + } + + public List getSuccess() { + return this.success; + } + + public worker_getPriorityDependencyList_result setSuccess(List success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((List)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + } + 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 SUCCESS: + return isSetSuccess(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof worker_getPriorityDependencyList_result) + return this.equals((worker_getPriorityDependencyList_result)that); + return false; + } + + public boolean equals(worker_getPriorityDependencyList_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(worker_getPriorityDependencyList_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + worker_getPriorityDependencyList_result typedOther = (worker_getPriorityDependencyList_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("worker_getPriorityDependencyList_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class worker_getPriorityDependencyList_resultStandardSchemeFactory implements SchemeFactory { + public worker_getPriorityDependencyList_resultStandardScheme getScheme() { + return new worker_getPriorityDependencyList_resultStandardScheme(); + } + } + + private static class worker_getPriorityDependencyList_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, worker_getPriorityDependencyList_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list88 = iprot.readListBegin(); + struct.success = new ArrayList(_list88.size); + for (int _i89 = 0; _i89 < _list88.size; ++_i89) + { + int _elem90; // required + _elem90 = iprot.readI32(); + struct.success.add(_elem90); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, worker_getPriorityDependencyList_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.success.size())); + for (int _iter91 : struct.success) + { + oprot.writeI32(_iter91); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class worker_getPriorityDependencyList_resultTupleSchemeFactory implements SchemeFactory { + public worker_getPriorityDependencyList_resultTupleScheme getScheme() { + return new worker_getPriorityDependencyList_resultTupleScheme(); + } + } + + private static class worker_getPriorityDependencyList_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, worker_getPriorityDependencyList_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (int _iter92 : struct.success) + { + oprot.writeI32(_iter92); + } + } + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, worker_getPriorityDependencyList_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list93 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.success = new ArrayList(_list93.size); + for (int _i94 = 0; _i94 < _list93.size; ++_i94) + { + int _elem95; // required + _elem95 = iprot.readI32(); + struct.success.add(_elem95); + } + } + struct.setSuccessIsSet(true); + } + } + } + + } + + public static class user_createDependency_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createDependency_args"); + + private static final org.apache.thrift.protocol.TField PARENTS_FIELD_DESC = new org.apache.thrift.protocol.TField("parents", org.apache.thrift.protocol.TType.LIST, (short)1); + private static final org.apache.thrift.protocol.TField CHILDREN_FIELD_DESC = new org.apache.thrift.protocol.TField("children", org.apache.thrift.protocol.TType.LIST, (short)2); + private static final org.apache.thrift.protocol.TField COMMAND_PREFIX_FIELD_DESC = new org.apache.thrift.protocol.TField("commandPrefix", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final org.apache.thrift.protocol.TField DATA_FIELD_DESC = new org.apache.thrift.protocol.TField("data", org.apache.thrift.protocol.TType.LIST, (short)4); + private static final org.apache.thrift.protocol.TField COMMENT_FIELD_DESC = new org.apache.thrift.protocol.TField("comment", org.apache.thrift.protocol.TType.STRING, (short)5); + private static final org.apache.thrift.protocol.TField FRAMEWORK_FIELD_DESC = new org.apache.thrift.protocol.TField("framework", org.apache.thrift.protocol.TType.STRING, (short)6); + private static final org.apache.thrift.protocol.TField FRAMEWORK_VERSION_FIELD_DESC = new org.apache.thrift.protocol.TField("frameworkVersion", org.apache.thrift.protocol.TType.STRING, (short)7); + private static final org.apache.thrift.protocol.TField DEPENDENCY_TYPE_FIELD_DESC = new org.apache.thrift.protocol.TField("dependencyType", org.apache.thrift.protocol.TType.I32, (short)8); + private static final org.apache.thrift.protocol.TField CHILDREN_BLOCK_SIZE_BYTE_FIELD_DESC = new org.apache.thrift.protocol.TField("childrenBlockSizeByte", org.apache.thrift.protocol.TType.I64, (short)9); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_createDependency_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_createDependency_argsTupleSchemeFactory()); + } + + public List parents; // required + public List children; // required + public String commandPrefix; // required + public List data; // required + public String comment; // required + public String framework; // required + public String frameworkVersion; // required + public int dependencyType; // required + public long childrenBlockSizeByte; // 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 { + PARENTS((short)1, "parents"), + CHILDREN((short)2, "children"), + COMMAND_PREFIX((short)3, "commandPrefix"), + DATA((short)4, "data"), + COMMENT((short)5, "comment"), + FRAMEWORK((short)6, "framework"), + FRAMEWORK_VERSION((short)7, "frameworkVersion"), + DEPENDENCY_TYPE((short)8, "dependencyType"), + CHILDREN_BLOCK_SIZE_BYTE((short)9, "childrenBlockSizeByte"); + + 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: // PARENTS + return PARENTS; + case 2: // CHILDREN + return CHILDREN; + case 3: // COMMAND_PREFIX + return COMMAND_PREFIX; + case 4: // DATA + return DATA; + case 5: // COMMENT + return COMMENT; + case 6: // FRAMEWORK + return FRAMEWORK; + case 7: // FRAMEWORK_VERSION + return FRAMEWORK_VERSION; + case 8: // DEPENDENCY_TYPE + return DEPENDENCY_TYPE; + case 9: // CHILDREN_BLOCK_SIZE_BYTE + return CHILDREN_BLOCK_SIZE_BYTE; + 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 + private static final int __DEPENDENCYTYPE_ISSET_ID = 0; + private static final int __CHILDRENBLOCKSIZEBYTE_ISSET_ID = 1; + private byte __isset_bitfield = 0; + 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.PARENTS, new org.apache.thrift.meta_data.FieldMetaData("parents", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.CHILDREN, new org.apache.thrift.meta_data.FieldMetaData("children", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING)))); + tmpMap.put(_Fields.COMMAND_PREFIX, new org.apache.thrift.meta_data.FieldMetaData("commandPrefix", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.DATA, new org.apache.thrift.meta_data.FieldMetaData("data", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.ListMetaData(org.apache.thrift.protocol.TType.LIST, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING , true)))); + tmpMap.put(_Fields.COMMENT, new org.apache.thrift.meta_data.FieldMetaData("comment", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FRAMEWORK, new org.apache.thrift.meta_data.FieldMetaData("framework", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.FRAMEWORK_VERSION, new org.apache.thrift.meta_data.FieldMetaData("frameworkVersion", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRING))); + tmpMap.put(_Fields.DEPENDENCY_TYPE, new org.apache.thrift.meta_data.FieldMetaData("dependencyType", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.CHILDREN_BLOCK_SIZE_BYTE, new org.apache.thrift.meta_data.FieldMetaData("childrenBlockSizeByte", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createDependency_args.class, metaDataMap); + } + + public user_createDependency_args() { + } + + public user_createDependency_args( + List parents, + List children, + String commandPrefix, + List data, + String comment, + String framework, + String frameworkVersion, + int dependencyType, + long childrenBlockSizeByte) + { + this(); + this.parents = parents; + this.children = children; + this.commandPrefix = commandPrefix; + this.data = data; + this.comment = comment; + this.framework = framework; + this.frameworkVersion = frameworkVersion; + this.dependencyType = dependencyType; + setDependencyTypeIsSet(true); + this.childrenBlockSizeByte = childrenBlockSizeByte; + setChildrenBlockSizeByteIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public user_createDependency_args(user_createDependency_args other) { + __isset_bitfield = other.__isset_bitfield; + if (other.isSetParents()) { + List __this__parents = new ArrayList(); + for (String other_element : other.parents) { + __this__parents.add(other_element); + } + this.parents = __this__parents; + } + if (other.isSetChildren()) { + List __this__children = new ArrayList(); + for (String other_element : other.children) { + __this__children.add(other_element); + } + this.children = __this__children; + } + if (other.isSetCommandPrefix()) { + this.commandPrefix = other.commandPrefix; + } + if (other.isSetData()) { + List __this__data = new ArrayList(); + for (ByteBuffer other_element : other.data) { + ByteBuffer temp_binary_element = org.apache.thrift.TBaseHelper.copyBinary(other_element); +; + __this__data.add(temp_binary_element); + } + this.data = __this__data; + } + if (other.isSetComment()) { + this.comment = other.comment; + } + if (other.isSetFramework()) { + this.framework = other.framework; + } + if (other.isSetFrameworkVersion()) { + this.frameworkVersion = other.frameworkVersion; + } + this.dependencyType = other.dependencyType; + this.childrenBlockSizeByte = other.childrenBlockSizeByte; + } + + public user_createDependency_args deepCopy() { + return new user_createDependency_args(this); + } + + @Override + public void clear() { + this.parents = null; + this.children = null; + this.commandPrefix = null; + this.data = null; + this.comment = null; + this.framework = null; + this.frameworkVersion = null; + setDependencyTypeIsSet(false); + this.dependencyType = 0; + setChildrenBlockSizeByteIsSet(false); + this.childrenBlockSizeByte = 0; + } + + public int getParentsSize() { + return (this.parents == null) ? 0 : this.parents.size(); + } + + public java.util.Iterator getParentsIterator() { + return (this.parents == null) ? null : this.parents.iterator(); + } + + public void addToParents(String elem) { + if (this.parents == null) { + this.parents = new ArrayList(); + } + this.parents.add(elem); + } + + public List getParents() { + return this.parents; + } + + public user_createDependency_args setParents(List parents) { + this.parents = parents; + return this; + } + + public void unsetParents() { + this.parents = null; + } + + /** Returns true if field parents is set (has been assigned a value) and false otherwise */ + public boolean isSetParents() { + return this.parents != null; + } + + public void setParentsIsSet(boolean value) { + if (!value) { + this.parents = null; + } + } + + public int getChildrenSize() { + return (this.children == null) ? 0 : this.children.size(); + } + + public java.util.Iterator getChildrenIterator() { + return (this.children == null) ? null : this.children.iterator(); + } + + public void addToChildren(String elem) { + if (this.children == null) { + this.children = new ArrayList(); + } + this.children.add(elem); + } + + public List getChildren() { + return this.children; + } + + public user_createDependency_args setChildren(List children) { + this.children = children; + return this; + } + + public void unsetChildren() { + this.children = null; + } + + /** Returns true if field children is set (has been assigned a value) and false otherwise */ + public boolean isSetChildren() { + return this.children != null; + } + + public void setChildrenIsSet(boolean value) { + if (!value) { + this.children = null; + } + } + + public String getCommandPrefix() { + return this.commandPrefix; + } + + public user_createDependency_args setCommandPrefix(String commandPrefix) { + this.commandPrefix = commandPrefix; + return this; + } + + public void unsetCommandPrefix() { + this.commandPrefix = null; + } + + /** Returns true if field commandPrefix is set (has been assigned a value) and false otherwise */ + public boolean isSetCommandPrefix() { + return this.commandPrefix != null; + } + + public void setCommandPrefixIsSet(boolean value) { + if (!value) { + this.commandPrefix = null; + } + } + + public int getDataSize() { + return (this.data == null) ? 0 : this.data.size(); + } + + public java.util.Iterator getDataIterator() { + return (this.data == null) ? null : this.data.iterator(); + } + + public void addToData(ByteBuffer elem) { + if (this.data == null) { + this.data = new ArrayList(); + } + this.data.add(elem); + } + + public List getData() { + return this.data; + } + + public user_createDependency_args setData(List data) { + this.data = data; + return this; + } + + public void unsetData() { + this.data = null; + } + + /** Returns true if field data is set (has been assigned a value) and false otherwise */ + public boolean isSetData() { + return this.data != null; + } + + public void setDataIsSet(boolean value) { + if (!value) { + this.data = null; + } + } + + public String getComment() { + return this.comment; + } + + public user_createDependency_args setComment(String comment) { + this.comment = comment; + return this; + } + + public void unsetComment() { + this.comment = null; + } + + /** Returns true if field comment is set (has been assigned a value) and false otherwise */ + public boolean isSetComment() { + return this.comment != null; + } + + public void setCommentIsSet(boolean value) { + if (!value) { + this.comment = null; + } + } + + public String getFramework() { + return this.framework; + } + + public user_createDependency_args setFramework(String framework) { + this.framework = framework; + return this; + } + + public void unsetFramework() { + this.framework = null; + } + + /** Returns true if field framework is set (has been assigned a value) and false otherwise */ + public boolean isSetFramework() { + return this.framework != null; + } + + public void setFrameworkIsSet(boolean value) { + if (!value) { + this.framework = null; + } + } + + public String getFrameworkVersion() { + return this.frameworkVersion; + } + + public user_createDependency_args setFrameworkVersion(String frameworkVersion) { + this.frameworkVersion = frameworkVersion; + return this; + } + + public void unsetFrameworkVersion() { + this.frameworkVersion = null; + } + + /** Returns true if field frameworkVersion is set (has been assigned a value) and false otherwise */ + public boolean isSetFrameworkVersion() { + return this.frameworkVersion != null; + } + + public void setFrameworkVersionIsSet(boolean value) { + if (!value) { + this.frameworkVersion = null; + } + } + + public int getDependencyType() { + return this.dependencyType; + } + + public user_createDependency_args setDependencyType(int dependencyType) { + this.dependencyType = dependencyType; + setDependencyTypeIsSet(true); + return this; + } + + public void unsetDependencyType() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEPENDENCYTYPE_ISSET_ID); + } + + /** Returns true if field dependencyType is set (has been assigned a value) and false otherwise */ + public boolean isSetDependencyType() { + return EncodingUtils.testBit(__isset_bitfield, __DEPENDENCYTYPE_ISSET_ID); + } + + public void setDependencyTypeIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEPENDENCYTYPE_ISSET_ID, value); + } + + public long getChildrenBlockSizeByte() { + return this.childrenBlockSizeByte; + } + + public user_createDependency_args setChildrenBlockSizeByte(long childrenBlockSizeByte) { + this.childrenBlockSizeByte = childrenBlockSizeByte; + setChildrenBlockSizeByteIsSet(true); + return this; + } + + public void unsetChildrenBlockSizeByte() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __CHILDRENBLOCKSIZEBYTE_ISSET_ID); + } + + /** Returns true if field childrenBlockSizeByte is set (has been assigned a value) and false otherwise */ + public boolean isSetChildrenBlockSizeByte() { + return EncodingUtils.testBit(__isset_bitfield, __CHILDRENBLOCKSIZEBYTE_ISSET_ID); + } + + public void setChildrenBlockSizeByteIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __CHILDRENBLOCKSIZEBYTE_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case PARENTS: + if (value == null) { + unsetParents(); + } else { + setParents((List)value); + } + break; + + case CHILDREN: + if (value == null) { + unsetChildren(); + } else { + setChildren((List)value); + } + break; + + case COMMAND_PREFIX: + if (value == null) { + unsetCommandPrefix(); + } else { + setCommandPrefix((String)value); + } + break; + + case DATA: + if (value == null) { + unsetData(); + } else { + setData((List)value); + } + break; + + case COMMENT: + if (value == null) { + unsetComment(); + } else { + setComment((String)value); + } + break; + + case FRAMEWORK: + if (value == null) { + unsetFramework(); + } else { + setFramework((String)value); + } + break; + + case FRAMEWORK_VERSION: + if (value == null) { + unsetFrameworkVersion(); + } else { + setFrameworkVersion((String)value); + } + break; + + case DEPENDENCY_TYPE: + if (value == null) { + unsetDependencyType(); + } else { + setDependencyType((Integer)value); + } + break; + + case CHILDREN_BLOCK_SIZE_BYTE: + if (value == null) { + unsetChildrenBlockSizeByte(); + } else { + setChildrenBlockSizeByte((Long)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case PARENTS: + return getParents(); + + case CHILDREN: + return getChildren(); + + case COMMAND_PREFIX: + return getCommandPrefix(); + + case DATA: + return getData(); + + case COMMENT: + return getComment(); + + case FRAMEWORK: + return getFramework(); + + case FRAMEWORK_VERSION: + return getFrameworkVersion(); + + case DEPENDENCY_TYPE: + return Integer.valueOf(getDependencyType()); + + case CHILDREN_BLOCK_SIZE_BYTE: + return Long.valueOf(getChildrenBlockSizeByte()); + + } + 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 PARENTS: + return isSetParents(); + case CHILDREN: + return isSetChildren(); + case COMMAND_PREFIX: + return isSetCommandPrefix(); + case DATA: + return isSetData(); + case COMMENT: + return isSetComment(); + case FRAMEWORK: + return isSetFramework(); + case FRAMEWORK_VERSION: + return isSetFrameworkVersion(); + case DEPENDENCY_TYPE: + return isSetDependencyType(); + case CHILDREN_BLOCK_SIZE_BYTE: + return isSetChildrenBlockSizeByte(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof user_createDependency_args) + return this.equals((user_createDependency_args)that); + return false; + } + + public boolean equals(user_createDependency_args that) { + if (that == null) + return false; + + boolean this_present_parents = true && this.isSetParents(); + boolean that_present_parents = true && that.isSetParents(); + if (this_present_parents || that_present_parents) { + if (!(this_present_parents && that_present_parents)) + return false; + if (!this.parents.equals(that.parents)) + return false; + } + + boolean this_present_children = true && this.isSetChildren(); + boolean that_present_children = true && that.isSetChildren(); + if (this_present_children || that_present_children) { + if (!(this_present_children && that_present_children)) + return false; + if (!this.children.equals(that.children)) + return false; + } + + boolean this_present_commandPrefix = true && this.isSetCommandPrefix(); + boolean that_present_commandPrefix = true && that.isSetCommandPrefix(); + if (this_present_commandPrefix || that_present_commandPrefix) { + if (!(this_present_commandPrefix && that_present_commandPrefix)) + return false; + if (!this.commandPrefix.equals(that.commandPrefix)) + return false; + } + + boolean this_present_data = true && this.isSetData(); + boolean that_present_data = true && that.isSetData(); + if (this_present_data || that_present_data) { + if (!(this_present_data && that_present_data)) + return false; + if (!this.data.equals(that.data)) + return false; + } + + boolean this_present_comment = true && this.isSetComment(); + boolean that_present_comment = true && that.isSetComment(); + if (this_present_comment || that_present_comment) { + if (!(this_present_comment && that_present_comment)) + return false; + if (!this.comment.equals(that.comment)) + return false; + } + + boolean this_present_framework = true && this.isSetFramework(); + boolean that_present_framework = true && that.isSetFramework(); + if (this_present_framework || that_present_framework) { + if (!(this_present_framework && that_present_framework)) + return false; + if (!this.framework.equals(that.framework)) + return false; + } + + boolean this_present_frameworkVersion = true && this.isSetFrameworkVersion(); + boolean that_present_frameworkVersion = true && that.isSetFrameworkVersion(); + if (this_present_frameworkVersion || that_present_frameworkVersion) { + if (!(this_present_frameworkVersion && that_present_frameworkVersion)) + return false; + if (!this.frameworkVersion.equals(that.frameworkVersion)) + return false; + } + + boolean this_present_dependencyType = true; + boolean that_present_dependencyType = true; + if (this_present_dependencyType || that_present_dependencyType) { + if (!(this_present_dependencyType && that_present_dependencyType)) + return false; + if (this.dependencyType != that.dependencyType) + return false; + } + + boolean this_present_childrenBlockSizeByte = true; + boolean that_present_childrenBlockSizeByte = true; + if (this_present_childrenBlockSizeByte || that_present_childrenBlockSizeByte) { + if (!(this_present_childrenBlockSizeByte && that_present_childrenBlockSizeByte)) + return false; + if (this.childrenBlockSizeByte != that.childrenBlockSizeByte) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(user_createDependency_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + user_createDependency_args typedOther = (user_createDependency_args)other; + + lastComparison = Boolean.valueOf(isSetParents()).compareTo(typedOther.isSetParents()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetParents()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.parents, typedOther.parents); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetChildren()).compareTo(typedOther.isSetChildren()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetChildren()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.children, typedOther.children); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetCommandPrefix()).compareTo(typedOther.isSetCommandPrefix()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetCommandPrefix()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.commandPrefix, typedOther.commandPrefix); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetData()).compareTo(typedOther.isSetData()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetData()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.data, typedOther.data); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetComment()).compareTo(typedOther.isSetComment()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetComment()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.comment, typedOther.comment); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFramework()).compareTo(typedOther.isSetFramework()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFramework()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.framework, typedOther.framework); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetFrameworkVersion()).compareTo(typedOther.isSetFrameworkVersion()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFrameworkVersion()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.frameworkVersion, typedOther.frameworkVersion); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetDependencyType()).compareTo(typedOther.isSetDependencyType()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDependencyType()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dependencyType, typedOther.dependencyType); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetChildrenBlockSizeByte()).compareTo(typedOther.isSetChildrenBlockSizeByte()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetChildrenBlockSizeByte()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.childrenBlockSizeByte, typedOther.childrenBlockSizeByte); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("user_createDependency_args("); + boolean first = true; + + sb.append("parents:"); + if (this.parents == null) { + sb.append("null"); + } else { + sb.append(this.parents); + } + first = false; + if (!first) sb.append(", "); + sb.append("children:"); + if (this.children == null) { + sb.append("null"); + } else { + sb.append(this.children); + } + first = false; + if (!first) sb.append(", "); + sb.append("commandPrefix:"); + if (this.commandPrefix == null) { + sb.append("null"); + } else { + sb.append(this.commandPrefix); + } + first = false; + if (!first) sb.append(", "); + sb.append("data:"); + if (this.data == null) { + sb.append("null"); + } else { + sb.append(this.data); + } + first = false; + if (!first) sb.append(", "); + sb.append("comment:"); + if (this.comment == null) { + sb.append("null"); + } else { + sb.append(this.comment); + } + first = false; + if (!first) sb.append(", "); + sb.append("framework:"); + if (this.framework == null) { + sb.append("null"); + } else { + sb.append(this.framework); + } + first = false; + if (!first) sb.append(", "); + sb.append("frameworkVersion:"); + if (this.frameworkVersion == null) { + sb.append("null"); + } else { + sb.append(this.frameworkVersion); + } + first = false; + if (!first) sb.append(", "); + sb.append("dependencyType:"); + sb.append(this.dependencyType); + first = false; + if (!first) sb.append(", "); + sb.append("childrenBlockSizeByte:"); + sb.append(this.childrenBlockSizeByte); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class user_createDependency_argsStandardSchemeFactory implements SchemeFactory { + public user_createDependency_argsStandardScheme getScheme() { + return new user_createDependency_argsStandardScheme(); + } + } + + private static class user_createDependency_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_createDependency_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PARENTS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list96 = iprot.readListBegin(); + struct.parents = new ArrayList(_list96.size); + for (int _i97 = 0; _i97 < _list96.size; ++_i97) + { + String _elem98; // required + _elem98 = iprot.readString(); + struct.parents.add(_elem98); + } + iprot.readListEnd(); + } + struct.setParentsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // CHILDREN + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list99 = iprot.readListBegin(); + struct.children = new ArrayList(_list99.size); + for (int _i100 = 0; _i100 < _list99.size; ++_i100) + { + String _elem101; // required + _elem101 = iprot.readString(); + struct.children.add(_elem101); + } + iprot.readListEnd(); + } + struct.setChildrenIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // COMMAND_PREFIX + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.commandPrefix = iprot.readString(); + struct.setCommandPrefixIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // DATA + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list102 = iprot.readListBegin(); + struct.data = new ArrayList(_list102.size); + for (int _i103 = 0; _i103 < _list102.size; ++_i103) + { + ByteBuffer _elem104; // required + _elem104 = iprot.readBinary(); + struct.data.add(_elem104); + } + iprot.readListEnd(); + } + struct.setDataIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // COMMENT + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.comment = iprot.readString(); + struct.setCommentIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 6: // FRAMEWORK + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.framework = iprot.readString(); + struct.setFrameworkIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 7: // FRAMEWORK_VERSION + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.frameworkVersion = iprot.readString(); + struct.setFrameworkVersionIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 8: // DEPENDENCY_TYPE + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.dependencyType = iprot.readI32(); + struct.setDependencyTypeIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 9: // CHILDREN_BLOCK_SIZE_BYTE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.childrenBlockSizeByte = iprot.readI64(); + struct.setChildrenBlockSizeByteIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_createDependency_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.parents != null) { + oprot.writeFieldBegin(PARENTS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.parents.size())); + for (String _iter105 : struct.parents) + { + oprot.writeString(_iter105); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.children != null) { + oprot.writeFieldBegin(CHILDREN_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.children.size())); + for (String _iter106 : struct.children) + { + oprot.writeString(_iter106); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.commandPrefix != null) { + oprot.writeFieldBegin(COMMAND_PREFIX_FIELD_DESC); + oprot.writeString(struct.commandPrefix); + oprot.writeFieldEnd(); + } + if (struct.data != null) { + oprot.writeFieldBegin(DATA_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.data.size())); + for (ByteBuffer _iter107 : struct.data) + { + oprot.writeBinary(_iter107); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.comment != null) { + oprot.writeFieldBegin(COMMENT_FIELD_DESC); + oprot.writeString(struct.comment); + oprot.writeFieldEnd(); + } + if (struct.framework != null) { + oprot.writeFieldBegin(FRAMEWORK_FIELD_DESC); + oprot.writeString(struct.framework); + oprot.writeFieldEnd(); + } + if (struct.frameworkVersion != null) { + oprot.writeFieldBegin(FRAMEWORK_VERSION_FIELD_DESC); + oprot.writeString(struct.frameworkVersion); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(DEPENDENCY_TYPE_FIELD_DESC); + oprot.writeI32(struct.dependencyType); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(CHILDREN_BLOCK_SIZE_BYTE_FIELD_DESC); + oprot.writeI64(struct.childrenBlockSizeByte); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_createDependency_argsTupleSchemeFactory implements SchemeFactory { + public user_createDependency_argsTupleScheme getScheme() { + return new user_createDependency_argsTupleScheme(); + } + } + + private static class user_createDependency_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_createDependency_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetParents()) { + optionals.set(0); + } + if (struct.isSetChildren()) { + optionals.set(1); + } + if (struct.isSetCommandPrefix()) { + optionals.set(2); + } + if (struct.isSetData()) { + optionals.set(3); + } + if (struct.isSetComment()) { + optionals.set(4); + } + if (struct.isSetFramework()) { + optionals.set(5); + } + if (struct.isSetFrameworkVersion()) { + optionals.set(6); + } + if (struct.isSetDependencyType()) { + optionals.set(7); + } + if (struct.isSetChildrenBlockSizeByte()) { + optionals.set(8); + } + oprot.writeBitSet(optionals, 9); + if (struct.isSetParents()) { + { + oprot.writeI32(struct.parents.size()); + for (String _iter108 : struct.parents) + { + oprot.writeString(_iter108); + } + } + } + if (struct.isSetChildren()) { + { + oprot.writeI32(struct.children.size()); + for (String _iter109 : struct.children) + { + oprot.writeString(_iter109); + } + } + } + if (struct.isSetCommandPrefix()) { + oprot.writeString(struct.commandPrefix); + } + if (struct.isSetData()) { + { + oprot.writeI32(struct.data.size()); + for (ByteBuffer _iter110 : struct.data) + { + oprot.writeBinary(_iter110); + } + } + } + if (struct.isSetComment()) { + oprot.writeString(struct.comment); + } + if (struct.isSetFramework()) { + oprot.writeString(struct.framework); + } + if (struct.isSetFrameworkVersion()) { + oprot.writeString(struct.frameworkVersion); + } + if (struct.isSetDependencyType()) { + oprot.writeI32(struct.dependencyType); + } + if (struct.isSetChildrenBlockSizeByte()) { + oprot.writeI64(struct.childrenBlockSizeByte); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_createDependency_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(9); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list111 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.parents = new ArrayList(_list111.size); + for (int _i112 = 0; _i112 < _list111.size; ++_i112) + { + String _elem113; // required + _elem113 = iprot.readString(); + struct.parents.add(_elem113); + } + } + struct.setParentsIsSet(true); + } + if (incoming.get(1)) { + { + org.apache.thrift.protocol.TList _list114 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.children = new ArrayList(_list114.size); + for (int _i115 = 0; _i115 < _list114.size; ++_i115) + { + String _elem116; // required + _elem116 = iprot.readString(); + struct.children.add(_elem116); + } + } + struct.setChildrenIsSet(true); + } + if (incoming.get(2)) { + struct.commandPrefix = iprot.readString(); + struct.setCommandPrefixIsSet(true); + } + if (incoming.get(3)) { + { + org.apache.thrift.protocol.TList _list117 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.data = new ArrayList(_list117.size); + for (int _i118 = 0; _i118 < _list117.size; ++_i118) + { + ByteBuffer _elem119; // required + _elem119 = iprot.readBinary(); + struct.data.add(_elem119); + } + } + struct.setDataIsSet(true); + } + if (incoming.get(4)) { + struct.comment = iprot.readString(); + struct.setCommentIsSet(true); + } + if (incoming.get(5)) { + struct.framework = iprot.readString(); + struct.setFrameworkIsSet(true); + } + if (incoming.get(6)) { + struct.frameworkVersion = iprot.readString(); + struct.setFrameworkVersionIsSet(true); + } + if (incoming.get(7)) { + struct.dependencyType = iprot.readI32(); + struct.setDependencyTypeIsSet(true); + } + if (incoming.get(8)) { + struct.childrenBlockSizeByte = iprot.readI64(); + struct.setChildrenBlockSizeByteIsSet(true); + } + } + } + + } + + public static class user_createDependency_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_createDependency_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); + private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final org.apache.thrift.protocol.TField E_A_FIELD_DESC = new org.apache.thrift.protocol.TField("eA", org.apache.thrift.protocol.TType.STRUCT, (short)3); + private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)5); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_createDependency_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_createDependency_resultTupleSchemeFactory()); + } + + public int success; // required + public InvalidPathException eI; // required + public FileDoesNotExistException eF; // required + public FileAlreadyExistException eA; // required + public BlockInfoException eB; // required + public TachyonException eT; // 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 { + SUCCESS((short)0, "success"), + E_I((short)1, "eI"), + E_F((short)2, "eF"), + E_A((short)3, "eA"), + E_B((short)4, "eB"), + E_T((short)5, "eT"); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // E_I + return E_I; + case 2: // E_F + return E_F; + case 3: // E_A + return E_A; + case 4: // E_B + return E_B; + case 5: // E_T + return E_T; + 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 + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + tmpMap.put(_Fields.E_I, new org.apache.thrift.meta_data.FieldMetaData("eI", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.E_F, new org.apache.thrift.meta_data.FieldMetaData("eF", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.E_A, new org.apache.thrift.meta_data.FieldMetaData("eA", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.E_B, new org.apache.thrift.meta_data.FieldMetaData("eB", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + tmpMap.put(_Fields.E_T, new org.apache.thrift.meta_data.FieldMetaData("eT", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_createDependency_result.class, metaDataMap); + } + + public user_createDependency_result() { + } + + public user_createDependency_result( + int success, + InvalidPathException eI, + FileDoesNotExistException eF, + FileAlreadyExistException eA, + BlockInfoException eB, + TachyonException eT) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.eI = eI; + this.eF = eF; + this.eA = eA; + this.eB = eB; + this.eT = eT; + } + + /** + * Performs a deep copy on other. + */ + public user_createDependency_result(user_createDependency_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetEI()) { + this.eI = new InvalidPathException(other.eI); + } + if (other.isSetEF()) { + this.eF = new FileDoesNotExistException(other.eF); + } + if (other.isSetEA()) { + this.eA = new FileAlreadyExistException(other.eA); + } + if (other.isSetEB()) { + this.eB = new BlockInfoException(other.eB); + } + if (other.isSetET()) { + this.eT = new TachyonException(other.eT); + } + } + + public user_createDependency_result deepCopy() { + return new user_createDependency_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = 0; + this.eI = null; + this.eF = null; + this.eA = null; + this.eB = null; + this.eT = null; + } + + public int getSuccess() { + return this.success; + } + + public user_createDependency_result setSuccess(int success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public InvalidPathException getEI() { + return this.eI; + } + + public user_createDependency_result setEI(InvalidPathException eI) { + this.eI = eI; + return this; + } + + public void unsetEI() { + this.eI = null; + } + + /** Returns true if field eI is set (has been assigned a value) and false otherwise */ + public boolean isSetEI() { + return this.eI != null; + } + + public void setEIIsSet(boolean value) { + if (!value) { + this.eI = null; + } + } + + public FileDoesNotExistException getEF() { + return this.eF; + } + + public user_createDependency_result setEF(FileDoesNotExistException eF) { + this.eF = eF; + return this; + } + + public void unsetEF() { + this.eF = null; + } + + /** Returns true if field eF is set (has been assigned a value) and false otherwise */ + public boolean isSetEF() { + return this.eF != null; + } + + public void setEFIsSet(boolean value) { + if (!value) { + this.eF = null; + } + } + + public FileAlreadyExistException getEA() { + return this.eA; + } + + public user_createDependency_result setEA(FileAlreadyExistException eA) { + this.eA = eA; + return this; + } + + public void unsetEA() { + this.eA = null; + } + + /** Returns true if field eA is set (has been assigned a value) and false otherwise */ + public boolean isSetEA() { + return this.eA != null; + } + + public void setEAIsSet(boolean value) { + if (!value) { + this.eA = null; + } + } + + public BlockInfoException getEB() { + return this.eB; + } + + public user_createDependency_result setEB(BlockInfoException eB) { + this.eB = eB; + return this; + } + + public void unsetEB() { + this.eB = null; + } + + /** Returns true if field eB is set (has been assigned a value) and false otherwise */ + public boolean isSetEB() { + return this.eB != null; + } + + public void setEBIsSet(boolean value) { + if (!value) { + this.eB = null; + } + } + + public TachyonException getET() { + return this.eT; + } + + public user_createDependency_result setET(TachyonException eT) { + this.eT = eT; + return this; + } + + public void unsetET() { + this.eT = null; + } + + /** Returns true if field eT is set (has been assigned a value) and false otherwise */ + public boolean isSetET() { + return this.eT != null; + } + + public void setETIsSet(boolean value) { + if (!value) { + this.eT = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Integer)value); + } + break; + + case E_I: + if (value == null) { + unsetEI(); + } else { + setEI((InvalidPathException)value); + } + break; + + case E_F: + if (value == null) { + unsetEF(); + } else { + setEF((FileDoesNotExistException)value); + } + break; + + case E_A: + if (value == null) { + unsetEA(); + } else { + setEA((FileAlreadyExistException)value); + } + break; + + case E_B: + if (value == null) { + unsetEB(); + } else { + setEB((BlockInfoException)value); + } + break; + + case E_T: + if (value == null) { + unsetET(); + } else { + setET((TachyonException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Integer.valueOf(getSuccess()); + + case E_I: + return getEI(); + + case E_F: + return getEF(); + + case E_A: + return getEA(); + + case E_B: + return getEB(); + + case E_T: + return getET(); + + } + 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 SUCCESS: + return isSetSuccess(); + case E_I: + return isSetEI(); + case E_F: + return isSetEF(); + case E_A: + return isSetEA(); + case E_B: + return isSetEB(); + case E_T: + return isSetET(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof user_createDependency_result) + return this.equals((user_createDependency_result)that); + return false; + } + + public boolean equals(user_createDependency_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_eI = true && this.isSetEI(); + boolean that_present_eI = true && that.isSetEI(); + if (this_present_eI || that_present_eI) { + if (!(this_present_eI && that_present_eI)) + return false; + if (!this.eI.equals(that.eI)) + return false; + } + + boolean this_present_eF = true && this.isSetEF(); + boolean that_present_eF = true && that.isSetEF(); + if (this_present_eF || that_present_eF) { + if (!(this_present_eF && that_present_eF)) + return false; + if (!this.eF.equals(that.eF)) + return false; + } + + boolean this_present_eA = true && this.isSetEA(); + boolean that_present_eA = true && that.isSetEA(); + if (this_present_eA || that_present_eA) { + if (!(this_present_eA && that_present_eA)) + return false; + if (!this.eA.equals(that.eA)) + return false; + } + + boolean this_present_eB = true && this.isSetEB(); + boolean that_present_eB = true && that.isSetEB(); + if (this_present_eB || that_present_eB) { + if (!(this_present_eB && that_present_eB)) + return false; + if (!this.eB.equals(that.eB)) + return false; + } + + boolean this_present_eT = true && this.isSetET(); + boolean that_present_eT = true && that.isSetET(); + if (this_present_eT || that_present_eT) { + if (!(this_present_eT && that_present_eT)) + return false; + if (!this.eT.equals(that.eT)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(user_createDependency_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + user_createDependency_result typedOther = (user_createDependency_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEI()).compareTo(typedOther.isSetEI()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEI()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eI, typedOther.eI); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEF()).compareTo(typedOther.isSetEF()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEF()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eF, typedOther.eF); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEA()).compareTo(typedOther.isSetEA()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEA()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eA, typedOther.eA); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetEB()).compareTo(typedOther.isSetEB()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetEB()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eB, typedOther.eB); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetET()).compareTo(typedOther.isSetET()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetET()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.eT, typedOther.eT); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("user_createDependency_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("eI:"); + if (this.eI == null) { + sb.append("null"); + } else { + sb.append(this.eI); + } + first = false; + if (!first) sb.append(", "); + sb.append("eF:"); + if (this.eF == null) { + sb.append("null"); + } else { + sb.append(this.eF); + } + first = false; + if (!first) sb.append(", "); + sb.append("eA:"); + if (this.eA == null) { + sb.append("null"); + } else { + sb.append(this.eA); + } + first = false; + if (!first) sb.append(", "); + sb.append("eB:"); + if (this.eB == null) { + sb.append("null"); + } else { + sb.append(this.eB); + } + first = false; + if (!first) sb.append(", "); + sb.append("eT:"); + if (this.eT == null) { + sb.append("null"); + } else { + sb.append(this.eT); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class user_createDependency_resultStandardSchemeFactory implements SchemeFactory { + public user_createDependency_resultStandardScheme getScheme() { + return new user_createDependency_resultStandardScheme(); + } + } + + private static class user_createDependency_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_createDependency_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_F + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // E_A + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eA = new FileAlreadyExistException(); + struct.eA.read(iprot); + struct.setEAIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // E_B + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // E_T + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eT = new TachyonException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_createDependency_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eF != null) { + oprot.writeFieldBegin(E_F_FIELD_DESC); + struct.eF.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eA != null) { + oprot.writeFieldBegin(E_A_FIELD_DESC); + struct.eA.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eB != null) { + oprot.writeFieldBegin(E_B_FIELD_DESC); + struct.eB.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eT != null) { + oprot.writeFieldBegin(E_T_FIELD_DESC); + struct.eT.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_createDependency_resultTupleSchemeFactory implements SchemeFactory { + public user_createDependency_resultTupleScheme getScheme() { + return new user_createDependency_resultTupleScheme(); + } + } + + private static class user_createDependency_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_createDependency_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEI()) { + optionals.set(1); + } + if (struct.isSetEF()) { + optionals.set(2); + } + if (struct.isSetEA()) { + optionals.set(3); + } + if (struct.isSetEB()) { + optionals.set(4); + } + if (struct.isSetET()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + if (struct.isSetEF()) { + struct.eF.write(oprot); + } + if (struct.isSetEA()) { + struct.eA.write(oprot); + } + if (struct.isSetEB()) { + struct.eB.write(oprot); + } + if (struct.isSetET()) { + struct.eT.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_createDependency_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(6); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + if (incoming.get(2)) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } + if (incoming.get(3)) { + struct.eA = new FileAlreadyExistException(); + struct.eA.read(iprot); + struct.setEAIsSet(true); + } + if (incoming.get(4)) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } + if (incoming.get(5)) { + struct.eT = new TachyonException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } + } + } + + } + + public static class user_getClientDependencyInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientDependencyInfo_args"); + + private static final org.apache.thrift.protocol.TField DEPENDENCY_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("dependencyId", org.apache.thrift.protocol.TType.I32, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getClientDependencyInfo_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getClientDependencyInfo_argsTupleSchemeFactory()); + } + + public int dependencyId; // 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 { + DEPENDENCY_ID((short)1, "dependencyId"); + + 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: // DEPENDENCY_ID + return DEPENDENCY_ID; + 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 + private static final int __DEPENDENCYID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEPENDENCY_ID, new org.apache.thrift.meta_data.FieldMetaData("dependencyId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientDependencyInfo_args.class, metaDataMap); + } + + public user_getClientDependencyInfo_args() { + } + + public user_getClientDependencyInfo_args( + int dependencyId) + { + this(); + this.dependencyId = dependencyId; + setDependencyIdIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public user_getClientDependencyInfo_args(user_getClientDependencyInfo_args other) { + __isset_bitfield = other.__isset_bitfield; + this.dependencyId = other.dependencyId; + } + + public user_getClientDependencyInfo_args deepCopy() { + return new user_getClientDependencyInfo_args(this); + } + + @Override + public void clear() { + setDependencyIdIsSet(false); + this.dependencyId = 0; + } + + public int getDependencyId() { + return this.dependencyId; + } + + public user_getClientDependencyInfo_args setDependencyId(int dependencyId) { + this.dependencyId = dependencyId; + setDependencyIdIsSet(true); + return this; + } + + public void unsetDependencyId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEPENDENCYID_ISSET_ID); + } + + /** Returns true if field dependencyId is set (has been assigned a value) and false otherwise */ + public boolean isSetDependencyId() { + return EncodingUtils.testBit(__isset_bitfield, __DEPENDENCYID_ISSET_ID); + } + + public void setDependencyIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEPENDENCYID_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case DEPENDENCY_ID: + if (value == null) { + unsetDependencyId(); + } else { + setDependencyId((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case DEPENDENCY_ID: + return Integer.valueOf(getDependencyId()); + + } + 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 DEPENDENCY_ID: + return isSetDependencyId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof user_getClientDependencyInfo_args) + return this.equals((user_getClientDependencyInfo_args)that); + return false; + } + + public boolean equals(user_getClientDependencyInfo_args that) { + if (that == null) + return false; + + boolean this_present_dependencyId = true; + boolean that_present_dependencyId = true; + if (this_present_dependencyId || that_present_dependencyId) { + if (!(this_present_dependencyId && that_present_dependencyId)) + return false; + if (this.dependencyId != that.dependencyId) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(user_getClientDependencyInfo_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + user_getClientDependencyInfo_args typedOther = (user_getClientDependencyInfo_args)other; + + lastComparison = Boolean.valueOf(isSetDependencyId()).compareTo(typedOther.isSetDependencyId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDependencyId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.dependencyId, typedOther.dependencyId); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("user_getClientDependencyInfo_args("); + boolean first = true; + + sb.append("dependencyId:"); + sb.append(this.dependencyId); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class user_getClientDependencyInfo_argsStandardSchemeFactory implements SchemeFactory { + public user_getClientDependencyInfo_argsStandardScheme getScheme() { + return new user_getClientDependencyInfo_argsStandardScheme(); + } + } + + private static class user_getClientDependencyInfo_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientDependencyInfo_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // DEPENDENCY_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.dependencyId = iprot.readI32(); + struct.setDependencyIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientDependencyInfo_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(DEPENDENCY_ID_FIELD_DESC); + oprot.writeI32(struct.dependencyId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getClientDependencyInfo_argsTupleSchemeFactory implements SchemeFactory { + public user_getClientDependencyInfo_argsTupleScheme getScheme() { + return new user_getClientDependencyInfo_argsTupleScheme(); + } + } + + private static class user_getClientDependencyInfo_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientDependencyInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetDependencyId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetDependencyId()) { + oprot.writeI32(struct.dependencyId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientDependencyInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.dependencyId = iprot.readI32(); + struct.setDependencyIdIsSet(true); + } + } + } + + } + + public static class user_getClientDependencyInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientDependencyInfo_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getClientDependencyInfo_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getClientDependencyInfo_resultTupleSchemeFactory()); + } + + public ClientDependencyInfo success; // required + public DependencyDoesNotExistException e; // 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 { + SUCCESS((short)0, "success"), + E((short)1, "e"); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // E + return E; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.StructMetaData(org.apache.thrift.protocol.TType.STRUCT, ClientDependencyInfo.class))); + tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientDependencyInfo_result.class, metaDataMap); + } + + public user_getClientDependencyInfo_result() { + } + + public user_getClientDependencyInfo_result( + ClientDependencyInfo success, + DependencyDoesNotExistException e) + { + this(); + this.success = success; + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public user_getClientDependencyInfo_result(user_getClientDependencyInfo_result other) { + if (other.isSetSuccess()) { + this.success = new ClientDependencyInfo(other.success); + } + if (other.isSetE()) { + this.e = new DependencyDoesNotExistException(other.e); + } + } + + public user_getClientDependencyInfo_result deepCopy() { + return new user_getClientDependencyInfo_result(this); + } + + @Override + public void clear() { + this.success = null; + this.e = null; + } + + public ClientDependencyInfo getSuccess() { + return this.success; + } + + public user_getClientDependencyInfo_result setSuccess(ClientDependencyInfo success) { + this.success = success; + return this; + } + + public void unsetSuccess() { + this.success = null; + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return this.success != null; + } + + public void setSuccessIsSet(boolean value) { + if (!value) { + this.success = null; + } + } + + public DependencyDoesNotExistException getE() { + return this.e; + } + + public user_getClientDependencyInfo_result setE(DependencyDoesNotExistException e) { + this.e = e; + return this; + } + + public void unsetE() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean isSetE() { + return this.e != null; + } + + public void setEIsSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((ClientDependencyInfo)value); + } + break; + + case E: + if (value == null) { + unsetE(); + } else { + setE((DependencyDoesNotExistException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return getSuccess(); + + case E: + return getE(); + + } + 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 SUCCESS: + return isSetSuccess(); + case E: + return isSetE(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof user_getClientDependencyInfo_result) + return this.equals((user_getClientDependencyInfo_result)that); + return false; + } + + public boolean equals(user_getClientDependencyInfo_result that) { + if (that == null) + return false; + + boolean this_present_success = true && this.isSetSuccess(); + boolean that_present_success = true && that.isSetSuccess(); + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (!this.success.equals(that.success)) + return false; + } + + boolean this_present_e = true && this.isSetE(); + boolean that_present_e = true && that.isSetE(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(user_getClientDependencyInfo_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + user_getClientDependencyInfo_result typedOther = (user_getClientDependencyInfo_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetE()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("user_getClientDependencyInfo_result("); + boolean first = true; + + sb.append("success:"); + if (this.success == null) { + sb.append("null"); + } else { + sb.append(this.success); + } + first = false; + if (!first) sb.append(", "); + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class user_getClientDependencyInfo_resultStandardSchemeFactory implements SchemeFactory { + public user_getClientDependencyInfo_resultStandardScheme getScheme() { + return new user_getClientDependencyInfo_resultStandardScheme(); + } + } + + private static class user_getClientDependencyInfo_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientDependencyInfo_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new ClientDependencyInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new DependencyDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientDependencyInfo_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getClientDependencyInfo_resultTupleSchemeFactory implements SchemeFactory { + public user_getClientDependencyInfo_resultTupleScheme getScheme() { + return new user_getClientDependencyInfo_resultTupleScheme(); + } + } + + private static class user_getClientDependencyInfo_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientDependencyInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientDependencyInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new ClientDependencyInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new DependencyDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + + } + + public static class user_reportLostFile_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_reportLostFile_args"); + + private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_reportLostFile_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_reportLostFile_argsTupleSchemeFactory()); + } + + public int fileId; // 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 { + FILE_ID((short)1, "fileId"); + + 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: // FILE_ID + return FILE_ID; + 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 + private static final int __FILEID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_reportLostFile_args.class, metaDataMap); + } + + public user_reportLostFile_args() { + } + + public user_reportLostFile_args( + int fileId) + { + this(); + this.fileId = fileId; + setFileIdIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public user_reportLostFile_args(user_reportLostFile_args other) { + __isset_bitfield = other.__isset_bitfield; + this.fileId = other.fileId; + } + + public user_reportLostFile_args deepCopy() { + return new user_reportLostFile_args(this); + } + + @Override + public void clear() { + setFileIdIsSet(false); + this.fileId = 0; + } + + public int getFileId() { + return this.fileId; + } + + public user_reportLostFile_args setFileId(int fileId) { + this.fileId = fileId; + setFileIdIsSet(true); + return this; + } + + public void unsetFileId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); + } + + /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ + public boolean isSetFileId() { + return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); + } + + public void setFileIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case FILE_ID: + if (value == null) { + unsetFileId(); + } else { + setFileId((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case FILE_ID: + return Integer.valueOf(getFileId()); + + } + 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 FILE_ID: + return isSetFileId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof user_reportLostFile_args) + return this.equals((user_reportLostFile_args)that); + return false; + } + + public boolean equals(user_reportLostFile_args that) { + if (that == null) + return false; + + boolean this_present_fileId = true; + boolean that_present_fileId = true; + if (this_present_fileId || that_present_fileId) { + if (!(this_present_fileId && that_present_fileId)) + return false; + if (this.fileId != that.fileId) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(user_reportLostFile_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + user_reportLostFile_args typedOther = (user_reportLostFile_args)other; + + lastComparison = Boolean.valueOf(isSetFileId()).compareTo(typedOther.isSetFileId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFileId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, typedOther.fileId); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("user_reportLostFile_args("); + boolean first = true; + + sb.append("fileId:"); + sb.append(this.fileId); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class user_reportLostFile_argsStandardSchemeFactory implements SchemeFactory { + public user_reportLostFile_argsStandardScheme getScheme() { + return new user_reportLostFile_argsStandardScheme(); + } + } + + private static class user_reportLostFile_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_reportLostFile_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // FILE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_reportLostFile_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(FILE_ID_FIELD_DESC); + oprot.writeI32(struct.fileId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_reportLostFile_argsTupleSchemeFactory implements SchemeFactory { + public user_reportLostFile_argsTupleScheme getScheme() { + return new user_reportLostFile_argsTupleScheme(); + } + } + + private static class user_reportLostFile_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_reportLostFile_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetFileId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetFileId()) { + oprot.writeI32(struct.fileId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_reportLostFile_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } + } + } + + } + + public static class user_reportLostFile_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_reportLostFile_result"); + + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_reportLostFile_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_reportLostFile_resultTupleSchemeFactory()); + } + + public FileDoesNotExistException e; // 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 { + E((short)1, "e"); + + 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: // E + return E; + 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.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_reportLostFile_result.class, metaDataMap); + } + + public user_reportLostFile_result() { + } + + public user_reportLostFile_result( + FileDoesNotExistException e) + { + this(); + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public user_reportLostFile_result(user_reportLostFile_result other) { + if (other.isSetE()) { + this.e = new FileDoesNotExistException(other.e); + } + } + + public user_reportLostFile_result deepCopy() { + return new user_reportLostFile_result(this); + } + + @Override + public void clear() { + this.e = null; + } + + public FileDoesNotExistException getE() { + return this.e; + } + + public user_reportLostFile_result setE(FileDoesNotExistException e) { + this.e = e; + return this; + } + + public void unsetE() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean isSetE() { + return this.e != null; + } + + public void setEIsSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case E: + if (value == null) { + unsetE(); + } else { + setE((FileDoesNotExistException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case E: + return getE(); + + } + 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 E: + return isSetE(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof user_reportLostFile_result) + return this.equals((user_reportLostFile_result)that); + return false; + } + + public boolean equals(user_reportLostFile_result that) { + if (that == null) + return false; + + boolean this_present_e = true && this.isSetE(); + boolean that_present_e = true && that.isSetE(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(user_reportLostFile_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + user_reportLostFile_result typedOther = (user_reportLostFile_result)other; + + lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetE()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("user_reportLostFile_result("); + boolean first = true; + + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class user_reportLostFile_resultStandardSchemeFactory implements SchemeFactory { + public user_reportLostFile_resultStandardScheme getScheme() { + return new user_reportLostFile_resultStandardScheme(); + } + } + + private static class user_reportLostFile_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_reportLostFile_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_reportLostFile_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_reportLostFile_resultTupleSchemeFactory implements SchemeFactory { + public user_reportLostFile_resultTupleScheme getScheme() { + return new user_reportLostFile_resultTupleScheme(); + } + } + + private static class user_reportLostFile_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_reportLostFile_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetE()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_reportLostFile_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + + } + + public static class user_requestFilesInDependency_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_requestFilesInDependency_args"); + + private static final org.apache.thrift.protocol.TField DEP_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("depId", org.apache.thrift.protocol.TType.I32, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_requestFilesInDependency_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_requestFilesInDependency_argsTupleSchemeFactory()); + } + + public int depId; // 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 { + DEP_ID((short)1, "depId"); + + 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: // DEP_ID + return DEP_ID; + 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 + private static final int __DEPID_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.DEP_ID, new org.apache.thrift.meta_data.FieldMetaData("depId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_requestFilesInDependency_args.class, metaDataMap); + } + + public user_requestFilesInDependency_args() { + } + + public user_requestFilesInDependency_args( + int depId) + { + this(); + this.depId = depId; + setDepIdIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public user_requestFilesInDependency_args(user_requestFilesInDependency_args other) { + __isset_bitfield = other.__isset_bitfield; + this.depId = other.depId; + } + + public user_requestFilesInDependency_args deepCopy() { + return new user_requestFilesInDependency_args(this); + } + + @Override + public void clear() { + setDepIdIsSet(false); + this.depId = 0; + } + + public int getDepId() { + return this.depId; + } + + public user_requestFilesInDependency_args setDepId(int depId) { + this.depId = depId; + setDepIdIsSet(true); + return this; + } + + public void unsetDepId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __DEPID_ISSET_ID); + } + + /** Returns true if field depId is set (has been assigned a value) and false otherwise */ + public boolean isSetDepId() { + return EncodingUtils.testBit(__isset_bitfield, __DEPID_ISSET_ID); + } + + public void setDepIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __DEPID_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case DEP_ID: + if (value == null) { + unsetDepId(); + } else { + setDepId((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case DEP_ID: + return Integer.valueOf(getDepId()); + + } + 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 DEP_ID: + return isSetDepId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof user_requestFilesInDependency_args) + return this.equals((user_requestFilesInDependency_args)that); + return false; + } + + public boolean equals(user_requestFilesInDependency_args that) { + if (that == null) + return false; + + boolean this_present_depId = true; + boolean that_present_depId = true; + if (this_present_depId || that_present_depId) { + if (!(this_present_depId && that_present_depId)) + return false; + if (this.depId != that.depId) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(user_requestFilesInDependency_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + user_requestFilesInDependency_args typedOther = (user_requestFilesInDependency_args)other; + + lastComparison = Boolean.valueOf(isSetDepId()).compareTo(typedOther.isSetDepId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetDepId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.depId, typedOther.depId); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("user_requestFilesInDependency_args("); + boolean first = true; + + sb.append("depId:"); + sb.append(this.depId); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class user_requestFilesInDependency_argsStandardSchemeFactory implements SchemeFactory { + public user_requestFilesInDependency_argsStandardScheme getScheme() { + return new user_requestFilesInDependency_argsStandardScheme(); + } + } + + private static class user_requestFilesInDependency_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_requestFilesInDependency_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // DEP_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.depId = iprot.readI32(); + struct.setDepIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_requestFilesInDependency_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(DEP_ID_FIELD_DESC); + oprot.writeI32(struct.depId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_requestFilesInDependency_argsTupleSchemeFactory implements SchemeFactory { + public user_requestFilesInDependency_argsTupleScheme getScheme() { + return new user_requestFilesInDependency_argsTupleScheme(); + } + } + + private static class user_requestFilesInDependency_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_requestFilesInDependency_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetDepId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetDepId()) { + oprot.writeI32(struct.depId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_requestFilesInDependency_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.depId = iprot.readI32(); + struct.setDepIdIsSet(true); + } + } + } + + } + + public static class user_requestFilesInDependency_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_requestFilesInDependency_result"); + + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_requestFilesInDependency_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_requestFilesInDependency_resultTupleSchemeFactory()); + } + + public DependencyDoesNotExistException e; // 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 { + E((short)1, "e"); + + 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: // E + return E; + 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.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_requestFilesInDependency_result.class, metaDataMap); + } + + public user_requestFilesInDependency_result() { + } + + public user_requestFilesInDependency_result( + DependencyDoesNotExistException e) + { + this(); + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public user_requestFilesInDependency_result(user_requestFilesInDependency_result other) { + if (other.isSetE()) { + this.e = new DependencyDoesNotExistException(other.e); + } + } + + public user_requestFilesInDependency_result deepCopy() { + return new user_requestFilesInDependency_result(this); + } + + @Override + public void clear() { + this.e = null; + } + + public DependencyDoesNotExistException getE() { + return this.e; + } + + public user_requestFilesInDependency_result setE(DependencyDoesNotExistException e) { + this.e = e; + return this; + } + + public void unsetE() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean isSetE() { + return this.e != null; + } + + public void setEIsSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case E: + if (value == null) { + unsetE(); + } else { + setE((DependencyDoesNotExistException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case E: + return getE(); + + } + 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 E: + return isSetE(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof user_requestFilesInDependency_result) + return this.equals((user_requestFilesInDependency_result)that); + return false; + } + + public boolean equals(user_requestFilesInDependency_result that) { + if (that == null) + return false; + + boolean this_present_e = true && this.isSetE(); + boolean that_present_e = true && that.isSetE(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(user_requestFilesInDependency_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + user_requestFilesInDependency_result typedOther = (user_requestFilesInDependency_result)other; + + lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetE()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("user_requestFilesInDependency_result("); + boolean first = true; + + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class user_requestFilesInDependency_resultStandardSchemeFactory implements SchemeFactory { + public user_requestFilesInDependency_resultStandardScheme getScheme() { + return new user_requestFilesInDependency_resultStandardScheme(); + } + } + + private static class user_requestFilesInDependency_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_requestFilesInDependency_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new DependencyDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_requestFilesInDependency_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); } - first = false; - sb.append(")"); - return sb.toString(); - } - public void validate() throws org.apache.thrift.TException { - // check for required fields } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); + private static class user_requestFilesInDependency_resultTupleSchemeFactory implements SchemeFactory { + public user_requestFilesInDependency_resultTupleScheme getScheme() { + return new user_requestFilesInDependency_resultTupleScheme(); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); + private static class user_requestFilesInDependency_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_requestFilesInDependency_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetE()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_requestFilesInDependency_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.e = new DependencyDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } } } @@ -9193,6 +15956,12 @@ public static class user_createFile_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_createFile_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_createFile_argsTupleSchemeFactory()); + } + public String path; // required public long blockSizeByte; // required @@ -9259,8 +16028,7 @@ public String getFieldName() { // isset id assignments private static final int __BLOCKSIZEBYTE_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -9289,8 +16057,7 @@ public user_createFile_args( * Performs a deep copy on other. */ public user_createFile_args(user_createFile_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetPath()) { this.path = other.path; } @@ -9343,16 +16110,16 @@ public user_createFile_args setBlockSizeByte(long blockSizeByte) { } public void unsetBlockSizeByte() { - __isset_bit_vector.clear(__BLOCKSIZEBYTE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKSIZEBYTE_ISSET_ID); } /** Returns true if field blockSizeByte is set (has been assigned a value) and false otherwise */ public boolean isSetBlockSizeByte() { - return __isset_bit_vector.get(__BLOCKSIZEBYTE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __BLOCKSIZEBYTE_ISSET_ID); } public void setBlockSizeByteIsSet(boolean value) { - __isset_bit_vector.set(__BLOCKSIZEBYTE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKSIZEBYTE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -9478,55 +16245,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // BLOCK_SIZE_BYTE - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.blockSizeByte = iprot.readI64(); - setBlockSizeByteIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(BLOCK_SIZE_BYTE_FIELD_DESC); - oprot.writeI64(this.blockSizeByte); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -9551,6 +16274,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -9564,13 +16288,118 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_createFile_argsStandardSchemeFactory implements SchemeFactory { + public user_createFile_argsStandardScheme getScheme() { + return new user_createFile_argsStandardScheme(); + } + } + + private static class user_createFile_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_createFile_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // BLOCK_SIZE_BYTE + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.blockSizeByte = iprot.readI64(); + struct.setBlockSizeByteIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_createFile_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(BLOCK_SIZE_BYTE_FIELD_DESC); + oprot.writeI64(struct.blockSizeByte); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_createFile_argsTupleSchemeFactory implements SchemeFactory { + public user_createFile_argsTupleScheme getScheme() { + return new user_createFile_argsTupleScheme(); + } + } + + private static class user_createFile_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_createFile_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + if (struct.isSetBlockSizeByte()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + if (struct.isSetBlockSizeByte()) { + oprot.writeI64(struct.blockSizeByte); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_createFile_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + if (incoming.get(1)) { + struct.blockSizeByte = iprot.readI64(); + struct.setBlockSizeByteIsSet(true); + } + } + } + } public static class user_createFile_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -9582,6 +16411,12 @@ public static class user_createFile_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_createFile_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_createFile_resultTupleSchemeFactory()); + } + public int success; // required public FileAlreadyExistException eR; // required public InvalidPathException eI; // required @@ -9660,8 +16495,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -9702,8 +16536,7 @@ public user_createFile_result( * Performs a deep copy on other. */ public user_createFile_result(user_createFile_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetER()) { this.eR = new FileAlreadyExistException(other.eR); @@ -9744,16 +16577,16 @@ public user_createFile_result setSuccess(int success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileAlreadyExistException getER() { @@ -10071,93 +16904,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.success = iprot.readI32(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E_R - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eR = new FileAlreadyExistException(); - this.eR.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_I - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eI = new InvalidPathException(); - this.eI.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // E_B - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eB = new BlockInfoException(); - this.eB.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // E_T - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eT = new TachyonException(); - this.eT.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetER()) { - oprot.writeFieldBegin(E_R_FIELD_DESC); - this.eR.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEI()) { - oprot.writeFieldBegin(E_I_FIELD_DESC); - this.eI.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEB()) { - oprot.writeFieldBegin(E_B_FIELD_DESC); - this.eB.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetET()) { - oprot.writeFieldBegin(E_T_FIELD_DESC); - this.eT.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -10205,6 +16957,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -10217,12 +16970,198 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_createFile_resultStandardSchemeFactory implements SchemeFactory { + public user_createFile_resultStandardScheme getScheme() { + return new user_createFile_resultStandardScheme(); + } + } + + private static class user_createFile_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_createFile_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_R + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eR = new FileAlreadyExistException(); + struct.eR.read(iprot); + struct.setERIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // E_B + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // E_T + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eT = new TachyonException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_createFile_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.eR != null) { + oprot.writeFieldBegin(E_R_FIELD_DESC); + struct.eR.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eB != null) { + oprot.writeFieldBegin(E_B_FIELD_DESC); + struct.eB.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eT != null) { + oprot.writeFieldBegin(E_T_FIELD_DESC); + struct.eT.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_createFile_resultTupleSchemeFactory implements SchemeFactory { + public user_createFile_resultTupleScheme getScheme() { + return new user_createFile_resultTupleScheme(); + } + } + + private static class user_createFile_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_createFile_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetER()) { + optionals.set(1); + } + if (struct.isSetEI()) { + optionals.set(2); + } + if (struct.isSetEB()) { + optionals.set(3); + } + if (struct.isSetET()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetER()) { + struct.eR.write(oprot); + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + if (struct.isSetEB()) { + struct.eB.write(oprot); + } + if (struct.isSetET()) { + struct.eT.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_createFile_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eR = new FileAlreadyExistException(); + struct.eR.read(iprot); + struct.setERIsSet(true); + } + if (incoming.get(2)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + if (incoming.get(3)) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } + if (incoming.get(4)) { + struct.eT = new TachyonException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } + } + } + } public static class user_createFileOnCheckpoint_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -10231,6 +17170,12 @@ public static class user_createFileOnCheckpoint_args implements org.apache.thrif 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 CHECKPOINT_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("checkpointPath", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_createFileOnCheckpoint_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_createFileOnCheckpoint_argsTupleSchemeFactory()); + } + public String path; // required public String checkpointPath; // required @@ -10296,7 +17241,6 @@ public String getFieldName() { } // 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); @@ -10513,56 +17457,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // CHECKPOINT_PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.checkpointPath = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - if (this.checkpointPath != null) { - oprot.writeFieldBegin(CHECKPOINT_PATH_FIELD_DESC); - oprot.writeString(this.checkpointPath); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -10591,6 +17490,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -10609,6 +17509,113 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_createFileOnCheckpoint_argsStandardSchemeFactory implements SchemeFactory { + public user_createFileOnCheckpoint_argsStandardScheme getScheme() { + return new user_createFileOnCheckpoint_argsStandardScheme(); + } + } + + private static class user_createFileOnCheckpoint_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_createFileOnCheckpoint_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // CHECKPOINT_PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.checkpointPath = iprot.readString(); + struct.setCheckpointPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_createFileOnCheckpoint_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + if (struct.checkpointPath != null) { + oprot.writeFieldBegin(CHECKPOINT_PATH_FIELD_DESC); + oprot.writeString(struct.checkpointPath); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_createFileOnCheckpoint_argsTupleSchemeFactory implements SchemeFactory { + public user_createFileOnCheckpoint_argsTupleScheme getScheme() { + return new user_createFileOnCheckpoint_argsTupleScheme(); + } + } + + private static class user_createFileOnCheckpoint_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_createFileOnCheckpoint_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + if (struct.isSetCheckpointPath()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + if (struct.isSetCheckpointPath()) { + oprot.writeString(struct.checkpointPath); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_createFileOnCheckpoint_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + if (incoming.get(1)) { + struct.checkpointPath = iprot.readString(); + struct.setCheckpointPathIsSet(true); + } + } + } + } public static class user_createFileOnCheckpoint_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -10621,6 +17628,12 @@ public static class user_createFileOnCheckpoint_result implements org.apache.thr private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)4); private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)5); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_createFileOnCheckpoint_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_createFileOnCheckpoint_resultTupleSchemeFactory()); + } + public int success; // required public FileAlreadyExistException eR; // required public InvalidPathException eI; // required @@ -10703,8 +17716,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -10749,8 +17761,7 @@ public user_createFileOnCheckpoint_result( * Performs a deep copy on other. */ public user_createFileOnCheckpoint_result(user_createFileOnCheckpoint_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetER()) { this.eR = new FileAlreadyExistException(other.eR); @@ -10795,16 +17806,16 @@ public user_createFileOnCheckpoint_result setSuccess(int success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileAlreadyExistException getER() { @@ -11177,107 +18188,14 @@ public _Fields fieldForId(int fieldId) { return _Fields.findByThriftId(fieldId); } - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.success = iprot.readI32(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E_R - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eR = new FileAlreadyExistException(); - this.eR.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_I - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eI = new InvalidPathException(); - this.eI.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // E_S - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eS = new SuspectedFileSizeException(); - this.eS.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // E_B - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eB = new BlockInfoException(); - this.eB.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 5: // E_T - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eT = new TachyonException(); - this.eT.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); - } - - public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetER()) { - oprot.writeFieldBegin(E_R_FIELD_DESC); - this.eR.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEI()) { - oprot.writeFieldBegin(E_I_FIELD_DESC); - this.eI.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetES()) { - oprot.writeFieldBegin(E_S_FIELD_DESC); - this.eS.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEB()) { - oprot.writeFieldBegin(E_B_FIELD_DESC); - this.eB.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetET()) { - oprot.writeFieldBegin(E_T_FIELD_DESC); - this.eT.write(oprot); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + @Override public String toString() { StringBuilder sb = new StringBuilder("user_createFileOnCheckpoint_result("); @@ -11332,6 +18250,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -11344,12 +18263,223 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_createFileOnCheckpoint_resultStandardSchemeFactory implements SchemeFactory { + public user_createFileOnCheckpoint_resultStandardScheme getScheme() { + return new user_createFileOnCheckpoint_resultStandardScheme(); + } + } + + private static class user_createFileOnCheckpoint_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_createFileOnCheckpoint_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_R + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eR = new FileAlreadyExistException(); + struct.eR.read(iprot); + struct.setERIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // E_S + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eS = new SuspectedFileSizeException(); + struct.eS.read(iprot); + struct.setESIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // E_B + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 5: // E_T + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eT = new TachyonException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_createFileOnCheckpoint_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.eR != null) { + oprot.writeFieldBegin(E_R_FIELD_DESC); + struct.eR.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eS != null) { + oprot.writeFieldBegin(E_S_FIELD_DESC); + struct.eS.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eB != null) { + oprot.writeFieldBegin(E_B_FIELD_DESC); + struct.eB.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eT != null) { + oprot.writeFieldBegin(E_T_FIELD_DESC); + struct.eT.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_createFileOnCheckpoint_resultTupleSchemeFactory implements SchemeFactory { + public user_createFileOnCheckpoint_resultTupleScheme getScheme() { + return new user_createFileOnCheckpoint_resultTupleScheme(); + } + } + + private static class user_createFileOnCheckpoint_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_createFileOnCheckpoint_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetER()) { + optionals.set(1); + } + if (struct.isSetEI()) { + optionals.set(2); + } + if (struct.isSetES()) { + optionals.set(3); + } + if (struct.isSetEB()) { + optionals.set(4); + } + if (struct.isSetET()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetER()) { + struct.eR.write(oprot); + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + if (struct.isSetES()) { + struct.eS.write(oprot); + } + if (struct.isSetEB()) { + struct.eB.write(oprot); + } + if (struct.isSetET()) { + struct.eT.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_createFileOnCheckpoint_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(6); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eR = new FileAlreadyExistException(); + struct.eR.read(iprot); + struct.setERIsSet(true); + } + if (incoming.get(2)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + if (incoming.get(3)) { + struct.eS = new SuspectedFileSizeException(); + struct.eS.read(iprot); + struct.setESIsSet(true); + } + if (incoming.get(4)) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } + if (incoming.get(5)) { + struct.eT = new TachyonException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } + } + } + } public static class user_createNewBlock_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -11357,6 +18487,12 @@ public static class user_createNewBlock_args implements org.apache.thrift.TBase< private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_createNewBlock_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_createNewBlock_argsTupleSchemeFactory()); + } + public int fileId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -11419,8 +18555,7 @@ public String getFieldName() { // isset id assignments private static final int __FILEID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -11445,8 +18580,7 @@ public user_createNewBlock_args( * Performs a deep copy on other. */ public user_createNewBlock_args(user_createNewBlock_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; } @@ -11471,16 +18605,16 @@ public user_createNewBlock_args setFileId(int fileId) { } public void unsetFileId() { - __isset_bit_vector.clear(__FILEID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { - return __isset_bit_vector.get(__FILEID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { - __isset_bit_vector.set(__FILEID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -11574,43 +18708,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // FILE_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.fileId = iprot.readI32(); - setFileIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(FILE_ID_FIELD_DESC); - oprot.writeI32(this.fileId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -11627,6 +18729,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -11640,13 +18743,95 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_createNewBlock_argsStandardSchemeFactory implements SchemeFactory { + public user_createNewBlock_argsStandardScheme getScheme() { + return new user_createNewBlock_argsStandardScheme(); + } + } + + private static class user_createNewBlock_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_createNewBlock_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // FILE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_createNewBlock_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(FILE_ID_FIELD_DESC); + oprot.writeI32(struct.fileId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_createNewBlock_argsTupleSchemeFactory implements SchemeFactory { + public user_createNewBlock_argsTupleScheme getScheme() { + return new user_createNewBlock_argsTupleScheme(); + } + } + + private static class user_createNewBlock_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_createNewBlock_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetFileId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetFileId()) { + oprot.writeI32(struct.fileId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_createNewBlock_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } + } + } + } public static class user_createNewBlock_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -11655,6 +18840,12 @@ public static class user_createNewBlock_result implements org.apache.thrift.TBas private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I64, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_createNewBlock_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_createNewBlock_resultTupleSchemeFactory()); + } + public long success; // required public FileDoesNotExistException e; // required @@ -11721,8 +18912,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -11751,8 +18941,7 @@ public user_createNewBlock_result( * Performs a deep copy on other. */ public user_createNewBlock_result(user_createNewBlock_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); @@ -11781,16 +18970,16 @@ public user_createNewBlock_result setSuccess(long success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileDoesNotExistException getE() { @@ -11940,57 +19129,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.success = iprot.readI64(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new FileDoesNotExistException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -12014,6 +19158,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -12026,12 +19171,123 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_createNewBlock_resultStandardSchemeFactory implements SchemeFactory { + public user_createNewBlock_resultStandardScheme getScheme() { + return new user_createNewBlock_resultStandardScheme(); + } + } + + private static class user_createNewBlock_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_createNewBlock_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_createNewBlock_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI64(struct.success); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_createNewBlock_resultTupleSchemeFactory implements SchemeFactory { + public user_createNewBlock_resultTupleScheme getScheme() { + return new user_createNewBlock_resultTupleScheme(); + } + } + + private static class user_createNewBlock_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_createNewBlock_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeI64(struct.success); + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_createNewBlock_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + } public static class user_completeFile_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -12039,6 +19295,12 @@ public static class user_completeFile_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_completeFile_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_completeFile_argsTupleSchemeFactory()); + } + public int fileId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -12101,8 +19363,7 @@ public String getFieldName() { // isset id assignments private static final int __FILEID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -12127,8 +19388,7 @@ public user_completeFile_args( * Performs a deep copy on other. */ public user_completeFile_args(user_completeFile_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; } @@ -12153,16 +19413,16 @@ public user_completeFile_args setFileId(int fileId) { } public void unsetFileId() { - __isset_bit_vector.clear(__FILEID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { - return __isset_bit_vector.get(__FILEID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { - __isset_bit_vector.set(__FILEID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -12256,43 +19516,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // FILE_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.fileId = iprot.readI32(); - setFileIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(FILE_ID_FIELD_DESC); - oprot.writeI32(this.fileId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -12309,6 +19537,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -12322,13 +19551,95 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_completeFile_argsStandardSchemeFactory implements SchemeFactory { + public user_completeFile_argsStandardScheme getScheme() { + return new user_completeFile_argsStandardScheme(); + } + } + + private static class user_completeFile_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_completeFile_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // FILE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_completeFile_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(FILE_ID_FIELD_DESC); + oprot.writeI32(struct.fileId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_completeFile_argsTupleSchemeFactory implements SchemeFactory { + public user_completeFile_argsTupleScheme getScheme() { + return new user_completeFile_argsTupleScheme(); + } + } + + private static class user_completeFile_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_completeFile_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetFileId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetFileId()) { + oprot.writeI32(struct.fileId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_completeFile_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } + } + } + } public static class user_completeFile_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -12336,6 +19647,12 @@ public static class user_completeFile_result implements org.apache.thrift.TBase< private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_completeFile_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_completeFile_resultTupleSchemeFactory()); + } + public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -12397,7 +19714,6 @@ public String getFieldName() { } // 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); @@ -12550,45 +19866,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new FileDoesNotExistException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -12601,28 +19884,115 @@ public String toString() { } else { sb.append(this.e); } - first = false; - sb.append(")"); - return sb.toString(); - } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class user_completeFile_resultStandardSchemeFactory implements SchemeFactory { + public user_completeFile_resultStandardScheme getScheme() { + return new user_completeFile_resultStandardScheme(); + } + } + + private static class user_completeFile_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_completeFile_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_completeFile_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } - public void validate() throws org.apache.thrift.TException { - // check for required fields } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); + private static class user_completeFile_resultTupleSchemeFactory implements SchemeFactory { + public user_completeFile_resultTupleScheme getScheme() { + return new user_completeFile_resultTupleScheme(); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); + private static class user_completeFile_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_completeFile_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetE()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_completeFile_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } } } @@ -12633,6 +20003,12 @@ public static class user_getFileId_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getFileId_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getFileId_argsTupleSchemeFactory()); + } + public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -12694,7 +20070,6 @@ public String getFieldName() { } // 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); @@ -12847,44 +20222,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -12905,6 +20247,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -12923,6 +20266,90 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getFileId_argsStandardSchemeFactory implements SchemeFactory { + public user_getFileId_argsStandardScheme getScheme() { + return new user_getFileId_argsStandardScheme(); + } + } + + private static class user_getFileId_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getFileId_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getFileId_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getFileId_argsTupleSchemeFactory implements SchemeFactory { + public user_getFileId_argsTupleScheme getScheme() { + return new user_getFileId_argsTupleScheme(); + } + } + + private static class user_getFileId_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getFileId_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getFileId_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + } + } + } public static class user_getFileId_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -12931,6 +20358,12 @@ public static class user_getFileId_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getFileId_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getFileId_resultTupleSchemeFactory()); + } + public int success; // required public InvalidPathException e; // required @@ -12997,8 +20430,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -13027,8 +20459,7 @@ public user_getFileId_result( * Performs a deep copy on other. */ public user_getFileId_result(user_getFileId_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new InvalidPathException(other.e); @@ -13057,16 +20488,16 @@ public user_getFileId_result setSuccess(int success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public InvalidPathException getE() { @@ -13216,57 +20647,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.success = iprot.readI32(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new InvalidPathException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -13290,6 +20676,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -13302,18 +20689,135 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_getFileId_resultStandardSchemeFactory implements SchemeFactory { + public user_getFileId_resultStandardScheme getScheme() { + return new user_getFileId_resultStandardScheme(); + } + } + + private static class user_getFileId_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getFileId_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new InvalidPathException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getFileId_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getFileId_resultTupleSchemeFactory implements SchemeFactory { + public user_getFileId_resultTupleScheme getScheme() { + return new user_getFileId_resultTupleScheme(); + } + } + + private static class user_getFileId_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getFileId_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getFileId_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new InvalidPathException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + } public static class user_getUserId_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getUserId_args"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getUserId_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getUserId_argsTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -13453,32 +20957,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -13492,6 +20975,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -13510,6 +20994,64 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getUserId_argsStandardSchemeFactory implements SchemeFactory { + public user_getUserId_argsStandardScheme getScheme() { + return new user_getUserId_argsStandardScheme(); + } + } + + private static class user_getUserId_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getUserId_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getUserId_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getUserId_argsTupleSchemeFactory implements SchemeFactory { + public user_getUserId_argsTupleScheme getScheme() { + return new user_getUserId_argsTupleScheme(); + } + } + + private static class user_getUserId_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getUserId_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getUserId_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class user_getUserId_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -13517,6 +21059,12 @@ public static class user_getUserId_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getUserId_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getUserId_resultTupleSchemeFactory()); + } + public long success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -13579,8 +21127,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -13605,8 +21152,7 @@ public user_getUserId_result( * Performs a deep copy on other. */ public user_getUserId_result(user_getUserId_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; } @@ -13631,16 +21177,16 @@ public user_getUserId_result setSuccess(long success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -13734,45 +21280,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.success = iprot.readI64(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(this.success); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -13788,6 +21301,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -13800,12 +21314,98 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_getUserId_resultStandardSchemeFactory implements SchemeFactory { + public user_getUserId_resultStandardScheme getScheme() { + return new user_getUserId_resultStandardScheme(); + } + } + + private static class user_getUserId_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getUserId_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getUserId_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI64(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getUserId_resultTupleSchemeFactory implements SchemeFactory { + public user_getUserId_resultTupleScheme getScheme() { + return new user_getUserId_resultTupleScheme(); + } + } + + private static class user_getUserId_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getUserId_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeI64(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getUserId_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } + } + } + } public static class user_getBlockId_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -13814,6 +21414,12 @@ public static class user_getBlockId_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getBlockId_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getBlockId_argsTupleSchemeFactory()); + } + public int fileId; // required public int index; // required @@ -13881,8 +21487,7 @@ public String getFieldName() { // isset id assignments private static final int __FILEID_ISSET_ID = 0; private static final int __INDEX_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private byte __isset_bitfield = 0; 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); @@ -13912,8 +21517,7 @@ public user_getBlockId_args( * Performs a deep copy on other. */ public user_getBlockId_args(user_getBlockId_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; this.index = other.index; } @@ -13941,16 +21545,16 @@ public user_getBlockId_args setFileId(int fileId) { } public void unsetFileId() { - __isset_bit_vector.clear(__FILEID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { - return __isset_bit_vector.get(__FILEID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { - __isset_bit_vector.set(__FILEID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public int getIndex() { @@ -13964,16 +21568,16 @@ public user_getBlockId_args setIndex(int index) { } public void unsetIndex() { - __isset_bit_vector.clear(__INDEX_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __INDEX_ISSET_ID); } /** Returns true if field index is set (has been assigned a value) and false otherwise */ public boolean isSetIndex() { - return __isset_bit_vector.get(__INDEX_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __INDEX_ISSET_ID); } public void setIndexIsSet(boolean value) { - __isset_bit_vector.set(__INDEX_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __INDEX_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -14099,54 +21703,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // FILE_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.fileId = iprot.readI32(); - setFileIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // INDEX - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.index = iprot.readI32(); - setIndexIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(FILE_ID_FIELD_DESC); - oprot.writeI32(this.fileId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(INDEX_FIELD_DESC); - oprot.writeI32(this.index); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -14167,6 +21728,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -14180,13 +21742,116 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_getBlockId_argsStandardSchemeFactory implements SchemeFactory { + public user_getBlockId_argsStandardScheme getScheme() { + return new user_getBlockId_argsStandardScheme(); + } + } + + private static class user_getBlockId_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getBlockId_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // FILE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // INDEX + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.index = iprot.readI32(); + struct.setIndexIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getBlockId_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(FILE_ID_FIELD_DESC); + oprot.writeI32(struct.fileId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(INDEX_FIELD_DESC); + oprot.writeI32(struct.index); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getBlockId_argsTupleSchemeFactory implements SchemeFactory { + public user_getBlockId_argsTupleScheme getScheme() { + return new user_getBlockId_argsTupleScheme(); + } + } + + private static class user_getBlockId_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getBlockId_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetFileId()) { + optionals.set(0); + } + if (struct.isSetIndex()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetFileId()) { + oprot.writeI32(struct.fileId); + } + if (struct.isSetIndex()) { + oprot.writeI32(struct.index); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getBlockId_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } + if (incoming.get(1)) { + struct.index = iprot.readI32(); + struct.setIndexIsSet(true); + } + } + } + } public static class user_getBlockId_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -14195,6 +21860,12 @@ public static class user_getBlockId_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getBlockId_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getBlockId_resultTupleSchemeFactory()); + } + public long success; // required public FileDoesNotExistException e; // required @@ -14261,8 +21932,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -14291,8 +21961,7 @@ public user_getBlockId_result( * Performs a deep copy on other. */ public user_getBlockId_result(user_getBlockId_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new FileDoesNotExistException(other.e); @@ -14321,16 +21990,16 @@ public user_getBlockId_result setSuccess(long success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileDoesNotExistException getE() { @@ -14480,57 +22149,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.success = iprot.readI64(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new FileDoesNotExistException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI64(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -14554,6 +22178,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -14566,12 +22191,123 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_getBlockId_resultStandardSchemeFactory implements SchemeFactory { + public user_getBlockId_resultStandardScheme getScheme() { + return new user_getBlockId_resultStandardScheme(); + } + } + + private static class user_getBlockId_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getBlockId_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getBlockId_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI64(struct.success); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getBlockId_resultTupleSchemeFactory implements SchemeFactory { + public user_getBlockId_resultTupleScheme getScheme() { + return new user_getBlockId_resultTupleScheme(); + } + } + + private static class user_getBlockId_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getBlockId_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeI64(struct.success); + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getBlockId_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readI64(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + } public static class user_getWorker_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -14580,6 +22316,12 @@ public static class user_getWorker_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getWorker_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getWorker_argsTupleSchemeFactory()); + } + public boolean random; // required public String host; // required @@ -14646,8 +22388,7 @@ public String getFieldName() { // isset id assignments private static final int __RANDOM_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -14676,8 +22417,7 @@ public user_getWorker_args( * Performs a deep copy on other. */ public user_getWorker_args(user_getWorker_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.random = other.random; if (other.isSetHost()) { this.host = other.host; @@ -14706,16 +22446,16 @@ public user_getWorker_args setRandom(boolean random) { } public void unsetRandom() { - __isset_bit_vector.clear(__RANDOM_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RANDOM_ISSET_ID); } /** Returns true if field random is set (has been assigned a value) and false otherwise */ public boolean isSetRandom() { - return __isset_bit_vector.get(__RANDOM_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __RANDOM_ISSET_ID); } public void setRandomIsSet(boolean value) { - __isset_bit_vector.set(__RANDOM_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RANDOM_ISSET_ID, value); } public String getHost() { @@ -14865,55 +22605,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // RANDOM - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.random = iprot.readBool(); - setRandomIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // HOST - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.host = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(RANDOM_FIELD_DESC); - oprot.writeBool(this.random); - oprot.writeFieldEnd(); - if (this.host != null) { - oprot.writeFieldBegin(HOST_FIELD_DESC); - oprot.writeString(this.host); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -14938,6 +22634,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -14951,13 +22648,118 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_getWorker_argsStandardSchemeFactory implements SchemeFactory { + public user_getWorker_argsStandardScheme getScheme() { + return new user_getWorker_argsStandardScheme(); + } + } + + private static class user_getWorker_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getWorker_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // RANDOM + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.random = iprot.readBool(); + struct.setRandomIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // HOST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.host = iprot.readString(); + struct.setHostIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getWorker_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(RANDOM_FIELD_DESC); + oprot.writeBool(struct.random); + oprot.writeFieldEnd(); + if (struct.host != null) { + oprot.writeFieldBegin(HOST_FIELD_DESC); + oprot.writeString(struct.host); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getWorker_argsTupleSchemeFactory implements SchemeFactory { + public user_getWorker_argsTupleScheme getScheme() { + return new user_getWorker_argsTupleScheme(); + } + } + + private static class user_getWorker_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getWorker_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetRandom()) { + optionals.set(0); + } + if (struct.isSetHost()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetRandom()) { + oprot.writeBool(struct.random); + } + if (struct.isSetHost()) { + oprot.writeString(struct.host); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getWorker_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.random = iprot.readBool(); + struct.setRandomIsSet(true); + } + if (incoming.get(1)) { + struct.host = iprot.readString(); + struct.setHostIsSet(true); + } + } + } + } public static class user_getWorker_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -14966,6 +22768,12 @@ public static class user_getWorker_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getWorker_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getWorker_resultTupleSchemeFactory()); + } + public NetAddress success; // required public NoWorkerException e; // required @@ -15031,7 +22839,6 @@ public String getFieldName() { } // 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); @@ -15248,57 +23055,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new NetAddress(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new NoWorkerException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -15326,6 +23088,10 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -15344,13 +23110,130 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getWorker_resultStandardSchemeFactory implements SchemeFactory { + public user_getWorker_resultStandardScheme getScheme() { + return new user_getWorker_resultStandardScheme(); + } + } + + private static class user_getWorker_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getWorker_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new NetAddress(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new NoWorkerException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getWorker_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getWorker_resultTupleSchemeFactory implements SchemeFactory { + public user_getWorker_resultTupleScheme getScheme() { + return new user_getWorker_resultTupleScheme(); + } + } + + private static class user_getWorker_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getWorker_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getWorker_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new NetAddress(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new NoWorkerException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + } - public static class user_getClientFileInfoById_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientFileInfoById_args"); + public static class getClientFileInfoById_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getClientFileInfoById_args"); private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getClientFileInfoById_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getClientFileInfoById_argsTupleSchemeFactory()); + } + public int fileId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -15413,21 +23296,20 @@ public String getFieldName() { // isset id assignments private static final int __FILEID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientFileInfoById_args.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getClientFileInfoById_args.class, metaDataMap); } - public user_getClientFileInfoById_args() { + public getClientFileInfoById_args() { } - public user_getClientFileInfoById_args( + public getClientFileInfoById_args( int fileId) { this(); @@ -15438,14 +23320,13 @@ public user_getClientFileInfoById_args( /** * Performs a deep copy on other. */ - public user_getClientFileInfoById_args(user_getClientFileInfoById_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + public getClientFileInfoById_args(getClientFileInfoById_args other) { + __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; } - public user_getClientFileInfoById_args deepCopy() { - return new user_getClientFileInfoById_args(this); + public getClientFileInfoById_args deepCopy() { + return new getClientFileInfoById_args(this); } @Override @@ -15458,23 +23339,23 @@ public int getFileId() { return this.fileId; } - public user_getClientFileInfoById_args setFileId(int fileId) { + public getClientFileInfoById_args setFileId(int fileId) { this.fileId = fileId; setFileIdIsSet(true); return this; } public void unsetFileId() { - __isset_bit_vector.clear(__FILEID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { - return __isset_bit_vector.get(__FILEID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { - __isset_bit_vector.set(__FILEID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -15516,12 +23397,12 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof user_getClientFileInfoById_args) - return this.equals((user_getClientFileInfoById_args)that); + if (that instanceof getClientFileInfoById_args) + return this.equals((getClientFileInfoById_args)that); return false; } - public boolean equals(user_getClientFileInfoById_args that) { + public boolean equals(getClientFileInfoById_args that) { if (that == null) return false; @@ -15542,13 +23423,13 @@ public int hashCode() { return 0; } - public int compareTo(user_getClientFileInfoById_args other) { + public int compareTo(getClientFileInfoById_args other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - user_getClientFileInfoById_args typedOther = (user_getClientFileInfoById_args)other; + getClientFileInfoById_args typedOther = (getClientFileInfoById_args)other; lastComparison = Boolean.valueOf(isSetFileId()).compareTo(typedOther.isSetFileId()); if (lastComparison != 0) { @@ -15568,48 +23449,16 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // FILE_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.fileId = iprot.readI32(); - setFileIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(FILE_ID_FIELD_DESC); - oprot.writeI32(this.fileId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override public String toString() { - StringBuilder sb = new StringBuilder("user_getClientFileInfoById_args("); + StringBuilder sb = new StringBuilder("getClientFileInfoById_args("); boolean first = true; sb.append("fileId:"); @@ -15621,6 +23470,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -15634,21 +23484,109 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class getClientFileInfoById_argsStandardSchemeFactory implements SchemeFactory { + public getClientFileInfoById_argsStandardScheme getScheme() { + return new getClientFileInfoById_argsStandardScheme(); + } + } + + private static class getClientFileInfoById_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getClientFileInfoById_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // FILE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getClientFileInfoById_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(FILE_ID_FIELD_DESC); + oprot.writeI32(struct.fileId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getClientFileInfoById_argsTupleSchemeFactory implements SchemeFactory { + public getClientFileInfoById_argsTupleScheme getScheme() { + return new getClientFileInfoById_argsTupleScheme(); + } + } + + private static class getClientFileInfoById_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getClientFileInfoById_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetFileId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetFileId()) { + oprot.writeI32(struct.fileId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getClientFileInfoById_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } + } + } + } - public static class user_getClientFileInfoById_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getClientFileInfoById_result"); + public static class getClientFileInfoById_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getClientFileInfoById_result"); private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getClientFileInfoById_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getClientFileInfoById_resultTupleSchemeFactory()); + } + public ClientFileInfo success; // required public FileDoesNotExistException e; // required @@ -15714,7 +23652,6 @@ public String getFieldName() { } // 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); @@ -15723,13 +23660,13 @@ public String getFieldName() { tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); metaDataMap = Collections.unmodifiableMap(tmpMap); - org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(user_getClientFileInfoById_result.class, metaDataMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(getClientFileInfoById_result.class, metaDataMap); } - public user_getClientFileInfoById_result() { + public getClientFileInfoById_result() { } - public user_getClientFileInfoById_result( + public getClientFileInfoById_result( ClientFileInfo success, FileDoesNotExistException e) { @@ -15741,7 +23678,7 @@ public user_getClientFileInfoById_result( /** * Performs a deep copy on other. */ - public user_getClientFileInfoById_result(user_getClientFileInfoById_result other) { + public getClientFileInfoById_result(getClientFileInfoById_result other) { if (other.isSetSuccess()) { this.success = new ClientFileInfo(other.success); } @@ -15750,8 +23687,8 @@ public user_getClientFileInfoById_result(user_getClientFileInfoById_result other } } - public user_getClientFileInfoById_result deepCopy() { - return new user_getClientFileInfoById_result(this); + public getClientFileInfoById_result deepCopy() { + return new getClientFileInfoById_result(this); } @Override @@ -15764,7 +23701,7 @@ public ClientFileInfo getSuccess() { return this.success; } - public user_getClientFileInfoById_result setSuccess(ClientFileInfo success) { + public getClientFileInfoById_result setSuccess(ClientFileInfo success) { this.success = success; return this; } @@ -15788,7 +23725,7 @@ public FileDoesNotExistException getE() { return this.e; } - public user_getClientFileInfoById_result setE(FileDoesNotExistException e) { + public getClientFileInfoById_result setE(FileDoesNotExistException e) { this.e = e; return this; } @@ -15860,12 +23797,12 @@ public boolean isSet(_Fields field) { public boolean equals(Object that) { if (that == null) return false; - if (that instanceof user_getClientFileInfoById_result) - return this.equals((user_getClientFileInfoById_result)that); + if (that instanceof getClientFileInfoById_result) + return this.equals((getClientFileInfoById_result)that); return false; } - public boolean equals(user_getClientFileInfoById_result that) { + public boolean equals(getClientFileInfoById_result that) { if (that == null) return false; @@ -15895,13 +23832,13 @@ public int hashCode() { return 0; } - public int compareTo(user_getClientFileInfoById_result other) { + public int compareTo(getClientFileInfoById_result other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; - user_getClientFileInfoById_result typedOther = (user_getClientFileInfoById_result)other; + getClientFileInfoById_result typedOther = (getClientFileInfoById_result)other; lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); if (lastComparison != 0) { @@ -15931,61 +23868,16 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new ClientFileInfo(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new FileDoesNotExistException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { - StringBuilder sb = new StringBuilder("user_getClientFileInfoById_result("); + StringBuilder sb = new StringBuilder("getClientFileInfoById_result("); boolean first = true; sb.append("success:"); @@ -16009,6 +23901,10 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -16027,6 +23923,117 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class getClientFileInfoById_resultStandardSchemeFactory implements SchemeFactory { + public getClientFileInfoById_resultStandardScheme getScheme() { + return new getClientFileInfoById_resultStandardScheme(); + } + } + + private static class getClientFileInfoById_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getClientFileInfoById_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new ClientFileInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getClientFileInfoById_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getClientFileInfoById_resultTupleSchemeFactory implements SchemeFactory { + public getClientFileInfoById_resultTupleScheme getScheme() { + return new getClientFileInfoById_resultTupleScheme(); + } + } + + private static class getClientFileInfoById_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getClientFileInfoById_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getClientFileInfoById_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new ClientFileInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + } public static class user_getClientFileInfoByPath_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -16034,6 +24041,12 @@ public static class user_getClientFileInfoByPath_args implements org.apache.thri 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getClientFileInfoByPath_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getClientFileInfoByPath_argsTupleSchemeFactory()); + } + public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -16095,7 +24108,6 @@ public String getFieldName() { } // 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); @@ -16248,44 +24260,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -16306,6 +24285,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -16324,6 +24304,90 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getClientFileInfoByPath_argsStandardSchemeFactory implements SchemeFactory { + public user_getClientFileInfoByPath_argsStandardScheme getScheme() { + return new user_getClientFileInfoByPath_argsStandardScheme(); + } + } + + private static class user_getClientFileInfoByPath_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientFileInfoByPath_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientFileInfoByPath_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getClientFileInfoByPath_argsTupleSchemeFactory implements SchemeFactory { + public user_getClientFileInfoByPath_argsTupleScheme getScheme() { + return new user_getClientFileInfoByPath_argsTupleScheme(); + } + } + + private static class user_getClientFileInfoByPath_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientFileInfoByPath_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientFileInfoByPath_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + } + } + } public static class user_getClientFileInfoByPath_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -16333,6 +24397,12 @@ public static class user_getClientFileInfoByPath_result implements org.apache.th private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getClientFileInfoByPath_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getClientFileInfoByPath_resultTupleSchemeFactory()); + } + public ClientFileInfo success; // required public FileDoesNotExistException eF; // required public InvalidPathException eI; // required @@ -16402,7 +24472,6 @@ public String getFieldName() { } // 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); @@ -16683,69 +24752,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new ClientFileInfo(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E_F - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eF = new FileDoesNotExistException(); - this.eF.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_I - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eI = new InvalidPathException(); - this.eI.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEF()) { - oprot.writeFieldBegin(E_F_FIELD_DESC); - this.eF.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEI()) { - oprot.writeFieldBegin(E_I_FIELD_DESC); - this.eI.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -16781,6 +24793,10 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -16799,6 +24815,142 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getClientFileInfoByPath_resultStandardSchemeFactory implements SchemeFactory { + public user_getClientFileInfoByPath_resultStandardScheme getScheme() { + return new user_getClientFileInfoByPath_resultStandardScheme(); + } + } + + private static class user_getClientFileInfoByPath_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientFileInfoByPath_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new ClientFileInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_F + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientFileInfoByPath_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eF != null) { + oprot.writeFieldBegin(E_F_FIELD_DESC); + struct.eF.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getClientFileInfoByPath_resultTupleSchemeFactory implements SchemeFactory { + public user_getClientFileInfoByPath_resultTupleScheme getScheme() { + return new user_getClientFileInfoByPath_resultTupleScheme(); + } + } + + private static class user_getClientFileInfoByPath_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientFileInfoByPath_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEF()) { + optionals.set(1); + } + if (struct.isSetEI()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetEF()) { + struct.eF.write(oprot); + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientFileInfoByPath_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = new ClientFileInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } + if (incoming.get(2)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + } + } + } public static class user_getClientBlockInfo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -16806,6 +24958,12 @@ public static class user_getClientBlockInfo_args implements org.apache.thrift.TB private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getClientBlockInfo_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getClientBlockInfo_argsTupleSchemeFactory()); + } + public long blockId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -16868,8 +25026,7 @@ public String getFieldName() { // isset id assignments private static final int __BLOCKID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -16894,8 +25051,7 @@ public user_getClientBlockInfo_args( * Performs a deep copy on other. */ public user_getClientBlockInfo_args(user_getClientBlockInfo_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.blockId = other.blockId; } @@ -16920,16 +25076,16 @@ public user_getClientBlockInfo_args setBlockId(long blockId) { } public void unsetBlockId() { - __isset_bit_vector.clear(__BLOCKID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID); } /** Returns true if field blockId is set (has been assigned a value) and false otherwise */ public boolean isSetBlockId() { - return __isset_bit_vector.get(__BLOCKID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID); } public void setBlockIdIsSet(boolean value) { - __isset_bit_vector.set(__BLOCKID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -17023,43 +25179,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // BLOCK_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.blockId = iprot.readI64(); - setBlockIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); - oprot.writeI64(this.blockId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -17076,6 +25200,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -17089,13 +25214,95 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_getClientBlockInfo_argsStandardSchemeFactory implements SchemeFactory { + public user_getClientBlockInfo_argsStandardScheme getScheme() { + return new user_getClientBlockInfo_argsStandardScheme(); + } + } + + private static class user_getClientBlockInfo_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientBlockInfo_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // BLOCK_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientBlockInfo_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); + oprot.writeI64(struct.blockId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getClientBlockInfo_argsTupleSchemeFactory implements SchemeFactory { + public user_getClientBlockInfo_argsTupleScheme getScheme() { + return new user_getClientBlockInfo_argsTupleScheme(); + } + } + + private static class user_getClientBlockInfo_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientBlockInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetBlockId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetBlockId()) { + oprot.writeI64(struct.blockId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientBlockInfo_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } + } + } + } public static class user_getClientBlockInfo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -17105,6 +25312,12 @@ public static class user_getClientBlockInfo_result implements org.apache.thrift. private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_B_FIELD_DESC = new org.apache.thrift.protocol.TField("eB", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getClientBlockInfo_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getClientBlockInfo_resultTupleSchemeFactory()); + } + public ClientBlockInfo success; // required public FileDoesNotExistException eF; // required public BlockInfoException eB; // required @@ -17174,7 +25387,6 @@ public String getFieldName() { } // 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); @@ -17455,69 +25667,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new ClientBlockInfo(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E_F - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eF = new FileDoesNotExistException(); - this.eF.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_B - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eB = new BlockInfoException(); - this.eB.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEF()) { - oprot.writeFieldBegin(E_F_FIELD_DESC); - this.eF.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEB()) { - oprot.writeFieldBegin(E_B_FIELD_DESC); - this.eB.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -17553,6 +25708,10 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -17571,6 +25730,142 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getClientBlockInfo_resultStandardSchemeFactory implements SchemeFactory { + public user_getClientBlockInfo_resultStandardScheme getScheme() { + return new user_getClientBlockInfo_resultStandardScheme(); + } + } + + private static class user_getClientBlockInfo_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientBlockInfo_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new ClientBlockInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_F + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_B + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientBlockInfo_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eF != null) { + oprot.writeFieldBegin(E_F_FIELD_DESC); + struct.eF.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eB != null) { + oprot.writeFieldBegin(E_B_FIELD_DESC); + struct.eB.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getClientBlockInfo_resultTupleSchemeFactory implements SchemeFactory { + public user_getClientBlockInfo_resultTupleScheme getScheme() { + return new user_getClientBlockInfo_resultTupleScheme(); + } + } + + private static class user_getClientBlockInfo_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientBlockInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEF()) { + optionals.set(1); + } + if (struct.isSetEB()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetEF()) { + struct.eF.write(oprot); + } + if (struct.isSetEB()) { + struct.eB.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientBlockInfo_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = new ClientBlockInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } + if (incoming.get(2)) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } + } + } + } public static class user_getFileBlocksById_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -17578,6 +25873,12 @@ public static class user_getFileBlocksById_args implements org.apache.thrift.TBa private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getFileBlocksById_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getFileBlocksById_argsTupleSchemeFactory()); + } + public int fileId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -17640,8 +25941,7 @@ public String getFieldName() { // isset id assignments private static final int __FILEID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -17666,8 +25966,7 @@ public user_getFileBlocksById_args( * Performs a deep copy on other. */ public user_getFileBlocksById_args(user_getFileBlocksById_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; } @@ -17692,16 +25991,16 @@ public user_getFileBlocksById_args setFileId(int fileId) { } public void unsetFileId() { - __isset_bit_vector.clear(__FILEID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { - return __isset_bit_vector.get(__FILEID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { - __isset_bit_vector.set(__FILEID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -17795,43 +26094,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // FILE_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.fileId = iprot.readI32(); - setFileIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(FILE_ID_FIELD_DESC); - oprot.writeI32(this.fileId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -17848,6 +26115,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -17861,13 +26129,95 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_getFileBlocksById_argsStandardSchemeFactory implements SchemeFactory { + public user_getFileBlocksById_argsStandardScheme getScheme() { + return new user_getFileBlocksById_argsStandardScheme(); + } + } + + private static class user_getFileBlocksById_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getFileBlocksById_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // FILE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getFileBlocksById_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(FILE_ID_FIELD_DESC); + oprot.writeI32(struct.fileId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getFileBlocksById_argsTupleSchemeFactory implements SchemeFactory { + public user_getFileBlocksById_argsTupleScheme getScheme() { + return new user_getFileBlocksById_argsTupleScheme(); + } + } + + private static class user_getFileBlocksById_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocksById_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetFileId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetFileId()) { + oprot.writeI32(struct.fileId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocksById_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } + } + } + } public static class user_getFileBlocksById_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -17876,6 +26226,12 @@ public static class user_getFileBlocksById_result implements org.apache.thrift.T private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.LIST, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getFileBlocksById_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getFileBlocksById_resultTupleSchemeFactory()); + } + public List success; // required public FileDoesNotExistException e; // required @@ -17941,7 +26297,6 @@ public String getFieldName() { } // 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); @@ -18178,74 +26533,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list36 = iprot.readListBegin(); - this.success = new ArrayList(_list36.size); - for (int _i37 = 0; _i37 < _list36.size; ++_i37) - { - ClientBlockInfo _elem38; // required - _elem38 = new ClientBlockInfo(); - _elem38.read(iprot); - this.success.add(_elem38); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new FileDoesNotExistException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (ClientBlockInfo _iter39 : this.success) - { - _iter39.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -18273,6 +26566,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -18291,6 +26585,149 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getFileBlocksById_resultStandardSchemeFactory implements SchemeFactory { + public user_getFileBlocksById_resultStandardScheme getScheme() { + return new user_getFileBlocksById_resultStandardScheme(); + } + } + + private static class user_getFileBlocksById_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getFileBlocksById_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list120 = iprot.readListBegin(); + struct.success = new ArrayList(_list120.size); + for (int _i121 = 0; _i121 < _list120.size; ++_i121) + { + ClientBlockInfo _elem122; // required + _elem122 = new ClientBlockInfo(); + _elem122.read(iprot); + struct.success.add(_elem122); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getFileBlocksById_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (ClientBlockInfo _iter123 : struct.success) + { + _iter123.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getFileBlocksById_resultTupleSchemeFactory implements SchemeFactory { + public user_getFileBlocksById_resultTupleScheme getScheme() { + return new user_getFileBlocksById_resultTupleScheme(); + } + } + + private static class user_getFileBlocksById_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocksById_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (ClientBlockInfo _iter124 : struct.success) + { + _iter124.write(oprot); + } + } + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocksById_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list125 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list125.size); + for (int _i126 = 0; _i126 < _list125.size; ++_i126) + { + ClientBlockInfo _elem127; // required + _elem127 = new ClientBlockInfo(); + _elem127.read(iprot); + struct.success.add(_elem127); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + } public static class user_getFileBlocksByPath_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -18298,6 +26735,12 @@ public static class user_getFileBlocksByPath_args implements org.apache.thrift.T 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getFileBlocksByPath_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getFileBlocksByPath_argsTupleSchemeFactory()); + } + public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -18359,7 +26802,6 @@ public String getFieldName() { } // 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); @@ -18512,44 +26954,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -18570,6 +26979,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -18588,6 +26998,90 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getFileBlocksByPath_argsStandardSchemeFactory implements SchemeFactory { + public user_getFileBlocksByPath_argsStandardScheme getScheme() { + return new user_getFileBlocksByPath_argsStandardScheme(); + } + } + + private static class user_getFileBlocksByPath_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getFileBlocksByPath_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getFileBlocksByPath_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getFileBlocksByPath_argsTupleSchemeFactory implements SchemeFactory { + public user_getFileBlocksByPath_argsTupleScheme getScheme() { + return new user_getFileBlocksByPath_argsTupleScheme(); + } + } + + private static class user_getFileBlocksByPath_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocksByPath_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocksByPath_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + } + } + } public static class user_getFileBlocksByPath_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -18597,6 +27091,12 @@ public static class user_getFileBlocksByPath_result implements org.apache.thrift private static final org.apache.thrift.protocol.TField E_F_FIELD_DESC = new org.apache.thrift.protocol.TField("eF", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getFileBlocksByPath_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getFileBlocksByPath_resultTupleSchemeFactory()); + } + public List success; // required public FileDoesNotExistException eF; // required public InvalidPathException eI; // required @@ -18666,7 +27166,6 @@ public String getFieldName() { } // 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); @@ -18967,86 +27466,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list40 = iprot.readListBegin(); - this.success = new ArrayList(_list40.size); - for (int _i41 = 0; _i41 < _list40.size; ++_i41) - { - ClientBlockInfo _elem42; // required - _elem42 = new ClientBlockInfo(); - _elem42.read(iprot); - this.success.add(_elem42); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E_F - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eF = new FileDoesNotExistException(); - this.eF.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_I - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eI = new InvalidPathException(); - this.eI.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, this.success.size())); - for (ClientBlockInfo _iter43 : this.success) - { - _iter43.write(oprot); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetEF()) { - oprot.writeFieldBegin(E_F_FIELD_DESC); - this.eF.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEI()) { - oprot.writeFieldBegin(E_I_FIELD_DESC); - this.eI.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -19082,6 +27507,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -19100,6 +27526,174 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getFileBlocksByPath_resultStandardSchemeFactory implements SchemeFactory { + public user_getFileBlocksByPath_resultStandardScheme getScheme() { + return new user_getFileBlocksByPath_resultStandardScheme(); + } + } + + private static class user_getFileBlocksByPath_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getFileBlocksByPath_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list128 = iprot.readListBegin(); + struct.success = new ArrayList(_list128.size); + for (int _i129 = 0; _i129 < _list128.size; ++_i129) + { + ClientBlockInfo _elem130; // required + _elem130 = new ClientBlockInfo(); + _elem130.read(iprot); + struct.success.add(_elem130); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_F + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getFileBlocksByPath_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, struct.success.size())); + for (ClientBlockInfo _iter131 : struct.success) + { + _iter131.write(oprot); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.eF != null) { + oprot.writeFieldBegin(E_F_FIELD_DESC); + struct.eF.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getFileBlocksByPath_resultTupleSchemeFactory implements SchemeFactory { + public user_getFileBlocksByPath_resultTupleScheme getScheme() { + return new user_getFileBlocksByPath_resultTupleScheme(); + } + } + + private static class user_getFileBlocksByPath_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocksByPath_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEF()) { + optionals.set(1); + } + if (struct.isSetEI()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (ClientBlockInfo _iter132 : struct.success) + { + _iter132.write(oprot); + } + } + } + if (struct.isSetEF()) { + struct.eF.write(oprot); + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getFileBlocksByPath_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list133 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRUCT, iprot.readI32()); + struct.success = new ArrayList(_list133.size); + for (int _i134 = 0; _i134 < _list133.size; ++_i134) + { + ClientBlockInfo _elem135; // required + _elem135 = new ClientBlockInfo(); + _elem135.read(iprot); + struct.success.add(_elem135); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } + if (incoming.get(2)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + } + } + } public static class user_listFiles_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -19108,6 +27702,12 @@ public static class user_listFiles_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_listFiles_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_listFiles_argsTupleSchemeFactory()); + } + public String path; // required public boolean recursive; // required @@ -19174,8 +27774,7 @@ public String getFieldName() { // isset id assignments private static final int __RECURSIVE_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -19204,8 +27803,7 @@ public user_listFiles_args( * Performs a deep copy on other. */ public user_listFiles_args(user_listFiles_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetPath()) { this.path = other.path; } @@ -19258,16 +27856,16 @@ public user_listFiles_args setRecursive(boolean recursive) { } public void unsetRecursive() { - __isset_bit_vector.clear(__RECURSIVE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { - return __isset_bit_vector.get(__RECURSIVE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { - __isset_bit_vector.set(__RECURSIVE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -19393,55 +27991,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // RECURSIVE - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.recursive = iprot.readBool(); - setRecursiveIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); - oprot.writeBool(this.recursive); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -19464,25 +28018,131 @@ public String toString() { return sb.toString(); } - public void validate() throws org.apache.thrift.TException { - // check for required fields + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class user_listFiles_argsStandardSchemeFactory implements SchemeFactory { + public user_listFiles_argsStandardScheme getScheme() { + return new user_listFiles_argsStandardScheme(); + } + } + + private static class user_listFiles_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_listFiles_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // RECURSIVE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.recursive = iprot.readBool(); + struct.setRecursiveIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_listFiles_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); + oprot.writeBool(struct.recursive); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); + private static class user_listFiles_argsTupleSchemeFactory implements SchemeFactory { + public user_listFiles_argsTupleScheme getScheme() { + return new user_listFiles_argsTupleScheme(); } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); + private static class user_listFiles_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_listFiles_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + if (struct.isSetRecursive()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + if (struct.isSetRecursive()) { + oprot.writeBool(struct.recursive); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_listFiles_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + if (incoming.get(1)) { + struct.recursive = iprot.readBool(); + struct.setRecursiveIsSet(true); + } } } @@ -19495,6 +28155,12 @@ public static class user_listFiles_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_listFiles_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_listFiles_resultTupleSchemeFactory()); + } + public List success; // required public FileDoesNotExistException eF; // required public InvalidPathException eI; // required @@ -19564,7 +28230,6 @@ public String getFieldName() { } // 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); @@ -19865,85 +28530,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list44 = iprot.readListBegin(); - this.success = new ArrayList(_list44.size); - for (int _i45 = 0; _i45 < _list44.size; ++_i45) - { - int _elem46; // required - _elem46 = iprot.readI32(); - this.success.add(_elem46); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E_F - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eF = new FileDoesNotExistException(); - this.eF.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_I - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eI = new InvalidPathException(); - this.eI.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, this.success.size())); - for (int _iter47 : this.success) - { - oprot.writeI32(_iter47); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetEF()) { - oprot.writeFieldBegin(E_F_FIELD_DESC); - this.eF.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEI()) { - oprot.writeFieldBegin(E_I_FIELD_DESC); - this.eI.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -19979,6 +28571,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -19997,6 +28590,172 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_listFiles_resultStandardSchemeFactory implements SchemeFactory { + public user_listFiles_resultStandardScheme getScheme() { + return new user_listFiles_resultStandardScheme(); + } + } + + private static class user_listFiles_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_listFiles_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list136 = iprot.readListBegin(); + struct.success = new ArrayList(_list136.size); + for (int _i137 = 0; _i137 < _list136.size; ++_i137) + { + int _elem138; // required + _elem138 = iprot.readI32(); + struct.success.add(_elem138); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_F + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_listFiles_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, struct.success.size())); + for (int _iter139 : struct.success) + { + oprot.writeI32(_iter139); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.eF != null) { + oprot.writeFieldBegin(E_F_FIELD_DESC); + struct.eF.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_listFiles_resultTupleSchemeFactory implements SchemeFactory { + public user_listFiles_resultTupleScheme getScheme() { + return new user_listFiles_resultTupleScheme(); + } + } + + private static class user_listFiles_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_listFiles_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEF()) { + optionals.set(1); + } + if (struct.isSetEI()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (int _iter140 : struct.success) + { + oprot.writeI32(_iter140); + } + } + } + if (struct.isSetEF()) { + struct.eF.write(oprot); + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_listFiles_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list141 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.I32, iprot.readI32()); + struct.success = new ArrayList(_list141.size); + for (int _i142 = 0; _i142 < _list141.size; ++_i142) + { + int _elem143; // required + _elem143 = iprot.readI32(); + struct.success.add(_elem143); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } + if (incoming.get(2)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + } + } + } public static class user_ls_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -20005,6 +28764,12 @@ public static class user_ls_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_ls_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_ls_argsTupleSchemeFactory()); + } + public String path; // required public boolean recursive; // required @@ -20071,8 +28836,7 @@ public String getFieldName() { // isset id assignments private static final int __RECURSIVE_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -20101,8 +28865,7 @@ public user_ls_args( * Performs a deep copy on other. */ public user_ls_args(user_ls_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetPath()) { this.path = other.path; } @@ -20155,16 +28918,16 @@ public user_ls_args setRecursive(boolean recursive) { } public void unsetRecursive() { - __isset_bit_vector.clear(__RECURSIVE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { - return __isset_bit_vector.get(__RECURSIVE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { - __isset_bit_vector.set(__RECURSIVE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -20290,55 +29053,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // RECURSIVE - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.recursive = iprot.readBool(); - setRecursiveIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); - oprot.writeBool(this.recursive); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -20363,6 +29082,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -20376,13 +29096,118 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_ls_argsStandardSchemeFactory implements SchemeFactory { + public user_ls_argsStandardScheme getScheme() { + return new user_ls_argsStandardScheme(); + } + } + + private static class user_ls_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_ls_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // RECURSIVE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.recursive = iprot.readBool(); + struct.setRecursiveIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_ls_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); + oprot.writeBool(struct.recursive); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_ls_argsTupleSchemeFactory implements SchemeFactory { + public user_ls_argsTupleScheme getScheme() { + return new user_ls_argsTupleScheme(); + } + } + + private static class user_ls_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_ls_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + if (struct.isSetRecursive()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + if (struct.isSetRecursive()) { + oprot.writeBool(struct.recursive); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_ls_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + if (incoming.get(1)) { + struct.recursive = iprot.readBool(); + struct.setRecursiveIsSet(true); + } + } + } + } public static class user_ls_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -20392,6 +29217,12 @@ public static class user_ls_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_ls_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_ls_resultTupleSchemeFactory()); + } + public List success; // required public FileDoesNotExistException eF; // required public InvalidPathException eI; // required @@ -20461,7 +29292,6 @@ public String getFieldName() { } // 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); @@ -20762,85 +29592,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.LIST) { - { - org.apache.thrift.protocol.TList _list48 = iprot.readListBegin(); - this.success = new ArrayList(_list48.size); - for (int _i49 = 0; _i49 < _list48.size; ++_i49) - { - String _elem50; // required - _elem50 = iprot.readString(); - this.success.add(_elem50); - } - iprot.readListEnd(); - } - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E_F - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eF = new FileDoesNotExistException(); - this.eF.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_I - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eI = new InvalidPathException(); - this.eI.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - { - oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, this.success.size())); - for (String _iter51 : this.success) - { - oprot.writeString(_iter51); - } - oprot.writeListEnd(); - } - oprot.writeFieldEnd(); - } else if (this.isSetEF()) { - oprot.writeFieldBegin(E_F_FIELD_DESC); - this.eF.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEI()) { - oprot.writeFieldBegin(E_I_FIELD_DESC); - this.eI.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -20876,6 +29633,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -20894,6 +29652,172 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_ls_resultStandardSchemeFactory implements SchemeFactory { + public user_ls_resultStandardScheme getScheme() { + return new user_ls_resultStandardScheme(); + } + } + + private static class user_ls_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_ls_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.LIST) { + { + org.apache.thrift.protocol.TList _list144 = iprot.readListBegin(); + struct.success = new ArrayList(_list144.size); + for (int _i145 = 0; _i145 < _list144.size; ++_i145) + { + String _elem146; // required + _elem146 = iprot.readString(); + struct.success.add(_elem146); + } + iprot.readListEnd(); + } + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_F + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_ls_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + { + oprot.writeListBegin(new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, struct.success.size())); + for (String _iter147 : struct.success) + { + oprot.writeString(_iter147); + } + oprot.writeListEnd(); + } + oprot.writeFieldEnd(); + } + if (struct.eF != null) { + oprot.writeFieldBegin(E_F_FIELD_DESC); + struct.eF.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_ls_resultTupleSchemeFactory implements SchemeFactory { + public user_ls_resultTupleScheme getScheme() { + return new user_ls_resultTupleScheme(); + } + } + + private static class user_ls_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_ls_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetEF()) { + optionals.set(1); + } + if (struct.isSetEI()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + { + oprot.writeI32(struct.success.size()); + for (String _iter148 : struct.success) + { + oprot.writeString(_iter148); + } + } + } + if (struct.isSetEF()) { + struct.eF.write(oprot); + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_ls_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + { + org.apache.thrift.protocol.TList _list149 = new org.apache.thrift.protocol.TList(org.apache.thrift.protocol.TType.STRING, iprot.readI32()); + struct.success = new ArrayList(_list149.size); + for (int _i150 = 0; _i150 < _list149.size; ++_i150) + { + String _elem151; // required + _elem151 = iprot.readString(); + struct.success.add(_elem151); + } + } + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } + if (incoming.get(2)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + } + } + } public static class user_deleteById_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -20902,6 +29826,12 @@ public static class user_deleteById_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_deleteById_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_deleteById_argsTupleSchemeFactory()); + } + public int fileId; // required public boolean recursive; // required @@ -20969,8 +29899,7 @@ public String getFieldName() { // isset id assignments private static final int __FILEID_ISSET_ID = 0; private static final int __RECURSIVE_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private byte __isset_bitfield = 0; 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); @@ -21000,8 +29929,7 @@ public user_deleteById_args( * Performs a deep copy on other. */ public user_deleteById_args(user_deleteById_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; this.recursive = other.recursive; } @@ -21029,16 +29957,16 @@ public user_deleteById_args setFileId(int fileId) { } public void unsetFileId() { - __isset_bit_vector.clear(__FILEID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { - return __isset_bit_vector.get(__FILEID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { - __isset_bit_vector.set(__FILEID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public boolean isRecursive() { @@ -21052,16 +29980,16 @@ public user_deleteById_args setRecursive(boolean recursive) { } public void unsetRecursive() { - __isset_bit_vector.clear(__RECURSIVE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { - return __isset_bit_vector.get(__RECURSIVE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { - __isset_bit_vector.set(__RECURSIVE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -21187,54 +30115,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // FILE_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.fileId = iprot.readI32(); - setFileIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // RECURSIVE - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.recursive = iprot.readBool(); - setRecursiveIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(FILE_ID_FIELD_DESC); - oprot.writeI32(this.fileId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); - oprot.writeBool(this.recursive); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -21255,6 +30140,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -21268,13 +30154,116 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_deleteById_argsStandardSchemeFactory implements SchemeFactory { + public user_deleteById_argsStandardScheme getScheme() { + return new user_deleteById_argsStandardScheme(); + } + } + + private static class user_deleteById_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_deleteById_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // FILE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // RECURSIVE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.recursive = iprot.readBool(); + struct.setRecursiveIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_deleteById_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(FILE_ID_FIELD_DESC); + oprot.writeI32(struct.fileId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); + oprot.writeBool(struct.recursive); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_deleteById_argsTupleSchemeFactory implements SchemeFactory { + public user_deleteById_argsTupleScheme getScheme() { + return new user_deleteById_argsTupleScheme(); + } + } + + private static class user_deleteById_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_deleteById_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetFileId()) { + optionals.set(0); + } + if (struct.isSetRecursive()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetFileId()) { + oprot.writeI32(struct.fileId); + } + if (struct.isSetRecursive()) { + oprot.writeBool(struct.recursive); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_deleteById_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } + if (incoming.get(1)) { + struct.recursive = iprot.readBool(); + struct.setRecursiveIsSet(true); + } + } + } + } public static class user_deleteById_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -21283,6 +30272,12 @@ public static class user_deleteById_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_deleteById_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_deleteById_resultTupleSchemeFactory()); + } + public boolean success; // required public TachyonException e; // required @@ -21349,8 +30344,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -21379,8 +30373,7 @@ public user_deleteById_result( * Performs a deep copy on other. */ public user_deleteById_result(user_deleteById_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new TachyonException(other.e); @@ -21409,16 +30402,16 @@ public user_deleteById_result setSuccess(boolean success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public TachyonException getE() { @@ -21568,57 +30561,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.success = iprot.readBool(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new TachyonException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -21642,6 +30590,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -21654,12 +30603,123 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_deleteById_resultStandardSchemeFactory implements SchemeFactory { + public user_deleteById_resultStandardScheme getScheme() { + return new user_deleteById_resultStandardScheme(); + } + } + + private static class user_deleteById_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_deleteById_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new TachyonException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_deleteById_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_deleteById_resultTupleSchemeFactory implements SchemeFactory { + public user_deleteById_resultTupleScheme getScheme() { + return new user_deleteById_resultTupleScheme(); + } + } + + private static class user_deleteById_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_deleteById_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_deleteById_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new TachyonException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + } public static class user_deleteByPath_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -21668,6 +30728,12 @@ public static class user_deleteByPath_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_deleteByPath_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_deleteByPath_argsTupleSchemeFactory()); + } + public String path; // required public boolean recursive; // required @@ -21734,8 +30800,7 @@ public String getFieldName() { // isset id assignments private static final int __RECURSIVE_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -21764,8 +30829,7 @@ public user_deleteByPath_args( * Performs a deep copy on other. */ public user_deleteByPath_args(user_deleteByPath_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetPath()) { this.path = other.path; } @@ -21818,16 +30882,16 @@ public user_deleteByPath_args setRecursive(boolean recursive) { } public void unsetRecursive() { - __isset_bit_vector.clear(__RECURSIVE_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } /** Returns true if field recursive is set (has been assigned a value) and false otherwise */ public boolean isSetRecursive() { - return __isset_bit_vector.get(__RECURSIVE_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __RECURSIVE_ISSET_ID); } public void setRecursiveIsSet(boolean value) { - __isset_bit_vector.set(__RECURSIVE_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RECURSIVE_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -21953,55 +31017,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // RECURSIVE - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.recursive = iprot.readBool(); - setRecursiveIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); - oprot.writeBool(this.recursive); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -22026,6 +31046,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -22039,13 +31060,118 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_deleteByPath_argsStandardSchemeFactory implements SchemeFactory { + public user_deleteByPath_argsStandardScheme getScheme() { + return new user_deleteByPath_argsStandardScheme(); + } + } + + private static class user_deleteByPath_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_deleteByPath_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // RECURSIVE + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.recursive = iprot.readBool(); + struct.setRecursiveIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_deleteByPath_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(RECURSIVE_FIELD_DESC); + oprot.writeBool(struct.recursive); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_deleteByPath_argsTupleSchemeFactory implements SchemeFactory { + public user_deleteByPath_argsTupleScheme getScheme() { + return new user_deleteByPath_argsTupleScheme(); + } + } + + private static class user_deleteByPath_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_deleteByPath_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + if (struct.isSetRecursive()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + if (struct.isSetRecursive()) { + oprot.writeBool(struct.recursive); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_deleteByPath_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + if (incoming.get(1)) { + struct.recursive = iprot.readBool(); + struct.setRecursiveIsSet(true); + } + } + } + } public static class user_deleteByPath_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -22054,6 +31180,12 @@ public static class user_deleteByPath_result implements org.apache.thrift.TBase< private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_deleteByPath_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_deleteByPath_resultTupleSchemeFactory()); + } + public boolean success; // required public TachyonException e; // required @@ -22120,8 +31252,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -22150,8 +31281,7 @@ public user_deleteByPath_result( * Performs a deep copy on other. */ public user_deleteByPath_result(user_deleteByPath_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new TachyonException(other.e); @@ -22180,16 +31310,16 @@ public user_deleteByPath_result setSuccess(boolean success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public TachyonException getE() { @@ -22339,57 +31469,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.success = iprot.readBool(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new TachyonException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -22413,6 +31498,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -22425,12 +31511,123 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_deleteByPath_resultStandardSchemeFactory implements SchemeFactory { + public user_deleteByPath_resultStandardScheme getScheme() { + return new user_deleteByPath_resultStandardScheme(); + } + } + + private static class user_deleteByPath_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_deleteByPath_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new TachyonException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_deleteByPath_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_deleteByPath_resultTupleSchemeFactory implements SchemeFactory { + public user_deleteByPath_resultTupleScheme getScheme() { + return new user_deleteByPath_resultTupleScheme(); + } + } + + private static class user_deleteByPath_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_deleteByPath_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_deleteByPath_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new TachyonException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + } public static class user_outOfMemoryForPinFile_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -22438,6 +31635,12 @@ public static class user_outOfMemoryForPinFile_args implements org.apache.thrift private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_outOfMemoryForPinFile_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_outOfMemoryForPinFile_argsTupleSchemeFactory()); + } + public int fileId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -22500,8 +31703,7 @@ public String getFieldName() { // isset id assignments private static final int __FILEID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -22526,8 +31728,7 @@ public user_outOfMemoryForPinFile_args( * Performs a deep copy on other. */ public user_outOfMemoryForPinFile_args(user_outOfMemoryForPinFile_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; } @@ -22552,16 +31753,16 @@ public user_outOfMemoryForPinFile_args setFileId(int fileId) { } public void unsetFileId() { - __isset_bit_vector.clear(__FILEID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { - return __isset_bit_vector.get(__FILEID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { - __isset_bit_vector.set(__FILEID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -22655,76 +31856,127 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // FILE_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.fileId = iprot.readI32(); - setFileIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("user_outOfMemoryForPinFile_args("); + boolean first = true; + + sb.append("fileId:"); + sb.append(this.fileId); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(FILE_ID_FIELD_DESC); - oprot.writeI32(this.fileId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + private static class user_outOfMemoryForPinFile_argsStandardSchemeFactory implements SchemeFactory { + public user_outOfMemoryForPinFile_argsStandardScheme getScheme() { + return new user_outOfMemoryForPinFile_argsStandardScheme(); + } } - @Override - public String toString() { - StringBuilder sb = new StringBuilder("user_outOfMemoryForPinFile_args("); - boolean first = true; + private static class user_outOfMemoryForPinFile_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_outOfMemoryForPinFile_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // FILE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_outOfMemoryForPinFile_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(FILE_ID_FIELD_DESC); + oprot.writeI32(struct.fileId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } - sb.append("fileId:"); - sb.append(this.fileId); - first = false; - sb.append(")"); - return sb.toString(); } - public void validate() throws org.apache.thrift.TException { - // check for required fields + private static class user_outOfMemoryForPinFile_argsTupleSchemeFactory implements SchemeFactory { + public user_outOfMemoryForPinFile_argsTupleScheme getScheme() { + return new user_outOfMemoryForPinFile_argsTupleScheme(); + } } - private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { - try { - write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); + private static class user_outOfMemoryForPinFile_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_outOfMemoryForPinFile_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetFileId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetFileId()) { + oprot.writeI32(struct.fileId); + } } - } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_outOfMemoryForPinFile_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } } } @@ -22734,6 +31986,12 @@ public static class user_outOfMemoryForPinFile_result implements org.apache.thri private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_outOfMemoryForPinFile_result"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_outOfMemoryForPinFile_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_outOfMemoryForPinFile_resultTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -22873,32 +32131,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } @Override public String toString() { @@ -22911,6 +32149,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -22929,6 +32168,64 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_outOfMemoryForPinFile_resultStandardSchemeFactory implements SchemeFactory { + public user_outOfMemoryForPinFile_resultStandardScheme getScheme() { + return new user_outOfMemoryForPinFile_resultStandardScheme(); + } + } + + private static class user_outOfMemoryForPinFile_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_outOfMemoryForPinFile_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_outOfMemoryForPinFile_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_outOfMemoryForPinFile_resultTupleSchemeFactory implements SchemeFactory { + public user_outOfMemoryForPinFile_resultTupleScheme getScheme() { + return new user_outOfMemoryForPinFile_resultTupleScheme(); + } + } + + private static class user_outOfMemoryForPinFile_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_outOfMemoryForPinFile_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_outOfMemoryForPinFile_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class user_rename_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -22937,6 +32234,12 @@ public static class user_rename_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_rename_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_rename_argsTupleSchemeFactory()); + } + public String srcPath; // required public String dstPath; // required @@ -23002,7 +32305,6 @@ public String getFieldName() { } // 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); @@ -23219,56 +32521,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // SRC_PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.srcPath = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // DST_PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.dstPath = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.srcPath != null) { - oprot.writeFieldBegin(SRC_PATH_FIELD_DESC); - oprot.writeString(this.srcPath); - oprot.writeFieldEnd(); - } - if (this.dstPath != null) { - oprot.writeFieldBegin(DST_PATH_FIELD_DESC); - oprot.writeString(this.dstPath); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -23297,6 +32554,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -23315,6 +32573,113 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_rename_argsStandardSchemeFactory implements SchemeFactory { + public user_rename_argsStandardScheme getScheme() { + return new user_rename_argsStandardScheme(); + } + } + + private static class user_rename_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_rename_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // SRC_PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.srcPath = iprot.readString(); + struct.setSrcPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // DST_PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.dstPath = iprot.readString(); + struct.setDstPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_rename_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.srcPath != null) { + oprot.writeFieldBegin(SRC_PATH_FIELD_DESC); + oprot.writeString(struct.srcPath); + oprot.writeFieldEnd(); + } + if (struct.dstPath != null) { + oprot.writeFieldBegin(DST_PATH_FIELD_DESC); + oprot.writeString(struct.dstPath); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_rename_argsTupleSchemeFactory implements SchemeFactory { + public user_rename_argsTupleScheme getScheme() { + return new user_rename_argsTupleScheme(); + } + } + + private static class user_rename_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_rename_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSrcPath()) { + optionals.set(0); + } + if (struct.isSetDstPath()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSrcPath()) { + oprot.writeString(struct.srcPath); + } + if (struct.isSetDstPath()) { + oprot.writeString(struct.dstPath); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_rename_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.srcPath = iprot.readString(); + struct.setSrcPathIsSet(true); + } + if (incoming.get(1)) { + struct.dstPath = iprot.readString(); + struct.setDstPathIsSet(true); + } + } + } + } public static class user_rename_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -23324,6 +32689,12 @@ public static class user_rename_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_rename_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_rename_resultTupleSchemeFactory()); + } + public FileAlreadyExistException eA; // required public FileDoesNotExistException eF; // required public InvalidPathException eI; // required @@ -23393,7 +32764,6 @@ public String getFieldName() { } // 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); @@ -23674,69 +33044,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // E_A - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eA = new FileAlreadyExistException(); - this.eA.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_F - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eF = new FileDoesNotExistException(); - this.eF.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // E_I - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eI = new InvalidPathException(); - this.eI.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetEA()) { - oprot.writeFieldBegin(E_A_FIELD_DESC); - this.eA.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEF()) { - oprot.writeFieldBegin(E_F_FIELD_DESC); - this.eF.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEI()) { - oprot.writeFieldBegin(E_I_FIELD_DESC); - this.eI.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -23772,6 +33085,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -23790,6 +33104,142 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_rename_resultStandardSchemeFactory implements SchemeFactory { + public user_rename_resultStandardScheme getScheme() { + return new user_rename_resultStandardScheme(); + } + } + + private static class user_rename_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_rename_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // E_A + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eA = new FileAlreadyExistException(); + struct.eA.read(iprot); + struct.setEAIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_F + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_rename_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.eA != null) { + oprot.writeFieldBegin(E_A_FIELD_DESC); + struct.eA.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eF != null) { + oprot.writeFieldBegin(E_F_FIELD_DESC); + struct.eF.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_rename_resultTupleSchemeFactory implements SchemeFactory { + public user_rename_resultTupleScheme getScheme() { + return new user_rename_resultTupleScheme(); + } + } + + private static class user_rename_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_rename_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetEA()) { + optionals.set(0); + } + if (struct.isSetEF()) { + optionals.set(1); + } + if (struct.isSetEI()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetEA()) { + struct.eA.write(oprot); + } + if (struct.isSetEF()) { + struct.eF.write(oprot); + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_rename_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.eA = new FileAlreadyExistException(); + struct.eA.read(iprot); + struct.setEAIsSet(true); + } + if (incoming.get(1)) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } + if (incoming.get(2)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + } + } + } public static class user_renameTo_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -23798,6 +33248,12 @@ public static class user_renameTo_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_renameTo_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_renameTo_argsTupleSchemeFactory()); + } + public int fileId; // required public String dstPath; // required @@ -23864,8 +33320,7 @@ public String getFieldName() { // isset id assignments private static final int __FILEID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -23894,8 +33349,7 @@ public user_renameTo_args( * Performs a deep copy on other. */ public user_renameTo_args(user_renameTo_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; if (other.isSetDstPath()) { this.dstPath = other.dstPath; @@ -23924,16 +33378,16 @@ public user_renameTo_args setFileId(int fileId) { } public void unsetFileId() { - __isset_bit_vector.clear(__FILEID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { - return __isset_bit_vector.get(__FILEID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { - __isset_bit_vector.set(__FILEID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public String getDstPath() { @@ -24083,55 +33537,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // FILE_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.fileId = iprot.readI32(); - setFileIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // DST_PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.dstPath = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(FILE_ID_FIELD_DESC); - oprot.writeI32(this.fileId); - oprot.writeFieldEnd(); - if (this.dstPath != null) { - oprot.writeFieldBegin(DST_PATH_FIELD_DESC); - oprot.writeString(this.dstPath); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -24156,6 +33566,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -24169,13 +33580,118 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_renameTo_argsStandardSchemeFactory implements SchemeFactory { + public user_renameTo_argsStandardScheme getScheme() { + return new user_renameTo_argsStandardScheme(); + } + } + + private static class user_renameTo_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_renameTo_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // FILE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // DST_PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.dstPath = iprot.readString(); + struct.setDstPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_renameTo_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(FILE_ID_FIELD_DESC); + oprot.writeI32(struct.fileId); + oprot.writeFieldEnd(); + if (struct.dstPath != null) { + oprot.writeFieldBegin(DST_PATH_FIELD_DESC); + oprot.writeString(struct.dstPath); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_renameTo_argsTupleSchemeFactory implements SchemeFactory { + public user_renameTo_argsTupleScheme getScheme() { + return new user_renameTo_argsTupleScheme(); + } + } + + private static class user_renameTo_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_renameTo_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetFileId()) { + optionals.set(0); + } + if (struct.isSetDstPath()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetFileId()) { + oprot.writeI32(struct.fileId); + } + if (struct.isSetDstPath()) { + oprot.writeString(struct.dstPath); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_renameTo_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } + if (incoming.get(1)) { + struct.dstPath = iprot.readString(); + struct.setDstPathIsSet(true); + } + } + } + } public static class user_renameTo_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -24185,6 +33701,12 @@ public static class user_renameTo_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_renameTo_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_renameTo_resultTupleSchemeFactory()); + } + public FileAlreadyExistException eA; // required public FileDoesNotExistException eF; // required public InvalidPathException eI; // required @@ -24254,7 +33776,6 @@ public String getFieldName() { } // 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); @@ -24531,73 +34052,16 @@ public int compareTo(user_renameTo_result other) { } public _Fields fieldForId(int fieldId) { - return _Fields.findByThriftId(fieldId); - } - - public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // E_A - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eA = new FileAlreadyExistException(); - this.eA.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_F - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eF = new FileDoesNotExistException(); - this.eF.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // E_I - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eI = new InvalidPathException(); - this.eI.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); + return _Fields.findByThriftId(fieldId); + } - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetEA()) { - oprot.writeFieldBegin(E_A_FIELD_DESC); - this.eA.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEF()) { - oprot.writeFieldBegin(E_F_FIELD_DESC); - this.eF.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEI()) { - oprot.writeFieldBegin(E_I_FIELD_DESC); - this.eI.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -24633,6 +34097,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -24651,6 +34116,142 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_renameTo_resultStandardSchemeFactory implements SchemeFactory { + public user_renameTo_resultStandardScheme getScheme() { + return new user_renameTo_resultStandardScheme(); + } + } + + private static class user_renameTo_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_renameTo_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // E_A + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eA = new FileAlreadyExistException(); + struct.eA.read(iprot); + struct.setEAIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_F + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_renameTo_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.eA != null) { + oprot.writeFieldBegin(E_A_FIELD_DESC); + struct.eA.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eF != null) { + oprot.writeFieldBegin(E_F_FIELD_DESC); + struct.eF.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_renameTo_resultTupleSchemeFactory implements SchemeFactory { + public user_renameTo_resultTupleScheme getScheme() { + return new user_renameTo_resultTupleScheme(); + } + } + + private static class user_renameTo_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_renameTo_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetEA()) { + optionals.set(0); + } + if (struct.isSetEF()) { + optionals.set(1); + } + if (struct.isSetEI()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetEA()) { + struct.eA.write(oprot); + } + if (struct.isSetEF()) { + struct.eF.write(oprot); + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_renameTo_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.eA = new FileAlreadyExistException(); + struct.eA.read(iprot); + struct.setEAIsSet(true); + } + if (incoming.get(1)) { + struct.eF = new FileDoesNotExistException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } + if (incoming.get(2)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + } + } + } public static class user_unpinFile_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -24658,6 +34259,12 @@ public static class user_unpinFile_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_unpinFile_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_unpinFile_argsTupleSchemeFactory()); + } + public int fileId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -24720,8 +34327,7 @@ public String getFieldName() { // isset id assignments private static final int __FILEID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -24746,8 +34352,7 @@ public user_unpinFile_args( * Performs a deep copy on other. */ public user_unpinFile_args(user_unpinFile_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.fileId = other.fileId; } @@ -24772,16 +34377,16 @@ public user_unpinFile_args setFileId(int fileId) { } public void unsetFileId() { - __isset_bit_vector.clear(__FILEID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { - return __isset_bit_vector.get(__FILEID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { - __isset_bit_vector.set(__FILEID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -24875,43 +34480,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // FILE_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.fileId = iprot.readI32(); - setFileIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(FILE_ID_FIELD_DESC); - oprot.writeI32(this.fileId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -24928,6 +34501,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -24941,13 +34515,95 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_unpinFile_argsStandardSchemeFactory implements SchemeFactory { + public user_unpinFile_argsStandardScheme getScheme() { + return new user_unpinFile_argsStandardScheme(); + } + } + + private static class user_unpinFile_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_unpinFile_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // FILE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_unpinFile_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(FILE_ID_FIELD_DESC); + oprot.writeI32(struct.fileId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_unpinFile_argsTupleSchemeFactory implements SchemeFactory { + public user_unpinFile_argsTupleScheme getScheme() { + return new user_unpinFile_argsTupleScheme(); + } + } + + private static class user_unpinFile_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_unpinFile_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetFileId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetFileId()) { + oprot.writeI32(struct.fileId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_unpinFile_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } + } + } + } public static class user_unpinFile_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -24955,6 +34611,12 @@ public static class user_unpinFile_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_unpinFile_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_unpinFile_resultTupleSchemeFactory()); + } + public FileDoesNotExistException e; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -25016,7 +34678,6 @@ public String getFieldName() { } // 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); @@ -25169,45 +34830,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new FileDoesNotExistException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -25227,6 +34855,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -25245,6 +34874,92 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_unpinFile_resultStandardSchemeFactory implements SchemeFactory { + public user_unpinFile_resultStandardScheme getScheme() { + return new user_unpinFile_resultStandardScheme(); + } + } + + private static class user_unpinFile_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_unpinFile_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_unpinFile_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_unpinFile_resultTupleSchemeFactory implements SchemeFactory { + public user_unpinFile_resultTupleScheme getScheme() { + return new user_unpinFile_resultTupleScheme(); + } + } + + private static class user_unpinFile_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_unpinFile_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetE()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_unpinFile_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.e = new FileDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + } public static class user_mkdir_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -25252,6 +34967,12 @@ public static class user_mkdir_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_mkdir_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_mkdir_argsTupleSchemeFactory()); + } + public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -25313,7 +35034,6 @@ public String getFieldName() { } // 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); @@ -25466,44 +35186,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -25524,6 +35211,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -25542,6 +35230,90 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_mkdir_argsStandardSchemeFactory implements SchemeFactory { + public user_mkdir_argsStandardScheme getScheme() { + return new user_mkdir_argsStandardScheme(); + } + } + + private static class user_mkdir_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_mkdir_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_mkdir_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_mkdir_argsTupleSchemeFactory implements SchemeFactory { + public user_mkdir_argsTupleScheme getScheme() { + return new user_mkdir_argsTupleScheme(); + } + } + + private static class user_mkdir_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_mkdir_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_mkdir_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + } + } + } public static class user_mkdir_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -25552,6 +35324,12 @@ public static class user_mkdir_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_mkdir_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_mkdir_resultTupleSchemeFactory()); + } + public boolean success; // required public FileAlreadyExistException eR; // required public InvalidPathException eI; // required @@ -25626,8 +35404,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -25664,8 +35441,7 @@ public user_mkdir_result( * Performs a deep copy on other. */ public user_mkdir_result(user_mkdir_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetER()) { this.eR = new FileAlreadyExistException(other.eR); @@ -25702,16 +35478,16 @@ public user_mkdir_result setSuccess(boolean success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileAlreadyExistException getER() { @@ -25973,81 +35749,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.success = iprot.readBool(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E_R - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eR = new FileAlreadyExistException(); - this.eR.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_I - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eI = new InvalidPathException(); - this.eI.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // E_T - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eT = new TachyonException(); - this.eT.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetER()) { - oprot.writeFieldBegin(E_R_FIELD_DESC); - this.eR.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEI()) { - oprot.writeFieldBegin(E_I_FIELD_DESC); - this.eI.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetET()) { - oprot.writeFieldBegin(E_T_FIELD_DESC); - this.eT.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -26087,6 +35794,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -26095,13 +35803,174 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } - } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class user_mkdir_resultStandardSchemeFactory implements SchemeFactory { + public user_mkdir_resultStandardScheme getScheme() { + return new user_mkdir_resultStandardScheme(); + } + } + + private static class user_mkdir_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_mkdir_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_R + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eR = new FileAlreadyExistException(); + struct.eR.read(iprot); + struct.setERIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // E_T + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eT = new TachyonException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_mkdir_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + if (struct.eR != null) { + oprot.writeFieldBegin(E_R_FIELD_DESC); + struct.eR.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eT != null) { + oprot.writeFieldBegin(E_T_FIELD_DESC); + struct.eT.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_mkdir_resultTupleSchemeFactory implements SchemeFactory { + public user_mkdir_resultTupleScheme getScheme() { + return new user_mkdir_resultTupleScheme(); + } + } + + private static class user_mkdir_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_mkdir_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetER()) { + optionals.set(1); + } + if (struct.isSetEI()) { + optionals.set(2); + } + if (struct.isSetET()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetER()) { + struct.eR.write(oprot); + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + if (struct.isSetET()) { + struct.eT.write(oprot); + } + } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_mkdir_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eR = new FileAlreadyExistException(); + struct.eR.read(iprot); + struct.setERIsSet(true); + } + if (incoming.get(2)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + if (incoming.get(3)) { + struct.eT = new TachyonException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } } } @@ -26114,6 +35983,12 @@ public static class user_createRawTable_args implements org.apache.thrift.TBase< private static final org.apache.thrift.protocol.TField COLUMNS_FIELD_DESC = new org.apache.thrift.protocol.TField("columns", org.apache.thrift.protocol.TType.I32, (short)2); private static final org.apache.thrift.protocol.TField METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata", org.apache.thrift.protocol.TType.STRING, (short)3); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_createRawTable_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_createRawTable_argsTupleSchemeFactory()); + } + public String path; // required public int columns; // required public ByteBuffer metadata; // required @@ -26184,8 +36059,7 @@ public String getFieldName() { // isset id assignments private static final int __COLUMNS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -26218,8 +36092,7 @@ public user_createRawTable_args( * Performs a deep copy on other. */ public user_createRawTable_args(user_createRawTable_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetPath()) { this.path = other.path; } @@ -26277,16 +36150,16 @@ public user_createRawTable_args setColumns(int columns) { } public void unsetColumns() { - __isset_bit_vector.clear(__COLUMNS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __COLUMNS_ISSET_ID); } /** Returns true if field columns is set (has been assigned a value) and false otherwise */ public boolean isSetColumns() { - return __isset_bit_vector.get(__COLUMNS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __COLUMNS_ISSET_ID); } public void setColumnsIsSet(boolean value) { - __isset_bit_vector.set(__COLUMNS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __COLUMNS_ISSET_ID, value); } public byte[] getMetadata() { @@ -26478,67 +36351,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // COLUMNS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.columns = iprot.readI32(); - setColumnsIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // METADATA - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.metadata = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(COLUMNS_FIELD_DESC); - oprot.writeI32(this.columns); - oprot.writeFieldEnd(); - if (this.metadata != null) { - oprot.writeFieldBegin(METADATA_FIELD_DESC); - oprot.writeBinary(this.metadata); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -26571,6 +36388,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -26584,13 +36402,141 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_createRawTable_argsStandardSchemeFactory implements SchemeFactory { + public user_createRawTable_argsStandardScheme getScheme() { + return new user_createRawTable_argsStandardScheme(); + } + } + + private static class user_createRawTable_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_createRawTable_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // COLUMNS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.columns = iprot.readI32(); + struct.setColumnsIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // METADATA + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.metadata = iprot.readBinary(); + struct.setMetadataIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_createRawTable_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(COLUMNS_FIELD_DESC); + oprot.writeI32(struct.columns); + oprot.writeFieldEnd(); + if (struct.metadata != null) { + oprot.writeFieldBegin(METADATA_FIELD_DESC); + oprot.writeBinary(struct.metadata); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_createRawTable_argsTupleSchemeFactory implements SchemeFactory { + public user_createRawTable_argsTupleScheme getScheme() { + return new user_createRawTable_argsTupleScheme(); + } + } + + private static class user_createRawTable_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_createRawTable_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + if (struct.isSetColumns()) { + optionals.set(1); + } + if (struct.isSetMetadata()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + if (struct.isSetColumns()) { + oprot.writeI32(struct.columns); + } + if (struct.isSetMetadata()) { + oprot.writeBinary(struct.metadata); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_createRawTable_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + if (incoming.get(1)) { + struct.columns = iprot.readI32(); + struct.setColumnsIsSet(true); + } + if (incoming.get(2)) { + struct.metadata = iprot.readBinary(); + struct.setMetadataIsSet(true); + } + } + } + } public static class user_createRawTable_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -26602,6 +36548,12 @@ public static class user_createRawTable_result implements org.apache.thrift.TBas private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)3); private static final org.apache.thrift.protocol.TField E_TA_FIELD_DESC = new org.apache.thrift.protocol.TField("eTa", org.apache.thrift.protocol.TType.STRUCT, (short)4); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_createRawTable_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_createRawTable_resultTupleSchemeFactory()); + } + public int success; // required public FileAlreadyExistException eR; // required public InvalidPathException eI; // required @@ -26680,8 +36632,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -26722,8 +36673,7 @@ public user_createRawTable_result( * Performs a deep copy on other. */ public user_createRawTable_result(user_createRawTable_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetER()) { this.eR = new FileAlreadyExistException(other.eR); @@ -26764,16 +36714,16 @@ public user_createRawTable_result setSuccess(int success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileAlreadyExistException getER() { @@ -27091,93 +37041,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.success = iprot.readI32(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E_R - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eR = new FileAlreadyExistException(); - this.eR.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_I - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eI = new InvalidPathException(); - this.eI.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // E_T - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eT = new TableColumnException(); - this.eT.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // E_TA - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eTa = new TachyonException(); - this.eTa.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetER()) { - oprot.writeFieldBegin(E_R_FIELD_DESC); - this.eR.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEI()) { - oprot.writeFieldBegin(E_I_FIELD_DESC); - this.eI.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetET()) { - oprot.writeFieldBegin(E_T_FIELD_DESC); - this.eT.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetETa()) { - oprot.writeFieldBegin(E_TA_FIELD_DESC); - this.eTa.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -27225,6 +37094,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -27237,12 +37107,198 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_createRawTable_resultStandardSchemeFactory implements SchemeFactory { + public user_createRawTable_resultStandardScheme getScheme() { + return new user_createRawTable_resultStandardScheme(); + } + } + + private static class user_createRawTable_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_createRawTable_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_R + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eR = new FileAlreadyExistException(); + struct.eR.read(iprot); + struct.setERIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // E_T + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eT = new TableColumnException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // E_TA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eTa = new TachyonException(); + struct.eTa.read(iprot); + struct.setETaIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_createRawTable_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.eR != null) { + oprot.writeFieldBegin(E_R_FIELD_DESC); + struct.eR.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eT != null) { + oprot.writeFieldBegin(E_T_FIELD_DESC); + struct.eT.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eTa != null) { + oprot.writeFieldBegin(E_TA_FIELD_DESC); + struct.eTa.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_createRawTable_resultTupleSchemeFactory implements SchemeFactory { + public user_createRawTable_resultTupleScheme getScheme() { + return new user_createRawTable_resultTupleScheme(); + } + } + + private static class user_createRawTable_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_createRawTable_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetER()) { + optionals.set(1); + } + if (struct.isSetEI()) { + optionals.set(2); + } + if (struct.isSetET()) { + optionals.set(3); + } + if (struct.isSetETa()) { + optionals.set(4); + } + oprot.writeBitSet(optionals, 5); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetER()) { + struct.eR.write(oprot); + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + if (struct.isSetET()) { + struct.eT.write(oprot); + } + if (struct.isSetETa()) { + struct.eTa.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_createRawTable_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(5); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eR = new FileAlreadyExistException(); + struct.eR.read(iprot); + struct.setERIsSet(true); + } + if (incoming.get(2)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + if (incoming.get(3)) { + struct.eT = new TableColumnException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } + if (incoming.get(4)) { + struct.eTa = new TachyonException(); + struct.eTa.read(iprot); + struct.setETaIsSet(true); + } + } + } + } public static class user_getRawTableId_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -27250,6 +37306,12 @@ public static class user_getRawTableId_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getRawTableId_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getRawTableId_argsTupleSchemeFactory()); + } + public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -27311,7 +37373,6 @@ public String getFieldName() { } // 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); @@ -27464,44 +37525,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -27522,6 +37550,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -27540,6 +37569,90 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getRawTableId_argsStandardSchemeFactory implements SchemeFactory { + public user_getRawTableId_argsStandardScheme getScheme() { + return new user_getRawTableId_argsStandardScheme(); + } + } + + private static class user_getRawTableId_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getRawTableId_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getRawTableId_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getRawTableId_argsTupleSchemeFactory implements SchemeFactory { + public user_getRawTableId_argsTupleScheme getScheme() { + return new user_getRawTableId_argsTupleScheme(); + } + } + + private static class user_getRawTableId_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getRawTableId_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getRawTableId_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + } + } + } public static class user_getRawTableId_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -27548,6 +37661,12 @@ public static class user_getRawTableId_result implements org.apache.thrift.TBase private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.I32, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getRawTableId_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getRawTableId_resultTupleSchemeFactory()); + } + public int success; // required public InvalidPathException e; // required @@ -27614,8 +37733,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -27644,8 +37762,7 @@ public user_getRawTableId_result( * Performs a deep copy on other. */ public user_getRawTableId_result(user_getRawTableId_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetE()) { this.e = new InvalidPathException(other.e); @@ -27674,16 +37791,16 @@ public user_getRawTableId_result setSuccess(int success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public InvalidPathException getE() { @@ -27833,57 +37950,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.success = iprot.readI32(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new InvalidPathException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -27907,6 +37979,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -27919,12 +37992,123 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_getRawTableId_resultStandardSchemeFactory implements SchemeFactory { + public user_getRawTableId_resultStandardScheme getScheme() { + return new user_getRawTableId_resultStandardScheme(); + } + } + + private static class user_getRawTableId_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getRawTableId_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new InvalidPathException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getRawTableId_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getRawTableId_resultTupleSchemeFactory implements SchemeFactory { + public user_getRawTableId_resultTupleScheme getScheme() { + return new user_getRawTableId_resultTupleScheme(); + } + } + + private static class user_getRawTableId_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getRawTableId_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getRawTableId_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new InvalidPathException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + } public static class user_getClientRawTableInfoById_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -27932,6 +38116,12 @@ public static class user_getClientRawTableInfoById_args implements org.apache.th private static final org.apache.thrift.protocol.TField TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tableId", org.apache.thrift.protocol.TType.I32, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getClientRawTableInfoById_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getClientRawTableInfoById_argsTupleSchemeFactory()); + } + public int tableId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -27994,8 +38184,7 @@ public String getFieldName() { // isset id assignments private static final int __TABLEID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -28020,8 +38209,7 @@ public user_getClientRawTableInfoById_args( * Performs a deep copy on other. */ public user_getClientRawTableInfoById_args(user_getClientRawTableInfoById_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.tableId = other.tableId; } @@ -28046,16 +38234,16 @@ public user_getClientRawTableInfoById_args setTableId(int tableId) { } public void unsetTableId() { - __isset_bit_vector.clear(__TABLEID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TABLEID_ISSET_ID); } /** Returns true if field tableId is set (has been assigned a value) and false otherwise */ public boolean isSetTableId() { - return __isset_bit_vector.get(__TABLEID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __TABLEID_ISSET_ID); } public void setTableIdIsSet(boolean value) { - __isset_bit_vector.set(__TABLEID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TABLEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -28149,43 +38337,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // TABLE_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.tableId = iprot.readI32(); - setTableIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(TABLE_ID_FIELD_DESC); - oprot.writeI32(this.tableId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -28202,6 +38358,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -28215,13 +38372,95 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_getClientRawTableInfoById_argsStandardSchemeFactory implements SchemeFactory { + public user_getClientRawTableInfoById_argsStandardScheme getScheme() { + return new user_getClientRawTableInfoById_argsStandardScheme(); + } + } + + private static class user_getClientRawTableInfoById_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientRawTableInfoById_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TABLE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.tableId = iprot.readI32(); + struct.setTableIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientRawTableInfoById_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TABLE_ID_FIELD_DESC); + oprot.writeI32(struct.tableId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getClientRawTableInfoById_argsTupleSchemeFactory implements SchemeFactory { + public user_getClientRawTableInfoById_argsTupleScheme getScheme() { + return new user_getClientRawTableInfoById_argsTupleScheme(); + } + } + + private static class user_getClientRawTableInfoById_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfoById_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetTableId()) { + oprot.writeI32(struct.tableId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfoById_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.tableId = iprot.readI32(); + struct.setTableIdIsSet(true); + } + } + } + } public static class user_getClientRawTableInfoById_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -28230,6 +38469,12 @@ public static class user_getClientRawTableInfoById_result implements org.apache. private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRUCT, (short)0); private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getClientRawTableInfoById_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getClientRawTableInfoById_resultTupleSchemeFactory()); + } + public ClientRawTableInfo success; // required public TableDoesNotExistException e; // required @@ -28295,7 +38540,6 @@ public String getFieldName() { } // 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); @@ -28512,57 +38756,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new ClientRawTableInfo(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.e = new TableDoesNotExistException(); - this.e.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetE()) { - oprot.writeFieldBegin(E_FIELD_DESC); - this.e.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -28590,6 +38789,10 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -28608,6 +38811,117 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getClientRawTableInfoById_resultStandardSchemeFactory implements SchemeFactory { + public user_getClientRawTableInfoById_resultStandardScheme getScheme() { + return new user_getClientRawTableInfoById_resultStandardScheme(); + } + } + + private static class user_getClientRawTableInfoById_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientRawTableInfoById_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new ClientRawTableInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new TableDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientRawTableInfoById_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getClientRawTableInfoById_resultTupleSchemeFactory implements SchemeFactory { + public user_getClientRawTableInfoById_resultTupleScheme getScheme() { + return new user_getClientRawTableInfoById_resultTupleScheme(); + } + } + + private static class user_getClientRawTableInfoById_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfoById_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfoById_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = new ClientRawTableInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new TableDoesNotExistException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + } public static class user_getClientRawTableInfoByPath_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -28615,6 +38929,12 @@ public static class user_getClientRawTableInfoByPath_args implements org.apache. private static final org.apache.thrift.protocol.TField TABLE_PATH_FIELD_DESC = new org.apache.thrift.protocol.TField("tablePath", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getClientRawTableInfoByPath_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getClientRawTableInfoByPath_argsTupleSchemeFactory()); + } + public String tablePath; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -28676,7 +38996,6 @@ public String getFieldName() { } // 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); @@ -28829,44 +39148,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // TABLE_PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.tablePath = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.tablePath != null) { - oprot.writeFieldBegin(TABLE_PATH_FIELD_DESC); - oprot.writeString(this.tablePath); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -28887,6 +39173,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -28905,6 +39192,90 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getClientRawTableInfoByPath_argsStandardSchemeFactory implements SchemeFactory { + public user_getClientRawTableInfoByPath_argsStandardScheme getScheme() { + return new user_getClientRawTableInfoByPath_argsStandardScheme(); + } + } + + private static class user_getClientRawTableInfoByPath_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientRawTableInfoByPath_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TABLE_PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.tablePath = iprot.readString(); + struct.setTablePathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientRawTableInfoByPath_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.tablePath != null) { + oprot.writeFieldBegin(TABLE_PATH_FIELD_DESC); + oprot.writeString(struct.tablePath); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getClientRawTableInfoByPath_argsTupleSchemeFactory implements SchemeFactory { + public user_getClientRawTableInfoByPath_argsTupleScheme getScheme() { + return new user_getClientRawTableInfoByPath_argsTupleScheme(); + } + } + + private static class user_getClientRawTableInfoByPath_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfoByPath_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTablePath()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetTablePath()) { + oprot.writeString(struct.tablePath); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfoByPath_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.tablePath = iprot.readString(); + struct.setTablePathIsSet(true); + } + } + } + } public static class user_getClientRawTableInfoByPath_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -28914,6 +39285,12 @@ public static class user_getClientRawTableInfoByPath_result implements org.apach private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getClientRawTableInfoByPath_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getClientRawTableInfoByPath_resultTupleSchemeFactory()); + } + public ClientRawTableInfo success; // required public TableDoesNotExistException eT; // required public InvalidPathException eI; // required @@ -28983,7 +39360,6 @@ public String getFieldName() { } // 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); @@ -29264,69 +39640,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.success = new ClientRawTableInfo(); - this.success.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E_T - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eT = new TableDoesNotExistException(); - this.eT.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_I - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eI = new InvalidPathException(); - this.eI.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - this.success.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetET()) { - oprot.writeFieldBegin(E_T_FIELD_DESC); - this.eT.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEI()) { - oprot.writeFieldBegin(E_I_FIELD_DESC); - this.eI.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -29362,6 +39681,10 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity + if (success != null) { + success.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -29380,6 +39703,142 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getClientRawTableInfoByPath_resultStandardSchemeFactory implements SchemeFactory { + public user_getClientRawTableInfoByPath_resultStandardScheme getScheme() { + return new user_getClientRawTableInfoByPath_resultStandardScheme(); + } + } + + private static class user_getClientRawTableInfoByPath_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getClientRawTableInfoByPath_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.success = new ClientRawTableInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_T + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eT = new TableDoesNotExistException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getClientRawTableInfoByPath_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + struct.success.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eT != null) { + oprot.writeFieldBegin(E_T_FIELD_DESC); + struct.eT.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getClientRawTableInfoByPath_resultTupleSchemeFactory implements SchemeFactory { + public user_getClientRawTableInfoByPath_resultTupleScheme getScheme() { + return new user_getClientRawTableInfoByPath_resultTupleScheme(); + } + } + + private static class user_getClientRawTableInfoByPath_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfoByPath_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetET()) { + optionals.set(1); + } + if (struct.isSetEI()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + struct.success.write(oprot); + } + if (struct.isSetET()) { + struct.eT.write(oprot); + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getClientRawTableInfoByPath_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = new ClientRawTableInfo(); + struct.success.read(iprot); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eT = new TableDoesNotExistException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } + if (incoming.get(2)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + } + } + } public static class user_updateRawTableMetadata_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -29388,6 +39847,12 @@ public static class user_updateRawTableMetadata_args implements org.apache.thrif private static final org.apache.thrift.protocol.TField TABLE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("tableId", org.apache.thrift.protocol.TType.I32, (short)1); private static final org.apache.thrift.protocol.TField METADATA_FIELD_DESC = new org.apache.thrift.protocol.TField("metadata", org.apache.thrift.protocol.TType.STRING, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_updateRawTableMetadata_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_updateRawTableMetadata_argsTupleSchemeFactory()); + } + public int tableId; // required public ByteBuffer metadata; // required @@ -29454,8 +39919,7 @@ public String getFieldName() { // isset id assignments private static final int __TABLEID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -29484,8 +39948,7 @@ public user_updateRawTableMetadata_args( * Performs a deep copy on other. */ public user_updateRawTableMetadata_args(user_updateRawTableMetadata_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.tableId = other.tableId; if (other.isSetMetadata()) { this.metadata = org.apache.thrift.TBaseHelper.copyBinary(other.metadata); @@ -29515,16 +39978,16 @@ public user_updateRawTableMetadata_args setTableId(int tableId) { } public void unsetTableId() { - __isset_bit_vector.clear(__TABLEID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __TABLEID_ISSET_ID); } /** Returns true if field tableId is set (has been assigned a value) and false otherwise */ public boolean isSetTableId() { - return __isset_bit_vector.get(__TABLEID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __TABLEID_ISSET_ID); } public void setTableIdIsSet(boolean value) { - __isset_bit_vector.set(__TABLEID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __TABLEID_ISSET_ID, value); } public byte[] getMetadata() { @@ -29684,55 +40147,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // TABLE_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.tableId = iprot.readI32(); - setTableIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // METADATA - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.metadata = iprot.readBinary(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(TABLE_ID_FIELD_DESC); - oprot.writeI32(this.tableId); - oprot.writeFieldEnd(); - if (this.metadata != null) { - oprot.writeFieldBegin(METADATA_FIELD_DESC); - oprot.writeBinary(this.metadata); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -29757,6 +40176,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -29767,11 +40187,118 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept } } - private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { - try { - read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); - } catch (org.apache.thrift.TException te) { - throw new java.io.IOException(te); + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class user_updateRawTableMetadata_argsStandardSchemeFactory implements SchemeFactory { + public user_updateRawTableMetadata_argsStandardScheme getScheme() { + return new user_updateRawTableMetadata_argsStandardScheme(); + } + } + + private static class user_updateRawTableMetadata_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_updateRawTableMetadata_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // TABLE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.tableId = iprot.readI32(); + struct.setTableIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // METADATA + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.metadata = iprot.readBinary(); + struct.setMetadataIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_updateRawTableMetadata_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(TABLE_ID_FIELD_DESC); + oprot.writeI32(struct.tableId); + oprot.writeFieldEnd(); + if (struct.metadata != null) { + oprot.writeFieldBegin(METADATA_FIELD_DESC); + oprot.writeBinary(struct.metadata); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_updateRawTableMetadata_argsTupleSchemeFactory implements SchemeFactory { + public user_updateRawTableMetadata_argsTupleScheme getScheme() { + return new user_updateRawTableMetadata_argsTupleScheme(); + } + } + + private static class user_updateRawTableMetadata_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_updateRawTableMetadata_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetTableId()) { + optionals.set(0); + } + if (struct.isSetMetadata()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetTableId()) { + oprot.writeI32(struct.tableId); + } + if (struct.isSetMetadata()) { + oprot.writeBinary(struct.metadata); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_updateRawTableMetadata_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.tableId = iprot.readI32(); + struct.setTableIdIsSet(true); + } + if (incoming.get(1)) { + struct.metadata = iprot.readBinary(); + struct.setMetadataIsSet(true); + } } } @@ -29783,6 +40310,12 @@ public static class user_updateRawTableMetadata_result implements org.apache.thr private static final org.apache.thrift.protocol.TField E_T_FIELD_DESC = new org.apache.thrift.protocol.TField("eT", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_TA_FIELD_DESC = new org.apache.thrift.protocol.TField("eTa", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_updateRawTableMetadata_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_updateRawTableMetadata_resultTupleSchemeFactory()); + } + public TableDoesNotExistException eT; // required public TachyonException eTa; // required @@ -29848,7 +40381,6 @@ public String getFieldName() { } // 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); @@ -30065,57 +40597,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // E_T - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eT = new TableDoesNotExistException(); - this.eT.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_TA - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eTa = new TachyonException(); - this.eTa.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetET()) { - oprot.writeFieldBegin(E_T_FIELD_DESC); - this.eT.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetETa()) { - oprot.writeFieldBegin(E_TA_FIELD_DESC); - this.eTa.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -30143,6 +40630,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -30161,6 +40649,117 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_updateRawTableMetadata_resultStandardSchemeFactory implements SchemeFactory { + public user_updateRawTableMetadata_resultStandardScheme getScheme() { + return new user_updateRawTableMetadata_resultStandardScheme(); + } + } + + private static class user_updateRawTableMetadata_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_updateRawTableMetadata_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // E_T + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eT = new TableDoesNotExistException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_TA + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eTa = new TachyonException(); + struct.eTa.read(iprot); + struct.setETaIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_updateRawTableMetadata_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.eT != null) { + oprot.writeFieldBegin(E_T_FIELD_DESC); + struct.eT.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eTa != null) { + oprot.writeFieldBegin(E_TA_FIELD_DESC); + struct.eTa.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_updateRawTableMetadata_resultTupleSchemeFactory implements SchemeFactory { + public user_updateRawTableMetadata_resultTupleScheme getScheme() { + return new user_updateRawTableMetadata_resultTupleScheme(); + } + } + + private static class user_updateRawTableMetadata_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_updateRawTableMetadata_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetET()) { + optionals.set(0); + } + if (struct.isSetETa()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetET()) { + struct.eT.write(oprot); + } + if (struct.isSetETa()) { + struct.eTa.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_updateRawTableMetadata_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.eT = new TableDoesNotExistException(); + struct.eT.read(iprot); + struct.setETIsSet(true); + } + if (incoming.get(1)) { + struct.eTa = new TachyonException(); + struct.eTa.read(iprot); + struct.setETaIsSet(true); + } + } + } + } public static class user_getNumberOfFiles_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -30168,6 +40767,12 @@ public static class user_getNumberOfFiles_args implements org.apache.thrift.TBas 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 Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getNumberOfFiles_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getNumberOfFiles_argsTupleSchemeFactory()); + } + public String path; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -30229,7 +40834,6 @@ public String getFieldName() { } // 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); @@ -30382,44 +40986,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // PATH - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.path = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.path != null) { - oprot.writeFieldBegin(PATH_FIELD_DESC); - oprot.writeString(this.path); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -30440,6 +41011,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -30458,6 +41030,90 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getNumberOfFiles_argsStandardSchemeFactory implements SchemeFactory { + public user_getNumberOfFiles_argsStandardScheme getScheme() { + return new user_getNumberOfFiles_argsStandardScheme(); + } + } + + private static class user_getNumberOfFiles_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getNumberOfFiles_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // PATH + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getNumberOfFiles_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.path != null) { + oprot.writeFieldBegin(PATH_FIELD_DESC); + oprot.writeString(struct.path); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getNumberOfFiles_argsTupleSchemeFactory implements SchemeFactory { + public user_getNumberOfFiles_argsTupleScheme getScheme() { + return new user_getNumberOfFiles_argsTupleScheme(); + } + } + + private static class user_getNumberOfFiles_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getNumberOfFiles_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetPath()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetPath()) { + oprot.writeString(struct.path); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getNumberOfFiles_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.path = iprot.readString(); + struct.setPathIsSet(true); + } + } + } + } public static class user_getNumberOfFiles_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -30467,6 +41123,12 @@ public static class user_getNumberOfFiles_result implements org.apache.thrift.TB private static final org.apache.thrift.protocol.TField E_R_FIELD_DESC = new org.apache.thrift.protocol.TField("eR", org.apache.thrift.protocol.TType.STRUCT, (short)1); private static final org.apache.thrift.protocol.TField E_I_FIELD_DESC = new org.apache.thrift.protocol.TField("eI", org.apache.thrift.protocol.TType.STRUCT, (short)2); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getNumberOfFiles_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getNumberOfFiles_resultTupleSchemeFactory()); + } + public int success; // required public FileDoesNotExistException eR; // required public InvalidPathException eI; // required @@ -30537,8 +41199,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -30571,8 +41232,7 @@ public user_getNumberOfFiles_result( * Performs a deep copy on other. */ public user_getNumberOfFiles_result(user_getNumberOfFiles_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; if (other.isSetER()) { this.eR = new FileDoesNotExistException(other.eR); @@ -30605,16 +41265,16 @@ public user_getNumberOfFiles_result setSuccess(int success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public FileDoesNotExistException getER() { @@ -30820,69 +41480,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.success = iprot.readI32(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 1: // E_R - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eR = new FileDoesNotExistException(); - this.eR.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_I - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eI = new InvalidPathException(); - this.eI.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeI32(this.success); - oprot.writeFieldEnd(); - } else if (this.isSetER()) { - oprot.writeFieldBegin(E_R_FIELD_DESC); - this.eR.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEI()) { - oprot.writeFieldBegin(E_I_FIELD_DESC); - this.eI.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -30914,6 +41517,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -30926,18 +41530,160 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class user_getNumberOfFiles_resultStandardSchemeFactory implements SchemeFactory { + public user_getNumberOfFiles_resultStandardScheme getScheme() { + return new user_getNumberOfFiles_resultStandardScheme(); + } + } + + private static class user_getNumberOfFiles_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getNumberOfFiles_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E_R + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eR = new FileDoesNotExistException(); + struct.eR.read(iprot); + struct.setERIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_I + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getNumberOfFiles_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeI32(struct.success); + oprot.writeFieldEnd(); + } + if (struct.eR != null) { + oprot.writeFieldBegin(E_R_FIELD_DESC); + struct.eR.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eI != null) { + oprot.writeFieldBegin(E_I_FIELD_DESC); + struct.eI.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getNumberOfFiles_resultTupleSchemeFactory implements SchemeFactory { + public user_getNumberOfFiles_resultTupleScheme getScheme() { + return new user_getNumberOfFiles_resultTupleScheme(); + } + } + + private static class user_getNumberOfFiles_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getNumberOfFiles_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetER()) { + optionals.set(1); + } + if (struct.isSetEI()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetSuccess()) { + oprot.writeI32(struct.success); + } + if (struct.isSetER()) { + struct.eR.write(oprot); + } + if (struct.isSetEI()) { + struct.eI.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getNumberOfFiles_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.success = iprot.readI32(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.eR = new FileDoesNotExistException(); + struct.eR.read(iprot); + struct.setERIsSet(true); + } + if (incoming.get(2)) { + struct.eI = new InvalidPathException(); + struct.eI.read(iprot); + struct.setEIIsSet(true); + } + } + } + } public static class user_getUnderfsAddress_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("user_getUnderfsAddress_args"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getUnderfsAddress_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getUnderfsAddress_argsTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -31077,32 +41823,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -31116,6 +41841,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -31134,6 +41860,64 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getUnderfsAddress_argsStandardSchemeFactory implements SchemeFactory { + public user_getUnderfsAddress_argsStandardScheme getScheme() { + return new user_getUnderfsAddress_argsStandardScheme(); + } + } + + private static class user_getUnderfsAddress_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getUnderfsAddress_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getUnderfsAddress_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getUnderfsAddress_argsTupleSchemeFactory implements SchemeFactory { + public user_getUnderfsAddress_argsTupleScheme getScheme() { + return new user_getUnderfsAddress_argsTupleScheme(); + } + } + + private static class user_getUnderfsAddress_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getUnderfsAddress_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getUnderfsAddress_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class user_getUnderfsAddress_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -31141,6 +41925,12 @@ public static class user_getUnderfsAddress_result implements org.apache.thrift.T private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new user_getUnderfsAddress_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new user_getUnderfsAddress_resultTupleSchemeFactory()); + } + public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -31202,7 +41992,6 @@ public String getFieldName() { } // 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); @@ -31355,44 +42144,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -31412,6 +42169,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -31430,6 +42188,90 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class user_getUnderfsAddress_resultStandardSchemeFactory implements SchemeFactory { + public user_getUnderfsAddress_resultStandardScheme getScheme() { + return new user_getUnderfsAddress_resultStandardScheme(); + } + } + + private static class user_getUnderfsAddress_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, user_getUnderfsAddress_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, user_getUnderfsAddress_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class user_getUnderfsAddress_resultTupleSchemeFactory implements SchemeFactory { + public user_getUnderfsAddress_resultTupleScheme getScheme() { + return new user_getUnderfsAddress_resultTupleScheme(); + } + } + + private static class user_getUnderfsAddress_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, user_getUnderfsAddress_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, user_getUnderfsAddress_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + } + } + } } diff --git a/src/main/java/tachyon/thrift/NetAddress.java b/src/main/java/tachyon/thrift/NetAddress.java index f66a2172da4d..3befc83396b4 100644 --- a/src/main/java/tachyon/thrift/NetAddress.java +++ b/src/main/java/tachyon/thrift/NetAddress.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -26,6 +36,12 @@ public class NetAddress implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new NetAddressStandardSchemeFactory()); + schemes.put(TupleScheme.class, new NetAddressTupleSchemeFactory()); + } + public String mHost; // required public int mPort; // required @@ -92,8 +108,7 @@ public String getFieldName() { // isset id assignments private static final int __MPORT_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -122,8 +137,7 @@ public NetAddress( * Performs a deep copy on other. */ public NetAddress(NetAddress other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; if (other.isSetMHost()) { this.mHost = other.mHost; } @@ -176,16 +190,16 @@ public NetAddress setMPort(int mPort) { } public void unsetMPort() { - __isset_bit_vector.clear(__MPORT_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __MPORT_ISSET_ID); } /** Returns true if field mPort is set (has been assigned a value) and false otherwise */ public boolean isSetMPort() { - return __isset_bit_vector.get(__MPORT_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __MPORT_ISSET_ID); } public void setMPortIsSet(boolean value) { - __isset_bit_vector.set(__MPORT_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __MPORT_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -311,55 +325,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // M_HOST - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.mHost = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // M_PORT - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.mPort = iprot.readI32(); - setMPortIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.mHost != null) { - oprot.writeFieldBegin(M_HOST_FIELD_DESC); - oprot.writeString(this.mHost); - oprot.writeFieldEnd(); - } - oprot.writeFieldBegin(M_PORT_FIELD_DESC); - oprot.writeI32(this.mPort); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -384,6 +354,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -397,12 +368,117 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class NetAddressStandardSchemeFactory implements SchemeFactory { + public NetAddressStandardScheme getScheme() { + return new NetAddressStandardScheme(); + } + } + + private static class NetAddressStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, NetAddress struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // M_HOST + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.mHost = iprot.readString(); + struct.setMHostIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // M_PORT + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.mPort = iprot.readI32(); + struct.setMPortIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, NetAddress struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.mHost != null) { + oprot.writeFieldBegin(M_HOST_FIELD_DESC); + oprot.writeString(struct.mHost); + oprot.writeFieldEnd(); + } + oprot.writeFieldBegin(M_PORT_FIELD_DESC); + oprot.writeI32(struct.mPort); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class NetAddressTupleSchemeFactory implements SchemeFactory { + public NetAddressTupleScheme getScheme() { + return new NetAddressTupleScheme(); + } + } + + private static class NetAddressTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, NetAddress struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMHost()) { + optionals.set(0); + } + if (struct.isSetMPort()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetMHost()) { + oprot.writeString(struct.mHost); + } + if (struct.isSetMPort()) { + oprot.writeI32(struct.mPort); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, NetAddress struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.mHost = iprot.readString(); + struct.setMHostIsSet(true); + } + if (incoming.get(1)) { + struct.mPort = iprot.readI32(); + struct.setMPortIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/NoWorkerException.java b/src/main/java/tachyon/thrift/NoWorkerException.java index 1154393d4947..20c1928a61ad 100644 --- a/src/main/java/tachyon/thrift/NoWorkerException.java +++ b/src/main/java/tachyon/thrift/NoWorkerException.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -20,11 +30,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class NoWorkerException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class NoWorkerException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("NoWorkerException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new NoWorkerExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new NoWorkerExceptionTupleSchemeFactory()); + } + public String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -86,7 +102,6 @@ public String getFieldName() { } // 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); @@ -239,44 +254,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MESSAGE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.message = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(this.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -297,6 +279,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -315,5 +298,89 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class NoWorkerExceptionStandardSchemeFactory implements SchemeFactory { + public NoWorkerExceptionStandardScheme getScheme() { + return new NoWorkerExceptionStandardScheme(); + } + } + + private static class NoWorkerExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, NoWorkerException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, NoWorkerException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class NoWorkerExceptionTupleSchemeFactory implements SchemeFactory { + public NoWorkerExceptionTupleScheme getScheme() { + return new NoWorkerExceptionTupleScheme(); + } + } + + private static class NoWorkerExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, NoWorkerException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, NoWorkerException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/OutOfMemoryForPinFileException.java b/src/main/java/tachyon/thrift/OutOfMemoryForPinFileException.java index ab1427ef4174..c0e2f72a478a 100644 --- a/src/main/java/tachyon/thrift/OutOfMemoryForPinFileException.java +++ b/src/main/java/tachyon/thrift/OutOfMemoryForPinFileException.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -20,11 +30,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class OutOfMemoryForPinFileException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class OutOfMemoryForPinFileException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("OutOfMemoryForPinFileException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new OutOfMemoryForPinFileExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new OutOfMemoryForPinFileExceptionTupleSchemeFactory()); + } + public String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -86,7 +102,6 @@ public String getFieldName() { } // 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); @@ -239,44 +254,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MESSAGE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.message = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(this.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -297,6 +279,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -315,5 +298,89 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class OutOfMemoryForPinFileExceptionStandardSchemeFactory implements SchemeFactory { + public OutOfMemoryForPinFileExceptionStandardScheme getScheme() { + return new OutOfMemoryForPinFileExceptionStandardScheme(); + } + } + + private static class OutOfMemoryForPinFileExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, OutOfMemoryForPinFileException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, OutOfMemoryForPinFileException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class OutOfMemoryForPinFileExceptionTupleSchemeFactory implements SchemeFactory { + public OutOfMemoryForPinFileExceptionTupleScheme getScheme() { + return new OutOfMemoryForPinFileExceptionTupleScheme(); + } + } + + private static class OutOfMemoryForPinFileExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, OutOfMemoryForPinFileException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, OutOfMemoryForPinFileException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/SuspectedFileSizeException.java b/src/main/java/tachyon/thrift/SuspectedFileSizeException.java index 0c7a10e9de39..8b6292c6a852 100644 --- a/src/main/java/tachyon/thrift/SuspectedFileSizeException.java +++ b/src/main/java/tachyon/thrift/SuspectedFileSizeException.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -20,11 +30,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class SuspectedFileSizeException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class SuspectedFileSizeException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("SuspectedFileSizeException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new SuspectedFileSizeExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new SuspectedFileSizeExceptionTupleSchemeFactory()); + } + public String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -86,7 +102,6 @@ public String getFieldName() { } // 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); @@ -239,44 +254,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MESSAGE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.message = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(this.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -297,6 +279,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -315,5 +298,89 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class SuspectedFileSizeExceptionStandardSchemeFactory implements SchemeFactory { + public SuspectedFileSizeExceptionStandardScheme getScheme() { + return new SuspectedFileSizeExceptionStandardScheme(); + } + } + + private static class SuspectedFileSizeExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, SuspectedFileSizeException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, SuspectedFileSizeException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class SuspectedFileSizeExceptionTupleSchemeFactory implements SchemeFactory { + public SuspectedFileSizeExceptionTupleScheme getScheme() { + return new SuspectedFileSizeExceptionTupleScheme(); + } + } + + private static class SuspectedFileSizeExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, SuspectedFileSizeException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, SuspectedFileSizeException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/TableColumnException.java b/src/main/java/tachyon/thrift/TableColumnException.java index b02d273837a4..2e3c28d24307 100644 --- a/src/main/java/tachyon/thrift/TableColumnException.java +++ b/src/main/java/tachyon/thrift/TableColumnException.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -20,11 +30,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class TableColumnException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class TableColumnException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TableColumnException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TableColumnExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TableColumnExceptionTupleSchemeFactory()); + } + public String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -86,7 +102,6 @@ public String getFieldName() { } // 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); @@ -239,44 +254,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MESSAGE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.message = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(this.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -297,6 +279,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -315,5 +298,89 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class TableColumnExceptionStandardSchemeFactory implements SchemeFactory { + public TableColumnExceptionStandardScheme getScheme() { + return new TableColumnExceptionStandardScheme(); + } + } + + private static class TableColumnExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TableColumnException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, TableColumnException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TableColumnExceptionTupleSchemeFactory implements SchemeFactory { + public TableColumnExceptionTupleScheme getScheme() { + return new TableColumnExceptionTupleScheme(); + } + } + + private static class TableColumnExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TableColumnException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TableColumnException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/TableDoesNotExistException.java b/src/main/java/tachyon/thrift/TableDoesNotExistException.java index d9da2d4f9e50..cb9103812e2b 100644 --- a/src/main/java/tachyon/thrift/TableDoesNotExistException.java +++ b/src/main/java/tachyon/thrift/TableDoesNotExistException.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -20,11 +30,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class TableDoesNotExistException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class TableDoesNotExistException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TableDoesNotExistException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TableDoesNotExistExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TableDoesNotExistExceptionTupleSchemeFactory()); + } + public String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -86,7 +102,6 @@ public String getFieldName() { } // 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); @@ -239,44 +254,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MESSAGE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.message = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(this.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -297,6 +279,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -315,5 +298,89 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class TableDoesNotExistExceptionStandardSchemeFactory implements SchemeFactory { + public TableDoesNotExistExceptionStandardScheme getScheme() { + return new TableDoesNotExistExceptionStandardScheme(); + } + } + + private static class TableDoesNotExistExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TableDoesNotExistException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, TableDoesNotExistException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TableDoesNotExistExceptionTupleSchemeFactory implements SchemeFactory { + public TableDoesNotExistExceptionTupleScheme getScheme() { + return new TableDoesNotExistExceptionTupleScheme(); + } + } + + private static class TableDoesNotExistExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TableDoesNotExistException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TableDoesNotExistException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/TachyonException.java b/src/main/java/tachyon/thrift/TachyonException.java index 47319f59b44f..842d54992785 100644 --- a/src/main/java/tachyon/thrift/TachyonException.java +++ b/src/main/java/tachyon/thrift/TachyonException.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -20,11 +30,17 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -public class TachyonException extends Exception implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { +public class TachyonException extends TException implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("TachyonException"); private static final org.apache.thrift.protocol.TField MESSAGE_FIELD_DESC = new org.apache.thrift.protocol.TField("message", org.apache.thrift.protocol.TType.STRING, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new TachyonExceptionStandardSchemeFactory()); + schemes.put(TupleScheme.class, new TachyonExceptionTupleSchemeFactory()); + } + public String message; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -86,7 +102,6 @@ public String getFieldName() { } // 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); @@ -239,44 +254,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // MESSAGE - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.message = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - if (this.message != null) { - oprot.writeFieldBegin(MESSAGE_FIELD_DESC); - oprot.writeString(this.message); - oprot.writeFieldEnd(); - } - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -297,6 +279,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -315,5 +298,89 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class TachyonExceptionStandardSchemeFactory implements SchemeFactory { + public TachyonExceptionStandardScheme getScheme() { + return new TachyonExceptionStandardScheme(); + } + } + + private static class TachyonExceptionStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, TachyonException struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // MESSAGE + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, TachyonException struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.message != null) { + oprot.writeFieldBegin(MESSAGE_FIELD_DESC); + oprot.writeString(struct.message); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class TachyonExceptionTupleSchemeFactory implements SchemeFactory { + public TachyonExceptionTupleScheme getScheme() { + return new TachyonExceptionTupleScheme(); + } + } + + private static class TachyonExceptionTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, TachyonException struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetMessage()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetMessage()) { + oprot.writeString(struct.message); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, TachyonException struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.message = iprot.readString(); + struct.setMessageIsSet(true); + } + } + } + } diff --git a/src/main/java/tachyon/thrift/WorkerService.java b/src/main/java/tachyon/thrift/WorkerService.java index ae51da64357d..5df56f7b86b6 100644 --- a/src/main/java/tachyon/thrift/WorkerService.java +++ b/src/main/java/tachyon/thrift/WorkerService.java @@ -1,10 +1,20 @@ /** - * Autogenerated by Thrift Compiler (0.7.0) + * Autogenerated by Thrift Compiler (0.9.0) * * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING + * @generated */ package tachyon.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 java.util.List; import java.util.ArrayList; import java.util.Map; @@ -28,6 +38,8 @@ public interface Iface { public void addCheckpoint(long userId, int fileId) throws FileDoesNotExistException, SuspectedFileSizeException, FailedToCheckpointException, BlockInfoException, org.apache.thrift.TException; + public boolean asyncCheckpoint(int fileId) throws TachyonException, org.apache.thrift.TException; + public void cacheBlock(long userId, long blockId) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException; public String getDataFolder() throws org.apache.thrift.TException; @@ -54,6 +66,8 @@ public interface AsyncIface { public void addCheckpoint(long userId, int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void asyncCheckpoint(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; + public void cacheBlock(long userId, long blockId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; public void getDataFolder(org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException; @@ -147,6 +161,32 @@ public void recv_addCheckpoint() throws FileDoesNotExistException, SuspectedFile return; } + public boolean asyncCheckpoint(int fileId) throws TachyonException, org.apache.thrift.TException + { + send_asyncCheckpoint(fileId); + return recv_asyncCheckpoint(); + } + + public void send_asyncCheckpoint(int fileId) throws org.apache.thrift.TException + { + asyncCheckpoint_args args = new asyncCheckpoint_args(); + args.setFileId(fileId); + sendBase("asyncCheckpoint", args); + } + + public boolean recv_asyncCheckpoint() throws TachyonException, org.apache.thrift.TException + { + asyncCheckpoint_result result = new asyncCheckpoint_result(); + receiveBase(result, "asyncCheckpoint"); + 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, "asyncCheckpoint failed: unknown result"); + } + public void cacheBlock(long userId, long blockId) throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, org.apache.thrift.TException { send_cacheBlock(userId, blockId); @@ -437,6 +477,38 @@ public void getResult() throws FileDoesNotExistException, SuspectedFileSizeExcep } } + public void asyncCheckpoint(int fileId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { + checkReady(); + asyncCheckpoint_call method_call = new asyncCheckpoint_call(fileId, resultHandler, this, ___protocolFactory, ___transport); + this.___currentMethod = method_call; + ___manager.call(method_call); + } + + public static class asyncCheckpoint_call extends org.apache.thrift.async.TAsyncMethodCall { + private int fileId; + public asyncCheckpoint_call(int 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("asyncCheckpoint", org.apache.thrift.protocol.TMessageType.CALL, 0)); + asyncCheckpoint_args args = new asyncCheckpoint_args(); + args.setFileId(fileId); + args.write(prot); + prot.writeMessageEnd(); + } + + public boolean getResult() throws TachyonException, 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_asyncCheckpoint(); + } + } + public void cacheBlock(long userId, long blockId, org.apache.thrift.async.AsyncMethodCallback resultHandler) throws org.apache.thrift.TException { checkReady(); cacheBlock_call method_call = new cacheBlock_call(userId, blockId, resultHandler, this, ___protocolFactory, ___transport); @@ -739,7 +811,7 @@ public void getResult() throws org.apache.thrift.TException { } - public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { + public static class Processor extends org.apache.thrift.TBaseProcessor implements org.apache.thrift.TProcessor { private static final Logger LOGGER = LoggerFactory.getLogger(Processor.class.getName()); public Processor(I iface) { super(iface, getProcessMap(new HashMap>())); @@ -752,6 +824,7 @@ protected Processor(I iface, Map Map> getProcessMap(Map> processMap) { processMap.put("accessBlock", new accessBlock()); processMap.put("addCheckpoint", new addCheckpoint()); + processMap.put("asyncCheckpoint", new asyncCheckpoint()); processMap.put("cacheBlock", new cacheBlock()); processMap.put("getDataFolder", new getDataFolder()); processMap.put("getUserTempFolder", new getUserTempFolder()); @@ -764,32 +837,40 @@ protected Processor(I iface, Map extends org.apache.thrift.ProcessFunction { + public static class accessBlock extends org.apache.thrift.ProcessFunction { public accessBlock() { super("accessBlock"); } - protected accessBlock_args getEmptyArgsInstance() { + public accessBlock_args getEmptyArgsInstance() { return new accessBlock_args(); } - protected accessBlock_result getResult(I iface, accessBlock_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public accessBlock_result getResult(I iface, accessBlock_args args) throws org.apache.thrift.TException { accessBlock_result result = new accessBlock_result(); iface.accessBlock(args.blockId); return result; } } - private static class addCheckpoint extends org.apache.thrift.ProcessFunction { + public static class addCheckpoint extends org.apache.thrift.ProcessFunction { public addCheckpoint() { super("addCheckpoint"); } - protected addCheckpoint_args getEmptyArgsInstance() { + public addCheckpoint_args getEmptyArgsInstance() { return new addCheckpoint_args(); } - protected addCheckpoint_result getResult(I iface, addCheckpoint_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public addCheckpoint_result getResult(I iface, addCheckpoint_args args) throws org.apache.thrift.TException { addCheckpoint_result result = new addCheckpoint_result(); try { iface.addCheckpoint(args.userId, args.fileId); @@ -806,16 +887,45 @@ protected addCheckpoint_result getResult(I iface, addCheckpoint_args args) throw } } - private static class cacheBlock extends org.apache.thrift.ProcessFunction { + public static class asyncCheckpoint extends org.apache.thrift.ProcessFunction { + public asyncCheckpoint() { + super("asyncCheckpoint"); + } + + public asyncCheckpoint_args getEmptyArgsInstance() { + return new asyncCheckpoint_args(); + } + + protected boolean isOneway() { + return false; + } + + public asyncCheckpoint_result getResult(I iface, asyncCheckpoint_args args) throws org.apache.thrift.TException { + asyncCheckpoint_result result = new asyncCheckpoint_result(); + try { + result.success = iface.asyncCheckpoint(args.fileId); + result.setSuccessIsSet(true); + } catch (TachyonException e) { + result.e = e; + } + return result; + } + } + + public static class cacheBlock extends org.apache.thrift.ProcessFunction { public cacheBlock() { super("cacheBlock"); } - protected cacheBlock_args getEmptyArgsInstance() { + public cacheBlock_args getEmptyArgsInstance() { return new cacheBlock_args(); } - protected cacheBlock_result getResult(I iface, cacheBlock_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public cacheBlock_result getResult(I iface, cacheBlock_args args) throws org.apache.thrift.TException { cacheBlock_result result = new cacheBlock_result(); try { iface.cacheBlock(args.userId, args.blockId); @@ -830,96 +940,120 @@ protected cacheBlock_result getResult(I iface, cacheBlock_args args) throws org. } } - private static class getDataFolder extends org.apache.thrift.ProcessFunction { + public static class getDataFolder extends org.apache.thrift.ProcessFunction { public getDataFolder() { super("getDataFolder"); } - protected getDataFolder_args getEmptyArgsInstance() { + public getDataFolder_args getEmptyArgsInstance() { return new getDataFolder_args(); } - protected getDataFolder_result getResult(I iface, getDataFolder_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public getDataFolder_result getResult(I iface, getDataFolder_args args) throws org.apache.thrift.TException { getDataFolder_result result = new getDataFolder_result(); result.success = iface.getDataFolder(); return result; } } - private static class getUserTempFolder extends org.apache.thrift.ProcessFunction { + public static class getUserTempFolder extends org.apache.thrift.ProcessFunction { public getUserTempFolder() { super("getUserTempFolder"); } - protected getUserTempFolder_args getEmptyArgsInstance() { + public getUserTempFolder_args getEmptyArgsInstance() { return new getUserTempFolder_args(); } - protected getUserTempFolder_result getResult(I iface, getUserTempFolder_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public getUserTempFolder_result getResult(I iface, getUserTempFolder_args args) throws org.apache.thrift.TException { getUserTempFolder_result result = new getUserTempFolder_result(); result.success = iface.getUserTempFolder(args.userId); return result; } } - private static class getUserUnderfsTempFolder extends org.apache.thrift.ProcessFunction { + public static class getUserUnderfsTempFolder extends org.apache.thrift.ProcessFunction { public getUserUnderfsTempFolder() { super("getUserUnderfsTempFolder"); } - protected getUserUnderfsTempFolder_args getEmptyArgsInstance() { + public getUserUnderfsTempFolder_args getEmptyArgsInstance() { return new getUserUnderfsTempFolder_args(); } - protected getUserUnderfsTempFolder_result getResult(I iface, getUserUnderfsTempFolder_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public getUserUnderfsTempFolder_result getResult(I iface, getUserUnderfsTempFolder_args args) throws org.apache.thrift.TException { getUserUnderfsTempFolder_result result = new getUserUnderfsTempFolder_result(); result.success = iface.getUserUnderfsTempFolder(args.userId); return result; } } - private static class lockBlock extends org.apache.thrift.ProcessFunction { + public static class lockBlock extends org.apache.thrift.ProcessFunction { public lockBlock() { super("lockBlock"); } - protected lockBlock_args getEmptyArgsInstance() { + public lockBlock_args getEmptyArgsInstance() { return new lockBlock_args(); } - protected lockBlock_result getResult(I iface, lockBlock_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public lockBlock_result getResult(I iface, lockBlock_args args) throws org.apache.thrift.TException { lockBlock_result result = new lockBlock_result(); iface.lockBlock(args.blockId, args.userId); return result; } } - private static class returnSpace extends org.apache.thrift.ProcessFunction { + public static class returnSpace extends org.apache.thrift.ProcessFunction { public returnSpace() { super("returnSpace"); } - protected returnSpace_args getEmptyArgsInstance() { + public returnSpace_args getEmptyArgsInstance() { return new returnSpace_args(); } - protected returnSpace_result getResult(I iface, returnSpace_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public returnSpace_result getResult(I iface, returnSpace_args args) throws org.apache.thrift.TException { returnSpace_result result = new returnSpace_result(); iface.returnSpace(args.userId, args.returnedBytes); return result; } } - private static class requestSpace extends org.apache.thrift.ProcessFunction { + public static class requestSpace extends org.apache.thrift.ProcessFunction { public requestSpace() { super("requestSpace"); } - protected requestSpace_args getEmptyArgsInstance() { + public requestSpace_args getEmptyArgsInstance() { return new requestSpace_args(); } - protected requestSpace_result getResult(I iface, requestSpace_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public requestSpace_result getResult(I iface, requestSpace_args args) throws org.apache.thrift.TException { requestSpace_result result = new requestSpace_result(); result.success = iface.requestSpace(args.userId, args.requestBytes); result.setSuccessIsSet(true); @@ -927,32 +1061,40 @@ protected requestSpace_result getResult(I iface, requestSpace_args args) throws } } - private static class unlockBlock extends org.apache.thrift.ProcessFunction { + public static class unlockBlock extends org.apache.thrift.ProcessFunction { public unlockBlock() { super("unlockBlock"); } - protected unlockBlock_args getEmptyArgsInstance() { + public unlockBlock_args getEmptyArgsInstance() { return new unlockBlock_args(); } - protected unlockBlock_result getResult(I iface, unlockBlock_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public unlockBlock_result getResult(I iface, unlockBlock_args args) throws org.apache.thrift.TException { unlockBlock_result result = new unlockBlock_result(); iface.unlockBlock(args.blockId, args.userId); return result; } } - private static class userHeartbeat extends org.apache.thrift.ProcessFunction { + public static class userHeartbeat extends org.apache.thrift.ProcessFunction { public userHeartbeat() { super("userHeartbeat"); } - protected userHeartbeat_args getEmptyArgsInstance() { + public userHeartbeat_args getEmptyArgsInstance() { return new userHeartbeat_args(); } - protected userHeartbeat_result getResult(I iface, userHeartbeat_args args) throws org.apache.thrift.TException { + protected boolean isOneway() { + return false; + } + + public userHeartbeat_result getResult(I iface, userHeartbeat_args args) throws org.apache.thrift.TException { userHeartbeat_result result = new userHeartbeat_result(); iface.userHeartbeat(args.userId); return result; @@ -966,6 +1108,12 @@ public static class accessBlock_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new accessBlock_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new accessBlock_argsTupleSchemeFactory()); + } + public long blockId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -1028,8 +1176,7 @@ public String getFieldName() { // isset id assignments private static final int __BLOCKID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -1054,8 +1201,7 @@ public accessBlock_args( * Performs a deep copy on other. */ public accessBlock_args(accessBlock_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.blockId = other.blockId; } @@ -1080,16 +1226,16 @@ public accessBlock_args setBlockId(long blockId) { } public void unsetBlockId() { - __isset_bit_vector.clear(__BLOCKID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID); } /** Returns true if field blockId is set (has been assigned a value) and false otherwise */ public boolean isSetBlockId() { - return __isset_bit_vector.get(__BLOCKID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID); } public void setBlockIdIsSet(boolean value) { - __isset_bit_vector.set(__BLOCKID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -1183,43 +1329,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // BLOCK_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.blockId = iprot.readI64(); - setBlockIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); - oprot.writeI64(this.blockId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -1236,6 +1350,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -1249,19 +1364,107 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class accessBlock_argsStandardSchemeFactory implements SchemeFactory { + public accessBlock_argsStandardScheme getScheme() { + return new accessBlock_argsStandardScheme(); + } + } + + private static class accessBlock_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, accessBlock_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // BLOCK_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, accessBlock_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); + oprot.writeI64(struct.blockId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class accessBlock_argsTupleSchemeFactory implements SchemeFactory { + public accessBlock_argsTupleScheme getScheme() { + return new accessBlock_argsTupleScheme(); + } + } + + private static class accessBlock_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, accessBlock_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetBlockId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetBlockId()) { + oprot.writeI64(struct.blockId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, accessBlock_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } + } + } + } public static class accessBlock_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("accessBlock_result"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new accessBlock_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new accessBlock_resultTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -1401,32 +1604,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } @Override public String toString() { @@ -1439,6 +1622,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -1457,6 +1641,64 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class accessBlock_resultStandardSchemeFactory implements SchemeFactory { + public accessBlock_resultStandardScheme getScheme() { + return new accessBlock_resultStandardScheme(); + } + } + + private static class accessBlock_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, accessBlock_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, accessBlock_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class accessBlock_resultTupleSchemeFactory implements SchemeFactory { + public accessBlock_resultTupleScheme getScheme() { + return new accessBlock_resultTupleScheme(); + } + } + + private static class accessBlock_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, accessBlock_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, accessBlock_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class addCheckpoint_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -1465,6 +1707,12 @@ public static class addCheckpoint_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new addCheckpoint_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new addCheckpoint_argsTupleSchemeFactory()); + } + public long userId; // required public int fileId; // required @@ -1532,8 +1780,7 @@ public String getFieldName() { // isset id assignments private static final int __USERID_ISSET_ID = 0; private static final int __FILEID_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private byte __isset_bitfield = 0; 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); @@ -1563,8 +1810,7 @@ public addCheckpoint_args( * Performs a deep copy on other. */ public addCheckpoint_args(addCheckpoint_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.userId = other.userId; this.fileId = other.fileId; } @@ -1592,16 +1838,16 @@ public addCheckpoint_args setUserId(long userId) { } public void unsetUserId() { - __isset_bit_vector.clear(__USERID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USERID_ISSET_ID); } /** Returns true if field userId is set (has been assigned a value) and false otherwise */ public boolean isSetUserId() { - return __isset_bit_vector.get(__USERID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __USERID_ISSET_ID); } public void setUserIdIsSet(boolean value) { - __isset_bit_vector.set(__USERID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USERID_ISSET_ID, value); } public int getFileId() { @@ -1615,16 +1861,16 @@ public addCheckpoint_args setFileId(int fileId) { } public void unsetFileId() { - __isset_bit_vector.clear(__FILEID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); } /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ public boolean isSetFileId() { - return __isset_bit_vector.get(__FILEID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); } public void setFileIdIsSet(boolean value) { - __isset_bit_vector.set(__FILEID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -1750,54 +1996,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // USER_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.userId = iprot.readI64(); - setUserIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // FILE_ID - if (field.type == org.apache.thrift.protocol.TType.I32) { - this.fileId = iprot.readI32(); - setFileIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(USER_ID_FIELD_DESC); - oprot.writeI64(this.userId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(FILE_ID_FIELD_DESC); - oprot.writeI32(this.fileId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -1818,6 +2021,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -1831,13 +2035,116 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class addCheckpoint_argsStandardSchemeFactory implements SchemeFactory { + public addCheckpoint_argsStandardScheme getScheme() { + return new addCheckpoint_argsStandardScheme(); + } + } + + private static class addCheckpoint_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, addCheckpoint_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // USER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // FILE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, addCheckpoint_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(USER_ID_FIELD_DESC); + oprot.writeI64(struct.userId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(FILE_ID_FIELD_DESC); + oprot.writeI32(struct.fileId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class addCheckpoint_argsTupleSchemeFactory implements SchemeFactory { + public addCheckpoint_argsTupleScheme getScheme() { + return new addCheckpoint_argsTupleScheme(); + } + } + + private static class addCheckpoint_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUserId()) { + optionals.set(0); + } + if (struct.isSetFileId()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetUserId()) { + oprot.writeI64(struct.userId); + } + if (struct.isSetFileId()) { + oprot.writeI32(struct.fileId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } + if (incoming.get(1)) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } + } + } + } public static class addCheckpoint_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -1848,6 +2155,12 @@ public static class addCheckpoint_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new addCheckpoint_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new addCheckpoint_resultTupleSchemeFactory()); + } + public FileDoesNotExistException eP; // required public SuspectedFileSizeException eS; // required public FailedToCheckpointException eF; // required @@ -1921,7 +2234,6 @@ public String getFieldName() { } // 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); @@ -2266,81 +2578,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // E_P - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eP = new FileDoesNotExistException(); - this.eP.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_S - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eS = new SuspectedFileSizeException(); - this.eS.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // E_F - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eF = new FailedToCheckpointException(); - this.eF.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 4: // E_B - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eB = new BlockInfoException(); - this.eB.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetEP()) { - oprot.writeFieldBegin(E_P_FIELD_DESC); - this.eP.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetES()) { - oprot.writeFieldBegin(E_S_FIELD_DESC); - this.eS.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEF()) { - oprot.writeFieldBegin(E_F_FIELD_DESC); - this.eF.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEB()) { - oprot.writeFieldBegin(E_B_FIELD_DESC); - this.eB.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -2384,6 +2627,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -2402,21 +2646,185 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class addCheckpoint_resultStandardSchemeFactory implements SchemeFactory { + public addCheckpoint_resultStandardScheme getScheme() { + return new addCheckpoint_resultStandardScheme(); + } + } + + private static class addCheckpoint_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, addCheckpoint_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // E_P + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eP = new FileDoesNotExistException(); + struct.eP.read(iprot); + struct.setEPIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_S + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eS = new SuspectedFileSizeException(); + struct.eS.read(iprot); + struct.setESIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // E_F + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eF = new FailedToCheckpointException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 4: // E_B + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, addCheckpoint_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.eP != null) { + oprot.writeFieldBegin(E_P_FIELD_DESC); + struct.eP.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eS != null) { + oprot.writeFieldBegin(E_S_FIELD_DESC); + struct.eS.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eF != null) { + oprot.writeFieldBegin(E_F_FIELD_DESC); + struct.eF.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eB != null) { + oprot.writeFieldBegin(E_B_FIELD_DESC); + struct.eB.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class addCheckpoint_resultTupleSchemeFactory implements SchemeFactory { + public addCheckpoint_resultTupleScheme getScheme() { + return new addCheckpoint_resultTupleScheme(); + } + } + + private static class addCheckpoint_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetEP()) { + optionals.set(0); + } + if (struct.isSetES()) { + optionals.set(1); + } + if (struct.isSetEF()) { + optionals.set(2); + } + if (struct.isSetEB()) { + optionals.set(3); + } + oprot.writeBitSet(optionals, 4); + if (struct.isSetEP()) { + struct.eP.write(oprot); + } + if (struct.isSetES()) { + struct.eS.write(oprot); + } + if (struct.isSetEF()) { + struct.eF.write(oprot); + } + if (struct.isSetEB()) { + struct.eB.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, addCheckpoint_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(4); + if (incoming.get(0)) { + struct.eP = new FileDoesNotExistException(); + struct.eP.read(iprot); + struct.setEPIsSet(true); + } + if (incoming.get(1)) { + struct.eS = new SuspectedFileSizeException(); + struct.eS.read(iprot); + struct.setESIsSet(true); + } + if (incoming.get(2)) { + struct.eF = new FailedToCheckpointException(); + struct.eF.read(iprot); + struct.setEFIsSet(true); + } + if (incoming.get(3)) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } + } + } + } - public static class cacheBlock_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { - private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("cacheBlock_args"); + public static class asyncCheckpoint_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("asyncCheckpoint_args"); - private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)1); - private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)2); + private static final org.apache.thrift.protocol.TField FILE_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("fileId", org.apache.thrift.protocol.TType.I32, (short)1); - public long userId; // required - public long blockId; // required + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new asyncCheckpoint_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new asyncCheckpoint_argsTupleSchemeFactory()); + } + + public int fileId; // 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 { - USER_ID((short)1, "userId"), - BLOCK_ID((short)2, "blockId"); + FILE_ID((short)1, "fileId"); private static final Map byName = new HashMap(); @@ -2431,10 +2839,8 @@ public enum _Fields implements org.apache.thrift.TFieldIdEnum { */ public static _Fields findByThriftId(int fieldId) { switch(fieldId) { - case 1: // USER_ID - return USER_ID; - case 2: // BLOCK_ID - return BLOCK_ID; + case 1: // FILE_ID + return FILE_ID; default: return null; } @@ -2475,17 +2881,829 @@ public String getFieldName() { } // isset id assignments - private static final int __USERID_ISSET_ID = 0; - private static final int __BLOCKID_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private static final int __FILEID_ISSET_ID = 0; + private byte __isset_bitfield = 0; 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.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); - tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT, - new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.FILE_ID, new org.apache.thrift.meta_data.FieldMetaData("fileId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I32))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(asyncCheckpoint_args.class, metaDataMap); + } + + public asyncCheckpoint_args() { + } + + public asyncCheckpoint_args( + int fileId) + { + this(); + this.fileId = fileId; + setFileIdIsSet(true); + } + + /** + * Performs a deep copy on other. + */ + public asyncCheckpoint_args(asyncCheckpoint_args other) { + __isset_bitfield = other.__isset_bitfield; + this.fileId = other.fileId; + } + + public asyncCheckpoint_args deepCopy() { + return new asyncCheckpoint_args(this); + } + + @Override + public void clear() { + setFileIdIsSet(false); + this.fileId = 0; + } + + public int getFileId() { + return this.fileId; + } + + public asyncCheckpoint_args setFileId(int fileId) { + this.fileId = fileId; + setFileIdIsSet(true); + return this; + } + + public void unsetFileId() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __FILEID_ISSET_ID); + } + + /** Returns true if field fileId is set (has been assigned a value) and false otherwise */ + public boolean isSetFileId() { + return EncodingUtils.testBit(__isset_bitfield, __FILEID_ISSET_ID); + } + + public void setFileIdIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __FILEID_ISSET_ID, value); + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case FILE_ID: + if (value == null) { + unsetFileId(); + } else { + setFileId((Integer)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case FILE_ID: + return Integer.valueOf(getFileId()); + + } + 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 FILE_ID: + return isSetFileId(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof asyncCheckpoint_args) + return this.equals((asyncCheckpoint_args)that); + return false; + } + + public boolean equals(asyncCheckpoint_args that) { + if (that == null) + return false; + + boolean this_present_fileId = true; + boolean that_present_fileId = true; + if (this_present_fileId || that_present_fileId) { + if (!(this_present_fileId && that_present_fileId)) + return false; + if (this.fileId != that.fileId) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(asyncCheckpoint_args other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + asyncCheckpoint_args typedOther = (asyncCheckpoint_args)other; + + lastComparison = Boolean.valueOf(isSetFileId()).compareTo(typedOther.isSetFileId()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetFileId()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.fileId, typedOther.fileId); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("asyncCheckpoint_args("); + boolean first = true; + + sb.append("fileId:"); + sb.append(this.fileId); + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class asyncCheckpoint_argsStandardSchemeFactory implements SchemeFactory { + public asyncCheckpoint_argsStandardScheme getScheme() { + return new asyncCheckpoint_argsStandardScheme(); + } + } + + private static class asyncCheckpoint_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, asyncCheckpoint_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // FILE_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I32) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, asyncCheckpoint_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(FILE_ID_FIELD_DESC); + oprot.writeI32(struct.fileId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class asyncCheckpoint_argsTupleSchemeFactory implements SchemeFactory { + public asyncCheckpoint_argsTupleScheme getScheme() { + return new asyncCheckpoint_argsTupleScheme(); + } + } + + private static class asyncCheckpoint_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, asyncCheckpoint_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetFileId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetFileId()) { + oprot.writeI32(struct.fileId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, asyncCheckpoint_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.fileId = iprot.readI32(); + struct.setFileIdIsSet(true); + } + } + } + + } + + public static class asyncCheckpoint_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("asyncCheckpoint_result"); + + private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.BOOL, (short)0); + private static final org.apache.thrift.protocol.TField E_FIELD_DESC = new org.apache.thrift.protocol.TField("e", org.apache.thrift.protocol.TType.STRUCT, (short)1); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new asyncCheckpoint_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new asyncCheckpoint_resultTupleSchemeFactory()); + } + + public boolean success; // required + public TachyonException e; // 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 { + SUCCESS((short)0, "success"), + E((short)1, "e"); + + 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 0: // SUCCESS + return SUCCESS; + case 1: // E + return E; + 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 + private static final int __SUCCESS_ISSET_ID = 0; + private byte __isset_bitfield = 0; + 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.SUCCESS, new org.apache.thrift.meta_data.FieldMetaData("success", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.BOOL))); + tmpMap.put(_Fields.E, new org.apache.thrift.meta_data.FieldMetaData("e", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.STRUCT))); + metaDataMap = Collections.unmodifiableMap(tmpMap); + org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(asyncCheckpoint_result.class, metaDataMap); + } + + public asyncCheckpoint_result() { + } + + public asyncCheckpoint_result( + boolean success, + TachyonException e) + { + this(); + this.success = success; + setSuccessIsSet(true); + this.e = e; + } + + /** + * Performs a deep copy on other. + */ + public asyncCheckpoint_result(asyncCheckpoint_result other) { + __isset_bitfield = other.__isset_bitfield; + this.success = other.success; + if (other.isSetE()) { + this.e = new TachyonException(other.e); + } + } + + public asyncCheckpoint_result deepCopy() { + return new asyncCheckpoint_result(this); + } + + @Override + public void clear() { + setSuccessIsSet(false); + this.success = false; + this.e = null; + } + + public boolean isSuccess() { + return this.success; + } + + public asyncCheckpoint_result setSuccess(boolean success) { + this.success = success; + setSuccessIsSet(true); + return this; + } + + public void unsetSuccess() { + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + /** Returns true if field success is set (has been assigned a value) and false otherwise */ + public boolean isSetSuccess() { + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); + } + + public void setSuccessIsSet(boolean value) { + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); + } + + public TachyonException getE() { + return this.e; + } + + public asyncCheckpoint_result setE(TachyonException e) { + this.e = e; + return this; + } + + public void unsetE() { + this.e = null; + } + + /** Returns true if field e is set (has been assigned a value) and false otherwise */ + public boolean isSetE() { + return this.e != null; + } + + public void setEIsSet(boolean value) { + if (!value) { + this.e = null; + } + } + + public void setFieldValue(_Fields field, Object value) { + switch (field) { + case SUCCESS: + if (value == null) { + unsetSuccess(); + } else { + setSuccess((Boolean)value); + } + break; + + case E: + if (value == null) { + unsetE(); + } else { + setE((TachyonException)value); + } + break; + + } + } + + public Object getFieldValue(_Fields field) { + switch (field) { + case SUCCESS: + return Boolean.valueOf(isSuccess()); + + case E: + return getE(); + + } + 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 SUCCESS: + return isSetSuccess(); + case E: + return isSetE(); + } + throw new IllegalStateException(); + } + + @Override + public boolean equals(Object that) { + if (that == null) + return false; + if (that instanceof asyncCheckpoint_result) + return this.equals((asyncCheckpoint_result)that); + return false; + } + + public boolean equals(asyncCheckpoint_result that) { + if (that == null) + return false; + + boolean this_present_success = true; + boolean that_present_success = true; + if (this_present_success || that_present_success) { + if (!(this_present_success && that_present_success)) + return false; + if (this.success != that.success) + return false; + } + + boolean this_present_e = true && this.isSetE(); + boolean that_present_e = true && that.isSetE(); + if (this_present_e || that_present_e) { + if (!(this_present_e && that_present_e)) + return false; + if (!this.e.equals(that.e)) + return false; + } + + return true; + } + + @Override + public int hashCode() { + return 0; + } + + public int compareTo(asyncCheckpoint_result other) { + if (!getClass().equals(other.getClass())) { + return getClass().getName().compareTo(other.getClass().getName()); + } + + int lastComparison = 0; + asyncCheckpoint_result typedOther = (asyncCheckpoint_result)other; + + lastComparison = Boolean.valueOf(isSetSuccess()).compareTo(typedOther.isSetSuccess()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetSuccess()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.success, typedOther.success); + if (lastComparison != 0) { + return lastComparison; + } + } + lastComparison = Boolean.valueOf(isSetE()).compareTo(typedOther.isSetE()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetE()) { + lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.e, typedOther.e); + if (lastComparison != 0) { + return lastComparison; + } + } + return 0; + } + + public _Fields fieldForId(int fieldId) { + return _Fields.findByThriftId(fieldId); + } + + public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder("asyncCheckpoint_result("); + boolean first = true; + + sb.append("success:"); + sb.append(this.success); + first = false; + if (!first) sb.append(", "); + sb.append("e:"); + if (this.e == null) { + sb.append("null"); + } else { + sb.append(this.e); + } + first = false; + sb.append(")"); + return sb.toString(); + } + + public void validate() throws org.apache.thrift.TException { + // check for required fields + // check for sub-struct validity + } + + private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { + try { + write(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(out))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { + try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; + read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); + } catch (org.apache.thrift.TException te) { + throw new java.io.IOException(te); + } + } + + private static class asyncCheckpoint_resultStandardSchemeFactory implements SchemeFactory { + public asyncCheckpoint_resultStandardScheme getScheme() { + return new asyncCheckpoint_resultStandardScheme(); + } + } + + private static class asyncCheckpoint_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, asyncCheckpoint_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 1: // E + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.e = new TachyonException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, asyncCheckpoint_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + if (struct.e != null) { + oprot.writeFieldBegin(E_FIELD_DESC); + struct.e.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class asyncCheckpoint_resultTupleSchemeFactory implements SchemeFactory { + public asyncCheckpoint_resultTupleScheme getScheme() { + return new asyncCheckpoint_resultTupleScheme(); + } + } + + private static class asyncCheckpoint_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, asyncCheckpoint_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + if (struct.isSetE()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + if (struct.isSetE()) { + struct.e.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, asyncCheckpoint_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + if (incoming.get(1)) { + struct.e = new TachyonException(); + struct.e.read(iprot); + struct.setEIsSet(true); + } + } + } + + } + + public static class cacheBlock_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { + private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("cacheBlock_args"); + + private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final org.apache.thrift.protocol.TField BLOCK_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("blockId", org.apache.thrift.protocol.TType.I64, (short)2); + + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new cacheBlock_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new cacheBlock_argsTupleSchemeFactory()); + } + + public long userId; // required + public long blockId; // 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 { + USER_ID((short)1, "userId"), + BLOCK_ID((short)2, "blockId"); + + 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: // USER_ID + return USER_ID; + case 2: // BLOCK_ID + return BLOCK_ID; + 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 + private static final int __USERID_ISSET_ID = 0; + private static final int __BLOCKID_ISSET_ID = 1; + private byte __isset_bitfield = 0; + 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.USER_ID, new org.apache.thrift.meta_data.FieldMetaData("userId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); + tmpMap.put(_Fields.BLOCK_ID, new org.apache.thrift.meta_data.FieldMetaData("blockId", org.apache.thrift.TFieldRequirementType.DEFAULT, + new org.apache.thrift.meta_data.FieldValueMetaData(org.apache.thrift.protocol.TType.I64))); metaDataMap = Collections.unmodifiableMap(tmpMap); org.apache.thrift.meta_data.FieldMetaData.addStructMetaDataMap(cacheBlock_args.class, metaDataMap); } @@ -2508,8 +3726,7 @@ public cacheBlock_args( * Performs a deep copy on other. */ public cacheBlock_args(cacheBlock_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.userId = other.userId; this.blockId = other.blockId; } @@ -2537,16 +3754,16 @@ public cacheBlock_args setUserId(long userId) { } public void unsetUserId() { - __isset_bit_vector.clear(__USERID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USERID_ISSET_ID); } /** Returns true if field userId is set (has been assigned a value) and false otherwise */ public boolean isSetUserId() { - return __isset_bit_vector.get(__USERID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __USERID_ISSET_ID); } public void setUserIdIsSet(boolean value) { - __isset_bit_vector.set(__USERID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USERID_ISSET_ID, value); } public long getBlockId() { @@ -2560,16 +3777,16 @@ public cacheBlock_args setBlockId(long blockId) { } public void unsetBlockId() { - __isset_bit_vector.clear(__BLOCKID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID); } /** Returns true if field blockId is set (has been assigned a value) and false otherwise */ public boolean isSetBlockId() { - return __isset_bit_vector.get(__BLOCKID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID); } public void setBlockIdIsSet(boolean value) { - __isset_bit_vector.set(__BLOCKID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -2695,54 +3912,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // USER_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.userId = iprot.readI64(); - setUserIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // BLOCK_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.blockId = iprot.readI64(); - setBlockIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(USER_ID_FIELD_DESC); - oprot.writeI64(this.userId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); - oprot.writeI64(this.blockId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -2763,6 +3937,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -2776,13 +3951,116 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class cacheBlock_argsStandardSchemeFactory implements SchemeFactory { + public cacheBlock_argsStandardScheme getScheme() { + return new cacheBlock_argsStandardScheme(); + } + } + + private static class cacheBlock_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, cacheBlock_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // USER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // BLOCK_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, cacheBlock_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(USER_ID_FIELD_DESC); + oprot.writeI64(struct.userId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); + oprot.writeI64(struct.blockId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class cacheBlock_argsTupleSchemeFactory implements SchemeFactory { + public cacheBlock_argsTupleScheme getScheme() { + return new cacheBlock_argsTupleScheme(); + } + } + + private static class cacheBlock_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, cacheBlock_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUserId()) { + optionals.set(0); + } + if (struct.isSetBlockId()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetUserId()) { + oprot.writeI64(struct.userId); + } + if (struct.isSetBlockId()) { + oprot.writeI64(struct.blockId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, cacheBlock_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } + if (incoming.get(1)) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } + } + } + } public static class cacheBlock_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -2792,6 +4070,12 @@ public static class cacheBlock_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new cacheBlock_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new cacheBlock_resultTupleSchemeFactory()); + } + public FileDoesNotExistException eP; // required public SuspectedFileSizeException eS; // required public BlockInfoException eB; // required @@ -2861,7 +4145,6 @@ public String getFieldName() { } // 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); @@ -3142,69 +4425,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // E_P - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eP = new FileDoesNotExistException(); - this.eP.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // E_S - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eS = new SuspectedFileSizeException(); - this.eS.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 3: // E_B - if (field.type == org.apache.thrift.protocol.TType.STRUCT) { - this.eB = new BlockInfoException(); - this.eB.read(iprot); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetEP()) { - oprot.writeFieldBegin(E_P_FIELD_DESC); - this.eP.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetES()) { - oprot.writeFieldBegin(E_S_FIELD_DESC); - this.eS.write(oprot); - oprot.writeFieldEnd(); - } else if (this.isSetEB()) { - oprot.writeFieldBegin(E_B_FIELD_DESC); - this.eB.write(oprot); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -3240,6 +4466,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -3258,12 +4485,154 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class cacheBlock_resultStandardSchemeFactory implements SchemeFactory { + public cacheBlock_resultStandardScheme getScheme() { + return new cacheBlock_resultStandardScheme(); + } + } + + private static class cacheBlock_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, cacheBlock_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // E_P + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eP = new FileDoesNotExistException(); + struct.eP.read(iprot); + struct.setEPIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // E_S + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eS = new SuspectedFileSizeException(); + struct.eS.read(iprot); + struct.setESIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 3: // E_B + if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, cacheBlock_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.eP != null) { + oprot.writeFieldBegin(E_P_FIELD_DESC); + struct.eP.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eS != null) { + oprot.writeFieldBegin(E_S_FIELD_DESC); + struct.eS.write(oprot); + oprot.writeFieldEnd(); + } + if (struct.eB != null) { + oprot.writeFieldBegin(E_B_FIELD_DESC); + struct.eB.write(oprot); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class cacheBlock_resultTupleSchemeFactory implements SchemeFactory { + public cacheBlock_resultTupleScheme getScheme() { + return new cacheBlock_resultTupleScheme(); + } + } + + private static class cacheBlock_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, cacheBlock_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetEP()) { + optionals.set(0); + } + if (struct.isSetES()) { + optionals.set(1); + } + if (struct.isSetEB()) { + optionals.set(2); + } + oprot.writeBitSet(optionals, 3); + if (struct.isSetEP()) { + struct.eP.write(oprot); + } + if (struct.isSetES()) { + struct.eS.write(oprot); + } + if (struct.isSetEB()) { + struct.eB.write(oprot); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, cacheBlock_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(3); + if (incoming.get(0)) { + struct.eP = new FileDoesNotExistException(); + struct.eP.read(iprot); + struct.setEPIsSet(true); + } + if (incoming.get(1)) { + struct.eS = new SuspectedFileSizeException(); + struct.eS.read(iprot); + struct.setESIsSet(true); + } + if (incoming.get(2)) { + struct.eB = new BlockInfoException(); + struct.eB.read(iprot); + struct.setEBIsSet(true); + } + } + } + } public static class getDataFolder_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("getDataFolder_args"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getDataFolder_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getDataFolder_argsTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -3403,32 +4772,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -3442,6 +4790,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -3460,6 +4809,64 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class getDataFolder_argsStandardSchemeFactory implements SchemeFactory { + public getDataFolder_argsStandardScheme getScheme() { + return new getDataFolder_argsStandardScheme(); + } + } + + private static class getDataFolder_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getDataFolder_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getDataFolder_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getDataFolder_argsTupleSchemeFactory implements SchemeFactory { + public getDataFolder_argsTupleScheme getScheme() { + return new getDataFolder_argsTupleScheme(); + } + } + + private static class getDataFolder_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getDataFolder_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getDataFolder_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class getDataFolder_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -3467,6 +4874,12 @@ public static class getDataFolder_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getDataFolder_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getDataFolder_resultTupleSchemeFactory()); + } + public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -3528,7 +4941,6 @@ public String getFieldName() { } // 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); @@ -3681,44 +5093,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -3738,6 +5118,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -3756,6 +5137,90 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class getDataFolder_resultStandardSchemeFactory implements SchemeFactory { + public getDataFolder_resultStandardScheme getScheme() { + return new getDataFolder_resultStandardScheme(); + } + } + + private static class getDataFolder_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getDataFolder_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getDataFolder_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getDataFolder_resultTupleSchemeFactory implements SchemeFactory { + public getDataFolder_resultTupleScheme getScheme() { + return new getDataFolder_resultTupleScheme(); + } + } + + private static class getDataFolder_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getDataFolder_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getDataFolder_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + } + } + } public static class getUserTempFolder_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -3763,6 +5228,12 @@ public static class getUserTempFolder_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getUserTempFolder_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getUserTempFolder_argsTupleSchemeFactory()); + } + public long userId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -3825,8 +5296,7 @@ public String getFieldName() { // isset id assignments private static final int __USERID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -3851,8 +5321,7 @@ public getUserTempFolder_args( * Performs a deep copy on other. */ public getUserTempFolder_args(getUserTempFolder_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.userId = other.userId; } @@ -3877,16 +5346,16 @@ public getUserTempFolder_args setUserId(long userId) { } public void unsetUserId() { - __isset_bit_vector.clear(__USERID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USERID_ISSET_ID); } /** Returns true if field userId is set (has been assigned a value) and false otherwise */ public boolean isSetUserId() { - return __isset_bit_vector.get(__USERID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __USERID_ISSET_ID); } public void setUserIdIsSet(boolean value) { - __isset_bit_vector.set(__USERID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USERID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -3980,43 +5449,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // USER_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.userId = iprot.readI64(); - setUserIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(USER_ID_FIELD_DESC); - oprot.writeI64(this.userId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -4033,6 +5470,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -4046,13 +5484,95 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class getUserTempFolder_argsStandardSchemeFactory implements SchemeFactory { + public getUserTempFolder_argsStandardScheme getScheme() { + return new getUserTempFolder_argsStandardScheme(); + } + } + + private static class getUserTempFolder_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getUserTempFolder_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // USER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getUserTempFolder_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(USER_ID_FIELD_DESC); + oprot.writeI64(struct.userId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getUserTempFolder_argsTupleSchemeFactory implements SchemeFactory { + public getUserTempFolder_argsTupleScheme getScheme() { + return new getUserTempFolder_argsTupleScheme(); + } + } + + private static class getUserTempFolder_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getUserTempFolder_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUserId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetUserId()) { + oprot.writeI64(struct.userId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getUserTempFolder_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } + } + } + } public static class getUserTempFolder_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -4060,6 +5580,12 @@ public static class getUserTempFolder_result implements org.apache.thrift.TBase< private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getUserTempFolder_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getUserTempFolder_resultTupleSchemeFactory()); + } + public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -4121,7 +5647,6 @@ public String getFieldName() { } // 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); @@ -4274,44 +5799,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -4331,6 +5824,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -4349,6 +5843,90 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class getUserTempFolder_resultStandardSchemeFactory implements SchemeFactory { + public getUserTempFolder_resultStandardScheme getScheme() { + return new getUserTempFolder_resultStandardScheme(); + } + } + + private static class getUserTempFolder_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getUserTempFolder_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getUserTempFolder_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getUserTempFolder_resultTupleSchemeFactory implements SchemeFactory { + public getUserTempFolder_resultTupleScheme getScheme() { + return new getUserTempFolder_resultTupleScheme(); + } + } + + private static class getUserTempFolder_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getUserTempFolder_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getUserTempFolder_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + } + } + } public static class getUserUnderfsTempFolder_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -4356,6 +5934,12 @@ public static class getUserUnderfsTempFolder_args implements org.apache.thrift.T private static final org.apache.thrift.protocol.TField USER_ID_FIELD_DESC = new org.apache.thrift.protocol.TField("userId", org.apache.thrift.protocol.TType.I64, (short)1); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getUserUnderfsTempFolder_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getUserUnderfsTempFolder_argsTupleSchemeFactory()); + } + public long userId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -4418,8 +6002,7 @@ public String getFieldName() { // isset id assignments private static final int __USERID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -4444,8 +6027,7 @@ public getUserUnderfsTempFolder_args( * Performs a deep copy on other. */ public getUserUnderfsTempFolder_args(getUserUnderfsTempFolder_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.userId = other.userId; } @@ -4470,16 +6052,16 @@ public getUserUnderfsTempFolder_args setUserId(long userId) { } public void unsetUserId() { - __isset_bit_vector.clear(__USERID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USERID_ISSET_ID); } /** Returns true if field userId is set (has been assigned a value) and false otherwise */ public boolean isSetUserId() { - return __isset_bit_vector.get(__USERID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __USERID_ISSET_ID); } public void setUserIdIsSet(boolean value) { - __isset_bit_vector.set(__USERID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USERID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -4573,43 +6155,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // USER_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.userId = iprot.readI64(); - setUserIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(USER_ID_FIELD_DESC); - oprot.writeI64(this.userId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -4626,6 +6176,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -4639,13 +6190,95 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class getUserUnderfsTempFolder_argsStandardSchemeFactory implements SchemeFactory { + public getUserUnderfsTempFolder_argsStandardScheme getScheme() { + return new getUserUnderfsTempFolder_argsStandardScheme(); + } + } + + private static class getUserUnderfsTempFolder_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getUserUnderfsTempFolder_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // USER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getUserUnderfsTempFolder_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(USER_ID_FIELD_DESC); + oprot.writeI64(struct.userId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getUserUnderfsTempFolder_argsTupleSchemeFactory implements SchemeFactory { + public getUserUnderfsTempFolder_argsTupleScheme getScheme() { + return new getUserUnderfsTempFolder_argsTupleScheme(); + } + } + + private static class getUserUnderfsTempFolder_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getUserUnderfsTempFolder_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUserId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetUserId()) { + oprot.writeI64(struct.userId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getUserUnderfsTempFolder_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } + } + } + } public static class getUserUnderfsTempFolder_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -4653,6 +6286,12 @@ public static class getUserUnderfsTempFolder_result implements org.apache.thrift private static final org.apache.thrift.protocol.TField SUCCESS_FIELD_DESC = new org.apache.thrift.protocol.TField("success", org.apache.thrift.protocol.TType.STRING, (short)0); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new getUserUnderfsTempFolder_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new getUserUnderfsTempFolder_resultTupleSchemeFactory()); + } + public String success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -4714,7 +6353,6 @@ public String getFieldName() { } // 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); @@ -4867,44 +6505,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.STRING) { - this.success = iprot.readString(); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeString(this.success); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -4924,6 +6530,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -4942,6 +6549,90 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class getUserUnderfsTempFolder_resultStandardSchemeFactory implements SchemeFactory { + public getUserUnderfsTempFolder_resultStandardScheme getScheme() { + return new getUserUnderfsTempFolder_resultStandardScheme(); + } + } + + private static class getUserUnderfsTempFolder_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, getUserUnderfsTempFolder_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.STRING) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, getUserUnderfsTempFolder_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.success != null) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeString(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class getUserUnderfsTempFolder_resultTupleSchemeFactory implements SchemeFactory { + public getUserUnderfsTempFolder_resultTupleScheme getScheme() { + return new getUserUnderfsTempFolder_resultTupleScheme(); + } + } + + private static class getUserUnderfsTempFolder_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, getUserUnderfsTempFolder_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeString(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, getUserUnderfsTempFolder_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readString(); + struct.setSuccessIsSet(true); + } + } + } + } public static class lockBlock_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -4950,6 +6641,12 @@ public static class lockBlock_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new lockBlock_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new lockBlock_argsTupleSchemeFactory()); + } + public long blockId; // required public long userId; // required @@ -5017,8 +6714,7 @@ public String getFieldName() { // isset id assignments private static final int __BLOCKID_ISSET_ID = 0; private static final int __USERID_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private byte __isset_bitfield = 0; 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); @@ -5048,8 +6744,7 @@ public lockBlock_args( * Performs a deep copy on other. */ public lockBlock_args(lockBlock_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.blockId = other.blockId; this.userId = other.userId; } @@ -5077,16 +6772,16 @@ public lockBlock_args setBlockId(long blockId) { } public void unsetBlockId() { - __isset_bit_vector.clear(__BLOCKID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID); } /** Returns true if field blockId is set (has been assigned a value) and false otherwise */ public boolean isSetBlockId() { - return __isset_bit_vector.get(__BLOCKID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID); } public void setBlockIdIsSet(boolean value) { - __isset_bit_vector.set(__BLOCKID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value); } public long getUserId() { @@ -5100,16 +6795,16 @@ public lockBlock_args setUserId(long userId) { } public void unsetUserId() { - __isset_bit_vector.clear(__USERID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USERID_ISSET_ID); } /** Returns true if field userId is set (has been assigned a value) and false otherwise */ public boolean isSetUserId() { - return __isset_bit_vector.get(__USERID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __USERID_ISSET_ID); } public void setUserIdIsSet(boolean value) { - __isset_bit_vector.set(__USERID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USERID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -5235,54 +6930,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // BLOCK_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.blockId = iprot.readI64(); - setBlockIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // USER_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.userId = iprot.readI64(); - setUserIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); - oprot.writeI64(this.blockId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(USER_ID_FIELD_DESC); - oprot.writeI64(this.userId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -5303,6 +6955,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -5316,19 +6969,128 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class lockBlock_argsStandardSchemeFactory implements SchemeFactory { + public lockBlock_argsStandardScheme getScheme() { + return new lockBlock_argsStandardScheme(); + } + } + + private static class lockBlock_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, lockBlock_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // BLOCK_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // USER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, lockBlock_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); + oprot.writeI64(struct.blockId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(USER_ID_FIELD_DESC); + oprot.writeI64(struct.userId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class lockBlock_argsTupleSchemeFactory implements SchemeFactory { + public lockBlock_argsTupleScheme getScheme() { + return new lockBlock_argsTupleScheme(); + } + } + + private static class lockBlock_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, lockBlock_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetBlockId()) { + optionals.set(0); + } + if (struct.isSetUserId()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetBlockId()) { + oprot.writeI64(struct.blockId); + } + if (struct.isSetUserId()) { + oprot.writeI64(struct.userId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, lockBlock_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } + if (incoming.get(1)) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } + } + } + } public static class lockBlock_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("lockBlock_result"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new lockBlock_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new lockBlock_resultTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -5468,32 +7230,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } @Override public String toString() { @@ -5506,6 +7248,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -5524,6 +7267,64 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class lockBlock_resultStandardSchemeFactory implements SchemeFactory { + public lockBlock_resultStandardScheme getScheme() { + return new lockBlock_resultStandardScheme(); + } + } + + private static class lockBlock_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, lockBlock_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, lockBlock_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class lockBlock_resultTupleSchemeFactory implements SchemeFactory { + public lockBlock_resultTupleScheme getScheme() { + return new lockBlock_resultTupleScheme(); + } + } + + private static class lockBlock_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, lockBlock_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, lockBlock_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class returnSpace_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -5532,6 +7333,12 @@ public static class returnSpace_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new returnSpace_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new returnSpace_argsTupleSchemeFactory()); + } + public long userId; // required public long returnedBytes; // required @@ -5599,8 +7406,7 @@ public String getFieldName() { // isset id assignments private static final int __USERID_ISSET_ID = 0; private static final int __RETURNEDBYTES_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private byte __isset_bitfield = 0; 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); @@ -5630,8 +7436,7 @@ public returnSpace_args( * Performs a deep copy on other. */ public returnSpace_args(returnSpace_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.userId = other.userId; this.returnedBytes = other.returnedBytes; } @@ -5659,16 +7464,16 @@ public returnSpace_args setUserId(long userId) { } public void unsetUserId() { - __isset_bit_vector.clear(__USERID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USERID_ISSET_ID); } /** Returns true if field userId is set (has been assigned a value) and false otherwise */ public boolean isSetUserId() { - return __isset_bit_vector.get(__USERID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __USERID_ISSET_ID); } public void setUserIdIsSet(boolean value) { - __isset_bit_vector.set(__USERID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USERID_ISSET_ID, value); } public long getReturnedBytes() { @@ -5682,16 +7487,16 @@ public returnSpace_args setReturnedBytes(long returnedBytes) { } public void unsetReturnedBytes() { - __isset_bit_vector.clear(__RETURNEDBYTES_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __RETURNEDBYTES_ISSET_ID); } /** Returns true if field returnedBytes is set (has been assigned a value) and false otherwise */ public boolean isSetReturnedBytes() { - return __isset_bit_vector.get(__RETURNEDBYTES_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __RETURNEDBYTES_ISSET_ID); } public void setReturnedBytesIsSet(boolean value) { - __isset_bit_vector.set(__RETURNEDBYTES_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __RETURNEDBYTES_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -5817,54 +7622,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // USER_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.userId = iprot.readI64(); - setUserIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // RETURNED_BYTES - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.returnedBytes = iprot.readI64(); - setReturnedBytesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(USER_ID_FIELD_DESC); - oprot.writeI64(this.userId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(RETURNED_BYTES_FIELD_DESC); - oprot.writeI64(this.returnedBytes); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -5885,6 +7647,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -5898,19 +7661,128 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class returnSpace_argsStandardSchemeFactory implements SchemeFactory { + public returnSpace_argsStandardScheme getScheme() { + return new returnSpace_argsStandardScheme(); + } + } + + private static class returnSpace_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, returnSpace_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // USER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // RETURNED_BYTES + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.returnedBytes = iprot.readI64(); + struct.setReturnedBytesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, returnSpace_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(USER_ID_FIELD_DESC); + oprot.writeI64(struct.userId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(RETURNED_BYTES_FIELD_DESC); + oprot.writeI64(struct.returnedBytes); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class returnSpace_argsTupleSchemeFactory implements SchemeFactory { + public returnSpace_argsTupleScheme getScheme() { + return new returnSpace_argsTupleScheme(); + } + } + + private static class returnSpace_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, returnSpace_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUserId()) { + optionals.set(0); + } + if (struct.isSetReturnedBytes()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetUserId()) { + oprot.writeI64(struct.userId); + } + if (struct.isSetReturnedBytes()) { + oprot.writeI64(struct.returnedBytes); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, returnSpace_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } + if (incoming.get(1)) { + struct.returnedBytes = iprot.readI64(); + struct.setReturnedBytesIsSet(true); + } + } + } + } public static class returnSpace_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("returnSpace_result"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new returnSpace_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new returnSpace_resultTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -6050,32 +7922,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } @Override public String toString() { @@ -6088,6 +7940,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -6106,6 +7959,64 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class returnSpace_resultStandardSchemeFactory implements SchemeFactory { + public returnSpace_resultStandardScheme getScheme() { + return new returnSpace_resultStandardScheme(); + } + } + + private static class returnSpace_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, returnSpace_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, returnSpace_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class returnSpace_resultTupleSchemeFactory implements SchemeFactory { + public returnSpace_resultTupleScheme getScheme() { + return new returnSpace_resultTupleScheme(); + } + } + + private static class returnSpace_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, returnSpace_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, returnSpace_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class requestSpace_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -6114,6 +8025,12 @@ public static class requestSpace_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new requestSpace_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new requestSpace_argsTupleSchemeFactory()); + } + public long userId; // required public long requestBytes; // required @@ -6181,8 +8098,7 @@ public String getFieldName() { // isset id assignments private static final int __USERID_ISSET_ID = 0; private static final int __REQUESTBYTES_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private byte __isset_bitfield = 0; 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); @@ -6212,8 +8128,7 @@ public requestSpace_args( * Performs a deep copy on other. */ public requestSpace_args(requestSpace_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.userId = other.userId; this.requestBytes = other.requestBytes; } @@ -6241,16 +8156,16 @@ public requestSpace_args setUserId(long userId) { } public void unsetUserId() { - __isset_bit_vector.clear(__USERID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USERID_ISSET_ID); } /** Returns true if field userId is set (has been assigned a value) and false otherwise */ public boolean isSetUserId() { - return __isset_bit_vector.get(__USERID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __USERID_ISSET_ID); } public void setUserIdIsSet(boolean value) { - __isset_bit_vector.set(__USERID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USERID_ISSET_ID, value); } public long getRequestBytes() { @@ -6264,16 +8179,16 @@ public requestSpace_args setRequestBytes(long requestBytes) { } public void unsetRequestBytes() { - __isset_bit_vector.clear(__REQUESTBYTES_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __REQUESTBYTES_ISSET_ID); } /** Returns true if field requestBytes is set (has been assigned a value) and false otherwise */ public boolean isSetRequestBytes() { - return __isset_bit_vector.get(__REQUESTBYTES_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __REQUESTBYTES_ISSET_ID); } public void setRequestBytesIsSet(boolean value) { - __isset_bit_vector.set(__REQUESTBYTES_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __REQUESTBYTES_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -6399,54 +8314,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // USER_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.userId = iprot.readI64(); - setUserIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // REQUEST_BYTES - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.requestBytes = iprot.readI64(); - setRequestBytesIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(USER_ID_FIELD_DESC); - oprot.writeI64(this.userId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(REQUEST_BYTES_FIELD_DESC); - oprot.writeI64(this.requestBytes); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -6467,6 +8339,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -6480,13 +8353,116 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class requestSpace_argsStandardSchemeFactory implements SchemeFactory { + public requestSpace_argsStandardScheme getScheme() { + return new requestSpace_argsStandardScheme(); + } + } + + private static class requestSpace_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, requestSpace_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // USER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // REQUEST_BYTES + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.requestBytes = iprot.readI64(); + struct.setRequestBytesIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, requestSpace_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(USER_ID_FIELD_DESC); + oprot.writeI64(struct.userId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(REQUEST_BYTES_FIELD_DESC); + oprot.writeI64(struct.requestBytes); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class requestSpace_argsTupleSchemeFactory implements SchemeFactory { + public requestSpace_argsTupleScheme getScheme() { + return new requestSpace_argsTupleScheme(); + } + } + + private static class requestSpace_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, requestSpace_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUserId()) { + optionals.set(0); + } + if (struct.isSetRequestBytes()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetUserId()) { + oprot.writeI64(struct.userId); + } + if (struct.isSetRequestBytes()) { + oprot.writeI64(struct.requestBytes); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, requestSpace_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } + if (incoming.get(1)) { + struct.requestBytes = iprot.readI64(); + struct.setRequestBytesIsSet(true); + } + } + } + } public static class requestSpace_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -6494,6 +8470,12 @@ public static class requestSpace_result implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new requestSpace_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new requestSpace_resultTupleSchemeFactory()); + } + public boolean success; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -6556,8 +8538,7 @@ public String getFieldName() { // isset id assignments private static final int __SUCCESS_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -6582,8 +8563,7 @@ public requestSpace_result( * Performs a deep copy on other. */ public requestSpace_result(requestSpace_result other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.success = other.success; } @@ -6608,16 +8588,16 @@ public requestSpace_result setSuccess(boolean success) { } public void unsetSuccess() { - __isset_bit_vector.clear(__SUCCESS_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __SUCCESS_ISSET_ID); } /** Returns true if field success is set (has been assigned a value) and false otherwise */ public boolean isSetSuccess() { - return __isset_bit_vector.get(__SUCCESS_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __SUCCESS_ISSET_ID); } public void setSuccessIsSet(boolean value) { - __isset_bit_vector.set(__SUCCESS_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __SUCCESS_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -6711,45 +8691,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 0: // SUCCESS - if (field.type == org.apache.thrift.protocol.TType.BOOL) { - this.success = iprot.readBool(); - setSuccessIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - if (this.isSetSuccess()) { - oprot.writeFieldBegin(SUCCESS_FIELD_DESC); - oprot.writeBool(this.success); - oprot.writeFieldEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } @Override public String toString() { @@ -6765,6 +8712,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -6777,12 +8725,98 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { + // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class requestSpace_resultStandardSchemeFactory implements SchemeFactory { + public requestSpace_resultStandardScheme getScheme() { + return new requestSpace_resultStandardScheme(); + } + } + + private static class requestSpace_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, requestSpace_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 0: // SUCCESS + if (schemeField.type == org.apache.thrift.protocol.TType.BOOL) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, requestSpace_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + if (struct.isSetSuccess()) { + oprot.writeFieldBegin(SUCCESS_FIELD_DESC); + oprot.writeBool(struct.success); + oprot.writeFieldEnd(); + } + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class requestSpace_resultTupleSchemeFactory implements SchemeFactory { + public requestSpace_resultTupleScheme getScheme() { + return new requestSpace_resultTupleScheme(); + } + } + + private static class requestSpace_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, requestSpace_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetSuccess()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetSuccess()) { + oprot.writeBool(struct.success); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, requestSpace_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.success = iprot.readBool(); + struct.setSuccessIsSet(true); + } + } + } + } public static class unlockBlock_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -6791,6 +8825,12 @@ public static class unlockBlock_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new unlockBlock_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new unlockBlock_argsTupleSchemeFactory()); + } + public long blockId; // required public long userId; // required @@ -6858,8 +8898,7 @@ public String getFieldName() { // isset id assignments private static final int __BLOCKID_ISSET_ID = 0; private static final int __USERID_ISSET_ID = 1; - private BitSet __isset_bit_vector = new BitSet(2); - + private byte __isset_bitfield = 0; 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); @@ -6889,8 +8928,7 @@ public unlockBlock_args( * Performs a deep copy on other. */ public unlockBlock_args(unlockBlock_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.blockId = other.blockId; this.userId = other.userId; } @@ -6918,16 +8956,16 @@ public unlockBlock_args setBlockId(long blockId) { } public void unsetBlockId() { - __isset_bit_vector.clear(__BLOCKID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __BLOCKID_ISSET_ID); } /** Returns true if field blockId is set (has been assigned a value) and false otherwise */ public boolean isSetBlockId() { - return __isset_bit_vector.get(__BLOCKID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __BLOCKID_ISSET_ID); } public void setBlockIdIsSet(boolean value) { - __isset_bit_vector.set(__BLOCKID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __BLOCKID_ISSET_ID, value); } public long getUserId() { @@ -6941,16 +8979,16 @@ public unlockBlock_args setUserId(long userId) { } public void unsetUserId() { - __isset_bit_vector.clear(__USERID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USERID_ISSET_ID); } /** Returns true if field userId is set (has been assigned a value) and false otherwise */ public boolean isSetUserId() { - return __isset_bit_vector.get(__USERID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __USERID_ISSET_ID); } public void setUserIdIsSet(boolean value) { - __isset_bit_vector.set(__USERID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USERID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -7076,54 +9114,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // BLOCK_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.blockId = iprot.readI64(); - setBlockIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - case 2: // USER_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.userId = iprot.readI64(); - setUserIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); - oprot.writeI64(this.blockId); - oprot.writeFieldEnd(); - oprot.writeFieldBegin(USER_ID_FIELD_DESC); - oprot.writeI64(this.userId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -7144,6 +9139,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -7157,19 +9153,128 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class unlockBlock_argsStandardSchemeFactory implements SchemeFactory { + public unlockBlock_argsStandardScheme getScheme() { + return new unlockBlock_argsStandardScheme(); + } + } + + private static class unlockBlock_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, unlockBlock_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // BLOCK_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + case 2: // USER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, unlockBlock_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(BLOCK_ID_FIELD_DESC); + oprot.writeI64(struct.blockId); + oprot.writeFieldEnd(); + oprot.writeFieldBegin(USER_ID_FIELD_DESC); + oprot.writeI64(struct.userId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class unlockBlock_argsTupleSchemeFactory implements SchemeFactory { + public unlockBlock_argsTupleScheme getScheme() { + return new unlockBlock_argsTupleScheme(); + } + } + + private static class unlockBlock_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, unlockBlock_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetBlockId()) { + optionals.set(0); + } + if (struct.isSetUserId()) { + optionals.set(1); + } + oprot.writeBitSet(optionals, 2); + if (struct.isSetBlockId()) { + oprot.writeI64(struct.blockId); + } + if (struct.isSetUserId()) { + oprot.writeI64(struct.userId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, unlockBlock_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(2); + if (incoming.get(0)) { + struct.blockId = iprot.readI64(); + struct.setBlockIdIsSet(true); + } + if (incoming.get(1)) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } + } + } + } public static class unlockBlock_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("unlockBlock_result"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new unlockBlock_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new unlockBlock_resultTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -7309,32 +9414,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } @Override public String toString() { @@ -7347,6 +9432,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -7365,6 +9451,64 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class unlockBlock_resultStandardSchemeFactory implements SchemeFactory { + public unlockBlock_resultStandardScheme getScheme() { + return new unlockBlock_resultStandardScheme(); + } + } + + private static class unlockBlock_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, unlockBlock_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, unlockBlock_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class unlockBlock_resultTupleSchemeFactory implements SchemeFactory { + public unlockBlock_resultTupleScheme getScheme() { + return new unlockBlock_resultTupleScheme(); + } + } + + private static class unlockBlock_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, unlockBlock_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, unlockBlock_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } public static class userHeartbeat_args implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { @@ -7372,6 +9516,12 @@ public static class userHeartbeat_args implements org.apache.thrift.TBase, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new userHeartbeat_argsStandardSchemeFactory()); + schemes.put(TupleScheme.class, new userHeartbeat_argsTupleSchemeFactory()); + } + public long userId; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ @@ -7434,8 +9584,7 @@ public String getFieldName() { // isset id assignments private static final int __USERID_ISSET_ID = 0; - private BitSet __isset_bit_vector = new BitSet(1); - + private byte __isset_bitfield = 0; 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); @@ -7460,8 +9609,7 @@ public userHeartbeat_args( * Performs a deep copy on other. */ public userHeartbeat_args(userHeartbeat_args other) { - __isset_bit_vector.clear(); - __isset_bit_vector.or(other.__isset_bit_vector); + __isset_bitfield = other.__isset_bitfield; this.userId = other.userId; } @@ -7486,16 +9634,16 @@ public userHeartbeat_args setUserId(long userId) { } public void unsetUserId() { - __isset_bit_vector.clear(__USERID_ISSET_ID); + __isset_bitfield = EncodingUtils.clearBit(__isset_bitfield, __USERID_ISSET_ID); } /** Returns true if field userId is set (has been assigned a value) and false otherwise */ public boolean isSetUserId() { - return __isset_bit_vector.get(__USERID_ISSET_ID); + return EncodingUtils.testBit(__isset_bitfield, __USERID_ISSET_ID); } public void setUserIdIsSet(boolean value) { - __isset_bit_vector.set(__USERID_ISSET_ID, value); + __isset_bitfield = EncodingUtils.setBit(__isset_bitfield, __USERID_ISSET_ID, value); } public void setFieldValue(_Fields field, Object value) { @@ -7589,43 +9737,11 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - case 1: // USER_ID - if (field.type == org.apache.thrift.protocol.TType.I64) { - this.userId = iprot.readI64(); - setUserIdIsSet(true); - } else { - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - break; - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - validate(); - - oprot.writeStructBegin(STRUCT_DESC); - oprot.writeFieldBegin(USER_ID_FIELD_DESC); - oprot.writeI64(this.userId); - oprot.writeFieldEnd(); - oprot.writeFieldStop(); - oprot.writeStructEnd(); + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); } @Override @@ -7642,6 +9758,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -7655,19 +9772,107 @@ private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOExcept private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { // it doesn't seem like you should have to do this, but java serialization is wacky, and doesn't call the default constructor. - __isset_bit_vector = new BitSet(1); + __isset_bitfield = 0; read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } } + private static class userHeartbeat_argsStandardSchemeFactory implements SchemeFactory { + public userHeartbeat_argsStandardScheme getScheme() { + return new userHeartbeat_argsStandardScheme(); + } + } + + private static class userHeartbeat_argsStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, userHeartbeat_args struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + case 1: // USER_ID + if (schemeField.type == org.apache.thrift.protocol.TType.I64) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } else { + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, userHeartbeat_args struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldBegin(USER_ID_FIELD_DESC); + oprot.writeI64(struct.userId); + oprot.writeFieldEnd(); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class userHeartbeat_argsTupleSchemeFactory implements SchemeFactory { + public userHeartbeat_argsTupleScheme getScheme() { + return new userHeartbeat_argsTupleScheme(); + } + } + + private static class userHeartbeat_argsTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, userHeartbeat_args struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + BitSet optionals = new BitSet(); + if (struct.isSetUserId()) { + optionals.set(0); + } + oprot.writeBitSet(optionals, 1); + if (struct.isSetUserId()) { + oprot.writeI64(struct.userId); + } + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, userHeartbeat_args struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + BitSet incoming = iprot.readBitSet(1); + if (incoming.get(0)) { + struct.userId = iprot.readI64(); + struct.setUserIdIsSet(true); + } + } + } + } public static class userHeartbeat_result implements org.apache.thrift.TBase, java.io.Serializable, Cloneable { private static final org.apache.thrift.protocol.TStruct STRUCT_DESC = new org.apache.thrift.protocol.TStruct("userHeartbeat_result"); + private static final Map, SchemeFactory> schemes = new HashMap, SchemeFactory>(); + static { + schemes.put(StandardScheme.class, new userHeartbeat_resultStandardSchemeFactory()); + schemes.put(TupleScheme.class, new userHeartbeat_resultTupleSchemeFactory()); + } + /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements org.apache.thrift.TFieldIdEnum { @@ -7807,32 +10012,12 @@ public _Fields fieldForId(int fieldId) { } public void read(org.apache.thrift.protocol.TProtocol iprot) throws org.apache.thrift.TException { - org.apache.thrift.protocol.TField field; - iprot.readStructBegin(); - while (true) - { - field = iprot.readFieldBegin(); - if (field.type == org.apache.thrift.protocol.TType.STOP) { - break; - } - switch (field.id) { - default: - org.apache.thrift.protocol.TProtocolUtil.skip(iprot, field.type); - } - iprot.readFieldEnd(); - } - iprot.readStructEnd(); - - // check for required fields of primitive type, which can't be checked in the validate method - validate(); + schemes.get(iprot.getScheme()).getScheme().read(iprot, this); } public void write(org.apache.thrift.protocol.TProtocol oprot) throws org.apache.thrift.TException { - oprot.writeStructBegin(STRUCT_DESC); - - oprot.writeFieldStop(); - oprot.writeStructEnd(); - } + schemes.get(oprot.getScheme()).getScheme().write(oprot, this); + } @Override public String toString() { @@ -7845,6 +10030,7 @@ public String toString() { public void validate() throws org.apache.thrift.TException { // check for required fields + // check for sub-struct validity } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -7863,6 +10049,64 @@ private void readObject(java.io.ObjectInputStream in) throws java.io.IOException } } + private static class userHeartbeat_resultStandardSchemeFactory implements SchemeFactory { + public userHeartbeat_resultStandardScheme getScheme() { + return new userHeartbeat_resultStandardScheme(); + } + } + + private static class userHeartbeat_resultStandardScheme extends StandardScheme { + + public void read(org.apache.thrift.protocol.TProtocol iprot, userHeartbeat_result struct) throws org.apache.thrift.TException { + org.apache.thrift.protocol.TField schemeField; + iprot.readStructBegin(); + while (true) + { + schemeField = iprot.readFieldBegin(); + if (schemeField.type == org.apache.thrift.protocol.TType.STOP) { + break; + } + switch (schemeField.id) { + default: + org.apache.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + iprot.readFieldEnd(); + } + iprot.readStructEnd(); + + // check for required fields of primitive type, which can't be checked in the validate method + struct.validate(); + } + + public void write(org.apache.thrift.protocol.TProtocol oprot, userHeartbeat_result struct) throws org.apache.thrift.TException { + struct.validate(); + + oprot.writeStructBegin(STRUCT_DESC); + oprot.writeFieldStop(); + oprot.writeStructEnd(); + } + + } + + private static class userHeartbeat_resultTupleSchemeFactory implements SchemeFactory { + public userHeartbeat_resultTupleScheme getScheme() { + return new userHeartbeat_resultTupleScheme(); + } + } + + private static class userHeartbeat_resultTupleScheme extends TupleScheme { + + @Override + public void write(org.apache.thrift.protocol.TProtocol prot, userHeartbeat_result struct) throws org.apache.thrift.TException { + TTupleProtocol oprot = (TTupleProtocol) prot; + } + + @Override + public void read(org.apache.thrift.protocol.TProtocol prot, userHeartbeat_result struct) throws org.apache.thrift.TException { + TTupleProtocol iprot = (TTupleProtocol) prot; + } + } + } } diff --git a/src/main/java/tachyon/util/CommonUtils.java b/src/main/java/tachyon/util/CommonUtils.java index f1decfad6bfc..b64c1f776251 100644 --- a/src/main/java/tachyon/util/CommonUtils.java +++ b/src/main/java/tachyon/util/CommonUtils.java @@ -1,13 +1,11 @@ /* * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with + * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * + * the License. You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -16,37 +14,69 @@ */ package tachyon.util; +import java.io.File; import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.PrintStream; import java.net.InetSocketAddress; -import java.net.URI; import java.nio.ByteBuffer; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.attribute.PosixFilePermission; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.Date; -import java.util.EnumSet; import java.util.List; -import java.util.Set; +import java.util.Scanner; -import org.apache.commons.lang3.StringEscapeUtils; import org.apache.log4j.Logger; import tachyon.Constants; +import tachyon.UnderFileSystem; import tachyon.thrift.InvalidPathException; -import static java.nio.file.attribute.PosixFilePermission.*; - /** * Common utilities shared by all components in Tachyon. */ public final class CommonUtils { private static final Logger LOG = Logger.getLogger(""); - private CommonUtils () { + /** + * Change local file's permission. + * + * @param filePath + * that will change permission + * @param perms + * the permission, e.g. "775" + * @throws IOException + */ + public static void changeLocalFilePermission(String filePath, String perms) throws IOException { + List commands = new ArrayList(); + commands.add("/bin/chmod"); + commands.add(perms); + File file = new File(filePath); + commands.add(file.getAbsolutePath()); + + try { + ProcessBuilder builder = new ProcessBuilder(commands); + Process process = builder.start(); + + redirectStreamAsync(process.getInputStream(), System.out); + redirectStreamAsync(process.getErrorStream(), System.err); + + process.waitFor(); + + if (process.exitValue() != 0) { + throw new IOException("Can not change the file " + file.getAbsolutePath() + + " 's permission to be " + perms); + } + } catch (InterruptedException e) { + LOG.error(e.getMessage()); + throw new IOException(e); + } + } + + public static void changeLocalFileToFullPermission(String filePath) throws IOException { + changeLocalFilePermission(filePath, "777"); } public static String cleanPath(String path) throws IOException { @@ -61,9 +91,8 @@ public static String cleanPath(String path) throws IOException { public static ByteBuffer cloneByteBuffer(ByteBuffer buf) { ByteBuffer ret = ByteBuffer.allocate(buf.limit() - buf.position()); - ret.put(buf); + ret.put(buf.array(), buf.position(), buf.limit() - buf.position()); ret.flip(); - buf.flip(); return ret; } @@ -75,16 +104,16 @@ public static List cloneByteBufferList(List source) { return ret; } - public static String convertByteArrayToString(byte[] data) { + public static String convertByteArrayToStringWithoutEscape(byte[] data) { StringBuilder sb = new StringBuilder(data.length); - for (int i = 0; i < data.length; ++ i) { + for (int i = 0; i < data.length; i ++) { if (data[i] < 128) { sb.append((char) data[i]); } else { return null; } } - return StringEscapeUtils.escapeHtml3(sb.toString()).replace("\n", "
    "); + return sb.toString(); } public static String convertMsToClockTime(long Millis) { @@ -93,8 +122,13 @@ public static String convertMsToClockTime(long Millis) { long mins = (Millis % Constants.HOUR_MS) / Constants.MINUTE_MS; long secs = (Millis % Constants.MINUTE_MS) / Constants.SECOND_MS; - return String.format("%d day(s), %d hour(s), %d minute(s), and %d second(s)", - days, hours, mins, secs); + return String.format("%d day(s), %d hour(s), %d minute(s), and %d second(s)", days, hours, + mins, secs); + } + + public static String convertMsToDate(long Millis) { + DateFormat formatter = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss:SSS"); + return formatter.format(new Date(Millis)); } public static String convertMsToShortClockTime(long Millis) { @@ -106,33 +140,20 @@ public static String convertMsToShortClockTime(long Millis) { return String.format("%d d, %d h, %d m, and %d s", days, hours, mins, secs); } - public static String convertMsToDate(long Millis) { - DateFormat formatter = new SimpleDateFormat("MM-dd-yyyy HH:mm:ss:SSS"); - return formatter.format(new Date(Millis)); - } - public static String convertMsToSimpleDate(long Millis) { DateFormat formatter = new SimpleDateFormat("MM-dd-yyyy"); return formatter.format(new Date(Millis)); } public static ByteBuffer generateNewByteBufferFromThriftRPCResults(ByteBuffer data) { - // TODO this is a trick to fix the issue in thrift. Change the code to use metadata directly - // when thrift fixes the issue. + // TODO this is a trick to fix the issue in thrift. Change the code to use + // metadata directly when thrift fixes the issue. ByteBuffer correctData = ByteBuffer.allocate(data.limit() - data.position()); correctData.put(data); correctData.flip(); return correctData; } - public static long getCurrentMs() { - return System.currentTimeMillis(); - } - - public static long getCurrentNs() { - return System.nanoTime(); - } - public static long getBlockIdFromFileName(String name) { long fileId; try { @@ -143,7 +164,15 @@ public static long getBlockIdFromFileName(String name) { return fileId; } - public static int getMB(int bytes) { + public static long getCurrentMs() { + return System.currentTimeMillis(); + } + + public static long getCurrentNs() { + return System.nanoTime(); + } + + public static long getMB(long bytes) { return bytes / Constants.MB; } @@ -164,15 +193,15 @@ public static String getSizeFromBytes(long bytes) { return String.format("%.2f GB", ret); } - public static void illegalArgumentException(String msg) { - throw new IllegalArgumentException(msg); - } - public static void illegalArgumentException(Exception e) { LOG.error(e.getMessage(), e); throw new IllegalArgumentException(e); } + public static void illegalArgumentException(String msg) { + throw new IllegalArgumentException(msg); + } + public static String listToString(List list) { StringBuilder sb = new StringBuilder(); for (int k = 0; k < list.size(); k ++) { @@ -181,7 +210,12 @@ public static String listToString(List list) { return sb.toString(); } - public static String parametersToString(Object ... objs) { + public static boolean mkdirs(String path) throws IOException { + UnderFileSystem ufs = UnderFileSystem.get(path); + return ufs.mkdirs(path, true); + } + + public static String parametersToString(Object... objs) { StringBuilder sb = new StringBuilder("("); for (int k = 0; k < objs.length; k ++) { if (k != 0) { @@ -193,6 +227,24 @@ public static String parametersToString(Object ... objs) { return sb.toString(); } + /** + * Parse InetSocketAddress from a String + * + * @param address + * @return + * @throws IOException + */ + public static InetSocketAddress parseInetSocketAddress(String address) throws IOException { + if (address == null) { + return null; + } + String[] strArr = address.split(":"); + if (strArr.length != 2) { + throw new IOException("Invalid InetSocketAddress " + address); + } + return new InetSocketAddress(strArr[0], Integer.parseInt(strArr[1])); + } + public static long parseMemorySize(String memorySize) { double alpha = 0.0001; String ori = memorySize; @@ -209,21 +261,20 @@ public static long parseMemorySize(String memorySize) { memorySize = memorySize.substring(0, tIndex + 1); double ret = Double.parseDouble(memorySize); end = end.toLowerCase(); - switch (end) { - case "": - case "b": + if (end.isEmpty() || end.equals("b")) { return (long) (ret + alpha); - case "kb": + } else if (end.equals("kb")) { return (long) (ret * Constants.KB + alpha); - case "mb": + } else if (end.equals("mb")) { return (long) (ret * Constants.MB + alpha); - case "gb": + } else if (end.equals("gb")) { return (long) (ret * Constants.GB + alpha); - case "tb": + } else if (end.equals("tb")) { return (long) (ret * Constants.TB + alpha); + } else { + runtimeException("Fail to parse " + ori + " as memory size"); + return -1; } - runtimeException("Fail to parse " + ori + " as memory size"); - return -1; } public static void printByteBuffer(Logger LOG, ByteBuffer buf) { @@ -243,8 +294,17 @@ public static void printTimeTakenNs(long startTimeNs, Logger logger, String mess logger.info(message + " took " + (getCurrentNs() - startTimeNs) + " ns."); } - public static void runtimeException(String msg) { - throw new RuntimeException(msg); + static void redirectStreamAsync(final InputStream input, final PrintStream output) { + new Thread(new Runnable() { + @Override + public void run() { + Scanner scanner = new Scanner(input); + while (scanner.hasNextLine()) { + output.println(scanner.nextLine()); + } + scanner.close(); + } + }).start(); } public static void runtimeException(Exception e) { @@ -252,6 +312,28 @@ public static void runtimeException(Exception e) { throw new RuntimeException(e); } + public static void runtimeException(String msg) { + throw new RuntimeException(msg); + } + + /** + * If the sticky bit of the 'file' is set, the 'file' is only writable to its owner and the owner + * of the folder containing the 'file'. + * + * @param file + * absolute file path + */ + public static void setLocalFileStickyBit(String file) { + try { + // sticky bit is not implemented in PosixFilePermission + if (file.startsWith("/")) { + Runtime.getRuntime().exec("chmod o+t " + file); + } + } catch (IOException e) { + LOG.info("Can not set the sticky bit of the file : " + file); + } + } + public static void sleepMs(Logger logger, long timeMs) { try { Thread.sleep(timeMs); @@ -260,75 +342,33 @@ public static void sleepMs(Logger logger, long timeMs) { } } - public static String[] toStringArray(ArrayList src) { - String[] ret = new String[src.size()]; - return src.toArray(ret); - } - public static void tempoaryLog(String msg) { LOG.info("Temporary Log ============================== " + msg); } - public static void validatePath(String path) throws InvalidPathException { - if (path == null || !path.startsWith(Constants.PATH_SEPARATOR) || - (path.length() > 1 && path.endsWith(Constants.PATH_SEPARATOR)) || - path.contains(" ")) { - throw new InvalidPathException("Path " + path + " is invalid."); - } + public static String[] toStringArray(ArrayList src) { + String[] ret = new String[src.size()]; + return src.toArray(ret); } /** - * Parse InetSocketAddress from a String - * @param address - * @return + * Create an empty file + * * @throws IOException */ - public static InetSocketAddress parseInetSocketAddress(String address) throws IOException { - if (address == null) { - return null; - } - String[] strArr = address.split(":"); - if (strArr.length != 2) { - throw new IOException("Invalid InetSocketAddress " + address); - } - return new InetSocketAddress(strArr[0], Integer.parseInt(strArr[1])); + public static void touch(String path) throws IOException { + UnderFileSystem ufs = UnderFileSystem.get(path); + OutputStream os = ufs.create(path); + os.close(); } - /** - * @param file that will be changed to full permission - */ - public static void changeLocalFileToFullPermission(String file) { - //set the full permission to everyone. - try { - Set permissions = EnumSet.of( - OWNER_READ, OWNER_WRITE, OWNER_EXECUTE, - GROUP_READ, GROUP_WRITE, GROUP_EXECUTE, - OTHERS_READ, OTHERS_WRITE, OTHERS_EXECUTE); - String fileURI = file; - if (file.startsWith("/")) { - fileURI = "file://" + file; - } - Path path = Paths.get(URI.create(fileURI)); - Files.setPosixFilePermissions(path, permissions); - } catch (IOException e) { - LOG.warn("Can not change the permission of the following file to '777':" + file); + public static void validatePath(String path) throws InvalidPathException { + if (path == null || !path.startsWith(Constants.PATH_SEPARATOR) + || (path.length() > 1 && path.endsWith(Constants.PATH_SEPARATOR)) || path.contains(" ")) { + throw new InvalidPathException("Path " + path + " is invalid."); } } - /** - * If the sticky bit of the 'file' is set, the 'file' is only writable to its owner and - * the owner of the folder containing the 'file'. - * - * @param file absolute file path - */ - public static void setLocalFileStickyBit(String file) { - try { - //sticky bit is not implemented in PosixFilePermission - if (file.startsWith("/")) { - Runtime.getRuntime().exec("chmod o+t " + file); - } - } catch (IOException e) { - LOG.info("Can not set the sticky bit of the file : " + file); - } + private CommonUtils() { } -} \ No newline at end of file +} diff --git a/src/main/java/tachyon/util/UnderfsUtil.java b/src/main/java/tachyon/util/UnderfsUtil.java index 0d2687b262fa..9a9c938a433d 100644 --- a/src/main/java/tachyon/util/UnderfsUtil.java +++ b/src/main/java/tachyon/util/UnderfsUtil.java @@ -86,16 +86,16 @@ public static void getInfo(TachyonFS tfs, String underfsAddress, String rootPath } } - public static void main(String[] args) - throws SuspectedFileSizeException, InvalidPathException, IOException, - FileDoesNotExistException, FileAlreadyExistException, TException { + public static void main(String[] args) throws SuspectedFileSizeException, InvalidPathException, + IOException, FileDoesNotExistException, FileAlreadyExistException, TException { if (!(args.length == 3 || args.length == 4)) { - String prefix = "java -cp target/tachyon-" + Version.VERSION + "-jar-with-dependencies.jar " + - "tachyon.util.UnderfsUtil "; - System.out.println("Usage: " + prefix + " " + - "[]"); - System.out.println("Example: " + prefix + - "127.0.0.1:19998 hdfs://localhost:54310 / /tachyon"); + String prefix = + "java -cp target/tachyon-" + Version.VERSION + "-jar-with-dependencies.jar " + + "tachyon.util.UnderfsUtil "; + System.out.println("Usage: " + prefix + " " + + "[]"); + System.out.println("Example: " + prefix + + "tachyon://127.0.0.1:19998 hdfs://localhost:9000 / /tachyon"); System.exit(-1); } @@ -109,4 +109,4 @@ public static void main(String[] args) getInfo(TachyonFS.get(args[0]), args[1], args[2], tExcludePathPrefix); System.exit(0); } -} \ No newline at end of file +} diff --git a/src/main/java/tachyon/web/UIWebServer.java b/src/main/java/tachyon/web/UIWebServer.java index 8ba4358bdb79..4d099bb24770 100644 --- a/src/main/java/tachyon/web/UIWebServer.java +++ b/src/main/java/tachyon/web/UIWebServer.java @@ -29,8 +29,8 @@ import org.apache.log4j.Logger; import tachyon.Constants; -import tachyon.MasterInfo; import tachyon.conf.CommonConf; +import tachyon.master.MasterInfo; import tachyon.util.CommonUtils; /** @@ -45,9 +45,13 @@ public class UIWebServer { /** * Constructor that pairs urls with servlets and sets the webapp folder. - * @param serverName Name of the server - * @param InetSocketAddress Address of the server - * @param masterInfo MasterInfo for the tachyon filesystem this UIWebServer supports + * + * @param serverName + * Name of the server + * @param address + * Address of the server + * @param masterInfo + * MasterInfo for the tachyon filesystem this UIWebServer supports * @return A new UIWebServer */ public UIWebServer(String serverName, InetSocketAddress address, MasterInfo masterInfo) { @@ -58,15 +62,17 @@ public UIWebServer(String serverName, InetSocketAddress address, MasterInfo mast WebAppContext webappcontext = new WebAppContext(); webappcontext.setContextPath("/"); - File warPath = new File(CommonConf.get().TACHYON_HOME + "/src/main/java/tachyon/web/resources"); + File warPath = new File(CommonConf.get().WEB_RESOURCES); webappcontext.setWar(warPath.getAbsolutePath()); HandlerList handlers = new HandlerList(); - webappcontext.addServlet( - new ServletHolder(new WebInterfaceGeneralServlet(masterInfo)), "/home"); - webappcontext.addServlet( - new ServletHolder(new WebInterfaceBrowseServlet(masterInfo)), "/browse"); - webappcontext.addServlet( - new ServletHolder(new WebInterfaceMemoryServlet(masterInfo)), "/memory"); + webappcontext.addServlet(new ServletHolder(new WebInterfaceGeneralServlet(masterInfo)), + "/home"); + webappcontext.addServlet(new ServletHolder(new WebInterfaceBrowseServlet(masterInfo)), + "/browse"); + webappcontext.addServlet(new ServletHolder(new WebInterfaceMemoryServlet(masterInfo)), + "/memory"); + webappcontext.addServlet(new ServletHolder(new WebInterfaceDependencyServlet(masterInfo)), + "/dependency"); handlers.setHandlers(new Handler[] { webappcontext, new DefaultHandler() }); mServer.setHandler(handlers); @@ -76,6 +82,10 @@ public void setHandler(AbstractHandler handler) { mServer.setHandler(handler); } + public void shutdownWebServer() throws Exception { + mServer.stop(); + } + public void startWebServer() { try { mServer.start(); @@ -84,8 +94,4 @@ public void startWebServer() { CommonUtils.runtimeException(e); } } - - public void shutdownWebServer() throws Exception { - mServer.stop(); - } } \ No newline at end of file diff --git a/src/main/java/tachyon/web/WebInterfaceBrowseServlet.java b/src/main/java/tachyon/web/WebInterfaceBrowseServlet.java index 442d45991fd5..6893ee0e1ab7 100644 --- a/src/main/java/tachyon/web/WebInterfaceBrowseServlet.java +++ b/src/main/java/tachyon/web/WebInterfaceBrowseServlet.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; + import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; @@ -30,11 +31,12 @@ import org.apache.thrift.TException; import tachyon.Constants; -import tachyon.MasterInfo; import tachyon.client.InStream; import tachyon.client.ReadType; import tachyon.client.TachyonFS; import tachyon.client.TachyonFile; +import tachyon.master.BlockInfo; +import tachyon.master.MasterInfo; import tachyon.thrift.ClientFileInfo; import tachyon.thrift.FileDoesNotExistException; import tachyon.thrift.InvalidPathException; @@ -45,17 +47,47 @@ * Servlet that provides data for browsing the file system. */ public class WebInterfaceBrowseServlet extends HttpServlet { - private static final long serialVersionUID = 6121623049981468871L; - private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); + /** + * Class to make referencing file objects more intuitive. Mainly to avoid + * implicit association by array indexes. + */ + public class UiBlockInfo implements Comparable { - private MasterInfo mMasterInfo; + private final long ID; + private final long BLOCK_LENGTH; + private final boolean IN_MEMORY; + + public UiBlockInfo(BlockInfo blockInfo) { + ID = blockInfo.BLOCK_ID; + BLOCK_LENGTH = blockInfo.LENGTH; + IN_MEMORY = blockInfo.isInMemory(); + } + + @Override + public int compareTo(UiBlockInfo p) { + return (ID < p.ID ? -1 : (ID == p.ID ? 0 : 1)); + } + + public long getBlockLength() { + return BLOCK_LENGTH; + } + + public long getID() { + return ID; + } + + public boolean inMemory() { + return IN_MEMORY; + } + } /** - * Class to make referencing file objects more intuitive. Mainly to avoid implicit association - * by array indexes. + * Class to make referencing file objects more intuitive. Mainly to avoid + * implicit association by array indexes. */ public class UiFileInfo implements Comparable { private final int ID; + private final int DEPENDENCY_ID; private final String NAME; private final String ABSOLUATE_PATH; private final String CHECKPOINT_PATH; @@ -63,11 +95,13 @@ public class UiFileInfo implements Comparable { private final long SIZE; private final long CREATION_TIME_MS; private final boolean IN_MEMORY; + private final int IN_MEMORY_PERCENTAGE; private final boolean IS_DIRECTORY; private List mFileLocations; private UiFileInfo(ClientFileInfo fileInfo) { ID = fileInfo.getId(); + DEPENDENCY_ID = fileInfo.getDependencyId(); NAME = fileInfo.getName(); ABSOLUATE_PATH = fileInfo.getPath(); CHECKPOINT_PATH = fileInfo.getCheckpointPath(); @@ -75,20 +109,14 @@ private UiFileInfo(ClientFileInfo fileInfo) { SIZE = fileInfo.getLength(); CREATION_TIME_MS = fileInfo.getCreationTimeMs(); IN_MEMORY = fileInfo.isInMemory(); + IN_MEMORY_PERCENTAGE = fileInfo.getInMemoryPercentage(); IS_DIRECTORY = fileInfo.isFolder(); mFileLocations = new ArrayList(); } - public int getId() { - return ID; - } - - public String getName() { - if (ABSOLUATE_PATH.equals(Constants.PATH_SEPARATOR)) { - return "root"; - } else { - return NAME; - } + @Override + public int compareTo(UiFileInfo o) { + return ABSOLUATE_PATH.compareTo(o.getAbsolutePath()); } public String getAbsolutePath() { @@ -107,52 +135,148 @@ public String getCheckpointPath() { return CHECKPOINT_PATH; } - public String getSize() { - if (IS_DIRECTORY) { - return " "; - } else { - return CommonUtils.getSizeFromBytes(SIZE); - } - } - public String getCreationTime() { return CommonUtils.convertMsToDate(CREATION_TIME_MS); } + public int getDependencyId() { + return DEPENDENCY_ID; + } + + public List getFileLocations() { + return mFileLocations; + } + + public int getId() { + return ID; + } + public boolean getInMemory() { return IN_MEMORY; } + public int getInMemoryPercentage() { + return IN_MEMORY_PERCENTAGE; + } + public boolean getIsDirectory() { return IS_DIRECTORY; } - public void setFileLocations(List fileLocations) { - for (NetAddress addr : fileLocations) { - mFileLocations.add(new String(addr.getMHost() + ":" + addr.getMPort())); + public String getName() { + if (ABSOLUATE_PATH.equals(Constants.PATH_SEPARATOR)) { + return "root"; + } else { + return NAME; } } - public List getFileLocations() { - return mFileLocations; + public String getSize() { + if (IS_DIRECTORY) { + return " "; + } else { + return CommonUtils.getSizeFromBytes(SIZE); + } } - @Override - public int compareTo(UiFileInfo o) { - return ABSOLUATE_PATH.compareTo(o.getAbsolutePath()); + public void setFileLocations(List fileLocations) { + for (NetAddress addr : fileLocations) { + mFileLocations.add(new String(addr.getMHost() + ":" + addr.getMPort())); + } } } + private static final long serialVersionUID = 6121623049981468871L; + + private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); + + private MasterInfo mMasterInfo; + public WebInterfaceBrowseServlet(MasterInfo masterInfo) { mMasterInfo = masterInfo; } /** - * Populates attribute fields with data from the MasterInfo associated with this servlet. Errors - * will be displayed in an error field. Debugging can be enabled to display additional data. - * Will eventually redirect the request to a jsp. - * @param request The HttpServletRequest object - * @param response The HttpServletResponse object + * This function displays the first 5KB of a file if it is in ASCII format. + * + * @param path + * The path of the file to display + * @param request + * The HttpServletRequest object + * @throws FileDoesNotExistException + * @throws IOException + * @throws InvalidPathException + * @throws TException + */ + private void displayFile(String path, HttpServletRequest request) + throws FileDoesNotExistException, InvalidPathException, IOException { + displayFile(path, request, 0); + } + + /** + * This function displays 5KB of a file from a specific offset if it is in + * ASCII format. + * + * @param path + * The path of the file to display + * @param request + * The HttpServletRequest object + * @param offset + * Where the file starts to display. + * @throws FileDoesNotExistException + * @throws IOException + * @throws InvalidPathException + * @throws TException + */ + private void displayFile(String path, HttpServletRequest request, int offset) + throws FileDoesNotExistException, InvalidPathException, IOException { + String masterAddress = + Constants.HEADER + mMasterInfo.getMasterAddress().getHostName() + ":" + + mMasterInfo.getMasterAddress().getPort(); + TachyonFS tachyonClient = TachyonFS.get(masterAddress); + TachyonFile tFile = tachyonClient.getFile(path); + String fileData = null; + if (tFile == null) { + throw new FileDoesNotExistException(path); + } + if (tFile.isComplete()) { + InStream is = tFile.getInStream(ReadType.NO_CACHE); + int len = (int) Math.min(5 * Constants.KB, tFile.length()); + byte[] data = new byte[len]; + is.skip(offset); + is.read(data, 0, len); + fileData = CommonUtils.convertByteArrayToStringWithoutEscape(data); + if (fileData == null) { + fileData = "The requested file is not completely encoded in ascii"; + } + is.close(); + } else { + fileData = "The requested file is not complete yet."; + } + try { + tachyonClient.close(); + } catch (TException e) { + LOG.error(e.getMessage()); + } + List rawBlockList = mMasterInfo.getBlockList(path); + List uiBlockInfo = new ArrayList(); + for (BlockInfo blockInfo : rawBlockList) { + uiBlockInfo.add(new UiBlockInfo(blockInfo)); + } + request.setAttribute("fileBlocks", uiBlockInfo); + request.setAttribute("fileData", fileData); + return; + } + + /** + * Populates attribute fields with data from the MasterInfo associated with + * this servlet. Errors will be displayed in an error field. Debugging can be + * enabled to display additional data. Will eventually redirect the request to a jsp. + * + * @param request + * The HttpServletRequest object + * @param response + * The HttpServletResponse object * @throws ServletException * @throws IOException * @throws UnknownHostException @@ -166,16 +290,21 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) request.setAttribute("invalidPathError", ""); List filesInfo = null; String currentPath = request.getParameter("path"); - if (currentPath.isEmpty()) { currentPath = "/"; } request.setAttribute("currentPath", currentPath); + request.setAttribute("viewingOffset", 0); try { UiFileInfo currentFileInfo = new UiFileInfo(mMasterInfo.getClientFileInfo(currentPath)); request.setAttribute("currentDirectory", currentFileInfo); + request.setAttribute("blockSizeByte", currentFileInfo.BLOCK_SIZE_BYTES); if (!currentFileInfo.getIsDirectory()) { - displayFile(currentFileInfo.getAbsolutePath(), request); + // TODO if parameter is illegal + String tmpParam = request.getParameter("offset"); + int offset = (tmpParam == null ? 0 : Integer.valueOf(tmpParam)); + displayFile(currentFileInfo.getAbsolutePath(), request, offset); + request.setAttribute("viewingOffset", offset); getServletContext().getRequestDispatcher("/viewFile.jsp").forward(request, response); return; } @@ -197,7 +326,8 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) UiFileInfo toAdd = new UiFileInfo(fileInfo); try { if (!toAdd.getIsDirectory() && fileInfo.getLength() > 0) { - toAdd.setFileLocations(mMasterInfo.getFileLocations(toAdd.getId()).get(0).getLocations()); + toAdd + .setFileLocations(mMasterInfo.getFileLocations(toAdd.getId()).get(0).getLocations()); } } catch (FileDoesNotExistException fdne) { request.setAttribute("invalidPathError", "Error: Invalid Path " + fdne.getMessage()); @@ -212,55 +342,14 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) getServletContext().getRequestDispatcher("/browse.jsp").forward(request, response); } - @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) { - return; - } - - /** - * This function displays the first 5KB of a file if it is in ASCII format. - * @param path The path of the file to display - * @param request The HttpServletRequest object - * @throws FileDoesNotExistException - * @throws IOException - * @throws InvalidPathException - * @throws TException - */ - private void displayFile(String path, HttpServletRequest request) - throws FileDoesNotExistException, InvalidPathException, IOException { - TachyonFS tachyonClient = TachyonFS.get(mMasterInfo.getMasterAddress()); - TachyonFile tFile = tachyonClient.getFile(path); - String fileData = null; - if (tFile == null) { - throw new FileDoesNotExistException(path); - } - if (tFile.isComplete()) { - InStream is = tFile.getInStream(ReadType.NO_CACHE); - int len = (int) Math.min(5 * Constants.KB, tFile.length()); - byte[] data = new byte[len]; - is.read(data, 0, len); - fileData = CommonUtils.convertByteArrayToString(data); - if (fileData == null) { - fileData = "The requested file is not completely encoded in ascii"; - } - is.close(); - } else { - fileData = "The requested file is not complete yet."; - } - try { - tachyonClient.close(); - } catch (TException e) { - LOG.error(e.getMessage()); - } - request.setAttribute("fileData", fileData); - return; - } - /** - * This function sets the fileinfos for folders that are in the path to the current directory. - * - * @param path The path of the current directory. - * @param request The HttpServletRequest object + * This function sets the fileinfos for folders that are in the path to the + * current directory. + * + * @param path + * The path of the current directory. + * @param request + * The HttpServletRequest object * @throws FileDoesNotExistException * @throws InvalidPathException */ diff --git a/src/main/java/tachyon/web/WebInterfaceDependencyServlet.java b/src/main/java/tachyon/web/WebInterfaceDependencyServlet.java new file mode 100644 index 000000000000..787e981b3b7e --- /dev/null +++ b/src/main/java/tachyon/web/WebInterfaceDependencyServlet.java @@ -0,0 +1,60 @@ +package tachyon.web; + +import java.util.List; +import java.util.ArrayList; +import java.util.Collections; + +import javax.servlet.ServletException; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; + +import tachyon.master.MasterInfo; +import tachyon.thrift.ClientDependencyInfo; +import tachyon.thrift.DependencyDoesNotExistException; +import tachyon.thrift.FileDoesNotExistException; + +public class WebInterfaceDependencyServlet extends HttpServlet { + private static final long serialVersionUID = 2071462168900313417L; + private MasterInfo mMasterInfo; + + public WebInterfaceDependencyServlet(MasterInfo masterInfo) { + mMasterInfo = masterInfo; + } + + @Override + public void doGet(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + request.setAttribute("masterNodeAddress", mMasterInfo.getMasterAddress().toString()); + request.setAttribute("filePath", request.getParameter("filePath")); + request.setAttribute("error", ""); + int dependencyId = Integer.parseInt(request.getParameter("id")); + List parentFileNames = new ArrayList(); + List childrenFileNames = new ArrayList(); + try { + ClientDependencyInfo dependencyInfo = mMasterInfo.getClientDependencyInfo(dependencyId); + for (int pId : dependencyInfo.parents) { + parentFileNames.add(mMasterInfo.getFileNameById(pId)); + } + for (int cId : dependencyInfo.children) { + childrenFileNames.add(mMasterInfo.getFileNameById(cId)); + } + } catch (DependencyDoesNotExistException ddnee) { + request.setAttribute("error", ddnee.getMessage()); + } catch (FileDoesNotExistException fdne) { + request.setAttribute("error", fdne.getMessage()); + } + Collections.sort(parentFileNames); + Collections.sort(childrenFileNames); + request.setAttribute("parentFileNames", parentFileNames); + request.setAttribute("childrenFileNames", childrenFileNames); + getServletContext().getRequestDispatcher("/dependency.jsp").forward(request, response); + } + + @Override + public void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + return; + } +} \ No newline at end of file diff --git a/src/main/java/tachyon/web/WebInterfaceGeneralServlet.java b/src/main/java/tachyon/web/WebInterfaceGeneralServlet.java index 0fda2f312ba9..00f6acc1d2f4 100644 --- a/src/main/java/tachyon/web/WebInterfaceGeneralServlet.java +++ b/src/main/java/tachyon/web/WebInterfaceGeneralServlet.java @@ -18,6 +18,7 @@ import java.io.IOException; import java.util.List; +import java.util.Set; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; @@ -25,8 +26,9 @@ import javax.servlet.http.HttpServletResponse; import tachyon.Constants; -import tachyon.MasterInfo; import tachyon.Version; +import tachyon.master.DependencyVariables; +import tachyon.master.MasterInfo; import tachyon.thrift.ClientWorkerInfo; import tachyon.util.CommonUtils; @@ -34,10 +36,6 @@ * Servlet that provides data for viewing the general status of the filesystem. */ public class WebInterfaceGeneralServlet extends HttpServlet { - private static final long serialVersionUID = 2335205655766736309L; - - private MasterInfo mMasterInfo; - /** * Class to make referencing worker nodes more intuitive. Mainly to avoid implicit association * by array indexes. @@ -54,45 +52,54 @@ private NodeInfo(ClientWorkerInfo workerInfo) { NAME = workerInfo.getAddress().getMHost(); LAST_CONTACT_SEC = Integer.toString(workerInfo.getLastContactSec()); STATE = workerInfo.getState(); - USED_SPACE_PERCENT = (int) (100L * workerInfo.getUsedBytes() / workerInfo.getCapacityBytes()); + USED_SPACE_PERCENT = + (int) (100L * workerInfo.getUsedBytes() / workerInfo.getCapacityBytes()); FREE_SPACE_PERCENT = 100 - USED_SPACE_PERCENT; - UPTIME_CLOCK_TIME = CommonUtils.convertMsToShortClockTime( - System.currentTimeMillis() - workerInfo.getStarttimeMs()); + UPTIME_CLOCK_TIME = + CommonUtils.convertMsToShortClockTime(System.currentTimeMillis() + - workerInfo.getStarttimeMs()); } - public String getName() { - return NAME; + public int getFreeSpacePercent() { + return FREE_SPACE_PERCENT; } public String getLastHeartbeat() { return LAST_CONTACT_SEC; } + public String getName() { + return NAME; + } + public String getState() { return STATE; } - public int getFreeSpacePercent() { - return FREE_SPACE_PERCENT; + public String getUptimeClockTime() { + return UPTIME_CLOCK_TIME; } public int getUsedSpacePercent() { return USED_SPACE_PERCENT; } - - public String getUptimeClockTime() { - return UPTIME_CLOCK_TIME; - } } + private static final long serialVersionUID = 2335205655766736309L; + + private MasterInfo mMasterInfo; + public WebInterfaceGeneralServlet(MasterInfo masterInfo) { mMasterInfo = masterInfo; } /** - * Redirects the request to a jsp after populating attributes via populateValues. - * @param request The HttpServletRequest object - * @param response The HttpServletResponse object + * Redirects the request to a JSP after populating attributes via populateValues. + * + * @param request + * The HttpServletRequest object + * @param response + * The HttpServletResponse object */ @Override protected void doGet(HttpServletRequest request, HttpServletResponse response) @@ -102,13 +109,26 @@ protected void doGet(HttpServletRequest request, HttpServletResponse response) } @Override - protected void doPost(HttpServletRequest request, HttpServletResponse response) { - return; + protected void doPost(HttpServletRequest request, HttpServletResponse response) + throws ServletException, IOException { + DependencyVariables.sVariables.clear(); + for (String key : (Set) request.getParameterMap().keySet()) { + if (key.startsWith("varName")) { + String value = request.getParameter("varVal" + key.substring(7)); + if (value != null) { + DependencyVariables.sVariables.put(request.getParameter(key), value); + } + } + } + populateValues(request); + getServletContext().getRequestDispatcher("/general.jsp").forward(request, response); } /** * Populates key, value pairs for UI display - * @param request The HttpServletRequest object + * + * @param request + * The HttpServletRequest object * @throws IOException */ private void populateValues(HttpServletRequest request) throws IOException { @@ -116,8 +136,8 @@ private void populateValues(HttpServletRequest request) throws IOException { request.setAttribute("masterNodeAddress", mMasterInfo.getMasterAddress().toString()); - request.setAttribute("uptime", CommonUtils.convertMsToClockTime( - System.currentTimeMillis() - mMasterInfo.getStarttimeMs())); + request.setAttribute("uptime", CommonUtils.convertMsToClockTime(System.currentTimeMillis() + - mMasterInfo.getStarttimeMs())); request.setAttribute("startTime", CommonUtils.convertMsToDate(mMasterInfo.getStarttimeMs())); @@ -129,8 +149,8 @@ private void populateValues(HttpServletRequest request) throws IOException { request.setAttribute("usedCapacity", CommonUtils.getSizeFromBytes(mMasterInfo.getUsedBytes())); - request.setAttribute("freeCapacity", CommonUtils.getSizeFromBytes( - (mMasterInfo.getCapacityBytes() - mMasterInfo.getUsedBytes()))); + request.setAttribute("freeCapacity", CommonUtils.getSizeFromBytes((mMasterInfo + .getCapacityBytes() - mMasterInfo.getUsedBytes()))); long sizeBytes = mMasterInfo.getUnderFsCapacityBytes(); if (sizeBytes >= 0) { @@ -153,11 +173,13 @@ private void populateValues(HttpServletRequest request) throws IOException { request.setAttribute("diskFreeCapacity", "UNKNOWN"); } + request.setAttribute("recomputeVariables", DependencyVariables.sVariables); + List workerInfos = mMasterInfo.getWorkersInfo(); for (int i = 0; i < workerInfos.size(); i ++) { for (int j = i + 1; j < workerInfos.size(); j ++) { - if (workerInfos.get(i).getAddress().getMHost().compareTo( - workerInfos.get(j).getAddress().getMHost()) > 0) { + if (workerInfos.get(i).getAddress().getMHost() + .compareTo(workerInfos.get(j).getAddress().getMHost()) > 0) { ClientWorkerInfo temp = workerInfos.get(i); workerInfos.set(i, workerInfos.get(j)); workerInfos.set(j, temp); diff --git a/src/main/java/tachyon/web/WebInterfaceMemoryServlet.java b/src/main/java/tachyon/web/WebInterfaceMemoryServlet.java index c809f8901a70..9369761ae09d 100644 --- a/src/main/java/tachyon/web/WebInterfaceMemoryServlet.java +++ b/src/main/java/tachyon/web/WebInterfaceMemoryServlet.java @@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import tachyon.MasterInfo; +import tachyon.master.MasterInfo; import java.io.IOException; @@ -38,14 +38,17 @@ public class WebInterfaceMemoryServlet extends HttpServlet { public WebInterfaceMemoryServlet(MasterInfo masterInfo) { mMasterInfo = masterInfo; } - + /** * Populates attributes before redirecting to a jsp. - * @param request The HttpServletRequest object - * @param response The HttpServletReponse object + * + * @param request + * The HttpServletRequest object + * @param response + * The HttpServletReponse object */ @Override - public void doGet(HttpServletRequest request, HttpServletResponse response) + public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setAttribute("masterNodeAddress", mMasterInfo.getMasterAddress().toString()); List inMemoryFiles = mMasterInfo.getInMemoryFiles(); @@ -53,10 +56,4 @@ public void doGet(HttpServletRequest request, HttpServletResponse response) request.setAttribute("inMemoryFiles", inMemoryFiles); getServletContext().getRequestDispatcher("/memory.jsp").forward(request, response); } - - @Override - public void doPost(HttpServletRequest request, HttpServletResponse response) - throws ServletException, IOException { - return; - } } \ No newline at end of file diff --git a/src/main/java/tachyon/web/resources/css/tachyoncustom.min.css b/src/main/java/tachyon/web/resources/css/tachyoncustom.min.css deleted file mode 100644 index 7fc11497a864..000000000000 --- a/src/main/java/tachyon/web/resources/css/tachyoncustom.min.css +++ /dev/null @@ -1 +0,0 @@ -.custom-progress{margin-bottom:0px;} \ No newline at end of file diff --git a/src/main/java/tachyon/web/resources/viewFile.jsp b/src/main/java/tachyon/web/resources/viewFile.jsp deleted file mode 100644 index ce2fb2823dfe..000000000000 --- a/src/main/java/tachyon/web/resources/viewFile.jsp +++ /dev/null @@ -1,44 +0,0 @@ -<%@ page import="java.util.*" %> -<%@ page import="tachyon.web.*" %> - - - - - - -Tachyon - - - -
    - - -
    -
    -
    -

    - <%= request.getAttribute("invalidPathError") %> -

    -

    The first 5KB of <%= request.getAttribute("currentPath") %> in ASCII

    -
    - <%= request.getAttribute("fileData") %> -
    -
    -
    -
    -
    -

    - Tachyon is a project developed at the UC Berkeley AMPLab. -

    -
    -
    - - \ No newline at end of file diff --git a/src/main/java/tachyon/BlocksLocker.java b/src/main/java/tachyon/worker/BlocksLocker.java similarity index 92% rename from src/main/java/tachyon/BlocksLocker.java rename to src/main/java/tachyon/worker/BlocksLocker.java index b148a66e00a4..f1d746fb9255 100644 --- a/src/main/java/tachyon/BlocksLocker.java +++ b/src/main/java/tachyon/worker/BlocksLocker.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.worker; import java.util.HashMap; import java.util.HashSet; @@ -42,13 +42,11 @@ public BlocksLocker(WorkerStorage workerStorage, int userId) { mWorkerStorage = workerStorage; } - public synchronized boolean locked(long blockId) { - return mLockedBlockIds.containsKey(blockId); - } - /** * Lock a block. - * @param blockId The id of the block. + * + * @param blockId + * The id of the block. * @return The lockId of this lock. */ public synchronized int lock(long blockId) { @@ -65,10 +63,17 @@ public synchronized int lock(long blockId) { return locker; } + public synchronized boolean locked(long blockId) { + return mLockedBlockIds.containsKey(blockId); + } + /** * Unlock a block with a lock id. - * @param blockId The id of the block. - * @param lockId The lock id of the lock. + * + * @param blockId + * The id of the block. + * @param lockId + * The lock id of the lock. */ public synchronized void unlock(long blockId, int lockId) { Set lockers = mLockedBlockIds.get(blockId); diff --git a/src/main/java/tachyon/DataServer.java b/src/main/java/tachyon/worker/DataServer.java similarity index 90% rename from src/main/java/tachyon/DataServer.java rename to src/main/java/tachyon/worker/DataServer.java index b9ea52f8ad1a..3a862d39271f 100644 --- a/src/main/java/tachyon/DataServer.java +++ b/src/main/java/tachyon/worker/DataServer.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.worker; import java.io.IOException; import java.net.InetSocketAddress; @@ -29,6 +29,9 @@ import java.util.Map; import org.apache.log4j.Logger; + +import tachyon.Constants; +import tachyon.Users; import tachyon.util.CommonUtils; /** @@ -47,10 +50,10 @@ public class DataServer implements Runnable { // The selector we will be monitoring. private Selector mSelector; - private Map mSendingData = - Collections.synchronizedMap(new HashMap()); - private Map mReceivingData = - Collections.synchronizedMap(new HashMap()); + private Map mSendingData = Collections + .synchronizedMap(new HashMap()); + private Map mReceivingData = Collections + .synchronizedMap(new HashMap()); // The blocks locker manager. private final BlocksLocker mBlocksLocker; @@ -60,8 +63,11 @@ public class DataServer implements Runnable { /** * Create a data server with direct access to worker storage. - * @param address The address of the data server. - * @param workerStorage The handler of the directly accessed worker storage. + * + * @param address + * The address of the data server. + * @param workerStorage + * The handler of the directly accessed worker storage. */ public DataServer(InetSocketAddress address, WorkerStorage workerStorage) { LOG.info("Starting DataServer @ " + address); @@ -75,6 +81,25 @@ public DataServer(InetSocketAddress address, WorkerStorage workerStorage) { } } + private void accept(SelectionKey key) throws IOException { + // For an accept to be pending the channel must be a server socket channel + ServerSocketChannel serverSocketChannel = (ServerSocketChannel) key.channel(); + + // Accept the connection and make it non-blocking + SocketChannel socketChannel = serverSocketChannel.accept(); + socketChannel.configureBlocking(false); + + // Register the new SocketChannel with our Selector, indicating we'd like to be notified + // when there is data waiting to be read. + socketChannel.register(mSelector, SelectionKey.OP_READ); + } + + public void close() throws IOException { + mShutdown = true; + mServerChannel.close(); + mSelector.close(); + } + private Selector initSelector() throws IOException { // Create a new selector Selector socketSelector = SelectorProvider.provider().openSelector(); @@ -92,17 +117,8 @@ private Selector initSelector() throws IOException { return socketSelector; } - private void accept(SelectionKey key) throws IOException { - // For an accept to be pending the channel must be a server socket channel - ServerSocketChannel serverSocketChannel = (ServerSocketChannel) key.channel(); - - // Accept the connection and make it non-blocking - SocketChannel socketChannel = serverSocketChannel.accept(); - socketChannel.configureBlocking(false); - - // Register the new SocketChannel with our Selector, indicating we'd like to be notified - // when there is data waiting to be read. - socketChannel.register(mSelector, SelectionKey.OP_READ); + public boolean isClosed() { + return mShutdowned; } private void read(SelectionKey key) throws IOException { @@ -130,7 +146,8 @@ private void read(SelectionKey key) throws IOException { } if (numRead == -1) { - // Remote entity shut the socket down cleanly. Do the same from our end and cancel the channel. + // Remote entity shut the socket down cleanly. Do the same from our end and cancel the + // channel. key.channel().close(); key.cancel(); mReceivingData.remove(socketChannel); @@ -147,50 +164,14 @@ private void read(SelectionKey key) throws IOException { key.interestOps(SelectionKey.OP_WRITE); LOG.info("Get request for " + tMessage.getBlockId()); int lockId = mBlocksLocker.lock(tMessage.getBlockId()); - DataServerMessage tResponseMessage = DataServerMessage.createBlockResponseMessage( - true, tMessage.getBlockId(), tMessage.getOffset(), tMessage.getLength()); + DataServerMessage tResponseMessage = + DataServerMessage.createBlockResponseMessage(true, tMessage.getBlockId(), + tMessage.getOffset(), tMessage.getLength()); tResponseMessage.setLockId(lockId); mSendingData.put(socketChannel, tResponseMessage); } } - private void write(SelectionKey key) { - SocketChannel socketChannel = (SocketChannel) key.channel(); - - DataServerMessage sendMessage = mSendingData.get(socketChannel); - - boolean closeChannel = false; - try { - sendMessage.send(socketChannel); - } catch (IOException e) { - closeChannel = true; - LOG.error(e.getMessage()); - } - - if (sendMessage.finishSending() || closeChannel) { - try { - key.channel().close(); - } catch (IOException e) { - LOG.error(e.getMessage()); - } - key.cancel(); - mReceivingData.remove(socketChannel); - mSendingData.remove(socketChannel); - sendMessage.close(); - mBlocksLocker.unlock(Math.abs(sendMessage.getBlockId()), sendMessage.getLockId()); - } - } - - public void close() throws IOException { - mShutdown = true; - mServerChannel.close(); - mSelector.close(); - } - - public boolean isClosed() { - return mShutdowned; - } - @Override public void run() { while (!mShutdown) { @@ -204,7 +185,7 @@ public void run() { // Iterate over the set of keys for which events are available Iterator selectKeys = mSelector.selectedKeys().iterator(); while (selectKeys.hasNext()) { - SelectionKey key = (SelectionKey) selectKeys.next(); + SelectionKey key = selectKeys.next(); selectKeys.remove(); if (!key.isValid()) { @@ -231,4 +212,31 @@ public void run() { } mShutdowned = true; } + + private void write(SelectionKey key) { + SocketChannel socketChannel = (SocketChannel) key.channel(); + + DataServerMessage sendMessage = mSendingData.get(socketChannel); + + boolean closeChannel = false; + try { + sendMessage.send(socketChannel); + } catch (IOException e) { + closeChannel = true; + LOG.error(e.getMessage()); + } + + if (sendMessage.finishSending() || closeChannel) { + try { + key.channel().close(); + } catch (IOException e) { + LOG.error(e.getMessage()); + } + key.cancel(); + mReceivingData.remove(socketChannel); + mSendingData.remove(socketChannel); + sendMessage.close(); + mBlocksLocker.unlock(Math.abs(sendMessage.getBlockId()), sendMessage.getLockId()); + } + } } \ No newline at end of file diff --git a/src/main/java/tachyon/DataServerMessage.java b/src/main/java/tachyon/worker/DataServerMessage.java similarity index 97% rename from src/main/java/tachyon/DataServerMessage.java rename to src/main/java/tachyon/worker/DataServerMessage.java index a4bdb3a9ebd3..ab57aa26f212 100644 --- a/src/main/java/tachyon/DataServerMessage.java +++ b/src/main/java/tachyon/worker/DataServerMessage.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.worker; import java.io.IOException; import java.io.RandomAccessFile; @@ -24,6 +24,7 @@ import org.apache.log4j.Logger; +import tachyon.Constants; import tachyon.client.TachyonByteBuffer; import tachyon.conf.WorkerConf; import tachyon.util.CommonUtils; @@ -35,36 +36,6 @@ public class DataServerMessage { public static final short DATA_SERVER_REQUEST_MESSAGE = 1; public static final short DATA_SERVER_RESPONSE_MESSAGE = 2; - private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); - - private final boolean IS_TO_SEND_DATA; - private final short mMsgType; - private boolean mIsMessageReady; - - private ByteBuffer mHeader; - private static final int HEADER_LENGTH = 26; - private long mBlockId; - private long mOffset; - private long mLength; - private int mLockId = -1; - - private TachyonByteBuffer mTachyonData = null; - private ByteBuffer mData = null; - - void setLockId(int lockId) { - mLockId = lockId; - } - - int getLockId() { - return mLockId; - } - - private DataServerMessage(boolean isToSendData, short msgType) { - IS_TO_SEND_DATA = isToSendData; - mMsgType = msgType; - mIsMessageReady = false; - } - public static DataServerMessage createBlockRequestMessage() { DataServerMessage ret = new DataServerMessage(false, DATA_SERVER_REQUEST_MESSAGE); ret.mHeader = ByteBuffer.allocate(HEADER_LENGTH); @@ -118,8 +89,9 @@ public static DataServerMessage createBlockResponseMessage(boolean toSend, long error = String.format("Offset(%d) is larger than file length(%d)", offset, fileLength); } if (error == null && len != -1 && offset + len > fileLength) { - error = String.format("Offset(%d) plus length(%d) is larger than file length(%d)", - offset, len, fileLength); + error = + String.format("Offset(%d) plus length(%d) is larger than file length(%d)", offset, + len, fileLength); } if (error != null) { file.close(); @@ -143,7 +115,7 @@ public static DataServerMessage createBlockResponseMessage(boolean toSend, long ret.LOG.info("Response remote requst by reading from " + filePath + " preparation done."); } catch (Exception e) { // TODO This is a trick for now. The data may have been removed before remote retrieving. - ret.mBlockId = - ret.mBlockId; + ret.mBlockId = -ret.mBlockId; ret.mLength = 0; ret.mHeader = ByteBuffer.allocate(HEADER_LENGTH); ret.mData = ByteBuffer.allocate(0); @@ -159,6 +131,37 @@ public static DataServerMessage createBlockResponseMessage(boolean toSend, long return ret; } + private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); + private final boolean IS_TO_SEND_DATA; + private final short mMsgType; + private boolean mIsMessageReady; + private ByteBuffer mHeader; + + private static final int HEADER_LENGTH = 26; + private long mBlockId; + + private long mOffset; + + private long mLength; + + private int mLockId = -1; + + private TachyonByteBuffer mTachyonData = null; + + private ByteBuffer mData = null; + + private DataServerMessage(boolean isToSendData, short msgType) { + IS_TO_SEND_DATA = isToSendData; + mMsgType = msgType; + mIsMessageReady = false; + } + + public void checkReady() { + if (!mIsMessageReady) { + CommonUtils.runtimeException("Message is not ready."); + } + } + public void close() { if (mMsgType == DATA_SERVER_RESPONSE_MESSAGE) { try { @@ -171,6 +174,12 @@ public void close() { } } + public boolean finishSending() { + isSend(true); + + return mHeader.remaining() == 0 && mData.remaining() == 0; + } + private void generateHeader() { mHeader.clear(); mHeader.putShort(mMsgType); @@ -180,6 +189,48 @@ private void generateHeader() { mHeader.flip(); } + public long getBlockId() { + checkReady(); + return mBlockId; + } + + public long getLength() { + checkReady(); + return mLength; + } + + int getLockId() { + return mLockId; + } + + public long getOffset() { + checkReady(); + return mOffset; + } + + public ByteBuffer getReadOnlyData() { + if (!mIsMessageReady) { + CommonUtils.runtimeException("Message is not ready."); + } + ByteBuffer ret = mData.asReadOnlyBuffer(); + ret.flip(); + return ret; + } + + public boolean isMessageReady() { + return mIsMessageReady; + } + + private void isSend(boolean isSend) { + if (IS_TO_SEND_DATA != isSend) { + if (IS_TO_SEND_DATA) { + CommonUtils.runtimeException("Try to recv on send message"); + } else { + CommonUtils.runtimeException("Try to send on recv message"); + } + } + } + public int recv(SocketChannel socketChannel) throws IOException { isSend(false); @@ -228,53 +279,7 @@ public void send(SocketChannel socketChannel) throws IOException { } } - public boolean finishSending() { - isSend(true); - - return mHeader.remaining() == 0 && mData.remaining() == 0; - } - - private void isSend(boolean isSend) { - if (IS_TO_SEND_DATA != isSend) { - if (IS_TO_SEND_DATA) { - CommonUtils.runtimeException("Try to recv on send message"); - } else { - CommonUtils.runtimeException("Try to send on recv message"); - } - } - } - - public boolean isMessageReady() { - return mIsMessageReady; - } - - public void checkReady() { - if (!mIsMessageReady) { - CommonUtils.runtimeException("Message is not ready."); - } - } - - public long getBlockId() { - checkReady(); - return mBlockId; - } - - public long getOffset() { - checkReady(); - return mOffset; - } - - public long getLength() { - checkReady(); - return mLength; - } - - public ByteBuffer getReadOnlyData() { - if (!mIsMessageReady) { - CommonUtils.runtimeException("Message is not ready."); - } - ByteBuffer ret = mData.asReadOnlyBuffer(); - ret.flip(); - return ret; + void setLockId(int lockId) { + mLockId = lockId; } } diff --git a/src/main/java/tachyon/Worker.java b/src/main/java/tachyon/worker/TachyonWorker.java similarity index 69% rename from src/main/java/tachyon/Worker.java rename to src/main/java/tachyon/worker/TachyonWorker.java index a58b17f42f24..270da04f5ef0 100644 --- a/src/main/java/tachyon/Worker.java +++ b/src/main/java/tachyon/worker/TachyonWorker.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.worker; import java.io.IOException; import java.net.InetSocketAddress; @@ -27,6 +27,8 @@ import org.apache.thrift.transport.TTransportException; import org.apache.log4j.Logger; +import tachyon.Constants; +import tachyon.Version; import tachyon.conf.WorkerConf; import tachyon.thrift.BlockInfoException; import tachyon.thrift.Command; @@ -36,26 +38,81 @@ /** * Entry point for a worker daemon. */ -public class Worker implements Runnable { +public class TachyonWorker implements Runnable { private static final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); + public static synchronized TachyonWorker createWorker(InetSocketAddress masterAddress, + InetSocketAddress workerAddress, int dataPort, int selectorThreads, + int acceptQueueSizePerThreads, int workerThreads, String localFolder, long spaceLimitBytes) { + return new TachyonWorker(masterAddress, workerAddress, dataPort, selectorThreads, + acceptQueueSizePerThreads, workerThreads, localFolder, spaceLimitBytes); + } + + public static synchronized TachyonWorker createWorker(String masterAddress, String workerAddress, + int dataPort, int selectorThreads, int acceptQueueSizePerThreads, int workerThreads, + String localFolder, long spaceLimitBytes) { + String[] address = masterAddress.split(":"); + InetSocketAddress master = new InetSocketAddress(address[0], Integer.parseInt(address[1])); + address = workerAddress.split(":"); + InetSocketAddress worker = new InetSocketAddress(address[0], Integer.parseInt(address[1])); + return new TachyonWorker(master, worker, dataPort, selectorThreads, acceptQueueSizePerThreads, + workerThreads, localFolder, spaceLimitBytes); + } + + private static String getMasterLocation(String[] args) { + WorkerConf wConf = WorkerConf.get(); + String confFileMasterLoc = wConf.MASTER_HOSTNAME + ":" + wConf.MASTER_PORT; + String masterLocation; + if (args.length < 2) { + masterLocation = confFileMasterLoc; + } else { + masterLocation = args[1]; + if (masterLocation.indexOf(":") == -1) { + masterLocation += ":" + wConf.MASTER_PORT; + } + if (!masterLocation.equals(confFileMasterLoc)) { + LOG.warn("Master Address in configuration file(" + confFileMasterLoc + ") is different " + + "from the command line one(" + masterLocation + ")."); + } + } + return masterLocation; + } + + public static void main(String[] args) throws UnknownHostException { + if (args.length < 1 || args.length > 2) { + LOG.info("Usage: java -cp target/tachyon-" + Version.VERSION + "-jar-with-dependencies.jar " + + "tachyon.Worker []"); + System.exit(-1); + } + + WorkerConf wConf = WorkerConf.get(); + + TachyonWorker worker = + TachyonWorker.createWorker(getMasterLocation(args), args[0] + ":" + wConf.PORT, + wConf.DATA_PORT, wConf.SELECTOR_THREADS, wConf.QUEUE_SIZE_PER_SELECTOR, + wConf.SERVER_THREADS, wConf.DATA_FOLDER, wConf.MEMORY_SIZE); + worker.start(); + } + private final InetSocketAddress MasterAddress; private final InetSocketAddress WorkerAddress; - private TServer mServer; - private TNonblockingServerSocket mServerTNonblockingServerSocket; + private TNonblockingServerSocket mServerTNonblockingServerSocket; private WorkerStorage mWorkerStorage; + private WorkerServiceHandler mWorkerServiceHandler; + private DataServer mDataServer; private Thread mDataServerThread; + private Thread mHeartbeatThread; private volatile boolean mStop = false; - private Worker(InetSocketAddress masterAddress, InetSocketAddress workerAddress, int dataPort, - int selectorThreads, int acceptQueueSizePerThreads, int workerThreads, + private TachyonWorker(InetSocketAddress masterAddress, InetSocketAddress workerAddress, + int dataPort, int selectorThreads, int acceptQueueSizePerThreads, int workerThreads, String dataFolder, long memoryCapacityBytes) { MasterAddress = masterAddress; WorkerAddress = workerAddress; @@ -65,8 +122,9 @@ private Worker(InetSocketAddress masterAddress, InetSocketAddress workerAddress, mWorkerServiceHandler = new WorkerServiceHandler(mWorkerStorage); - mDataServer = new DataServer(new InetSocketAddress(workerAddress.getHostName(), dataPort), - mWorkerStorage); + mDataServer = + new DataServer(new InetSocketAddress(workerAddress.getHostName(), dataPort), + mWorkerStorage); mDataServerThread = new Thread(mDataServer); mHeartbeatThread = new Thread(this); @@ -76,21 +134,31 @@ private Worker(InetSocketAddress masterAddress, InetSocketAddress workerAddress, new WorkerService.Processor(mWorkerServiceHandler); // TODO This is for Thrift 0.8 or newer. - // mServer = new TThreadedSelectorServer(new TThreadedSelectorServer - // .Args(new TNonblockingServerSocket(workerAddress)).processor(processor) - // .selectorThreads(selectorThreads).acceptQueueSizePerThread(acceptQueueSizePerThreads) - // .workerThreads(workerThreads)); + // mServer = new TThreadedSelectorServer(new TThreadedSelectorServer + // .Args(new TNonblockingServerSocket(workerAddress)).processor(processor) + // .selectorThreads(selectorThreads).acceptQueueSizePerThread(acceptQueueSizePerThreads) + // .workerThreads(workerThreads)); // This is for Thrift 0.7.0, for Hive compatibility. mServerTNonblockingServerSocket = new TNonblockingServerSocket(workerAddress); - mServer = new THsHaServer(new THsHaServer.Args(mServerTNonblockingServerSocket). - processor(processor).workerThreads(workerThreads)); + mServer = + new THsHaServer(new THsHaServer.Args(mServerTNonblockingServerSocket).processor( + processor).workerThreads(workerThreads)); } catch (TTransportException e) { LOG.error(e.getMessage(), e); CommonUtils.runtimeException(e); } } + /** + * Get the worker server handler class. This is for unit test only. + * + * @return the WorkerServiceHandler + */ + WorkerServiceHandler getWorkerServiceHandler() { + return mWorkerServiceHandler; + } + @Override public void run() { long lastHeartbeatMs = System.currentTimeMillis(); @@ -122,24 +190,24 @@ public void run() { if (cmd != null) { switch (cmd.mCommandType) { - case Unknown : + case Unknown: LOG.error("Unknown command: " + cmd); break; - case Nothing : + case Nothing: LOG.debug("Nothing command: " + cmd); break; - case Register : + case Register: LOG.info("Register command: " + cmd); mWorkerStorage.register(); break; - case Free : + case Free: mWorkerStorage.freeBlocks(cmd.mData); LOG.info("Free command: " + cmd); break; - case Delete : + case Delete: LOG.info("Delete command: " + cmd); break; - default : + default: CommonUtils.runtimeException("Un-recognized command from master " + cmd.toString()); } } @@ -148,24 +216,6 @@ public void run() { } } - public static synchronized Worker createWorker(InetSocketAddress masterAddress, - InetSocketAddress workerAddress, int dataPort, int selectorThreads, - int acceptQueueSizePerThreads, int workerThreads, String localFolder, long spaceLimitBytes) { - return new Worker(masterAddress, workerAddress, dataPort, selectorThreads, - acceptQueueSizePerThreads, workerThreads, localFolder, spaceLimitBytes); - } - - public static synchronized Worker createWorker(String masterAddress, - String workerAddress, int dataPort, int selectorThreads, int acceptQueueSizePerThreads, - int workerThreads, String localFolder, long spaceLimitBytes) { - String[] address = masterAddress.split(":"); - InetSocketAddress master = new InetSocketAddress(address[0], Integer.parseInt(address[1])); - address = workerAddress.split(":"); - InetSocketAddress worker = new InetSocketAddress(address[0], Integer.parseInt(address[1])); - return new Worker(master, worker, dataPort, selectorThreads, - acceptQueueSizePerThreads, workerThreads, localFolder, spaceLimitBytes); - } - public void start() { mDataServerThread.start(); mHeartbeatThread.start(); @@ -189,26 +239,4 @@ public void stop() throws IOException, InterruptedException { } mHeartbeatThread.join(); } - - public static void main(String[] args) throws UnknownHostException { - if (args.length != 1) { - LOG.info("Usage: java -cp target/tachyon-" + Version.VERSION + "-jar-with-dependencies.jar " + - "tachyon.Worker "); - System.exit(-1); - } - WorkerConf wConf = WorkerConf.get(); - Worker worker = Worker.createWorker(wConf.MASTER_HOSTNAME + ":" + wConf.MASTER_PORT, - args[0] + ":" + wConf.PORT, wConf.DATA_PORT, - wConf.SELECTOR_THREADS, wConf.QUEUE_SIZE_PER_SELECTOR, - wConf.SERVER_THREADS, wConf.DATA_FOLDER, wConf.MEMORY_SIZE); - worker.start(); - } - - /** - * Get the worker server handler class. This is for unit test only. - * @return the WorkerServiceHandler - */ - WorkerServiceHandler getWorkerServiceHandler() { - return mWorkerServiceHandler; - } } \ No newline at end of file diff --git a/src/main/java/tachyon/WorkerClient.java b/src/main/java/tachyon/worker/WorkerClient.java similarity index 80% rename from src/main/java/tachyon/WorkerClient.java rename to src/main/java/tachyon/worker/WorkerClient.java index 6bf3e12446d5..54a3263aaf9b 100644 --- a/src/main/java/tachyon/WorkerClient.java +++ b/src/main/java/tachyon/worker/WorkerClient.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.worker; import java.io.IOException; import java.net.InetSocketAddress; @@ -27,11 +27,14 @@ import org.apache.thrift.transport.TTransportException; import org.apache.log4j.Logger; +import tachyon.Constants; +import tachyon.HeartbeatThread; import tachyon.conf.UserConf; import tachyon.thrift.BlockInfoException; import tachyon.thrift.FailedToCheckpointException; import tachyon.thrift.FileDoesNotExistException; import tachyon.thrift.SuspectedFileSizeException; +import tachyon.thrift.TachyonException; import tachyon.thrift.WorkerService; /** @@ -53,14 +56,15 @@ public class WorkerClient { public WorkerClient(InetSocketAddress address, long userId) { mWorkerAddress = address; - mProtocol = new TBinaryProtocol(new TFramedTransport(new TSocket( - mWorkerAddress.getHostName(), mWorkerAddress.getPort()))); + mProtocol = + new TBinaryProtocol(new TFramedTransport(new TSocket(mWorkerAddress.getHostName(), + mWorkerAddress.getPort()))); CLIENT = new WorkerService.Client(mProtocol); mUserId = userId; - mHeartbeatThread = new HeartbeatThread("WorkerClientToWorkerHeartbeat", - new WorkerClientHeartbeatExecutor(this, mUserId), - UserConf.get().HEARTBEAT_INTERVAL_MS); + mHeartbeatThread = + new HeartbeatThread("WorkerClientToWorkerHeartbeat", new WorkerClientHeartbeatExecutor( + this, mUserId), UserConf.get().HEARTBEAT_INTERVAL_MS); mHeartbeatThread.setDaemon(true); } @@ -68,23 +72,33 @@ public synchronized void accessBlock(long blockId) throws TException { CLIENT.accessBlock(blockId); } - public synchronized void addCheckpoint(long userId, int fileId) - throws IOException, TException { + public synchronized void addCheckpoint(long userId, int fileId) throws IOException, TException { try { CLIENT.addCheckpoint(userId, fileId); - } catch (FileDoesNotExistException | SuspectedFileSizeException | FailedToCheckpointException | - BlockInfoException e) { + } catch (FileDoesNotExistException e) { + throw new IOException(e); + } catch (SuspectedFileSizeException e) { + throw new IOException(e); + } catch (FailedToCheckpointException e) { + throw new IOException(e); + } catch (BlockInfoException e) { throw new IOException(e); } } - public synchronized void cacheBlock(long userId, long blockId) - throws IOException, TException { + public synchronized boolean asyncCheckpoint(int fid) throws TachyonException, TException { + return CLIENT.asyncCheckpoint(fid); + } + + public synchronized void cacheBlock(long userId, long blockId) throws IOException, TException { try { CLIENT.cacheBlock(userId, blockId); - } catch (FileDoesNotExistException | BlockInfoException e) { + } catch (FileDoesNotExistException e) { + throw new IOException(e); + } catch (BlockInfoException e) { throw new IOException(e); } catch (SuspectedFileSizeException e) { + throw new IOException(e); } } @@ -96,14 +110,6 @@ public synchronized void close() { } } - public synchronized String getUserTempFolder(long userId) throws TException { - return CLIENT.getUserTempFolder(userId); - } - - public synchronized String getUserUnderfsTempFolder(long userId) throws TException { - return CLIENT.getUserUnderfsTempFolder(userId); - } - public synchronized String getDataFolder() throws TException { if (mRootFolder == null) { mRootFolder = CLIENT.getDataFolder(); @@ -112,6 +118,14 @@ public synchronized String getDataFolder() throws TException { return mRootFolder; } + public synchronized String getUserTempFolder(long userId) throws TException { + return CLIENT.getUserTempFolder(userId); + } + + public synchronized String getUserUnderfsTempFolder(long userId) throws TException { + return CLIENT.getUserUnderfsTempFolder(userId); + } + public synchronized boolean isConnected() { return mIsConnected; } diff --git a/src/main/java/tachyon/WorkerClientHeartbeatExecutor.java b/src/main/java/tachyon/worker/WorkerClientHeartbeatExecutor.java similarity index 94% rename from src/main/java/tachyon/WorkerClientHeartbeatExecutor.java rename to src/main/java/tachyon/worker/WorkerClientHeartbeatExecutor.java index e77bef3d4530..28bd8bff5f1c 100644 --- a/src/main/java/tachyon/WorkerClientHeartbeatExecutor.java +++ b/src/main/java/tachyon/worker/WorkerClientHeartbeatExecutor.java @@ -14,14 +14,17 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.worker; import org.apache.log4j.Logger; import org.apache.thrift.TException; +import tachyon.Constants; +import tachyon.HeartbeatExecutor; + /** * User client sends periodical heartbeats to the worker it is talking to. It is fails to do so, - * the worker may withdraw the space granted to the particular user. + * the worker may withdraw the space granted to the particular user. */ class WorkerClientHeartbeatExecutor implements HeartbeatExecutor { private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); diff --git a/src/main/java/tachyon/WorkerServiceHandler.java b/src/main/java/tachyon/worker/WorkerServiceHandler.java similarity index 77% rename from src/main/java/tachyon/WorkerServiceHandler.java rename to src/main/java/tachyon/worker/WorkerServiceHandler.java index edfd5493aaad..d8a017ffae1e 100644 --- a/src/main/java/tachyon/WorkerServiceHandler.java +++ b/src/main/java/tachyon/worker/WorkerServiceHandler.java @@ -14,7 +14,9 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.worker; + +import java.io.IOException; import org.apache.thrift.TException; @@ -22,10 +24,11 @@ import tachyon.thrift.FailedToCheckpointException; import tachyon.thrift.FileDoesNotExistException; import tachyon.thrift.SuspectedFileSizeException; +import tachyon.thrift.TachyonException; import tachyon.thrift.WorkerService; /** - * WorkerServiceHandler handles all the RPC call to the worker. + * WorkerServiceHandler handles all the RPC calls to the worker. */ public class WorkerServiceHandler implements WorkerService.Iface { private WorkerStorage mWorkerStorage; @@ -40,15 +43,23 @@ public void accessBlock(long blockId) throws TException { } @Override - public void addCheckpoint(long userId, int fileId) - throws FileDoesNotExistException, SuspectedFileSizeException, - FailedToCheckpointException, BlockInfoException, TException { + public void addCheckpoint(long userId, int fileId) throws FileDoesNotExistException, + SuspectedFileSizeException, FailedToCheckpointException, BlockInfoException, TException { mWorkerStorage.addCheckpoint(userId, fileId); } @Override - public void cacheBlock(long userId, long blockId) - throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, TException { + public boolean asyncCheckpoint(int fileId) throws TachyonException, TException { + try { + return mWorkerStorage.asyncCheckpoint(fileId); + } catch (IOException e) { + throw new TachyonException(e.getMessage()); + } + } + + @Override + public void cacheBlock(long userId, long blockId) throws FileDoesNotExistException, + SuspectedFileSizeException, BlockInfoException, TException { mWorkerStorage.cacheBlock(userId, blockId); } @@ -73,13 +84,13 @@ public void lockBlock(long blockId, long userId) throws TException { } @Override - public void returnSpace(long userId, long returnedBytes) throws TException { - mWorkerStorage.returnSpace(userId, returnedBytes); + public boolean requestSpace(long userId, long requestBytes) throws TException { + return mWorkerStorage.requestSpace(userId, requestBytes); } @Override - public boolean requestSpace(long userId, long requestBytes) throws TException { - return mWorkerStorage.requestSpace(userId, requestBytes); + public void returnSpace(long userId, long returnedBytes) throws TException { + mWorkerStorage.returnSpace(userId, returnedBytes); } @Override diff --git a/src/main/java/tachyon/WorkerSpaceCounter.java b/src/main/java/tachyon/worker/WorkerSpaceCounter.java similarity index 98% rename from src/main/java/tachyon/WorkerSpaceCounter.java rename to src/main/java/tachyon/worker/WorkerSpaceCounter.java index 8db8f6d45a3e..1c41847ada42 100644 --- a/src/main/java/tachyon/WorkerSpaceCounter.java +++ b/src/main/java/tachyon/worker/WorkerSpaceCounter.java @@ -14,7 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.worker; /** * The worker space counter, in charge of counting and granting spaces in a worker daemon. diff --git a/src/main/java/tachyon/WorkerStorage.java b/src/main/java/tachyon/worker/WorkerStorage.java similarity index 57% rename from src/main/java/tachyon/WorkerStorage.java rename to src/main/java/tachyon/worker/WorkerStorage.java index 006778f7b1f1..15474dfde322 100644 --- a/src/main/java/tachyon/WorkerStorage.java +++ b/src/main/java/tachyon/worker/WorkerStorage.java @@ -14,10 +14,12 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package tachyon; +package tachyon.worker; import java.io.File; +import java.io.FileInputStream; import java.io.IOException; +import java.io.InputStream; import java.io.OutputStream; import java.io.RandomAccessFile; import java.net.InetSocketAddress; @@ -37,9 +39,15 @@ import org.apache.log4j.Logger; import org.apache.thrift.TException; +import tachyon.Constants; +import tachyon.UnderFileSystem; +import tachyon.Users; import tachyon.conf.CommonConf; import tachyon.conf.WorkerConf; +import tachyon.master.BlockInfo; +import tachyon.master.MasterClient; import tachyon.thrift.BlockInfoException; +import tachyon.thrift.ClientFileInfo; import tachyon.thrift.Command; import tachyon.thrift.FailedToCheckpointException; import tachyon.thrift.FileDoesNotExistException; @@ -51,35 +59,229 @@ * The structure to store a worker's information in worker node. */ public class WorkerStorage { + public class CheckpointThread implements Runnable { + private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); + private final int ID; + private UnderFileSystem mCheckpointUnderFs = null; + + public CheckpointThread(int id) { + ID = id; + } + + // This method assumes the mDependencyLock has been acquired. + private int getFileIdBasedOnPriorityDependency() throws TException { + if (mPriorityDependencies.isEmpty()) { + return -1; + } + for (int depId : mPriorityDependencies) { + int fileId = getFileIdFromOneDependency(depId); + if (fileId != -1) { + return fileId; + } + } + return -1; + } + + // This method assumes the mDependencyLock has been acquired. + private int getFileIdFromOneDependency(int depId) throws TException { + Set fileIds = mDepIdToFiles.get(depId); + if (fileIds != null && !fileIds.isEmpty()) { + int fileId = fileIds.iterator().next(); + fileIds.remove(fileId); + mUncheckpointFiles.remove(fileId); + if (fileIds.isEmpty()) { + mDepIdToFiles.remove(depId); + } + return fileId; + } + return -1; + } + + // This method assumes the mDependencyLock has been acquired. + private int getRandomUncheckpointedFile() throws TException { + if (mUncheckpointFiles.isEmpty()) { + return -1; + } + for (int depId : mDepIdToFiles.keySet()) { + int fileId = getFileIdFromOneDependency(depId); + if (fileId != -1) { + return fileId; + } + } + return -1; + } + + private List getSortedPriorityDependencyList() throws TException { + List ret = mMasterClient.worker_getPriorityDependencyList(); + for (int i = 0; i < ret.size(); i ++) { + for (int j = i + 1; j < ret.size(); j ++) { + if (ret.get(i) < ret.get(j)) { + int k = ret.get(i); + ret.set(i, ret.get(j)); + ret.set(j, k); + } + } + } + return ret; + } + + @Override + public void run() { + while (true) { + try { + int fileId = -1; + synchronized (mDependencyLock) { + fileId = getFileIdBasedOnPriorityDependency(); + + if (fileId == -1) { + if (mPriorityDependencies.size() == 0) { + mPriorityDependencies = getSortedPriorityDependencyList(); + if (!mPriorityDependencies.isEmpty()) { + LOG.info("Get new mPriorityDependencies " + + CommonUtils.listToString(mPriorityDependencies)); + } + } else { + List tList = getSortedPriorityDependencyList(); + boolean equal = true; + if (mPriorityDependencies.size() != tList.size()) { + equal = false; + } + if (equal) { + for (int k = 0; k < tList.size(); k ++) { + if (tList.get(k) != mPriorityDependencies.get(k)) { + equal = false; + break; + } + } + } + + if (!equal) { + mPriorityDependencies = tList; + } + } + + fileId = getFileIdBasedOnPriorityDependency(); + } + + if (fileId == -1) { + fileId = getRandomUncheckpointedFile(); + } + } + + if (fileId == -1) { + LOG.debug("Thread " + ID + " has nothing to checkpoint. Sleep for 1 sec."); + CommonUtils.sleepMs(LOG, 1000); + continue; + } + + // TODO checkpoint process. In future, move from midPath to dstPath should be done by + // master + String midPath = mUnderfsWorkerDataFolder + "/" + fileId; + String dstPath = CommonConf.get().UNDERFS_DATA_FOLDER + "/" + fileId; + LOG.info("Thread " + ID + " is checkpointing file " + fileId + " from " + + mLocalDataFolder.toString() + " to " + midPath + " to " + dstPath); + + if (mCheckpointUnderFs == null) { + mCheckpointUnderFs = UnderFileSystem.get(midPath); + } + + long startCopyTimeMs = System.currentTimeMillis(); + ClientFileInfo fileInfo = mMasterClient.getClientFileInfoById(fileId); + if (!fileInfo.isComplete()) { + LOG.error("File " + fileInfo + " is not complete!"); + continue; + } + for (int k = 0; k < fileInfo.blockIds.size(); k ++) { + lockBlock(fileInfo.blockIds.get(k), Users.sCHECKPOINT_USER_ID); + } + OutputStream os = mCheckpointUnderFs.create(midPath, (int) fileInfo.getBlockSizeByte()); + long fileSizeByte = 0; + for (int k = 0; k < fileInfo.blockIds.size(); k ++) { + File tempFile = new File(mLocalDataFolder.toString() + "/" + fileInfo.blockIds.get(k)); + fileSizeByte += tempFile.length(); + InputStream is = new FileInputStream(tempFile); + byte[] buf = new byte[16 * Constants.KB]; + int got = is.read(buf); + while (got != -1) { + os.write(buf, 0, got); + got = is.read(buf); + } + is.close(); + } + os.close(); + if (!mCheckpointUnderFs.rename(midPath, dstPath)) { + LOG.error("Failed to rename from " + midPath + " to " + dstPath); + } + mMasterClient.addCheckpoint(mWorkerId, fileId, fileSizeByte, dstPath); + for (int k = 0; k < fileInfo.blockIds.size(); k ++) { + unlockBlock(fileInfo.blockIds.get(k), Users.sCHECKPOINT_USER_ID); + } + + long shouldTakeMs = + (long) (1000.0 * fileSizeByte / Constants.MB / WorkerConf.get().WORKER_PER_THREAD_CHECKPOINT_CAP_MB_SEC); + long currentTimeMs = System.currentTimeMillis(); + if (startCopyTimeMs + shouldTakeMs > currentTimeMs) { + long shouldSleepMs = startCopyTimeMs + shouldTakeMs - currentTimeMs; + LOG.info("Checkpointed last file " + fileId + " took " + + (currentTimeMs - startCopyTimeMs) + " ms. Need to sleep " + shouldSleepMs + + " ms."); + CommonUtils.sleepMs(LOG, shouldSleepMs); + } + } catch (FileDoesNotExistException e) { + LOG.warn(e); + } catch (SuspectedFileSizeException e) { + LOG.error(e); + } catch (BlockInfoException e) { + LOG.error(e); + } catch (IOException e) { + LOG.error(e); + } catch (TException e) { + LOG.warn(e); + } + } + } + } + private final Logger LOG = Logger.getLogger(Constants.LOGGER_TYPE); private final CommonConf COMMON_CONF; - private volatile MasterClient mMasterClient; private InetSocketAddress mMasterAddress; private InetSocketAddress mWorkerAddress; private WorkerSpaceCounter mWorkerSpaceCounter; - private long mWorkerId; + private long mWorkerId; private Set mMemoryData = new HashSet(); private Map mBlockSizes = new HashMap(); - private Map mLatestBlockAccessTimeMs = new HashMap(); + private Map mLatestBlockAccessTimeMs = new HashMap(); private Map> mUsersPerLockedBlock = new HashMap>(); - private Map> mLockedBlocksPerUser = new HashMap>(); - private BlockingQueue mRemovedBlockList = - new ArrayBlockingQueue(Constants.WORKER_FILES_QUEUE_SIZE); - private BlockingQueue mAddedBlockList = - new ArrayBlockingQueue(Constants.WORKER_FILES_QUEUE_SIZE); + private Map> mLockedBlocksPerUser = new HashMap>(); + private BlockingQueue mRemovedBlockList = new ArrayBlockingQueue( + Constants.WORKER_BLOCKS_QUEUE_SIZE); + private BlockingQueue mAddedBlockList = new ArrayBlockingQueue( + Constants.WORKER_BLOCKS_QUEUE_SIZE); private File mLocalDataFolder; private File mLocalUserFolder; private String mUnderfsWorkerFolder; + private String mUnderfsWorkerDataFolder; private String mUnderfsOrphansFolder; + private UnderFileSystem mUnderFs; private Users mUsers; + // Dependency related lock + private Object mDependencyLock = new Object(); + private Set mUncheckpointFiles = new HashSet(); + // From dependencyId to files in that set. + private Map> mDepIdToFiles = new HashMap>(); + + private List mPriorityDependencies = new ArrayList(); + + private ArrayList mCheckpointThreads = new ArrayList( + WorkerConf.get().WORKER_CHECKPOINT_THREADS); public WorkerStorage(InetSocketAddress masterAddress, InetSocketAddress workerAddress, String dataFolder, long memoryCapacityBytes) { @@ -94,9 +296,10 @@ public WorkerStorage(InetSocketAddress masterAddress, InetSocketAddress workerAd while (mWorkerId == 0) { try { mMasterClient.connect(); - mWorkerId = mMasterClient.worker_register( - new NetAddress(mWorkerAddress.getHostName(), mWorkerAddress.getPort()), - mWorkerSpaceCounter.getCapacityBytes(), 0, new ArrayList()); + mWorkerId = + mMasterClient.worker_register(new NetAddress(mWorkerAddress.getHostName(), + mWorkerAddress.getPort()), mWorkerSpaceCounter.getCapacityBytes(), 0, + new ArrayList()); } catch (BlockInfoException e) { LOG.error(e.getMessage(), e); mWorkerId = 0; @@ -112,9 +315,16 @@ public WorkerStorage(InetSocketAddress masterAddress, InetSocketAddress workerAd mLocalUserFolder = new File(mLocalDataFolder.toString(), WorkerConf.get().USER_TEMP_RELATIVE_FOLDER); mUnderfsWorkerFolder = COMMON_CONF.UNDERFS_WORKERS_FOLDER + "/" + mWorkerId; + mUnderfsWorkerDataFolder = mUnderfsWorkerFolder + "/data"; mUnderFs = UnderFileSystem.get(COMMON_CONF.UNDERFS_ADDRESS); mUsers = new Users(mLocalUserFolder.toString(), mUnderfsWorkerFolder); + for (int k = 0; k < WorkerConf.get().WORKER_CHECKPOINT_THREADS; k ++) { + Thread thread = new Thread(new CheckpointThread(k)); + mCheckpointThreads.add(thread); + thread.start(); + } + try { initializeWorkerStorage(); } catch (IOException e) { @@ -129,8 +339,8 @@ public WorkerStorage(InetSocketAddress masterAddress, InetSocketAddress workerAd CommonUtils.runtimeException(e); } - LOG.info("Current Worker Info: ID " + mWorkerId + ", ADDRESS: " + mWorkerAddress + - ", MemoryCapacityBytes: " + mWorkerSpaceCounter.getCapacityBytes()); + LOG.info("Current Worker Info: ID " + mWorkerId + ", ADDRESS: " + mWorkerAddress + + ", MemoryCapacityBytes: " + mWorkerSpaceCounter.getCapacityBytes()); } public void accessBlock(long blockId) { @@ -139,9 +349,16 @@ public void accessBlock(long blockId) { } } - public void addCheckpoint(long userId, int fileId) - throws FileDoesNotExistException, SuspectedFileSizeException, - FailedToCheckpointException, BlockInfoException, TException { + private void addBlockId(long blockId, long fileSizeBytes) { + synchronized (mLatestBlockAccessTimeMs) { + mLatestBlockAccessTimeMs.put(blockId, System.currentTimeMillis()); + mBlockSizes.put(blockId, fileSizeBytes); + mMemoryData.add(blockId); + } + } + + public void addCheckpoint(long userId, int fileId) throws FileDoesNotExistException, + SuspectedFileSizeException, FailedToCheckpointException, BlockInfoException, TException { // TODO This part need to be changed. String srcPath = getUserUnderfsTempFolder(userId) + "/" + fileId; String dstPath = COMMON_CONF.UNDERFS_DATA_FOLDER + "/" + fileId; @@ -161,22 +378,32 @@ public void addCheckpoint(long userId, int fileId) mMasterClient.addCheckpoint(mWorkerId, fileId, fileSize, dstPath); } - private void addFoundBlock(long blockId, long length) - throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, TException { + private void addFoundBlock(long blockId, long length) throws FileDoesNotExistException, + SuspectedFileSizeException, BlockInfoException, TException { addBlockId(blockId, length); - mMasterClient.worker_cacheBlock(mWorkerId, mWorkerSpaceCounter.getUsedBytes(), blockId, length); + mMasterClient + .worker_cacheBlock(mWorkerId, mWorkerSpaceCounter.getUsedBytes(), blockId, length); } - private void addBlockId(long blockId, long fileSizeBytes) { - synchronized (mLatestBlockAccessTimeMs) { - mLatestBlockAccessTimeMs.put(blockId, System.currentTimeMillis()); - mBlockSizes.put(blockId, fileSizeBytes); - mMemoryData.add(blockId); + public boolean asyncCheckpoint(int fileId) throws IOException, TException { + ClientFileInfo fileInfo = mMasterClient.getClientFileInfoById(fileId); + + if (fileInfo.getDependencyId() != -1) { + synchronized (mDependencyLock) { + mUncheckpointFiles.add(fileId); + if (!mDepIdToFiles.containsKey(fileInfo.getDependencyId())) { + mDepIdToFiles.put(fileInfo.getDependencyId(), new HashSet()); + } + mDepIdToFiles.get(fileInfo.getDependencyId()).add(fileId); + } + return true; } + + return false; } - public void cacheBlock(long userId, long blockId) - throws FileDoesNotExistException, SuspectedFileSizeException, BlockInfoException, TException { + public void cacheBlock(long userId, long blockId) throws FileDoesNotExistException, + SuspectedFileSizeException, BlockInfoException, TException { File srcFile = new File(getUserTempFolder(userId) + "/" + blockId); File dstFile = new File(mLocalDataFolder + "/" + blockId); long fileSizeBytes = srcFile.length(); @@ -184,13 +411,13 @@ public void cacheBlock(long userId, long blockId) throw new FileDoesNotExistException("File " + srcFile + " does not exist."); } if (!srcFile.renameTo(dstFile)) { - throw new FileDoesNotExistException("Failed to rename file from " + srcFile.getPath() + - " to " + dstFile.getPath()); + throw new FileDoesNotExistException("Failed to rename file from " + srcFile.getPath() + + " to " + dstFile.getPath()); } addBlockId(blockId, fileSizeBytes); - mUsers.addOwnBytes(userId, - fileSizeBytes); - mMasterClient.worker_cacheBlock(mWorkerId, - mWorkerSpaceCounter.getUsedBytes(), blockId, fileSizeBytes); + mUsers.addOwnBytes(userId, -fileSizeBytes); + mMasterClient.worker_cacheBlock(mWorkerId, mWorkerSpaceCounter.getUsedBytes(), blockId, + fileSizeBytes); LOG.info(userId + " " + dstFile); } @@ -222,7 +449,9 @@ public void checkStatus() { /** * Remove a block from the memory. - * @param blockId The block to be removed. + * + * @param blockId + * The block to be removed. * @return Removed file size in bytes. */ private synchronized long freeBlock(long blockId) { @@ -247,40 +476,24 @@ private synchronized long freeBlock(long blockId) { /** * Remove blocks from the memory. - * @param blocks The list of blocks to be removed. + * + * @param blocks + * The list of blocks to be removed. */ public void freeBlocks(List blocks) { - for (long blockId: blocks) { + for (long blockId : blocks) { freeBlock(blockId); } } - /** - * Swap out those blocks missing INode information onto underFS which can be - * retrieved by user later. Its cleanup only happens while formating the TFS. - */ - private void swapoutOrphanBlocks(long blockId, File file) throws IOException { - RandomAccessFile localFile = new RandomAccessFile(file, "r"); - ByteBuffer buf = localFile.getChannel().map(MapMode.READ_ONLY, 0, file.length()); - - String ufsOrphanBlock = mUnderfsOrphansFolder + Constants.PATH_SEPARATOR + blockId; - OutputStream os = mUnderFs.create(ufsOrphanBlock); - int BULKSIZE = 1024 * 64; - byte[] bulk = new byte[BULKSIZE]; - for (int k = 0; k < (buf.limit() + BULKSIZE - 1) / BULKSIZE; k++) { - int len = BULKSIZE < buf.remaining() ? BULKSIZE : buf.remaining(); - buf.get(bulk, buf.position(), len); - os.write(bulk, 0, len); - } - os.close(); - - localFile.close(); - } - public String getDataFolder() throws TException { return mLocalDataFolder.toString(); } + public String getUnderfsOrphansFolder() { + return mUnderfsOrphansFolder; + } + public String getUserTempFolder(long userId) throws TException { String ret = mUsers.getUserTempFolder(userId); LOG.info("Return UserTempFolder for " + userId + " : " + ret); @@ -303,12 +516,15 @@ public Command heartbeat() throws BlockInfoException, TException { } private void initializeWorkerStorage() throws IOException, FileDoesNotExistException, - SuspectedFileSizeException, BlockInfoException, TException { + SuspectedFileSizeException, BlockInfoException, TException { LOG.info("Initializing the worker storage."); if (!mLocalDataFolder.exists()) { LOG.info("Local folder " + mLocalDataFolder + " does not exist. Creating a new one."); mLocalDataFolder.mkdir(); mLocalUserFolder.mkdir(); + + CommonUtils.changeLocalFilePermission(mLocalDataFolder.getPath(), "775"); + CommonUtils.changeLocalFilePermission(mLocalUserFolder.getPath(), "775"); return; } @@ -326,6 +542,7 @@ private void initializeWorkerStorage() throws IOException, FileDoesNotExistExcep } } mLocalUserFolder.mkdir(); + CommonUtils.changeLocalFilePermission(mLocalUserFolder.getPath(), "775"); mUnderfsOrphansFolder = mUnderfsWorkerFolder + "/orphans"; if (!mUnderFs.exists(mUnderfsOrphansFolder)) { @@ -344,7 +561,8 @@ private void initializeWorkerStorage() throws IOException, FileDoesNotExistExcep addFoundBlock(blockId, tFile.length()); } catch (FileDoesNotExistException e) { LOG.error("BlockId: " + blockId + " becomes orphan for: \"" + e.message + "\""); - LOG.info("Swapout File " + cnt + ": blockId: " + blockId + " to " + mUnderfsOrphansFolder); + LOG.info("Swapout File " + cnt + ": blockId: " + blockId + " to " + + mUnderfsOrphansFolder); swapoutOrphanBlocks(blockId, tFile); freeBlock(blockId); continue; @@ -373,8 +591,10 @@ public void lockBlock(long blockId, long userId) throws TException { /** * Use local LRU to evict data, and get requestBytes available space. - * @param requestBytes The data requested. - * @return true if the space is granteed, false if not. + * + * @param requestBytes + * The data requested. + * @return true if the space is granted, false if not. */ private boolean memoryEvictionLRU(long requestBytes) { Set pinList = new HashSet(); @@ -394,7 +614,7 @@ private boolean memoryEvictionLRU(long requestBytes) { for (Entry entry : mLatestBlockAccessTimeMs.entrySet()) { if (entry.getValue() < latestTimeMs && !pinList.contains(BlockInfo.computeInodeId(entry.getKey()))) { - if(!mUsersPerLockedBlock.containsKey(entry.getKey())) { + if (!mUsersPerLockedBlock.containsKey(entry.getKey())) { blockId = entry.getKey(); latestTimeMs = entry.getValue(); } @@ -417,9 +637,10 @@ public void register() { while (id == 0) { try { mMasterClient.connect(); - id = mMasterClient.worker_register( - new NetAddress(mWorkerAddress.getHostName(), mWorkerAddress.getPort()), - mWorkerSpaceCounter.getCapacityBytes(), 0, new ArrayList(mMemoryData)); + id = + mMasterClient.worker_register(new NetAddress(mWorkerAddress.getHostName(), + mWorkerAddress.getPort()), mWorkerSpaceCounter.getCapacityBytes(), 0, + new ArrayList(mMemoryData)); } catch (BlockInfoException e) { LOG.error(e.getMessage(), e); id = 0; @@ -433,26 +654,12 @@ public void register() { mWorkerId = id; } - public void returnSpace(long userId, long returnedBytes) throws TException { - long preAvailableBytes = mWorkerSpaceCounter.getAvailableBytes(); - if (returnedBytes > mUsers.ownBytes(userId)) { - LOG.error("User " + userId + " does not own " + returnedBytes + " bytes."); - } else { - mWorkerSpaceCounter.returnUsedBytes(returnedBytes); - mUsers.addOwnBytes(userId, - returnedBytes); - } - - LOG.info("returnSpace(" + userId + ", " + returnedBytes + ") : " + - preAvailableBytes + " returned: " + returnedBytes + ". New Available: " + - mWorkerSpaceCounter.getAvailableBytes()); - } - public boolean requestSpace(long userId, long requestBytes) throws TException { - LOG.info("requestSpace(" + userId + ", " + requestBytes + "): Current available: " + - mWorkerSpaceCounter.getAvailableBytes() + " requested: " + requestBytes); + LOG.info("requestSpace(" + userId + ", " + requestBytes + "): Current available: " + + mWorkerSpaceCounter.getAvailableBytes() + " requested: " + requestBytes); if (mWorkerSpaceCounter.getCapacityBytes() < requestBytes) { - LOG.info("user_requestSpace(): requested memory size is larger than the total memory on" + - " the machine."); + LOG.info("user_requestSpace(): requested memory size is larger than the total memory on" + + " the machine."); return false; } @@ -473,10 +680,46 @@ public void resetMasterClient() { mMasterClient = tMasterClient; } + public void returnSpace(long userId, long returnedBytes) throws TException { + long preAvailableBytes = mWorkerSpaceCounter.getAvailableBytes(); + if (returnedBytes > mUsers.ownBytes(userId)) { + LOG.error("User " + userId + " does not own " + returnedBytes + " bytes."); + } else { + mWorkerSpaceCounter.returnUsedBytes(returnedBytes); + mUsers.addOwnBytes(userId, -returnedBytes); + } + + LOG.info("returnSpace(" + userId + ", " + returnedBytes + ") : " + preAvailableBytes + + " returned: " + returnedBytes + ". New Available: " + + mWorkerSpaceCounter.getAvailableBytes()); + } + public void stop() { mMasterClient.shutdown(); } + /** + * Swap out those blocks missing INode information onto underFS which can be + * retrieved by user later. Its cleanup only happens while formating the TFS. + */ + private void swapoutOrphanBlocks(long blockId, File file) throws IOException { + RandomAccessFile localFile = new RandomAccessFile(file, "r"); + ByteBuffer buf = localFile.getChannel().map(MapMode.READ_ONLY, 0, file.length()); + + String ufsOrphanBlock = mUnderfsOrphansFolder + Constants.PATH_SEPARATOR + blockId; + OutputStream os = mUnderFs.create(ufsOrphanBlock); + int BULKSIZE = 1024 * 64; + byte[] bulk = new byte[BULKSIZE]; + for (int k = 0; k < (buf.limit() + BULKSIZE - 1) / BULKSIZE; k ++) { + int len = BULKSIZE < buf.remaining() ? BULKSIZE : buf.remaining(); + buf.get(bulk, 0, len); + os.write(bulk, 0, len); + } + os.close(); + + localFile.close(); + } + public void unlockBlock(long blockId, long userId) throws TException { synchronized (mUsersPerLockedBlock) { if (mUsersPerLockedBlock.containsKey(blockId)) { diff --git a/src/main/java/tachyon/web/resources/browse.jsp b/src/main/webapp/browse.jsp similarity index 78% rename from src/main/java/tachyon/web/resources/browse.jsp rename to src/main/webapp/browse.jsp index 2ed246da1cd3..5281511a7bf3 100644 --- a/src/main/java/tachyon/web/resources/browse.jsp +++ b/src/main/webapp/browse.jsp @@ -14,9 +14,10 @@ @@ -55,6 +56,7 @@ --> <% if ((Boolean) request.getAttribute("debug")) { %> +
    @@ -84,6 +86,11 @@ + @@ -111,15 +118,25 @@ <% if ((Boolean) request.getAttribute("debug")) { %> + + <% } %> @@ -133,7 +132,7 @@ - +
    @@ -162,17 +161,57 @@
    - + + +
    [D]Dependency Id [D]Inode Number [D]Checkpoint Path [D]File Locations${fileInfo.creationTime} + + + + ${fileInfo.id} ${fileInfo.checkpointPath}<%= fileInfo.getSize() %> <%= fileInfo.getBlockSizeBytes() %> - <% if (fileInfo.getInMemory()) { %> - + <% if (fileInfo.getIsDirectory()) { %> <% } %> - <% if (!fileInfo.getInMemory()) { %> - + <% if (!fileInfo.getIsDirectory()) { %> + <% if (fileInfo.getInMemory()) { %> + + <% } %> + <% if (!fileInfo.getInMemory()) { %> + + <% } %> + <%= fileInfo.getInMemoryPercentage() %>% <% } %> <%= fileInfo.getCreationTime() %> + <% if (fileInfo.getDependencyId() != -1) { %> + <%= fileInfo.getDependencyId() %> + <% } %> + <%= fileInfo.getId() %> <%= fileInfo.getCheckpointPath() %> <% for (String location : fileInfo.getFileLocations()) { %> @@ -137,7 +154,7 @@

    - Tachyon is a project developed at the UC Berkeley AMPLab. + Tachyon is a project developed at the UC Berkeley AMPLab.

    diff --git a/src/main/java/tachyon/web/resources/css/bootstrap-responsive.min.css b/src/main/webapp/css/bootstrap-responsive.min.css similarity index 100% rename from src/main/java/tachyon/web/resources/css/bootstrap-responsive.min.css rename to src/main/webapp/css/bootstrap-responsive.min.css diff --git a/src/main/java/tachyon/web/resources/css/bootstrap.min.css b/src/main/webapp/css/bootstrap.min.css similarity index 100% rename from src/main/java/tachyon/web/resources/css/bootstrap.min.css rename to src/main/webapp/css/bootstrap.min.css diff --git a/src/main/webapp/css/tachyoncustom.min.css b/src/main/webapp/css/tachyoncustom.min.css new file mode 100644 index 000000000000..2dd5376e0968 --- /dev/null +++ b/src/main/webapp/css/tachyoncustom.min.css @@ -0,0 +1,6 @@ +.custom-progress{margin-bottom:0px;} +.file-content +{ + width:100%; + height:50%; +} diff --git a/src/main/webapp/dependency.jsp b/src/main/webapp/dependency.jsp new file mode 100644 index 000000000000..25fc803fdaa3 --- /dev/null +++ b/src/main/webapp/dependency.jsp @@ -0,0 +1,66 @@ +<%@ page import="java.util.*" %> +<%@ page import="tachyon.web.*" %> + + + + + + + +Tachyon + + + +
    + +
    + <% if (!((String) request.getAttribute("error")).isEmpty()) { %> +

    + <%= request.getAttribute("error") %> +

    + <% } %> +

    Dependency info for <%= request.getAttribute("filePath") %>.

    +
    + + + + + <% for (String parent : (List) request.getAttribute("parentFileNames")) { %> + + <% } %> + +
    Parent Files
    <%= parent %>
    +
    +
    + + + + + <% for (String child : (List) request.getAttribute("childrenFileNames")) { %> + + <% } %> + +
    Children Files
    <%= child %>
    +
    +
    +
    +

    + Tachyon is a project developed at the UC Berkeley AMPLab. +

    +
    +
    + + \ No newline at end of file diff --git a/src/main/java/tachyon/web/resources/general.jsp b/src/main/webapp/general.jsp similarity index 72% rename from src/main/java/tachyon/web/resources/general.jsp rename to src/main/webapp/general.jsp index 3905eb6a1495..149d23b2a476 100644 --- a/src/main/java/tachyon/web/resources/general.jsp +++ b/src/main/webapp/general.jsp @@ -15,10 +15,10 @@ @@ -34,6 +34,10 @@
    + + + + @@ -45,7 +49,7 @@ - + @@ -78,31 +82,26 @@ - + - - - - - - + - + - + - +
    Master Address:<%= request.getAttribute("masterNodeAddress") %>
    Started: <%= request.getAttribute("uptime") %>
    Version:Version: <%= request.getAttribute("version") %>
    <%= request.getAttribute("capacity") %>
    Memory Used:Memory Free / Used: <%= request.getAttribute("usedCapacity") %>
    Memory Free:<%= request.getAttribute("freeCapacity") %><%= request.getAttribute("freeCapacity") %> / <%= request.getAttribute("usedCapacity") %>
    Disk Capacity:UnderFS Capacity: <%= request.getAttribute("diskCapacity") %>
    Disk Free:UnderFS Free / Used: <%= request.getAttribute("diskFreeCapacity") %><%= request.getAttribute("diskFreeCapacity") %> / <%= request.getAttribute("diskUsedCapacity") %>
    - +
    @@ -123,7 +122,7 @@ --> <% for (String file : ((List) request.getAttribute("pinlist"))) { %> -
    <%= file %>
    @@ -187,7 +226,7 @@ <% } %> - +
    Last Heartbeat StateMemory CapacityMemory Usage