分享

c#访问hadoop案例

desehawk 2015-5-10 11:59:53 发表于 实操演练 [显示全部楼层] 回帖奖励 阅读模式 关闭右栏 4 17785
问题导读

1..NET能否使用hadoop?
2.thrift --gen csharp hadoopfs.thrift的作用是什么?
3.你认为thrift的作用是什么?







网上关于Hadoop的内容真是太多了,但是多数都是java方面的,C#的少之又少,因为Hadoop本身是Java实现需要搭建在Linux下,所以网上的应用多是java写的也不足为怪,而我的需求又要求使用.Net的WinForm,所以研究了好几天才有点眉目,现在把研究的一点点成果贴出来和大家分享。

.Net想访问Hadoop官方提供了多种其他途径,这也是官方所引以为豪的,但在真正的非Java开发者看来这些所谓的多种途径多是些Hadoop的噱头(个人拙见)。我因为唯一可行的方案是通过Thrift访问,还好官方也提供了这种方案。

    我使用的是hadoop-1.0.3,当前最新版本是2.0的阿尔法版,hadoopfs.thrift文件可以在\src\contrib\thriftfs\if\hadoopfs.thrift找到,然后使用thrift-0.8.0.exe(请到Thrift官方下载最新版本)运行

[mw_shl_code=applescript,true]thrift --gen csharp hadoopfs.thrift[/mw_shl_code]

命令即可生成最新的c#访问Hadoop客户端代码,如果你不愿意自己生成请在这里下载/Content/attached/file/20120610/nix5lwmw_ayb.rar。
其中ThriftHadoopFileSystem.cs为主要文件,下面贴出部分代码让大家预览一下





已有(4)人评论

跳转到指定楼层
desehawk 发表于 2015-5-10 12:05:35


[mw_shl_code=csharp,true]/**
* Autogenerated by Thrift Compiler (0.8.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.IO;
using Thrift;
using Thrift.Collections;
using Thrift.Protocol;
using Thrift.Transport;
namespace hdfs
{
public class ThriftHadoopFileSystem {
public interface Iface {
void setInactivityTimeoutPeriod(long periodInSeconds);
void shutdown(int status);
ThriftHandle create(PathName path);
ThriftHandle createFile(PathName path, short mode, bool overwrite, int bufferSize, short block_replication, long blocksize);
ThriftHandle open(PathName path);
ThriftHandle append(PathName path);
bool write(ThriftHandle handle, string data);
string read(ThriftHandle handle, long offset, int size);
bool close(ThriftHandle outThrift);
bool rm(PathName path, bool recursive);
bool rename(PathName path, PathName dest);
bool mkdirs(PathName path);
bool exists(PathName path);
FileStatus stat(PathName path);
List<FileStatus> listStatus(PathName path);
void chmod(PathName path, short mode);
void chown(PathName path, string owner, string group);
void setReplication(PathName path, short replication);
List<BlockLocation> getFileBlockLocations(PathName path, long start, long length);
}

public class Client : Iface {
public Client(TProtocol prot) : this(prot, prot)
{
}

public Client(TProtocol iprot, TProtocol oprot)
{
iprot_ = iprot;
oprot_ = oprot;
}

protected TProtocol iprot_;
protected TProtocol oprot_;
protected int seqid_;

public TProtocol InputProtocol
{
get { return iprot_; }
}
public TProtocol OutputProtocol
{
get { return oprot_; }
}


public void setInactivityTimeoutPeriod(long periodInSeconds)
{
send_setInactivityTimeoutPeriod(periodInSeconds);
recv_setInactivityTimeoutPeriod();
}

public void send_setInactivityTimeoutPeriod(long periodInSeconds)
{
oprot_.WriteMessageBegin(new TMessage("setInactivityTimeoutPeriod", TMessageType.Call, seqid_));
setInactivityTimeoutPeriod_args args = new setInactivityTimeoutPeriod_args();
args.PeriodInSeconds = periodInSeconds;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public void recv_setInactivityTimeoutPeriod()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
setInactivityTimeoutPeriod_result result = new setInactivityTimeoutPeriod_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
return;
}

public void shutdown(int status)
{
send_shutdown(status);
recv_shutdown();
}

public void send_shutdown(int status)
{
oprot_.WriteMessageBegin(new TMessage("shutdown", TMessageType.Call, seqid_));
shutdown_args args = new shutdown_args();
args.Status = status;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public void recv_shutdown()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
shutdown_result result = new shutdown_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
return;
}

public ThriftHandle create(PathName path)
{
send_create(path);
return recv_create();
}

public void send_create(PathName path)
{
oprot_.WriteMessageBegin(new TMessage("create", TMessageType.Call, seqid_));
create_args args = new create_args();
args.Path = path;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public ThriftHandle recv_create()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
create_result result = new create_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "create failed: unknown result");
}

public ThriftHandle createFile(PathName path, short mode, bool overwrite, int bufferSize, short block_replication, long blocksize)
{
send_createFile(path, mode, overwrite, bufferSize, block_replication, blocksize);
return recv_createFile();
}

public void send_createFile(PathName path, short mode, bool overwrite, int bufferSize, short block_replication, long blocksize)
{
oprot_.WriteMessageBegin(new TMessage("createFile", TMessageType.Call, seqid_));
createFile_args args = new createFile_args();
args.Path = path;
args.Mode = mode;
args.Overwrite = overwrite;
args.BufferSize = bufferSize;
args.Block_replication = block_replication;
args.Blocksize = blocksize;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public ThriftHandle recv_createFile()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
createFile_result result = new createFile_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "createFile failed: unknown result");
}

public ThriftHandle open(PathName path)
{
send_open(path);
return recv_open();
}

public void send_open(PathName path)
{
oprot_.WriteMessageBegin(new TMessage("open", TMessageType.Call, seqid_));
open_args args = new open_args();
args.Path = path;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public ThriftHandle recv_open()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
open_result result = new open_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "open failed: unknown result");
}

public ThriftHandle append(PathName path)
{
send_append(path);
return recv_append();
}

public void send_append(PathName path)
{
oprot_.WriteMessageBegin(new TMessage("append", TMessageType.Call, seqid_));
append_args args = new append_args();
args.Path = path;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public ThriftHandle recv_append()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
append_result result = new append_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "append failed: unknown result");
}

public bool write(ThriftHandle handle, string data)
{
send_write(handle, data);
return recv_write();
}

public void send_write(ThriftHandle handle, string data)
{
oprot_.WriteMessageBegin(new TMessage("write", TMessageType.Call, seqid_));
write_args args = new write_args();
args.Handle = handle;
args.Data = data;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public bool recv_write()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
write_result result = new write_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "write failed: unknown result");
}

public string read(ThriftHandle handle, long offset, int size)
{
send_read(handle, offset, size);
return recv_read();
}

public void send_read(ThriftHandle handle, long offset, int size)
{
oprot_.WriteMessageBegin(new TMessage("read", TMessageType.Call, seqid_));
read_args args = new read_args();
args.Handle = handle;
args.Offset = offset;
args.Size = size;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public string recv_read()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
read_result result = new read_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "read failed: unknown result");
}

public bool close(ThriftHandle outThrift)
{
send_close(outThrift);
return recv_close();
}

public void send_close(ThriftHandle outThrift)
{
oprot_.WriteMessageBegin(new TMessage("close", TMessageType.Call, seqid_));
close_args args = new close_args();
args.OutThrift = outThrift;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public bool recv_close()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
close_result result = new close_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "close failed: unknown result");
}

public bool rm(PathName path, bool recursive)
{
send_rm(path, recursive);
return recv_rm();
}

public void send_rm(PathName path, bool recursive)
{
oprot_.WriteMessageBegin(new TMessage("rm", TMessageType.Call, seqid_));
rm_args args = new rm_args();
args.Path = path;
args.Recursive = recursive;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public bool recv_rm()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
rm_result result = new rm_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "rm failed: unknown result");
}

public bool rename(PathName path, PathName dest)
{
send_rename(path, dest);
return recv_rename();
}

public void send_rename(PathName path, PathName dest)
{
oprot_.WriteMessageBegin(new TMessage("rename", TMessageType.Call, seqid_));
rename_args args = new rename_args();
args.Path = path;
args.Dest = dest;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public bool recv_rename()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
rename_result result = new rename_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "rename failed: unknown result");
}

public bool mkdirs(PathName path)
{
send_mkdirs(path);
return recv_mkdirs();
}

public void send_mkdirs(PathName path)
{
oprot_.WriteMessageBegin(new TMessage("mkdirs", TMessageType.Call, seqid_));
mkdirs_args args = new mkdirs_args();
args.Path = path;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public bool recv_mkdirs()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
mkdirs_result result = new mkdirs_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "mkdirs failed: unknown result");
}

public bool exists(PathName path)
{
send_exists(path);
return recv_exists();
}

public void send_exists(PathName path)
{
oprot_.WriteMessageBegin(new TMessage("exists", TMessageType.Call, seqid_));
exists_args args = new exists_args();
args.Path = path;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public bool recv_exists()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
exists_result result = new exists_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "exists failed: unknown result");
}

public FileStatus stat(PathName path)
{
send_stat(path);
return recv_stat();
}

public void send_stat(PathName path)
{
oprot_.WriteMessageBegin(new TMessage("stat", TMessageType.Call, seqid_));
stat_args args = new stat_args();
args.Path = path;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public FileStatus recv_stat()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
stat_result result = new stat_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "stat failed: unknown result");
}

public List<FileStatus> listStatus(PathName path)
{
send_listStatus(path);
return recv_listStatus();
}

public void send_listStatus(PathName path)
{
oprot_.WriteMessageBegin(new TMessage("listStatus", TMessageType.Call, seqid_));
listStatus_args args = new listStatus_args();
args.Path = path;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public List<FileStatus> recv_listStatus()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
listStatus_result result = new listStatus_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "listStatus failed: unknown result");
}

public void chmod(PathName path, short mode)
{
send_chmod(path, mode);
recv_chmod();
}

public void send_chmod(PathName path, short mode)
{
oprot_.WriteMessageBegin(new TMessage("chmod", TMessageType.Call, seqid_));
chmod_args args = new chmod_args();
args.Path = path;
args.Mode = mode;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public void recv_chmod()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
chmod_result result = new chmod_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.ouch) {
throw result.Ouch;
}
return;
}

public void chown(PathName path, string owner, string group)
{
send_chown(path, owner, group);
recv_chown();
}

public void send_chown(PathName path, string owner, string group)
{
oprot_.WriteMessageBegin(new TMessage("chown", TMessageType.Call, seqid_));
chown_args args = new chown_args();
args.Path = path;
args.Owner = owner;
args.Group = group;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public void recv_chown()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
chown_result result = new chown_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.ouch) {
throw result.Ouch;
}
return;
}

public void setReplication(PathName path, short replication)
{
send_setReplication(path, replication);
recv_setReplication();
}

public void send_setReplication(PathName path, short replication)
{
oprot_.WriteMessageBegin(new TMessage("setReplication", TMessageType.Call, seqid_));
setReplication_args args = new setReplication_args();
args.Path = path;
args.Replication = replication;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public void recv_setReplication()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
setReplication_result result = new setReplication_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.ouch) {
throw result.Ouch;
}
return;
}

public List<BlockLocation> getFileBlockLocations(PathName path, long start, long length)
{
send_getFileBlockLocations(path, start, length);
return recv_getFileBlockLocations();
}

public void send_getFileBlockLocations(PathName path, long start, long length)
{
oprot_.WriteMessageBegin(new TMessage("getFileBlockLocations", TMessageType.Call, seqid_));
getFileBlockLocations_args args = new getFileBlockLocations_args();
args.Path = path;
args.Start = start;
args.Length = length;
args.Write(oprot_);
oprot_.WriteMessageEnd();
oprot_.Transport.Flush();
}

public List<BlockLocation> recv_getFileBlockLocations()
{
TMessage msg = iprot_.ReadMessageBegin();
if (msg.Type == TMessageType.Exception) {
TApplicationException x = TApplicationException.Read(iprot_);
iprot_.ReadMessageEnd();
throw x;
}
getFileBlockLocations_result result = new getFileBlockLocations_result();
result.Read(iprot_);
iprot_.ReadMessageEnd();
if (result.__isset.success) {
return result.Success;
}
if (result.__isset.ouch) {
throw result.Ouch;
}
throw new TApplicationException(TApplicationException.ExceptionType.MissingResult, "getFileBlockLocations failed: unknown result");
}

}
public class Processor : TProcessor {
public Processor(Iface iface)
{
iface_ = iface;
processMap_["setInactivityTimeoutPeriod"] = setInactivityTimeoutPeriod_Process;
processMap_["shutdown"] = shutdown_Process;
processMap_["create"] = create_Process;
processMap_["createFile"] = createFile_Process;
processMap_["open"] = open_Process;
processMap_["append"] = append_Process;
processMap_["write"] = write_Process;
processMap_["read"] = read_Process;
processMap_["close"] = close_Process;
processMap_["rm"] = rm_Process;
processMap_["rename"] = rename_Process;
processMap_["mkdirs"] = mkdirs_Process;
processMap_["exists"] = exists_Process;
processMap_["stat"] = stat_Process;
processMap_["listStatus"] = listStatus_Process;
processMap_["chmod"] = chmod_Process;
processMap_["chown"] = chown_Process;
processMap_["setReplication"] = setReplication_Process;
processMap_["getFileBlockLocations"] = getFileBlockLocations_Process;
}

protected delegate void ProcessFunction(int seqid, TProtocol iprot, TProtocol oprot);
private Iface iface_;
protected Dictionary<string, ProcessFunction> processMap_ = new Dictionary<string, ProcessFunction>();

public bool Process(TProtocol iprot, TProtocol oprot)
{
try
{
TMessage msg = iprot.ReadMessageBegin();
ProcessFunction fn;
processMap_.TryGetValue(msg.Name, out fn);
if (fn == null) {
TProtocolUtil.Skip(iprot, TType.Struct);
iprot.ReadMessageEnd();
TApplicationException x = new TApplicationException (TApplicationException.ExceptionType.UnknownMethod, "Invalid method name: '" + msg.Name + "'");
oprot.WriteMessageBegin(new TMessage(msg.Name, TMessageType.Exception, msg.SeqID));
x.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
return true;
}
fn(msg.SeqID, iprot, oprot);
}
catch (IOException)
{
return false;
}
return true;
}

public void setInactivityTimeoutPeriod_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
setInactivityTimeoutPeriod_args args = new setInactivityTimeoutPeriod_args();
args.Read(iprot);
iprot.ReadMessageEnd();
setInactivityTimeoutPeriod_result result = new setInactivityTimeoutPeriod_result();
iface_.setInactivityTimeoutPeriod(args.PeriodInSeconds);
oprot.WriteMessageBegin(new TMessage("setInactivityTimeoutPeriod", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void shutdown_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
shutdown_args args = new shutdown_args();
args.Read(iprot);
iprot.ReadMessageEnd();
shutdown_result result = new shutdown_result();
iface_.shutdown(args.Status);
oprot.WriteMessageBegin(new TMessage("shutdown", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void create_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
create_args args = new create_args();
args.Read(iprot);
iprot.ReadMessageEnd();
create_result result = new create_result();
try {
result.Success = iface_.create(args.Path);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("create", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void createFile_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
createFile_args args = new createFile_args();
args.Read(iprot);
iprot.ReadMessageEnd();
createFile_result result = new createFile_result();
try {
result.Success = iface_.createFile(args.Path, args.Mode, args.Overwrite, args.BufferSize, args.Block_replication, args.Blocksize);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("createFile", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void open_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
open_args args = new open_args();
args.Read(iprot);
iprot.ReadMessageEnd();
open_result result = new open_result();
try {
result.Success = iface_.open(args.Path);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("open", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void append_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
append_args args = new append_args();
args.Read(iprot);
iprot.ReadMessageEnd();
append_result result = new append_result();
try {
result.Success = iface_.append(args.Path);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("append", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void write_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
write_args args = new write_args();
args.Read(iprot);
iprot.ReadMessageEnd();
write_result result = new write_result();
try {
result.Success = iface_.write(args.Handle, args.Data);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("write", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void read_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
read_args args = new read_args();
args.Read(iprot);
iprot.ReadMessageEnd();
read_result result = new read_result();
try {
result.Success = iface_.read(args.Handle, args.Offset, args.Size);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("read", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void close_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
close_args args = new close_args();
args.Read(iprot);
iprot.ReadMessageEnd();
close_result result = new close_result();
try {
result.Success = iface_.close(args.OutThrift);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("close", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void rm_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
rm_args args = new rm_args();
args.Read(iprot);
iprot.ReadMessageEnd();
rm_result result = new rm_result();
try {
result.Success = iface_.rm(args.Path, args.Recursive);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("rm", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void rename_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
rename_args args = new rename_args();
args.Read(iprot);
iprot.ReadMessageEnd();
rename_result result = new rename_result();
try {
result.Success = iface_.rename(args.Path, args.Dest);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("rename", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void mkdirs_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
mkdirs_args args = new mkdirs_args();
args.Read(iprot);
iprot.ReadMessageEnd();
mkdirs_result result = new mkdirs_result();
try {
result.Success = iface_.mkdirs(args.Path);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("mkdirs", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void exists_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
exists_args args = new exists_args();
args.Read(iprot);
iprot.ReadMessageEnd();
exists_result result = new exists_result();
try {
result.Success = iface_.exists(args.Path);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("exists", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void stat_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
stat_args args = new stat_args();
args.Read(iprot);
iprot.ReadMessageEnd();
stat_result result = new stat_result();
try {
result.Success = iface_.stat(args.Path);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("stat", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void listStatus_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
listStatus_args args = new listStatus_args();
args.Read(iprot);
iprot.ReadMessageEnd();
listStatus_result result = new listStatus_result();
try {
result.Success = iface_.listStatus(args.Path);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("listStatus", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void chmod_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
chmod_args args = new chmod_args();
args.Read(iprot);
iprot.ReadMessageEnd();
chmod_result result = new chmod_result();
try {
iface_.chmod(args.Path, args.Mode);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("chmod", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void chown_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
chown_args args = new chown_args();
args.Read(iprot);
iprot.ReadMessageEnd();
chown_result result = new chown_result();
try {
iface_.chown(args.Path, args.Owner, args.Group);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("chown", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void setReplication_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
setReplication_args args = new setReplication_args();
args.Read(iprot);
iprot.ReadMessageEnd();
setReplication_result result = new setReplication_result();
try {
iface_.setReplication(args.Path, args.Replication);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("setReplication", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

public void getFileBlockLocations_Process(int seqid, TProtocol iprot, TProtocol oprot)
{
getFileBlockLocations_args args = new getFileBlockLocations_args();
args.Read(iprot);
iprot.ReadMessageEnd();
getFileBlockLocations_result result = new getFileBlockLocations_result();
try {
result.Success = iface_.getFileBlockLocations(args.Path, args.Start, args.Length);
} catch (ThriftIOException ouch) {
result.Ouch = ouch;
}
oprot.WriteMessageBegin(new TMessage("getFileBlockLocations", TMessageType.Reply, seqid));
result.Write(oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}

}


[Serializable]
public partial class setInactivityTimeoutPeriod_args : TBase
{
private long _periodInSeconds;

public long PeriodInSeconds
{
get
{
return _periodInSeconds;
}
set
{
__isset.periodInSeconds = true;
this._periodInSeconds = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool periodInSeconds;
}

public setInactivityTimeoutPeriod_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.I64) {
PeriodInSeconds = iprot.ReadI64();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("setInactivityTimeoutPeriod_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (__isset.periodInSeconds) {
field.Name = "periodInSeconds";
field.Type = TType.I64;
field.ID = 1;
oprot.WriteFieldBegin(field);
oprot.WriteI64(PeriodInSeconds);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("setInactivityTimeoutPeriod_args(");
sb.Append("PeriodInSeconds: ");
sb.Append(PeriodInSeconds);
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class setInactivityTimeoutPeriod_result : TBase
{

public setInactivityTimeoutPeriod_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("setInactivityTimeoutPeriod_result");
oprot.WriteStructBegin(struc);

oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("setInactivityTimeoutPeriod_result(");
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class shutdown_args : TBase
{
private int _status;

public int Status
{
get
{
return _status;
}
set
{
__isset.status = true;
this._status = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool status;
}

public shutdown_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.I32) {
Status = iprot.ReadI32();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("shutdown_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (__isset.status) {
field.Name = "status";
field.Type = TType.I32;
field.ID = 1;
oprot.WriteFieldBegin(field);
oprot.WriteI32(Status);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("shutdown_args(");
sb.Append("Status: ");
sb.Append(Status);
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class shutdown_result : TBase
{

public shutdown_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("shutdown_result");
oprot.WriteStructBegin(struc);

oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("shutdown_result(");
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class create_args : TBase
{
private PathName _path;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
}

public create_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("create_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("create_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class create_result : TBase
{
private ThriftHandle _success;
private ThriftIOException _ouch;

public ThriftHandle Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public create_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.Struct) {
Success = new ThriftHandle();
Success.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("create_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
if (Success != null) {
field.Name = "Success";
field.Type = TType.Struct;
field.ID = 0;
oprot.WriteFieldBegin(field);
Success.Write(oprot);
oprot.WriteFieldEnd();
}
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("create_result(");
sb.Append("Success: ");
sb.Append(Success== null ? "<null>" : Success.ToString());
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class createFile_args : TBase
{
private PathName _path;
private short _mode;
private bool _overwrite;
private int _bufferSize;
private short _block_replication;
private long _blocksize;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}

public short Mode
{
get
{
return _mode;
}
set
{
__isset.mode = true;
this._mode = value;
}
}

public bool Overwrite
{
get
{
return _overwrite;
}
set
{
__isset.overwrite = true;
this._overwrite = value;
}
}

public int BufferSize
{
get
{
return _bufferSize;
}
set
{
__isset.bufferSize = true;
this._bufferSize = value;
}
}

public short Block_replication
{
get
{
return _block_replication;
}
set
{
__isset.block_replication = true;
this._block_replication = value;
}
}

public long Blocksize
{
get
{
return _blocksize;
}
set
{
__isset.blocksize = true;
this._blocksize = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
public bool mode;
public bool overwrite;
public bool bufferSize;
public bool block_replication;
public bool blocksize;
}

public createFile_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.I16) {
Mode = iprot.ReadI16();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 3:
if (field.Type == TType.Bool) {
Overwrite = iprot.ReadBool();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 4:
if (field.Type == TType.I32) {
BufferSize = iprot.ReadI32();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 5:
if (field.Type == TType.I16) {
Block_replication = iprot.ReadI16();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 6:
if (field.Type == TType.I64) {
Blocksize = iprot.ReadI64();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("createFile_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
if (__isset.mode) {
field.Name = "mode";
field.Type = TType.I16;
field.ID = 2;
oprot.WriteFieldBegin(field);
oprot.WriteI16(Mode);
oprot.WriteFieldEnd();
}
if (__isset.overwrite) {
field.Name = "overwrite";
field.Type = TType.Bool;
field.ID = 3;
oprot.WriteFieldBegin(field);
oprot.WriteBool(Overwrite);
oprot.WriteFieldEnd();
}
if (__isset.bufferSize) {
field.Name = "bufferSize";
field.Type = TType.I32;
field.ID = 4;
oprot.WriteFieldBegin(field);
oprot.WriteI32(BufferSize);
oprot.WriteFieldEnd();
}
if (__isset.block_replication) {
field.Name = "block_replication";
field.Type = TType.I16;
field.ID = 5;
oprot.WriteFieldBegin(field);
oprot.WriteI16(Block_replication);
oprot.WriteFieldEnd();
}
if (__isset.blocksize) {
field.Name = "blocksize";
field.Type = TType.I64;
field.ID = 6;
oprot.WriteFieldBegin(field);
oprot.WriteI64(Blocksize);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("createFile_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(",Mode: ");
sb.Append(Mode);
sb.Append(",Overwrite: ");
sb.Append(Overwrite);
sb.Append(",BufferSize: ");
sb.Append(BufferSize);
sb.Append(",Block_replication: ");
sb.Append(Block_replication);
sb.Append(",Blocksize: ");
sb.Append(Blocksize);
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class createFile_result : TBase
{
private ThriftHandle _success;
private ThriftIOException _ouch;

public ThriftHandle Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public createFile_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.Struct) {
Success = new ThriftHandle();
Success.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("createFile_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
if (Success != null) {
field.Name = "Success";
field.Type = TType.Struct;
field.ID = 0;
oprot.WriteFieldBegin(field);
Success.Write(oprot);
oprot.WriteFieldEnd();
}
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("createFile_result(");
sb.Append("Success: ");
sb.Append(Success== null ? "<null>" : Success.ToString());
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class open_args : TBase
{
private PathName _path;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
}

public open_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("open_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("open_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class open_result : TBase
{
private ThriftHandle _success;
private ThriftIOException _ouch;

public ThriftHandle Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public open_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.Struct) {
Success = new ThriftHandle();
Success.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("open_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
if (Success != null) {
field.Name = "Success";
field.Type = TType.Struct;
field.ID = 0;
oprot.WriteFieldBegin(field);
Success.Write(oprot);
oprot.WriteFieldEnd();
}
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("open_result(");
sb.Append("Success: ");
sb.Append(Success== null ? "<null>" : Success.ToString());
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class append_args : TBase
{
private PathName _path;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
}

public append_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("append_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("append_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class append_result : TBase
{
private ThriftHandle _success;
private ThriftIOException _ouch;

public ThriftHandle Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public append_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.Struct) {
Success = new ThriftHandle();
Success.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("append_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
if (Success != null) {
field.Name = "Success";
field.Type = TType.Struct;
field.ID = 0;
oprot.WriteFieldBegin(field);
Success.Write(oprot);
oprot.WriteFieldEnd();
}
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("append_result(");
sb.Append("Success: ");
sb.Append(Success== null ? "<null>" : Success.ToString());
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class write_args : TBase
{
private ThriftHandle _handle;
private string _data;

public ThriftHandle Handle
{
get
{
return _handle;
}
set
{
__isset.handle = true;
this._handle = value;
}
}

public string Data
{
get
{
return _data;
}
set
{
__isset.data = true;
this._data = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool handle;
public bool data;
}

public write_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Handle = new ThriftHandle();
Handle.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case -1:
if (field.Type == TType.String) {
Data = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("write_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Data != null && __isset.data) {
field.Name = "data";
field.Type = TType.String;
field.ID = -1;
oprot.WriteFieldBegin(field);
oprot.WriteString(Data);
oprot.WriteFieldEnd();
}
if (Handle != null && __isset.handle) {
field.Name = "handle";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Handle.Write(oprot);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("write_args(");
sb.Append("Handle: ");
sb.Append(Handle== null ? "<null>" : Handle.ToString());
sb.Append(",Data: ");
sb.Append(Data);
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class write_result : TBase
{
private bool _success;
private ThriftIOException _ouch;

public bool Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public write_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.Bool) {
Success = iprot.ReadBool();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("write_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
field.Name = "Success";
field.Type = TType.Bool;
field.ID = 0;
oprot.WriteFieldBegin(field);
oprot.WriteBool(Success);
oprot.WriteFieldEnd();
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("write_result(");
sb.Append("Success: ");
sb.Append(Success);
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class read_args : TBase
{
private ThriftHandle _handle;
private long _offset;
private int _size;

public ThriftHandle Handle
{
get
{
return _handle;
}
set
{
__isset.handle = true;
this._handle = value;
}
}

public long Offset
{
get
{
return _offset;
}
set
{
__isset.offset = true;
this._offset = value;
}
}

public int Size
{
get
{
return _size;
}
set
{
__isset.size = true;
this._size = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool handle;
public bool offset;
public bool size;
}

public read_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Handle = new ThriftHandle();
Handle.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case -1:
if (field.Type == TType.I64) {
Offset = iprot.ReadI64();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case -2:
if (field.Type == TType.I32) {
Size = iprot.ReadI32();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("read_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (__isset.size) {
field.Name = "size";
field.Type = TType.I32;
field.ID = -2;
oprot.WriteFieldBegin(field);
oprot.WriteI32(Size);
oprot.WriteFieldEnd();
}
if (__isset.offset) {
field.Name = "offset";
field.Type = TType.I64;
field.ID = -1;
oprot.WriteFieldBegin(field);
oprot.WriteI64(Offset);
oprot.WriteFieldEnd();
}
if (Handle != null && __isset.handle) {
field.Name = "handle";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Handle.Write(oprot);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("read_args(");
sb.Append("Handle: ");
sb.Append(Handle== null ? "<null>" : Handle.ToString());
sb.Append(",Offset: ");
sb.Append(Offset);
sb.Append(",Size: ");
sb.Append(Size);
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class read_result : TBase
{
private string _success;
private ThriftIOException _ouch;

public string Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public read_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.String) {
Success = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("read_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
if (Success != null) {
field.Name = "Success";
field.Type = TType.String;
field.ID = 0;
oprot.WriteFieldBegin(field);
oprot.WriteString(Success);
oprot.WriteFieldEnd();
}
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("read_result(");
sb.Append("Success: ");
sb.Append(Success);
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class close_args : TBase
{
private ThriftHandle _outThrift;

public ThriftHandle OutThrift
{
get
{
return _outThrift;
}
set
{
__isset.outThrift = true;
this._outThrift = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool outThrift;
}

public close_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
OutThrift = new ThriftHandle();
OutThrift.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("close_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (OutThrift != null && __isset.outThrift) {
field.Name = "outThrift";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
OutThrift.Write(oprot);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("close_args(");
sb.Append("OutThrift: ");
sb.Append(OutThrift== null ? "<null>" : OutThrift.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class close_result : TBase
{
private bool _success;
private ThriftIOException _ouch;

public bool Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public close_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.Bool) {
Success = iprot.ReadBool();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("close_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
field.Name = "Success";
field.Type = TType.Bool;
field.ID = 0;
oprot.WriteFieldBegin(field);
oprot.WriteBool(Success);
oprot.WriteFieldEnd();
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("close_result(");
sb.Append("Success: ");
sb.Append(Success);
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class rm_args : TBase
{
private PathName _path;
private bool _recursive;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}

public bool Recursive
{
get
{
return _recursive;
}
set
{
__isset.recursive = true;
this._recursive = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
public bool recursive;
}

public rm_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.Bool) {
Recursive = iprot.ReadBool();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("rm_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
if (__isset.recursive) {
field.Name = "recursive";
field.Type = TType.Bool;
field.ID = 2;
oprot.WriteFieldBegin(field);
oprot.WriteBool(Recursive);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("rm_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(",Recursive: ");
sb.Append(Recursive);
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class rm_result : TBase
{
private bool _success;
private ThriftIOException _ouch;

public bool Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public rm_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.Bool) {
Success = iprot.ReadBool();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("rm_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
field.Name = "Success";
field.Type = TType.Bool;
field.ID = 0;
oprot.WriteFieldBegin(field);
oprot.WriteBool(Success);
oprot.WriteFieldEnd();
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("rm_result(");
sb.Append("Success: ");
sb.Append(Success);
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class rename_args : TBase
{
private PathName _path;
private PathName _dest;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}

public PathName Dest
{
get
{
return _dest;
}
set
{
__isset.dest = true;
this._dest = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
public bool dest;
}

public rename_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.Struct) {
Dest = new PathName();
Dest.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("rename_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
if (Dest != null && __isset.dest) {
field.Name = "dest";
field.Type = TType.Struct;
field.ID = 2;
oprot.WriteFieldBegin(field);
Dest.Write(oprot);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("rename_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(",Dest: ");
sb.Append(Dest== null ? "<null>" : Dest.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class rename_result : TBase
{
private bool _success;
private ThriftIOException _ouch;

public bool Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public rename_result() {
}
//由于代码量比较大拆分见下面回帖
}[/mw_shl_code]
回复

使用道具 举报

desehawk 发表于 2015-5-10 12:06:22


接上面
[mw_shl_code=csharp,true]
public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.Bool) {
Success = iprot.ReadBool();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("rename_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
field.Name = "Success";
field.Type = TType.Bool;
field.ID = 0;
oprot.WriteFieldBegin(field);
oprot.WriteBool(Success);
oprot.WriteFieldEnd();
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("rename_result(");
sb.Append("Success: ");
sb.Append(Success);
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class mkdirs_args : TBase
{
private PathName _path;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
}

public mkdirs_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("mkdirs_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("mkdirs_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class mkdirs_result : TBase
{
private bool _success;
private ThriftIOException _ouch;

public bool Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public mkdirs_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.Bool) {
Success = iprot.ReadBool();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("mkdirs_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
field.Name = "Success";
field.Type = TType.Bool;
field.ID = 0;
oprot.WriteFieldBegin(field);
oprot.WriteBool(Success);
oprot.WriteFieldEnd();
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("mkdirs_result(");
sb.Append("Success: ");
sb.Append(Success);
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class exists_args : TBase
{
private PathName _path;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
}

public exists_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("exists_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("exists_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class exists_result : TBase
{
private bool _success;
private ThriftIOException _ouch;

public bool Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public exists_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.Bool) {
Success = iprot.ReadBool();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("exists_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
field.Name = "Success";
field.Type = TType.Bool;
field.ID = 0;
oprot.WriteFieldBegin(field);
oprot.WriteBool(Success);
oprot.WriteFieldEnd();
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("exists_result(");
sb.Append("Success: ");
sb.Append(Success);
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class stat_args : TBase
{
private PathName _path;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
}

public stat_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("stat_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("stat_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class stat_result : TBase
{
private FileStatus _success;
private ThriftIOException _ouch;

public FileStatus Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public stat_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.Struct) {
Success = new FileStatus();
Success.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("stat_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
if (Success != null) {
field.Name = "Success";
field.Type = TType.Struct;
field.ID = 0;
oprot.WriteFieldBegin(field);
Success.Write(oprot);
oprot.WriteFieldEnd();
}
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("stat_result(");
sb.Append("Success: ");
sb.Append(Success== null ? "<null>" : Success.ToString());
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class listStatus_args : TBase
{
private PathName _path;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
}

public listStatus_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("listStatus_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("listStatus_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class listStatus_result : TBase
{
private List<FileStatus> _success;
private ThriftIOException _ouch;

public List<FileStatus> Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public listStatus_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.List) {
{
Success = new List<FileStatus>();
TList _list8 = iprot.ReadListBegin();
for( int _i9 = 0; _i9 < _list8.Count; ++_i9)
{
FileStatus _elem10 = new FileStatus();
_elem10 = new FileStatus();
_elem10.Read(iprot);
Success.Add(_elem10);
}
iprot.ReadListEnd();
}
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("listStatus_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
if (Success != null) {
field.Name = "Success";
field.Type = TType.List;
field.ID = 0;
oprot.WriteFieldBegin(field);
{
oprot.WriteListBegin(new TList(TType.Struct, Success.Count));
foreach (FileStatus _iter11 in Success)
{
_iter11.Write(oprot);
}
oprot.WriteListEnd();
}
oprot.WriteFieldEnd();
}
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("listStatus_result(");
sb.Append("Success: ");
sb.Append(Success);
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class chmod_args : TBase
{
private PathName _path;
private short _mode;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}

public short Mode
{
get
{
return _mode;
}
set
{
__isset.mode = true;
this._mode = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
public bool mode;
}

public chmod_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.I16) {
Mode = iprot.ReadI16();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("chmod_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
if (__isset.mode) {
field.Name = "mode";
field.Type = TType.I16;
field.ID = 2;
oprot.WriteFieldBegin(field);
oprot.WriteI16(Mode);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("chmod_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(",Mode: ");
sb.Append(Mode);
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class chmod_result : TBase
{
private ThriftIOException _ouch;

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool ouch;
}

public chmod_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("chmod_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("chmod_result(");
sb.Append("Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class chown_args : TBase
{
private PathName _path;
private string _owner;
private string _group;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}

public string Owner
{
get
{
return _owner;
}
set
{
__isset.owner = true;
this._owner = value;
}
}

public string Group
{
get
{
return _group;
}
set
{
__isset.group = true;
this._group = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
public bool owner;
public bool group;
}

public chown_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.String) {
Owner = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 3:
if (field.Type == TType.String) {
Group = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("chown_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
if (Owner != null && __isset.owner) {
field.Name = "owner";
field.Type = TType.String;
field.ID = 2;
oprot.WriteFieldBegin(field);
oprot.WriteString(Owner);
oprot.WriteFieldEnd();
}
if (Group != null && __isset.group) {
field.Name = "group";
field.Type = TType.String;
field.ID = 3;
oprot.WriteFieldBegin(field);
oprot.WriteString(Group);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("chown_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(",Owner: ");
sb.Append(Owner);
sb.Append(",Group: ");
sb.Append(Group);
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class chown_result : TBase
{
private ThriftIOException _ouch;

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool ouch;
}

public chown_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("chown_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("chown_result(");
sb.Append("Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class setReplication_args : TBase
{
private PathName _path;
private short _replication;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}

public short Replication
{
get
{
return _replication;
}
set
{
__isset.replication = true;
this._replication = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
public bool replication;
}

public setReplication_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.I16) {
Replication = iprot.ReadI16();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("setReplication_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
if (__isset.replication) {
field.Name = "replication";
field.Type = TType.I16;
field.ID = 2;
oprot.WriteFieldBegin(field);
oprot.WriteI16(Replication);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("setReplication_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(",Replication: ");
sb.Append(Replication);
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class setReplication_result : TBase
{
private ThriftIOException _ouch;

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool ouch;
}

public setReplication_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("setReplication_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("setReplication_result(");
sb.Append("Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class getFileBlockLocations_args : TBase
{
private PathName _path;
private long _start;
private long _length;

public PathName Path
{
get
{
return _path;
}
set
{
__isset.path = true;
this._path = value;
}
}

public long Start
{
get
{
return _start;
}
set
{
__isset.start = true;
this._start = value;
}
}

public long Length
{
get
{
return _length;
}
set
{
__isset.length = true;
this._length = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool path;
public bool start;
public bool length;
}

public getFileBlockLocations_args() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Struct) {
Path = new PathName();
Path.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.I64) {
Start = iprot.ReadI64();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 3:
if (field.Type == TType.I64) {
Length = iprot.ReadI64();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("getFileBlockLocations_args");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Path != null && __isset.path) {
field.Name = "path";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Path.Write(oprot);
oprot.WriteFieldEnd();
}
if (__isset.start) {
field.Name = "start";
field.Type = TType.I64;
field.ID = 2;
oprot.WriteFieldBegin(field);
oprot.WriteI64(Start);
oprot.WriteFieldEnd();
}
if (__isset.length) {
field.Name = "length";
field.Type = TType.I64;
field.ID = 3;
oprot.WriteFieldBegin(field);
oprot.WriteI64(Length);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("getFileBlockLocations_args(");
sb.Append("Path: ");
sb.Append(Path== null ? "<null>" : Path.ToString());
sb.Append(",Start: ");
sb.Append(Start);
sb.Append(",Length: ");
sb.Append(Length);
sb.Append(")");
return sb.ToString();
}

}


[Serializable]
public partial class getFileBlockLocations_result : TBase
{
private List<BlockLocation> _success;
private ThriftIOException _ouch;

public List<BlockLocation> Success
{
get
{
return _success;
}
set
{
__isset.success = true;
this._success = value;
}
}

public ThriftIOException Ouch
{
get
{
return _ouch;
}
set
{
__isset.ouch = true;
this._ouch = value;
}
}


public Isset __isset;
[Serializable]
public struct Isset {
public bool success;
public bool ouch;
}

public getFileBlockLocations_result() {
}

public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 0:
if (field.Type == TType.List) {
{
Success = new List<BlockLocation>();
TList _list12 = iprot.ReadListBegin();
for( int _i13 = 0; _i13 < _list12.Count; ++_i13)
{
BlockLocation _elem14 = new BlockLocation();
_elem14 = new BlockLocation();
_elem14.Read(iprot);
Success.Add(_elem14);
}
iprot.ReadListEnd();
}
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 1:
if (field.Type == TType.Struct) {
Ouch = new ThriftIOException();
Ouch.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}

public void Write(TProtocol oprot) {
TStruct struc = new TStruct("getFileBlockLocations_result");
oprot.WriteStructBegin(struc);
TField field = new TField();

if (this.__isset.success) {
if (Success != null) {
field.Name = "Success";
field.Type = TType.List;
field.ID = 0;
oprot.WriteFieldBegin(field);
{
oprot.WriteListBegin(new TList(TType.Struct, Success.Count));
foreach (BlockLocation _iter15 in Success)
{
_iter15.Write(oprot);
}
oprot.WriteListEnd();
}
oprot.WriteFieldEnd();
}
} else if (this.__isset.ouch) {
if (Ouch != null) {
field.Name = "Ouch";
field.Type = TType.Struct;
field.ID = 1;
oprot.WriteFieldBegin(field);
Ouch.Write(oprot);
oprot.WriteFieldEnd();
}
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}

public override string ToString() {
StringBuilder sb = new StringBuilder("getFileBlockLocations_result(");
sb.Append("Success: ");
sb.Append(Success);
sb.Append(",Ouch: ");
sb.Append(Ouch== null ? "<null>" : Ouch.ToString());
sb.Append(")");
return sb.ToString();
}

}

}[/mw_shl_code]
回复

使用道具 举报

shzhanghuan 发表于 2015-5-10 12:37:23
感谢分享,多多向前辈学习!!
回复

使用道具 举报

shzhanghuan 发表于 2015-5-10 12:38:46
感谢分享,多多向前辈学习!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

推荐上一条 /2 下一条