本文整理汇总了C#中FluentCassandra.Thrift.Protocol.TProtocol类的典型用法代码示例。如果您正苦于以下问题:C# TProtocol类的具体用法?C# TProtocol怎么用?C# TProtocol使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TProtocol类属于FluentCassandra.Thrift.Protocol命名空间,在下文中一共展示了TProtocol类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Read
public void Read (TProtocol iprot)
{
bool isset_why = false;
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.String) {
Why = iprot.ReadString();
isset_why = true;
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
if (!isset_why)
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
示例2: Read
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) {
Acknowledged_by = iprot.ReadI32();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.Bool) {
Acknowledged_by_batchlog = iprot.ReadBool();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
示例3: Read
public void Read (TProtocol iprot)
{
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 3:
if (field.Type == TType.String) {
Column_family = iprot.ReadString();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 4:
if (field.Type == TType.String) {
Super_column = iprot.ReadBinary();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
示例4: Read
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.String) {
Key = iprot.ReadBinary();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.I32) {
Count = iprot.ReadI32();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
示例5: Fail
private void Fail( TProtocol oprot, TMessage message, TApplicationException.ExceptionType extype, string etxt)
{
TApplicationException appex = new TApplicationException( extype, etxt);
TMessage newMessage = new TMessage(message.Name, TMessageType.Exception, message.SeqID);
oprot.WriteMessageBegin(newMessage);
appex.Write( oprot);
oprot.WriteMessageEnd();
oprot.Transport.Flush();
}
示例6: Read
public void Read (TProtocol iprot)
{
bool isset_name = false;
bool isset_options = false;
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.String) {
Name = iprot.ReadString();
isset_name = true;
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.Map) {
{
Options = new Dictionary<string, string>();
TMap _map50 = iprot.ReadMapBegin();
for( int _i51 = 0; _i51 < _map50.Count; ++_i51)
{
string _key52;
string _val53;
_key52 = iprot.ReadString();
_val53 = iprot.ReadString();
Options[_key52] = _val53;
}
iprot.ReadMapEnd();
}
isset_options = true;
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
if (!isset_name)
throw new TProtocolException(TProtocolException.INVALID_DATA);
if (!isset_options)
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
示例7: Read
public void Read (TProtocol iprot)
{
bool isset_name = false;
bool isset_columns = false;
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.String) {
Name = iprot.ReadBinary();
isset_name = true;
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.List) {
{
Columns = new List<CounterColumn>();
TList _list4 = iprot.ReadListBegin();
for( int _i5 = 0; _i5 < _list4.Count; ++_i5)
{
CounterColumn _elem6 = new CounterColumn();
_elem6 = new CounterColumn();
_elem6.Read(iprot);
Columns.Add(_elem6);
}
iprot.ReadListEnd();
}
isset_columns = true;
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
if (!isset_name)
throw new TProtocolException(TProtocolException.INVALID_DATA);
if (!isset_columns)
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
示例8: Read
public void Read (TProtocol iprot)
{
bool isset_start_token = false;
bool isset_end_token = false;
bool isset_row_count = false;
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.String) {
Start_token = iprot.ReadString();
isset_start_token = true;
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.String) {
End_token = iprot.ReadString();
isset_end_token = true;
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 3:
if (field.Type == TType.I64) {
Row_count = iprot.ReadI64();
isset_row_count = true;
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
if (!isset_start_token)
throw new TProtocolException(TProtocolException.INVALID_DATA);
if (!isset_end_token)
throw new TProtocolException(TProtocolException.INVALID_DATA);
if (!isset_row_count)
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
示例9: Read
public void Read (TProtocol iprot)
{
bool isset_column_name = false;
bool isset_op = false;
bool isset_value = false;
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.String) {
Column_name = iprot.ReadBinary();
isset_column_name = true;
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.I32) {
Op = (IndexOperator)iprot.ReadI32();
isset_op = true;
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 3:
if (field.Type == TType.String) {
Value = iprot.ReadBinary();
isset_value = true;
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
if (!isset_column_name)
throw new TProtocolException(TProtocolException.INVALID_DATA);
if (!isset_op)
throw new TProtocolException(TProtocolException.INVALID_DATA);
if (!isset_value)
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
示例10: Read
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.List) {
{
Expressions = new List<IndexExpression>();
TList _list12 = iprot.ReadListBegin();
for( int _i13 = 0; _i13 < _list12.Count; ++_i13)
{
IndexExpression _elem14 = new IndexExpression();
_elem14 = new IndexExpression();
_elem14.Read(iprot);
Expressions.Add(_elem14);
}
iprot.ReadListEnd();
}
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.String) {
Start_key = iprot.ReadBinary();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 3:
if (field.Type == TType.I32) {
Count = iprot.ReadI32();
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}
示例11: Write
public void Write(TProtocol oprot) {
TStruct struc = new TStruct("AuthenticationException");
oprot.WriteStructBegin(struc);
TField field = new TField();
field.Name = "why";
field.Type = TType.String;
field.ID = 1;
oprot.WriteFieldBegin(field);
oprot.WriteString(Why);
oprot.WriteFieldEnd();
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
示例12: Read
public static TApplicationException Read(TProtocol iprot)
{
TField field;
string message = null;
ExceptionType type = ExceptionType.Unknown;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop)
{
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.String)
{
message = iprot.ReadString();
}
else
{
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.I32)
{
type = (ExceptionType)iprot.ReadI32();
}
else
{
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
return new TApplicationException(type, message);
}
示例13: Read
public void Read (TProtocol iprot)
{
bool isset_success = false;
TField field;
iprot.ReadStructBegin();
while (true)
{
field = iprot.ReadFieldBegin();
if (field.Type == TType.Stop) {
break;
}
switch (field.ID)
{
case 1:
if (field.Type == TType.Bool) {
Success = iprot.ReadBool();
isset_success = true;
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.List) {
{
Current_values = new List<Column>();
TList _list24 = iprot.ReadListBegin();
for( int _i25 = 0; _i25 < _list24.Count; ++_i25)
{
Column _elem26 = new Column();
_elem26 = new Column();
_elem26.Read(iprot);
Current_values.Add(_elem26);
}
iprot.ReadListEnd();
}
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
if (!isset_success)
throw new TProtocolException(TProtocolException.INVALID_DATA);
}
示例14: Write
public void Write(TProtocol oprot) {
TStruct struc = new TStruct("InvalidRequestException");
oprot.WriteStructBegin(struc);
TField field = new TField();
if (Why != null && __isset.why) {
field.Name = "why";
field.Type = TType.String;
field.ID = 1;
oprot.WriteFieldBegin(field);
oprot.WriteString(Why);
oprot.WriteFieldEnd();
}
oprot.WriteFieldStop();
oprot.WriteStructEnd();
}
示例15: Read
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.List) {
{
Column_names = new List<byte[]>();
TList _list8 = iprot.ReadListBegin();
for( int _i9 = 0; _i9 < _list8.Count; ++_i9)
{
byte[] _elem10 = null;
_elem10 = iprot.ReadBinary();
Column_names.Add(_elem10);
}
iprot.ReadListEnd();
}
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
case 2:
if (field.Type == TType.Struct) {
Slice_range = new SliceRange();
Slice_range.Read(iprot);
} else {
TProtocolUtil.Skip(iprot, field.Type);
}
break;
default:
TProtocolUtil.Skip(iprot, field.Type);
break;
}
iprot.ReadFieldEnd();
}
iprot.ReadStructEnd();
}