diff --git a/aliyun-tablestore-csharp-sdk.sln b/aliyun-tablestore-csharp-sdk.sln index 517b5a7..315cced 100644 --- a/aliyun-tablestore-csharp-sdk.sln +++ b/aliyun-tablestore-csharp-sdk.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.28010.2050 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30611.23 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "aliyun-tablestore-sdk", "sdk\aliyun-tablestore-sdk.csproj", "{AB5EFCA2-53A9-42B5-861E-3FD6F865036B}" EndProject @@ -9,6 +9,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "aliyun-tablestore-sdk-test" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "aliyun-tablestore-sdk-sample", "sample\aliyun-tablestore-sdk-sample.csproj", "{D151C869-BC8F-4465-9460-5103A25D21E9}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "aliyun-tablestore-netstandard-sdk", "netstandard-sdk\aliyun-tablestore-netstandard-sdk.csproj", "{9D75067C-1B14-45BC-94C4-8DB2ED5EEF93}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "aliyun-tablestore-netcore-sdk-sample", "netcore-sample\aliyun-tablestore-netcore-sdk-sample.csproj", "{4E840B62-46EE-49DC-B140-43884CAAF4CF}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -27,6 +31,14 @@ Global {D151C869-BC8F-4465-9460-5103A25D21E9}.Debug|Any CPU.Build.0 = Debug|Any CPU {D151C869-BC8F-4465-9460-5103A25D21E9}.Release|Any CPU.ActiveCfg = Release|Any CPU {D151C869-BC8F-4465-9460-5103A25D21E9}.Release|Any CPU.Build.0 = Release|Any CPU + {9D75067C-1B14-45BC-94C4-8DB2ED5EEF93}.Debug|Any CPU.ActiveCfg = Release|Any CPU + {9D75067C-1B14-45BC-94C4-8DB2ED5EEF93}.Debug|Any CPU.Build.0 = Release|Any CPU + {9D75067C-1B14-45BC-94C4-8DB2ED5EEF93}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9D75067C-1B14-45BC-94C4-8DB2ED5EEF93}.Release|Any CPU.Build.0 = Release|Any CPU + {4E840B62-46EE-49DC-B140-43884CAAF4CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E840B62-46EE-49DC-B140-43884CAAF4CF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E840B62-46EE-49DC-B140-43884CAAF4CF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E840B62-46EE-49DC-B140-43884CAAF4CF}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/netcore-sample/Config.cs b/netcore-sample/Config.cs new file mode 100644 index 0000000..09097ae --- /dev/null +++ b/netcore-sample/Config.cs @@ -0,0 +1,31 @@ +namespace Aliyun.OTS.Samples +{ + internal static class Config + { + public static string AccessKeyId = ""; + + public static string AccessKeySecret = ""; + + public static string Endpoint = ""; + + public static string InstanceName = ""; + + private static OTSClient OtsClient = null; + + public static OTSClient GetClient() + { + if (OtsClient != null) + { + return OtsClient; + } + + OTSClientConfig config = new OTSClientConfig(Endpoint, AccessKeyId, AccessKeySecret, InstanceName) + { + OTSDebugLogHandler = null, + OTSErrorLogHandler = null + }; + OtsClient = new OTSClient(config); + return OtsClient; + } + } +} diff --git a/netcore-sample/Program.cs b/netcore-sample/Program.cs new file mode 100644 index 0000000..e9eff33 --- /dev/null +++ b/netcore-sample/Program.cs @@ -0,0 +1,56 @@ +using System; +namespace Aliyun.OTS.Samples +{ + class Program + { + static void Main(string[] args) + { + Console.WriteLine("Aliyun Table Store SDK for .NET Samples!"); + + try + { + ClientInitialize.InitializeClient(); + + CreateTableSample.TableOperations(); + + SingleRowReadWriteSample.PutRow(); + SingleRowReadWriteSample.PutRowAsync(); + + SingleRowReadWriteSample.UpdateRow(); + + SingleRowReadWriteSample.GetRow(); + SingleRowReadWriteSample.GetRowWithFilter(); + + MultiRowReadWriteSample.BatchWriteRow(); + + MultiRowReadWriteSample.GetRange(); + MultiRowReadWriteSample.GetRangeWithFilter(); + MultiRowReadWriteSample.GetIterator(); + + MultiRowReadWriteSample.BatchGetRow(); + MultiRowReadWriteSample.BatchGetRowWithFilter(); + + ConditionUpdateSample.ConditionPutRow(); + ConditionUpdateSample.ConditionUpdateRow(); + ConditionUpdateSample.ConditionDeleteRow(); + ConditionUpdateSample.ConditionBatchWriteRow(); + } + catch (OTSClientException ex) + { + Console.WriteLine("Failed with client exception:{0}", ex.Message); + } + catch (OTSServerException ex) + { + Console.WriteLine("Failed with server exception:{0}, {1}", ex.Message, ex.RequestID); + } + catch (Exception ex) + { + Console.WriteLine("Failed with error info: {0}", ex.Message); + } + + Console.WriteLine("Press any key to continue . . . "); + + Console.ReadKey(true); + } + } +} diff --git a/netcore-sample/Samples/AtomicIncrementSample.cs b/netcore-sample/Samples/AtomicIncrementSample.cs new file mode 100644 index 0000000..f3b19fc --- /dev/null +++ b/netcore-sample/Samples/AtomicIncrementSample.cs @@ -0,0 +1,172 @@ +using System; +using System.Collections.Generic; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.Request; +using Aliyun.OTS.Response; + +namespace Aliyun.OTS.Samples.Samples +{ + /// + /// 原子自增示例 + /// 可以指定某一列为原子自增列,每次按照指定的数值进行累加。 + /// + public class AtomicIncrementSample + { + private static readonly string TableName = "AtomicIncrementSample"; + + private static readonly string Pk1 = "Pk1"; + private static readonly string Pk2 = "Pk2"; + private static readonly string IncrementCol = "IncrementCol"; + + + //static void Main(string[] args) + //{ + // Console.WriteLine("AtomicIncrementSample"); + + // //准备表 + // PrepareTable(); + + // //新增一行,设置IncrementCol这个属性列的初始值为0 + // PutRow(); + + // //对IncrementCol执行原子自增,10次,每次加1 + // for (int i = 0; i < 10; i++) + // { + // Increment(1); + // } + + // //获取自增后的列 + // GetRow(); + + // Console.ReadLine(); + + //} + + + private static void PrepareTable() + { + // 创建表 + OTSClient otsClient = Config.GetClient(); + + IList tables = otsClient.ListTable(new ListTableRequest()).TableNames; + if (tables.Contains(TableName)) + { + return; + } + + PrimaryKeySchema primaryKeySchema = new PrimaryKeySchema + { + { Pk1, ColumnValueType.Integer }, + { Pk2, ColumnValueType.String } + }; + TableMeta tableMeta = new TableMeta(TableName, primaryKeySchema); + + CapacityUnit reservedThroughput = new CapacityUnit(0, 0); + CreateTableRequest request = new CreateTableRequest(tableMeta, reservedThroughput); + otsClient.CreateTable(request); + + } + + public static void PutRow() + { + Console.WriteLine("Start put row..."); + OTSClient otsClient = Config.GetClient(); + + // 定义行的主键,必须与创建表时的TableMeta中定义的一致 + PrimaryKey primaryKey = new PrimaryKey + { + { Pk1, new ColumnValue(0) }, + { Pk2, new ColumnValue("abc") } + }; + + // 定义要写入该行的属性列 + AttributeColumns attribute = new AttributeColumns + { + { IncrementCol, new ColumnValue(0) } + }; + PutRowRequest request = new PutRowRequest(TableName, new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + + otsClient.PutRow(request); + Console.WriteLine("Put row succeed."); + } + + + /// + /// 更新行的时候,指定某一列为原子自增列,并对这一列进行原子自增 + /// + public static void Increment(int incrementValue) + { + Console.WriteLine("Start set increment column..."); + OTSClient otsClient = Config.GetClient(); + + // 定义行的主键,必须与创建表时的TableMeta中定义的一致 + PrimaryKey primaryKey = new PrimaryKey + { + { Pk1, new ColumnValue(0) }, + { Pk2, new ColumnValue("abc") } + }; + RowUpdateChange rowUpdateChange = new RowUpdateChange(TableName, primaryKey); + rowUpdateChange.ReturnType = ReturnType.RT_AFTER_MODIFY; + rowUpdateChange.ReturnColumnNames = new List() { IncrementCol}; + //设置一个原子自增列,这一列从0开始自增,每次增增加1。 + rowUpdateChange.Increment(new Column(IncrementCol, new ColumnValue(incrementValue))); + + UpdateRowRequest updateRowRequest = new UpdateRowRequest(rowUpdateChange); + + var response = otsClient.UpdateRow(updateRowRequest); + Console.WriteLine("set Increment column succeed,Increment result:" + response.Row.GetColumns()[0].Value); + } + + + public static void GetRow() + { + Console.WriteLine("Start get row..."); + PrepareTable(); + OTSClient otsClient = Config.GetClient(); + + // 定义行的主键,必须与创建表时的TableMeta中定义的一致 + PrimaryKey primaryKey = new PrimaryKey + { + { Pk1, new ColumnValue(0) }, + { Pk2, new ColumnValue("abc") } + }; + + GetRowRequest request = new GetRowRequest(TableName, primaryKey); // 未指定读哪列,默认读整行 + GetRowResponse response = otsClient.GetRow(request); + PrimaryKey primaryKeyRead = response.PrimaryKey; + AttributeColumns attributesRead = response.Attribute; + + Console.WriteLine("Primary key read: "); + foreach (KeyValuePair entry in primaryKeyRead) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + + Console.WriteLine("Attributes read: "); + foreach (KeyValuePair entry in attributesRead) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + + Console.WriteLine("Get row succeed."); + } + + + + private static string PrintColumnValue(ColumnValue value) + { + switch (value.Type) + { + case ColumnValueType.String: return value.StringValue; + case ColumnValueType.Integer: return value.IntegerValue.ToString(); + case ColumnValueType.Boolean: return value.BooleanValue.ToString(); + case ColumnValueType.Double: return value.DoubleValue.ToString(); + case ColumnValueType.Binary: return value.BinaryValue.ToString(); + } + + throw new Exception("Unknow type."); + } + + + } +} diff --git a/netcore-sample/Samples/AutoIncrementSample.cs b/netcore-sample/Samples/AutoIncrementSample.cs new file mode 100644 index 0000000..d372ca5 --- /dev/null +++ b/netcore-sample/Samples/AutoIncrementSample.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.Request; +using Aliyun.OTS.Response; + +namespace Aliyun.OTS.Samples.Samples +{ + /// + /// 主键列自增示例 + /// + public class AutoIncrementSample + { + private static readonly string TableName = "AutoIncrementSample"; + + private static readonly string Pk1 = "Pk1"; + private static readonly string Pk2 = "Pk2_AutoIncrement"; + + + //static void Main(string[] args) + //{ + // Console.WriteLine("AutoIncrementSample"); + + // //创建一个带自增列的表 + // CreateTableWithAutoIncrementPk(); + + // //写入10行,自增列Pk2将 + // for (int i = 0; i < 10; i++) + // { + // PutRow(i.ToString()); + // } + + // Console.ReadLine(); + + //} + + /// + /// 创建一个带自增列的表 + /// + private static void CreateTableWithAutoIncrementPk() + { + + OTSClient otsClient = Config.GetClient(); + + IList tables = otsClient.ListTable(new ListTableRequest()).TableNames; + if (tables.Contains(TableName)) + { + return; + } + + PrimaryKeySchema primaryKeySchema = new PrimaryKeySchema + { + { Pk1, ColumnValueType.String }, + //指定Pk2为自增列主键 + { Pk2, ColumnValueType.Integer, PrimaryKeyOption.AUTO_INCREMENT} + }; + TableMeta tableMeta = new TableMeta(TableName, primaryKeySchema); + + CapacityUnit reservedThroughput = new CapacityUnit(0, 0); + CreateTableRequest request = new CreateTableRequest(tableMeta, reservedThroughput); + otsClient.CreateTable(request); + + } + + public static void PutRow(string pk1Value) + { + Console.WriteLine("Start put row..."); + OTSClient otsClient = Config.GetClient(); + + // 定义行的主键,必须与创建表时的TableMeta中定义的一致 + PrimaryKey primaryKey = new PrimaryKey + { + { Pk1, new ColumnValue(pk1Value) }, + { Pk2, ColumnValue.AUTO_INCREMENT } + }; + + // 定义要写入该行的属性列 + AttributeColumns attribute = new AttributeColumns + { + { "Col1", new ColumnValue(0) } + }; + PutRowRequest request = new PutRowRequest(TableName, new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + request.RowPutChange.ReturnType = ReturnType.RT_PK; + + var response = otsClient.PutRow(request); + Console.WriteLine("Put row succeed,autoIncrement Pk value:"+ response.Row.GetPrimaryKey()[Pk2].IntegerValue); + } + + } +} diff --git a/netcore-sample/Samples/ClientInitialize.cs b/netcore-sample/Samples/ClientInitialize.cs new file mode 100644 index 0000000..c7a88d3 --- /dev/null +++ b/netcore-sample/Samples/ClientInitialize.cs @@ -0,0 +1,31 @@ +using System; +using Aliyun.OTS.Request; + +namespace Aliyun.OTS.Samples +{ + public static class ClientInitialize + { + + public static void ErrorLog(string message) + { + Console.WriteLine(message); + } + + public static void InitializeClient() + { + OTSClientConfig config = new OTSClientConfig(Config.Endpoint, Config.AccessKeyId, Config.AccessKeySecret, Config.InstanceName); + config.AccessKeyID = Config.AccessKeyId; // 访问OTS服务所需的云账号的accessid + config.AccessKeySecret = Config.AccessKeySecret; // 访问OTS服务所需的云账号的accesskey + config.InstanceName = Config.InstanceName; // OTS的实例名 + config.EndPoint = Config.Endpoint; // OTS的服务访问地址 + config.ConnectionLimit = 300; // Client内部的连接池的连接数上限 + config.OTSDebugLogHandler = null; // 将DebugLogHandler设置为null,可关闭client内部的debug log的输出,否则默认会输出到标准输出 + config.OTSErrorLogHandler = ErrorLog; // 也可自定义LogHandler,将日志输出进行定制 + + OTSClient client = new OTSClient(config); // 初始化ots client + + ListTableRequest request = new ListTableRequest(); + client.ListTable(request); + } + } +} diff --git a/netcore-sample/Samples/ConditionUpdateSample.cs b/netcore-sample/Samples/ConditionUpdateSample.cs new file mode 100644 index 0000000..ad4d94a --- /dev/null +++ b/netcore-sample/Samples/ConditionUpdateSample.cs @@ -0,0 +1,288 @@ +using System; +using System.Collections.Generic; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.Request; +using Aliyun.OTS.Response; +using Aliyun.OTS.DataModel.ConditionalUpdate; + +namespace Aliyun.OTS.Samples +{ + public static class ConditionUpdateSample + { + + private static string tableName = "condition_update_sample"; + + private static void PrepareTable() + { + // 创建表 + OTSClient otsClient = Config.GetClient(); + + IList tables = otsClient.ListTable(new ListTableRequest()).TableNames; + if (tables.Contains(tableName)) { + return; + } + + PrimaryKeySchema primaryKeySchema = new PrimaryKeySchema(); + primaryKeySchema.Add("pk0", ColumnValueType.Integer); + primaryKeySchema.Add("pk1", ColumnValueType.String); + TableMeta tableMeta = new TableMeta(tableName, primaryKeySchema); + + CapacityUnit reservedThroughput = new CapacityUnit(0, 0); + CreateTableRequest request = new CreateTableRequest(tableMeta, reservedThroughput); + otsClient.CreateTable(request); + } + + public static void ConditionPutRow() + { + Console.WriteLine("Start put row..."); + + PrepareTable(); + OTSClient otsClient = Config.GetClient(); + + // 定义行的主键,必须与创建表时的TableMeta中定义的一致 + PrimaryKey primaryKey = new PrimaryKey(); + primaryKey.Add("pk0", new ColumnValue(0)); + primaryKey.Add("pk1", new ColumnValue("abc")); + + // 定义要写入改行的属性列 + AttributeColumns attribute = new AttributeColumns(); + attribute.Add("col0", new ColumnValue(0)); + attribute.Add("col1", new ColumnValue("a")); + attribute.Add("col2", new ColumnValue(true)); + + PutRowRequest request = new PutRowRequest(tableName, new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + + // 不带condition时put row,预期成功 + try + { + otsClient.PutRow(request); + + Console.WriteLine("Put row succeeded."); + } catch (Exception ex) + { + Console.WriteLine("Put row failed. error:{0}", ex.Message); + } + + // 当col0列的值不等于5的时候,允许再次put row,覆盖掉原值,预期成功 + try + { + request.Condition.ColumnCondition = new RelationalCondition("col0", + CompareOperator.NOT_EQUAL, + new ColumnValue(5)); + otsClient.PutRow(request); + + Console.WriteLine("Put row succeeded."); + } catch (Exception ex) + { + Console.WriteLine("Put row failed. error:{0}", ex.Message); + } + + // 当col0列的值等于5的时候,允许再次put row,覆盖掉原值,预期失败 + try + { + // 新增条件:col0列的值等于5 + request.Condition.ColumnCondition = new RelationalCondition("col0", + CompareOperator.EQUAL, + new ColumnValue(5)); + otsClient.PutRow(request); + + Console.WriteLine("Put row succeeded."); + } + catch (OTSServerException) + { + // 由于条件不满足,抛出OTSServerException + Console.WriteLine("Put row failed because condition check failed. but expected"); + } + catch (Exception ex) + { + Console.WriteLine("Put row failed. error:{0}", ex.Message); + } + } + + public static void ConditionUpdateRow() + { + Console.WriteLine("Start update row..."); + + PrepareTable(); + var otsClient = Config.GetClient(); + + // 定义行的主键,必须与创建表时的TableMeta中定义的一致 + var primaryKey = new PrimaryKey(); + primaryKey.Add("pk0", new ColumnValue(1)); + primaryKey.Add("pk1", new ColumnValue("abc")); + + // 定义要写入改行的属性列 + var attribute = new AttributeColumns(); + attribute.Add("col0", new ColumnValue(1)); + attribute.Add("col1", new ColumnValue("a")); + attribute.Add("col2", new ColumnValue(true)); + + var request = new PutRowRequest(tableName, new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + + // 新创建一行数据 + try + { + otsClient.PutRow(request); + + Console.WriteLine("Put row succeeded."); + } + catch (Exception ex) + { + Console.WriteLine("Put row failed. error:{0}", ex.Message); + } + + + // 当col0不等于5,且col1等于'a'时,允许修改,否则不允许修改 + try + { + // 构造condition + var cond1 = new RelationalCondition("col0", + CompareOperator.NOT_EQUAL, + new ColumnValue(5)); + var cond2 = new RelationalCondition("col1", CompareOperator.EQUAL, + new ColumnValue("a")); + var columenCondition = new CompositeCondition(LogicOperator.AND); + columenCondition.AddCondition(cond1); + columenCondition.AddCondition(cond2); + + var condition = new Condition(RowExistenceExpectation.IGNORE); + condition.ColumnCondition = columenCondition; + + // 构造更新请求 + var updateOfAttribute = new UpdateOfAttribute(); + updateOfAttribute.AddAttributeColumnToPut("col2", new ColumnValue(false)); + var updateRowRequest = new UpdateRowRequest(tableName, condition, primaryKey, updateOfAttribute); + + // 更新数据 + otsClient.UpdateRow(updateRowRequest); + + // 更新成功 + Console.WriteLine("Update row succeeded."); + } + catch (Exception ex) + { + Console.WriteLine("Update row failed. error:{0}", ex.Message); + } + } + + public static void ConditionDeleteRow() + { + Console.WriteLine("Start delete row..."); + + PrepareTable(); + OTSClient otsClient = Config.GetClient(); + + // 定义行的主键,必须与创建表时的TableMeta中定义的一致 + PrimaryKey primaryKey = new PrimaryKey(); + primaryKey.Add("pk0", new ColumnValue(2)); + primaryKey.Add("pk1", new ColumnValue("abc")); + + // 定义要写入改行的属性列 + AttributeColumns attribute = new AttributeColumns(); + attribute.Add("col0", new ColumnValue(2)); + attribute.Add("col1", new ColumnValue("a")); + attribute.Add("col2", new ColumnValue(true)); + + PutRowRequest putRequest = new PutRowRequest(tableName, new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + + // 新创建一行数据 + try + { + otsClient.PutRow(putRequest); + + Console.WriteLine("Put row succeeded."); + } + catch (Exception ex) + { + Console.WriteLine("Put row failed. error:{0}", ex.Message); + } + + // 当col2列的值等于true的时候,允许删除 + try + { + // 构造条件语句:col2列的值等于true + var condition = new Condition(RowExistenceExpectation.EXPECT_EXIST); + condition.ColumnCondition = new RelationalCondition("col2", + CompareOperator.EQUAL, + new ColumnValue(true)); + + // 构造删除请求 + var deleteRequest = new DeleteRowRequest(tableName, condition, primaryKey); + + // 删除满足条件的特定行 + otsClient.DeleteRow(deleteRequest); + + Console.WriteLine("Delete row succeeded."); + } + catch (Exception ex) + { + Console.WriteLine("Delete row failed. error:{0}", ex.Message); + } + + Console.WriteLine("Delete row succeeded."); + } + + public static void ConditionBatchWriteRow() + { + Console.WriteLine("Start batch write row..."); + + PrepareTable(); + OTSClient otsClient = Config.GetClient(); + + // 定义行的主键,必须与创建表时的TableMeta中定义的一致 + PrimaryKey primaryKey = new PrimaryKey(); + primaryKey.Add("pk0", new ColumnValue(3)); + primaryKey.Add("pk1", new ColumnValue("abc")); + + // 定义要写入改行的属性列 + AttributeColumns attribute = new AttributeColumns(); + attribute.Add("col0", new ColumnValue(0)); + attribute.Add("col1", new ColumnValue("a")); + attribute.Add("col2", new ColumnValue(true)); + + PutRowRequest request = new PutRowRequest(tableName, new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + + // 新创建一行数据 + try + { + otsClient.PutRow(request); + + Console.WriteLine("Put row succeeded."); + } + catch (Exception ex) + { + Console.WriteLine("Put row failed. error:{0}", ex.Message); + } + + // 当col0列的值不等于5的时候,允许再次put row,覆盖掉原值,预期成功 + try + { + // 构造条件语句:col0列的值不等于5 + var condition = new Condition(RowExistenceExpectation.IGNORE); + condition.ColumnCondition = new RelationalCondition("col0", + CompareOperator.NOT_EQUAL, + new ColumnValue(5)); + + // 构造col2列的值 + var attr1 = new AttributeColumns(); + attr1.Add("col2", new ColumnValue(false)); + + // 构造批量写请求 + var rowChange = new RowChanges(tableName); + rowChange.AddPut(condition, primaryKey, attr1); + + var batchWriteRequest = new BatchWriteRowRequest(); + batchWriteRequest.Add(tableName, rowChange); + + // 批量写数据 + otsClient.BatchWriteRow(batchWriteRequest); + + Console.WriteLine("Batch write row succeeded."); + } + catch (Exception ex) + { + Console.WriteLine("Batch write row failed. error:{0}", ex.Message); + } + } + } +} diff --git a/netcore-sample/Samples/CreateTableSample.cs b/netcore-sample/Samples/CreateTableSample.cs new file mode 100644 index 0000000..24e116e --- /dev/null +++ b/netcore-sample/Samples/CreateTableSample.cs @@ -0,0 +1,70 @@ +using System; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.Request; +using Aliyun.OTS.Response; +using System.Threading; + +namespace Aliyun.OTS.Samples +{ + public static class CreateTableSample + { + + private static readonly string TableName = "createTableSample"; + + public static void TableOperations() + { + // 创建表 + OTSClient otsClient = Config.GetClient(); + + { + Console.WriteLine("Start create table..."); + PrimaryKeySchema primaryKeySchema = new PrimaryKeySchema + { + { "pk0", ColumnValueType.Integer }, + { "pk1", ColumnValueType.String } + }; + TableMeta tableMeta = new TableMeta(TableName, primaryKeySchema); + + CapacityUnit reservedThroughput = new CapacityUnit(0, 0); + CreateTableRequest request = new CreateTableRequest(tableMeta, reservedThroughput); + otsClient.CreateTable(request); + + Console.WriteLine("Table is created: " + TableName); + } + + //// 更新表 + //{ + // Thread.Sleep(60 * 1000); // 每次更新表需要至少间隔1分钟 + // Console.WriteLine("Start update table..."); + // CapacityUnit reservedThroughput = new CapacityUnit(0, 0); // 将预留CU调整为0,0 + // UpdateTableRequest request = new UpdateTableRequest(TableName, reservedThroughput); + // UpdateTableResponse response = otsClient.UpdateTable(request); + // Console.WriteLine("LastIncreaseTime: " + response.ReservedThroughputDetails.LastIncreaseTime); + // Console.WriteLine("LastDecreaseTime: " + response.ReservedThroughputDetails.LastDecreaseTime); + // Console.WriteLine("NumberOfDecreaseToday: " + response.ReservedThroughputDetails.LastIncreaseTime); + // Console.WriteLine("ReadCapacity: " + response.ReservedThroughputDetails.CapacityUnit.Read); + // Console.WriteLine("WriteCapacity: " + response.ReservedThroughputDetails.CapacityUnit.Write); + //} + + // 描述表 + { + Console.WriteLine("Start describe table..."); + DescribeTableRequest request = new DescribeTableRequest(TableName); + DescribeTableResponse response = otsClient.DescribeTable(request); + Console.WriteLine("LastIncreaseTime: " + response.ReservedThroughputDetails.LastIncreaseTime); + Console.WriteLine("LastDecreaseTime: " + response.ReservedThroughputDetails.LastDecreaseTime); + Console.WriteLine("NumberOfDecreaseToday: " + response.ReservedThroughputDetails.LastIncreaseTime); + Console.WriteLine("ReadCapacity: " + response.ReservedThroughputDetails.CapacityUnit.Read); + Console.WriteLine("WriteCapacity: " + response.ReservedThroughputDetails.CapacityUnit.Write); + } + + //// 删除表 + //{ + // Console.WriteLine("Start delete table..."); + // DeleteTableRequest request = new DeleteTableRequest(TableName); + // otsClient.DeleteTable(request); + // Console.WriteLine("Table is deleted."); + //} + } + } +} diff --git a/netcore-sample/Samples/GlobalIndexSample.cs b/netcore-sample/Samples/GlobalIndexSample.cs new file mode 100644 index 0000000..a7b9e25 --- /dev/null +++ b/netcore-sample/Samples/GlobalIndexSample.cs @@ -0,0 +1,233 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.Request; +using Aliyun.OTS.Response; + +namespace Aliyun.OTS.Samples.Samples +{ + public class GlobalIndexSample + { + private static readonly string TableName = "tableWithGlobalIndexSample"; + private static readonly string IndexName = "tableWithGlobalIndexSampleIndex"; + private static readonly string IndexName2 = "tableWithGlobalIndexSampleIndex2"; + + private static readonly string Pk1 = "Pk1"; + private static readonly string Pk2 = "Pk2"; + private static readonly string Col1 = "Col1"; + private static readonly string Col2 = "Col2"; + + + //static void Main(string[] args) + //{ + // Console.WriteLine("GlobalIndexSample"); + + // CreateTableWithGlobalIndex(); + + // CreateGlobalIndex(); + + // PutRow(); + + // GetRangeFromIndexTable(); + + // DeleteGlobalIndex(); + + // DeleteTable(); + + // Console.ReadLine(); + + //} + + /// + /// 创建一个带二级索引的表 + /// + public static void CreateTableWithGlobalIndex() + { + //建主表,两列Pk:Pk1、Pk2。 预定义列:Col1、Col2。 + //建索引表,索引表中Col1放Pk0 + OTSClient otsClient = Config.GetClient(); + + Console.WriteLine("Start create table with globalIndex..."); + PrimaryKeySchema primaryKeySchema = new PrimaryKeySchema + { + { Pk1, ColumnValueType.String }, + { Pk2, ColumnValueType.String } + }; + TableMeta tableMeta = new TableMeta(TableName, primaryKeySchema); + tableMeta.DefinedColumnSchema = new DefinedColumnSchema { + { Col1, DefinedColumnType.STRING}, + { Col2,DefinedColumnType.STRING} + }; + + IndexMeta indexMeta = new IndexMeta(IndexName); + indexMeta.PrimaryKey = new List() { Col1 }; + indexMeta.DefinedColumns = new List() { Col2 }; + //indexMeta.IndexType = IndexType.IT_GLOBAL_INDEX; + //indexMeta.IndexUpdateModel = IndexUpdateMode.IUM_ASYNC_INDEX; + + List indexMetas = new List() { }; + indexMetas.Add(indexMeta); + + CapacityUnit reservedThroughput = new CapacityUnit(0, 0); + CreateTableRequest request = new CreateTableRequest(tableMeta, reservedThroughput, indexMetas); + otsClient.CreateTable(request); + + Console.WriteLine("Table is created: " + TableName); + + } + + /// + /// 单独在表上再创建一个索引表2 + /// + public static void CreateGlobalIndex() + { + OTSClient otsClient = Config.GetClient(); + + Console.WriteLine("Start create globalIndex..."); + + IndexMeta indexMeta = new IndexMeta(IndexName2); + indexMeta.PrimaryKey = new List() { Col2 }; + indexMeta.DefinedColumns = new List() { Pk1 }; + + + CapacityUnit reservedThroughput = new CapacityUnit(0, 0); + CreateGlobalIndexRequest request = new CreateGlobalIndexRequest(TableName, indexMeta); + otsClient.CreateGlobalIndex(request); + + Console.WriteLine("Global Index is created,tableName: " + TableName + ",IndexName:" + IndexName2); + + } + + /// + /// 向主表中写入数据(自动同步到索引表) + /// + public static void PutRow() + { + Console.WriteLine("Start put row..."); + OTSClient otsClient = Config.GetClient(); + PrimaryKey primaryKey = new PrimaryKey + { + { Pk1, new ColumnValue("abc") }, + { Pk2, new ColumnValue("edf") } + }; + + // 定义要写入改行的属性列 + AttributeColumns attribute = new AttributeColumns + { + { Col1, new ColumnValue("Col1Value") }, + { Col2, new ColumnValue("Col2Value") } + }; + PutRowRequest request = new PutRowRequest(TableName, new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + + otsClient.PutRow(request); + Console.WriteLine("Put row succeed."); + } + + /// + /// 从索引表中读取数据 + /// + public static void GetRangeFromIndexTable() + { + Console.WriteLine("Start getRange from index..."); + OTSClient otsClient = Config.GetClient(); + // 指定第一主键Col1的值,进行扫描 + PrimaryKey inclusiveStartPrimaryKey = new PrimaryKey + { + { Col1, new ColumnValue("Col1Value") }, + { Pk1, ColumnValue.INF_MIN }, + { Pk2, ColumnValue.INF_MIN } + }; + + PrimaryKey exclusiveEndPrimaryKey = new PrimaryKey + { + { Col1, new ColumnValue("Col1Value") }, + { Pk1, ColumnValue.INF_MAX }, + { Pk2, ColumnValue.INF_MAX } + }; + + GetRangeRequest request = new GetRangeRequest(IndexName, GetRangeDirection.Forward, inclusiveStartPrimaryKey, exclusiveEndPrimaryKey); + + GetRangeResponse response = otsClient.GetRange(request); + IList rows = response.RowDataList; + PrimaryKey nextStartPrimaryKey = response.NextPrimaryKey; + while (nextStartPrimaryKey != null) + { + request = new GetRangeRequest(TableName, GetRangeDirection.Forward, nextStartPrimaryKey, exclusiveEndPrimaryKey); + response = otsClient.GetRange(request); + nextStartPrimaryKey = response.NextPrimaryKey; + foreach (var row in response.RowDataList) + { + rows.Add(row); + } + } + + foreach (var row in rows) + { + PrintRow(row); + } + + Console.WriteLine("TotalRowsRead: " + rows.Count); + } + + + /// + /// 删除索引表1、2 + /// + public static void DeleteGlobalIndex() + { + OTSClient otsClient = Config.GetClient(); + + Console.WriteLine("Start delete globalIndex..."); + + DeleteGlobalIndexRequest request = new DeleteGlobalIndexRequest(TableName, IndexName); + otsClient.DeleteGlobalIndex(request); + + DeleteGlobalIndexRequest request2 = new DeleteGlobalIndexRequest(TableName, IndexName2); + otsClient.DeleteGlobalIndex(request2); + + Console.WriteLine("Global Index is deleted,tableName: " + TableName + ",IndexName:" + IndexName + "," + IndexName2); + + } + + public static void DeleteTable() + { + OTSClient otsClient = Config.GetClient(); + Console.WriteLine("Start delete table..."); + DeleteTableRequest request = new DeleteTableRequest(TableName); + otsClient.DeleteTable(request); + Console.WriteLine("Table is deleted."); + } + + private static string PrintColumnValue(ColumnValue value) + { + switch (value.Type) + { + case ColumnValueType.String: return value.StringValue; + case ColumnValueType.Integer: return value.IntegerValue.ToString(); + case ColumnValueType.Boolean: return value.BooleanValue.ToString(); + case ColumnValueType.Double: return value.DoubleValue.ToString(); + case ColumnValueType.Binary: return value.BinaryValue.ToString(); + } + + throw new Exception("Unknow type."); + } + + private static void PrintRow(Row row) + { + Console.WriteLine("-----------------"); + + foreach (KeyValuePair entry in row.GetPrimaryKey()) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + + foreach (Column entry in row.GetColumns()) + { + Console.WriteLine(entry.Name + ":" + PrintColumnValue(entry.Value)); + } + + Console.WriteLine("-----------------"); + } + } +} diff --git a/netcore-sample/Samples/MultiRowReadWriteSample.cs b/netcore-sample/Samples/MultiRowReadWriteSample.cs new file mode 100644 index 0000000..88102a5 --- /dev/null +++ b/netcore-sample/Samples/MultiRowReadWriteSample.cs @@ -0,0 +1,397 @@ +using System; +using System.Collections.Generic; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.Request; +using Aliyun.OTS.Response; +using Aliyun.OTS.DataModel.ConditionalUpdate; + +namespace Aliyun.OTS.Samples +{ + public static class MultiRowReadWriteSample + { + + private const string TableName = "multiRowReadWriteSample"; + + private static void PrepareTable() + { + // 创建表 + OTSClient otsClient = Config.GetClient(); + + IList tables = otsClient.ListTable(new ListTableRequest()).TableNames; + if (tables.Contains(TableName)) { + return; + } + + + PrimaryKeySchema primaryKeySchema = new PrimaryKeySchema + { + { "pk0", ColumnValueType.Integer }, + { "pk1", ColumnValueType.String } + }; + + TableMeta tableMeta = new TableMeta(TableName, primaryKeySchema); + + CapacityUnit reservedThroughput = new CapacityUnit(0, 0); + CreateTableRequest request = new CreateTableRequest(tableMeta, reservedThroughput); + otsClient.CreateTable(request); + + } + + private static void PrepareData() + { + OTSClient otsClient = Config.GetClient(); + + // 插入100条数据 + for (int i = 0; i < 100; i++) + { + PrimaryKey primaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(i) }, + { "pk1", new ColumnValue("abc") } + }; + + // 定义要写入改行的属性列 + AttributeColumns attribute = new AttributeColumns + { + { "col0", new ColumnValue(0) }, + { "col1", new ColumnValue("a") }, + { "col2", new ColumnValue(i % 3 != 0) } + }; + PutRowRequest request = new PutRowRequest(TableName, new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + + otsClient.PutRow(request); + } + } + + public static void GetRange() + { + Console.WriteLine("Start get range..."); + + PrepareTable(); + PrepareData(); + + OTSClient otsClient = Config.GetClient(); + // 读取 (0, INF_MIN)到(100, INF_MAX)这个范围内的所有行 + PrimaryKey inclusiveStartPrimaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(0) }, + { "pk1", ColumnValue.INF_MIN } + }; + + PrimaryKey exclusiveEndPrimaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(100) }, + { "pk1", ColumnValue.INF_MAX } + }; + + GetRangeRequest request = new GetRangeRequest(TableName, GetRangeDirection.Forward, inclusiveStartPrimaryKey, exclusiveEndPrimaryKey); + + GetRangeResponse response = otsClient.GetRange(request); + IList rows = response.RowDataList; + PrimaryKey nextStartPrimaryKey = response.NextPrimaryKey; + while (nextStartPrimaryKey != null) + { + request = new GetRangeRequest(TableName, GetRangeDirection.Forward, nextStartPrimaryKey, exclusiveEndPrimaryKey); + response = otsClient.GetRange(request); + nextStartPrimaryKey = response.NextPrimaryKey; + foreach (var row in response.RowDataList) + { + rows.Add(row); + } + } + + foreach (var row in rows) + { + PrintRow(row); + } + + Console.WriteLine("TotalRowsRead: " + rows.Count); + } + + public static void GetRangeWithFilter() + { + Console.WriteLine("Start get range with filter ..."); + PrepareTable(); + PrepareData(); + + OTSClient otsClient = Config.GetClient(); + // 读取 (0, INF_MIN)到(100, INF_MAX)这个范围内的所有行,且col2等于false的行 + PrimaryKey inclusiveStartPrimaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(0) }, + { "pk1", ColumnValue.INF_MIN } + }; + + PrimaryKey exclusiveEndPrimaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(100) }, + { "pk1", ColumnValue.INF_MAX } + }; + + // 构造列过滤条件 + var condition = new RelationalCondition("col2", + CompareOperator.EQUAL, + new ColumnValue(false)); + + var queryCriteria = new RangeRowQueryCriteria(TableName) + { + Direction = GetRangeDirection.Forward, + InclusiveStartPrimaryKey = inclusiveStartPrimaryKey, + ExclusiveEndPrimaryKey = exclusiveEndPrimaryKey, + Filter = condition.ToFilter() + }; + + GetRangeResponse response = otsClient.GetRange(new GetRangeRequest(queryCriteria)); + IList rows = response.RowDataList; + PrimaryKey nextStartPrimaryKey = response.NextPrimaryKey; + while (nextStartPrimaryKey != null) + { + queryCriteria = new RangeRowQueryCriteria(TableName) + { + Direction = GetRangeDirection.Forward, + InclusiveStartPrimaryKey = nextStartPrimaryKey, + ExclusiveEndPrimaryKey = exclusiveEndPrimaryKey, + Filter = condition.ToFilter() + }; + + response = otsClient.GetRange(new GetRangeRequest(queryCriteria)); + nextStartPrimaryKey = response.NextPrimaryKey; + foreach (var row in response.RowDataList) + { + rows.Add(row); + } + } + + foreach (var row in rows) + { + PrintRow(row); + } + + Console.WriteLine("TotalRowsRead with filter: " + rows.Count); + } + + public static void GetIterator() + { + Console.WriteLine("Start get iterator..."); + + PrepareTable(); + PrepareData(); + + OTSClient otsClient = Config.GetClient(); + // 读取 (0, "a")到(1000, "xyz")这个范围内的所有行 + PrimaryKey inclusiveStartPrimaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(0) }, + { "pk1", new ColumnValue("a") } + }; + + PrimaryKey exclusiveEndPrimaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(1000) }, + { "pk1", new ColumnValue("xyz") } + }; + + var cu = new CapacityUnit(0, 0); + var request = new GetIteratorRequest(TableName, GetRangeDirection.Forward, inclusiveStartPrimaryKey, + exclusiveEndPrimaryKey, cu); + + var iterator = otsClient.GetRangeIterator(request); + foreach (var row in iterator) + { + PrintRow(row); + } + + Console.WriteLine("Consumed CapacityUnit Counter:{0}", cu.Read); + } + + public static void BatchGetRow() + { + Console.WriteLine("Start batch get row..."); + PrepareTable(); + PrepareData(); + OTSClient otsClient = Config.GetClient(); + + // 批量一次读10行 + BatchGetRowRequest request = new BatchGetRowRequest(); + List primaryKeys = new List(); + for (int i = 0; i < 10; i++) + { + PrimaryKey primaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(i) }, + { "pk1", new ColumnValue("abc") } + }; + primaryKeys.Add(primaryKey); + } + + request.Add(TableName, primaryKeys); + + BatchGetRowResponse response = otsClient.BatchGetRow(request); + var tableRows = response.RowDataGroupByTable; + var rows = tableRows[TableName]; + + foreach(var row in rows) + { + // 注意:batch操作可能部分成功部分失败,需要为每行检查状态 + if (row.IsOK) + { + Console.WriteLine("-----------------"); + foreach (KeyValuePair entry in row.PrimaryKey) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + foreach (KeyValuePair entry in row.Attribute) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + Console.WriteLine("-----------------"); + } else + { + Console.WriteLine("Read row failed: " + row.ErrorMessage); + } + } + + Console.WriteLine("RowsCount: " + rows.Count); + } + + public static void BatchGetRowWithFilter() + { + Console.WriteLine("Start batch get row with filter ..."); + PrepareTable(); + PrepareData(); + OTSClient otsClient = Config.GetClient(); + + // 批量一次读10行 + BatchGetRowRequest request = new BatchGetRowRequest(); + List primaryKeys = new List(); + for (int i = 0; i < 10; i++) + { + PrimaryKey primaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(i) }, + { "pk1", new ColumnValue("abc") } + }; + primaryKeys.Add(primaryKey); + } + + var condition = new RelationalCondition("col2", + CompareOperator.EQUAL, + new ColumnValue(false)); + + request.Add(TableName, primaryKeys, null, condition); + + BatchGetRowResponse response = otsClient.BatchGetRow(request); + var tableRows = response.RowDataGroupByTable; + var rows = tableRows[TableName]; + + foreach (var row in rows) + { + // 注意:batch操作可能部分成功部分失败,需要为每行检查状态 + if (row.IsOK) + { + Console.WriteLine("-----------------"); + foreach (KeyValuePair entry in row.PrimaryKey) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + foreach (KeyValuePair entry in row.Attribute) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + Console.WriteLine("-----------------"); + } + else + { + Console.WriteLine("Read row with filter failed: " + row.ErrorMessage); + } + } + + Console.WriteLine("RowsCount with filter"); + } + + public static void BatchWriteRow() + { + Console.WriteLine("Start batch write row..."); + PrepareTable(); + PrepareData(); + OTSClient otsClient = Config.GetClient(); + + // 一次批量导入100行数据 + var request = new BatchWriteRowRequest(); + var rowChanges = new RowChanges(TableName); + for (int i = 0; i < 100; i++) + { + PrimaryKey primaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(i) }, + { "pk1", new ColumnValue("abc") } + }; + + // 定义要写入改行的属性列 + UpdateOfAttribute attribute = new UpdateOfAttribute(); + attribute.AddAttributeColumnToPut("col0", new ColumnValue(0)); + attribute.AddAttributeColumnToPut("col1", new ColumnValue("a")); + attribute.AddAttributeColumnToPut("col2", new ColumnValue(true)); + + rowChanges.AddUpdate(new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + } + + request.Add(TableName, rowChanges); + + var response = otsClient.BatchWriteRow(request); + var tableRows = response.TableRespones; + var rows = tableRows[TableName]; + + int succeedRows = 0; + int failedRows = 0; + foreach (var row in rows.Responses) + { + // 注意:batch操作可能部分成功部分失败,需要为每行检查状态 + if (row.IsOK) + { + succeedRows++; + } + else + { + Console.WriteLine("Read row failed: " + row.ErrorMessage); + failedRows++; + } + } + + Console.WriteLine("SucceedRows: " + succeedRows); + Console.WriteLine("FailedRows: " + failedRows); + } + + private static string PrintColumnValue(ColumnValue value) + { + switch (value.Type) + { + case ColumnValueType.String: return value.StringValue; + case ColumnValueType.Integer: return value.IntegerValue.ToString(); + case ColumnValueType.Boolean: return value.BooleanValue.ToString(); + case ColumnValueType.Double: return value.DoubleValue.ToString(); + case ColumnValueType.Binary: return value.BinaryValue.ToString(); + } + + throw new Exception("Unknow type."); + } + + + private static void PrintRow(Row row) + { + Console.WriteLine("-----------------"); + + foreach (KeyValuePair entry in row.GetPrimaryKey()) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + + foreach (Column entry in row.GetColumns()) + { + Console.WriteLine(entry.Name + ":" + PrintColumnValue(entry.Value)); + } + + Console.WriteLine("-----------------"); + } + } +} diff --git a/netcore-sample/Samples/SearchIndexGeoSample.cs b/netcore-sample/Samples/SearchIndexGeoSample.cs new file mode 100644 index 0000000..e5046c4 --- /dev/null +++ b/netcore-sample/Samples/SearchIndexGeoSample.cs @@ -0,0 +1,321 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.DataModel.Search; +using Aliyun.OTS.DataModel.Search.Query; +using Aliyun.OTS.Request; +using Aliyun.OTS.Response; +using Newtonsoft.Json; + +namespace Aliyun.OTS.Samples.Samples +{ + public class SearchIndexGeoSample + { + private static readonly string TableName = "SearchIndexGeoSampleTable"; + private static readonly string IndexName = "SearchIndexGeoSampleTableIndex"; + private static readonly string Pk0 = "pk0"; + private static readonly string Pk1 = "pk1"; + private static readonly string Geo_type_col = "geo_type_col"; + + //static void Main(string[] args) + //{ + // OTSClient otsClient = Config.GetClient(); + // //DeleteSearchIndex(otsClient); + // //DeleteTable(otsClient); + // //CreateTable(otsClient); + // //CreateSearchIndex(otsClient); + + // ////Wait searchIndex load success + // //Console.WriteLine("wait searchIndex load success"); + // //Thread.Sleep(3 * 1000); + + // //ListSearchIndex(otsClient); + // //DescribeSearchIndex(otsClient); + // //PutRow(otsClient); + + // //Wait searchIndex load success + // WaiteAllDataSyncSuccess(otsClient, 10); + + // //GeoBoundingBoxQuery + // GeoBoundingBoxQuery(otsClient); + + // //GeoDistanceQuery + // GeoDistanceQuery(otsClient); + + // //GeoPolygonQuery + // GeoPolygonQuery(otsClient); + + // Console.ReadLine(); + //} + + public static void CreateTable(OTSClient otsClient) + { + // 创建表 + Console.WriteLine("\n Start create table..."); + PrimaryKeySchema primaryKeySchema = new PrimaryKeySchema + { + { Pk0, ColumnValueType.Integer }, + { Pk1, ColumnValueType.String } + }; + TableMeta tableMeta = new TableMeta(TableName, primaryKeySchema); + + CapacityUnit reservedThroughput = new CapacityUnit(0, 0); + CreateTableRequest request = new CreateTableRequest(tableMeta, reservedThroughput); + otsClient.CreateTable(request); + + Console.WriteLine("Table is created: " + TableName); + } + + public static void DeleteTable(OTSClient otsClient) + { + DeleteTableRequest request = new DeleteTableRequest(TableName); + otsClient.DeleteTable(request); + } + + public static void ListSearchIndex(OTSClient otsClient) + { + Console.WriteLine("\n Start list searchindex..."); + + ListSearchIndexRequest request = new ListSearchIndexRequest(TableName); + ListSearchIndexResponse response = otsClient.ListSearchIndex(request); + foreach (var index in response.IndexInfos) + { + Console.WriteLine("indexname:" + index.IndexName); + Console.WriteLine("tablename:" + index.TableName); + } + } + + public static void CreateSearchIndex(OTSClient otsClient) + { + Console.WriteLine("\n Start Create searchindex..."); + + CreateSearchIndexRequest request = new CreateSearchIndexRequest(TableName,IndexName); + List FieldSchemas = new List() { + new FieldSchema(Geo_type_col,FieldType.GEO_POINT){ index=true,EnableSortAndAgg=true}, + }; + request.IndexSchame = new IndexSchema() + { + FieldSchemas = FieldSchemas + }; + + CreateSearchIndexResponse response = otsClient.CreateSearchIndex(request); + + Console.WriteLine("Searchindex is created: " + IndexName); + } + + public static void DescribeSearchIndex(OTSClient otsClient) + { + Console.WriteLine("\n Start Describe searchindex..."); + + DescribeSearchIndexRequest request = new DescribeSearchIndexRequest(TableName, IndexName); + DescribeSearchIndexResponse response = otsClient.DescribeSearchIndex(request); + string serializedObjectString = JsonConvert.SerializeObject(response); + Console.WriteLine(serializedObjectString); + + } + + public static void DeleteSearchIndex(OTSClient otsClient) + { + Console.WriteLine("\n Start Delete searchindex..."); + + DeleteSearchIndexRequest request = new DeleteSearchIndexRequest(TableName, IndexName); + DeleteSearchIndexResponse response = otsClient.DeleteSearchIndex(request); + + Console.WriteLine("Searchindex is deleted:" + IndexName); + + } + + public static void PutRow(OTSClient otsClient) + { + Console.WriteLine("\n Start put row..."); + List colList = new List() { + "0,0", + "7,3", + "2,8", + "5,9", + "10,10", + "20,20", + "14,18", + "12,16", + "15,4", + "8,13" + }; + for (int i = 0; i < 10; i++) + { + PrimaryKey primaryKey = new PrimaryKey{ + { Pk0, new ColumnValue(i) }, + { Pk1, new ColumnValue("pk1value") } + }; + AttributeColumns attribute = new AttributeColumns{ + { Geo_type_col, new ColumnValue(colList[i]) } + }; + PutRowRequest request = new PutRowRequest(TableName, new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + + otsClient.PutRow(request); + } + Console.WriteLine("Put row succeed."); + } + + public static void WaiteAllDataSyncSuccess(OTSClient otsClient, int expectTotalCount) + { + Console.WriteLine("wait all rows sync success"); + int timeoutSeconds = 3 * 60; + var beginTime = DateTime.Now; + while (true) + { + var searchQuery = new SearchQuery(); + searchQuery.Query = new MatchAllQuery(); + var request = new SearchRequest(TableName, IndexName, searchQuery); + + var response = otsClient.Search(request); + if (response.TotalCount == expectTotalCount) + { + break; + } + else if ((DateTime.Now - beginTime).Seconds > timeoutSeconds) + { + throw new Exception("searchIndex sync data timeout"); + } + Thread.Sleep(1000); + } + } + + private static string PrintColumnValue(ColumnValue value) + { + switch (value.Type) + { + case ColumnValueType.String: return value.StringValue; + case ColumnValueType.Integer: return value.IntegerValue.ToString(); + case ColumnValueType.Boolean: return value.BooleanValue.ToString(); + case ColumnValueType.Double: return value.DoubleValue.ToString(); + case ColumnValueType.Binary: return value.BinaryValue.ToString(); + } + + throw new Exception("Unknow type."); + } + + private static void PrintRow(Row row) + { + PrimaryKey primaryKeyRead = row.PrimaryKey; + AttributeColumns attributesRead = row.AttributeColumns; + + Console.WriteLine("Primary key: "); + foreach (KeyValuePair entry in primaryKeyRead) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + + Console.WriteLine("Attributes: "); + foreach (KeyValuePair entry in attributesRead) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + } + + /// + /// 查询所有行,返回行数 + /// + /// + public static void MatchAllQuery(OTSClient otsClient) + { + Console.WriteLine("\n Start matchAll query..."); + + var searchQuery = new SearchQuery(); + searchQuery.Query = new MatchAllQuery(); + var request = new SearchRequest(TableName, IndexName, searchQuery); + + var response = otsClient.Search(request); + + Console.WriteLine("IsAllSuccess:" + response.IsAllSuccess); + Console.WriteLine("Total Count:" + response.TotalCount); + } + + /// + /// geo_type_col是GeoPoint类型,查询表中geo_type_col这一列的值在左上角为"10,0", 右下角为"0,10"的矩形范围内的数据 + /// + /// + public static void GeoBoundingBoxQuery(OTSClient client) + { + Console.WriteLine("\n Start GeoBoundingBox query..."); + + SearchQuery searchQuery = new SearchQuery(); + GeoBoundingBoxQuery geoBoundingBoxQuery = new GeoBoundingBoxQuery(); // 设置查询类型为GeoBoundingBoxQuery + geoBoundingBoxQuery.FieldName = Geo_type_col; // 设置比较哪个字段的值 + geoBoundingBoxQuery.TopLeft = "10,0"; // 设置矩形左上角 + geoBoundingBoxQuery.BottomRight = "0,10"; // 设置矩形右下角 + searchQuery.Query = geoBoundingBoxQuery; + + SearchRequest searchRequest = new SearchRequest(TableName, IndexName, searchQuery); + + var columnsToGet = new ColumnsToGet(); + columnsToGet.Columns = new List { Geo_type_col }; //设置返回Col_GeoPoint这一列 + searchRequest.ColumnsToGet = columnsToGet; + + SearchResponse response = client.Search(searchRequest); + Console.WriteLine(response.TotalCount); + foreach (var row in response.Rows) + { + PrintRow(row); + } + } + + /// + /// 查询表中geo_type_col这一列的值距离中心点不超过一定距离的数据。 + /// + /// + public static void GeoDistanceQuery(OTSClient client) + { + Console.WriteLine("\n Start GeoDistance query..."); + + SearchQuery searchQuery = new SearchQuery(); + GeoDistanceQuery geoDistanceQuery = new GeoDistanceQuery(); // 设置查询类型为GeoDistanceQuery + geoDistanceQuery.FieldName = Geo_type_col; + geoDistanceQuery.CenterPoint = "10,11"; // 设置中心点 + geoDistanceQuery.DistanceInMeter = 10000; // 设置到中心点的距离条件,不超过50米 + searchQuery.Query = geoDistanceQuery; + + SearchRequest searchRequest = new SearchRequest(TableName, IndexName, searchQuery); + + ColumnsToGet columnsToGet = new ColumnsToGet(); + columnsToGet.Columns = new List() { Geo_type_col }; //设置返回Col_GeoPoint这一列 + searchRequest.ColumnsToGet = columnsToGet; + + SearchResponse response = client.Search(searchRequest); + Console.WriteLine(response.TotalCount); + foreach (var row in response.Rows) + { + PrintRow(row); + } + } + + + /// + /// 查询表中geo_type_col这一列的值在一个给定多边形范围内的数据。 + /// + /// + public static void GeoPolygonQuery(OTSClient client) + { + Console.WriteLine("\n Start GeoPolygon query..."); + + SearchQuery searchQuery = new SearchQuery(); + GeoPolygonQuery geoPolygonQuery = new GeoPolygonQuery(); // 设置查询类型为GeoPolygonQuery + geoPolygonQuery.FieldName = Geo_type_col; + geoPolygonQuery.Points = new List() { "0,0", "10,0", "10,10" }; // 设置多边形的顶点 + searchQuery.Query = geoPolygonQuery; + + SearchRequest searchRequest = new SearchRequest(TableName, IndexName, searchQuery); + + ColumnsToGet columnsToGet = new ColumnsToGet(); + columnsToGet.Columns = new List() { Geo_type_col }; //设置返回Col_GeoPoint这一列 + searchRequest.ColumnsToGet = columnsToGet; + + SearchResponse response = client.Search(searchRequest); + Console.WriteLine(response.TotalCount); + foreach (var row in response.Rows) + { + PrintRow(row); + } + } + } +} diff --git a/netcore-sample/Samples/SearchIndexPageSample.cs b/netcore-sample/Samples/SearchIndexPageSample.cs new file mode 100644 index 0000000..7860ac2 --- /dev/null +++ b/netcore-sample/Samples/SearchIndexPageSample.cs @@ -0,0 +1,212 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.DataModel.Search; +using Aliyun.OTS.DataModel.Search.Query; +using Aliyun.OTS.Request; +using Aliyun.OTS.Response; +using Newtonsoft.Json; + +namespace Aliyun.OTS.Samples.Samples +{ + public class SearchIndexPageSample + { + private static readonly string TableName = "SearchIndexPageSampleTable"; + private static readonly string IndexName = "SearchIndexPageSampleTableIndex"; + private static readonly string Pk0 = "pk0"; + private static readonly string Pk1 = "pk1"; + private static readonly string Long_type_col = "Long_type_col"; + private static readonly string Text_type_col = "Text_type_col"; + private static readonly string Keyword_type_col = "Keyword_type_col"; + + //static void Main(string[] args) + //{ + // OTSClient otsClient = Config.GetClient(); + // //DeleteSearchIndex(otsClient); + // //DeleteTable(otsClient); + // //CreateTable(otsClient); + // //CreateSearchIndex(otsClient); + + // ////Wait searchIndex load success + // //Console.WriteLine("wait searchIndex load success"); + // //Thread.Sleep(3 * 1000); + + // //ListSearchIndex(otsClient); + // //DescribeSearchIndex(otsClient); + // //PutRow(otsClient); + + // ////Wait searchIndex load success + // //WaiteAllDataSyncSuccess(otsClient, 7); + + // ReadMoreRowsWithToken(otsClient); + + // Console.ReadLine(); + //} + + + public static void CreateTable(OTSClient otsClient) + { + // 创建表 + Console.WriteLine("\n Start create table..."); + PrimaryKeySchema primaryKeySchema = new PrimaryKeySchema + { + { Pk0, ColumnValueType.Integer }, + { Pk1, ColumnValueType.String } + }; + TableMeta tableMeta = new TableMeta(TableName, primaryKeySchema); + + CapacityUnit reservedThroughput = new CapacityUnit(0, 0); + CreateTableRequest request = new CreateTableRequest(tableMeta, reservedThroughput); + otsClient.CreateTable(request); + + Console.WriteLine("Table is created: " + TableName); + } + + public static void DeleteTable(OTSClient otsClient) + { + DeleteTableRequest request = new DeleteTableRequest(TableName); + otsClient.DeleteTable(request); + } + + public static void ListSearchIndex(OTSClient otsClient) + { + Console.WriteLine("\n Start list searchindex..."); + + ListSearchIndexRequest request = new ListSearchIndexRequest(TableName); + ListSearchIndexResponse response = otsClient.ListSearchIndex(request); + foreach (var index in response.IndexInfos) + { + Console.WriteLine("indexname:" + index.IndexName); + Console.WriteLine("tablename:" + index.TableName); + } + } + + public static void CreateSearchIndex(OTSClient otsClient) + { + Console.WriteLine("\n Start Create searchindex..."); + + CreateSearchIndexRequest request = new CreateSearchIndexRequest(TableName, IndexName); + List FieldSchemas = new List() { + new FieldSchema(Keyword_type_col,FieldType.KEYWORD){index=true,EnableSortAndAgg=true}, + new FieldSchema(Long_type_col,FieldType.LONG){ index=true,EnableSortAndAgg=true}, + new FieldSchema(Text_type_col,FieldType.TEXT){ index=true} + }; + request.IndexSchame = new IndexSchema() + { + FieldSchemas = FieldSchemas + }; + + CreateSearchIndexResponse response = otsClient.CreateSearchIndex(request); + + Console.WriteLine("Searchindex is created: " + IndexName); + } + + public static void DescribeSearchIndex(OTSClient otsClient) + { + Console.WriteLine("\n Start Describe searchindex..."); + + DescribeSearchIndexRequest request = new DescribeSearchIndexRequest(TableName, IndexName); + + DescribeSearchIndexResponse response = otsClient.DescribeSearchIndex(request); + string serializedObjectString = JsonConvert.SerializeObject(response); + Console.WriteLine(serializedObjectString); + + } + + public static void DeleteSearchIndex(OTSClient otsClient) + { + Console.WriteLine("\n Start Delete searchindex..."); + + DeleteSearchIndexRequest request = new DeleteSearchIndexRequest(TableName, IndexName); + DeleteSearchIndexResponse response = otsClient.DeleteSearchIndex(request); + + Console.WriteLine("Searchindex is deleted:" + IndexName); + + } + + public static void PutRow(OTSClient otsClient) + { + Console.WriteLine("\n Start put row..."); + List colList = new List() { + "TableStore SearchIndex Sample", + "TableStore", + "SearchIndex", + "Sample", + "SearchIndex Sample", + "TableStore Sample", + "TableStore SearchIndex" + }; + for (int i = 0; i < 500; i++) + { + PrimaryKey primaryKey = new PrimaryKey{ + { Pk0, new ColumnValue(i) }, + { Pk1, new ColumnValue("pk1value") } + }; + var colId = i % 7; + AttributeColumns attribute = new AttributeColumns{ + { Long_type_col, new ColumnValue(i) }, + { Text_type_col, new ColumnValue(colList[colId]) }, + { Keyword_type_col, new ColumnValue(colList[colId]) } + }; + PutRowRequest request = new PutRowRequest(TableName, new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + + otsClient.PutRow(request); + } + Console.WriteLine("Put row succeed."); + } + + public static void WaiteAllDataSyncSuccess(OTSClient otsClient, int expectTotalCount) + { + Console.WriteLine("wait all rows sync success"); + int timeoutSeconds = 3 * 60; + var beginTime = DateTime.Now; + while (true) + { + var searchQuery = new SearchQuery(); + searchQuery.Query = new MatchAllQuery(); + var request = new SearchRequest(TableName, IndexName, searchQuery); + + var response = otsClient.Search(request); + if (response.TotalCount == expectTotalCount) + { + break; + } + else if ((DateTime.Now - beginTime).Seconds > timeoutSeconds) + { + throw new Exception("searchIndex sync data timeout"); + } + Thread.Sleep(1000); + } + } + + + /// + /// 查询所有行,返回行数 + /// + /// + public static SearchResponse ReadMoreRowsWithToken(OTSClient otsClient) + { + Console.WriteLine("\n Start matchAll query..."); + + var searchQuery = new SearchQuery(); + searchQuery.Query = new MatchAllQuery(); + + var request = new SearchRequest(TableName, IndexName, searchQuery); + + var response = otsClient.Search(request); + var rows = response.Rows; + while (response.NextToken != null) + { + request.SearchQuery.Token = response.NextToken; + response = otsClient.Search(request); + rows.AddRange(response.Rows); + } + + return response; + } + + } +} diff --git a/netcore-sample/Samples/SearchIndexSample.cs b/netcore-sample/Samples/SearchIndexSample.cs new file mode 100644 index 0000000..22809f3 --- /dev/null +++ b/netcore-sample/Samples/SearchIndexSample.cs @@ -0,0 +1,584 @@ +using System; +using System.Collections.Generic; +using System.Threading; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.DataModel.Search; +using Aliyun.OTS.DataModel.Search.Query; +using Aliyun.OTS.DataModel.Search.Sort; +using Aliyun.OTS.Request; +using Aliyun.OTS.Response; +using Newtonsoft.Json; + +namespace Aliyun.OTS.Samples.Samples +{ + public class SearchIndexSample + { + private static readonly string TableName = "SearchIndexSampleTable"; + private static readonly string IndexName = "SearchIndexSampleTableIndex2"; + private static readonly string Pk0 = "pk0"; + private static readonly string Pk1 = "pk1"; + private static readonly string Long_type_col = "Long_type_col"; + private static readonly string Text_type_col = "Text_type_col"; + private static readonly string Keyword_type_col = "Keyword_type_col"; + + //static void Main(string[] args) + //{ + // OTSClient otsClient = Config.GetClient(); + // //DeleteSearchIndex(otsClient); + // //DeleteTable(otsClient); + + // //创建一张TableStore表 + // CreateTable(otsClient); + // //在TableStore表上创建一个索引表 + // CreateSearchIndex(otsClient); + + // //Wait searchIndex load success + // Console.WriteLine("wait searchIndex load success"); + // Thread.Sleep(3 * 1000); + + // ListSearchIndex(otsClient); + // CreateSearchIndexWithIndexSort(otsClient); + // DescribeSearchIndex(otsClient); + // PutRow(otsClient); + + // //等待索引数据同步成功 + // WaiteAllDataSyncSuccess(otsClient, 7); + + // //MatchAll Query + // MatchAllQuery(otsClient); + + // //MatchQuery + // MatchQuery(otsClient); + + // //MatchPhraseQuery + // MatchPhraseQuery(otsClient); + + // //RangeQuery + // RangeQuery(otsClient); + + // //PrefixQuery + // PrefixQuery(otsClient); + + // //TermQuery + // TermQuery(otsClient); + + // //WildcardQuery + // WildcardQuery(otsClient); + + // //BoolQuery + // BoolQuery(otsClient); + + // Console.ReadLine(); + //} + + public static void CreateTable(OTSClient otsClient) + { + Console.WriteLine("\n Start create table..."); + PrimaryKeySchema primaryKeySchema = new PrimaryKeySchema + { + { Pk0, ColumnValueType.Integer }, + { Pk1, ColumnValueType.String } + }; + TableMeta tableMeta = new TableMeta(TableName, primaryKeySchema); + + CapacityUnit reservedThroughput = new CapacityUnit(0, 0); + CreateTableRequest request = new CreateTableRequest(tableMeta, reservedThroughput); + otsClient.CreateTable(request); + + Console.WriteLine("Table is created: " + TableName); + } + + public static void DeleteTable(OTSClient otsClient) + { + DeleteTableRequest request = new DeleteTableRequest(TableName); + otsClient.DeleteTable(request); + } + + /// + /// 列出多元索引名称 + /// + /// + public static void ListSearchIndex(OTSClient otsClient) + { + Console.WriteLine("\n Start list searchindex..."); + + ListSearchIndexRequest request = new ListSearchIndexRequest(TableName); + ListSearchIndexResponse response = otsClient.ListSearchIndex(request); + foreach (var index in response.IndexInfos) + { + Console.WriteLine("indexname:" + index.IndexName); + Console.WriteLine("tablename:" + index.TableName); + } + } + + /// + /// 创建一个多元索引,包含Keyword_type_col、Long_type_col、Text_type_col三个属性列,类型分别设置为不分词字符串(KEYWORD),整型(LONG),分词字符串(TEXT) + /// + /// + public static void CreateSearchIndex(OTSClient otsClient) + { + Console.WriteLine("\n Start Create searchindex..."); + + //指定表名和索引名 + CreateSearchIndexRequest request = new CreateSearchIndexRequest(TableName, IndexName); + List FieldSchemas = new List() { + new FieldSchema(Keyword_type_col,FieldType.KEYWORD){ //设置字段名和字段类型 + index =true, //开启索引 + EnableSortAndAgg =true //开启排序和统计功能 + }, + new FieldSchema(Long_type_col,FieldType.LONG){ index=true,EnableSortAndAgg=true}, + new FieldSchema(Text_type_col,FieldType.TEXT){ index=true} + }; + request.IndexSchame = new IndexSchema() + { + FieldSchemas = FieldSchemas + }; + + CreateSearchIndexResponse response = otsClient.CreateSearchIndex(request); + + Console.WriteLine("Searchindex is created: " + IndexName); + } + + /// + /// 创建一个多元索引,包含Keyword_type_col、Long_type_col、Text_type_col三个属性列,类型分别设置为不分词字符串(KEYWORD),整型(LONG),分词字符串(TEXT) + /// + /// + public static void CreateSearchIndexWithIndexSort(OTSClient otsClient) + { + Console.WriteLine("\n Start Create searchindex with indexSort..."); + + //指定表名和索引名 + CreateSearchIndexRequest request = new CreateSearchIndexRequest(TableName, IndexName); + List FieldSchemas = new List() { + new FieldSchema(Keyword_type_col,FieldType.KEYWORD){ //设置字段名和字段类型 + index =true, //开启索引 + EnableSortAndAgg =true //开启排序和统计功能 + }, + new FieldSchema(Long_type_col,FieldType.LONG){ index=true,EnableSortAndAgg=true}, + new FieldSchema(Text_type_col,FieldType.TEXT){ index=true} + }; + request.IndexSchame = new IndexSchema() + { + FieldSchemas = FieldSchemas, + IndexSort = new Sort(new List() + { + new FieldSort(Long_type_col,SortOrder.ASC) + }) + }; + + CreateSearchIndexResponse response = otsClient.CreateSearchIndex(request); + + Console.WriteLine("Searchindex is created: " + IndexName); + } + + /// + /// 查询多元索引的描述信息 + /// + /// + public static void DescribeSearchIndex(OTSClient otsClient) + { + Console.WriteLine("\n Start Describe searchindex..."); + + //设置表名和索引名 + DescribeSearchIndexRequest request = new DescribeSearchIndexRequest(TableName, IndexName); + + DescribeSearchIndexResponse response = otsClient.DescribeSearchIndex(request); + string serializedObjectString = JsonConvert.SerializeObject(response); + Console.WriteLine(serializedObjectString); + } + + /// + /// 删除多元索引 + /// + /// + public static void DeleteSearchIndex(OTSClient otsClient) + { + Console.WriteLine("\n Start Delete searchindex..."); + + //设置表名和索引名 + DeleteSearchIndexRequest request = new DeleteSearchIndexRequest(TableName, IndexName); + DeleteSearchIndexResponse response = otsClient.DeleteSearchIndex(request); + + Console.WriteLine("Searchindex is deleted:" + IndexName); + } + + /// + /// 通过PutRow 接口写入一些数据到TableStore,数据将自动同步到索引表 + /// + /// + public static void PutRow(OTSClient otsClient) + { + Console.WriteLine("\n Start put row..."); + List colList = new List() { + "TableStore SearchIndex Sample", + "TableStore", + "SearchIndex", + "Sample", + "SearchIndex Sample", + "TableStore Sample", + "TableStore SearchIndex" + }; + for (int i = 0; i < 7; i++) + { + PrimaryKey primaryKey = new PrimaryKey{ + { Pk0, new ColumnValue(i) }, + { Pk1, new ColumnValue("pk1value") } + }; + AttributeColumns attribute = new AttributeColumns{ + { Long_type_col, new ColumnValue(i) }, + { Text_type_col, new ColumnValue(colList[i]) }, + { Keyword_type_col, new ColumnValue(colList[i]) } + }; + PutRowRequest request = new PutRowRequest(TableName, new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + + otsClient.PutRow(request); + } + Console.WriteLine("Put row succeed."); + } + + /// + /// 等待数据同步到索引表完成 + /// + /// + /// + public static void WaiteAllDataSyncSuccess(OTSClient otsClient, int expectTotalCount) + { + Console.WriteLine("wait all rows sync success"); + int timeoutSeconds = 3 * 60; + var beginTime = DateTime.Now; + while (true) + { + var searchQuery = new SearchQuery(); + searchQuery.GetTotalCount = true; + searchQuery.Query = new MatchAllQuery(); + var request = new SearchRequest(TableName, IndexName, searchQuery); + + var response = otsClient.Search(request); + if (response.TotalCount == expectTotalCount) + { + break; + } + else if ((DateTime.Now - beginTime).Seconds > timeoutSeconds) + { + throw new Exception("searchIndex sync data timeout"); + } + Thread.Sleep(1000); + } + } + + private static string PrintColumnValue(ColumnValue value) + { + switch (value.Type) + { + case ColumnValueType.String: return value.StringValue; + case ColumnValueType.Integer: return value.IntegerValue.ToString(); + case ColumnValueType.Boolean: return value.BooleanValue.ToString(); + case ColumnValueType.Double: return value.DoubleValue.ToString(); + case ColumnValueType.Binary: return value.BinaryValue.ToString(); + } + + throw new Exception("Unknow type."); + } + + private static void PrintRow(Row row) + { + PrimaryKey primaryKeyRead = row.PrimaryKey; + AttributeColumns attributesRead = row.AttributeColumns; + + Console.WriteLine("Primary key: "); + foreach (KeyValuePair entry in primaryKeyRead) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + + Console.WriteLine("Attributes: "); + foreach (KeyValuePair entry in attributesRead) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + } + + /// + /// 查询所有行,返回行数 + /// + /// + public static void MatchAllQuery(OTSClient otsClient) + { + Console.WriteLine("\n Start matchAll query..."); + + var searchQuery = new SearchQuery(); + searchQuery.Query = new MatchAllQuery(); + searchQuery.GetTotalCount = true; // 需要设置GetTotalCount = true 才会返回满足条件的数据总行数 + /* + * MatchAllQuery 结果中的Totalcount可以表示数据的总行数(数据量很大时为估算值) + * 如果只是为了查询TotalHit,可以设置limit=0,即不返回任意一行数据。 + */ + searchQuery.Limit = 0; + var request = new SearchRequest(TableName, IndexName, searchQuery); + + var response = otsClient.Search(request); + + Console.WriteLine("IsAllSuccess:" + response.IsAllSuccess); + Console.WriteLine("Total Count:" + response.TotalCount); + } + + + /// + /// 模糊匹配和短语或邻近查询,返回指定列 + /// + /// + public static void MatchQuery(OTSClient otsClient) + { + Console.WriteLine("\n Start match query..."); + + var searchQuery = new SearchQuery(); + searchQuery.Query = new MatchQuery(Text_type_col, "SearchIndex"); + searchQuery.GetTotalCount = true; + var request = new SearchRequest(TableName, IndexName, searchQuery); + searchQuery.Sort = new Sort(new List() { new ScoreSort() }); + request.ColumnsToGet = new ColumnsToGet() + { + Columns = new List() { Long_type_col, Text_type_col, Keyword_type_col } + }; + + var response = otsClient.Search(request); + + Console.WriteLine("Total Count:" + response.TotalCount); + foreach (var row in response.Rows) + { + PrintRow(row); + } + } + + /// + /// 类似MatchQuery(MatchQuery 仅匹配某个词即可),但是 MatchPhraseQuery会匹配所有的短语。 + /// + /// + public static void MatchPhraseQuery(OTSClient otsClient) + { + Console.WriteLine("\n Start MatchPhrase query..."); + + var searchQuery = new SearchQuery(); + searchQuery.Query = new MatchPhraseQuery(Text_type_col, "TableStore SearchIndex"); + searchQuery.GetTotalCount = true; + var request = new SearchRequest(TableName, IndexName, searchQuery); + request.ColumnsToGet = new ColumnsToGet() + { + Columns = new List() { Long_type_col, Text_type_col, Keyword_type_col } + }; + + var response = otsClient.Search(request); + + Console.WriteLine("Total Count:" + response.TotalCount); + foreach (var row in response.Rows) + { + PrintRow(row); + } + } + + /// + /// 范围查询。通过设置一个范围(from,to),查询该范围内的所有数据。 + /// + /// + public static void RangeQuery(OTSClient otsClient) + { + Console.WriteLine("\n Start range query..."); + + var searchQuery = new SearchQuery(); + searchQuery.GetTotalCount = true; + var rangeQuery = new RangeQuery(Long_type_col, new ColumnValue(0), new ColumnValue(6)); + //包括下边界(大于等于0) + rangeQuery.IncludeLower = true; + searchQuery.Query = rangeQuery; + var request = new SearchRequest(TableName, IndexName, searchQuery); + var response = otsClient.Search(request); + + Console.WriteLine("Total Count:" + response.TotalCount); + foreach (var row in response.Rows) + { + PrintRow(row); + } + } + + + /// + /// 前缀查询。 + /// + /// + public static void PrefixQuery(OTSClient otsClient) + { + Console.WriteLine("\n Start prefix query..."); + + var searchQuery = new SearchQuery(); + searchQuery.Query = new PrefixQuery(Keyword_type_col, "Search"); + searchQuery.GetTotalCount = true; + var request = new SearchRequest(TableName, IndexName, searchQuery); + request.ColumnsToGet = new ColumnsToGet() + { + ReturnAll = true + }; + + var response = otsClient.Search(request); + + Console.WriteLine("Total Count:" + response.TotalCount); + foreach (var row in response.Rows) + { + PrintRow(row); + } + } + + /// + /// 精确的term查询 + /// + /// + public static void TermQuery(OTSClient otsClient) + { + Console.WriteLine("\n Start term query..."); + + var searchQuery = new SearchQuery(); + searchQuery.GetTotalCount = true; + searchQuery.Query = new TermQuery(Keyword_type_col, new ColumnValue("SearchIndex")); + + var request = new SearchRequest(TableName, IndexName, searchQuery); + request.ColumnsToGet = new ColumnsToGet() + { + ReturnAll = true + }; + + var response = otsClient.Search(request); + + Console.WriteLine("Total Count:" + response.TotalCount); + foreach (var row in response.Rows) + { + PrintRow(row); + } + } + + /// + /// 精确的terms查询,查询Keyword_type_col这一列精确匹配"TableStore"或者"SearchIndex"的数据 + /// TermsQuery可以使用多个Term同时查询 + /// + /// + public static void TermsQuery(OTSClient otsClient) + { + Console.WriteLine("\n Start terms query..."); + + var searchQuery = new SearchQuery(); + searchQuery.GetTotalCount = true; + var query = new TermsQuery(); + query.FieldName = Keyword_type_col; + query.Terms = new List() { new ColumnValue("TableStore"), new ColumnValue("SearchIndex") }; + + var request = new SearchRequest(TableName, IndexName, searchQuery); + request.ColumnsToGet = new ColumnsToGet() + { + ReturnAll = true + }; + + var response = otsClient.Search(request); + + Console.WriteLine("Total Count:" + response.TotalCount); + foreach (var row in response.Rows) + { + PrintRow(row); + } + } + + + + /// + ///通配符查询。支持 *( 任意0或多个)和 ?(任意1个字符)。 + /// + /// + public static void WildcardQuery(OTSClient otsClient) + { + Console.WriteLine("\n Start wildcard query..."); + + var searchQuery = new SearchQuery(); + searchQuery.Query = new WildcardQuery(Keyword_type_col, "*Search*"); + searchQuery.GetTotalCount = true; + var request = new SearchRequest(TableName, IndexName, searchQuery); + request.ColumnsToGet = new ColumnsToGet() + { + ReturnAll = true + }; + + var response = otsClient.Search(request); + + Console.WriteLine("Total Count:" + response.TotalCount); + foreach (var row in response.Rows) + { + PrintRow(row); + } + } + + /// + ///联合查询(复杂查询条件下用的最多的一个查询)。Bool查询由一个或者多个子句组成,每个子句都有特定的类型。 + ///must: 文档必须完全匹配条件 + ///should: should下面会带一个以上的条件,至少满足一个条件,这个文档就符合should + ///must_not: 文档必须不匹配条件 + ///MinimumShouldMatch: should查询的条件至少满足几个 + /// + /// + public static void BoolQuery(OTSClient otsClient) + { + Console.WriteLine("\n Start bool query..."); + + var searchQuery = new SearchQuery(); + searchQuery.GetTotalCount = true; + var boolQuery = new BoolQuery(); + var shouldQuerys = new List(); + shouldQuerys.Add(new TermQuery(Keyword_type_col, new ColumnValue("SearchIndex"))); + shouldQuerys.Add(new TermQuery(Keyword_type_col, new ColumnValue("TableStore"))); + boolQuery.ShouldQueries = shouldQuerys; + boolQuery.MinimumShouldMatch = 1; + + searchQuery.Query = boolQuery; + + var request = new SearchRequest(TableName, IndexName, searchQuery); + request.ColumnsToGet = new ColumnsToGet() + { + ReturnAll = true + }; + + var response = otsClient.Search(request); + + Console.WriteLine("Total Count:" + response.TotalCount); + foreach (var row in response.Rows) + { + PrintRow(row); + } + } + + /// + /// 有一个类型为NESTED的列,子文档包含nested_1和nested_2两列,现在查询col1_nested.nested_1为"tablestore"的数据 + /// + /// + public static void NestedQuery(OTSClient otsClient) + { + Console.WriteLine("\n Start bool query..."); + + var searchQuery = new SearchQuery(); + searchQuery.GetTotalCount = true; + var nestedQuery = new NestedQuery(); + nestedQuery.Path = "col1_nested"; //设置nested字段路径 + TermQuery termQuery = new TermQuery("col1_nested.nested_1",new ColumnValue("tablestore"));//构造NestedQuery的子查询 + nestedQuery.Query = termQuery; + nestedQuery.ScoreMode = ScoreMode.None; + + var request = new SearchRequest(TableName, IndexName, searchQuery); + request.ColumnsToGet = new ColumnsToGet() + { + ReturnAll = true + }; + + var response = otsClient.Search(request); + + Console.WriteLine("Total Count:" + response.TotalCount); + foreach (var row in response.Rows) + { + PrintRow(row); + } + } + } +} diff --git a/netcore-sample/Samples/SingleRowReadWriteSample.cs b/netcore-sample/Samples/SingleRowReadWriteSample.cs new file mode 100644 index 0000000..c5300d8 --- /dev/null +++ b/netcore-sample/Samples/SingleRowReadWriteSample.cs @@ -0,0 +1,239 @@ +using System; +using System.Collections.Generic; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.Request; +using Aliyun.OTS.Response; +using Aliyun.OTS.DataModel.ConditionalUpdate; +using System.Threading.Tasks; + +namespace Aliyun.OTS.Samples +{ + public static class SingleRowReadWriteSample + { + + private static readonly string TableName = "singleRowReadWriteSample"; + + private static void PrepareTable() + { + // 创建表 + OTSClient otsClient = Config.GetClient(); + + IList tables = otsClient.ListTable(new ListTableRequest()).TableNames; + if (tables.Contains(TableName)) { + return; + } + + + PrimaryKeySchema primaryKeySchema = new PrimaryKeySchema + { + { "pk0", ColumnValueType.Integer }, + { "pk1", ColumnValueType.String } + }; + TableMeta tableMeta = new TableMeta(TableName, primaryKeySchema); + + CapacityUnit reservedThroughput = new CapacityUnit(0, 0); + CreateTableRequest request = new CreateTableRequest(tableMeta, reservedThroughput); + otsClient.CreateTable(request); + + } + + public static void PutRow() + { + Console.WriteLine("Start put row..."); + PrepareTable(); + OTSClient otsClient = Config.GetClient(); + + // 定义行的主键,必须与创建表时的TableMeta中定义的一致 + PrimaryKey primaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(0) }, + { "pk1", new ColumnValue("abc") } + }; + + // 定义要写入该行的属性列 + AttributeColumns attribute = new AttributeColumns + { + { "col0", new ColumnValue(0) }, + { "col1", new ColumnValue("a") }, + { "col2", new ColumnValue(true) } + }; + PutRowRequest request = new PutRowRequest(TableName, new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + + otsClient.PutRow(request); + Console.WriteLine("Put row succeed."); + } + + public static void PutRowAsync() + { + Console.WriteLine("Start put row async..."); + PrepareTable(); + OTSClient TabeStoreClient = Config.GetClient(); + + try + { + var putRowTaskList = new List>(); + for (int i = 0; i < 100; i++) + { + // 定义行的主键,必须与创建表时的TableMeta中定义的一致 + var primaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(i) }, + { "pk1", new ColumnValue("abc") } + }; + + // 定义要写入改行的属性列 + var attribute = new AttributeColumns + { + { "col0", new ColumnValue(i) }, + { "col1", new ColumnValue("a") }, + { "col2", new ColumnValue(true) } + }; + + var request = new PutRowRequest(TableName, new Condition(RowExistenceExpectation.IGNORE), + primaryKey, attribute); + + putRowTaskList.Add(TabeStoreClient.PutRowAsync(request)); + } + + foreach (var task in putRowTaskList) + { + task.Wait(); + Console.WriteLine("consumed read:{0}, write:{1}", task.Result.ConsumedCapacityUnit.Read, + task.Result.ConsumedCapacityUnit.Write); + } + + Console.WriteLine("Put row async succeeded."); + } + catch (Exception ex) + { + Console.WriteLine("Put row async failed. exception:{0}", ex.Message); + } + } + + public static void UpdateRow() + { + Console.WriteLine("Start update row..."); + PrepareTable(); + OTSClient otsClient = Config.GetClient(); + + // 定义行的主键,必须与创建表时的TableMeta中定义的一致 + PrimaryKey primaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(0) }, + { "pk1", new ColumnValue("abc") } + }; + + // 定义要写入该行的属性列 + UpdateOfAttribute attribute = new UpdateOfAttribute(); + attribute.AddAttributeColumnToPut("col0", new ColumnValue(0)); + attribute.AddAttributeColumnToPut("col1", new ColumnValue("b")); // 将原先的值'a'改为'b' + attribute.AddAttributeColumnToPut("col2", new ColumnValue(true)); + UpdateRowRequest request = new UpdateRowRequest(TableName, new Condition(RowExistenceExpectation.IGNORE), primaryKey, attribute); + + otsClient.UpdateRow(request); + Console.WriteLine("Update row succeed."); + } + + private static string PrintColumnValue(ColumnValue value) + { + switch(value.Type) + { + case ColumnValueType.String: return value.StringValue; + case ColumnValueType.Integer: return value.IntegerValue.ToString(); + case ColumnValueType.Boolean: return value.BooleanValue.ToString(); + case ColumnValueType.Double: return value.DoubleValue.ToString(); + case ColumnValueType.Binary: return value.BinaryValue.ToString(); + } + + throw new Exception("Unknow type."); + } + + public static void GetRow() + { + Console.WriteLine("Start get row..."); + PrepareTable(); + OTSClient otsClient = Config.GetClient(); + + // 定义行的主键,必须与创建表时的TableMeta中定义的一致 + PrimaryKey primaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(0) }, + { "pk1", new ColumnValue("abc") } + }; + + GetRowRequest request = new GetRowRequest(TableName, primaryKey); // 未指定读哪列,默认读整行 + GetRowResponse response = otsClient.GetRow(request); + PrimaryKey primaryKeyRead = response.PrimaryKey; + AttributeColumns attributesRead = response.Attribute; + + Console.WriteLine("Primary key read: "); + foreach(KeyValuePair entry in primaryKeyRead) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + + Console.WriteLine("Attributes read: "); + foreach (KeyValuePair entry in attributesRead) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + + Console.WriteLine("Get row succeed."); + } + + public static void GetRowWithFilter() + { + Console.WriteLine("Start get row with filter ..."); + PrepareTable(); + OTSClient otsClient = Config.GetClient(); + + // 定义行的主键,必须与创建表时的TableMeta中定义的一致 + PrimaryKey primaryKey = new PrimaryKey + { + { "pk0", new ColumnValue(0) }, + { "pk1", new ColumnValue("abc") } + }; + + var rowQueryCriteria = new SingleRowQueryCriteria(TableName) + { + RowPrimaryKey = primaryKey + }; + + // 只返回col0的值等于5的行或者col1不等于ff的行 + var filter1 = new RelationalCondition("col0", + CompareOperator.EQUAL, + new ColumnValue(5)); + + var filter2 = new RelationalCondition("col1", CompareOperator.NOT_EQUAL, new ColumnValue("ff")); + + var filter = new CompositeCondition(LogicOperator.OR); + filter.AddCondition(filter1); + filter.AddCondition(filter2); + + rowQueryCriteria.Filter = filter.ToFilter(); + rowQueryCriteria.AddColumnsToGet("col0"); + rowQueryCriteria.AddColumnsToGet("col1"); + + GetRowRequest request = new GetRowRequest(rowQueryCriteria); + + // 查询 + GetRowResponse response = otsClient.GetRow(request); + PrimaryKey primaryKeyRead = response.PrimaryKey; + AttributeColumns attributesRead = response.Attribute; + + Console.WriteLine("Primary key read: "); + foreach (KeyValuePair entry in primaryKeyRead) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + + Console.WriteLine("Attributes read: "); + foreach (KeyValuePair entry in attributesRead) + { + Console.WriteLine(entry.Key + ":" + PrintColumnValue(entry.Value)); + } + + Console.WriteLine("Get row with filter succeed."); + } + } +} diff --git a/netcore-sample/aliyun-tablestore-netcore-sdk-sample.csproj b/netcore-sample/aliyun-tablestore-netcore-sdk-sample.csproj new file mode 100644 index 0000000..dc44945 --- /dev/null +++ b/netcore-sample/aliyun-tablestore-netcore-sdk-sample.csproj @@ -0,0 +1,17 @@ + + + + Exe + netcoreapp3.1 + aliyun_tablestore_netcore_sdk_sample + + + + + + + + + + + diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/AttributeColumns.cs b/netstandard-sdk/Aliyun/OTS/DataModel/AttributeColumns.cs new file mode 100644 index 0000000..3ca4b82 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/AttributeColumns.cs @@ -0,0 +1,99 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel +{ + /// + /// 表示若干属性列组成的属性。可以使用Add方法指定列名和列值来添加属性列。 + /// + public class AttributeColumns : Dictionary + { + /// + /// 某些列会有多个版本的数据,需要把这些数据保存下来 + /// + private readonly Dictionary> multiVersionColumns = new Dictionary>(); + + public static Dictionary ParseColumnArray(Column[] columns) + { + AttributeColumns keyValuePairs = new AttributeColumns(); + foreach(var column in columns) + { + keyValuePairs.Add(column); + } + + return keyValuePairs; + } + + public void Add(Column column) + { + if (!this.ContainsKey(column.Name)) + { + this.Add(column.Name, column.Value); + } + else + { + if(!this.multiVersionColumns.ContainsKey(column.Name)) + { + this.multiVersionColumns.Add(column.Name, new List()); + } + + this.multiVersionColumns[column.Name].Add(column.Value); + } + } + + /// + /// 得到某一列的多个版本的值 + /// + /// The all column values. + /// Column name. + public List GetAllColumnValues(string columnName) + { + List columnValues = new List(); + if(this.ContainsKey(columnName)) + { + columnValues.Add(this[columnName]); + } + + if(this.multiVersionColumns.ContainsKey(columnName)) + { + columnValues.AddRange(this.multiVersionColumns[columnName]); + } + + return columnValues; + } + + /// + /// 得到所有返回值的版本 + /// + /// The all attribute columns. + public Dictionary> GetAllAttributeColumns() + { + Dictionary> attributeColumns = new Dictionary>(); + + foreach(var key in this.Keys) + { + if(attributeColumns.ContainsKey(key)) + { + attributeColumns[key].AddRange(this.multiVersionColumns[key]); + } + else + { + attributeColumns.Add(key, new List()); + attributeColumns[key].Add(this[key]); + } + } + + return attributeColumns; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/BloomFilterType.cs b/netstandard-sdk/Aliyun/OTS/DataModel/BloomFilterType.cs new file mode 100644 index 0000000..5091968 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/BloomFilterType.cs @@ -0,0 +1,9 @@ +namespace Aliyun.OTS.DataModel +{ + public enum BloomFilterType + { + NONE = 1, + CELL = 2, + ROW = 3, + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/CapacityUnit.cs b/netstandard-sdk/Aliyun/OTS/DataModel/CapacityUnit.cs new file mode 100644 index 0000000..093bfc8 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/CapacityUnit.cs @@ -0,0 +1,48 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +namespace Aliyun.OTS.DataModel +{ + /// + /// CapacityUnit(读写能力单元)是OTS用来计量的单位。 + /// + /// 请参见:阿里云官网关于读写能力单元的描述。 + /// + /// + public class CapacityUnit + { + /// + /// 读能力单元 + /// + public int? Read { get; set; } + + /// + /// 写能力单元 + /// + public int? Write { get; set; } + + /// + /// CapacityUnit的构造函数。 + /// + /// 当UpdateRow指定预留读写吞吐量时,读和写预留吞吐量可以指定其中一个,表示只调节一个值;也可以两个都指定。 + /// 其他情况下构造CapacityUnit必须同时指定read和write参数。 + /// + /// + /// 读能力单元 + /// 写能力单元 + public CapacityUnit(int? read = null, int? write = null) + { + Read = read; + Write = write; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Column.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Column.cs new file mode 100644 index 0000000..bff4c43 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Column.cs @@ -0,0 +1,69 @@ +using System; +using Aliyun.OTS.Util; +namespace Aliyun.OTS.DataModel +{ + /** + * TableStore中每行数据都包含主键({@link PrimaryKey}), + * 主键由多列主键列构成({@link PrimaryKeyColumn}), + * 每一个主键列包含主键列名称和主键列的值{@link PrimaryKeyValue}。 + */ + public class Column: PrimaryKeyColumn + { + /// + /// 序列化后占用的数据大小 + /// + private int dataSize = -1; + + /// + /// 属性列的时间戳 + /// + public long? Timestamp { get; set; } + + public static NameTimestampComparator NAME_TIMESTAMP_COMPARATOR = new NameTimestampComparator(); + + /// + /// 根据指定的主键列的名称和主键列的值构造主键列。 + ///

主键列的名称不能为null pointer及空字符串。

+ ///

主键列的值不能为null pointer。

+ ///
+ /// 列名 + /// 列值 + public Column(string name, ColumnValue columnValue):base(name, columnValue) + { + } + + /// + /// 构造一个属性列,必须包含名称、值和时间戳。 + ///

属性列的名称不能为null pointer及空字符串。

+ ///

属性列的值不能为null pointer。

+ ///
+ /// 列名 + /// 列值 + /// 列的时间戳 + public Column(String name, ColumnValue columnValue, long timestamp):this(name, columnValue) + { + this.Timestamp = timestamp; + } + + public new int GetDataSize() + { + if (dataSize == -1) + { + int size = OtsUtils.CalcStringSizeInBytes(Name) + Value.GetDataSize(); + if (this.Timestamp.HasValue) + { + size += 8; + } + + dataSize = size; + } + + return dataSize; + } + + public override string ToString() + { + return "'" + Name + "':" + Value + "," + Timestamp; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/ColumnValue.cs b/netstandard-sdk/Aliyun/OTS/DataModel/ColumnValue.cs new file mode 100644 index 0000000..8f5a2ef --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/ColumnValue.cs @@ -0,0 +1,297 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; +using com.alicloud.openservices.tablestore.core.protocol; +using System.IO; +using Aliyun.OTS.Util; + +namespace Aliyun.OTS.DataModel +{ + /// + /// 表示一个列值,包含类型和值。 + /// + public class ColumnValue : IComparable, IMeasurable + { + /// + /// 表示一个最大值(不分类型) + /// + public readonly static ColumnValue INF_MAX = new ColumnValue("INF_MAX"); + + /// + /// 表示一个最小值(不分类型) + /// + public readonly static ColumnValue INF_MIN = new ColumnValue("INF_MIN"); + + /// + /// 表示一个自增值(不分类型) + /// + public readonly static ColumnValue AUTO_INCREMENT = new ColumnValue("AUTO_INCREMENT"); + + /// + /// 列值的类型 + /// + public ColumnValueType Type { get; private set; } + + public Int64 IntegerValue; + public string StringValue; + public bool BooleanValue = true; + public double DoubleValue; + public byte[] BinaryValue; + + private ColumnValue() + { + } + + /// + /// 构造一个整数类型的列值。 + /// + /// + public ColumnValue(Int64 value) + { + Type = ColumnValueType.Integer; + IntegerValue = value; + } + + public ColumnValue(ulong value) + { + Type = ColumnValueType.Integer; + IntegerValue = (Int64)value; + } + + /// + /// 构造一个字符串类型的列值。 + /// + /// + public ColumnValue(string value) + { + Type = ColumnValueType.String; + StringValue = value; + } + + /// + /// 构造一个布尔类型的列值。 + /// + /// + public ColumnValue(bool value) + { + Type = ColumnValueType.Boolean; + BooleanValue = value; + } + + /// + /// 构造一个浮点类型的列值。 + /// + /// + public ColumnValue(double value) + { + Type = ColumnValueType.Double; + DoubleValue = value; + } + + /// + /// 构造一个二进制串类型的列值。 + /// + /// + public ColumnValue(byte[] value) + { + Type = ColumnValueType.Binary; + BinaryValue = value; + } + + /// + /// 这个column value是否可以为 primary key value + /// + /// true, column value类型可以成为primary key, false otherwise. + public bool CanBePrimaryKeyValue() + { + switch (this.Type) + { + case ColumnValueType.String: + case ColumnValueType.Integer: + case ColumnValueType.Binary: + return true; + default: + return false; + } + } + + public byte[] AsStringInBytes() + { + return System.Text.Encoding.UTF8.GetBytes(this.StringValue); + } + + public bool IsInfMin() + { + return this.StringValue == "INF_MIN"; + } + + public bool IsInfMax() + { + return this.StringValue == "INF_MAX"; + } + + public bool IsPlaceHolderForAutoIncr() + { + return this.StringValue == "AUTO_INCREMENT"; + } + + /// + /// 采用crc8算法得到一个checksum,主要用于计算cell的checksum + /// + /// The checksum. + /// Crc. + public byte GetChecksum(byte crc) + { + if (IsInfMin()) + { + crc = PlainBufferCrc8.crc8(crc, PlainBufferConsts.VT_INF_MIN); + return crc; + } + + if (IsInfMax()) + { + crc = PlainBufferCrc8.crc8(crc, PlainBufferConsts.VT_INF_MAX); + return crc; + } + + if (IsPlaceHolderForAutoIncr()) + { + crc = PlainBufferCrc8.crc8(crc, PlainBufferConsts.VT_AUTO_INCREMENT); + return crc; + } + + switch (this.Type) + { + case ColumnValueType.String: + { + byte[] rawData = AsStringInBytes(); + crc = PlainBufferCrc8.crc8(crc, PlainBufferConsts.VT_STRING); + crc = PlainBufferCrc8.crc8(crc, rawData.Length); + crc = PlainBufferCrc8.crc8(crc, rawData); + break; + } + case ColumnValueType.Integer: + { + crc = PlainBufferCrc8.crc8(crc, PlainBufferConsts.VT_INTEGER); + crc = PlainBufferCrc8.crc8(crc, (long)this.IntegerValue); + break; + } + case ColumnValueType.Binary: + { + byte[] rawData = this.BinaryValue; + crc = PlainBufferCrc8.crc8(crc, PlainBufferConsts.VT_BLOB); + crc = PlainBufferCrc8.crc8(crc, rawData.Length); + crc = PlainBufferCrc8.crc8(crc, rawData); + break; + } + case ColumnValueType.Double: + { + crc = PlainBufferCrc8.crc8(crc, PlainBufferConsts.VT_DOUBLE); + crc = PlainBufferCrc8.crc8(crc, BitConverter.DoubleToInt64Bits(this.DoubleValue)); + break; + } + case ColumnValueType.Boolean: + { + crc = PlainBufferCrc8.crc8(crc, PlainBufferConsts.VT_BOOLEAN); + crc = PlainBufferCrc8.crc8(crc, this.BooleanValue ? (byte)0x1 : (byte)0x0); + break; + } + default: + throw new IOException("Bug: unsupported column type: " + this.Type); + } + + return crc; + } + + public int GetDataSize() + { + int dataSize = 0; + switch (this.Type) + { + case ColumnValueType.Integer: + dataSize = 8; + break; + case ColumnValueType.String: + + dataSize = this.StringValue == null ? 0 : OtsUtils.CalcStringSizeInBytes(this.StringValue); + break; + case ColumnValueType.Binary: + dataSize = this.BinaryValue.Length; + break; + case ColumnValueType.Double: + dataSize = 8; + break; + case ColumnValueType.Boolean: + dataSize = 1; + break; + default: + throw new TypeLoadException("Bug: not support the type : " + this.Type); + } + + return dataSize; + } + + public int CompareTo(Object obj) + { + var target = obj as ColumnValue; + + if (this.Type != target.Type) + { + throw new ArgumentException("The type of column to compare must be the same."); + } + + switch (this.Type) + { + case ColumnValueType.String: + return string.Compare(this.StringValue, target.StringValue, StringComparison.Ordinal); + case ColumnValueType.Integer: + return this.IntegerValue.CompareTo(target.IntegerValue); + case ColumnValueType.Binary: + int ret = OtsUtils.CompareByteArrayInLexOrder(this.BinaryValue, 0, this.BinaryValue.Length, target.BinaryValue, 0, target.BinaryValue.Length); + return ret; + case ColumnValueType.Double: + return this.DoubleValue.CompareTo(target.DoubleValue); + case ColumnValueType.Boolean: + return this.BooleanValue.CompareTo(target.BooleanValue); + default: + throw new ArgumentException("Unknown type: " + this.Type); + } + } + + public override string ToString() + { + string result = ""; + switch (Type) + { + case ColumnValueType.String: + result = StringValue + "(string)"; + break; + case ColumnValueType.Integer: + result = IntegerValue + "(int)"; + break; + case ColumnValueType.Binary: + result = BinaryValue + "(binary)"; + break; + case ColumnValueType.Double: + result = DoubleValue + "(double)"; + break; + case ColumnValueType.Boolean: + result = BooleanValue + "(boolean)"; + break; + default: + throw new ArgumentException("Unknown type: " + this.Type); + } + + return result; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/ColumnValueType.cs b/netstandard-sdk/Aliyun/OTS/DataModel/ColumnValueType.cs new file mode 100644 index 0000000..2e3e827 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/ColumnValueType.cs @@ -0,0 +1,33 @@ +namespace Aliyun.OTS.DataModel +{ + /// + /// 列值的类型枚举定义 + /// + public enum ColumnValueType + { + /// + /// 整数类型 + /// + Integer = 1, + + /// + /// 字符串类型 + /// + String = 2, + + /// + /// 二进制串类型 + /// + Binary = 3, + + /// + /// 布尔类型 + /// + Boolean, + + /// + /// 浮点数类型 + /// + Double, + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/CompareOperator.cs b/netstandard-sdk/Aliyun/OTS/DataModel/CompareOperator.cs new file mode 100644 index 0000000..ec3538b --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/CompareOperator.cs @@ -0,0 +1,7 @@ +namespace Aliyun.OTS.DataModel +{ + public enum CompareOperator + { + EQUAL, NOT_EQUAL, GREATER_THAN, GREATER_EQUAL, LESS_THAN, LESS_EQUAL + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Condition.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Condition.cs new file mode 100644 index 0000000..dab4bbe --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Condition.cs @@ -0,0 +1,36 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using Aliyun.OTS.DataModel.ConditionalUpdate; + +namespace Aliyun.OTS.DataModel +{ + /// + /// 写操作(包括、 + /// ) + /// 的检查条件。当检查条件满足时,响应的操作才会执行;否则操作出错。 + /// + public class Condition + { + /// + /// condition update的新接口 + /// + public RowExistenceExpectation RowExistenceExpect { get; set; } + public IColumnCondition ColumnCondition { get; set; } + + public Condition() { } + + public Condition(RowExistenceExpectation rowExist) + { + RowExistenceExpect = rowExist; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/ColumnCondition.cs b/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/ColumnCondition.cs new file mode 100644 index 0000000..bbd2540 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/ColumnCondition.cs @@ -0,0 +1,7 @@ +namespace Aliyun.OTS.DataModel.ConditionalUpdate +{ + public interface ColumnCondition + { + ColumnConditionType GetType(); + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/ColumnConditionType.cs b/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/ColumnConditionType.cs new file mode 100644 index 0000000..1953bb5 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/ColumnConditionType.cs @@ -0,0 +1,8 @@ +namespace Aliyun.OTS.DataModel.ConditionalUpdate +{ + public enum ColumnConditionType + { + COMPOSITE_CONDITION, + RELATIONAL_CONDITION // same as SINGLE_COLUMN_VALUE_CONDITION + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/CompositeCondition.cs b/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/CompositeCondition.cs new file mode 100644 index 0000000..46466b8 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/CompositeCondition.cs @@ -0,0 +1,54 @@ +using System.Collections.Generic; +using Google.ProtocolBuffers; +using Aliyun.OTS.DataModel.Filter; + +namespace Aliyun.OTS.DataModel.ConditionalUpdate +{ + public class CompositeCondition : IColumnCondition + { + private List subConditions; + + public LogicOperator LogicOperator { get; set; } + + public List SubConditions + { + get { return subConditions; } + } + + public CompositeCondition(LogicOperator logicOperator) + { + LogicOperator = logicOperator; + subConditions = new List(); + } + + public CompositeCondition AddCondition(IColumnCondition condition) + { + subConditions.Add(condition); + return this; + } + + public void Clear() { subConditions.Clear(); } + + public ColumnConditionType GetConditionType() + { + return ColumnConditionType.COMPOSITE_CONDITION; + } + + public ByteString Serialize() + { + return ToFilter().Serialize(); + } + + public IFilter ToFilter() + { + CompositeColumnValueFilter compositeColumnValueFilter = new CompositeColumnValueFilter(LogicOperator); + + foreach (IColumnCondition condition in SubConditions) + { + compositeColumnValueFilter.AddFilter(condition.ToFilter()); + } + + return compositeColumnValueFilter; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/IColumnCondition.cs b/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/IColumnCondition.cs new file mode 100644 index 0000000..c099196 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/IColumnCondition.cs @@ -0,0 +1,12 @@ +using Google.ProtocolBuffers; +using Aliyun.OTS.DataModel.Filter; + +namespace Aliyun.OTS.DataModel.ConditionalUpdate +{ + public interface IColumnCondition + { + ColumnConditionType GetConditionType(); + ByteString Serialize(); + IFilter ToFilter(); + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/RelationalCondition.cs b/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/RelationalCondition.cs new file mode 100644 index 0000000..8290b35 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/ConditionalUpdate/RelationalCondition.cs @@ -0,0 +1,46 @@ +using Google.ProtocolBuffers; +using Aliyun.OTS.DataModel.Filter; + +namespace Aliyun.OTS.DataModel.ConditionalUpdate +{ + public class RelationalCondition : IColumnCondition + { + public CompareOperator Operator { get; set; } + public string ColumnName { get;set;} + public ColumnValue ColumnValue { get; set; } + public bool PassIfMissing {get;set;} + public bool LatestVersionsOnly { get; set; } + + public RelationalCondition(string columnName, CompareOperator oper, ColumnValue columnValue) + { + Operator = oper; + ColumnName = columnName; + ColumnValue = columnValue; + PassIfMissing = true; + LatestVersionsOnly = true; + } + + public ColumnConditionType GetConditionType() + { + return ColumnConditionType.RELATIONAL_CONDITION; + } + + public ByteString Serialize() + { + + return ToFilter().Serialize(); + } + + public IFilter ToFilter() + { + + SingleColumnValueFilter singleColumnValueFilter = new SingleColumnValueFilter(ColumnName, Operator, ColumnValue) + { + LatestVersionsOnly = LatestVersionsOnly, + PassIfMissing = PassIfMissing + }; + + return singleColumnValueFilter; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/DefinedColumnSchema.cs b/netstandard-sdk/Aliyun/OTS/DataModel/DefinedColumnSchema.cs new file mode 100644 index 0000000..ccd5ff8 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/DefinedColumnSchema.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel +{ + public class DefinedColumnSchema : List> + { + /// + /// 添加一个预定义列的设计 + /// + /// + /// + public void Add(string name, DefinedColumnType type) + { + var tuple = new Tuple(name, type); + + Add(tuple); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/DefinedColumnType.cs b/netstandard-sdk/Aliyun/OTS/DataModel/DefinedColumnType.cs new file mode 100644 index 0000000..661c602 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/DefinedColumnType.cs @@ -0,0 +1,15 @@ +namespace Aliyun.OTS.DataModel +{ + public enum DefinedColumnType + { + INTEGER, + + DOUBLE, + + BOOLEAN, + + STRING, + + BINARY + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Filter/ColumnPaginationFilter.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Filter/ColumnPaginationFilter.cs new file mode 100644 index 0000000..0d0414d --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Filter/ColumnPaginationFilter.cs @@ -0,0 +1,35 @@ +using System; +using Google.ProtocolBuffers; +using PB = com.alicloud.openservices.tablestore.core.protocol; + +namespace Aliyun.OTS.DataModel.Filter +{ + public class ColumnPaginationFilter : IFilter + { + public int Limit { get; set; } + public int Offset { get; set; } + + public ColumnPaginationFilter(int limit) : this(limit, 0) + { + } + + public ColumnPaginationFilter(int limit, int offset) + { + this.Limit = limit; + this.Offset = offset; + } + + public FilterType GetFilterType() + { + return FilterType.COLUMN_PAGINATION_FILTER; + } + + public ByteString Serialize() + { + PB.ColumnPaginationFilter.Builder builder = PB.ColumnPaginationFilter.CreateBuilder(); + builder.SetLimit(this.Limit); + builder.SetOffset(this.Offset); + return builder.Build().ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Filter/CompositeColumnValueFilter.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Filter/CompositeColumnValueFilter.cs new file mode 100644 index 0000000..2d3c545 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Filter/CompositeColumnValueFilter.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using PB = com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Filter +{ + /** + * TableStore查询操作时使用的过滤器,CompositeColumnValueFilter用于表示ColumnValueFilter之间的逻辑关系条件,主要有NOT、AND和OR三种逻辑关系条件,其中NOT和AND表示二元或多元的关系,NOT只表示一元的关系。 + *

逻辑关系通过构造函数{@link CompositeColumnValueFilter#CompositeColumnValueFilter(CompositeColumnValueFilter.LogicOperator)}的参数提供。

+ *

若逻辑关系为{@link CompositeColumnValueFilter.LogicOperator#NOT},可以通过{@link CompositeColumnValueFilter#addFilter(ColumnValueFilter)}添加ColumnValueFilter,添加的ColumnValueFilter有且只有一个。

+ *

若逻辑关系为{@link CompositeColumnValueFilter.LogicOperator#AND},可以通过{@link CompositeColumnValueFilter#addFilter(ColumnValueFilter)}添加ColumnValueFilter,添加的ColumnValueFilter必须大于等于两个。

+ *

若逻辑关系为{@link CompositeColumnValueFilter.LogicOperator#OR},可以通过{@link CompositeColumnValueFilter#addFilter(ColumnValueFilter)}添加ColumnValueFilter,添加的ColumnValueFilter必须大于等于两个。

+ */ + public class CompositeColumnValueFilter : IFilter + { + private readonly LogicOperator type; + private readonly List filters; + + public CompositeColumnValueFilter(LogicOperator loType) + { + this.type = loType; + this.filters = new List(); + } + + /// + /// 增加逻辑关系组中的ColumnValueFilter。 + ///

若逻辑关系为{@link CompositeColumnValueFilter.LogicOperator#NOT},有且只能添加一个ColumnValueFilter。

+ ///

若逻辑关系为{@link CompositeColumnValueFilter.LogicOperator#AND},必须添加至少两个ColumnValueFilter。

+ ///

若逻辑关系为{ @link CompositeColumnValueFilter.LogicOperator#OR},必须添加至少两个ColumnValueFilter。

+ ///
+ /// The Composite filter. + /// Filter. + public CompositeColumnValueFilter AddFilter(IFilter filter) + { + Contract.Requires(filter != null); + this.filters.Add(filter); + return this; + } + + public void Clear() + { + this.filters.Clear(); + } + + /// + /// 查看当前设置的逻辑关系 + /// + /// 逻辑关系符号 + public LogicOperator GetOperationType() + { + return this.type; + } + + /// + /// 返回逻辑关系组中的所有ColumnValueFilter。 + /// + /// The sub filters. + public List GetSubFilters() + { + return this.filters; + } + + + public FilterType GetFilterType() + { + return FilterType.COMPOSITE_COLUMN_VALUE_FILTER; + } + + + public ByteString Serialize() + { + return BuildCompositeColumnValueFilter(this); + } + + private static ByteString BuildCompositeColumnValueFilter(CompositeColumnValueFilter filter) + { + PB.CompositeColumnValueFilter.Builder builder = PB.CompositeColumnValueFilter.CreateBuilder(); + builder.SetCombinator(ToPBLogicalOperator(filter.GetOperationType())); + + foreach (IFilter f in filter.GetSubFilters()) + { + builder.AddSubFilters(ToPBFilter(f)); + } + + return builder.Build().ToByteString(); + } + + private static PB.LogicalOperator ToPBLogicalOperator(LogicOperator type) + { + switch (type) + { + case LogicOperator.NOT: + return PB.LogicalOperator.LO_NOT; + case LogicOperator.AND: + return PB.LogicalOperator.LO_AND; + case LogicOperator.OR: + return PB.LogicalOperator.LO_OR; + default: + throw new ArgumentException("Unknown logic operation type: " + type); + } + } + + private static PB.Filter ToPBFilter(IFilter f) + { + PB.Filter.Builder builder = PB.Filter.CreateBuilder(); + builder.SetType(ToPBFilterType(f.GetFilterType())); + builder.SetFilter_(f.Serialize()); + return builder.Build(); + } + + private static PB.FilterType ToPBFilterType(FilterType type) + { + switch (type) + { + case FilterType.COMPOSITE_COLUMN_VALUE_FILTER: + return PB.FilterType.FT_COMPOSITE_COLUMN_VALUE; + case FilterType.SINGLE_COLUMN_VALUE_FILTER: + return PB.FilterType.FT_SINGLE_COLUMN_VALUE; + case FilterType.COLUMN_PAGINATION_FILTER: + return PB.FilterType.FT_COLUMN_PAGINATION; + default: + throw new ArgumentException("Unknown filter type: " + type); + } + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Filter/FilterType.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Filter/FilterType.cs new file mode 100644 index 0000000..0865212 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Filter/FilterType.cs @@ -0,0 +1,10 @@ +using System; +namespace Aliyun.OTS.DataModel.Filter +{ + public enum FilterType + { + SINGLE_COLUMN_VALUE_FILTER, + COMPOSITE_COLUMN_VALUE_FILTER, + COLUMN_PAGINATION_FILTER + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Filter/IFilter.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Filter/IFilter.cs new file mode 100644 index 0000000..a670e60 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Filter/IFilter.cs @@ -0,0 +1,12 @@ +using System; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Filter +{ + public interface IFilter + { + FilterType GetFilterType(); + + ByteString Serialize(); + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Filter/SingleColumnValueFilter.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Filter/SingleColumnValueFilter.cs new file mode 100644 index 0000000..3303bed --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Filter/SingleColumnValueFilter.cs @@ -0,0 +1,93 @@ +using System.IO; +using Google.ProtocolBuffers; +using System; +using PB = com.alicloud.openservices.tablestore.core.protocol; +namespace Aliyun.OTS.DataModel.Filter +{ + /// + /// TableStore查询操作时使用的过滤器,SingleColumnValueFilter用于表示查询的行内数据列和数据值的比较关系。 + ///

可以表示的列与值的比较关系包括:EQUAL(=), NOT_EQUAL(!=), GREATER_THAN(>), GREATER_EQUAL(>=), LESS_THAN(<)以及LESS_EQUAL(<=)。

+ ///

由于TableStore一行的属性列不固定,有可能存在有filter条件的列在该行不存在的情况,这时{@link SingleColumnValueFilter#passIfMissing}参数控制在这种情况下对该行的过滤结果。

+ /// 如果设置 + /// {@link SingleColumnValueFilter#passIfMissing}为true,则若列在该行中不存在,则返回该行; + /// 如果设置{@ref SingleColumnValueFilter#passIfMissing}为false,则若列在该行中不存在,则不返回该行。 + /// 默认值为true。 + /// < p > 由于TableStore的属性列可能有多个版本,有可能存在该列的一个版本的值与给定值匹配但是另一个版本的值不匹配的情况, + /// 这时{@link SingleColumnValueFilter#latestVersionsOnly}参数控制在这种情况下对该行的过滤结果。 + /// 如果设置{@link SingleColumnValueFilter#latestVersionsOnly}为true,则只会对最新版本的值进行比较,否则会对该列的所有版本(最新的max_versions个)进行比较, + /// 只要有一个版本的值匹配就认为条件成立。默认值为true。 + ///
+ public class SingleColumnValueFilter : IFilter + { + public CompareOperator CompareOperator { get; set; } + public string ColumnName { get; set; } + public ColumnValue ColumnValue { get; set; } + public bool PassIfMissing { get; set;} + public bool LatestVersionsOnly { get; set; } + + /// + /// 构造函数。 + /// + /// 列的名称 + /// 比较函数 + /// 列的值 + public SingleColumnValueFilter(string columnName, CompareOperator compareOperator, ColumnValue columnValue) + { + ColumnName = columnName; + CompareOperator = compareOperator; + ColumnValue = columnValue; + PassIfMissing = true; + LatestVersionsOnly = true; + } + + public FilterType GetFilterType() + { + return FilterType.SINGLE_COLUMN_VALUE_FILTER; + } + + public ByteString Serialize() + { + return BuildSingleColumnValueFilter(this); + } + + private static ByteString BuildSingleColumnValueFilter(SingleColumnValueFilter filter) + { + PB.SingleColumnValueFilter.Builder builder = PB.SingleColumnValueFilter.CreateBuilder(); + builder.SetColumnName(filter.ColumnName); + builder.SetComparator(ToComparatorType(filter.CompareOperator)); + try + { + builder.SetColumnValue(ByteString.CopyFrom(PB.PlainBufferBuilder.BuildColumnValueWithoutLengthPrefix(filter.ColumnValue))); + } + catch (IOException e) + { + throw new OTSClientException("Bug: serialize column value failed." + e.Message); + } + + builder.SetFilterIfMissing(!filter.PassIfMissing); + builder.SetLatestVersionOnly(filter.LatestVersionsOnly); + + return builder.Build().ToByteString(); + } + + private static PB.ComparatorType ToComparatorType(CompareOperator compareOperator) + { + switch (compareOperator) { + case CompareOperator.EQUAL: + return PB.ComparatorType.CT_EQUAL; + case CompareOperator.NOT_EQUAL: + return PB.ComparatorType.CT_NOT_EQUAL; + case CompareOperator.GREATER_THAN: + return PB.ComparatorType.CT_GREATER_THAN; + case CompareOperator.GREATER_EQUAL: + return PB.ComparatorType.CT_GREATER_EQUAL; + case CompareOperator.LESS_THAN: + return PB.ComparatorType.CT_LESS_THAN; + case CompareOperator.LESS_EQUAL: + return PB.ComparatorType.CT_LESS_EQUAL; + default: + throw new ArgumentException("Unknown compare operator: " + compareOperator); + } + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/IMeasurable.cs b/netstandard-sdk/Aliyun/OTS/DataModel/IMeasurable.cs new file mode 100644 index 0000000..f9ca7dc --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/IMeasurable.cs @@ -0,0 +1,11 @@ +namespace Aliyun.OTS.DataModel +{ + public interface IMeasurable + { + /// + /// 序列化后占用的数据大小 + /// + /// 序列化后占用的数据大小 + int GetDataSize(); + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/IRow.cs b/netstandard-sdk/Aliyun/OTS/DataModel/IRow.cs new file mode 100644 index 0000000..78a5aad --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/IRow.cs @@ -0,0 +1,8 @@ +using System; +namespace Aliyun.OTS.DataModel +{ + public interface IRow : IComparable + { + PrimaryKey GetPrimaryKey(); + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/IndexMeta.cs b/netstandard-sdk/Aliyun/OTS/DataModel/IndexMeta.cs new file mode 100644 index 0000000..9970fa3 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/IndexMeta.cs @@ -0,0 +1,25 @@ +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel +{ + /// + /// 索引表的结构信息,包含索引表的名称以及索引表的主键及预定义列定义 + /// + public class IndexMeta + { + public string IndexName { get; set; } + + public List PrimaryKey { get; set; } + + public List DefinedColumns { get; set; } + + public IndexUpdateMode IndexUpdateModel { get; set; } + + public IndexType IndexType { get; set; } + + public IndexMeta(string indexName) + { + this.IndexName = indexName; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/IndexType.cs b/netstandard-sdk/Aliyun/OTS/DataModel/IndexType.cs new file mode 100644 index 0000000..203c48c --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/IndexType.cs @@ -0,0 +1,13 @@ +namespace Aliyun.OTS.DataModel +{ + /// + /// 表示索引类型 + /// + public enum IndexType + { + /// + /// 全局索引 + /// + IT_GLOBAL_INDEX + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/IndexUpdateMode.cs b/netstandard-sdk/Aliyun/OTS/DataModel/IndexUpdateMode.cs new file mode 100644 index 0000000..ff7062a --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/IndexUpdateMode.cs @@ -0,0 +1,13 @@ +namespace Aliyun.OTS.DataModel +{ + /// + /// 表示索引更新模式 + /// + public enum IndexUpdateMode + { + /// + /// 异步更新索引 + /// + IUM_ASYNC_INDEX + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/LogicOperator.cs b/netstandard-sdk/Aliyun/OTS/DataModel/LogicOperator.cs new file mode 100644 index 0000000..f242809 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/LogicOperator.cs @@ -0,0 +1,7 @@ +namespace Aliyun.OTS.DataModel +{ + public enum LogicOperator + { + NOT, AND, OR, + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/MultiRowQueryCriteria.cs b/netstandard-sdk/Aliyun/OTS/DataModel/MultiRowQueryCriteria.cs new file mode 100644 index 0000000..8c18a12 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/MultiRowQueryCriteria.cs @@ -0,0 +1,128 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + */ + +using System.Collections.Generic; +using System.Linq; + +namespace Aliyun.OTS.DataModel +{ + /// + ///从TableStore表中查询多行数据所需的参数,可以支持以下几种读取行为: + ///
    + ///
  • 读取某些列或所有列的某个特定版本
  • + ///
  • 读取某些列或所有列的某个版本范围内的所有版本或最大的N个版本
  • + ///
  • 读取某些列或所有列的最大的N个版本(N最小为 1,最大为MaxVersions)
  • + ///
+ ///

注意:读取参数不能为每行单独设置,多行必须使用相同的查询参数。

+ /// + ///
+ public class MultiRowQueryCriteria : RowQueryCriteria + { + private List rowPrimaryKeys = new List(); + private List tokens; + + /// + /// 构造一个在给定名称的表中查询的条件 + /// + /// + public MultiRowQueryCriteria(string tableName) + : base(tableName) + { + rowPrimaryKeys = new List(); + tokens = new List(); + } + + /// + /// 向多行查询条件中插入要查询的行的主键 + /// + /// 要查询的行的主键 + public void AddRowKey(PrimaryKey primaryKey) + { + AddRowKey(primaryKey, new byte[0]); + } + + public void AddRowKey(PrimaryKey primaryKey, byte[] token) + { + this.rowPrimaryKeys.Add(primaryKey); + this.tokens.Add(token); + } + + /// + /// 设置该表中所有要查询的行的主键 + /// + /// 所有行的主键 + public void SetRowKeys(List primaryKeys) + { + rowPrimaryKeys = primaryKeys; + for (int i = 0; i < primaryKeys.Count; i++) + { + tokens.Add(new byte[0]); + } + } + + /// + /// 获取该表中所要要查询的行的主键。 + /// + /// 所有行的主键。 + public List GetRowKeys() + { + return rowPrimaryKeys; + } + + public List GetTokens() + { + return tokens; + } + + /// + /// 获取某行的主键,若该行index不存在,则返回null。 + /// + /// 该行的索引 + /// 若该行存在,则返回该行主键,否则返回null + public PrimaryKey Get(int index) + { + if (index < rowPrimaryKeys.Count()) + { + return rowPrimaryKeys[index]; + } + + return null; + } + + /// + /// 清空要查询的所有行 + /// + public void Clear() + { + rowPrimaryKeys.Clear(); + } + + /// + /// 获取要查询的行的个数。 + /// + /// The size. + public int Size() + { + return rowPrimaryKeys.Count; + } + + public bool IsEmpty() + { + return rowPrimaryKeys.Count == 0; + } + + public MultiRowQueryCriteria CloneWithoutRowKeys() + { + MultiRowQueryCriteria newCriteria = new MultiRowQueryCriteria(this.TableName); + this.CopyTo(newCriteria); + return newCriteria; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/NameTimestampComparator.cs b/netstandard-sdk/Aliyun/OTS/DataModel/NameTimestampComparator.cs new file mode 100644 index 0000000..f560d8e --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/NameTimestampComparator.cs @@ -0,0 +1,23 @@ +using System; +using System.Collections; +namespace Aliyun.OTS.DataModel +{ + public class NameTimestampComparator: IComparer + { + public int Compare(Object obj1, Object obj2) + { + var c1 = obj1 as Column; + var c2 = obj2 as Column; + int ret = string.Compare(c1.Name, c2.Name, StringComparison.Ordinal); + + if (ret != 0) + { + return ret; + } + + long t1 = c1.Timestamp.Value; + long t2 = c2.Timestamp.Value; + return t1 == t2 ? 0 : (t1 < t2 ? 1 : -1); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/PartitionRange.cs b/netstandard-sdk/Aliyun/OTS/DataModel/PartitionRange.cs new file mode 100644 index 0000000..273ec57 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/PartitionRange.cs @@ -0,0 +1,24 @@ +using System; +namespace Aliyun.OTS.DataModel +{ + public class PartitionRange + { + /// + /// 范围的起始值 + /// + /// The begin. + public ColumnValue Begin { get; set; } + + /// + /// 范围的结束值 + /// + /// The end. + public ColumnValue End { get; set; } + + public PartitionRange(ColumnValue begin, ColumnValue end) + { + Begin = begin; + End = end; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/PrimaryKey.cs b/netstandard-sdk/Aliyun/OTS/DataModel/PrimaryKey.cs new file mode 100644 index 0000000..4bf5446 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/PrimaryKey.cs @@ -0,0 +1,112 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; +using System.Collections.Generic; +using Aliyun.OTS.Util; + +namespace Aliyun.OTS.DataModel +{ + /// + /// 表示若干主键列组成的主键。可以使用Add方法指定列名和列值来添加主键列。 + /// + public class PrimaryKey : Dictionary, IComparable, IMeasurable + { + /// + /// 获取所有的主键列。 + ///

主键中包含的主键列的个数以及主键列的顺序与创建表时TableMeta中定义的一致。

+ ///
+ /// The primary key columns. + public PrimaryKeyColumn[] GetPrimaryKeyColumns() + { + if (this == null) + { + return null; + } + + PrimaryKeyColumn[] keyColumns = new PrimaryKeyColumn[this.Count]; + + var enumerator = this.GetEnumerator(); + + for (var i = 0; enumerator.MoveNext();i++) + { + keyColumns[i] = new PrimaryKeyColumn(enumerator.Current); + } + + return keyColumns; + } + + /// + /// 获取行主键的数据大小总和,大小总和包括所有主键列的名称和值。 + /// + /// 行主键的数据大小总和 + public int GetDataSize() + { + if (this.Keys == null) + { + return 0; + } + + + int size = 0; + foreach (var key in this.Keys) + { + size += OtsUtils.CalcStringSizeInBytes(key); + size += this[key].GetDataSize(); + } + + return size; + } + + public override string ToString() + { + var primaryColumns = GetPrimaryKeyColumns(); + string result = ""; + + if(primaryColumns == null) + { + return result; + } + + foreach(var col in primaryColumns) + { + result += col + ","; + } + + return result; + } + + /// + /// 比较两个主键 + ///

对比的两个主键必须为相同的schema,即列数、主键名称和顺序都完全一致。

+ ///
+ /// 比较结果 + /// Target. + public int CompareTo(PrimaryKey target) + { + if (this.Keys.Count != target.Keys.Count) + { + throw new ArgumentException("The schema of the two primary key compared is not the same."); + } + + for (int i = 0; i < this.Count; i++) + { + int ret = string.Compare(this.Keys.GetEnumerator().Current, target.Keys.GetEnumerator().Current, StringComparison.Ordinal); + if (ret != 0) + { + return ret; + } + } + + return 0; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/PrimaryKeyColumn.cs b/netstandard-sdk/Aliyun/OTS/DataModel/PrimaryKeyColumn.cs new file mode 100644 index 0000000..6601cc0 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/PrimaryKeyColumn.cs @@ -0,0 +1,109 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using Aliyun.OTS.Util; +namespace Aliyun.OTS.DataModel +{ + public class PrimaryKeyColumn : IComparable, IMeasurable + { + /// + /// 主键列名 + /// + /// The name. + public string Name { get; set; } + + /// + /// 列值 + /// + public ColumnValue Value { get; set; } + + /// + /// 序列化后占用的数据大小 + /// + private int dataSize = -1; + + /// + /// 根据指定的主键列的名称和主键列的值构造主键列。 + ///

主键列的名称不能为null pointer及空字符串。

+ ///

主键列的值不能为null pointer。

+ ///
+ /// 列名 + /// 列值 + public PrimaryKeyColumn(string name, ColumnValue columnValue) + { + Contract.Requires(!string.IsNullOrEmpty(name)); + Contract.Requires(columnValue != null); + this.Name = name; + this.Value = columnValue; + } + + public PrimaryKeyColumn(KeyValuePair pair) + { + this.Name = pair.Key; + this.Value = pair.Value; + } + + public byte[] GetNameRawData() + { + return OtsUtils.String2Bytes(Name); + } + + public int HashCode() + { + return Name.GetHashCode() ^ Value.GetHashCode(); + } + + public override int GetHashCode() + { + return HashCode(); + } + + public override bool Equals(Object obj) + { + if (obj == null || !(obj is PrimaryKeyColumn)) + { + return false; + } + + PrimaryKeyColumn col = (PrimaryKeyColumn)obj; + return this.Name.Equals(col.Name) && this.Value.Equals(col.Value); + } + + /// + /// 比较两个主键列的大小 + ///

对比的两个主键列必须含有相同的名称和类型。

+ ///
+ /// 若相等返回0,若大于返回1,若小于返回-1 + /// 比较对象 + public int CompareTo(Object obj) + { + var target = obj as PrimaryKeyColumn; + if (!this.Name.Equals(target.Name)) + { + throw new ArgumentException("The name of primary key to be compared must be the same."); + } + + return this.Value.CompareTo(target.Value); + } + + public int GetDataSize() + { + if (dataSize == -1) + { + dataSize = OtsUtils.CalcStringSizeInBytes(Name) + Value.GetDataSize(); + } + + return dataSize; + } + + public override string ToString() + { + return "'" + Name + "':" + Value; + } + + public Column ToColumn() + { + return new Column(this.Name, this.Value); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/PrimaryKeyOption.cs b/netstandard-sdk/Aliyun/OTS/DataModel/PrimaryKeyOption.cs new file mode 100644 index 0000000..9b25ce1 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/PrimaryKeyOption.cs @@ -0,0 +1,8 @@ +namespace Aliyun.OTS.DataModel +{ + public enum PrimaryKeyOption + { + NONE = 0, + AUTO_INCREMENT = 1 + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/PrimaryKeySchema.cs b/netstandard-sdk/Aliyun/OTS/DataModel/PrimaryKeySchema.cs new file mode 100644 index 0000000..8986608 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/PrimaryKeySchema.cs @@ -0,0 +1,56 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel +{ + /// + /// 表示主键的设计,包括每个主键列的名称和列值类型。 + /// + public class PrimaryKeySchema : List> + { + /// + /// 添加一个主键列的设计,PrimaryKey。 + /// + /// 列名 + /// 列值类型 + public void Add(string primaryKeyColumnName, ColumnValueType columnValueType) + { + var tuple = new Tuple(primaryKeyColumnName, columnValueType, PrimaryKeyOption.NONE); + Add(tuple); + } + + /// + /// 添加一个主键列的设计。 + /// + /// 列名 + /// 列值类型 + public void Add(string primaryKeyColumnName, ColumnValueType columnValueType, PrimaryKeyOption primaryKeyOption) + { + var tuple = new Tuple(primaryKeyColumnName, columnValueType, primaryKeyOption); + Add(tuple); + } + + public override String ToString() + { + String schema = ""; + foreach (Tuple v in this) + { + var item2 = v.Item3 == PrimaryKeyOption.AUTO_INCREMENT ? PrimaryKeyOption.AUTO_INCREMENT.ToString(): v.Item2.ToString(); + schema += v.Item1 + ":" + v.Item2 + ","; + } + + return schema; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/RangeRowQueryCriteria.cs b/netstandard-sdk/Aliyun/OTS/DataModel/RangeRowQueryCriteria.cs new file mode 100644 index 0000000..72a2495 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/RangeRowQueryCriteria.cs @@ -0,0 +1,59 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + */ + +using Aliyun.OTS.Request; + +namespace Aliyun.OTS.DataModel +{ + public class RangeRowQueryCriteria : RowQueryCriteria + { + /// + /// 设置或获取范围查询的读取顺序(正序(FORWARD)或反序(BACKWARD))。 + /// + public GetRangeDirection Direction { get; set; } + + /// + /// 设置或获取查询返回的最大行数,若limit未设置,则返回查询范围下的所有行 + /// + public int? Limit { get; set; } + + /// + /// 设置或获取范围查询的左边界的主键值 + /// + public PrimaryKey InclusiveStartPrimaryKey { get; set; } + + /// + /// 设置或获取获取范围查询的右边界的主键值 + /// + public PrimaryKey ExclusiveEndPrimaryKey { get; set; } + + /// + /// 用于行内流式读, 标记位置和状态信息. + /// + public byte[] Token { get; set; } + + /// + /// 构造一个在给定名称的表中查询的条件。 + /// + /// 表名称 + public RangeRowQueryCriteria(string tableName) + : base(tableName) + { + Direction = GetRangeDirection.Forward; + InclusiveStartPrimaryKey = new PrimaryKey(); + ExclusiveEndPrimaryKey = new PrimaryKey(); + } + + public bool HasSetToken() + { + return Token != null; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/ReservedThroughputDetails.cs b/netstandard-sdk/Aliyun/OTS/DataModel/ReservedThroughputDetails.cs new file mode 100644 index 0000000..2c3ff09 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/ReservedThroughputDetails.cs @@ -0,0 +1,61 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; + +namespace Aliyun.OTS.DataModel +{ + /// + /// 的返回中包含的 + /// 预留读写吞吐量详细信息。 + /// + public class ReservedThroughputDetails + { + /// + /// 读写能力单元 + /// + public CapacityUnit CapacityUnit { get; private set; } + + /// + /// 最后一次上调的时间 + /// + public Int64 LastIncreaseTime { get; private set; } + + /// + /// 最后一次下调的时间 + /// + public Int64 LastDecreaseTime { get; private set; } + + /// + /// 本日预留读写吞吐量下调的次数 + /// + public int NumberOfDecreasesToday { get; private set; } + + public ReservedThroughputDetails(CapacityUnit capacityUnit, + Int64 lastIncreaseTime, + Int64 lastDecreaseTime, + int numberOfDecreasesToday) : + this(capacityUnit, + lastIncreaseTime, + lastDecreaseTime) + { + NumberOfDecreasesToday = numberOfDecreasesToday; + } + + public ReservedThroughputDetails(CapacityUnit capacityUnit, + Int64 lastIncreaseTime, Int64 lastDecreaseTime) + { + CapacityUnit = capacityUnit; + LastIncreaseTime = lastIncreaseTime; + LastDecreaseTime = lastDecreaseTime; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/ReturnType.cs b/netstandard-sdk/Aliyun/OTS/DataModel/ReturnType.cs new file mode 100644 index 0000000..d4924cf --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/ReturnType.cs @@ -0,0 +1,24 @@ +using System; +namespace Aliyun.OTS.DataModel +{ + /** + * 表示操作(PUT,UPDATE,DELETE)的返回结果中是否附带PK值,对于PK递增列,应该设置返回PK + */ + public enum ReturnType + { + /// + /// 不返回任何行数据。 + /// + RT_NONE, + + /// + /// 返回PK列的数据。 + /// + RT_PK, + + /// + /// 返回修改列的数据(如原子加的结果返回) + /// + RT_AFTER_MODIFY, + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Row.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Row.cs new file mode 100644 index 0000000..69dd7f4 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Row.cs @@ -0,0 +1,221 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Aliyun.OTS.DataModel +{ + public class Row : IRow + { + public PrimaryKey PrimaryKey { get; set; } + + public AttributeColumns AttributeColumns{ + get{ + if(columns == null) + { + return null; + } + + var attributeColumns = new AttributeColumns(); + + foreach(var column in columns) + { + attributeColumns.Add(column); + } + + return attributeColumns; + } + } + + private readonly Column[] columns; + + /// + /// 构造函数。 + /// + /// 行的主键,不能为null或者为空 + /// 该行的属性列,不能为null + public Row(PrimaryKey primaryKey, List columns) : this(primaryKey, columns.ToArray()) + { + + } + + /// + /// 构造函数。 + /// + /// 行的主键,不能为null或者为空 + /// 该行的属性列,不能为null + public Row(PrimaryKey primaryKey, Column[] columns) + { + PrimaryKey = primaryKey; + this.columns = columns; + SortColumns(); // it may not been sorted, so we should sort it first + } + + public PrimaryKey GetPrimaryKey() + { + return PrimaryKey; + } + + /// + /// 获取所有的属性列。数组中的所有属性列按名称升序排列,相同名称的属性列按timestamp降序排列。 + /// + /// 所有属性列 + public Column[] GetColumns() + { + return columns; + } + + /// + /// 获取某个特定名称的属性列的所有版本的值。返回结果中这些属性列按timestamp降序排列. + /// + /// 若该属性列存在,则返回所有版本的值,按timestamp降序排列,否则返回空列表 + /// 属性列的名称 + public List GetColumn(String columnName) + { + List result = new List(); + + if (columns == null || columns.Length == 0) + { + return result; + } + + int pos = BinarySearch(columnName); + if (pos == -1) + { + return result; + } + + for (int i = pos; i < columns.Length; i++) + { + Column col = columns[i]; + if (col.Name.Equals(columnName)) + { + result.Add(col); + } + else + { + break; + } + } + + return result; + } + + /// + /// 获取该属性列中最新版本的值。 + /// + /// 若该属性列存在,则返回最新版本的值,否则返回null + /// 属性列的名称 + public Column GetLatestColumn(String name) + { + if (columns == null || columns.Length == 0) + { + return null; + } + + int pos = BinarySearch(name); + if (pos == -1) + { + return null; + } + + Column col = columns[pos]; + + if (col.Name.Equals(name)) + { + return col; + } + + return null; + } + + /// + /// 检查该行中是否有该名称的属性列。 + /// + /// 若存在,则返回true,否则返回false + /// Name. + public bool Contains(String name) + { + return GetLatestColumn(name) != null; + } + + /// + /// 检查该行是否包含属性列。 + /// + /// 若该行不包含任何属性列,则返回true,否则返回false + public bool IsEmpty() + { + return columns == null || columns.Length == 0; + } + + public int CompareTo(IRow o) + { + + return this.PrimaryKey.CompareTo(o.GetPrimaryKey()); + } + + public override String ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("[PrimaryKey]:"); + sb.Append(this.PrimaryKey); + sb.Append("\n[Columns]:"); + foreach (Column column in this.GetColumns()) + { + sb.Append("("); + sb.Append(column); + sb.Append(")"); + } + + return sb.ToString(); + } + + /// + /// 将数组中的所有属性列按名称升序、timestamp降序的顺序重新排列。 + /// + private void SortColumns() + { + // check if it is already sorted, optimized as in most time it is sorted. + bool sorted = true; + for (int i = 0; i < columns.Length - 1; i++) + { + int ret = Column.NAME_TIMESTAMP_COMPARATOR.Compare(columns[i], columns[i + 1]); + if (ret > 0) + { + sorted = false; + break; + } + } + + if (!sorted) + { + Array.Sort(this.columns, Column.NAME_TIMESTAMP_COMPARATOR); + } + } + + /// + /// 二分查找指定的列. + /// + /// T如果包含查找的列, 返回对应的index; 如果不包含该列, 返回可以插入该列的位置; 如果所有元素都小于该列, 返回-1. + /// 要查找的列名 + private int BinarySearch(String name) + { + Column searchTerm = new Column(name, null, long.MaxValue); + + // 若数组中有多列与searchTerm相同,那不保证一定返回第一列,Row中的数据是TableStore返回的,不会出现这种情况。 + // pos === ( -(insertion point) - 1) + int pos = Array.BinarySearch(columns, searchTerm, Column.NAME_TIMESTAMP_COMPARATOR); + + if (pos < 0) + { + pos = (pos + 1) * -1; + } + + if (pos == columns.Length) + { + return -1; + } + + return pos; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/RowChange.cs b/netstandard-sdk/Aliyun/OTS/DataModel/RowChange.cs new file mode 100644 index 0000000..2257bfe --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/RowChange.cs @@ -0,0 +1,83 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +namespace Aliyun.OTS.DataModel +{ + /** + * 单行的数据变更操作的基础结构。 + *

若是PutRow操作,请参考{@link RowPutChange}。

+ *

若是UpdateRow操作,请参考{@link RowUpdateChange}。

+ *

若是DeleteRow操作,请参考{@link RowDeleteChange}。

+ */ + public abstract class RowChange : IRow, IMeasurable + { + /// + /// 表的名称。 + /// + /// The name of the table. + public String TableName { get; set; } + + /// + /// 表的主键。 + /// + /// The primary key. + public PrimaryKey PrimaryKey { get; set; } + + /// + /// 判断条件。 + /// + /// The condition. + public Condition Condition { get; set; } + + /// + /// 返回的数据类型,默认是不返回。 + /// + /// The type of the return. + public ReturnType ReturnType { get; set; } + + /// + /// 指定本次需要返回的列名 + /// + public List ReturnColumnNames { get; set; } + + /// + /// Initializes a new instance of the class. + ///

表的名称不能为null或者为空。

+ ///

行的主键不能为null或者为空。

+ ///
+ /// 表的名称 + /// 表的主键 + protected RowChange(string tableName, PrimaryKey primaryKey) + { + Contract.Requires(!string.IsNullOrEmpty(tableName), "表的名称不能为null或者为空。"); + this.TableName = tableName; + this.PrimaryKey = primaryKey; + this.Condition = new Condition(); + this.ReturnType = ReturnType.RT_NONE; + } + + /// + /// 构造函数。internal use + ///

表的名称不能为null或者为空。

+ ///
+ /// 表的名称 + protected RowChange(String tableName) : this(tableName, null) + { + } + + public int CompareTo(IRow row) + { + return this.PrimaryKey.CompareTo(row.GetPrimaryKey()); + } + + public PrimaryKey GetPrimaryKey() + { + return this.PrimaryKey; + } + + public int GetDataSize() + { + throw new NotImplementedException(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/RowChangeType.cs b/netstandard-sdk/Aliyun/OTS/DataModel/RowChangeType.cs new file mode 100644 index 0000000..a13aaa1 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/RowChangeType.cs @@ -0,0 +1,25 @@ +namespace Aliyun.OTS.DataModel +{ + public enum RowChangeType + { + /// + /// 代表写入该Column的某个特定版本的值。 + /// + PUT, + + /// + /// 代表删除该Column的某个特定版本,版本号的时间戳等于{@link Column#timestamp}。 + /// + DELETE, + + /// + /// 代表删除该Column的所有版本的值。 + /// + DELETE_ALL, + + /// + /// 代表对该column的最新版本执行原子加。 + /// + INCREMENT + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/RowChanges.cs b/netstandard-sdk/Aliyun/OTS/DataModel/RowChanges.cs new file mode 100644 index 0000000..a366e05 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/RowChanges.cs @@ -0,0 +1,125 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel +{ + /// + /// 用来表示中同一个表的多行操作,包括Put, Update和Delete。 + /// + public class RowChanges + { + /// + /// 表示多个Put操作。 + /// + public List> PutOperations { get; set; } + + /// + /// 表示多个Update操作。 + /// + public List> UpdateOperations { get; set; } + + /// + /// 表示多个Delete操作。 + /// + public List> DeleteOperations { get; set;} + + + /// + /// 表示多个Put操作。 + /// + public List RowPutChanges; + + /// + /// 表示多个Update操作。 + /// + public List RowUpdateChanges; + + /// + /// 表示多个Delete操作。 + /// + public List RowDeleteChanges; + + public string TableName { get; set;} + + public RowChanges(string tableName) + { + RowPutChanges = new List(); + RowUpdateChanges = new List(); + RowDeleteChanges = new List(); + TableName = tableName; + } + + /// + /// 添加一个Put操作 + /// + /// 检查条件 + /// 主键 + /// 属性 + public void AddPut(Condition condition, PrimaryKey primaryKey, AttributeColumns attributeColumns) + { + var item = new RowPutChange(TableName, primaryKey) + { + Condition = condition + }; + + if (attributeColumns != null) + { + foreach (var column in attributeColumns) + { + item.AddColumn(column.Key, column.Value); + } + } + + RowPutChanges.Add(item); + } + + /// + /// 添加一个Delete操作 + /// + /// + /// + public void AddDelete(Condition condition, PrimaryKey primaryKey) + { + var item = new RowDeleteChange(TableName, primaryKey) + { + Condition = condition + }; + + RowDeleteChanges.Add(item); + } + + /// + /// 添加一个Update操作 + /// + /// + /// + /// + public void AddUpdate(Condition condition, PrimaryKey primaryKey, UpdateOfAttribute updateAttributes) + { + var item = new RowUpdateChange(TableName, primaryKey) + { + Condition = condition + }; + + item.FromUpdateOfAtrribute(updateAttributes); + + RowUpdateChanges.Add(item); + } + + public bool IsEmpty() + { + return RowPutChanges.Count + RowUpdateChanges.Count + RowDeleteChanges.Count == 0; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/RowDeleteChange.cs b/netstandard-sdk/Aliyun/OTS/DataModel/RowDeleteChange.cs new file mode 100644 index 0000000..82a178e --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/RowDeleteChange.cs @@ -0,0 +1,28 @@ +using System; +namespace Aliyun.OTS.DataModel +{ + public class RowDeleteChange : RowChange + { + /// + /// 构造函数。 + /// + /// 表的名称 + /// 要删除的行的主键 + public RowDeleteChange(String tableName, PrimaryKey primaryKey) : base(tableName, primaryKey) + { + } + + /// + /// 构造函数。 + /// + /// 表的名称 + public RowDeleteChange(String tableName) : base(tableName) + { + } + + public new int GetDataSize() + { + return GetPrimaryKey().GetDataSize(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/RowExistenceExpectation.cs b/netstandard-sdk/Aliyun/OTS/DataModel/RowExistenceExpectation.cs new file mode 100644 index 0000000..7dfbd0a --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/RowExistenceExpectation.cs @@ -0,0 +1,23 @@ +namespace Aliyun.OTS.DataModel +{ + public enum RowExistenceExpectation + { + /// + /// 表示写操作(包括PutRow, DeleteRow, UpdateRow, BatchWriteRow)中的IGNORE条件。 + /// 即不论该行是否存在均执行操作。 + /// + IGNORE, + + /// + /// 表示写操作(包括PutRow, DeleteRow, UpdateRow, BatchWriteRow)EXPECT_EXIST条件。 + /// 即仅在该行存在的情况下执行操作;否则操作出错。 + /// + EXPECT_EXIST, + + /// + /// 表示写操作PutRow和BatchWriteRow中的put操作的EXPECT_NOT_EXIST条件。 + /// 即仅在该行不存在的情况下执行操作;否则操作出错。 + /// + EXPECT_NOT_EXIST + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/RowPutChange.cs b/netstandard-sdk/Aliyun/OTS/DataModel/RowPutChange.cs new file mode 100644 index 0000000..4ce5538 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/RowPutChange.cs @@ -0,0 +1,249 @@ +using System; +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel +{ + public class RowPutChange : RowChange + { + /// + /// 行的属性列集合。 + /// + private readonly List columnsToPut = new List(); + + private long? timestamp; + + /// + /// 构造函数。 + /// + /// 表的名称 + public RowPutChange(String tableName) : base(tableName) + { + } + + /// + /// 构造函数。 + /// + /// 表的名称 + /// 行的主键 + public RowPutChange(String tableName, PrimaryKey primaryKey) : base(tableName, primaryKey) + { + } + + /// + /// 构造函数。 + ///

允许用户设置一个默认的时间戳,若写入的列没有带时间戳,则会使用该默认时间戳。

+ ///
+ /// 表的名称. + /// 行的主键 + /// 默认时间戳 + public RowPutChange(String tableName, PrimaryKey primaryKey, long timestamp) : base(tableName, primaryKey) + { + this.timestamp = timestamp; + } + + /// + /// 拷贝构造函数 + /// + /// To copy. + public RowPutChange(RowPutChange toCopy) : base(toCopy.TableName, toCopy.GetPrimaryKey()) + { + if (toCopy.timestamp.HasValue) + { + timestamp = toCopy.timestamp; + } + + columnsToPut.AddRange(toCopy.columnsToPut); + } + + /// + /// 新写入一个属性列。 + /// + /// The column. + /// Column(for invocation chain). + public RowPutChange AddColumn(Column column) + { + this.columnsToPut.Add(column); + return this; + } + + /// + /// 新写入一个属性列。 + ///

若设置过{@link #timestamp},则使用该默认的时间戳。

+ ///
+ /// The column(for invocation chain). + /// 属性列的名称 + /// 属性列的值 + public RowPutChange AddColumn(String name, ColumnValue value) + { + Column column = null; + if (this.timestamp.HasValue) + { + column = new Column(name, value, this.timestamp.Value); + } + else + { + column = new Column(name, value); + } + + this.columnsToPut.Add(column); + return this; + } + + /// + /// 新写入一个属性列。 + /// + /// The column. + /// 属性列的名称 + /// 属性列的值 + /// T属性列的时间戳 + public RowPutChange AddColumn(String name, ColumnValue value, long timestamp) + { + this.columnsToPut.Add(new Column(name, value, timestamp)); + return this; + } + + /// + /// 新写入一批属性列。 + ///

属性列的写入顺序与列表中的顺序一致。

+ ///
+ /// The columns(for invocation chain). + /// 属性列列表 + public RowPutChange AddColumns(IEnumerable columns) + { + this.columnsToPut.AddRange(columns); + return this; + } + + /// + /// 新写入一批属性列。 + ///

属性列的写入顺序与列表中的顺序一致。

+ ///
+ /// The columns(for invocation chain). + /// 属性列列表 + public RowPutChange AddColumns(AttributeColumns columns) + { + foreach (var key in columns.Keys) + { + this.columnsToPut.Add(new Column(key, columns[key])); + } + + return this; + } + + /// + /// 获取所有要写入的属性列列表。 + /// + /// 属性列列表 + public List GetColumnsToPut() + { + return this.columnsToPut; + } + + /// + /// 获取名称与指定名称相同的所有属性列的列表 + /// + /// 属性列名称 + /// 若找到对应的属性列,则返回包含这些元素的列表,否则返回一个空列表。 + public List GetColumnsToPut(string name) + { + List result = new List(); + + foreach (Column col in columnsToPut) + { + if (col.Name.Equals(name)) + { + result.Add(col); + } + } + + return result; + } + + public new int GetDataSize() + { + int valueTotalSize = 0; + foreach (Column col in columnsToPut) + { + valueTotalSize += col.GetDataSize(); + } + return GetPrimaryKey().GetDataSize() + valueTotalSize; + } + + /// + /// 检查是否已经有相同名称的属性列写入,忽略时间戳和值是否相等。 + /// + /// 若有返回true,否则返回false + /// 属性列名称 + public bool Has(String name) + { + foreach (Column col in columnsToPut) + { + if (col.Name.Equals(name)) + { + return true; + } + } + + return false; + } + + /// + /// 检查是否有相同名称和相同时间戳的属性列写入,忽略值是否相等。 + /// + /// 若有返回true,否则返回false + /// 属性列名称 + /// 属性列时间戳 + public bool Has(String name, long ts) + { + foreach (Column col in columnsToPut) + { + if (col.Name.Equals(name) && (col.Timestamp.HasValue && col.Timestamp == ts)) + { + return true; + } + } + + return false; + } + + /// + /// 检查是否有相同名称和相同值的属性列写入,忽略时间戳是否相等。 + /// + /// 若有返回true,否则返回false + /// 属性列名称 + /// 属性列值 + public bool Has(String name, ColumnValue value) + { + foreach (Column col in columnsToPut) + { + if (col.Name.Equals(name) && col.Value.Equals(value)) + { + return true; + } + } + + return false; + } + + /// + /// 检查是否有相同名称、相同时间戳并且相同值的属性列写入。 + /// + /// 若有返回true,否则返回false + /// 属性列名称 + /// 属性列时间戳 + /// 属性列值 + public bool Has(String name, long ts, ColumnValue value) + { + foreach (Column col in columnsToPut) + { + if (col.Name.Equals(name) && (col.Timestamp.HasValue && col.Timestamp == ts) && + value.Equals(col.Value)) + { + return true; + } + } + + return false; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/RowQueryCriteria.cs b/netstandard-sdk/Aliyun/OTS/DataModel/RowQueryCriteria.cs new file mode 100644 index 0000000..41ca82a --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/RowQueryCriteria.cs @@ -0,0 +1,122 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + */ + +using System.Collections.Generic; +using Aliyun.OTS.DataModel.Filter; + +namespace Aliyun.OTS.DataModel +{ + /// + /// 表示返回行的查询条件 + /// + public class RowQueryCriteria + { + /// + /// 查询的表的名称。 + /// + public string TableName { get; set; } + + /// + /// 要查询的列的名称,若未指定查询的列,则查询整行 + /// + private HashSet columnsToGet = new HashSet(); + + /// + /// 要读取的时间戳的范围,若未设置,则代表读取所有的版本。 + /// + public TimeRange TimeRange { get; set; } + + /// + /// 要返回的列的版本的个数,若未设置,则返回OTS当前保留的所有版本。 + /// + public int? MaxVersions { get; set; } + + /// + /// 本次查询使用的Filter + /// + public IFilter Filter { get; set; } + + /// + /// 查询的列范围的起始位置. + /// + public string StartColumn { get; set; } + + /// + /// 查询的列范围的终止位置. + /// + public string EndColumn { get; set; } + + /// + /// 内部参数。 + /// + public bool? CacheBlocks { get; set; } + + + /// + /// 构造一个在给定名称的表中查询的条件 + /// + /// 要查询的表名称 + public RowQueryCriteria(string tableName) + { + TableName = tableName; + } + + /// + /// 获取返回列的名称的列表 + /// + /// 返回列的名称列表 + public HashSet GetColumnsToGet() + { + return columnsToGet; + } + + /// + /// 添加要返回的列 + /// + /// 返回的列的名称 + public void AddColumnsToGet(string columnName) + { + columnsToGet.Add(columnName); + } + + /// + /// 添加要返回的列。 + /// + /// 要返回列的名称 + public void AddColumnsToGet(HashSet columnNames) + { + foreach (string column in columnNames) + { + columnsToGet.Add(column); + } + } + + /// + /// 设置需要读取的列的列表。若List为空,则读取所有列 + /// + /// 需要读取的列的列表 + public void SetColumnsToGet(HashSet columnNames) + { + this.columnsToGet = columnNames; + } + + public void CopyTo(RowQueryCriteria target) + { + target.TableName = TableName; + target.columnsToGet.UnionWith(this.columnsToGet); + target.TimeRange = TimeRange; + target.MaxVersions = MaxVersions; + target.CacheBlocks = CacheBlocks; + target.Filter = Filter; + target.StartColumn = StartColumn; + target.EndColumn = EndColumn; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/RowUpdateChange.cs b/netstandard-sdk/Aliyun/OTS/DataModel/RowUpdateChange.cs new file mode 100644 index 0000000..d6f17ea --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/RowUpdateChange.cs @@ -0,0 +1,191 @@ +using System; +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel +{ + public class RowUpdateChange : RowChange + { + + /// + /// + ///所有要更新的属性列。 + ///

若类型为{@link Type#PUT},则代表写入一个属性列。

+ ///

若类型为{@link Type#DELETE},则代表删除一个属性列的某个特定版本,对应的Column中的value无效。

+ ///

若类型为{@link Type#DELETE_ALL},则代表删除一个属性列的所有版本,对应的Column中的value和timestamp均无效。

+ /// + ///
+ private readonly List> columnsToUpdate = new List>(); + + private long? timestamp; + + public RowUpdateChange(String tableName) : base(tableName) + { + + } + + public RowUpdateChange(String tableName, PrimaryKey primaryKey) : base(tableName, primaryKey) + { + + } + + public RowUpdateChange(String tableName, PrimaryKey primaryKey, long ts) : base(tableName, primaryKey) + { + this.timestamp = ts; + } + + public RowUpdateChange(RowUpdateChange toCopy) : base(toCopy.TableName, toCopy.PrimaryKey) + { + if (toCopy.timestamp.HasValue) + { + timestamp = toCopy.timestamp; + } + + columnsToUpdate.AddRange(toCopy.columnsToUpdate); + } + + /// + /// 新写入一个属性列。 + /// + /// The put. + /// Column. + public RowUpdateChange Put(Column column) + { + this.columnsToUpdate.Add(new Tuple(column, RowChangeType.PUT)); + return this; + } + + /// + /// 新写入一个属性列。 + ///

若设置过{@link #timestamp},则使用该默认的时间戳。

+ ///
+ /// The put. + /// 属性列的名称 + /// 属性列的值 + public RowUpdateChange Put(String name, ColumnValue value) + { + Column column = null; + if (this.timestamp.HasValue) + { + column = new Column(name, value, this.timestamp.Value); + } + else + { + column = new Column(name, value); + } + + this.columnsToUpdate.Add(new Tuple(column, RowChangeType.PUT)); + return this; + } + + /// + /// 新写入一个属性列。 + /// + /// The put. + /// 属性列的名称 + /// 属性列的值 + /// 属性列的时间戳 + public RowUpdateChange Put(String name, ColumnValue value, long ts) + { + this.columnsToUpdate.Add(new Tuple(new Column(name, value, ts), RowChangeType.PUT)); + return this; + } + + /// + /// 新写入一批属性列。 + ///

属性列的写入顺序与列表中的顺序一致。

+ ///
+ /// The put. + /// 属性列列表 + public RowUpdateChange Put(List columns) + { + foreach (Column col in columns) + { + Put(col); + } + + return this; + } + + /// + /// 删除某一属性列的特定版本。 + /// + /// The column. + /// 属性列的名称 + /// 属性列的时间戳 + public RowUpdateChange DeleteColumn(String name, long ts) + { + this.columnsToUpdate.Add(new Tuple(new Column(name, null, ts), RowChangeType.DELETE)); + return this; + } + + /// + /// 删除某一属性列的所有版本。 + /// + /// The column. + /// 属性列的名称 + public RowUpdateChange DeleteColumn(String name) + { + this.columnsToUpdate.Add(new Tuple(new Column(name, null), RowChangeType.DELETE_ALL)); + return this; + } + + /// + /// 添加一列原子自增 + /// + /// + /// + public RowUpdateChange Increment(Column column) + { + this.columnsToUpdate.Add(new Tuple(column, RowChangeType.INCREMENT)); + return this; + } + + /// + /// + ///所有要更新的属性列。 + ///

若类型为{@link Type#PUT},则代表写入一个属性列。

+ ///

若类型为{@link Type#DELETE},则代表删除一个属性列的某个特定版本,对应的Column中的value无效。

+ ///

若类型为{@link Type#DELETE_ALL},则代表删除一个属性列的所有版本,对应的Column中的value和timestamp均无效。

+ /// + ///
+ /// 所有要更新的列 + public List> GetColumnsToUpdate() + { + return this.columnsToUpdate; + } + + + public new int GetDataSize() + { + int valueTotalSize = 0; + foreach (Tuple col in columnsToUpdate) + { + valueTotalSize += col.Item1.GetDataSize(); + } + + return GetPrimaryKey().GetDataSize() + valueTotalSize; + } + + + public RowUpdateChange FromUpdateOfAtrribute(UpdateOfAttribute updateOfAttribute) + { + if (updateOfAttribute.AttributeColumnsToDelete != null) + { + foreach (var attributeColumnToDelete in updateOfAttribute.AttributeColumnsToDelete) + { + this.DeleteColumn(attributeColumnToDelete); + } + } + + if (updateOfAttribute.AttributeColumnsToPut != null) + { + foreach (var attributeColumnToPut in updateOfAttribute.AttributeColumnsToPut) + { + this.Put(attributeColumnToPut.Key, attributeColumnToPut.Value); + } + } + + return this; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Collapse.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Collapse.cs new file mode 100644 index 0000000..7b2a64e --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Collapse.cs @@ -0,0 +1,13 @@ +/** + * 字段折叠,能够实现某个字段的结果去重 + *

场景举例:

+ *

app点餐场景下,我想吃八大菜系最火的菜。如果用传统的方法,我们可能需要对8个菜的type进行分别查询最火的菜。 + * 但是我们通过设置{@link Collapse}为菜系type,就可以返回8个最火的菜(每个菜系只返回一个,因为{@link Collapse}帮我们进行了去重)。一次查询搞定用户的需求。

+ */ +namespace Aliyun.OTS.DataModel.Search +{ + public class Collapse + { + public string FieldName { get; set; } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/ColumnsToGet.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/ColumnsToGet.cs new file mode 100644 index 0000000..92ba9ee --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/ColumnsToGet.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel.Search +{ + public class ColumnsToGet + { + public List Columns { get; set; } + public bool ReturnAll { get; set; } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/FieldSchema.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/FieldSchema.cs new file mode 100644 index 0000000..4cf4e6e --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/FieldSchema.cs @@ -0,0 +1,64 @@ +using System; +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel.Search +{ + public enum Analyzer + { + NotAnalyzed, + SingleWord, + MaxWord + + } + + public class FieldSchema + { + /// + /// 字段名 + /// + public string FieldName { get; set; } + /// + /// 字段类型,详见{@link FieldType} + /// + public FieldType FieldType { get; set; } + + /// + /// 是否开启索引,默认开启 + /// + public Boolean index = true; + /// + /// 倒排索引的配置选项 + /// + public IndexOptions IndexOptions { get; set; } + /// + /// 分词器设置 + /// + public Analyzer Analyzer { get; set; } + /// + /// 是否开启排序和聚合功能 + /// + public bool EnableSortAndAgg { get; set; } + + /// + /// 附加存储,是否在SearchIndex中附加存储该字段的值。 + ///开启后,可以直接从SearchIndex中读取该字段的值,而不必反查主表,可用于查询性能优化。 + /// + public bool Store { get; set; } + + /// + /// 存的值是否是一个数组 + /// + public bool IsArray { get; set; } + + /// + /// 如果 FiledType 是 NESTED ,则可使用该字段,声明一个嵌套的FieldSchema + /// + public List SubFieldSchemas { get; set; } + + public FieldSchema(string fieldName, FieldType fieldType) + { + this.FieldName = fieldName; + this.FieldType = fieldType; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/FieldType.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/FieldType.cs new file mode 100644 index 0000000..8533e53 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/FieldType.cs @@ -0,0 +1,19 @@ +namespace Aliyun.OTS.DataModel.Search +{ + public enum FieldType + { + LONG, + DOUBLE, + BOOLEAN, + /// + /// 字符串类型,同Text的区别是keyword不分词,一般作为一个整体,如果想进行聚合统计分析,请使用该类型。 + /// + KEYWORD, + /// + /// 字符串类型,同keyword的区别是text会进行分词,一般在模糊查询的场景使用。 + /// + TEXT, + NESTED, + GEO_POINT + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/GeoPoint.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/GeoPoint.cs new file mode 100644 index 0000000..3c16307 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/GeoPoint.cs @@ -0,0 +1,17 @@ +namespace Aliyun.OTS.DataModel.Search +{ + /// + /// 经纬度 + /// + public class GeoPoint + { + public double Lat { get; set; } + public double Lon { get; set; } + + public GeoPoint(double lat, double lon) + { + this.Lat = lat; + this.Lon = lon; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/IndexOptions.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/IndexOptions.cs new file mode 100644 index 0000000..5c5f130 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/IndexOptions.cs @@ -0,0 +1,16 @@ +namespace Aliyun.OTS.DataModel.Search +{ + + /// + /// 支持的索引选项控制 + /// + public enum IndexOptions + { + NULL, + DOCS, + FREQS, + POSITIONS, + OFFSETS + } + +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/IndexSchema.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/IndexSchema.cs new file mode 100644 index 0000000..2cda0be --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/IndexSchema.cs @@ -0,0 +1,19 @@ +using System.Collections.Generic; +using Aliyun.OTS.DataModel.Search.Sort; + +namespace Aliyun.OTS.DataModel.Search +{ + public class IndexSchema + { + public IndexSchema() { } + + public IndexSetting IndexSetting { get; set; } + + public List FieldSchemas { get; set; } + + /// + /// 自定义索引的预排序方式 + /// + public Sort.Sort IndexSort { get; set; } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/IndexSetting.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/IndexSetting.cs new file mode 100644 index 0000000..3a19158 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/IndexSetting.cs @@ -0,0 +1,10 @@ +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel.Search +{ + public class IndexSetting + { + public IndexSetting() { } + public List RoutingFields { get; set; } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/BoolQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/BoolQuery.cs new file mode 100644 index 0000000..580fbc0 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/BoolQuery.cs @@ -0,0 +1,46 @@ +using System.Collections.Generic; +using Google.ProtocolBuffers; +using com.alicloud.openservices.tablestore.core.protocol; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + ///联合查询(复杂查询条件下用的最多的一个查询)。Bool查询对应Lucene中的BooleanQuery,它由一个或者多个子句组成,每个子句都有特定的类型。 + ///must: 文档必须完全匹配条件 + ///should: should下面会带一个以上的条件,至少满足一个条件,这个文档就符合should + ///must_not: 文档必须不匹配条件 + /// + public class BoolQuery : IQuery + { + /// + /// 文档必须完全匹配所有的子query + /// + public List MustQueries { get; set; } + /// + /// 文档必须不能匹配任何子query + /// + public List MustNotQueries { get; set; } + /// + /// 文档必须完全匹配所有的子filter,filter类似于query,区别是不会进行算分 + /// + public List FilterQueries { get; set; } + /// + /// 文档应该至少匹配一个should,匹配多的得分会高 + /// + public List ShouldQueries { get; set; } + /// + /// 定义了至少满足几个should子句,默认是1。 + /// + public int? MinimumShouldMatch { get; set; } + + public QueryType GetQueryType() + { + return QueryType.QueryType_BoolQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildBoolQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/ConstScoreQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/ConstScoreQuery.cs new file mode 100644 index 0000000..8a56d6d --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/ConstScoreQuery.cs @@ -0,0 +1,24 @@ +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + /// 当我们不关心检索词频率TF(Term Frequency)对搜索结果排序的影响时,可以使用constant_score将查询语句query或者过滤语句filter包装起来,达到提高搜索速度。 + ///举例:我们班有100个人,有一个字段叫“name”,我们想要获得名字中包含“王”的人,我们并不关心排序结果,使用ConstScoreQuery(将原来的Query放在" private Query filter;"中)将会大大提高搜索速度。 + /// + public class ConstScoreQuery:IQuery + { + public IQuery Filter { get; set; } + + public QueryType GetQueryType() + { + return QueryType.QueryType_ConstScoreQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildConstScoreQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/FieldValueFactor.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/FieldValueFactor.cs new file mode 100644 index 0000000..75915d4 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/FieldValueFactor.cs @@ -0,0 +1,16 @@ +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + /// field_value_factor的目的是通过文档中某个字段的值计算出一个分数,以此分数来影响文档的排序。请结合{@link FunctionScoreQuery} 使用。 + ///举例:HR管理系统的场景,我们想查名字中包含“王”、出生地包含“京”的人,但是想让结果根据根据身高排序。就可以把身高设置在FieldValueFactor中 + /// + public class FieldValueFactor + { + public string FieldName { get; set; } + + public FieldValueFactor(string fieldName) + { + this.FieldName = fieldName; + } + } +} \ No newline at end of file diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/FunctionScoreQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/FunctionScoreQuery.cs new file mode 100644 index 0000000..02ca64a --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/FunctionScoreQuery.cs @@ -0,0 +1,31 @@ +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + /// 用于处理文档分值的Query,它会在查询结束后对每一个匹配的文档进行一系列的重打分操作,最后以生成的最终分数进行排序。 + ///举例见{@link FieldValueFactor} + /// + public class FunctionScoreQuery : IQuery + { + public IQuery Query { get; set; } + public FieldValueFactor FieldValueFactor { get; set; } + + public FunctionScoreQuery(IQuery query, FieldValueFactor fieldValueFactor) + { + this.Query = query; + this.FieldValueFactor = fieldValueFactor; + } + + public QueryType GetQueryType() + { + return QueryType.QueryType_FunctionScoreQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildFunctionScoreQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/GeoBoundingBoxQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/GeoBoundingBoxQuery.cs new file mode 100644 index 0000000..469b725 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/GeoBoundingBoxQuery.cs @@ -0,0 +1,35 @@ +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + /// 找出经纬度落在指定矩形内的数据。 + ///场景举例:订单区域画像分析的场景,想分析A小区购买力,而恰好这A小区是矩形的。我们通过统计A小区订单数量(或总价)即可。 + ///方法:在SearchQuery的中构造一个{@link BoolQuery},其 mustQueries 中放入一个{@link GeoBoundingBoxQuery}的矩形地理位置,然后mustQueries再放入查询订单数量的query,就可以获得想要的结果。 + /// + public class GeoBoundingBoxQuery : IQuery + { + public string FieldName { get; set; } + /** + * 矩形的左上角的经纬度 + *

示例:"46.24123424, 23.2342424"

+ */ + public string TopLeft { get; set; } + /** + * 矩形的右下角经纬度 + *

示例:"46.24123424, 23.2342424"

+ */ + public string BottomRight { get; set; } + + public QueryType GetQueryType() + { + return QueryType.QueryType_GeoBoundingBoxQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildGeoBoundingBoxQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/GeoDistanceQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/GeoDistanceQuery.cs new file mode 100644 index 0000000..f2a642a --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/GeoDistanceQuery.cs @@ -0,0 +1,36 @@ +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + /// 找出与某个位置某个距离内的数据。 + ///常用场景:搜索我附近1千米内的人。

+ ///通过设置我的centerPoint(一个经纬度信息),然后设置举例信息distanceInMeter=1000,进行查询即可 + ///
+ public class GeoDistanceQuery : IQuery + { + /// + /// 字段名 + /// + public string FieldName { get; set; } + /// + /// 中心点 + /// + public string CenterPoint { get; set; } + /// + /// 与中心点的距离(单位:米) + /// + public double DistanceInMeter { get; set; } + + public QueryType GetQueryType() + { + return QueryType.QueryType_GeoDistanceQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildGeoDistanceQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/GeoPolygonQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/GeoPolygonQuery.cs new file mode 100644 index 0000000..1f31990 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/GeoPolygonQuery.cs @@ -0,0 +1,33 @@ +using System.Collections.Generic; +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + /// 找出落在指定多边形包围起来的图形内的数据 + ///注意:这个查询器使用代价很大,请避免使用

+ ///场景举例:小黄车只能在繁华的地方服务,出了市区要收额外的服务费,而繁华的城市的边界是多边形的。我们想查询该车辆是否需要付额外的服务费,就需要通过搜索用户的经纬度是否在多边形内。 + ///
+ public class GeoPolygonQuery : IQuery + { + /// + /// 字段名 + /// + public string FieldName { get; set; } + /// + /// 经纬度字符串的List + /// + public List Points { get; set; } + + public QueryType GetQueryType() + { + return QueryType.QueryType_GeoPolygonQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildGeoPolygonQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/IQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/IQuery.cs new file mode 100644 index 0000000..b937c54 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/IQuery.cs @@ -0,0 +1,16 @@ +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /** + * IQuery接口,具体介绍请查看具体的实现类的说明 + */ + public interface IQuery + { + + QueryType GetQueryType(); + + ByteString Serialize(); + + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/MatchAllQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/MatchAllQuery.cs new file mode 100644 index 0000000..11f6703 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/MatchAllQuery.cs @@ -0,0 +1,21 @@ +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + /// 获取所有的文档,所有文档分数为1。返回的结果中:命中数永远都是正确的。加入返回的结果过多,SearchIndex会只返回部分数据。 + /// + public class MatchAllQuery : IQuery + { + public QueryType GetQueryType() + { + return QueryType.QueryType_MatchAllQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildMatchAllQuery().ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/MatchPhraseQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/MatchPhraseQuery.cs new file mode 100644 index 0000000..20fa777 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/MatchPhraseQuery.cs @@ -0,0 +1,30 @@ +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + /// 类似 {@link MatchQuery} (MatchQuery 仅匹配某个词即可),但是 MatchPhraseQuery会匹配所有的短语。 + /// + public class MatchPhraseQuery : IQuery + { + public string FieldName { get; set; } + public string Text { get; set; } + + public MatchPhraseQuery(string fieldName, string text) + { + this.FieldName = fieldName; + this.Text = text; + } + + public QueryType GetQueryType() + { + return QueryType.QueryType_MatchPhraseQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildMatchPhraseQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/MatchQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/MatchQuery.cs new file mode 100644 index 0000000..21124c4 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/MatchQuery.cs @@ -0,0 +1,46 @@ +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + /// 包括模糊匹配和短语或邻近查询 + /// + public class MatchQuery : IQuery + { + /// + /// 字段 + /// + public string FieldName { get; set; } + /// + /// 模糊匹配的值 + /// + public string Text { get; set; } + + /// + /// 最小匹配个数 + /// + public int? MinimumShouldMatch { get; set; } + + /// + /// 操作符 + /// + public QueryOperator Operator { get; set; } + + public MatchQuery(string fieldName, string text) + { + this.FieldName = fieldName; + this.Text = text; + } + + public QueryType GetQueryType() + { + return QueryType.QueryType_MatchQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildMatchQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/NestedQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/NestedQuery.cs new file mode 100644 index 0000000..b2ad64c --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/NestedQuery.cs @@ -0,0 +1,36 @@ +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + ///嵌套查询可以查询嵌套的对象/文档。 + ///举例:我们的文档是这样的:{"id":"1","os":{"name":"win7","ip":"127.0.0.1"}},我们想搜索os的name, + ///但是不能直接查询,需要通过{@link NestedQuery}来进行查询。在"path"设置为“os”,然后query中放一个正常的Query + /// + public class NestedQuery : IQuery + { + /// + /// 嵌套文档的路径 + /// + public string Path { get; set; } + /// + /// 一个query + /// + public IQuery Query { get; set; } + /// + /// 多值字段获取文档得分的模式 + /// + public ScoreMode ScoreMode { get; set; } + + public QueryType GetQueryType() + { + return QueryType.QueryType_NestedQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildNestedQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/PrefixQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/PrefixQuery.cs new file mode 100644 index 0000000..1d352e8 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/PrefixQuery.cs @@ -0,0 +1,32 @@ +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + /// 匹配前缀。比如搜索“name”是以“王”字开头的所有人。 + /// + public class PrefixQuery : IQuery + { + public string FieldName { get; set; } + /** + * 字符串前缀 + */ + public string Prefix { get; set; } + + public PrefixQuery(string fieldName, string prefix) { + this.FieldName = fieldName; + this.Prefix = prefix; + } + + public QueryType GetQueryType() + { + return QueryType.QueryType_PrefixQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildPrefixQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/QueryOperator.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/QueryOperator.cs new file mode 100644 index 0000000..be370e1 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/QueryOperator.cs @@ -0,0 +1,8 @@ +namespace Aliyun.OTS.DataModel.Search.Query +{ + public enum QueryOperator + { + OR, + AND + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/QueryType.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/QueryType.cs new file mode 100644 index 0000000..fe32272 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/QueryType.cs @@ -0,0 +1,25 @@ +namespace Aliyun.OTS.DataModel.Search.Query +{ + /** + * SearchIndex支持的Query类型 + */ + public enum QueryType + { + QueryType_None, + QueryType_MatchQuery, + QueryType_MatchPhraseQuery, + QueryType_TermQuery, + QueryType_RangeQuery, + QueryType_PrefixQuery, + QueryType_BoolQuery, + QueryType_ConstScoreQuery, + QueryType_FunctionScoreQuery, + QueryType_NestedQuery, + QueryType_WildcardQuery, + QueryType_MatchAllQuery, + QueryType_GeoBoundingBoxQuery, + QueryType_GeoDistanceQuery, + QueryType_GeoPolygonQuery, + QueryType_TermsQuery + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/RangeQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/RangeQuery.cs new file mode 100644 index 0000000..4f72b05 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/RangeQuery.cs @@ -0,0 +1,49 @@ +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + /// 范围查询。通过设置一个范围(from,to),查询该范围内的所有数据。 + /// + public class RangeQuery : IQuery + { + /// + /// 字段名 + /// + public string FieldName { get; set; } + /// + /// 字段取值的下界 + /// + public ColumnValue From { get; set; } + /// + /// 字段取值的上界 + /// + public ColumnValue To { get; set; } + /// + /// 范围取值是否包含下界 + /// + public bool IncludeLower { get; set; } + /// + /// 范围取值是否包含上界 + /// + public bool IncludeUpper { get; set; } + + public RangeQuery(string fieldName, ColumnValue from, ColumnValue to) + { + this.FieldName = fieldName; + this.From = from; + this.To = to; + } + + public QueryType GetQueryType() + { + return QueryType.QueryType_RangeQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildRangeQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/ScoreMode.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/ScoreMode.cs new file mode 100644 index 0000000..d06b4e3 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/ScoreMode.cs @@ -0,0 +1,16 @@ +namespace Aliyun.OTS.DataModel.Search.Query +{ + + /// + /// 一个字段多个值的情况下,采用哪个值来进行排序。 + ///举例:有一个小学生学生状态监测系统,其中存了小学生的身高,但是小学生身高一直在长,所以“身高”这个字段,采用了array的方式。然后我们查询的时候,想根据身高进行排序,就可以设置ScoreMode为MAX,这样就能得到最近的一次身高 + /// + public enum ScoreMode + { + None, + Avg, + Max, + Min, + Total, + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/TermQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/TermQuery.cs new file mode 100644 index 0000000..b8bebd5 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/TermQuery.cs @@ -0,0 +1,30 @@ +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + /// 精确的term查询。 + /// + public class TermQuery : IQuery + { + public string FieldName { get; set; } + public ColumnValue Term { get; set; } + + public TermQuery(string fieldName, ColumnValue term) + { + this.FieldName = fieldName; + this.Term = term; + } + + public QueryType GetQueryType() + { + return QueryType.QueryType_TermQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildTermQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/TermsQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/TermsQuery.cs new file mode 100644 index 0000000..26fd5f8 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/TermsQuery.cs @@ -0,0 +1,23 @@ +using System.Collections.Generic; +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + public class TermsQuery : IQuery + { + public string FieldName { get; set; } + + public List Terms { get; set; } + + public QueryType GetQueryType() + { + return QueryType.QueryType_TermsQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildTermsQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/WildcardQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/WildcardQuery.cs new file mode 100644 index 0000000..d112a3e --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Query/WildcardQuery.cs @@ -0,0 +1,31 @@ +using com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; + +namespace Aliyun.OTS.DataModel.Search.Query +{ + /// + /// 通配符查询。支持 *( 任意0或多个)和 ?(任意1个字符)。 + ///举例:名字字段是“name”,想查询名字中包含“龙”的人,就可以“* 龙*” ,但是效率可能不高。 + /// + public class WildcardQuery : IQuery + { + public string FieldName { get; set; } + public string Value { get; set; } + + public WildcardQuery(string fieldName, string value) + { + this.FieldName = fieldName; + this.Value = value; + } + + public QueryType GetQueryType() + { + return QueryType.QueryType_WildcardQuery; + } + + public ByteString Serialize() + { + return SearchQueryBuilder.BuildWildcardQuery(this).ToByteString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/SearchIndexInfo.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/SearchIndexInfo.cs new file mode 100644 index 0000000..ba1dd7c --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/SearchIndexInfo.cs @@ -0,0 +1,8 @@ +namespace Aliyun.OTS.DataModel.Search +{ + public class SearchIndexInfo + { + public string TableName { get; set; } + public string IndexName { get; set; } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/SearchQuery.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/SearchQuery.cs new file mode 100644 index 0000000..35f4566 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/SearchQuery.cs @@ -0,0 +1,50 @@ +using Aliyun.OTS.DataModel.Search.Query; + +namespace Aliyun.OTS.DataModel.Search +{ + public class SearchQuery + { + /// + /// 分页起始数量 + /// + public int? Offset { get; set; } + /// + /// 分页大小,即返回的行数 + /// + public int? Limit { get; set; } + /// + /// 查询语句 + /// + public IQuery Query { get; set; } + /// + /// 字段折叠 + /// 能够实现某个字段的结果去重。 + /// + public Collapse Collapse { get; set; } + /// + /// 排序 + /// 设置结果的排序方式,该参数支持多字段排序

+ ///
+ public Sort.Sort Sort { get; set; } + /// + /// 获取总行数,默认设置为false + /// + public bool GetTotalCount { get; set; } + + private byte[] token { get; set; } + + public byte[] Token + { + get + { + return this.token; + } + set + { + //Token中编码了Sort条件,所以设置Token时不需要设置Sort + this.token = value; + this.Sort = null; + } + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/FieldSort.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/FieldSort.cs new file mode 100644 index 0000000..de8b1ed --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/FieldSort.cs @@ -0,0 +1,24 @@ +namespace Aliyun.OTS.DataModel.Search.Sort +{ + public class FieldSort : ISorter + { + private SortOrder order = SortOrder.ASC; + + public string FieldName { get; set; } + public SortMode Mode { get; set; } + public NestedFilter NestedFilter { get; set; } + + public SortOrder Order + { + get { return order; } + set { order = value; } + } + + public FieldSort(string fieldName, SortOrder order) + { + this.FieldName = fieldName; + this.Order = order; + } + } +} + diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/GeoDistanceSort.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/GeoDistanceSort.cs new file mode 100644 index 0000000..cde38f8 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/GeoDistanceSort.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel.Search.Sort +{ + public class GeoDistanceSort : ISorter + { + /** + * 排序的字段 + */ + public string FieldName { get; set; } + /** + * 排序的地理位置点 + */ + public List Points { get; set; } + /** + * 升序或降序 + */ + public SortOrder Order { get; set; } + /** + * 多值字段的排序依据 + */ + public SortMode Mode { get; set; } + /** + * 计算两点距离的算法 + */ + public GeoDistanceType DistanceType { get; set; } + /** + * 嵌套的过滤器 + */ + public NestedFilter NestedFilter { get; set; } + + public GeoDistanceSort(String fieldName, List points) + { + this.FieldName = fieldName; + this.Points = points; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/GeoDistanceType.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/GeoDistanceType.cs new file mode 100644 index 0000000..2e19cd4 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/GeoDistanceType.cs @@ -0,0 +1,18 @@ +namespace Aliyun.OTS.DataModel.Search.Sort +{ + + /** + * 地理空间类型的Field在计算距离的时候采用的模型(默认为ARC) + */ + public enum GeoDistanceType + { + /** + * 弧形(因为地球是弧形的,采用该设置可精确距离,但计算量较大) + */ + ARC, + /** + * 把地球看成平面,计算两点距离(精确值不够,但是计算量小) + */ + PLANE + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/ISorter.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/ISorter.cs new file mode 100644 index 0000000..fe54ecb --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/ISorter.cs @@ -0,0 +1,6 @@ +namespace Aliyun.OTS.DataModel.Search.Sort +{ + public interface ISorter + { + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/NestedFilter.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/NestedFilter.cs new file mode 100644 index 0000000..c24847e --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/NestedFilter.cs @@ -0,0 +1,19 @@ +using Aliyun.OTS.DataModel.Search.Query; + +namespace Aliyun.OTS.DataModel.Search.Sort +{ + /** + * 一个嵌套的过滤器 + */ + public class NestedFilter + { + public string Path { get; set; } + public IQuery Query { get; set; } + + public NestedFilter(string path, IQuery query) + { + this.Path = path; + this.Query = query; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/PrimaryKeySort.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/PrimaryKeySort.cs new file mode 100644 index 0000000..d0b3bd6 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/PrimaryKeySort.cs @@ -0,0 +1,14 @@ +namespace Aliyun.OTS.DataModel.Search.Sort +{ + public class PrimaryKeySort : ISorter + { + public SortOrder Order { get; set; } + + public PrimaryKeySort() { } + + public PrimaryKeySort(SortOrder order) + { + this.Order = order; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/ScoreSort.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/ScoreSort.cs new file mode 100644 index 0000000..c2b5e89 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/ScoreSort.cs @@ -0,0 +1,19 @@ +namespace Aliyun.OTS.DataModel.Search.Sort +{ + public class ScoreSort : ISorter + { + private SortOrder order = SortOrder.DESC; + + public SortOrder Order + { + get + { + return order; + } + set + { + order = value; + } + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/Sort.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/Sort.cs new file mode 100644 index 0000000..10f5403 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/Sort.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel.Search.Sort +{ + public class Sort + { + public List Sorters { get; set; } + + public Sort(List sorters) + { + this.Sorters = sorters; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/SortMode.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/SortMode.cs new file mode 100644 index 0000000..03d5d00 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/SortMode.cs @@ -0,0 +1,15 @@ +namespace Aliyun.OTS.DataModel.Search.Sort +{ + + /** + * 选取一个Field的哪个值进行排序 + *

大多数情况下,一个字段只有一个值,所以这项无意义,默认为 MIN

+ *

当一个字段是一个集合(Array)时候,可以设置用该集合中的某一个值作为排序的依据

+ */ + public enum SortMode + { + MIN, + MAX, + AVG + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/SortOrder.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/SortOrder.cs new file mode 100644 index 0000000..10613b2 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/Sort/SortOrder.cs @@ -0,0 +1,11 @@ +namespace Aliyun.OTS.DataModel.Search.Sort +{ + /** + * 排序的顺序(升序或降序) + */ + public enum SortOrder + { + ASC, + DESC + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/Search/SyncStat.cs b/netstandard-sdk/Aliyun/OTS/DataModel/Search/SyncStat.cs new file mode 100644 index 0000000..882a821 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/Search/SyncStat.cs @@ -0,0 +1,15 @@ +namespace Aliyun.OTS.DataModel.Search +{ + public enum SyncPhase + { + FULL, + INCR + } + + public class SyncStat + { + + public SyncPhase SyncPhase; + public long CurrentSyncTimestamp; + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/SingleRowQueryCriteria.cs b/netstandard-sdk/Aliyun/OTS/DataModel/SingleRowQueryCriteria.cs new file mode 100644 index 0000000..bc7987b --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/SingleRowQueryCriteria.cs @@ -0,0 +1,44 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + */ + +namespace Aliyun.OTS.DataModel +{ + public class SingleRowQueryCriteria : RowQueryCriteria, IRow + { + /// + /// 设置和获取主键 + /// + public PrimaryKey RowPrimaryKey {get;set;} + + /// + /// 用于行内流式读, 标记位置和状态信息. + /// + /// The token. + public byte[] Token { get; set; } + + /// + /// 构造一个在给定名称的表中查询的条件。 + /// + /// 查询的表名 + public SingleRowQueryCriteria(string tableName) + : base(tableName) + { } + + public PrimaryKey GetPrimaryKey() + { + return this.RowPrimaryKey; + } + + public int CompareTo(IRow other) + { + return this.RowPrimaryKey.CompareTo(other.GetPrimaryKey()); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/StreamDetails.cs b/netstandard-sdk/Aliyun/OTS/DataModel/StreamDetails.cs new file mode 100644 index 0000000..b23870a --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/StreamDetails.cs @@ -0,0 +1,32 @@ +using System; +namespace Aliyun.OTS.DataModel +{ + public class StreamDetails + { + /// + /// 该表是否打开stream + /// + public bool EnableStream { private set; get; } + + /// + /// 该表的stream的id + /// + public string StreamId { set; get; } + + /// + /// 该表的stream的过期时间 + /// + public int ExpirationTime { set; get; } + + /// + /// 该stream的打开的时间 + /// + public Int64 LastEnableTime { set; get; } + + + public StreamDetails(bool enableStream) + { + EnableStream = enableStream; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/StreamSpecification.cs b/netstandard-sdk/Aliyun/OTS/DataModel/StreamSpecification.cs new file mode 100644 index 0000000..6ef86e9 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/StreamSpecification.cs @@ -0,0 +1,15 @@ +using System; +namespace Aliyun.OTS.DataModel +{ + public class StreamSpecification + { + public bool EnableStream { get; set; } + + public int ExpirationTime { get; set; } + + public StreamSpecification( bool enableStream) + { + EnableStream = enableStream; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/TableMeta.cs b/netstandard-sdk/Aliyun/OTS/DataModel/TableMeta.cs new file mode 100644 index 0000000..d00d68b --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/TableMeta.cs @@ -0,0 +1,49 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel +{ + /// + /// 表的元信息。建表时需要设定TableMeta,DescribeTable时可以返回这个TableMeta。 + /// + public class TableMeta + { + /// + /// 表名 + /// + public string TableName { get; set; } + + /// + /// 主键的设计,包括每一个主键列的列名和列值类型,有序。 + /// + public PrimaryKeySchema PrimaryKeySchema { get; set; } + + /// + /// 预定义列 + /// + public DefinedColumnSchema DefinedColumnSchema { get; set; } + + public TableMeta(string tableName, PrimaryKeySchema primaryKeySchema) + { + TableName = tableName; + PrimaryKeySchema = primaryKeySchema; + } + + public TableMeta(string tableName, DefinedColumnSchema definedColumnSchema) + { + TableName = tableName; + DefinedColumnSchema = definedColumnSchema; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/TableOptions.cs b/netstandard-sdk/Aliyun/OTS/DataModel/TableOptions.cs new file mode 100644 index 0000000..bbd4cac --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/TableOptions.cs @@ -0,0 +1,28 @@ +using System; +namespace Aliyun.OTS.DataModel +{ + public class TableOptions + { + /// + /// 本张表中保存的数据的存活时间,单位秒 + /// + public int? TimeToLive{ get; set; } + + /// + /// 本张表保留的最大版本数 + /// + public int? MaxVersions{ get; set; } + + /// + /// 最大版本偏差,目的主要是为了禁止写入与预期较大的数据 + /// + public Int64? DeviationCellVersionInSec { get; set; } + + public BloomFilterType? BloomFilterType { get; set; } // 可以动态更改 + + /// + /// 最大版本偏差,目的主要是为了禁止写入与预期较大的数据 + /// + public int? BlockSize { get; set; } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/TimeRange.cs b/netstandard-sdk/Aliyun/OTS/DataModel/TimeRange.cs new file mode 100644 index 0000000..bcd7b35 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/TimeRange.cs @@ -0,0 +1,10 @@ +using System; +namespace Aliyun.OTS.DataModel +{ + public class TimeRange + { + public Int64? StartTime { get; set; } + public Int64? EndTime { get; set; } + public Int64? SpecificTime { get; set; } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/DataModel/UpdateOfAttribute.cs b/netstandard-sdk/Aliyun/OTS/DataModel/UpdateOfAttribute.cs new file mode 100644 index 0000000..cfb3407 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/DataModel/UpdateOfAttribute.cs @@ -0,0 +1,47 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System.Collections.Generic; + +namespace Aliyun.OTS.DataModel +{ + /// + /// 表示对属性的修改,用于接口。 + /// + public class UpdateOfAttribute + { + /// + /// 表示要删除的列的列名List。 + /// + public IList AttributeColumnsToDelete { get; private set; } + + /// + /// 表示要写入的列的列名和列值。 + /// + public IDictionary AttributeColumnsToPut { get; private set; } + + public UpdateOfAttribute() + { + AttributeColumnsToDelete = new List(); + AttributeColumnsToPut = new Dictionary(); + } + + public void AddAttributeColumnToDelete(string columnName) + { + AttributeColumnsToDelete.Add(columnName); + } + + public void AddAttributeColumnToPut(string columnName, ColumnValue columnValue) + { + AttributeColumnsToPut.Add(columnName, columnValue); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Handler/Context.cs b/netstandard-sdk/Aliyun/OTS/Handler/Context.cs new file mode 100644 index 0000000..84cdca0 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Handler/Context.cs @@ -0,0 +1,50 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System.Collections.Generic; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; + +using Aliyun.OTS.Request; +using Aliyun.OTS.Response; + +namespace Aliyun.OTS.Handler +{ + public class Context + { + public OTSClientConfig ClientConfig { get; set; } + + public HttpClient HttpClient { get; set; } + public string APIName { get; set; } + public Task HttpTask; + + public int RetryTimes { get; set; } + + // For Request + public OTSRequest OTSRequest { get; set; } + public string HttpRequestQuery { get; set; } + public Dictionary HttpRequestHeaders { get; set; } + public byte[] HttpRequestBody { get; set; } + + // For Response + public OTSResponse OTSReponse { get; set; } + public HttpResponseMessage HttpResponseMessage { get; set; } + public HttpStatusCode HttpResponseStatusCode { get; set; } + public Dictionary HttpResponseHeaders { get; set; } + public byte[] HttpResponseBody { get; set; } + + public Context() + { + RetryTimes = 0; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Handler/ErrorHandler.cs b/netstandard-sdk/Aliyun/OTS/Handler/ErrorHandler.cs new file mode 100644 index 0000000..6c6a654 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Handler/ErrorHandler.cs @@ -0,0 +1,89 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +using PB = com.alicloud.openservices.tablestore.core.protocol; + +namespace Aliyun.OTS.Handler +{ + public class ErrorHandler : PipelineHandler + { + public ErrorHandler(PipelineHandler innerHandler) : base(innerHandler) { } + + public override void HandleBefore(Context context) + { + InnerHandler.HandleBefore(context); + } + + private void throwOTSServerException(Context context) + { + var exception = new OTSServerException(context.APIName, context.HttpResponseStatusCode); + if (context.ClientConfig.OTSErrorLogHandler != null) { + context.ClientConfig.OTSErrorLogHandler(exception.ToString() + "\n"); + } + throw exception; + } + + public override void HandleAfter(Context context) + { + + OTSServerException exception; + InnerHandler.HandleAfter(context); + + var statusCode = context.HttpResponseStatusCode; + + if ((int)statusCode >= 200 && (int)statusCode < 300) + { + return; + } + + var builder = PB.Error.CreateBuilder(); + string errorCode = null, errorMessage = null; + + try + { + builder.MergeFrom(context.HttpResponseBody); + var message = builder.Build(); + errorCode = message.Code; + errorMessage = message.Message; + } catch (Google.ProtocolBuffers.InvalidProtocolBufferException) { + throwOTSServerException(context); + } catch (Google.ProtocolBuffers.UninitializedMessageException) { + throwOTSServerException(context); + } + + string requestID; + if (context.HttpResponseHeaders.ContainsKey("x-ots-requestid")) + { + requestID = context.HttpResponseHeaders["x-ots-requestid"]; + } + else + { + requestID = null; + } + + exception = new OTSServerException( + context.APIName, + statusCode, + errorCode, + errorMessage, + requestID + ); + + if(context.ClientConfig.OTSErrorLogHandler != null) + { + context.ClientConfig.OTSErrorLogHandler.Invoke(exception.ToString()); + } + + throw exception; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Handler/HttpHandler.cs b/netstandard-sdk/Aliyun/OTS/Handler/HttpHandler.cs new file mode 100644 index 0000000..15bcec3 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Handler/HttpHandler.cs @@ -0,0 +1,74 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Net.Http; + + +namespace Aliyun.OTS.Handler +{ + public class HttpHandler : PipelineHandler + { + public override void HandleBefore(Context context) + { + HttpContent content = new ByteArrayContent(context.HttpRequestBody); + content.Headers.Clear(); + + foreach (var item in context.HttpRequestHeaders) + { + content.Headers.Add(item.Key, item.Value); + } + + Task task = context.HttpClient.PostAsync(context.APIName, content); + context.HttpTask = task; + } + + public override void HandleAfter(Context context) + { + HttpResponseMessage responseMessage = context.HttpTask.Result; + var task = responseMessage.Content.ReadAsByteArrayAsync(); + task.Wait(); + + if (OTSClientTestHelper.HTTPResponseBodyIsSet) + { + context.HttpResponseBody = OTSClientTestHelper.HTTPResponseBody; + } + else + { + context.HttpResponseBody = task.Result; + } + + if (OTSClientTestHelper.HttpStatusCodeIsSet) + { + context.HttpResponseStatusCode = OTSClientTestHelper.HttpStatusCode; + } + else + { + context.HttpResponseStatusCode = responseMessage.StatusCode; + } + + if (OTSClientTestHelper.HttpResponseHeadersIsSet) + { + context.HttpResponseHeaders = OTSClientTestHelper.HttpRequestHeaders; + } + else + { + context.HttpResponseHeaders = new Dictionary(); + foreach (var item in responseMessage.Headers) + { + context.HttpResponseHeaders.Add(item.Key.ToLower(), item.Value.ElementAt(0)); + } + } + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Handler/HttpHeaderHandler.cs b/netstandard-sdk/Aliyun/OTS/Handler/HttpHeaderHandler.cs new file mode 100644 index 0000000..002297a --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Handler/HttpHeaderHandler.cs @@ -0,0 +1,231 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; +using System.Collections.Generic; +using System.Net; +using System.Security.Cryptography; + +namespace Aliyun.OTS.Handler +{ + public class HttpHeaderHandler : PipelineHandler + { + public static int MAX_TIME_DEVIATION_IN_MINUTES = 15; + + private static readonly string[] HeaderNames = { + "x-ots-contentmd5", + "x-ots-requestid", + "x-ots-date", + "x-ots-contenttype", + }; + + public HttpHeaderHandler(PipelineHandler innerHandler) : base(innerHandler) { } + + private string MakeHeaderString(Dictionary headers) + { + List items = new List(); + + foreach (var item in headers) + { + if (item.Key.StartsWith("x-ots-", StringComparison.Ordinal)) + { + items.Add(String.Format("{0}:{1}", item.Key, item.Value)); + } + } + + items.Sort(); + return String.Join("\n", items); + } + + private string ComputeSignature(string signatureString, string accessKeySecret) + { + var hmac = new HMACSHA1(System.Text.Encoding.ASCII.GetBytes(accessKeySecret)); + byte[] hashValue = hmac.ComputeHash(System.Text.Encoding.ASCII.GetBytes(signatureString)); + string signature = System.Convert.ToBase64String(hashValue); + return signature; + } + + private string MakeRequestSignature(Context context, Dictionary headers) + { + string headerString = MakeHeaderString(headers); + string signatureString = context.APIName + "\nPOST\n\n" + headerString + '\n'; + return ComputeSignature(signatureString, context.ClientConfig.AccessKeySecret); + } + + private string MakeResponseSignature(Context context) + { + string headerString = MakeHeaderString(context.HttpResponseHeaders); + string signatureString = headerString + "\n" + context.APIName; + return ComputeSignature(signatureString, context.ClientConfig.AccessKeySecret); + } + + public override void HandleBefore(Context context) + { + + var headers = new Dictionary(); + + // Step 1, compute Content MD5 + var md5hash = MD5.Create(); + byte[] hashData = md5hash.ComputeHash(context.HttpRequestBody); + string contentMD5 = Convert.ToBase64String(hashData); + headers.Add("x-ots-contentmd5", contentMD5); + + // Step 2, make date time string + var dateString = Util.OtsUtils.FormatDateTimeStr(DateTime.UtcNow); + headers.Add("x-ots-date", dateString); + + // Step 3, other headers + headers.Add("x-ots-apiversion", context.ClientConfig.APIVersion); + headers.Add("x-ots-accesskeyid", context.ClientConfig.AccessKeyID); + headers.Add("x-ots-instancename", context.ClientConfig.InstanceName); + + headers.Add("x-ots-user-agent", context.ClientConfig.UserAgent); + + // Step 4, compute signature + string signature = MakeRequestSignature(context, headers); + headers.Add("x-ots-signature", signature); + + context.HttpRequestHeaders = headers; + + InnerHandler.HandleBefore(context); + } + + private void CheckOtherHeaders(Context context) + { + var headers = context.HttpResponseHeaders; + + // Step 1, make sure we have all headers + if ((int)context.HttpResponseStatusCode >= 200 + && (int)context.HttpResponseStatusCode < 300) + { + foreach (string name in HeaderNames) + { + if (!headers.ContainsKey(name)) + { + throw new OTSClientException(String.Format( + "{0} is missing in response header.", name + )); + } + } + } + + // Step 2, check md5 + if (headers.ContainsKey("x-ots-contentmd5")) + { + var md5hash = MD5.Create(); + byte[] hashData = md5hash.ComputeHash(context.HttpResponseBody); + string contentMD5 = System.Convert.ToBase64String(hashData); + if (contentMD5 != headers["x-ots-contentmd5"]) + { + throw new OTSClientException("MD5 mismatch in response."); + } + } + + // Step 3, check date + if (headers.ContainsKey("x-ots-date")) + { + string serverTimeString = headers["x-ots-date"]; + DateTime serverTime; + try + { + serverTime = DateTime.Parse(serverTimeString).ToUniversalTime(); + } + catch (System.FormatException) + { + throw new OTSClientException(String.Format( + "Invalid date format in response: {0}", serverTimeString + )); + } + + var clientTime = DateTime.UtcNow; + if (Math.Abs((serverTime - clientTime).TotalSeconds) > MAX_TIME_DEVIATION_IN_MINUTES * 60) + { + throw new OTSClientException("The difference between date in response and system time is more than 15 minutes."); + } + } + + } + + private void CheckAuthorization(Context context) + { + // Step 1, Check if authorization header is there + if (!context.HttpResponseHeaders.ContainsKey("authorization")) + { + if ((int)context.HttpResponseStatusCode >= 200 + && (int)context.HttpResponseStatusCode < 300) + { + throw new OTSClientException("\"Authorization\" is missing in response header."); + } + + return; + } + + string authorization = context.HttpResponseHeaders["authorization"]; + + // Step 2, check if authorization is valid + if (!authorization.StartsWith("OTS ", StringComparison.Ordinal)) + { + throw new OTSClientException("Invalid Authorization in response."); + } + + string[] splits = authorization.Substring(4).Split(':'); + if (splits.Length != 2) + { + throw new OTSClientException("Invalid Authorization in response."); + } + + // Step 3, check accessKeyID + string accessKeyID = splits[0]; + if (accessKeyID != context.ClientConfig.AccessKeyID) + { + throw new OTSClientException("Access Key ID mismatch in response."); + } + + // Step 4, check signature + string signature = splits[1]; + if (signature != MakeResponseSignature(context)) + { + throw new OTSClientException("Signature mismatch in response."); + } + } + + public override void HandleAfter(Context context) + { + InnerHandler.HandleAfter(context); + + // Disable reponse validation + if (context.ClientConfig.SkipResponseValidation) + { + return; + } + + try + { + CheckOtherHeaders(context); + + // Header['authorization'] is not neccessarily available + // when HttpStatusCode.Forbidden happens. + if (context.HttpResponseStatusCode != HttpStatusCode.Forbidden) + { + CheckAuthorization(context); + } + } + catch (OTSClientException e) + { + // re-throw the exception with additonal information + throw new OTSClientException( + String.Format("{0} HTTP Status: {1}.", e.Message, context.HttpResponseStatusCode), + context.HttpResponseStatusCode + ); + } + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Handler/OTSHandler.cs b/netstandard-sdk/Aliyun/OTS/Handler/OTSHandler.cs new file mode 100644 index 0000000..fd1a5b2 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Handler/OTSHandler.cs @@ -0,0 +1,40 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +namespace Aliyun.OTS.Handler +{ + public class OTSHandler : PipelineHandler + { + public OTSHandler() + { + PipelineHandler inner; + inner = new HttpHandler(); + inner = new HttpHeaderHandler(inner); + inner = new ErrorHandler(inner); + inner = new ProtocolBufferDecoder(inner); + inner = new ProtocolBufferEncoder(inner); + inner = new RetryHandler(inner); + InnerHandler = inner; + } + + + public override void HandleBefore(Context context) + { + InnerHandler.HandleBefore(context); + } + + public override void HandleAfter(Context context) + { + InnerHandler.HandleAfter(context); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Handler/PipelineHandler.cs b/netstandard-sdk/Aliyun/OTS/Handler/PipelineHandler.cs new file mode 100644 index 0000000..9112c7a --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Handler/PipelineHandler.cs @@ -0,0 +1,32 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +namespace Aliyun.OTS.Handler +{ + public abstract class PipelineHandler + { + protected PipelineHandler InnerHandler { get; set; } + + protected PipelineHandler() + { + InnerHandler = null; + } + + protected PipelineHandler(PipelineHandler innerHandler) + { + InnerHandler = innerHandler; + } + + public abstract void HandleBefore(Context context); + public abstract void HandleAfter(Context context); + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Handler/ProtocolBufferDecoder.cs b/netstandard-sdk/Aliyun/OTS/Handler/ProtocolBufferDecoder.cs new file mode 100644 index 0000000..8668e0b --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Handler/ProtocolBufferDecoder.cs @@ -0,0 +1,772 @@ +using System; +using System.Collections.Generic; +using Google.ProtocolBuffers; +using System.IO; +using PB = com.alicloud.openservices.tablestore.core.protocol; +using Aliyun.OTS.DataModel.Search; +using com.alicloud.openservices.tablestore.core.protocol; + +namespace Aliyun.OTS.Handler +{ + public class ProtocolBufferDecoder : PipelineHandler + { + private delegate Response.OTSResponse ResponseDecoder(byte[] body, out IMessage message); + private readonly Dictionary DecoderMap; + + public ProtocolBufferDecoder(PipelineHandler innerHandler) : base(innerHandler) + { + DecoderMap = new Dictionary() { + { "/CreateTable", DecodeCreateTable }, + { "/DeleteTable", DecodeDeleteTable }, + { "/UpdateTable", DecodeUpdateTable }, + { "/DescribeTable", DecodeDescribeTable }, + { "/ListTable", DecodeListTable }, + + { "/PutRow", DecodePutRow }, + { "/GetRow", DecodeGetRow }, + { "/UpdateRow", DecodeUpdateRow }, + { "/DeleteRow", DecodeDeleteRow }, + + { "/BatchWriteRow", DecodeBatchWriteRow }, + { "/BatchGetRow", DecodeBatchGetRow }, + { "/GetRange", DecodeGetRange }, + + { "/ListSearchIndex", DecodeListSearchIndex }, + { "/CreateSearchIndex", DecodeCreateSearchIndex }, + { "/DescribeSearchIndex", DecodeDescribeSearchIndex }, + { "/DeleteSearchIndex", DecodeDeleteSearchIndex }, + { "/Search", DecodeSearch }, + + { "/CreateIndex", DecodeCreateGlobalIndex }, + { "/DropIndex", DecodeDeleteGlobalIndex }, + }; + } + + public override void HandleBefore(Context context) + { + InnerHandler.HandleBefore(context); + } + + public override void HandleAfter(Context context) + { + InnerHandler.HandleAfter(context); + IMessage message; + context.OTSReponse = DecoderMap[context.APIName](context.HttpResponseBody, out message); + LogEncodedMessage(context, message); + } + + private void LogEncodedMessage(Context context, IMessage message) + { + if (context.ClientConfig.OTSDebugLogHandler != null) + { + string requestID = ""; + if (context.HttpResponseHeaders.ContainsKey("x-ots-requestid")) + { + requestID = context.HttpResponseHeaders["x-ots-requestid"]; + } + var msgString = String.Format("OTS Response API: {0} RequestID: {1} Protobuf: {2}\n", + context.APIName, + requestID, + TextFormat.PrintToString(message)); + + context.ClientConfig.OTSDebugLogHandler(msgString); + } + } + + private Response.OTSResponse DecodeCreateTable(byte[] body, out IMessage _message) + { + var response = new Response.CreateTableResponse(); + var builder = PB.CreateTableResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + _message = message; + return response; + } + + private Response.OTSResponse DecodeDeleteTable(byte[] body, out IMessage _message) + { + var response = new Response.DeleteTableResponse(); + var builder = PB.DeleteTableResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + _message = message; + return response; + } + + private Response.OTSResponse DecodeUpdateTable(byte[] body, out IMessage _message) + { + var builder = PB.UpdateTableResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + var response = new Response.UpdateTableResponse( + ParseReservedThroughputDetails(message.ReservedThroughputDetails) + ); + _message = message; + return response; + } + + private Response.OTSResponse DecodeListTable(byte[] body, out IMessage _message) + { + var response = new Response.ListTableResponse + { + TableNames = new List() + }; + + var builder = PB.ListTableResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + + for (int i = 0; i < message.TableNamesCount; i++) + { + response.TableNames.Add(message.GetTableNames(i)); + } + _message = message; + return response; + } + + private Response.OTSResponse DecodeDescribeTable(byte[] body, out IMessage _message) + { + var response = new Response.DescribeTableResponse(); + var builder = PB.DescribeTableResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + response.TableMeta = ParseTableMeta(message.TableMeta); + response.ReservedThroughputDetails = ParseReservedThroughputDetails(message.ReservedThroughputDetails); + response.StreamDetails = ParseStreamDetails(message.StreamDetails); + response.TableOptions = ParseTableOptions(message.TableOptions); + _message = message; + return response; + } + + private Response.OTSResponse DecodePutRow(byte[] body, out IMessage _message) + { + var builder = PB.PutRowResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + + DataModel.Row row = null; + if (message.HasRow && !message.Row.IsEmpty) + { + row = ParseRow(message.Row); + } + else + { + row = new DataModel.Row(new DataModel.PrimaryKey(), new List()); + } + + var response = new Response.PutRowResponse( + ParseCapacityUnit(message.Consumed.CapacityUnit), + row + ); + _message = message; + return response; + } + + private Response.OTSResponse DecodeGetRow(byte[] body, out IMessage _message) + { + var builder = PB.GetRowResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + + DataModel.Row row = null; + + if (message.HasRow && !message.Row.IsEmpty) + { + row = ParseRow(message.Row); + } + else + { + row = new DataModel.Row(new DataModel.PrimaryKey(), new List()); + } + + var primaryKey = row.GetPrimaryKey(); + var columns = row.GetColumns(); + + var response = new Response.GetRowResponse( + ParseCapacityUnit(message.Consumed.CapacityUnit), + row + ); + + _message = message; + return response; + } + + private Response.OTSResponse DecodeUpdateRow(byte[] body, out IMessage _message) + { + var builder = PB.UpdateRowResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + + DataModel.Row row = null; + + if (message.HasRow && !message.Row.IsEmpty) + { + row = ParseRow(message.Row); + } + else + { + row = new DataModel.Row(new DataModel.PrimaryKey(), new List()); + } + + var response = new Response.UpdateRowResponse( + ParseCapacityUnit(message.Consumed.CapacityUnit), + row + ); + _message = message; + return response; + } + + + + private Response.OTSResponse DecodeDeleteRow(byte[] body, out IMessage _message) + { + var builder = PB.DeleteRowResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + + DataModel.Row row = null; + if (message.HasRow && !message.Row.IsEmpty) + { + row = ParseRow(message.Row); + } + else + { + row = new DataModel.Row(new DataModel.PrimaryKey(), new List()); + } + + var response = new Response.DeleteRowResponse( + ParseCapacityUnit(message.Consumed.CapacityUnit), + row + ); + _message = message; + return response; + } + + private DataModel.Row ParseRow(ByteString row) + { + PB.PlainBufferCodedInputStream inputStream = new PB.PlainBufferCodedInputStream(row.CreateCodedInput()); + List rows = inputStream.ReadRowsWithHeader(); + if (rows.Count != 1) + { + throw new IOException("Expect only returns one row. Row count: " + rows.Count); + } + + return PB.PlainBufferConversion.ToRow(rows[0]) as DataModel.Row; + } + + private Response.OTSResponse DecodeBatchWriteRow(byte[] body, out IMessage _message) + { + var builder = PB.BatchWriteRowResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + + var response = new Response.BatchWriteRowResponse(); + + foreach (var table in message.TablesList) + { + var item = ParseTableInBatchWriteRowResponse(table); + response.TableRespones.Add(table.TableName, item); + } + + _message = message; + return response; + } + + private Response.OTSResponse DecodeBatchGetRow(byte[] body, out IMessage _message) + { + var builder = PB.BatchGetRowResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + var response = new Response.BatchGetRowResponse(); + + foreach (var table in message.TablesList) + { + response.Add(table.TableName, ParseTableInBatchGetRowResponse(table)); + } + _message = message; + return response; + } + + private Response.OTSResponse DecodeGetRange(byte[] body, out IMessage _message) + { + var builder = PB.GetRangeResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + var response = new Response.GetRangeResponse + { + ConsumedCapacityUnit = ParseCapacityUnit(message.Consumed.CapacityUnit) + }; + + if (!message.HasNextStartPrimaryKey) + { + response.NextPrimaryKey = null; + } + else + { + var inputStream = new PB.PlainBufferCodedInputStream(message.NextStartPrimaryKey.CreateCodedInput()); + var rows = inputStream.ReadRowsWithHeader(); + if (rows.Count != 1) + { + throw new IOException("Expect only one row return. Row count: " + rows.Count); + } + + PB.PlainBufferRow row = rows[0]; + if (row.HasDeleteMarker() || row.HasCells()) + { + throw new IOException("The next primary key should only have primary key: " + row); + } + + response.NextPrimaryKey = PB.PlainBufferConversion.ToPrimaryKey(row.GetPrimaryKey()); + } + + + if (message.HasRows && !message.Rows.IsEmpty) + { + List rows = new List(); + var inputStream = new PB.PlainBufferCodedInputStream(message.Rows.CreateCodedInput()); + + List pbRows = inputStream.ReadRowsWithHeader(); + foreach (var pbRow in pbRows) + { + + rows.Add((DataModel.Row)PB.PlainBufferConversion.ToRow(pbRow)); + } + + response.RowDataList = rows; + } + + if (message.HasNextToken) + { + response.NextToken = message.NextToken.ToByteArray(); + } + + _message = message; + return response; + } + + private Response.OTSResponse DecodeListSearchIndex(byte[] body, out IMessage _message) + { + var response = new Response.ListSearchIndexResponse + { + IndexInfos = new List() + }; + + var builder = PB.ListSearchIndexResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + + for (int i = 0; i < message.IndicesCount; i++) + { + PB.IndexInfo indexInfo = message.GetIndices(i); + SearchIndexInfo searchIndexInfo = new SearchIndexInfo(); + searchIndexInfo.TableName = indexInfo.TableName; + searchIndexInfo.IndexName = indexInfo.IndexName; + response.IndexInfos.Add(searchIndexInfo); + } + _message = message; + return response; + } + + private Response.OTSResponse DecodeCreateSearchIndex(byte[] body, out IMessage _message) + { + var response = new Response.CreateSearchIndexResponse(); + var builder = PB.CreateSearchIndexResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + _message = message; + return response; + } + + private Response.OTSResponse DecodeDeleteSearchIndex(byte[] body, out IMessage _message) + { + var response = new Response.DeleteSearchIndexResponse(); + var builder = PB.DeleteSearchIndexResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + _message = message; + return response; + } + + private Response.OTSResponse DecodeSearch(byte[] body, out IMessage _message) + { + var response = new Response.SearchResponse(); + var builder = PB.SearchResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + _message = message; + + response.TotalCount = message.TotalHits; + response.IsAllSuccess = message.IsAllSucceeded; + response.Rows = new List(); + + foreach (var item in message.RowsList) + { + PlainBufferCodedInputStream coded = new PlainBufferCodedInputStream(item.CreateCodedInput()); + List plainBufferRows = coded.ReadRowsWithHeader(); + if (plainBufferRows.Count != 1) + { + throw new IOException("Expect only returns one row. Row count: " + plainBufferRows.Count); + } + var row = PlainBufferConversion.ToRow(plainBufferRows[0]); + response.Rows.Add(row as DataModel.Row); + } + if (message.HasNextToken) + { + response.NextToken = message.NextToken.ToByteArray(); + } + + return response; + } + + private Response.OTSResponse DecodeDescribeSearchIndex(byte[] body, out IMessage _message) + { + var response = new Response.DescribeSearchIndexResponse(); + var builder = PB.DescribeSearchIndexResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + response.Schema = ParseIndexSchema(message.Schema); + response.SyncStat = ParseSyncStat(message.SyncStat); + _message = message; + return response; + } + + private DataModel.Search.SyncStat ParseSyncStat(PB.SyncStat syncStat) + { + var ret = new DataModel.Search.SyncStat(); + ret.CurrentSyncTimestamp = syncStat.CurrentSyncTimestamp; + ret.SyncPhase = ParseSyncPhase(syncStat.SyncPhase); + return ret; + } + + private DataModel.Search.SyncPhase ParseSyncPhase(PB.SyncPhase syncPhase) + { + switch (syncPhase) + { + case PB.SyncPhase.FULL: + return DataModel.Search.SyncPhase.FULL; + case PB.SyncPhase.INCR: + return DataModel.Search.SyncPhase.INCR; + default: + throw new OTSClientException( + String.Format("Invalid indexOptions SyncPhase type {0}", syncPhase) + ); + } + + } + + private DataModel.Search.IndexSchema ParseIndexSchema(PB.IndexSchema indexSchema) + { + var ret = new DataModel.Search.IndexSchema(); + ret.IndexSetting = ParseIndexSetting(indexSchema.IndexSetting); + ret.FieldSchemas = new List(); + foreach (var item in indexSchema.FieldSchemasList) + { + ret.FieldSchemas.Add(ParseFieldSchema(item)); + } + return ret; + } + + private DataModel.Search.FieldSchema ParseFieldSchema(PB.FieldSchema fieldSchema) + { + var ret = new DataModel.Search.FieldSchema(fieldSchema.FieldName, ParseFieldType(fieldSchema.FieldType)); + ret.Analyzer = ParseAnalyzer(fieldSchema.Analyzer); + ret.EnableSortAndAgg = fieldSchema.DocValues; + ret.index = fieldSchema.Index; + ret.Store = fieldSchema.Store; + ret.IsArray = fieldSchema.IsArray; + ret.IndexOptions = ParseIndexOption(fieldSchema.IndexOptions); + foreach (var item in fieldSchema.FieldSchemasList) + { + ret.SubFieldSchemas.Add(ParseFieldSchema(item)); + } + + return ret; + } + + private DataModel.Search.IndexOptions ParseIndexOption(PB.IndexOptions indexOptions) + { + switch (indexOptions) + { + case PB.IndexOptions.DOCS: + return DataModel.Search.IndexOptions.DOCS; + case PB.IndexOptions.FREQS: + return DataModel.Search.IndexOptions.FREQS; + case PB.IndexOptions.OFFSETS: + return DataModel.Search.IndexOptions.OFFSETS; + case PB.IndexOptions.POSITIONS: + return DataModel.Search.IndexOptions.POSITIONS; + default: + throw new OTSClientException( + String.Format("Invalid indexOptions type {0}", indexOptions) + ); + } + } + + private DataModel.Search.FieldType ParseFieldType(PB.FieldType fieldType) + { + switch (fieldType) + { + case PB.FieldType.BOOLEAN: + return DataModel.Search.FieldType.BOOLEAN; + case PB.FieldType.DOUBLE: + return DataModel.Search.FieldType.DOUBLE; + case PB.FieldType.GEO_POINT: + return DataModel.Search.FieldType.GEO_POINT; + case PB.FieldType.KEYWORD: + return DataModel.Search.FieldType.KEYWORD; + case PB.FieldType.LONG: + return DataModel.Search.FieldType.LONG; + case PB.FieldType.NESTED: + return DataModel.Search.FieldType.NESTED; + case PB.FieldType.TEXT: + return DataModel.Search.FieldType.TEXT; + default: + throw new OTSClientException( + String.Format("Invalid FieldType type {0}", fieldType) + ); + } + } + + private DataModel.Search.Analyzer ParseAnalyzer(string analyzer) + { + switch (analyzer) + { + case "max_word": + return Analyzer.MaxWord; + case "single_word": + return Analyzer.SingleWord; + default: + throw new OTSClientException( + String.Format("Invalid Analyzer type {0}", analyzer) + ); + } + } + + private DataModel.Search.IndexSetting ParseIndexSetting(PB.IndexSetting indexSetting) + { + var ret = new DataModel.Search.IndexSetting(); + foreach (var item in indexSetting.RoutingFieldsList) + { + ret.RoutingFields.Add(item); + } + + return ret; + } + + + private IList ParseTableInBatchGetRowResponse(PB.TableInBatchGetRowResponse table) + { + var ret = new List(); + int index = 0; + + foreach (var row in table.RowsList) + { + DataModel.IRow result = null; + if (!row.IsOk) + { + ret.Add(new Response.BatchGetRowResponseItem(row.Error.Code, row.Error.Message)); + continue; + } + + if (row.HasRow && !row.Row.IsEmpty) + { + var inputStream = new PB.PlainBufferCodedInputStream(row.Row.CreateCodedInput()); + List rows = inputStream.ReadRowsWithHeader(); + if (rows.Count != 1) + { + throw new IOException("Expect only returns one row. Row count: " + rows.Count); + } + + result = PB.PlainBufferConversion.ToRow(rows[0]); + } + + Response.BatchGetRowResponseItem item = null; + + var capacityUnit = ParseCapacityUnit(row.Consumed.CapacityUnit); + + if (row.HasNextToken) + { + item = new Response.BatchGetRowResponseItem(table.TableName, result, capacityUnit, index, row.NextToken.ToByteArray()); + } + else + { + item = new Response.BatchGetRowResponseItem(table.TableName, result, capacityUnit, index); + } + + index++; + + ret.Add(item); + + } + + return ret; + } + + private DataModel.TableMeta ParseTableMeta(PB.TableMeta tableMeta) + { + var schema = new DataModel.PrimaryKeySchema(); + + for (int i = 0; i < tableMeta.PrimaryKeyCount; i++) + { + var item = tableMeta.GetPrimaryKey(i); + + schema.Add(item.Name, ParseColumnValueType(item.Type)); + } + + var ret = new DataModel.TableMeta( + tableMeta.TableName, + schema + ); + + return ret; + } + + private DataModel.ColumnValueType ParseColumnValueType(PB.PrimaryKeyType type) + { + switch (type) + { + case PB.PrimaryKeyType.BINARY: + return DataModel.ColumnValueType.Binary; + + case PB.PrimaryKeyType.INTEGER: + return DataModel.ColumnValueType.Integer; + case PB.PrimaryKeyType.STRING: + return DataModel.ColumnValueType.String; + + default: + throw new OTSClientException( + String.Format("Invalid column type {0}", type) + ); + } + } + + private DataModel.ReservedThroughputDetails ParseReservedThroughputDetails(PB.ReservedThroughputDetails details) + { + var ret = new DataModel.ReservedThroughputDetails( + ParseCapacityUnit(details.CapacityUnit), + details.LastIncreaseTime, + details.LastDecreaseTime + ); + + return ret; + } + + private DataModel.CapacityUnit ParseCapacityUnit(PB.CapacityUnit capacityUnit) + { + return new DataModel.CapacityUnit(capacityUnit.Read, capacityUnit.Write); + } + + private DataModel.StreamDetails ParseStreamDetails(PB.StreamDetails streamDetails) + { + return new DataModel.StreamDetails(streamDetails.EnableStream) + { + StreamId = streamDetails.StreamId, + LastEnableTime = streamDetails.LastEnableTime, + ExpirationTime = streamDetails.ExpirationTime + }; + } + + private DataModel.TableOptions ParseTableOptions(PB.TableOptions tableOptions) + { + DataModel.TableOptions options = new DataModel.TableOptions() + { + TimeToLive = tableOptions.TimeToLive, + MaxVersions = tableOptions.MaxVersions, + DeviationCellVersionInSec = tableOptions.DeviationCellVersionInSec, + BlockSize = tableOptions.BlockSize, + BloomFilterType = ParseBloomFilterType(tableOptions.BloomFilterType) + }; + + return options; + } + + private DataModel.BloomFilterType ParseBloomFilterType(PB.BloomFilterType bloomFilterType) + { + switch (bloomFilterType) + { + case PB.BloomFilterType.CELL: + return DataModel.BloomFilterType.CELL; + case PB.BloomFilterType.ROW: + return DataModel.BloomFilterType.ROW; + case PB.BloomFilterType.NONE: + return DataModel.BloomFilterType.NONE; + default: + throw new OTSClientException( + String.Format("Invalid bloomFilterType {0}", bloomFilterType) + ); + } + } + + private Response.BatchWriteRowResponseForOneTable ParseTableInBatchWriteRowResponse(PB.TableInBatchWriteRowResponse table) + { + + var ret = new Response.BatchWriteRowResponseForOneTable + { + Responses = ParseBatchWriteRowResponseItems(table.TableName, table.RowsList) + }; + + return ret; + } + + private IList ParseBatchWriteRowResponseItems(string tableName, IList responseItems) + { + var ret = new List(); + int index = 0; + foreach (var responseItem in responseItems) + { + DataModel.IRow row = null; + if (responseItem.IsOk) + { + if (responseItem.HasRow && !responseItem.Row.IsEmpty) + { + try + { + var inputStream = new PB.PlainBufferCodedInputStream(responseItem.Row.CreateCodedInput()); + List rows = inputStream.ReadRowsWithHeader(); + if (rows.Count != 1) + { + throw new IOException("Expect only returns one row. Row count: " + rows.Count); + } + + row = PB.PlainBufferConversion.ToRow(rows[0]); + } + catch (Exception e) + { + throw new OTSException("Failed to parse row data." + e.Message); + } + } + + ret.Add(new Response.BatchWriteRowResponseItem( + ParseCapacityUnit(responseItem.Consumed.CapacityUnit), tableName, index++, row)); + } + else + { + ret.Add(new Response.BatchWriteRowResponseItem( + responseItem.Error.Code, responseItem.Error.Message, tableName, index++)); + } + } + + return ret; + } + + private Response.CreateGlobalIndexResponse DecodeCreateGlobalIndex(byte[] body, out IMessage _message) + { + var response = new Response.CreateGlobalIndexResponse(); + var builder = PB.CreateIndexResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + _message = message; + return response; + } + + private Response.DeleteGlobalIndexResponse DecodeDeleteGlobalIndex(byte[] body, out IMessage _message) + { + var response = new Response.DeleteGlobalIndexResponse(); + var builder = PB.DropIndexResponse.CreateBuilder(); + builder.MergeFrom(body); + var message = builder.Build(); + _message = message; + return response; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Handler/ProtocolBufferEncoder.cs b/netstandard-sdk/Aliyun/OTS/Handler/ProtocolBufferEncoder.cs new file mode 100644 index 0000000..2419329 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Handler/ProtocolBufferEncoder.cs @@ -0,0 +1,1221 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; +using System.Collections.Generic; +using PB = com.alicloud.openservices.tablestore.core.protocol; +using Google.ProtocolBuffers; +using Aliyun.OTS.DataModel.Filter; +using Aliyun.OTS.DataModel.ConditionalUpdate; +using com.alicloud.openservices.tablestore.core.protocol; +using Aliyun.OTS.ProtoBuffer; + +namespace Aliyun.OTS.Handler +{ + public class ProtocolBufferEncoder : PipelineHandler + { + private delegate IMessage RequestEncoder(Request.OTSRequest request); + private readonly Dictionary EncoderMap; + private readonly int DEFAULT_NUMBER_OF_SHARDS = 1; + + public ProtocolBufferEncoder(PipelineHandler innerHandler) : base(innerHandler) + { + EncoderMap = new Dictionary { + { "/CreateTable", EncodeCreateTable }, + { "/DeleteTable", EncodeDeleteTable }, + { "/UpdateTable", EncodeUpdateTable }, + { "/DescribeTable", EncodeDescribeTable }, + { "/ListTable", EncodeListTable }, + + { "/PutRow", EncodePutRow }, + { "/GetRow", EncodeGetRow }, + { "/UpdateRow", EncodeUpdateRow }, + { "/DeleteRow", EncodeDeleteRow }, + + { "/BatchWriteRow", EncodeBatchWriteRow }, + { "/BatchGetRow", EncodeBatchGetRow }, + { "/GetRange", EncodeGetRange }, + + { "/ListSearchIndex", EncodeListSearchIndex }, + { "/CreateSearchIndex", EncodeCreateSearchIndex }, + { "/DescribeSearchIndex", EncodeDescribeSearchIndex }, + { "/DeleteSearchIndex", EncodeDeleteSearchIndex }, + { "/Search", EncodeSearch }, + + { "/CreateIndex", EncodeCreateGlobalIndex }, + { "/DropIndex", EncodeDeleteGlobalIndex }, + }; + } + + public override void HandleBefore(Context context) + { + var encoder = EncoderMap[context.APIName]; + var message = encoder(context.OTSRequest); + LogEncodedMessage(context, message); + context.HttpRequestBody = message.ToByteArray(); + InnerHandler.HandleBefore(context); + } + + public override void HandleAfter(Context context) + { + InnerHandler.HandleAfter(context); + } + + #region Encode Request + private IMessage EncodeCreateTable(Request.OTSRequest request) + { + var requestReal = (Request.CreateTableRequest)request; + var builder = PB.CreateTableRequest.CreateBuilder(); + builder.SetTableMeta(EncodeTableMeta(requestReal.TableMeta)); + builder.SetReservedThroughput(EncodeReservedThroughput(requestReal.ReservedThroughput)); + + builder.SetTableOptions(EncodeTableOptions(requestReal.TableOptions)); + + if (requestReal.StreamSpecification != null) + { + builder.SetStreamSpec(EncodeStreamSpecification(requestReal.StreamSpecification)); + } + + if (requestReal.PartitionRange != null) + { + for (var i = 0; i < requestReal.PartitionRange.Count; i++) + { + builder.SetPartitions(i, EncodePartitionRange(requestReal.PartitionRange[i])); + } + } + + if (requestReal.IndexMetas != null) + { + for (int i = 0; i < requestReal.IndexMetas.Count; i++) + { + builder.AddIndexMetas(EncodeIndexMeta(requestReal.IndexMetas[i])); + } + } + + var message = builder.Build(); + return message; + } + + private IMessage EncodeDeleteTable(Request.OTSRequest request) + { + var requestReal = (Request.DeleteTableRequest)request; + var builder = PB.DeleteTableRequest.CreateBuilder(); + builder.SetTableName(requestReal.TableName); + return builder.Build(); + } + + private IMessage EncodeUpdateTable(Request.OTSRequest request) + { + var requestReal = (Request.UpdateTableRequest)request; + var builder = PB.UpdateTableRequest.CreateBuilder(); + builder.SetTableName(requestReal.TableName); + + if (requestReal.ReservedThroughput != null) + { + builder.SetReservedThroughput(EncodeReservedThroughput(requestReal.ReservedThroughput)); + } + + if (requestReal.TableOptions != null) + { + builder.SetTableOptions(EncodeTableOptions(requestReal.TableOptions)); + } + + if (requestReal.StreamSpecification != null) + { + builder.SetStreamSpec(EncodeStreamSpecification(requestReal.StreamSpecification)); + } + + return builder.Build(); + } + + private IMessage EncodeDescribeTable(Request.OTSRequest request) + { + var requestReal = (Request.DescribeTableRequest)request; + var builder = PB.DescribeTableRequest.CreateBuilder(); + builder.SetTableName(requestReal.TableName); + return builder.Build(); + } + + private IMessage EncodeListTable(Request.OTSRequest request) + { + var builder = PB.ListTableRequest.CreateBuilder(); + return builder.Build(); + } + + private IMessage EncodePutRow(Request.OTSRequest request) + { + var requestReal = (Request.PutRowRequest)request; + var builder = PB.PutRowRequest.CreateBuilder(); + builder.SetTableName(requestReal.TableName); + builder.SetCondition(EncodeCondition(requestReal.Condition)); + builder.SetRow(ByteString.CopyFrom(PB.PlainBufferBuilder.BuildRowPutChangeWithHeader(requestReal.RowPutChange))); + builder.SetReturnContent(EncodeReturnContent(requestReal.RowPutChange.ReturnType, requestReal.RowPutChange.ReturnColumnNames)); + return builder.Build(); + } + + private IMessage EncodeGetRow(Request.OTSRequest request) + { + var requestReal = (Request.GetRowRequest)request; + var queryCriteria = requestReal.QueryCriteria; + + var builder = PB.GetRowRequest.CreateBuilder(); + builder.SetTableName(queryCriteria.TableName); + builder.SetPrimaryKey(ByteString.CopyFrom(PB.PlainBufferBuilder.BuildPrimaryKeyWithHeader(queryCriteria.RowPrimaryKey))); + + builder.AddRangeColumnsToGet(queryCriteria.GetColumnsToGet()); + + // if timeRange and maxVersions are both not set, set maxVersions to 1 default + if (!CheckQueryCondition(queryCriteria.TableName, queryCriteria.MaxVersions, queryCriteria.TimeRange)) + { + queryCriteria.MaxVersions = 1; + } + + if (queryCriteria.TimeRange != null) + { + builder.SetTimeRange(EncodeTimeRange(queryCriteria.TimeRange)); + } + + if (queryCriteria.MaxVersions.HasValue) + { + builder.SetMaxVersions(queryCriteria.MaxVersions.Value); + } + + if (queryCriteria.CacheBlocks != null && queryCriteria.CacheBlocks.HasValue) + { + builder.SetCacheBlocks(queryCriteria.CacheBlocks.Value); + } + + if (queryCriteria.Filter != null) + { + builder.SetFilter(BuildFilter(queryCriteria.Filter)); + } + + if (queryCriteria.StartColumn != null) + { + builder.SetStartColumn(queryCriteria.StartColumn); + } + + if (queryCriteria.EndColumn != null) + { + builder.SetEndColumn(queryCriteria.EndColumn); + } + + if (queryCriteria.Token != null) + { + builder.SetToken(ByteString.CopyFrom(queryCriteria.Token)); + } + + + return builder.Build(); + } + + private IMessage EncodeUpdateRow(Request.OTSRequest request) + { + var requestReal = (Request.UpdateRowRequest)request; + var builder = PB.UpdateRowRequest.CreateBuilder(); + + var rowChange = requestReal.RowUpdateChange; + + // required string table_name = 1; + builder.SetTableName(rowChange.TableName); + // required bytes row_change = 2; + builder.SetRowChange(ByteString.CopyFrom(PB.PlainBufferBuilder.BuildRowUpdateChangeWithHeader(rowChange))); + // required Condition condition = 3; + builder.SetCondition(EncodeCondition(rowChange.Condition)); + // option ReturnType = 4; + builder.SetReturnContent(EncodeReturnContent(rowChange.ReturnType, rowChange.ReturnColumnNames)); + + return builder.Build(); + } + + private IMessage EncodeDeleteRow(Request.OTSRequest request) + { + var requestReal = (Request.DeleteRowRequest)request; + var rowChange = requestReal.RowDeleteChange; + var builder = PB.DeleteRowRequest.CreateBuilder(); + + // required string table_name = 1; + builder.SetTableName(rowChange.TableName); + // required bytes primary_key = 2; + builder.SetPrimaryKey(ByteString.CopyFrom(PB.PlainBufferBuilder.BuildRowDeleteChangeWithHeader(rowChange))); + // required Condition condition = 3; + builder.SetCondition(EncodeCondition(rowChange.Condition)); + // option ReturnType = 4; + builder.SetReturnContent(EncodeReturnContent(rowChange.ReturnType, rowChange.ReturnColumnNames)); + return builder.Build(); + } + + private IMessage EncodeBatchWriteRow(Request.OTSRequest request) + { + var requestReal = (Request.BatchWriteRowRequest)request; + var builder = PB.BatchWriteRowRequest.CreateBuilder(); + + foreach (var item in requestReal.RowChangesGroupByTable) + { + builder.AddTables(EncodeTableInBatchWriteRowRequest(item.Key, item.Value)); + } + + return builder.Build(); + } + + private IMessage EncodeBatchGetRow(Request.OTSRequest request) + { + var requestReal = (Request.BatchGetRowRequest)request; + var builder = PB.BatchGetRowRequest.CreateBuilder(); + + foreach (var criterias in requestReal.GetCriterias()) + { + builder.AddTables(EncodeTableInBatchGetRowRequest(criterias)); + } + + return builder.Build(); + } + + private IMessage EncodeGetRange(Request.OTSRequest request) + { + var requestReal = (Request.GetRangeRequest)request; + var builder = PB.GetRangeRequest.CreateBuilder(); + + var queryCriteria = requestReal.QueryCriteria; + + // required string table_name = 1; + builder.SetTableName(queryCriteria.TableName); + + // required Direction direction = 2; + builder.SetDirection(ToPBDirection(queryCriteria.Direction)); + + // repeated string columns_to_get = 3; + if (queryCriteria.GetColumnsToGet() != null) + { + builder.AddRangeColumnsToGet(queryCriteria.GetColumnsToGet()); + } + + // if timeRange and maxVersions are both not set, set maxVersions to 1 default + if (!CheckQueryCondition(queryCriteria.TableName, queryCriteria.MaxVersions, queryCriteria.TimeRange)) + { + queryCriteria.MaxVersions = 1; + } + + // optional TimeRange time_range = 4; + if (queryCriteria.TimeRange != null) + { + builder.SetTimeRange(EncodeTimeRange(queryCriteria.TimeRange)); + } + + // optional int32 max_versions = 5; + if (queryCriteria.MaxVersions.HasValue) + { + builder.SetMaxVersions(queryCriteria.MaxVersions.Value); + } + + // optional int32 limit = 6; + if (queryCriteria.Limit != null && queryCriteria.Limit > 0) + { + builder.SetLimit((int)queryCriteria.Limit); + } + + // required bytes inclusive_start_primary_key = 7; + builder.SetInclusiveStartPrimaryKey(ByteString.CopyFrom(PB.PlainBufferBuilder.BuildPrimaryKeyWithHeader(queryCriteria.InclusiveStartPrimaryKey))); + // required bytes exclusive_end_primary_key = 8; + builder.SetExclusiveEndPrimaryKey(ByteString.CopyFrom(PB.PlainBufferBuilder.BuildPrimaryKeyWithHeader(queryCriteria.ExclusiveEndPrimaryKey))); + + // optional bool cache_blocks = 9 [default = true]; + if (queryCriteria.CacheBlocks.HasValue) + { + builder.SetCacheBlocks(queryCriteria.CacheBlocks.Value); + } + + // optional bytes filter = 10; + if (queryCriteria.Filter != null) + { + builder.SetFilter(BuildFilter(queryCriteria.Filter)); + } + + // optional string start_column = 11; + if (queryCriteria.StartColumn != null) + { + builder.SetStartColumn(queryCriteria.StartColumn); + } + + // optional string end_column = 12; + if (queryCriteria.EndColumn != null) + { + builder.SetEndColumn(queryCriteria.EndColumn); + } + + // optional bytes token = 13; + if (queryCriteria.HasSetToken()) + { + builder.SetToken(ByteString.CopyFrom(queryCriteria.Token)); + } + + return builder.Build(); + } + + + private IMessage EncodeListSearchIndex(Request.OTSRequest request) + { + var requestReal = (Request.ListSearchIndexRequest)request; + var builder = PB.ListSearchIndexRequest.CreateBuilder(); + builder.SetTableName(requestReal.TableName); + return builder.Build(); + } + + private IMessage EncodeCreateSearchIndex(Request.OTSRequest request) + { + var requestReal = (Request.CreateSearchIndexRequest)request; + var builder = PB.CreateSearchIndexRequest.CreateBuilder(); + builder.SetTableName(requestReal.TableName); + builder.SetIndexName(requestReal.IndexName); + builder.SetSchema(EncodeIndexSchema(requestReal.IndexSchame)); + return builder.Build(); + } + + private IMessage EncodeSearch(Request.OTSRequest request) + { + var requestReal = (Request.SearchRequest)request; + var builder = PB.SearchRequest.CreateBuilder(); + + builder.SetTableName(requestReal.TableName); + builder.SetIndexName(requestReal.IndexName); + builder.SetSearchQuery(EncodeSearchQuery(requestReal.SearchQuery).ToByteString()); + if (requestReal.ColumnsToGet != null) + { + builder.SetColumnsToGet(EncodeColumsToGet(requestReal.ColumnsToGet)); + } + if (requestReal.RoutingValues != null) + { + List routingValues = new List(); + foreach (var pk in requestReal.RoutingValues) + { + try + { + routingValues.Add(ByteString.CopyFrom(PlainBufferBuilder.BuildPrimaryKeyWithHeader(pk))); + } + catch (Exception e) + { + throw new OTSClientException("build plain buffer fail,msg:" + e.Message); + } + } + builder.AddRangeRoutingValues(routingValues); + } + + return builder.Build(); + } + + private PB.ColumnsToGet EncodeColumsToGet(DataModel.Search.ColumnsToGet columnsToGet) + { + var builder = PB.ColumnsToGet.CreateBuilder(); + if (columnsToGet.ReturnAll) + { + builder.SetReturnType(ColumnReturnType.RETURN_ALL); + } + else if (columnsToGet.Columns.Count > 0) + { + builder.SetReturnType(ColumnReturnType.RETURN_SPECIFIED); + builder.AddRangeColumnNames(columnsToGet.Columns); + } + else + { + builder.SetReturnType(ColumnReturnType.RETURN_NONE); + } + return builder.Build(); + } + + private PB.SearchQuery EncodeSearchQuery(DataModel.Search.SearchQuery searchQuery) + { + var builder = PB.SearchQuery.CreateBuilder(); + if (searchQuery.Limit.HasValue) + { + builder.SetLimit(searchQuery.Limit.Value); + } + if (searchQuery.Offset.HasValue) + { + builder.SetOffset(searchQuery.Offset.Value); + } + + if (searchQuery.Collapse != null) + { + builder.SetCollapse(EncodeCollapse(searchQuery.Collapse)); + } + + if (searchQuery.Query != null) + { + builder.SetQuery(SearchQueryBuilder.BuildQuery(searchQuery.Query)); + } + + if (searchQuery.Sort != null) + { + builder.SetSort(SearchSortBuilder.BuildSort(searchQuery.Sort)); + } + + builder.SetGetTotalCount(searchQuery.GetTotalCount); + if (searchQuery.Token != null) + { + builder.SetToken(ByteString.CopyFrom(searchQuery.Token)); + } + + return builder.Build(); + } + + private PB.Collapse EncodeCollapse(DataModel.Search.Collapse collapse) + { + var builder = PB.Collapse.CreateBuilder(); + if (collapse.FieldName != null) + { + builder.SetFieldName(collapse.FieldName); + } + return builder.Build(); + } + + private PB.IndexSchema EncodeIndexSchema(DataModel.Search.IndexSchema schema) + { + var builder = PB.IndexSchema.CreateBuilder(); + + if (schema.IndexSetting != null) + { + builder.SetIndexSetting(EncodeIndexSetting(schema.IndexSetting)); + } + else + { + builder.SetIndexSetting(EncodeIndexSetting(new DataModel.Search.IndexSetting())); + } + if (schema.FieldSchemas != null) + { + for (var i = 0; i < schema.FieldSchemas.Count; i++) + { + builder.FieldSchemasList.Add(EncodingFieldSchema(schema.FieldSchemas[i])); + } + } + if (schema.IndexSort != null) + { + builder.SetIndexSort(SearchSortBuilder.BuildSort(schema.IndexSort)); + } + return builder.Build(); + } + + private PB.FieldSchema EncodingFieldSchema(DataModel.Search.FieldSchema fieldSchema) + { + var builder = PB.FieldSchema.CreateBuilder(); + builder.SetFieldName(fieldSchema.FieldName); + builder.SetFieldType(EncodingFieldType(fieldSchema.FieldType)); + if (fieldSchema.FieldType != DataModel.Search.FieldType.NESTED) + { + builder.Index = fieldSchema.index; + builder.DocValues = fieldSchema.EnableSortAndAgg; + builder.Store = fieldSchema.Store; + builder.IsArray = fieldSchema.IsArray; + } + + if (fieldSchema.IndexOptions != DataModel.Search.IndexOptions.NULL) + { + builder.IndexOptions = EncodingIndexOptions(fieldSchema.IndexOptions); + } + if (fieldSchema.Analyzer != DataModel.Search.Analyzer.NotAnalyzed) + { + builder.Analyzer = EncodingAnalyzer(fieldSchema.Analyzer); + } + + if (fieldSchema.SubFieldSchemas != null) + { + for (var i = 0; i < fieldSchema.SubFieldSchemas.Count; i++) + { + builder.AddFieldSchemas(EncodingFieldSchema(fieldSchema.SubFieldSchemas[i])); + } + } + + return builder.Build(); + } + + private string EncodingAnalyzer(DataModel.Search.Analyzer analyzer) + { + switch (analyzer) + { + case DataModel.Search.Analyzer.MaxWord: + return "max_word"; + case DataModel.Search.Analyzer.SingleWord: + return "single_word"; + default: + throw new OTSClientException( + String.Format("Invalid Analyzer {0}", analyzer) + ); + } + } + + private PB.IndexOptions EncodingIndexOptions(DataModel.Search.IndexOptions indexOptions) + { + switch (indexOptions) + { + case DataModel.Search.IndexOptions.DOCS: + return PB.IndexOptions.DOCS; + case DataModel.Search.IndexOptions.FREQS: + return PB.IndexOptions.FREQS; + case DataModel.Search.IndexOptions.OFFSETS: + return PB.IndexOptions.OFFSETS; + case DataModel.Search.IndexOptions.POSITIONS: + return PB.IndexOptions.POSITIONS; + default: + throw new OTSClientException( + String.Format("Invalid IndexOptions {0}", indexOptions) + ); + } + } + + private PB.FieldType EncodingFieldType(DataModel.Search.FieldType fieldType) + { + switch (fieldType) + { + case DataModel.Search.FieldType.BOOLEAN: + return PB.FieldType.BOOLEAN; + case DataModel.Search.FieldType.DOUBLE: + return PB.FieldType.DOUBLE; + case DataModel.Search.FieldType.GEO_POINT: + return PB.FieldType.GEO_POINT; + case DataModel.Search.FieldType.KEYWORD: + return PB.FieldType.KEYWORD; + case DataModel.Search.FieldType.LONG: + return PB.FieldType.LONG; + case DataModel.Search.FieldType.NESTED: + return PB.FieldType.NESTED; + case DataModel.Search.FieldType.TEXT: + return PB.FieldType.TEXT; + default: + throw new OTSClientException( + String.Format("Invalid FieldType {0}", fieldType) + ); + } + } + + private PB.IndexSetting EncodeIndexSetting(DataModel.Search.IndexSetting indexSetting) + { + var builder = PB.IndexSetting.CreateBuilder(); + if (indexSetting != null) + { + if (indexSetting.RoutingFields != null) + { + for (var i = 0; i < indexSetting.RoutingFields.Count; i++) + { + builder.SetRoutingFields(i, indexSetting.RoutingFields[i]); + } + } + builder.SetNumberOfShards(DEFAULT_NUMBER_OF_SHARDS); + } + return builder.Build(); + } + + + private IMessage EncodeDescribeSearchIndex(Request.OTSRequest request) + { + var requestReal = (Request.DescribeSearchIndexRequest)request; + var builder = PB.DescribeSearchIndexRequest.CreateBuilder(); + builder.SetTableName(requestReal.TableName); + builder.SetIndexName(requestReal.IndexName); + return builder.Build(); + } + + private IMessage EncodeDeleteSearchIndex(Request.OTSRequest request) + { + var requestReal = (Request.DeleteSearchIndexRequest)request; + var builder = PB.DeleteSearchIndexRequest.CreateBuilder(); + builder.SetTableName(requestReal.TableName); + builder.SetIndexName(requestReal.IndexName); + return builder.Build(); + } + + private IMessage EncodeCreateGlobalIndex(Request.OTSRequest request) + { + var requestReal = (Request.CreateGlobalIndexRequest)request; + var builder = PB.CreateIndexRequest.CreateBuilder(); + builder.SetMainTableName(requestReal.MainTableName); + builder.SetIncludeBaseData(requestReal.IncludeBaseData); + builder.SetIndexMeta(EncodeIndexMeta(requestReal.IndexMeta)); + + return builder.Build(); + } + + public IMessage EncodeDeleteGlobalIndex(Request.OTSRequest request) + { + var requestReal = (Request.DeleteGlobalIndexRequest)request; + var builder = PB.DropIndexRequest.CreateBuilder(); + builder.SetMainTableName(requestReal.MainTableName); + builder.SetIndexName(requestReal.IndexName); + + return builder.Build(); + } + + #endregion + + #region Encode Others + private PB.TableOptions EncodeTableOptions(DataModel.TableOptions tableOptions) + { + var builder = PB.TableOptions.CreateBuilder(); + + if (tableOptions.TimeToLive.HasValue) + { + builder.SetTimeToLive(tableOptions.TimeToLive.Value); + } + else + { + Console.WriteLine("Time to live is set to -1 in default."); + builder.SetTimeToLive(-1); + } + + if (tableOptions.MaxVersions.HasValue) + { + builder.SetMaxVersions(tableOptions.MaxVersions.Value); + } + else + { + Console.WriteLine("Max Versions is set to 1 in default."); + builder.SetMaxVersions(1); + } + + if (tableOptions.DeviationCellVersionInSec.HasValue) + { + builder.SetDeviationCellVersionInSec(tableOptions.DeviationCellVersionInSec.Value); + } + + if (tableOptions.BlockSize.HasValue) + { + builder.SetBlockSize(tableOptions.BlockSize.Value); + } + + if (tableOptions.BloomFilterType.HasValue) + { + builder.SetBloomFilterType(EncodeBloomFilterType(tableOptions.BloomFilterType.Value)); + } + + + return builder.Build(); + } + + private PB.BloomFilterType EncodeBloomFilterType(DataModel.BloomFilterType bloomFilterType) + { + + switch (bloomFilterType) + { + case DataModel.BloomFilterType.CELL: + return PB.BloomFilterType.CELL; + case DataModel.BloomFilterType.NONE: + return PB.BloomFilterType.NONE; + case DataModel.BloomFilterType.ROW: + return PB.BloomFilterType.ROW; + default: + throw new OTSClientException( + String.Format("Invalid bloomFilterType {0}", bloomFilterType) + ); + } + } + + private PB.StreamSpecification EncodeStreamSpecification(DataModel.StreamSpecification streamSpecification) + { + var builder = new PB.StreamSpecification.Builder(); + builder.SetEnableStream(streamSpecification.EnableStream); + builder.SetExpirationTime(streamSpecification.ExpirationTime); + return builder.Build(); + } + + private PB.PartitionRange EncodePartitionRange(DataModel.PartitionRange partitionRange) + { + var builder = PB.PartitionRange.CreateBuilder(); + builder.SetBegin(ByteString.CopyFrom(PB.PlainBufferBuilder.BuildPrimaryKeyValueWithoutLengthPrefix(partitionRange.Begin))); + builder.SetEnd(ByteString.CopyFrom(PB.PlainBufferBuilder.BuildPrimaryKeyValueWithoutLengthPrefix(partitionRange.End))); + return builder.Build(); + } + + private PB.IndexMeta EncodeIndexMeta(DataModel.IndexMeta indexMeta) + { + var builder = PB.IndexMeta.CreateBuilder(); + builder.Name = indexMeta.IndexName; + builder.IndexType = EncodeIndexType(indexMeta.IndexType); + builder.IndexUpdateMode = EncodeIndexUpdateMode(indexMeta.IndexUpdateModel); + if (indexMeta.PrimaryKey != null) + { + for (int i = 0; i < indexMeta.PrimaryKey.Count; i++) + { + builder.AddPrimaryKey(indexMeta.PrimaryKey[i]); + } + } + + if (indexMeta.DefinedColumns != null) + { + for (int i = 0; i < indexMeta.DefinedColumns.Count; i++) + { + builder.AddDefinedColumn(indexMeta.DefinedColumns[i]); + } + } + + return builder.Build(); + } + + private PB.IndexType EncodeIndexType(DataModel.IndexType indexType) + { + switch (indexType) + { + case DataModel.IndexType.IT_GLOBAL_INDEX: + return PB.IndexType.IT_GLOBAL_INDEX; + default: + throw new OTSClientException(String.Format( + "Invalid indexType {0}", indexType + )); + } + } + + private PB.IndexUpdateMode EncodeIndexUpdateMode(DataModel.IndexUpdateMode indexUpdateModel) + { + switch (indexUpdateModel) + { + case DataModel.IndexUpdateMode.IUM_ASYNC_INDEX: + return PB.IndexUpdateMode.IUM_ASYNC_INDEX; + default: + throw new OTSClientException(String.Format( + "Invalid indexUpdateModel {0}", indexUpdateModel + )); + } + } + + private PB.TableMeta EncodeTableMeta(DataModel.TableMeta tableMeta) + { + var builder = PB.TableMeta.CreateBuilder(); + builder.SetTableName(tableMeta.TableName); + builder.AddRangePrimaryKey(EncodePrimaryKeySchema(tableMeta.PrimaryKeySchema)); + if (tableMeta.DefinedColumnSchema != null) + { + builder.AddRangeDefinedColumn(EncodeDefinedColumnSchema(tableMeta.DefinedColumnSchema)); + } + return builder.Build(); + } + + private IEnumerable EncodeDefinedColumnSchema(DataModel.DefinedColumnSchema schema) + { + foreach (var item in schema) + { + yield return EncodeDefinedColumnSchemaItem(item); + } + } + + private PB.DefinedColumnSchema EncodeDefinedColumnSchemaItem(Tuple schema) + { + var builder = PB.DefinedColumnSchema.CreateBuilder(); + builder.SetName(schema.Item1); + builder.SetType(EncodeDeinedColumnType(schema.Item2)); + + return builder.Build(); + } + + private PB.DefinedColumnType EncodeDeinedColumnType(DataModel.DefinedColumnType type) + { + switch (type) + { + case DataModel.DefinedColumnType.BINARY: + return DefinedColumnType.DCT_BLOB; + case DataModel.DefinedColumnType.INTEGER: + return DefinedColumnType.DCT_INTEGER; + case DataModel.DefinedColumnType.STRING: + return DefinedColumnType.DCT_STRING; + case DataModel.DefinedColumnType.DOUBLE: + return DefinedColumnType.DCT_STRING; + case DataModel.DefinedColumnType.BOOLEAN: + return DefinedColumnType.DCT_BOOLEAN; + + default: + throw new OTSClientException(String.Format( + "Invalid definedColumn value type: {0}", type + )); + } + } + + private IEnumerable EncodePrimaryKeySchema(DataModel.PrimaryKeySchema schema) + { + foreach (var item in schema) + { + yield return EncodeColumnSchema(item); + } + } + + private PB.PrimaryKeySchema EncodeColumnSchema(Tuple schema) + { + var builder = PB.PrimaryKeySchema.CreateBuilder(); + builder.SetName(schema.Item1); + builder.SetType(EncodeColumnType(schema.Item2)); + + if (schema.Item3 != DataModel.PrimaryKeyOption.NONE) + { + builder.SetOption(EncodePrimaryKeyOption(schema.Item3)); + } + + return builder.Build(); + } + + private PB.PrimaryKeyType EncodeColumnType(DataModel.ColumnValueType type) + { + switch (type) + { + case DataModel.ColumnValueType.Integer: + return PB.PrimaryKeyType.INTEGER; + case DataModel.ColumnValueType.String: + return PB.PrimaryKeyType.STRING; + case DataModel.ColumnValueType.Binary: + return PB.PrimaryKeyType.BINARY; + default: + throw new OTSClientException(String.Format( + "Invalid column value type: {0}", type + )); + } + } + + private PB.PrimaryKeyOption EncodePrimaryKeyOption(DataModel.PrimaryKeyOption option) + { + switch (option) + { + case DataModel.PrimaryKeyOption.AUTO_INCREMENT: + return PB.PrimaryKeyOption.AUTO_INCREMENT; + default: + throw new OTSClientException(String.Format( + "Invalid primary key option: {0}", option + )); + } + } + + private PB.ReservedThroughput EncodeReservedThroughput(DataModel.CapacityUnit capacityUnit) + { + var builder = PB.ReservedThroughput.CreateBuilder(); + builder.SetCapacityUnit(EncodeCapacityUnit(capacityUnit)); + return builder.Build(); + } + + private PB.CapacityUnit EncodeCapacityUnit(DataModel.CapacityUnit capacityUnit) + { + var builder = PB.CapacityUnit.CreateBuilder(); + + if (capacityUnit.Read.HasValue) + { + builder.SetRead(capacityUnit.Read.Value); + } + + if (capacityUnit.Write.HasValue) + { + builder.SetWrite(capacityUnit.Write.Value); + } + + return builder.Build(); + } + + private PB.Condition EncodeCondition(DataModel.Condition condition) + { + PB.Condition.Builder builder = PB.Condition.CreateBuilder(); + switch (condition.RowExistenceExpect) + { + case DataModel.RowExistenceExpectation.EXPECT_EXIST: + builder.SetRowExistence(PB.RowExistenceExpectation.EXPECT_EXIST); + break; + case DataModel.RowExistenceExpectation.EXPECT_NOT_EXIST: + builder.SetRowExistence(PB.RowExistenceExpectation.EXPECT_NOT_EXIST); + break; + case DataModel.RowExistenceExpectation.IGNORE: + builder.SetRowExistence(PB.RowExistenceExpectation.IGNORE); + break; + default: + throw new OTSClientException(String.Format("Invalid RowExistenceExpectation: {0}", condition.RowExistenceExpect)); + } + + if (condition.ColumnCondition != null) + { + builder.SetColumnCondition(BuildFilter(condition.ColumnCondition)); + } + + return builder.Build(); + } + + private static ByteString BuildFilter(IColumnCondition filter) + { + PB.Filter.Builder builder = PB.Filter.CreateBuilder(); + + builder.SetType(EncodeFilterType(filter.GetConditionType())); + builder.SetFilter_(filter.Serialize()); + return builder.Build().ToByteString(); + } + + private static ByteString BuildFilter(IFilter filter) + { + PB.Filter.Builder builder = PB.Filter.CreateBuilder(); + + builder.SetType(ToPBFilterType(filter.GetFilterType())); + builder.SetFilter_(filter.Serialize()); + return builder.Build().ToByteString(); + } + + private static PB.FilterType EncodeFilterType(ColumnConditionType type) + { + switch (type) + { + case ColumnConditionType.COMPOSITE_CONDITION: + return PB.FilterType.FT_COMPOSITE_COLUMN_VALUE; + case ColumnConditionType.RELATIONAL_CONDITION: + return PB.FilterType.FT_SINGLE_COLUMN_VALUE; + default: + throw new ArgumentException("Unknown filter type: " + type); + } + } + + private static PB.ReturnContent EncodeReturnContent(DataModel.ReturnType returnType, List returnColumnNames) + { + PB.ReturnContent.Builder builder = PB.ReturnContent.CreateBuilder(); + builder.SetReturnType(ToPBReturnType(returnType)); + + if (returnColumnNames != null) + { + foreach (var item in returnColumnNames) + { + builder.AddReturnColumnNames(item); + } + } + + return builder.Build(); + } + + private static PB.TimeRange EncodeTimeRange(DataModel.TimeRange timeRange) + { + PB.TimeRange.Builder builder = PB.TimeRange.CreateBuilder(); + if (timeRange.SpecificTime.HasValue) + { + builder.SetSpecificTime(timeRange.SpecificTime.Value); + } + else + { + builder.SetStartTime(timeRange.StartTime.Value); + builder.SetEndTime(timeRange.EndTime.Value); + } + + return builder.Build(); + } + + private PB.TableInBatchWriteRowRequest EncodeTableInBatchWriteRowRequest(string tableName, DataModel.RowChanges rowChanges) + { + var tableBuilder = PB.TableInBatchWriteRowRequest.CreateBuilder(); + + tableBuilder.SetTableName(tableName); + + if (rowChanges == null || rowChanges.IsEmpty()) + { + return tableBuilder.Build(); + } + + foreach (var rowChange in rowChanges.RowPutChanges) + { + tableBuilder.AddRows(EncodeWriteRowRequest(rowChange)); + } + + foreach (var rowChange in rowChanges.RowUpdateChanges) + { + tableBuilder.AddRows(EncodeWriteRowRequest(rowChange)); + } + + foreach (var rowChange in rowChanges.RowDeleteChanges) + { + tableBuilder.AddRows(EncodeWriteRowRequest(rowChange)); + } + + return tableBuilder.Build(); + } + + private PB.RowInBatchWriteRowRequest EncodeWriteRowRequest(DataModel.RowChange rowChange) + { + var rowBuilder = PB.RowInBatchWriteRowRequest.CreateBuilder(); + + if (rowChange is DataModel.RowPutChange) + { + rowBuilder.SetType(PB.OperationType.PUT); + rowBuilder.SetRowChange(ByteString.CopyFrom(PB.PlainBufferBuilder.BuildRowPutChangeWithHeader(rowChange as DataModel.RowPutChange))); + } + else if (rowChange is DataModel.RowUpdateChange) + { + rowBuilder.SetType(PB.OperationType.UPDATE); + rowBuilder.SetRowChange(ByteString.CopyFrom(PB.PlainBufferBuilder.BuildRowUpdateChangeWithHeader(rowChange as DataModel.RowUpdateChange))); + } + else if (rowChange is DataModel.RowDeleteChange) + { + rowBuilder.SetType(PB.OperationType.DELETE); + rowBuilder.SetRowChange(ByteString.CopyFrom(PB.PlainBufferBuilder.BuildRowDeleteChangeWithHeader(rowChange as DataModel.RowDeleteChange))); + } + else + { + throw new OTSException("unkown row change " + rowChange.GetType()); + } + + rowBuilder.SetCondition(EncodeCondition(rowChange.Condition)); + rowBuilder.SetReturnContent(EncodeReturnContent(rowChange.ReturnType, rowChange.ReturnColumnNames)); + return rowBuilder.Build(); + } + + private PB.TableInBatchGetRowRequest EncodeTableInBatchGetRowRequest(DataModel.MultiRowQueryCriteria criteria) + { + var tableBuilder = PB.TableInBatchGetRowRequest.CreateBuilder(); + tableBuilder.SetTableName(criteria.TableName); + + + if (criteria.GetRowKeys().Count != criteria.GetTokens().Count) + { + throw new OTSException("The number of primaryKeys and tokens must be the same. Table name:" + criteria.TableName); + } + + // if timeRange and maxVersions are both not set, set maxVersions to 1 default + if (!CheckQueryCondition(criteria.TableName, criteria.MaxVersions, criteria.TimeRange)) + { + criteria.MaxVersions = 1; + } + + // repeated bytes primary_key = 2; + // repeated bytes tokens = 3; + for (int i = 0; i < criteria.Size(); i++) + { + tableBuilder.AddPrimaryKey(ByteString.CopyFrom(PB.PlainBufferBuilder.BuildPrimaryKeyWithHeader(criteria.Get(i)))); + tableBuilder.AddToken(ByteString.CopyFrom(criteria.GetTokens()[i])); + } + + // repeated string columns_to_get = 4; + if (criteria.GetColumnsToGet() != null) + { + tableBuilder.AddRangeColumnsToGet(criteria.GetColumnsToGet()); + } + + // optional TimeRange time_range = 5; + if (criteria.TimeRange != null) + { + tableBuilder.SetTimeRange(EncodeTimeRange(criteria.TimeRange)); + } + + // optional int32 max_versions = 6; + if (criteria.MaxVersions.HasValue) + { + tableBuilder.SetMaxVersions(criteria.MaxVersions.Value); + } + + // optional bool cache_blocks = 7; + if (criteria.CacheBlocks.HasValue) + { + tableBuilder.SetCacheBlocks(criteria.CacheBlocks.Value); + } + + // optional bytes filter = 8; + if (criteria.Filter != null) + { + tableBuilder.SetFilter(BuildFilter(criteria.Filter)); + } + + // optional string startColumn = 9; + if (criteria.StartColumn != null) + { + tableBuilder.SetStartColumn(criteria.StartColumn); + } + + // optional string endColumn = 10; + if (criteria.EndColumn != null) + { + tableBuilder.SetEndColumn(criteria.EndColumn); + } + + return tableBuilder.Build(); + } + + #endregion + + private void LogEncodedMessage(Context context, IMessage message) + { + if (context.ClientConfig.OTSDebugLogHandler != null) + { + var msgString = String.Format("OTS Request API: {0} Protobuf: {1}\n", + context.APIName, + TextFormat.PrintToString(message)); + context.ClientConfig.OTSDebugLogHandler(msgString); + } + } + + private static PB.ComparatorType ToPBComparatorType(DataModel.CompareOperator compareOperator) + { + switch (compareOperator) + { + case DataModel.CompareOperator.EQUAL: + return PB.ComparatorType.CT_EQUAL; + case DataModel.CompareOperator.NOT_EQUAL: + return PB.ComparatorType.CT_NOT_EQUAL; + case DataModel.CompareOperator.GREATER_THAN: + return PB.ComparatorType.CT_GREATER_THAN; + case DataModel.CompareOperator.GREATER_EQUAL: + return PB.ComparatorType.CT_GREATER_EQUAL; + case DataModel.CompareOperator.LESS_THAN: + return PB.ComparatorType.CT_LESS_THAN; + case DataModel.CompareOperator.LESS_EQUAL: + return PB.ComparatorType.CT_LESS_EQUAL; + default: + throw new ArgumentException("Unknown compare operator: " + compareOperator); + } + } + + private static PB.ReturnType ToPBReturnType(DataModel.ReturnType returnType) + { + switch (returnType) + { + case DataModel.ReturnType.RT_NONE: + return PB.ReturnType.RT_NONE; + case DataModel.ReturnType.RT_PK: + return PB.ReturnType.RT_PK; + case DataModel.ReturnType.RT_AFTER_MODIFY: + return PB.ReturnType.RT_AFTER_MODIFY; + default: + throw new ArgumentException("Invalid return type: " + returnType); + } + } + + private static PB.Direction ToPBDirection(Request.GetRangeDirection direction) + { + switch (direction) + { + case Request.GetRangeDirection.Forward: + return PB.Direction.FORWARD; + case Request.GetRangeDirection.Backward: + return PB.Direction.BACKWARD; + default: + throw new ArgumentException("unknown direction type:" + direction); + } + } + + private static PB.FilterType ToPBFilterType(DataModel.Filter.FilterType filterType) + { + switch (filterType) + { + case DataModel.Filter.FilterType.SINGLE_COLUMN_VALUE_FILTER: + return PB.FilterType.FT_SINGLE_COLUMN_VALUE; + case DataModel.Filter.FilterType.COMPOSITE_COLUMN_VALUE_FILTER: + return PB.FilterType.FT_COMPOSITE_COLUMN_VALUE; + case DataModel.Filter.FilterType.COLUMN_PAGINATION_FILTER: + return PB.FilterType.FT_COLUMN_PAGINATION; + default: + throw new ArgumentException("Unknown filter type: " + filterType); + } + } + + private bool CheckQueryCondition(string tableName, int? maxVersions, DataModel.TimeRange timeRange) + { + if (maxVersions.HasValue && timeRange != null) + { + throw new OTSException("Error, MaxVersions and TimeRange can NOT be specified at the same time. Table name:" + tableName); + } + + if (!maxVersions.HasValue && timeRange == null) + { + return false; + } + + return true; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Handler/RetryHandler.cs b/netstandard-sdk/Aliyun/OTS/Handler/RetryHandler.cs new file mode 100644 index 0000000..79538ba --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Handler/RetryHandler.cs @@ -0,0 +1,99 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System.Linq; +using System.Threading; +using Aliyun.OTS.Retry; + +namespace Aliyun.OTS.Handler +{ + public class RetryHandler : PipelineHandler + { + public RetryHandler(PipelineHandler innerHandler) : base(innerHandler) { } + + public override void HandleBefore(Context context) + { + InnerHandler.HandleBefore(context); + } + + private bool ShouldRetry(RetryPolicy retryPolicy, Context context, OTSException exception) + { + if (retryPolicy.MaxRetryTimeReached(context, exception)) + { + return false; + } + + if (retryPolicy.CanRetry(context, exception)) + { + return true; + } + + return false; + } + + private void ResetRetry(Context context) + { + InnerHandler.HandleBefore(context); + context.HttpTask.Wait(); + } + + public override void HandleAfter(Context context) + { + var retryPolicy = context.ClientConfig.RetryPolicy; + + while (true) + { + OTSException exceptionForRetry = null; + + try + { + InnerHandler.HandleAfter(context); + } + catch (OTSClientException exception) + { + exceptionForRetry = exception; + } + catch (OTSServerException exception) + { + exceptionForRetry = exception; + } + + if (OTSClientTestHelper.RetryTimesAndBackOffRecordSwith) { + if (OTSClientTestHelper.RetryExceptions.Count() > OTSClientTestHelper.RetryTimes) { + exceptionForRetry = OTSClientTestHelper.RetryExceptions[OTSClientTestHelper.RetryTimes]; + } + } + + if (ShouldRetry(retryPolicy, context, exceptionForRetry)) { + int retryDelay = retryPolicy.DelayBeforeNextRetry(context, exceptionForRetry); + Thread.Sleep(retryDelay); + ResetRetry(context); + context.RetryTimes += 1; + + if (OTSClientTestHelper.RetryTimesAndBackOffRecordSwith) { + OTSClientTestHelper.RetryTimes += 1; + OTSClientTestHelper.RetryDelays.Add(retryDelay); + } + + continue; + } + + if (exceptionForRetry != null) { + throw exceptionForRetry; + } + + // TODO handle retry in BatchWriteRow & BatchGetRow + return; + } + + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/OTSClient.cs b/netstandard-sdk/Aliyun/OTS/OTSClient.cs new file mode 100644 index 0000000..06ee930 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/OTSClient.cs @@ -0,0 +1,832 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System.Collections.Generic; +using System.Threading.Tasks; + +using Aliyun.OTS.DataModel; +using Aliyun.OTS.Request; +using Aliyun.OTS.Response; +using Aliyun.OTS.Handler; +using Aliyun.OTS.DataModel.ConditionalUpdate; +using System; +using System.Net; +using System.Net.Http; + +namespace Aliyun.OTS +{ + /// + /// OTSClient实现,用来访问OTS。 + /// + /// OTSClient实现了OTS服务的所有接口,包括同步形式和异步形式。用户可以通过创建OTSClient的实例,并调用它的 + /// 方法来访问OTS服务的所有功能。 + /// + /// + /// 除了外,OTSClient提供的其他API都存在2种形式:同步和异步;并且 + /// 这些接口都接受一个特定的request实例,这个实例分别封装了请求的不同参数;同样,这些接口都返回一个 + /// response实例,这个实例封装了API的返回数据。 + /// + /// + /// 例如接口,它接受的实例作为参数,在这里实例里 + /// 你可以指定表名、主键名以及其他参数;这个接口返回的实例,包含本次 + /// GetRow请求消耗的CapacityUnit。 + /// + /// + /// 而 的异步形式 同样接受 + /// 作为参数,但它返回一个Task实例,用来代表异步操作。这个异步操作的结果(Task.Result)即 + /// 。 + /// + /// + public class OTSClient + { + #region Fields & Properties + + private HttpClient client; + + private OTSHandler OTSHandler; + private readonly OTSClientConfig ClientConfig; + + #endregion + + #region Construct + + /// + /// OTSClient的构造函数。 + /// + /// OTS服务的地址(例如 'http://instance.cn-hangzhou.ots.aliyun.com:80'),必须以'http://'或者'https://'开头。 + /// OTS的Access Key ID,通过官方网站申请。 + /// OTS的Access Key Secret,通过官方网站申请。 + /// OTS实例名,通过官方网站控制台创建。 + /// + public OTSClient(string endPoint, string accessKeyID, string accessKeySecret, string instanceName) + : this(new OTSClientConfig(endPoint, accessKeyID, accessKeySecret, instanceName)) { } + + // public OTSClient(string configFileName) { } + // TODO enable client config file later + + /// + /// 通过客户端配置的实例来创建实例。 + /// + /// 客户端配置实例 + public OTSClient(OTSClientConfig config) + { + ClientConfig = config; + OTSHandler = new OTSHandler(); + + client = new HttpClient + { + BaseAddress = new Uri(ClientConfig.EndPoint) + }; + + ServicePointManager.DefaultConnectionLimit = config.ConnectionLimit; + OTSClientTestHelper.Reset(); + } + + #endregion + + #region Table Operations + // ListTable + /// + /// 获取当前实例下已创建的所有表的表名。 + /// + /// 请求参数 + /// ListTable的返回,用来获取表名列表。 + /// + /// 获取一个实例下所有表名并循环读取 + /// + /// var request = new ListTableRequest(); + /// var response = otsClient.ListTable(request); + /// foreach (var tableName in response.TableNames) { + /// // Do something + /// } + /// + /// + public ListTableResponse ListTable(ListTableRequest request) + { + return GetResponseFromAsyncTask(ListTableAsync(request)); + } + + /// + /// ListTable的异步形式。 + /// + /// + /// + public Task ListTableAsync(ListTableRequest request) + { + return CallAsync("/ListTable", request); + } + + /// + /// 根据表信息(包含表名、主键的设计和预留读写吞吐量)创建表。 + /// + /// 请求参数 + /// CreateTable的返回,这个返回实例是空的,不包含具体信息。 + /// + /// + /// 创建一个有2个主键列,预留读吞吐量为0,预留写吞吐量为0的表。CU的详细使用规则请参考OTS文档 + /// + /// var primaryKeySchema = new PrimaryKeySchema(); + /// primaryKeySchema.Add("PK0", ColumnValueType.Integer); + /// primaryKeySchema.Add("PK1", ColumnValueType.String); + /// + /// var tableMeta = new TableMeta("SampleTable", primaryKeySchema); + /// var reservedThroughput = new CapacityUnit(0, 0); + /// var request = new CreateTableRequest(tableMeta, reservedThroughput); + /// var response = otsClient.CreateTable(request); + /// + /// + public CreateTableResponse CreateTable(CreateTableRequest request) + { + return GetResponseFromAsyncTask(CreateTableAsync(request)); + } + + /// + /// CreateTable的异步形式。 + /// + /// + /// + public Task CreateTableAsync(CreateTableRequest request) + { + return CallAsync("/CreateTable", request); + } + + /// + /// 根据表名删除表。 + /// + /// 请求参数 + /// DeleteTable的返回,这个返回实例是空的,不包含具体信息。 + /// + public DeleteTableResponse DeleteTable(DeleteTableRequest request) + { + return GetResponseFromAsyncTask(DeleteTableAsync(request)); + } + + /// + /// DeleteTable的异步形式。 + /// + /// + /// + public Task DeleteTableAsync(DeleteTableRequest request) + { + return CallAsync("/DeleteTable", request); + } + + // UpdateTable + /// + /// 更新指定表的预留读吞吐量或预留写吞吐量设置,新设定将于更新成功一分钟内生效。 + /// + /// 请求参数,包含表名以及预留读写吞吐量 + /// UpdateTable的返回,包含更新后的预留读写吞吐量等信息 + /// + /// 将表的预留读吞吐量调整为1,预留写吞吐量调整为1。 + /// + /// var reservedThroughput = new CapacityUnit(1, 1); + /// var request = new UpdateTableRequest("SampleTable", reservedThroughput); + /// var response = otsClient.UpdateTable(request); + /// + /// + public UpdateTableResponse UpdateTable(UpdateTableRequest request) + { + return GetResponseFromAsyncTask(UpdateTableAsync(request)); + } + + /// + /// UpdateTable的异步形式。 + /// + /// + /// + public Task UpdateTableAsync(UpdateTableRequest request) + { + return CallAsync("/UpdateTable", request); + } + + // DescribeTable + /// + /// 查询指定表的结构信息和预留读写吞吐量设置信息。 + /// + /// 请求参数,包含表名 + /// DescribeTable的返回,包含表的结构信息和预留读写吞吐量等信息。 + public DescribeTableResponse DescribeTable(DescribeTableRequest request) + { + return GetResponseFromAsyncTask(DescribeTableAsync(request)); + } + + /// + /// DescribeTable的异步形式。 + /// + /// + /// + public Task DescribeTableAsync(DescribeTableRequest request) + { + return CallAsync("/DescribeTable", request); + } + + #endregion + + #region Single Row Operations + /// + /// 根据给定的主键读取单行数据。 + /// + /// 请求参数 + /// GetRow的返回 + /// + /// + /// var primaryKey = new PrimaryKey(); + /// primaryKey.Add("PK0", new ColumnValue("ABC")); + /// primaryKey.Add("PK1", new ColumnValue(123)); + /// var getRowRequest = new GetRowRequest( + /// "SampleTableName", + /// primaryKey + /// ); + /// var getRowResponse = otsClient.GetRow(getRowRequest); + /// + /// System.Console.WriteLine("GetRow CU Consumed: Read {0} Write {0}", + /// getRowResponse.ConsumedCapacityUnit.Read, + /// getRowResponse.ConsumedCapacityUnit.Write); + /// + /// var pk0 = getRowResponse.PrimaryKey["PK0"]; + /// System.Console.WriteLine("PrimaryKey PK0 Value {0}", pk0.StringValue); + /// var pk1 = getRowResponse.PrimaryKey["PK1"]; + /// System.Console.WriteLine("PrimaryKey PK1 Value {0}", pk1.IntegerValue); + /// var attr0 = getRowResponse.Attribute["IntAttr0"]; + /// System.Console.WriteLine("Attribute IntAttr0 Value {0}", attr0.IntegerValue); + /// var attr1 = getRowResponse.Attribute["StringAttr1"]; + /// System.Console.WriteLine("Attribute StringAttr1 Value {0}", attr1.StringValue); + /// var attr2 = getRowResponse.Attribute["DoubleAttr2"]; + /// System.Console.WriteLine("Attribute DoubleAttr2 Value {0}", attr2.DoubleValue); + /// var attr3 = getRowResponse.Attribute["BooleanAttr3"]; + /// System.Console.WriteLine("Attribute BooleanAttr3 Value {0}", attr2.BooleanValue); + /// + /// + public GetRowResponse GetRow(GetRowRequest request) + { + return GetResponseFromAsyncTask(GetRowAsync(request)); + } + + /// + /// GetRow的异步形式。 + /// + /// + /// + public Task GetRowAsync(GetRowRequest request) + { + return CallAsync("/GetRow", request); + } + + /// + /// 插入数据到指定的行,如果该行不存在,则新增一行;若该行存在,则覆盖原有行。 + /// 指定表名、主键和属性,写入一行数据。返回本次操作消耗的CapacityUnit。 + /// + /// 请求实例 + /// 响应实例 + /// + /// 写入1行数据,并打印出返回的读写能力消耗。 + /// + /// var primaryKey = new PrimaryKey(); + /// primaryKey.Add("PK0", new ColumnValue("ABC")); + /// primaryKey.Add("PK1", new ColumnValue(123)); + /// + /// var attribute = new AttributeColumns(); + /// attribute.Add("IntAttr0", new ColumnValue(12345)); + /// attribute.Add("StringAttr1", new ColumnValue("ABC")); + /// attribute.Add("DoubleAttr2", new ColumnValue(3.14)); + /// attribute.Add("BooleanAttr3", new ColumnValue(true)); + /// + /// var putRowRequest = new PutRowRequest( + /// "SampleTableName", + /// new Condition(RowExistenceExpectation.IGNORE), + /// primaryKey, + /// attribute + /// ); + /// + /// var putRowResponse = otsClient.PutRow(putRowRequest); + /// System.Console.WriteLine("PutRow CU Consumed: Read {0} Write {0}", + /// putRowResponse.ConsumedCapacityUnit.Read, + /// putRowResponse.ConsumedCapacityUnit.Write); + /// + /// + public PutRowResponse PutRow(PutRowRequest request) + { + return GetResponseFromAsyncTask(PutRowAsync(request)); + } + + /// + /// PutRow的异步形式。 + /// + /// + /// + public Task PutRowAsync(PutRowRequest request) + { + return CallAsync("/PutRow", request); + } + + /// + /// 更新指定行的数据,如果该行不存在,则新增一行;若该行存在,则根据请求的内容在这一行中新增、修改或者删除指定列的值。 + /// + /// 请求实例 + /// 响应实例 + /// + /// 更新一行,新增一列"NewColumn",并删除一列"IntAttr0"。 + /// + /// var primaryKey = new PrimaryKey(); + /// primaryKey.Add("PK0", new ColumnValue("ABC")); + /// primaryKey.Add("PK1", new ColumnValue(123)); + /// var updateOfAttribute = new UpdateOfAttribute(); + /// updateOfAttribute.AddAttributeColumnToPut("NewColumn", new ColumnValue(123)); + /// updateOfAttribute.AddAttributeColumnToDelete("IntAttr0"); + /// + /// var updateRowRequest = new UpdateRowRequest( + /// "SampleTableName", + /// new Condition(RowExistenceExpectation.EXPECT_EXIST), + /// primaryKey, + /// updateOfAttribute); + /// var updateRowResponse = otsClient.UpdateRow(updateRowRequest); + /// + /// System.Console.WriteLine("UpdateRow CU Consumed: Read {0} Write {0}", + /// updateRowResponse.ConsumedCapacityUnit.Read, + /// updateRowResponse.ConsumedCapacityUnit.Write); + /// + /// + public UpdateRowResponse UpdateRow(UpdateRowRequest request) + { + return GetResponseFromAsyncTask(UpdateRowAsync(request)); + } + + /// + /// UpdateRow的异步形式。 + /// + /// + /// + public Task UpdateRowAsync(UpdateRowRequest request) + { + return CallAsync("/UpdateRow", request); + } + + /// + /// 指定表名和主键,删除一行数据。 + /// + /// 请求实例 + /// 响应实例 + /// + /// 删除一行 + /// + /// var primaryKey = new PrimaryKey(); + /// primaryKey.Add("PK0", new ColumnValue("ABC")); + /// primaryKey.Add("PK1", new ColumnValue(123)); + /// + /// var deleteRowRequest = new DeleteRowRequest( + /// "SampleTableName", + /// Condition.EXPECT_EXIST, + /// primaryKey); + /// + /// var deleteRowResponse = otsClient.DeleteRow(deleteRowRequest); + /// System.Console.WriteLine("DeleteRow CU Consumed: Read {0} Write {0}", + /// deleteRowResponse.ConsumedCapacityUnit.Read, + /// deleteRowResponse.ConsumedCapacityUnit.Write); + /// + /// + public DeleteRowResponse DeleteRow(DeleteRowRequest request) + { + return GetResponseFromAsyncTask(DeleteRowAsync(request)); + } + + /// + /// DeleteRow的异步形式。 + /// + /// + /// + /// + public Task DeleteRowAsync(DeleteRowRequest request) + { + return CallAsync("/DeleteRow", request); + } + + #endregion + + #region Multiple Row Operations + /// + /// 批量读取一个或多个表中的若干行数据。 + /// BatchGetRow操作可视为多个GetRow操作的集合,各个操作独立执行, + /// 独立返回结果,独立计算服务能力单元。 + /// 与执行大量的GetRow操作相比,使用BatchGetRow操作可以有效减少请求的响应时间,提高数据的读取速率。 + /// + /// 请求实例 + /// 响应实例 + /// + /// 用BatchWriteRow读取2行数据 + /// + /// var primaryKey1 = new PrimaryKey(); + /// primaryKey1.Add("PK0", new ColumnValue("TestData")); + /// primaryKey1.Add("PK1", new ColumnValue(0)); + /// + /// var primaryKey2 = new PrimaryKey(); + /// primaryKey2.Add("PK0", new ColumnValue("TestData")); + /// primaryKey2.Add("PK1", new ColumnValue(1)); + /// + /// var batchGetRowRequest = new BatchGetRowRequest(); + /// var primaryKeys = new List<PrimaryKey>() { + /// primaryKey1, + /// primaryKey2 + /// }; + /// batchGetRowRequest.Add("SampleTableName", primaryKeys); + /// var batchGetRowRespnse = otsClient.BatchGetRow(batchGetRowRequest); + /// + /// foreach (var responseForOneTable in batchGetRowRespnse.RowDataGroupByTable) { + /// foreach (var row in responseForOneTable.Value) { + /// // 处理每一行的返回 + /// } + /// } + /// + /// + public BatchGetRowResponse BatchGetRow(BatchGetRowRequest request) + { + return GetResponseFromAsyncTask(BatchGetRowAsync(request)); + } + + /// + /// BatchGetRow的异步形式。 + /// + /// + /// + public Task BatchGetRowAsync(BatchGetRowRequest request) + { + return CallAsync("/BatchGetRow", request); + } + + /// + /// 批量插入,修改或删除一个或多个表中的若干行数据。 + /// BatchWriteRow操作可视为多个PutRow、UpdateRow、DeleteRow操作的集合,各个操作独立执行,独立返回结果,独立计算服务能力单元。 + /// 与执行大量的单行写操作相比,使用BatchWriteRow操作可以有效减少请求的响应时间,提高数据的写入速率。 + /// + /// 请求实例 + /// 响应实例 + /// + /// 用BatchWriteRow写入2行并解析返回 + /// + /// var primaryKey1 = new PrimaryKey(); + /// primaryKey1.Add("PK0", new ColumnValue("TestData")); + /// primaryKey1.Add("PK1", new ColumnValue(0)); + /// + /// var attribute1 = new AttributeColumns(); + /// attribute1.Add("Col0", new ColumnValue("Hangzhou")); + /// + /// var primaryKey2 = new PrimaryKey(); + /// primaryKey2.Add("PK0", new ColumnValue("TestData")); + /// primaryKey2.Add("PK1", new ColumnValue(1)); + /// + /// var attribute2 = new AttributeColumns(); + /// attribute2.Add("Col0", new ColumnValue("Shanghai")); + /// + /// var rowChanges = new RowChanges(); + /// rowChanges.AddPut(new Condition(RowExistenceExpectation.IGNORE), primaryKey1, attribute1); + /// rowChanges.AddPut(new Condition(RowExistenceExpectation.IGNORE), primaryKey2, attribute2); + /// var batchWriteRowRequest = new BatchWriteRowRequest(); + /// batchWriteRowRequest.Add("SampleTableName", rowChanges); + /// + /// var batchWriteRowResponse = otsClient.BatchWriteRow(batchWriteRowRequest); + /// foreach (var responseForOneTable in batchWriteRowResponse.TableRespones) { + /// foreach (var row in responseForOneTable.Value.PutResponses) { + /// // 处理每一行的返回 + /// } + /// } + /// + /// + public BatchWriteRowResponse BatchWriteRow(BatchWriteRowRequest request) + { + return GetResponseFromAsyncTask(BatchWriteRowAsync(request)); + } + + /// + /// BatchWriteRow的异步形式。 + /// + /// + /// + public Task BatchWriteRowAsync(BatchWriteRowRequest request) + { + return CallAsync("/BatchWriteRow", request); + } + + /// + /// 根据范围条件获取多行数据,返回用来迭代每一行数据的迭代器。 + /// + /// + /// 返回的迭代器。 + public IEnumerable GetRangeIterator(GetIteratorRequest request) + { + int? leftCount = request.QueryCriteria.Limit; + + if (leftCount != null && leftCount < 0) + { + throw new OTSClientException("the value of count must be larger than 0"); + } + + var nextStartPrimaryKey = request.QueryCriteria.InclusiveStartPrimaryKey; + + while (nextStartPrimaryKey != null) + { + request.QueryCriteria.InclusiveStartPrimaryKey = nextStartPrimaryKey; + request.QueryCriteria.Limit = leftCount; + + var response = GetRange(request); + request.ConsumedCapacityUnitCounter.Read += response.ConsumedCapacityUnit.Read; + nextStartPrimaryKey = response.NextPrimaryKey; + + foreach (var rowData in response.RowDataList) + { + yield return rowData; + } + + if (leftCount != null) + { + leftCount -= response.RowDataList.Count; + if (leftCount <= 0) + { + break; + } + } + } + } + + /// + /// 根据范围条件获取多行数据,返回用来迭代每一行数据的迭代器。 + /// + /// 表名 + /// 范围的方向,可以是或者 + /// 范围的开始主键,包含。 + /// 范围的结束主键,不包含。 + /// 用户传入的CapacityUnit消耗计数器。 + /// 可选参数,表示要获取的列的名称列表;默认获取所有列。 + /// 可选参数,表示最多获取多少行;默认获取范围内的所有行。 + /// 返回的迭代器。 + /// + /// + /// var startPrimaryKey = new PrimaryKey(); + /// startPrimaryKey.Add("PK0", new ColumnValue("TestData")); + /// startPrimaryKey.Add("PK1", ColumnValue.INF_MIN); + /// + /// var endPrimaryKey = new PrimaryKey(); + /// endPrimaryKey.Add("PK0", new ColumnValue("TestData")); + /// endPrimaryKey.Add("PK1", ColumnValue.INF_MAX); + /// + /// var consumed = new CapacityUnit(0, 0); + /// + /// var iterator = otsClient.GetRangeIterator( + /// "SampleTableName", + /// GetRangeDirection.Forward, + /// startPrimaryKey, + /// endPrimaryKey, + /// consumed); + /// + /// foreach (var rowData in iterator) { + /// // 处理每一行数据 + /// } + /// + /// + [Obsolete("GetRangeIterator(string ...) is deprecated, please use GetRangeIterator(GetIteratorRequest request) instead.")] + public IEnumerable GetRangeIterator( + string tableName, + GetRangeDirection direction, + PrimaryKey inclusiveStartPrimaryKey, + PrimaryKey exclusiveEndPrimaryKey, + CapacityUnit consumedCapacityUnitCounter, + HashSet columnsToGet = null, + int? count = null, + IColumnCondition condition = null) + { + int? leftCount = count; + + if (leftCount != null && leftCount < 0) + { + throw new OTSClientException("the value of count must be larger than 0"); + } + + PrimaryKey nextStartPrimaryKey = inclusiveStartPrimaryKey; + + while (nextStartPrimaryKey != null) + { + var request = new GetRangeRequest( + tableName, direction, nextStartPrimaryKey, exclusiveEndPrimaryKey, + columnsToGet, leftCount, condition); + + var response = GetRange(request); + consumedCapacityUnitCounter.Read += response.ConsumedCapacityUnit.Read; + nextStartPrimaryKey = response.NextPrimaryKey; + + foreach (var rowData in response.RowDataList) + { + yield return rowData; + } + + if (leftCount != null) + { + leftCount -= response.RowDataList.Count; + if (leftCount <= 0) + { + break; + } + } + } + } + + /// + /// 根据范围条件获取多行数据。 + /// + /// 请求实例 + /// 响应实例 + public GetRangeResponse GetRange(GetRangeRequest request) + { + return GetResponseFromAsyncTask(GetRangeAsync(request)); + } + + /// + /// GetRange的异步版本。 + /// + /// + /// + public Task GetRangeAsync(GetRangeRequest request) + { + return CallAsync("/GetRange", request); + } + + #endregion + + #region Search Operations + public ListSearchIndexResponse ListSearchIndex(ListSearchIndexRequest request) + { + return GetResponseFromAsyncTask(ListSearchIndexAsync(request)); + } + + /// + /// ListSearchIndex的异步形式。 + /// + /// + /// + public Task ListSearchIndexAsync(ListSearchIndexRequest request) + { + return CallAsync("/ListSearchIndex", request); + } + + public CreateSearchIndexResponse CreateSearchIndex(CreateSearchIndexRequest request) + { + return GetResponseFromAsyncTask(CreateSearchIndexAsync(request)); + } + + /// + /// CreateSearchIndex的异步形式。 + /// + /// + /// + public Task CreateSearchIndexAsync(CreateSearchIndexRequest request) + { + return CallAsync("/CreateSearchIndex", request); + } + + public DeleteSearchIndexResponse DeleteSearchIndex(DeleteSearchIndexRequest request) + { + return GetResponseFromAsyncTask(DeleteSearchIndexAsync(request)); + } + + /// + /// DeleteSearchIndex的异步形式。 + /// + /// + /// + public Task DeleteSearchIndexAsync(DeleteSearchIndexRequest request) + { + return CallAsync("/DeleteSearchIndex", request); + } + + public DescribeSearchIndexResponse DescribeSearchIndex(DescribeSearchIndexRequest request) + { + return GetResponseFromAsyncTask(DescribeSearchIndexAsync(request)); + } + + /// + /// DescribeSearchIndex的异步形式。 + /// + /// + /// + public Task DescribeSearchIndexAsync(DescribeSearchIndexRequest request) + { + return CallAsync("/DescribeSearchIndex", request); + } + + public SearchResponse Search(SearchRequest request) + { + return GetResponseFromAsyncTask(SearchAsync(request)); + } + + /// + /// Search的异步形式。 + /// + /// + /// + public Task SearchAsync(SearchRequest request) + { + return CallAsync("/Search", request); + } + #endregion + + + #region Search Operations + + + public CreateGlobalIndexResponse CreateGlobalIndex(CreateGlobalIndexRequest request) + { + return GetResponseFromAsyncTask(CreateGlobalIndexAsync(request)); + } + + /// + /// CreateGlobalIndex的异步形式。 + /// + /// + /// + public Task CreateGlobalIndexAsync(CreateGlobalIndexRequest request) + { + return CallAsync("/CreateIndex", request); + } + + public DeleteGlobalIndexResponse DeleteGlobalIndex(DeleteGlobalIndexRequest request) + { + return GetResponseFromAsyncTask(DeleteGlobalIndexAsync(request)); + } + + /// + /// CreateGlobalIndex的异步形式。 + /// + /// + /// + public Task DeleteGlobalIndexAsync(DeleteGlobalIndexRequest request) + { + return CallAsync("/DropIndex", request); + } + + #endregion + + + #region Private Function + + private void ThrowIfNullRequest(TRequestType request) + { + if (request == null) + { + throw new ArgumentNullException("request"); + } + } + + + private Task CallAsync(string apiName, TRequest request) + where TResponse : OTSResponse, new() + where TRequest : OTSRequest + { + ThrowIfNullRequest(request); + + Context otsContext = new Context + { + ClientConfig = ClientConfig, + APIName = apiName, + OTSRequest = request, + OTSReponse = new TResponse(), + HttpClient = client + }; + + OTSHandler.HandleBefore(otsContext); + + return otsContext.HttpTask.ContinueWith((t) => + { + // ConnectionPool.ReturnHttpClient(otsContext.HttpClient); + OTSHandler.HandleAfter(otsContext); + return (TResponse)otsContext.OTSReponse; + }); + } + + private TResponse GetResponseFromAsyncTask(Task task) + { + try + { + task.Wait(); + } + catch (AggregateException e) + { + if (ClientConfig.OTSErrorLogHandler != null) + { + ClientConfig.OTSErrorLogHandler.Invoke("Exception:\n" + e.GetBaseException().StackTrace + "\n"); + } + + throw e.GetBaseException(); + } + + return task.Result; + } + + #endregion + } +} diff --git a/netstandard-sdk/Aliyun/OTS/OTSClientConfig.cs b/netstandard-sdk/Aliyun/OTS/OTSClientConfig.cs new file mode 100644 index 0000000..cc7fa1b --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/OTSClientConfig.cs @@ -0,0 +1,144 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using Aliyun.OTS.Util; +using Aliyun.OTS.Retry; +using System; + +namespace Aliyun.OTS +{ + /// + /// OTS客户端配置,用来设置用户的权限信息等。 + /// + public class OTSClientConfig + { + private static int DefaultConnectionLimit = 300; + private static readonly string DefaultAPIVersion = "2015-12-31"; + private const string UserAgentPrefix = "aliyun-tablestore-sdk-dotnet/"; + private static readonly string _userAgent = GetDefaultUserAgent(); + + /// + /// OTS服务的地址(例如 'http://instance.cn-hangzhou.ots.aliyun.com:80'),必须以'http://'或'https://'开头。 + /// + public string EndPoint { get; set; } + + /// + /// OTS的Access Key ID,通过官方网站申请。 + /// + public string AccessKeyID { get; set; } + + /// + /// OTS的Access Key Secret,通过官方网站申请。 + /// + public string AccessKeySecret { get; set; } + + /// + /// OTS实例名,通过官方网站控制台创建。 + /// + public string InstanceName { get; set; } + + /// + /// OTS协议的版本,默认为"2015-12-31"。无需改动。 + /// + public string APIVersion { get; set; } + + /// + /// 连接池的最大连接数,默认为300。 + /// + public int ConnectionLimit { get; set; } + + /// + /// 重试策略,默认为。 + /// + public RetryPolicy RetryPolicy { get; set; } + + public string UserAgent + { + get { return _userAgent; } + } + + /// + /// OTSClient的Log回调函数类型。如果要改变OTSClient默认的日志行为,需要定义这个类型的函数并 + /// 设置到OTSClientConfig中。 + /// + /// 回调函数被传入的日志信息。 + public delegate void OTSLogHandler(string message); + + /// + /// 错误日志的处理函数。默认行为是将日志输出到标准输出文件。 + /// + public OTSLogHandler OTSErrorLogHandler { get; set; } + + /// + /// 调试日志的处理函数。默认行为是将日志输出到标准输出文件。 + /// + public OTSLogHandler OTSDebugLogHandler { get; set; } + + /// + /// 跳过返回校验 + /// + public bool SkipResponseValidation { get; set; } + + /// + /// OTSClientConfig的构造函数。 + /// + /// OTS服务的地址 + /// OTS的Access Key ID + /// OTS的Access Key Secret + /// OTS实例名 + public OTSClientConfig(string endPoint, string accessKeyID, string accessKeySecret, string instanceName) + { + if (string.IsNullOrEmpty(endPoint)) + { + throw new ArgumentNullException("endPoint"); + } + + if (string.IsNullOrEmpty(accessKeyID)) + { + throw new ArgumentNullException("accessKeyID"); + } + + if (string.IsNullOrEmpty(accessKeySecret)) + { + throw new ArgumentNullException("AccessKeySecret"); + } + + if (string.IsNullOrEmpty(instanceName)) + { + throw new ArgumentNullException("instanceName"); + } + + EndPoint = endPoint.Trim(); + AccessKeyID = accessKeyID.Trim(); + AccessKeySecret = accessKeySecret.Trim(); + InstanceName = instanceName.Trim(); + ConnectionLimit = DefaultConnectionLimit; + APIVersion = DefaultAPIVersion; + RetryPolicy = RetryPolicy.DefaultRetryPolicy; + + OTSErrorLogHandler = OTSDefaultLogHandler.DefaultErrorLogHandler; + OTSDebugLogHandler = OTSDefaultLogHandler.DefaultDebugLogHandler; + } + + /// + /// 获取User-Agent信息。 + /// + private static string GetDefaultUserAgent() + { + return UserAgentPrefix + + typeof(OTSClientConfig).Assembly.GetName().Version + "(" + + OtsUtils.DetermineOsVersion() + "/" + + Environment.OSVersion.Version + "/" + + OtsUtils.DetermineSystemArchitecture() + ";" + + Environment.Version + ")"; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/OTSClientException.cs b/netstandard-sdk/Aliyun/OTS/OTSClientException.cs new file mode 100644 index 0000000..84c32ab --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/OTSClientException.cs @@ -0,0 +1,43 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System.Net; + +namespace Aliyun.OTS +{ + /// + /// OTS客户端错误,用来表示OTS SDK运行时遇到的错误。 + /// + public class OTSClientException : OTSException + { + /// + /// 错误信息。 + /// + public string ErrorMessage; + + /// + /// HTTP返回码(如果有)。 + /// + public HttpStatusCode HttpStatusCode { get; private set; } + + public OTSClientException(string errorMessage) + : base(errorMessage) + { + ErrorMessage = errorMessage; + } + + public OTSClientException(string errorMessage, HttpStatusCode httpCode) + : this(errorMessage) + { + HttpStatusCode = httpCode; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/OTSClientTestHelper.cs b/netstandard-sdk/Aliyun/OTS/OTSClientTestHelper.cs new file mode 100644 index 0000000..c61a1b5 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/OTSClientTestHelper.cs @@ -0,0 +1,67 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System.Net; +using System.Collections.Generic; + +namespace Aliyun.OTS +{ + public static class OTSClientTestHelper + { + public static bool HTTPResponseBodyIsSet { get; private set; } + public static byte[] HTTPResponseBody { get; private set; } + + public static bool HttpStatusCodeIsSet { get; private set; } + public static HttpStatusCode HttpStatusCode { get; private set; } + + public static bool HttpResponseHeadersIsSet { get; private set; } + public static Dictionary HttpRequestHeaders { get; private set; } + + public static bool RetryTimesAndBackOffRecordSwith { get; private set; } + public static int RetryTimes; + public static List RetryDelays { get; private set; } + public static List RetryExceptions { get; private set; } + + public static void Reset() + { + HTTPResponseBodyIsSet = false; + HttpStatusCodeIsSet = false; + HttpResponseHeadersIsSet = false; + RetryTimesAndBackOffRecordSwith = false; + } + + public static void SetHTTPResponseBody(byte[] body) + { + HTTPResponseBodyIsSet = true; + HTTPResponseBody = body; + } + + public static void SetHttpStatusCode(HttpStatusCode code) + { + HttpStatusCodeIsSet = true; + HttpStatusCode = code; + } + + public static void SetHttpRequestHeaders(Dictionary headers) + { + HttpResponseHeadersIsSet = true; + HttpRequestHeaders = headers; + } + + public static void TurnOnRetryTimesAndBackOffRecording() + { + RetryTimesAndBackOffRecordSwith = true; + RetryTimes = 0; + RetryDelays = new List(); + RetryExceptions = new List(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/OTSDefaultLogHandler.cs b/netstandard-sdk/Aliyun/OTS/OTSDefaultLogHandler.cs new file mode 100644 index 0000000..0a991ca --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/OTSDefaultLogHandler.cs @@ -0,0 +1,37 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ +using System; + +namespace Aliyun.OTS +{ + /// + /// 默认的日志处理,行为是将错误日志和调试日志打印到标准输出文件。 + /// + public class OTSDefaultLogHandler + { + protected static string GetDateTimeString() + { + return DateTime.Now.ToString("o"); + } + + public static void DefaultErrorLogHandler(string message) + { + var dateString = GetDateTimeString(); + System.Console.WriteLine("OTSClient ERROR {0} {1}", dateString, message); + } + + public static void DefaultDebugLogHandler(string message) + { + var dateString = GetDateTimeString(); + System.Console.WriteLine("OTSClient DEBUG {0} {1}", dateString, message); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/OTSException.cs b/netstandard-sdk/Aliyun/OTS/OTSException.cs new file mode 100644 index 0000000..ee7d80a --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/OTSException.cs @@ -0,0 +1,28 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; + +namespace Aliyun.OTS +{ + /// + /// OTS错误类型的基类,它有两个子类。 + /// + public class OTSException : Exception + { + public OTSException() { } + + public OTSException(string message) + : base(message) + { + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/OTSServerException.cs b/netstandard-sdk/Aliyun/OTS/OTSServerException.cs new file mode 100644 index 0000000..5f74c9a --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/OTSServerException.cs @@ -0,0 +1,101 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; +using System.Net; + +namespace Aliyun.OTS +{ + /// + /// OTS服务端错误类型,用来表示OTS返回的错误。 + /// + /// 完整的OTS出错信息请见阿里云官网关于OTS错误信息的定义。 + /// + /// + public class OTSServerException : OTSException + { + /// + /// API名称,例如 "/GetRow","/CeateTable"。 + /// + public string APIName { get; private set; } + + /// + /// HTTP返回码。 + /// + public HttpStatusCode HttpStatusCode { get; private set; } + + /// + /// 错误类型字符串。 + /// + public string ErrorCode { get; private set; } + + /// + /// 错误消息字符串。 + /// + public string ErrorMessage { get; private set; } + + /// + /// 本次请求的ID,用于OTS工程师定位错误使用。 + /// + public string RequestID { get; private set; } + + private static string GetMessageString(string apiName, HttpStatusCode httpStatusCode, string errorCode, string errorMessage, string requestID) + { + string ret = String.Format( + "OTS request failed, API: {0}, HTTPStatus: {1} {2}", + apiName, (int)httpStatusCode, httpStatusCode + ); + + if (errorCode != null) + { + ret += String.Format(", ErrorCode: {0}", errorCode); + } + + if (errorMessage != null) + { + ret += String.Format(", ErrorMessage: {0}", errorMessage); + } + + if (requestID != null) + { + ret += String.Format(", Request ID: {0}", requestID); + } + + return ret; + } + + public OTSServerException(string apiName, HttpStatusCode httpStatusCode) + : base(GetMessageString(apiName, httpStatusCode, null, null, null)) + { + APIName = apiName; + HttpStatusCode = httpStatusCode; + } + + public OTSServerException(string apiName, HttpStatusCode httpStatusCode, string errorCode, string errorMessage) + : base(GetMessageString(apiName, httpStatusCode, errorCode, errorMessage, null)) + { + APIName = apiName; + HttpStatusCode = httpStatusCode; + ErrorCode = errorCode; + ErrorMessage = errorMessage; + } + + public OTSServerException(string apiName, HttpStatusCode httpStatusCode, string errorCode, string errorMessage, string requestID) + : base(GetMessageString(apiName, httpStatusCode, errorCode, errorMessage, requestID)) + { + APIName = apiName; + HttpStatusCode = httpStatusCode; + ErrorCode = errorCode; + ErrorMessage = errorMessage; + RequestID = requestID; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/IResultParser.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/IResultParser.cs new file mode 100644 index 0000000..f3c8ab2 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/IResultParser.cs @@ -0,0 +1,8 @@ +using System; +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public interface IResultParser + { + Object getObject(GetRowRequest response); + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferBuilder.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferBuilder.cs new file mode 100644 index 0000000..5e804b5 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferBuilder.cs @@ -0,0 +1,488 @@ +using System.IO; +using Aliyun.OTS.DataModel; +using System.Collections.Generic; +using System; + +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public static class PlainBufferBuilder + { + public static int ComputePrimaryKeyValue(ColumnValue value) + { + int size = PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; + size += ComputePrimaryKeyValueWithoutLengthPrefix(value); + return size; + } + + + // Bytes Data: value_type + type + public static int ComputePrimaryKeyValueWithoutLengthPrefix(ColumnValue value) + { + int size = 1; // length + type + value + if (value.IsInfMin() || value.IsInfMax() || value.IsPlaceHolderForAutoIncr()) + { + return size; // inf value and AutoIncr only has a type. + } + + switch (value.Type) + { + case ColumnValueType.String: + { + size += PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; + size += value.AsStringInBytes().Length; + break; + } + case ColumnValueType.Integer: + { + size += PlainBufferOutputStream.LITTLE_ENDIAN_64_SIZE; + break; + } + case ColumnValueType.Binary: + { + size += PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; + size += value.BinaryValue.Length; + break; + } + default: + throw new IOException("Bug: unsupported primary key type: " + value.Type); + + } + return size; + } + + public static int ComputeColumnValue(ColumnValue value) + { + int size = PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; + size += ComputeColumnValueWithoutLengthPrefix(value); + return size; + } + + // Bytes Data: value_type + type + public static int ComputeColumnValueWithoutLengthPrefix(ColumnValue value) + { + int size = 1; // length + type + value + + if (value.IsInfMin() || value.IsInfMax() || value.IsPlaceHolderForAutoIncr()) + { + return size; // inf value and AutoIncr only has a type. + } + + switch (value.Type) + { + case ColumnValueType.String: + { + size += PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; + size += value.AsStringInBytes().Length; + break; + } + case ColumnValueType.Integer: + { + size += PlainBufferOutputStream.LITTLE_ENDIAN_64_SIZE; + break; + } + case ColumnValueType.Binary: + { + size += PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; + size += value.BinaryValue.Length; + break; + } + case ColumnValueType.Double: + { + size += PlainBufferOutputStream.LITTLE_ENDIAN_64_SIZE; + break; + } + case ColumnValueType.Boolean: + { + size += 1; + break; + } + default: + throw new IOException("Bug: unsupported column type: " + value.Type); + + } + + return size; + } + + public static int ComputePlainBufferExtension(PlainBufferExtension extension) + { + int size = 1; //TAG_EXTENSION + size += PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; // Length + if (extension.HasSeq()) + { + size += ComputePlainBufferSequenceInfo(); + } + + return size; + } + + public static int ComputePlainBufferSequenceInfo() + { + int size = 1;//TAG_SEQ_INFO + size += PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; // Length + size += 1 + PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; // TAG_SEQ_INFO_EPOCH + epoch + size += 1 + PlainBufferOutputStream.LITTLE_ENDIAN_64_SIZE; // TAG_SEQ_INFO_TS + timestamp + size += 1 + PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; // TAG_SEQ_INFO_ROW_INDEX + rowIndex + return size; + } + + public static int ComputePlainBufferCell(PlainBufferCell cell) + { + int size = 1; // TAG_CELL + if (cell.HasCellName()) + { + size += 1; // TAG_CELL_NAME + size += PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; // length + size += cell.GetNameRawData().Length; + } + if (cell.HasCellValue()) + { + size += 1; // TAG_CELL_VALUE + if (cell.IsPk()) + { + size += ComputePrimaryKeyValue(cell.GetPkCellValue()); + } + else + { + size += ComputeColumnValue(cell.GetCellValue()); + } + } + if (cell.HasCellType()) + { + size += 2; // TAG_CELL_OP_TYPE + type + } + if (cell.HasCellTimestamp()) + { + size += 1 + PlainBufferOutputStream.LITTLE_ENDIAN_64_SIZE; // TAG_CELL_TIMESTAMP + timestamp + } + size += 2; // TAG_CELL_CHECKSUM + checksum + return size; + } + + public static int ComputePlainBufferRow(PlainBufferRow row) + { + int size = 0; + size += 1; // TAG_ROW_PK + foreach (PlainBufferCell cell in row.GetPrimaryKey()) + { + size += ComputePlainBufferCell(cell); + } + if (row.GetCells().Count > 0) + { + size += 1; // TAG_ROW_DATA + foreach (PlainBufferCell cell in row.GetCells()) + { + size += ComputePlainBufferCell(cell); + } + } + if (row.HasDeleteMarker()) + { + size += 1; // TAG_DELETE_MARKER + } + if (row.HasExtension()) + { + size += ComputePlainBufferExtension(row.GetExtension()); + } + size += 2; // TAG_ROW_CHECKSUM + checksum + return size; + } + + public static int ComputePlainBufferRowWithHeader(PlainBufferRow row) + { + int size = PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; // header + size += ComputePlainBufferRow(row); + return size; + } + + + public static int ComputeSkipLengthForExtensionTag(PlainBufferExtension extension) + { + int size = 0; + if (extension.HasSeq()) + { + size += 1 + PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; //TAG_SEQ_ING + length + size += ComputeSkipLengthForSequenceInfo(); + } + + return size; + } + + public static int ComputeSkipLengthForSequenceInfo() + { + int size = 0; + size += 1 + PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; // TAG_SEQ_INFO_EPOCH + epoch + size += 1 + PlainBufferOutputStream.LITTLE_ENDIAN_64_SIZE; // TAG_SEQ_INFO_TS + timestamp + size += 1 + PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; // TAG_SEQ_INFO_ROW_INDEX + rowIndex + return size; + } + + public static byte[] BuildPrimaryKeyValueWithoutLengthPrefix(ColumnValue value) + { + int size = ComputePrimaryKeyValueWithoutLengthPrefix(value); + PlainBufferOutputStream output = new PlainBufferOutputStream(size); + PlainBufferCodedOutputStream codedOutput = new PlainBufferCodedOutputStream(output); + codedOutput.WritePrimaryKeyValueWithoutLengthPrefix(value); + + if (!output.IsFull()) + { + throw new IOException("Bug: serialize primary key value failed. Buffer remains " + output.Remain()); + } + + return output.GetBuffer(); + } + + public static byte[] BuildColumnValueWithoutLengthPrefix(ColumnValue value) + { + int size = ComputeColumnValueWithoutLengthPrefix(value); + PlainBufferOutputStream output = new PlainBufferOutputStream(size); + PlainBufferCodedOutputStream codedOutput = new PlainBufferCodedOutputStream(output); + codedOutput.WriteColumnValueWithoutLengthPrefix(value); + + if (!output.IsFull()) + { + throw new IOException("Bug: serialize column value failed. Buffer remains " + output.Remain()); + } + + return output.GetBuffer(); + } + + public static int ComputePrimaryKeyColumn(Column column) + { + int size = 2; // TAG_CELL + TAG_CELL_NAME; + size += PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; + size += column.GetNameRawData().Length; + size += 1; // TAG_CELL_VALUE + size += ComputePrimaryKeyValue(column.Value); + size += 2; // TAG_CELL_CHECKSUM + checksum + return size; + } + + // Bytes Data: TAG_ROW_PK + [primary key columns] + public static int ComputePrimaryKey(PrimaryKey primaryKey) + { + int size = 1; // TAG_ROW_PK + foreach (var key in primaryKey) + { + var column = new Column(key.Key, key.Value); + size += ComputePrimaryKeyColumn(column); + } + + return size; + } + + public static int ComputePrimaryKeyWithHeader(PrimaryKey primaryKey) + { + int size = PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE; // Header + size += ComputePrimaryKey(primaryKey); + size += 2; // TAG_ROW_CHECKSUM + checksum + return size; + } + + public static void WritePrimaryKeyValue(ColumnValue value, PlainBufferOutputStream output) + { + if (value.IsInfMin()) + { + output.WriteRawLittleEndian32(1); + output.WriteRawByte(PlainBufferConsts.VT_INF_MIN); + return; + } + + if (value.IsInfMax()) + { + output.WriteRawLittleEndian32(1); + output.WriteRawByte(PlainBufferConsts.VT_INF_MAX); + return; + } + + if (value.IsPlaceHolderForAutoIncr()) + { + output.WriteRawLittleEndian32(1); + output.WriteRawByte(PlainBufferConsts.VT_AUTO_INCREMENT); + return; + } + + switch (value.Type) + { + case ColumnValueType.String: + { + byte[] rawData = value.AsStringInBytes(); + int prefixLength = PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE + 1; // length + type + length + output.WriteRawLittleEndian32(prefixLength + rawData.Length); // length + type + value + output.WriteRawByte(PlainBufferConsts.VT_STRING); + output.WriteRawLittleEndian32(rawData.Length); + output.WriteBytes(rawData); + break; + } + case ColumnValueType.Integer: + { + output.WriteRawLittleEndian32(1 + PlainBufferOutputStream.LITTLE_ENDIAN_64_SIZE); + output.WriteRawByte(PlainBufferConsts.VT_INTEGER); + output.WriteRawLittleEndian64(value.IntegerValue); + break; + } + case ColumnValueType.Binary: + { + byte[] rawData = value.BinaryValue; + int prefixLength = PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE + 1; // length + type + length + output.WriteRawLittleEndian32(prefixLength + rawData.Length); // length + type + value + output.WriteRawByte(PlainBufferConsts.VT_BLOB); + output.WriteRawLittleEndian32(rawData.Length); + output.WriteBytes(rawData); + break; + } + default: + throw new IOException("Bug: unsupported primary key type: " + value.GetType()); + } + } + + public static void WritePrimaryKeyColumn(Column column, PlainBufferOutputStream output, byte checksum) + { + output.WriteRawByte(PlainBufferConsts.TAG_CELL); + output.WriteRawByte(PlainBufferConsts.TAG_CELL_NAME); + byte[] rawData = column.GetNameRawData(); + output.WriteRawLittleEndian32(rawData.Length); + output.WriteBytes(rawData); + output.WriteRawByte(PlainBufferConsts.TAG_CELL_VALUE); + WritePrimaryKeyValue(column.Value, output); + output.WriteRawByte(PlainBufferConsts.TAG_CELL_CHECKSUM); + output.WriteRawByte(checksum); + } + + public static byte[] BuildPrimaryKeyWithHeader(PrimaryKey primaryKey) + { + int size = ComputePrimaryKeyWithHeader(primaryKey); + PlainBufferOutputStream output = new PlainBufferOutputStream(size); + output.WriteRawLittleEndian32(PlainBufferConsts.HEADER); + output.WriteRawByte(PlainBufferConsts.TAG_ROW_PK); + + byte rowChecksum = (byte)0x0, cellChecksum; + + foreach (var key in primaryKey) + { + var column = new Column(key.Key, key.Value); + cellChecksum = PlainBufferCrc8.crc8((byte)0x0, column.GetNameRawData()); + cellChecksum = column.Value.GetChecksum(cellChecksum); + WritePrimaryKeyColumn(column, output, cellChecksum); + rowChecksum = PlainBufferCrc8.crc8(rowChecksum, cellChecksum); + } + + // 没有deleteMarker, 要与0x0做crc. + rowChecksum = PlainBufferCrc8.crc8(rowChecksum, (byte)0x0); + + output.WriteRawByte(PlainBufferConsts.TAG_ROW_CHECKSUM); + output.WriteRawByte(rowChecksum); + + if (!output.IsFull()) + { + throw new IOException("Bug: serialize primary key failed."); + } + + return output.GetBuffer(); + } + + public static byte[] BuildRowPutChangeWithHeader(RowPutChange rowChange) + { + + List pkCells = new List(); + + if (rowChange.GetPrimaryKey() == null) + { + throw new ArgumentException("Primary Key is NULL"); + } + + foreach (PrimaryKeyColumn column in rowChange.GetPrimaryKey().GetPrimaryKeyColumns()) + { + pkCells.Add(PlainBufferConversion.ToPlainBufferCell(column)); + } + + List cells = new List(); + foreach (Column column in rowChange.GetColumnsToPut()) + { + cells.Add(PlainBufferConversion.ToPlainBufferCell(column, false, false, false, (byte)0x0)); + } + + PlainBufferRow row = new PlainBufferRow(pkCells, cells, false); + + int size = ComputePlainBufferRowWithHeader(row); + PlainBufferOutputStream output = new PlainBufferOutputStream(size); + PlainBufferCodedOutputStream codedOutput = new PlainBufferCodedOutputStream(output); + codedOutput.WriteRowWithHeader(row); + if (!output.IsFull()) + { + throw new IOException("Bug: serialize row put change failed. Buffer remains " + output.Remain()); + } + + return output.GetBuffer(); + } + + public static byte[] BuildRowUpdateChangeWithHeader(RowUpdateChange rowChange) + { + List pkCells = new List(); + foreach (var column in rowChange.GetPrimaryKey().GetPrimaryKeyColumns()) + { + pkCells.Add(PlainBufferConversion.ToPlainBufferCell(column)); + } + + List cells = new List(); + if (rowChange.GetColumnsToUpdate().Count > 0) + { + foreach (Tuple column in rowChange.GetColumnsToUpdate()) + { + switch (column.Item2) + { + case RowChangeType.PUT: + cells.Add(PlainBufferConversion.ToPlainBufferCell(column.Item1, false, false, false, (byte)0x0)); + break; + case RowChangeType.DELETE: + cells.Add(PlainBufferConversion.ToPlainBufferCell(column.Item1, true, false, true, PlainBufferConsts.DELETE_ONE_VERSION)); + break; + case RowChangeType.DELETE_ALL: + cells.Add(PlainBufferConversion.ToPlainBufferCell(column.Item1, true, true, true, PlainBufferConsts.DELETE_ALL_VERSION)); + break; + case RowChangeType.INCREMENT: + cells.Add(PlainBufferConversion.ToPlainBufferCell(column.Item1, false, true, true, PlainBufferConsts.INCREMENT)); + break; + } + } + } + + PlainBufferRow row = new PlainBufferRow(pkCells, cells, false); + + int size = ComputePlainBufferRowWithHeader(row); + PlainBufferOutputStream output = new PlainBufferOutputStream(size); + PlainBufferCodedOutputStream codedOutput = new PlainBufferCodedOutputStream(output); + codedOutput.WriteRowWithHeader(row); + + if (!output.IsFull()) + { + throw new IOException("Bug: serialize row update change failed."); + } + + return output.GetBuffer(); + } + + public static byte[] BuildRowDeleteChangeWithHeader(RowDeleteChange rowChange) + { + List pkCells = new List(); + foreach (var primaryKeyColumn in rowChange.GetPrimaryKey().GetPrimaryKeyColumns()) + { + pkCells.Add(PlainBufferConversion.ToPlainBufferCell(primaryKeyColumn)); + } + + List cells = new List(); + PlainBufferRow row = new PlainBufferRow(pkCells, cells, true); + + int size = ComputePlainBufferRowWithHeader(row); + PlainBufferOutputStream output = new PlainBufferOutputStream(size); + PlainBufferCodedOutputStream codedOutput = new PlainBufferCodedOutputStream(output); + codedOutput.WriteRowWithHeader(row); + + if (!output.IsFull()) + { + throw new IOException("Bug: serialize row delete change failed."); + } + + return output.GetBuffer(); + } + } +} \ No newline at end of file diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferCell.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferCell.cs new file mode 100644 index 0000000..b15405e --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferCell.cs @@ -0,0 +1,218 @@ +using System; +using Aliyun.OTS.DataModel; +using System.IO; +using Aliyun.OTS; +using System.Text; +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public class PlainBufferCell + { + + private String cellName; + private byte[] nameRawData; + private bool hasCellName; + + private ColumnValue cellValue; + private bool hasCellValue; + + private bool isPk; + private ColumnValue pkCellValue; + + private byte cellType; + private bool hasCellType; + + private long cellTimestamp; + private bool hasCellTimestamp; + + private byte checksum; + private bool hasChecksum; + + public String GetCellName() + { + return cellName; + } + + public byte[] GetNameRawData() + { + if (nameRawData == null) + { + this.nameRawData = Encoding.UTF8.GetBytes(cellName); + } + + return nameRawData; + } + + public void SetCellName(String cellName) + { + this.cellName = cellName; + this.hasCellName = true; + this.nameRawData = null; + this.hasChecksum = false; + } + + public bool HasCellName() + { + return this.hasCellName; + } + + public ColumnValue GetCellValue() + { + return this.cellValue; + } + + public void SetCellValue(ColumnValue cellValue) + { + this.cellValue = cellValue; + this.hasCellValue = true; + this.hasChecksum = false; + } + + public bool HasCellValue() + { + return this.hasCellValue; + } + + public byte GetCellType() + { + return this.cellType; + } + + public void SetCellType(byte cellType) + { + this.cellType = cellType; + this.hasCellType = true; + this.hasChecksum = false; + } + + public bool HasCellType() + { + return this.hasCellType; + } + + public long GetCellTimestamp() + { + return this.cellTimestamp; + } + + public void SetCellTimestamp(long cellTimestamp) + { + this.cellTimestamp = cellTimestamp; + this.hasCellTimestamp = true; + this.hasChecksum = false; + } + + public bool HasCellTimestamp() + { + return hasCellTimestamp; + } + + /// + /// 会自动计算当前的checksum并返回,当没有数据变化时,checksum会缓存在对象中,以减少不必要的计算。 + /// + /// The checksum. + public byte GetChecksum() + { + if (!this.hasChecksum) + { + GenerateChecksum(); + } + + return this.checksum; + } + + private void GenerateChecksum() + { + this.checksum = PlainBufferCrc8.GetChecksum((byte)0x0, this); + this.hasChecksum = true; + } + + public override int GetHashCode() + { + return base.GetHashCode(); + } + + public override bool Equals(Object obj) + { + if (obj == null || !(obj is PlainBufferCell)) + { + return false; + } + + try + { + if (GetChecksum() != ((PlainBufferCell)obj).GetChecksum()) + { + return false; + } + } + catch (IOException e) + { + throw new OTSException("Error when getChecksum." + e.Message); + } + + if ((HasCellName() != ((PlainBufferCell)obj).HasCellName()) + || (HasCellName() && !GetCellName().Equals(((PlainBufferCell)obj).GetCellName()))) + { + return false; + } + + if ((HasCellValue() != ((PlainBufferCell)obj).HasCellValue()) + || (HasCellValue() && !GetCellValue().Equals(((PlainBufferCell)obj).GetCellValue()))) + { + return false; + } + + if ((IsPk() != ((PlainBufferCell)obj).IsPk()) + || (IsPk() && !GetPkCellValue().Equals(((PlainBufferCell)obj).GetPkCellValue()))) + { + return false; + } + + if ((HasCellType() != ((PlainBufferCell)obj).HasCellType()) + || (HasCellType() && (GetCellType() != ((PlainBufferCell)obj).GetCellType()))) + { + return false; + } + + if ((HasCellTimestamp() != ((PlainBufferCell)obj).HasCellTimestamp()) + || (HasCellTimestamp() && (GetCellTimestamp() != ((PlainBufferCell)obj).GetCellTimestamp()))) + { + return false; + } + + return true; + } + + + public override String ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("CellName: " + HasCellName() + "|" + cellName); + sb.Append(", CellValue: " + HasCellValue() + "|" + cellValue); + sb.Append(", CellType: " + HasCellType() + "|" + cellType); + sb.Append(", IsPk: " + IsPk() + "|" + GetPkCellValue()); + sb.Append(", CellTimestamp: " + HasCellTimestamp() + "|" + cellTimestamp); + sb.Append(", Checksum: " + this.hasChecksum + "|" + checksum); + return sb.ToString(); + } + + public bool IsPk() + { + return isPk; + } + + public ColumnValue GetPkCellValue() + { + return pkCellValue; + } + + public void SetPkCellValue(ColumnValue pkCellValue) + { + this.pkCellValue = pkCellValue; + this.hasCellValue = true; + this.hasChecksum = false; + this.isPk = true; + } + } + +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferCodedInputStream.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferCodedInputStream.cs new file mode 100644 index 0000000..6ed584f --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferCodedInputStream.cs @@ -0,0 +1,352 @@ +using System.IO; +using System.Collections.Generic; +using Google.ProtocolBuffers; +using Aliyun.OTS.DataModel; + +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public class PlainBufferCodedInputStream + { + private readonly CodedInputStream inputStream; + private uint lastTag = 0; + + public PlainBufferCodedInputStream(CodedInputStream inputStream) + { + this.inputStream = inputStream; + } + + + public List ReadRowsWithHeader() + { + List rows = new List(); + if (ReadHeader() != PlainBufferConsts.HEADER) + { + throw new IOException("Invalid header from plain buffer: " + this.inputStream); + } + + ReadTag(); + while (!this.inputStream.IsAtEnd) + { + PlainBufferRow row = ReadRow(); + rows.Add(row); + } + + if (!this.inputStream.IsAtEnd) + { + throw new IOException(""); + } + + return rows; + } + + public uint ReadHeader() + { + return ReadUInt32(); + } + + public uint ReadTag() + { + if (this.inputStream.IsAtEnd) + { + lastTag = 0; + return 0; + } + + lastTag = this.inputStream.ReadRawByte(); + return lastTag; + } + + public uint GetLastTag() + { + return this.lastTag; + } + + + public PlainBufferRow ReadRow() + { + List columns = new List(); + List primaryKey = new List(); + bool hasDeleteMarker = false; + + if (CheckLastTagWas(PlainBufferConsts.TAG_ROW_PK)) + { + primaryKey = ReadRowPK(); + if (primaryKey.Count <= 0) + { + throw new IOException("The primary key of row is empty."); + } + } + + if (CheckLastTagWas(PlainBufferConsts.TAG_ROW_DATA)) + { + columns = ReadRowData(); + } + + if (CheckLastTagWas(PlainBufferConsts.TAG_DELETE_ROW_MARKER)) + { + hasDeleteMarker = true; + ReadTag(); + } + + PlainBufferRow row = new PlainBufferRow(primaryKey, columns, hasDeleteMarker); + + row.SetExtension(ReadExtension()); + + if (CheckLastTagWas(PlainBufferConsts.TAG_ROW_CHECKSUM)) + { + byte checksum = this.inputStream.ReadRawByte(); + ReadTag(); + if (row.GetChecksum() != checksum) + { + throw new IOException("Checksum is mismatch.Row: " + row + ". Checksum: " + checksum + ". PlainBuffer: " + this.inputStream); + } + } + else + { + throw new IOException("Expect TAG_ROW_CHECKSUM but it was " + PlainBufferConsts.PrintTag(GetLastTag())); + } + + return row; + } + + public bool CheckLastTagWas(uint tag) + { + return this.lastTag == tag; + } + + public List ReadRowPK() + { + if (!CheckLastTagWas(PlainBufferConsts.TAG_ROW_PK)) + { + throw new IOException("Expect TAG_ROW_PK but it was " + PlainBufferConsts.PrintTag(GetLastTag())); + } + + List primaryKeyColumns = new List(); + ReadTag(); + while (CheckLastTagWas(PlainBufferConsts.TAG_CELL)) + { + PlainBufferCell cell = ReadCell(); + primaryKeyColumns.Add(cell); + } + + return primaryKeyColumns; + } + + public PlainBufferCell ReadCell() + { + if (!CheckLastTagWas(PlainBufferConsts.TAG_CELL)) + { + throw new IOException("Expect TAG_CELL but it was " + PlainBufferConsts.PrintTag(GetLastTag())); + } + + PlainBufferCell cell = new PlainBufferCell(); + + ReadTag(); + if (GetLastTag() == PlainBufferConsts.TAG_CELL_NAME) + { + cell.SetCellName(ReadUTFString(ReadUInt32())); + ReadTag(); + } + + if (GetLastTag() == PlainBufferConsts.TAG_CELL_VALUE) + { + cell.SetCellValue(ReadCellValue()); + } + + if (GetLastTag() == PlainBufferConsts.TAG_CELL_TYPE) + { + cell.SetCellType(this.inputStream.ReadRawByte()); + ReadTag(); + } + + if (GetLastTag() == PlainBufferConsts.TAG_CELL_TIMESTAMP) + { + long timestamp = (long)ReadInt64(); + if (timestamp < 0) + { + throw new IOException("The timestamp is negative."); + } + + cell.SetCellTimestamp(timestamp); + ReadTag(); // consume next tag as all read function should consume next tag + } + + if (GetLastTag() == PlainBufferConsts.TAG_CELL_CHECKSUM) + { + byte checksum = this.inputStream.ReadRawByte(); + ReadTag(); + if (cell.GetChecksum() != checksum) + { + throw new IOException("Checksum is mismatch. Cell: " + cell + ". Checksum: " + checksum + ". PlainBuffer: " + this.inputStream); + } + } + else + { + throw new IOException("Expect TAG_CELL_CHECKSUM but it was " + PlainBufferConsts.PrintTag(GetLastTag())); + } + + return cell; + } + + public List ReadRowData() + { + if (!CheckLastTagWas(PlainBufferConsts.TAG_ROW_DATA)) + { + throw new IOException("Expect TAG_ROW_DATA but it was " + PlainBufferConsts.PrintTag(GetLastTag())); + } + + List columns = new List(); + ReadTag(); + while (CheckLastTagWas(PlainBufferConsts.TAG_CELL)) + { + columns.Add(ReadCell()); + } + + return columns; + } + + public PlainBufferExtension ReadExtension() + { + PlainBufferExtension extension = new PlainBufferExtension(); + if (CheckLastTagWas(PlainBufferConsts.TAG_EXTENSION)) + { + ReadUInt32(); // length + ReadTag(); + while (PlainBufferConsts.IsTagInExtension(GetLastTag())) + { + if (CheckLastTagWas(PlainBufferConsts.TAG_SEQ_INFO)) + { + extension.setSequenceInfo(ReadSequenceInfo()); + } + else + { + int length = (int)this.inputStream.ReadRawLittleEndian32(); + SkipRawSize(length); + ReadTag(); + } + } + } + + return extension; + } + + public PlainBufferSequenceInfo ReadSequenceInfo() + { + if (!CheckLastTagWas(PlainBufferConsts.TAG_SEQ_INFO)) + { + throw new IOException("Expect TAG_SEQ_INFO but it was " + PlainBufferConsts.PrintTag(GetLastTag())); + } + + this.inputStream.ReadRawLittleEndian32();// length + ReadTag(); + PlainBufferSequenceInfo seq = new PlainBufferSequenceInfo(); + + if (CheckLastTagWas(PlainBufferConsts.TAG_SEQ_INFO_EPOCH)) + { + seq.SetEpoch(ReadUInt32()); + ReadTag(); + } + else + { + throw new IOException("Expect TAG_SEQ_INFO_EPOCH but it was " + PlainBufferConsts.PrintTag(GetLastTag())); + } + + if (CheckLastTagWas(PlainBufferConsts.TAG_SEQ_INFO_TS)) + { + seq.SetTimestamp((long)ReadInt64()); + ReadTag(); + } + else + { + throw new IOException("Expect TAG_SEQ_INFO_TS but it was " + PlainBufferConsts.PrintTag(GetLastTag())); + } + + if (CheckLastTagWas(PlainBufferConsts.TAG_SEQ_INFO_ROW_INDEX)) + { + seq.SetRowIndex(ReadUInt32()); + ReadTag(); + } + else + { + throw new IOException("Expect TAG_SEQ_INFO_ROW_INDEX but it was " + PlainBufferConsts.PrintTag(GetLastTag())); + } + + return seq; + } + + public uint ReadUInt32() + { + return this.inputStream.ReadRawLittleEndian32(); + } + + public ulong ReadInt64() + { + return this.inputStream.ReadRawLittleEndian64(); + } + + public byte[] ReadBytes(uint size) + { + return this.inputStream.ReadRawBytes((int)size); + } + + + public string ReadUTFString(uint size) + { + return System.Text.Encoding.UTF8.GetString(ReadBytes(size)); + } + + public bool ReadBoolean() + { + bool result = false; + this.inputStream.ReadBool(ref result); + return result; + } + + public double ReadDouble() + { + double result = 0; + this.inputStream.ReadDouble(ref result); + return result; + } + + public void SkipRawSize(int length) + { + this.inputStream.SkipRawBytes(length); + } + + + public ColumnValue ReadCellValue() + { + if (!CheckLastTagWas(PlainBufferConsts.TAG_CELL_VALUE)) + { + throw new IOException("Expect TAG_CELL_VALUE but it was " + PlainBufferConsts.PrintTag(GetLastTag())); + } + uint length = this.inputStream.ReadRawLittleEndian32(); + byte type = this.inputStream.ReadRawByte(); + ColumnValue columnValue = null; + switch (type) + { + case PlainBufferConsts.VT_INTEGER: + columnValue = new ColumnValue(ReadInt64()); + break; + case PlainBufferConsts.VT_BLOB: + columnValue = new ColumnValue(ReadBytes(ReadUInt32())); + break; + case PlainBufferConsts.VT_STRING: + columnValue = new ColumnValue(ReadUTFString(ReadUInt32())); + break; + case PlainBufferConsts.VT_BOOLEAN: + columnValue = new ColumnValue(ReadBoolean()); + break; + case PlainBufferConsts.VT_DOUBLE: + columnValue = new ColumnValue(ReadDouble()); + break; + default: + throw new IOException("Unsupported column type: " + type); + } + + ReadTag(); + return columnValue; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferCodedOutputStream.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferCodedOutputStream.cs new file mode 100644 index 0000000..541bc6f --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferCodedOutputStream.cs @@ -0,0 +1,287 @@ +using System.IO; +using Aliyun.OTS.DataModel; + +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public class PlainBufferCodedOutputStream + { + private readonly PlainBufferOutputStream output; + + public PlainBufferCodedOutputStream(PlainBufferOutputStream output) + { + this.output = output; + } + + public void WriteHeader() + { + output.WriteRawLittleEndian32(PlainBufferConsts.HEADER); + } + + public void WriteTag(byte tag) + { + output.WriteRawByte(tag); + } + + public void WriteCellName(byte[] name) + { + WriteTag(PlainBufferConsts.TAG_CELL_NAME); + output.WriteRawLittleEndian32(name.Length); + output.WriteBytes(name); + } + + public void WritePrimaryKeyValue(ColumnValue value) + { + if (value.CanBePrimaryKeyValue()) + { + WriteCellValue(value); + } + else + { + throw new IOException("Bug: unsupported primary key type: " + value.GetType()); + } + } + + public void WriteCellValue(ColumnValue value) + { + WriteTag(PlainBufferConsts.TAG_CELL_VALUE); + if (value.IsInfMin()) + { + output.WriteRawLittleEndian32(1); + output.WriteRawByte(PlainBufferConsts.VT_INF_MIN); + return; + } + + if (value.IsInfMax()) + { + output.WriteRawLittleEndian32(1); + output.WriteRawByte(PlainBufferConsts.VT_INF_MAX); + return; + } + + if (value.IsPlaceHolderForAutoIncr()) + { + output.WriteRawLittleEndian32(1); + output.WriteRawByte(PlainBufferConsts.VT_AUTO_INCREMENT); + return; + } + + byte[] rawData; + int prefixLength; + + switch (value.Type) + { + case ColumnValueType.String: + rawData = value.AsStringInBytes(); + prefixLength = PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE + 1; // length + type + length + output.WriteRawLittleEndian32(prefixLength + rawData.Length); // length + type + value + output.WriteRawByte(PlainBufferConsts.VT_STRING); + output.WriteRawLittleEndian32(rawData.Length); + output.WriteBytes(rawData); + break; + case ColumnValueType.Integer: + output.WriteRawLittleEndian32(1 + PlainBufferOutputStream.LITTLE_ENDIAN_64_SIZE); + output.WriteRawByte(PlainBufferConsts.VT_INTEGER); + output.WriteRawLittleEndian64(value.IntegerValue); + break; + case ColumnValueType.Binary: + rawData = value.BinaryValue; + prefixLength = PlainBufferOutputStream.LITTLE_ENDIAN_32_SIZE + 1; // length + type + length + output.WriteRawLittleEndian32(prefixLength + rawData.Length); // length + type + value + output.WriteRawByte(PlainBufferConsts.VT_BLOB); + output.WriteRawLittleEndian32(rawData.Length); + output.WriteBytes(rawData); + break; + case ColumnValueType.Boolean: + output.WriteRawLittleEndian32(2); + output.WriteRawByte(PlainBufferConsts.VT_BOOLEAN); + output.WriteBool(value.BooleanValue); + break; + case ColumnValueType.Double: + output.WriteRawLittleEndian32(1 + PlainBufferOutputStream.LITTLE_ENDIAN_64_SIZE); + output.WriteRawByte(PlainBufferConsts.VT_DOUBLE); + output.WriteDouble(value.DoubleValue); + break; + default: + throw new IOException("Bug: unsupported column type: " + value.Type); + } + } + + public void WriteCell(PlainBufferCell cell) + { + WriteTag(PlainBufferConsts.TAG_CELL); + + if (cell.HasCellName()) + { + WriteCellName(cell.GetNameRawData()); + } + + if (cell.HasCellValue()) + { + var columnValue = cell.IsPk() ? cell.GetPkCellValue() : cell.GetCellValue(); + WriteCellValue(columnValue); + } + + if (cell.HasCellType()) + { + WriteTag(PlainBufferConsts.TAG_CELL_TYPE); + output.WriteRawByte(cell.GetCellType()); + } + + if (cell.HasCellTimestamp()) + { + WriteTag(PlainBufferConsts.TAG_CELL_TIMESTAMP); + output.WriteRawLittleEndian64(cell.GetCellTimestamp()); + } + + WriteTag(PlainBufferConsts.TAG_CELL_CHECKSUM); + output.WriteRawByte(cell.GetChecksum()); + } + + public void WriteExtension(PlainBufferExtension extension) + { + WriteTag(PlainBufferConsts.TAG_EXTENSION); + output.WriteRawLittleEndian32(PlainBufferBuilder.ComputeSkipLengthForExtensionTag(extension)); + int extensionCount = 0; + if (extension.HasSeq()) + { + WriteSequenceInfo(extension.GetSequenceInfo()); + extensionCount++; + } + + if (extensionCount == 0) + { + throw new IOException("no extension tag is Writen."); + } + } + + public void WriteSequenceInfo(PlainBufferSequenceInfo sequenceInfo) + { + WriteTag(PlainBufferConsts.TAG_SEQ_INFO); + output.WriteRawLittleEndian32(PlainBufferBuilder.ComputeSkipLengthForSequenceInfo()); + WriteTag(PlainBufferConsts.TAG_SEQ_INFO_EPOCH); + output.WriteRawLittleEndian32((int)sequenceInfo.GetEpoch()); + WriteTag(PlainBufferConsts.TAG_SEQ_INFO_TS); + output.WriteRawLittleEndian64(sequenceInfo.GetTimestamp()); + WriteTag(PlainBufferConsts.TAG_SEQ_INFO_ROW_INDEX); + output.WriteRawLittleEndian32((int)sequenceInfo.GetRowIndex()); + } + + public void WriteRow(PlainBufferRow row) + { + WriteTag(PlainBufferConsts.TAG_ROW_PK); + foreach (PlainBufferCell cell in row.GetPrimaryKey()) + { + WriteCell(cell); + } + + if (row.GetCells().Count > 0) + { + WriteTag(PlainBufferConsts.TAG_ROW_DATA); + foreach (PlainBufferCell cell in row.GetCells()) + { + WriteCell(cell); + } + } + if (row.HasDeleteMarker()) + { + WriteTag(PlainBufferConsts.TAG_DELETE_ROW_MARKER); + } + + if (row.HasExtension()) + { + WriteExtension(row.GetExtension()); + } + + WriteTag(PlainBufferConsts.TAG_ROW_CHECKSUM); + output.WriteRawByte(row.GetChecksum()); + } + + public void WriteRowWithHeader(PlainBufferRow row) + { + WriteHeader(); + WriteRow(row); + } + + public void WritePrimaryKeyValueWithoutLengthPrefix(ColumnValue value) + { + if (value.IsInfMin()) + { + output.WriteRawByte(PlainBufferConsts.VT_INF_MIN); + return; + } + + if (value.IsInfMax()) + { + output.WriteRawByte(PlainBufferConsts.VT_INF_MAX); + return; + } + + if (value.IsPlaceHolderForAutoIncr()) + { + output.WriteRawByte(PlainBufferConsts.VT_AUTO_INCREMENT); + return; + } + + byte[] rawData; + + switch (value.Type) + { + case ColumnValueType.String: + rawData = value.AsStringInBytes(); + output.WriteRawByte(PlainBufferConsts.VT_STRING); + output.WriteRawLittleEndian32(rawData.Length); + output.WriteBytes(rawData); + break; + case ColumnValueType.Integer: + output.WriteRawByte(PlainBufferConsts.VT_INTEGER); + output.WriteRawLittleEndian64(value.IntegerValue); + break; + case ColumnValueType.Binary: + rawData = value.BinaryValue; + output.WriteRawByte(PlainBufferConsts.VT_BLOB); + output.WriteRawLittleEndian32(rawData.Length); + output.WriteBytes(rawData); + break; + + default: + throw new IOException("Bug: unsupported primary key type: " + value.Type); + } + } + + + public void WriteColumnValueWithoutLengthPrefix(ColumnValue value) + { + byte[] rawData; + switch (value.Type) + { + case ColumnValueType.String: + rawData = value.AsStringInBytes(); + output.WriteRawByte(PlainBufferConsts.VT_STRING); + output.WriteRawLittleEndian32(rawData.Length); + output.WriteBytes(rawData); + break; + case ColumnValueType.Integer: + output.WriteRawByte(PlainBufferConsts.VT_INTEGER); + output.WriteRawLittleEndian64(value.IntegerValue); + break; + case ColumnValueType.Binary: + rawData = value.BinaryValue; + output.WriteRawByte(PlainBufferConsts.VT_BLOB); + output.WriteRawLittleEndian32(rawData.Length); + output.WriteBytes(rawData); + break; + + case ColumnValueType.Double: + output.WriteRawByte(PlainBufferConsts.VT_DOUBLE); + output.WriteDouble(value.DoubleValue); + break; + case ColumnValueType.Boolean: + output.WriteRawByte(PlainBufferConsts.VT_BOOLEAN); + output.WriteBool(value.BooleanValue); + break; + default: + throw new IOException("Bug: unsupported column type: " + value.Type); + } + } + } +} \ No newline at end of file diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferConsts.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferConsts.cs new file mode 100644 index 0000000..1e54b52 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferConsts.cs @@ -0,0 +1,109 @@ + namespace com.alicloud.openservices.tablestore.core.protocol +{ + public static class PlainBufferConsts + { + public const int HEADER = 0x75; + + // tag type + public const byte TAG_ROW_PK = 0x1; + public const byte TAG_ROW_DATA = 0x2; + public const byte TAG_CELL = 0x3; + public const byte TAG_CELL_NAME = 0x4; + public const byte TAG_CELL_VALUE = 0x5; + public const byte TAG_CELL_TYPE = 0x6; + public const byte TAG_CELL_TIMESTAMP = 0x7; + public const byte TAG_DELETE_ROW_MARKER = 0x8; + public const byte TAG_ROW_CHECKSUM = 0x9; + public const byte TAG_CELL_CHECKSUM = 0x0A; + public const byte TAG_EXTENSION = 0x0B; + public const byte TAG_SEQ_INFO = 0x0C; + public const byte TAG_SEQ_INFO_EPOCH = 0x0D; + public const byte TAG_SEQ_INFO_TS = 0x0E; + public const byte TAG_SEQ_INFO_ROW_INDEX = 0x0F; + + // cell op type + public const byte DELETE_ALL_VERSION = 0x1; + public const byte DELETE_ONE_VERSION = 0x3; + public const byte INCREMENT = 0x4; + + // variant type + public const byte VT_INTEGER = 0x0; + public const byte VT_DOUBLE = 0x1; + public const byte VT_BOOLEAN = 0x2; + public const byte VT_STRING = 0x3; + //public const byte VT_NULL = 0x6; + public const byte VT_BLOB = 0x7; + public const byte VT_INF_MIN = 0x9; + public const byte VT_INF_MAX = 0xa; + public const byte VT_AUTO_INCREMENT = 0xb; + + public static string PrintTag(uint tag) + { + switch (tag) + { + case TAG_ROW_PK: + return "TAG_ROW_PK"; + case TAG_ROW_DATA: + return "TAG_ROW_DATA"; + case TAG_CELL: + return "TAG_CELL"; + case TAG_CELL_NAME: + return "TAG_CELL_NAME"; + case TAG_CELL_VALUE: + return "TAG_CELL_VALUE"; + case TAG_CELL_TYPE: + return "TAG_CELL_TYPE"; + case TAG_CELL_TIMESTAMP: + return "TAG_CELL_TIMESTAMP"; + case TAG_DELETE_ROW_MARKER: + return "TAG_DELETE_ROW_MARKER"; + case TAG_ROW_CHECKSUM: + return "TAG_ROW_CHECKSUM"; + case TAG_CELL_CHECKSUM: + return "TAG_CELL_CHECKSUM"; + case TAG_SEQ_INFO: + return "TAG_SEQ_INFO"; + case TAG_SEQ_INFO_EPOCH: + return "TAG_SEQ_INFO_EPOCH"; + case TAG_SEQ_INFO_TS: + return "TAG_SEQ_INFO_TS"; + case TAG_SEQ_INFO_ROW_INDEX: + return "TAG_SEQ_INFO_ROW_INDEX"; + case TAG_EXTENSION: + return "TAG_EXTENSION"; + default: + return "UNKNOWN_TAG(" + tag + ")"; + } + } + + public static bool IsUnknownTag(uint tag) + { + switch (tag) + { + case TAG_ROW_PK: + case TAG_ROW_DATA: + case TAG_CELL: + case TAG_CELL_NAME: + case TAG_CELL_VALUE: + case TAG_CELL_TYPE: + case TAG_CELL_TIMESTAMP: + case TAG_DELETE_ROW_MARKER: + case TAG_ROW_CHECKSUM: + case TAG_CELL_CHECKSUM: + case TAG_SEQ_INFO: + case TAG_SEQ_INFO_EPOCH: + case TAG_SEQ_INFO_TS: + case TAG_SEQ_INFO_ROW_INDEX: + case TAG_EXTENSION: + return false; + default: + return true; + } + } + + public static bool IsTagInExtension(uint tag) + { + return tag == TAG_SEQ_INFO || IsUnknownTag(tag); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferConversion.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferConversion.cs new file mode 100644 index 0000000..17b65c9 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferConversion.cs @@ -0,0 +1,95 @@ +using System.Collections.Generic; +using System.IO; +using Aliyun.OTS.DataModel; +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public static class PlainBufferConversion + { + public static IRow ToRow(PlainBufferRow plainBufferRow) + { + if (plainBufferRow.HasDeleteMarker()) + { + throw new IOException("Row could not has delete marker: " + plainBufferRow); + } + + if (plainBufferRow.GetPrimaryKey() == null) + { + throw new IOException("Row has no primary key: " + plainBufferRow); + } + + List columns = new List(plainBufferRow.GetCells().Count); + + foreach (PlainBufferCell cell in plainBufferRow.GetCells()) + { + columns.Add(ToColumn(cell)); + } + + return new Row(ToPrimaryKey(plainBufferRow.GetPrimaryKey()), columns); + } + + public static Column ToColumn(PlainBufferCell cell) + { + if (!cell.HasCellName() || !cell.HasCellValue()) + { + throw new IOException("The cell has no name or value: " + cell); + } + + if (cell.HasCellType() && cell.GetCellType() != PlainBufferConsts.INCREMENT) + { + throw new IOException("The cell should not has type: " + cell); + } + + if (cell.HasCellTimestamp()) + { + return new Column(cell.GetCellName(), cell.GetCellValue(), cell.GetCellTimestamp()); + } + else + { + return new Column(cell.GetCellName(), cell.GetCellValue()); + } + } + + public static PrimaryKey ToPrimaryKey(List pkCells) + { + var primaryKey = new PrimaryKey(); + foreach (PlainBufferCell cell in pkCells) + { + primaryKey.Add(cell.GetCellName(), cell.GetCellValue()); + } + + return primaryKey; + } + + public static PlainBufferCell ToPlainBufferCell(PrimaryKeyColumn primaryKeyColumn) + { + PlainBufferCell cell = new PlainBufferCell(); + cell.SetCellName(primaryKeyColumn.Name); + cell.SetPkCellValue(primaryKeyColumn.Value); + return cell; + } + + public static PlainBufferCell ToPlainBufferCell(Column column, bool ignoreValue, bool ignoreTs, + bool setType, byte type) + { + PlainBufferCell cell = new PlainBufferCell(); + cell.SetCellName(column.Name); + if (!ignoreValue) + { + cell.SetCellValue(column.Value); + } + if (!ignoreTs) + { + if (column.Timestamp.HasValue) + { + cell.SetCellTimestamp(column.Timestamp.Value); + } + } + if (setType) + { + cell.SetCellType(type); + } + + return cell; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferCrc8.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferCrc8.cs new file mode 100644 index 0000000..e5f8013 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferCrc8.cs @@ -0,0 +1,113 @@ +using System; +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public static class PlainBufferCrc8 + { + private const int spaceSize = 256; + private static byte[] crc8Table = new byte[spaceSize]; + + static PlainBufferCrc8() + { + for (int i = 0; i < crc8Table.Length; ++i) + { + byte x = (byte)i; + for (int j = 8; j > 0; --j) + { + x = (byte)((x << 1) ^ (((x & 0x80) != 0) ? 0x07 : 0)); + } + crc8Table[i] = x; + } + } + + public static byte crc8(byte crc, byte data) + { + crc = crc8Table[(crc ^ data) & 0xff]; + return crc; + } + + public static byte crc8(byte crc, int data) + { + for (int i = 0; i < 4; i++) + { + crc = crc8(crc, (byte)(data & 0xff)); + data >>= 8; + } + + return crc; + } + + public static byte crc8(byte crc, long data) + { + for (int i = 0; i < 8; i++) + { + crc = crc8(crc, (byte)(data & 0xff)); + data >>= 8; + } + return crc; + } + + public static byte crc8(byte crc, byte[] data) + { + for (int i = 0; i < data.Length; i++) + { + crc = crc8(crc, data[i]); + } + return crc; + } + + public static byte GetChecksum(byte crc, PlainBufferCell cell) + { + + if (cell.HasCellName()) + { + crc = crc8(crc, cell.GetNameRawData()); + } + + if (cell.HasCellValue()) + { + if (cell.IsPk()) + { + crc = cell.GetPkCellValue().GetChecksum(crc); + } + else + { + crc = cell.GetCellValue().GetChecksum(crc); + } + } + + if (cell.HasCellTimestamp()) + { + crc = crc8(crc, cell.GetCellTimestamp()); + } + + if (cell.HasCellType()) + { + crc = crc8(crc, cell.GetCellType()); + } + + return crc; + } + + public static byte GetChecksum(byte crc, PlainBufferRow row) + { + foreach (PlainBufferCell cell in row.GetPrimaryKey()) + { + crc = crc8(crc, cell.GetChecksum()); + } + + foreach (PlainBufferCell cell in row.GetCells()) + { + crc = crc8(crc, cell.GetChecksum()); + } + + byte del = 0; + if (row.HasDeleteMarker()) + { + del = (byte)0x1; + } + crc = crc8(crc, del); + + return crc; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferExtension.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferExtension.cs new file mode 100644 index 0000000..a7ffc74 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferExtension.cs @@ -0,0 +1,40 @@ +using System; +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public class PlainBufferExtension + { + private PlainBufferSequenceInfo sequenceInfo; + + + public PlainBufferExtension() + { + this.sequenceInfo = new PlainBufferSequenceInfo(); + } + public void setSequenceInfo(PlainBufferSequenceInfo sequenceInfo) + { + this.sequenceInfo = sequenceInfo; + } + + public PlainBufferSequenceInfo GetSequenceInfo() + { + return sequenceInfo; + } + + public bool HasSeq() + { + return sequenceInfo.GetHasSeq(); + } + + public override String ToString() + { + + String str = ""; + if (HasSeq()) + { + str += " SequenceInfo: {" + GetSequenceInfo() + "}"; + } + + return str; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferInputStream.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferInputStream.cs new file mode 100644 index 0000000..6749d88 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferInputStream.cs @@ -0,0 +1,138 @@ +using System; +using System.IO; +using Aliyun.OTS.Util; + +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public class PlainBufferInputStream + { + private readonly MemoryStream buffer; + private int lastTag; + + public PlainBufferInputStream(MemoryStream buffer) + { + this.buffer = buffer; + this.lastTag = 0; + } + + public PlainBufferInputStream(byte[] byteBuffer) + { + var ms = new MemoryStream(); + ms.SetLength(byteBuffer.Length); + ms.Write(byteBuffer, 0, byteBuffer.Length); + this.buffer = ms; + this.lastTag = 0; + } + + public bool IsAtEnd() + { + return buffer.Position == buffer.Length; + } + + public int ReadTag() + { + if (IsAtEnd()) + { + lastTag = 0; + return 0; + } + + lastTag = ReadRawByte(); + return lastTag; + } + + public bool CheckLastTagWas(int tag) + { + return lastTag == tag; + } + + public int GetLastTag() + { + return lastTag; + } + + public byte ReadRawByte() + { + if (IsAtEnd()) + { + throw new IOException("Read raw byte encountered EOF."); + } + + return (byte)buffer.ReadByte(); + } + + public long ReadRawLittleEndian64() + { + byte b1 = ReadRawByte(); + byte b2 = ReadRawByte(); + byte b3 = ReadRawByte(); + byte b4 = ReadRawByte(); + byte b5 = ReadRawByte(); + byte b6 = ReadRawByte(); + byte b7 = ReadRawByte(); + byte b8 = ReadRawByte(); + return (((long)b1 & 0xff)) | + (((long)b2 & 0xff) << 8) | + (((long)b3 & 0xff) << 16) | + (((long)b4 & 0xff) << 24) | + (((long)b5 & 0xff) << 32) | + (((long)b6 & 0xff) << 40) | + (((long)b7 & 0xff) << 48) | + (((long)b8 & 0xff) << 56); + } + + public int ReadRawLittleEndian32() + { + byte b1 = ReadRawByte(); + byte b2 = ReadRawByte(); + byte b3 = ReadRawByte(); + byte b4 = ReadRawByte(); + return (((int)b1 & 0xff)) | + (((int)b2 & 0xff) << 8) | + (((int)b3 & 0xff) << 16) | + (((int)b4 & 0xff) << 24); + } + + public bool ReadBoolean() + { + return ReadRawByte() != 0; + } + + public double ReadDouble() + { + return BitConverter.Int64BitsToDouble(ReadRawLittleEndian64()); + } + + public int ReadUInt32() + { + return ReadRawLittleEndian32(); + } + + public long ReadInt64() + { + return ReadRawLittleEndian64(); + } + + public byte[] ReadBytes(int size) + { + if (buffer.Length - buffer.Position < size) + { + throw new IOException("Read bytes encountered EOF."); + } + + byte[] result = new byte[size]; + buffer.Read(result, 0, size); + return result; + } + + public string ReadUTFString(int size) + { + return OtsUtils.Bytes2UTF8String(ReadBytes(size)); + } + + public override string ToString() + { + return OtsUtils.Bytes2UTF8String(this.buffer.GetBuffer()); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferOutputStream.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferOutputStream.cs new file mode 100644 index 0000000..f4a82c9 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferOutputStream.cs @@ -0,0 +1,110 @@ +using System.Diagnostics.Contracts; +using System.IO; +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public class PlainBufferOutputStream + { + private readonly byte[] buffer; + private readonly int capacity; + private int pos; + + public PlainBufferOutputStream(int capacity) + { + Contract.Requires(capacity > 0); + buffer = new byte[capacity]; + this.capacity = capacity; + } + + public byte[] GetBuffer() + { + return buffer; + } + + public bool IsFull() + { + return pos == capacity; + } + + public int Count() + { + return pos; + } + + public int Remain() + { + return capacity - pos; + } + + public void Clear() + { + this.pos = 0; + } + + public void WriteRawByte(byte value) + { + if (pos == capacity) + { + throw new IOException("The buffer is full."); + } + + buffer[pos++] = value; + } + + public void WriteRawByte(int value) + { + WriteRawByte((byte)value); + } + + /// + /// Write a little-endian 32-bit integer. + /// + /// Value. + public void WriteRawLittleEndian32(int value) + { + WriteRawByte((value) & 0xFF); + WriteRawByte((value >> 8) & 0xFF); + WriteRawByte((value >> 16) & 0xFF); + WriteRawByte((value >> 24) & 0xFF); + } + + /// + /// Write a little-endian 64-bit integer. + /// + /// Value. + public void WriteRawLittleEndian64(long value) + { + WriteRawByte((int)(value) & 0xFF); + WriteRawByte((int)(value >> 8) & 0xFF); + WriteRawByte((int)(value >> 16) & 0xFF); + WriteRawByte((int)(value >> 24) & 0xFF); + WriteRawByte((int)(value >> 32) & 0xFF); + WriteRawByte((int)(value >> 40) & 0xFF); + WriteRawByte((int)(value >> 48) & 0xFF); + WriteRawByte((int)(value >> 56) & 0xFF); + } + + public void WriteDouble(double value) + { + WriteRawLittleEndian64(System.BitConverter.DoubleToInt64Bits(value)); + } + + public void WriteBool(bool value) + { + WriteRawByte(value ? 1 : 0); + } + + public void WriteBytes(byte[] bytes) + { + if (this.pos + bytes.Length > this.capacity) + { + throw new IOException("The buffer is full."); + } + + System.Array.Copy(bytes, 0, this.buffer, this.pos, bytes.Length); + this.pos += bytes.Length; + } + + public const int LITTLE_ENDIAN_32_SIZE = 4; + public const int LITTLE_ENDIAN_64_SIZE = 8; + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferRow.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferRow.cs new file mode 100644 index 0000000..9a38d45 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferRow.cs @@ -0,0 +1,121 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public class PlainBufferRow + { + private List primaryKey; + + private readonly List cells; + + private bool hasDeleteMarker = false; + + private byte checksum; + private bool hasChecksum = false; + private PlainBufferExtension extension; + + public PlainBufferRow(List primaryKey, List cells, bool hasDeleteMarker) + { + this.primaryKey = primaryKey; + this.cells = cells; + this.hasDeleteMarker = hasDeleteMarker; + this.extension = new PlainBufferExtension(); + } + + public List GetPrimaryKey() + { + return primaryKey; + } + + public void SetPrimaryKey(List primaryKey) + { + this.primaryKey = primaryKey; + this.hasChecksum = false; + } + + public List GetCells() + { + return cells; + } + + public void AddCell(PlainBufferCell cell) + { + this.cells.Add(cell); + this.hasChecksum = false; + } + + public bool HasCells() + { + return this.cells.Count > 0; + } + + public bool HasDeleteMarker() + { + return hasDeleteMarker; + } + + public void SetHasDeleteMarker(bool hasDeleteMarker) + { + this.hasDeleteMarker = hasDeleteMarker; + this.hasChecksum = false; + } + + public PlainBufferExtension GetExtension() + { + return extension; + } + + public void SetExtension(PlainBufferExtension extension) + { + this.extension = extension; + } + + public bool HasExtension() + { + return extension.HasSeq(); + } + + /// + /// 会自动计算当前的checksum并返回,当没有数据变化时,checksum会缓存在对象中,以减少不必要的计算。 + /// + /// The checksum. + public byte GetChecksum() + { + if (!this.hasChecksum) + { + GenerateChecksum(); + } + return this.checksum; + } + + private void GenerateChecksum() + { + this.checksum = PlainBufferCrc8.GetChecksum((byte)0x0, this); + this.hasChecksum = true; + } + + + public override string ToString() + { + StringBuilder sb = new StringBuilder(); + sb.Append("PrimaryKey: ").Append(primaryKey); + sb.Append("Cells: "); + foreach (PlainBufferCell cell in cells) + { + sb.Append("[").Append(cell).Append("]"); + } + + sb.Append(" HasDeleteMarker: " + HasDeleteMarker()); + + if (HasExtension()) + { + sb.Append(" Extension: {"); + sb.Append(GetExtension()); + sb.Append("}"); + } + return sb.ToString(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferSequenceInfo.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferSequenceInfo.cs new file mode 100644 index 0000000..c2fdc66 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/PlainBufferSequenceInfo.cs @@ -0,0 +1,53 @@ +using System; +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public class PlainBufferSequenceInfo + { + private uint epoch = 0; + private long timestamp = 0; + private uint rowIndex = 0; + private bool hasSeq = false; + + public uint GetEpoch() + { + return epoch; + } + + public void SetEpoch(uint epoch) + { + this.epoch = epoch; + this.hasSeq = true; + } + public long GetTimestamp() + { + return timestamp; + } + + public void SetTimestamp(long timestamp) + { + this.timestamp = timestamp; + this.hasSeq = true; + } + + public uint GetRowIndex() + { + return rowIndex; + } + + public void SetRowIndex(uint rowIndex) + { + this.rowIndex = rowIndex; + this.hasSeq = true; + } + + public bool GetHasSeq() + { + return hasSeq; + } + + public override String ToString() + { + return "Epoch: " + epoch + ", Timestamp: " + timestamp + ", RowIndex: " + rowIndex; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/ProtocolBufferParser.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/ProtocolBufferParser.cs new file mode 100644 index 0000000..b6b8930 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/ProtocolBufferParser.cs @@ -0,0 +1,11 @@ +using System; +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public class ProtocolBufferParse: IResultParser + { + public object getObject(GetRowRequest response) + { + throw new NotImplementedException(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/SearchQueryBuilder.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/SearchQueryBuilder.cs new file mode 100644 index 0000000..ae920df --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/SearchQueryBuilder.cs @@ -0,0 +1,268 @@ +using System; +using Aliyun.OTS.DataModel.Search.Query; +using Aliyun.OTS.ProtoBuffer; +using Google.ProtocolBuffers; + +namespace com.alicloud.openservices.tablestore.core.protocol +{ + public class SearchQueryBuilder + { + public static QueryType BuildQueryType(Aliyun.OTS.DataModel.Search.Query.QueryType type) + { + switch (type) + { + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_MatchQuery: + return QueryType.MATCH_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_MatchPhraseQuery: + return QueryType.MATCH_PHRASE_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_TermQuery: + return QueryType.TERM_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_TermsQuery: + return QueryType.TERMS_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_RangeQuery: + return QueryType.RANGE_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_PrefixQuery: + return QueryType.PREFIX_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_BoolQuery: + return QueryType.BOOL_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_ConstScoreQuery: + return QueryType.CONST_SCORE_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_FunctionScoreQuery: + return QueryType.FUNCTION_SCORE_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_NestedQuery: + return QueryType.NESTED_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_WildcardQuery: + return QueryType.WILDCARD_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_MatchAllQuery: + return QueryType.MATCH_ALL_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_GeoBoundingBoxQuery: + return QueryType.GEO_BOUNDING_BOX_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_GeoDistanceQuery: + return QueryType.GEO_DISTANCE_QUERY; + case Aliyun.OTS.DataModel.Search.Query.QueryType.QueryType_GeoPolygonQuery: + return QueryType.GEO_POLYGON_QUERY; + default: + throw new ArgumentException("unknown queryType: " + type.ToString()); + } + } + + public static Query BuildQuery(IQuery query) + { + Query.Builder builder = Query.CreateBuilder(); + builder.SetType(BuildQueryType(query.GetQueryType())); + builder.SetQuery_(query.Serialize()); + return builder.Build(); + } + + public static MatchAllQuery BuildMatchAllQuery() + { + MatchAllQuery.Builder builder = MatchAllQuery.CreateBuilder(); + return builder.Build(); + } + + public static MatchQuery BuildMatchQuery(Aliyun.OTS.DataModel.Search.Query.MatchQuery query) + { + MatchQuery.Builder builder = MatchQuery.CreateBuilder(); + + builder.SetFieldName(query.FieldName); + builder.SetText(query.Text); + if (query.MinimumShouldMatch != null) + { + builder.SetMinimumShouldMatch(query.MinimumShouldMatch.Value); + } + switch (query.Operator) + { + case Aliyun.OTS.DataModel.Search.Query.QueryOperator.AND: + builder.SetOperator(QueryOperator.AND); + break; + case Aliyun.OTS.DataModel.Search.Query.QueryOperator.OR: + builder.SetOperator(QueryOperator.OR); + break; + default: + throw new ArgumentException("unsupported operator:" + query.Operator); + + } + + return builder.Build(); + } + + public static MatchPhraseQuery BuildMatchPhraseQuery(Aliyun.OTS.DataModel.Search.Query.MatchPhraseQuery query) + { + MatchPhraseQuery.Builder builder = MatchPhraseQuery.CreateBuilder(); + builder.SetFieldName(query.FieldName); + builder.SetText(query.Text); + return builder.Build(); + } + + public static TermQuery BuildTermQuery(Aliyun.OTS.DataModel.Search.Query.TermQuery query) + { + TermQuery.Builder builder = TermQuery.CreateBuilder(); + builder.SetFieldName(query.FieldName); + builder.SetTerm(ByteString.CopyFrom(SearchVariantType.toVariant(query.Term))); + return builder.Build(); + } + + public static TermsQuery BuildTermsQuery(Aliyun.OTS.DataModel.Search.Query.TermsQuery query) + { + TermsQuery.Builder builder = TermsQuery.CreateBuilder(); + builder.SetFieldName(query.FieldName); + if (query.Terms == null) + { + throw new ArgumentException("terms is null"); + } + foreach (var item in query.Terms) + { + builder.AddTerms(ByteString.CopyFrom(SearchVariantType.toVariant(item))); + } + return builder.Build(); + } + + public static RangeQuery BuildRangeQuery(Aliyun.OTS.DataModel.Search.Query.RangeQuery query) + { + RangeQuery.Builder builder = RangeQuery.CreateBuilder(); + builder.SetFieldName(query.FieldName); + if (query.From != null) + { + builder.SetRangeFrom(ByteString.CopyFrom(SearchVariantType.toVariant(query.From))); + builder.SetIncludeLower(query.IncludeLower); + } + if (query.To != null) + { + builder.SetRangeTo(ByteString.CopyFrom(SearchVariantType.toVariant(query.To))); + builder.SetIncludeUpper(query.IncludeUpper); + } + return builder.Build(); + } + + public static PrefixQuery BuildPrefixQuery(Aliyun.OTS.DataModel.Search.Query.PrefixQuery query) + { + PrefixQuery.Builder builder = PrefixQuery.CreateBuilder(); + builder.SetFieldName(query.FieldName); + builder.SetPrefix(query.Prefix); + return builder.Build(); + } + + public static WildcardQuery BuildWildcardQuery(Aliyun.OTS.DataModel.Search.Query.WildcardQuery query) + { + WildcardQuery.Builder builder = WildcardQuery.CreateBuilder(); + builder.SetFieldName(query.FieldName); + builder.SetValue(query.Value); + return builder.Build(); + } + + public static BoolQuery BuildBoolQuery(Aliyun.OTS.DataModel.Search.Query.BoolQuery query) + { + BoolQuery.Builder builder = BoolQuery.CreateBuilder(); + if (query.MinimumShouldMatch != null) + { + builder.SetMinimumShouldMatch(query.MinimumShouldMatch.Value); + } + if (query.MustQueries != null) + { + foreach (var q in query.MustQueries) + { + builder.AddMustQueries(BuildQuery(q)); + } + } + if (query.MustNotQueries != null) + { + foreach (var q in query.MustNotQueries) + { + builder.AddMustNotQueries(BuildQuery(q)); + } + } + if (query.ShouldQueries != null) + { + foreach (var q in query.ShouldQueries) + { + builder.AddShouldQueries(BuildQuery(q)); + } + } + if (query.FilterQueries != null) + { + foreach (var q in query.FilterQueries) + { + builder.AddFilterQueries(BuildQuery(q)); + } + } + return builder.Build(); + } + + public static ConstScoreQuery BuildConstScoreQuery(Aliyun.OTS.DataModel.Search.Query.ConstScoreQuery query) + { + + ConstScoreQuery.Builder builder = ConstScoreQuery.CreateBuilder(); + builder.SetFilter(SearchQueryBuilder.BuildQuery(query.Filter)); + return builder.Build(); + } + + public static FieldValueFactor BuildFieldValueFactor(Aliyun.OTS.DataModel.Search.Query.FieldValueFactor fieldValueFactor) + { + FieldValueFactor.Builder builder = FieldValueFactor.CreateBuilder(); + builder.SetFieldName(fieldValueFactor.FieldName); + return builder.Build(); + } + + public static FunctionScoreQuery BuildFunctionScoreQuery(Aliyun.OTS.DataModel.Search.Query.FunctionScoreQuery query) + { + FunctionScoreQuery.Builder builder = FunctionScoreQuery.CreateBuilder(); + builder.SetQuery(SearchQueryBuilder.BuildQuery(query.Query)); + builder.SetFieldValueFactor(BuildFieldValueFactor(query.FieldValueFactor)); + return builder.Build(); + } + + public static ScoreMode BuildScoreMode(Aliyun.OTS.DataModel.Search.Query.ScoreMode scoreMode) + { + switch (scoreMode) + { + case Aliyun.OTS.DataModel.Search.Query.ScoreMode.Max: + return ScoreMode.SCORE_MODE_MAX; + case Aliyun.OTS.DataModel.Search.Query.ScoreMode.Min: + return ScoreMode.SCORE_MODE_MIN; + case Aliyun.OTS.DataModel.Search.Query.ScoreMode.Avg: + return ScoreMode.SCORE_MODE_AVG; + case Aliyun.OTS.DataModel.Search.Query.ScoreMode.Total: + return ScoreMode.SCORE_MODE_TOTAL; + case Aliyun.OTS.DataModel.Search.Query.ScoreMode.None: + return ScoreMode.SCORE_MODE_NONE; + default: + throw new ArgumentException("unknown scoreMode: " + scoreMode.ToString()); + } + } + + public static NestedQuery BuildNestedQuery(Aliyun.OTS.DataModel.Search.Query.NestedQuery query) + { + NestedQuery.Builder builder = NestedQuery.CreateBuilder(); + builder.SetQuery(SearchQueryBuilder.BuildQuery(query.Query)); + builder.SetPath(query.Path); + builder.SetScoreMode(BuildScoreMode(query.ScoreMode)); + return builder.Build(); + } + + public static GeoBoundingBoxQuery BuildGeoBoundingBoxQuery(Aliyun.OTS.DataModel.Search.Query.GeoBoundingBoxQuery query) + { + GeoBoundingBoxQuery.Builder builder = GeoBoundingBoxQuery.CreateBuilder(); + builder.SetFieldName(query.FieldName); + builder.SetTopLeft(query.TopLeft); + builder.SetBottomRight(query.BottomRight); + return builder.Build(); + } + + public static GeoDistanceQuery BuildGeoDistanceQuery(Aliyun.OTS.DataModel.Search.Query.GeoDistanceQuery query) + { + GeoDistanceQuery.Builder builder = GeoDistanceQuery.CreateBuilder(); + builder.SetFieldName(query.FieldName); + builder.SetCenterPoint(query.CenterPoint); + builder.SetDistance(query.DistanceInMeter); + return builder.Build(); + } + + public static GeoPolygonQuery BuildGeoPolygonQuery(Aliyun.OTS.DataModel.Search.Query.GeoPolygonQuery query) + { + GeoPolygonQuery.Builder builder = GeoPolygonQuery.CreateBuilder(); + builder.SetFieldName(query.FieldName); + builder.AddRangePoints(query.Points); + return builder.Build(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/SearchSortBuilder.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/SearchSortBuilder.cs new file mode 100644 index 0000000..f9d5575 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/SearchSortBuilder.cs @@ -0,0 +1,149 @@ +using System; +using com.alicloud.openservices.tablestore.core.protocol; + +namespace Aliyun.OTS.ProtoBuffer +{ + public class SearchSortBuilder + { + + public static SortOrder BuildSortOrder(DataModel.Search.Sort.SortOrder sortOrder) + { + switch (sortOrder) + { + case DataModel.Search.Sort.SortOrder.ASC: + return SortOrder.SORT_ORDER_ASC; + case DataModel.Search.Sort.SortOrder.DESC: + return SortOrder.SORT_ORDER_DESC; + default: + throw new ArgumentException("unknown sortOrder: " + sortOrder.ToString()); + } + } + + public static SortMode BuildSortMode(DataModel.Search.Sort.SortMode sortMode) + { + switch (sortMode) + { + case DataModel.Search.Sort.SortMode.MIN: + return SortMode.SORT_MODE_MIN; + case DataModel.Search.Sort.SortMode.MAX: + return SortMode.SORT_MODE_MAX; + case DataModel.Search.Sort.SortMode.AVG: + return SortMode.SORT_MODE_AVG; + default: + throw new ArgumentException("unknown sortOrder: " + sortMode.ToString()); + } + } + + public static NestedFilter BuildNestedFilter(DataModel.Search.Sort.NestedFilter nestedFilter) + { + NestedFilter.Builder builder = NestedFilter.CreateBuilder(); + builder.SetPath(nestedFilter.Path); + builder.SetFilter(SearchQueryBuilder.BuildQuery(nestedFilter.Query)); + return builder.Build(); + } + + public static FieldSort BuildFieldSort(DataModel.Search.Sort.FieldSort fieldSort) + { + FieldSort.Builder builder = FieldSort.CreateBuilder(); + builder.SetFieldName(fieldSort.FieldName); + + builder.SetOrder(BuildSortOrder(fieldSort.Order)); + + builder.SetMode(BuildSortMode(fieldSort.Mode)); + + if (fieldSort.NestedFilter != null) + { + builder.SetNestedFilter(BuildNestedFilter(fieldSort.NestedFilter)); + } + return builder.Build(); + } + + public static ScoreSort BuildScoreSort(DataModel.Search.Sort.ScoreSort scoreSort) + { + ScoreSort.Builder builder = ScoreSort.CreateBuilder(); + builder.SetOrder(BuildSortOrder(scoreSort.Order)); + return builder.Build(); + } + + public static GeoDistanceType BuildGeoDistanceType(DataModel.Search.Sort.GeoDistanceType geoDistanceType) + { + switch (geoDistanceType) + { + case DataModel.Search.Sort.GeoDistanceType.ARC: + return GeoDistanceType.GEO_DISTANCE_ARC; + case DataModel.Search.Sort.GeoDistanceType.PLANE: + return GeoDistanceType.GEO_DISTANCE_PLANE; + default: + throw new ArgumentException("unknown geoDistanceType: " + geoDistanceType.ToString()); + } + } + + public static GeoDistanceSort BuildGeoDistanceSort(DataModel.Search.Sort.GeoDistanceSort geoDistanceSort) + { + GeoDistanceSort.Builder builder = GeoDistanceSort.CreateBuilder(); + builder.SetFieldName(geoDistanceSort.FieldName); + if (geoDistanceSort.Points != null) + { + builder.AddRangePoints(geoDistanceSort.Points); + } + + builder.SetOrder(BuildSortOrder(geoDistanceSort.Order)); + + + builder.SetMode(BuildSortMode(geoDistanceSort.Mode)); + + + builder.SetDistanceType(BuildGeoDistanceType(geoDistanceSort.DistanceType)); + + if (geoDistanceSort.NestedFilter != null) + { + builder.SetNestedFilter(BuildNestedFilter(geoDistanceSort.NestedFilter)); + } + return builder.Build(); + } + + public static PrimaryKeySort BuilderPrimarykeySort(DataModel.Search.Sort.PrimaryKeySort primaryKeySort) + { + var builder = PrimaryKeySort.CreateBuilder(); + builder.SetOrder(BuildSortOrder(primaryKeySort.Order)); + return builder.Build(); + } + + public static Sorter BuildSorter(DataModel.Search.Sort.ISorter sorter) + { + Sorter.Builder builder = Sorter.CreateBuilder(); + if (sorter is DataModel.Search.Sort.FieldSort) + { + builder.SetFieldSort(BuildFieldSort((DataModel.Search.Sort.FieldSort)sorter)); + } + else if (sorter is DataModel.Search.Sort.ScoreSort) + { + builder.SetScoreSort(BuildScoreSort((DataModel.Search.Sort.ScoreSort)sorter)); + } + else if (sorter is DataModel.Search.Sort.GeoDistanceSort) + { + builder.SetGeoDistanceSort(BuildGeoDistanceSort((DataModel.Search.Sort.GeoDistanceSort)sorter)); + } + else if (sorter is DataModel.Search.Sort.PrimaryKeySort) + { + builder.SetPkSort(BuilderPrimarykeySort((DataModel.Search.Sort.PrimaryKeySort)sorter)); + } + else + { + throw new ArgumentException("unknown sorter type: " + sorter.ToString()); + } + return builder.Build(); + } + + public static Sort BuildSort(DataModel.Search.Sort.Sort sort) + { + Sort.Builder builder = Sort.CreateBuilder(); + foreach (var sorter in sort.Sorters) + { + builder.AddSorter(BuildSorter(sorter)); + } + return builder.Build(); + } + + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/SearchVariantType.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/SearchVariantType.cs new file mode 100644 index 0000000..34ac2ce --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/SearchVariantType.cs @@ -0,0 +1,116 @@ +using System; +using System.IO; +using System.Text; +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.ProtoBuffer +{ + public class SearchVariantType + { + public enum VariantType + { + INTEGER, + DOUBLE, + BOOLEAN, + STRING + } + + // variant type + public static byte VT_INTEGER = 0x0; + public static byte VT_DOUBLE = 0x1; + public static byte VT_BOOLEAN = 0x2; + public static byte VT_STRING = 0x3; + + public static VariantType GetVariantType(byte[] data) + { + if (data[0] == VT_INTEGER) + { + return VariantType.INTEGER; + } + else if (data[0] == VT_DOUBLE) + { + return VariantType.DOUBLE; + } + else if (data[0] == VT_BOOLEAN) + { + return VariantType.BOOLEAN; + } + else if (data[0] == VT_STRING) + { + return VariantType.STRING; + } + else + { + throw new ArgumentException("unknown type: " + data[0]); + } + } + + public static byte[] FromLong(long v) + { + using (MemoryStream ms = new MemoryStream()) + { + ms.WriteByte(VT_INTEGER); + foreach (var item in BitConverter.GetBytes(v)) + { + ms.WriteByte(item); + } + return ms.ToArray(); + } + } + + public static byte[] FromDouble(double v) + { + using (MemoryStream ms = new MemoryStream()) + { + ms.WriteByte(VT_DOUBLE); + foreach (var item in BitConverter.GetBytes(v)) + { + ms.WriteByte(item); + } + return ms.ToArray(); + } + } + + public static byte[] FromString(string v) + { + using (MemoryStream ms = new MemoryStream()) + { + byte[] strBytes = Encoding.UTF8.GetBytes(v); + + ms.WriteByte(VT_STRING); + foreach (var item in BitConverter.GetBytes(strBytes.Length)) + { + ms.WriteByte(item); + } + + foreach (var item in Encoding.UTF8.GetBytes(v)) + { + ms.WriteByte(item); + } + return ms.ToArray(); + } + } + + public static byte[] FromBoolean(bool v) + { + return new byte[] { VT_BOOLEAN, (byte)(v ? 1 : 0) }; + } + + public static byte[] toVariant(ColumnValue value) + { + switch (value.Type) + { + case ColumnValueType.String: + return FromString(value.StringValue); + case ColumnValueType.Integer: + return FromLong(value.IntegerValue); + case ColumnValueType.Double: + return FromDouble(value.DoubleValue); + case ColumnValueType.Boolean: + return FromBoolean(value.BooleanValue); + default: + throw new ArgumentException("unsupported type:" + value.Type); + } + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/TableStore.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/TableStore.cs new file mode 100644 index 0000000..431c08f --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/TableStore.cs @@ -0,0 +1,29215 @@ +// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT! +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace com.alicloud.openservices.tablestore.core.protocol { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class TableStore { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_Error__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_Error__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySchema__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySchema__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DefinedColumnSchema__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DefinedColumnSchema__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_PartitionRange__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_PartitionRange__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_TableOptions__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_TableOptions__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexMeta__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexMeta__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_TableMeta__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_TableMeta__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_Condition__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_Condition__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_CapacityUnit__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_CapacityUnit__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughputDetails__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughputDetails__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughput__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughput__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ConsumedCapacity__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ConsumedCapacity__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamSpecification__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamSpecification__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamDetails__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamDetails__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_TimeRange__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_TimeRange__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ReturnContent__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ReturnContent__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchGetRowResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchGetRowResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_Stream__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_Stream__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamShard__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamShard__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse_StreamRecord__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse_StreamRecord__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse_SplitLocation__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse_SplitLocation__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static TableStore() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChF0YWJsZV9zdG9yZS5wcm90bxIyY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNl", + "cy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wiJgoFRXJyb3ISDAoEY29kZRgB", + "IAIoCRIPCgdtZXNzYWdlGAIgASgJIsgBChBQcmltYXJ5S2V5U2NoZW1hEgwK", + "BG5hbWUYASACKAkSUAoEdHlwZRgCIAIoDjJCLmNvbS5hbGljbG91ZC5vcGVu", + "c2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlByaW1hcnlLZXlU", + "eXBlElQKBm9wdGlvbhgDIAEoDjJELmNvbS5hbGljbG91ZC5vcGVuc2Vydmlj", + "ZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlByaW1hcnlLZXlPcHRpb24i", + "eAoTRGVmaW5lZENvbHVtblNjaGVtYRIMCgRuYW1lGAEgAigJElMKBHR5cGUY", + "AiACKA4yRS5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUu", + "Y29yZS5wcm90b2NvbC5EZWZpbmVkQ29sdW1uVHlwZSIsCg5QYXJ0aXRpb25S", + "YW5nZRINCgViZWdpbhgBIAIoDBILCgNlbmQYAiACKAwi1QEKDFRhYmxlT3B0", + "aW9ucxIUCgx0aW1lX3RvX2xpdmUYASABKAUSFAoMbWF4X3ZlcnNpb25zGAIg", + "ASgFEl4KEWJsb29tX2ZpbHRlcl90eXBlGAMgASgOMkMuY29tLmFsaWNsb3Vk", + "Lm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuQmxvb21G", + "aWx0ZXJUeXBlEhIKCmJsb2NrX3NpemUYBCABKAUSJQodZGV2aWF0aW9uX2Nl", + "bGxfdmVyc2lvbl9pbl9zZWMYBSABKAMi+QEKCUluZGV4TWV0YRIMCgRuYW1l", + "GAEgAigJEhMKC3ByaW1hcnlfa2V5GAIgAygJEhYKDmRlZmluZWRfY29sdW1u", + "GAMgAygJEl4KEWluZGV4X3VwZGF0ZV9tb2RlGAQgAigOMkMuY29tLmFsaWNs", + "b3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuSW5k", + "ZXhVcGRhdGVNb2RlElEKCmluZGV4X3R5cGUYBSACKA4yPS5jb20uYWxpY2xv", + "dWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5JbmRl", + "eFR5cGUirgIKCVRhYmxlTWV0YRISCgp0YWJsZV9uYW1lGAEgAigJElkKC3By", + "aW1hcnlfa2V5GAIgAygLMkQuY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50", + "YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuUHJpbWFyeUtleVNjaGVtYRJfCg5k", + "ZWZpbmVkX2NvbHVtbhgDIAMoCzJHLmNvbS5hbGljbG91ZC5vcGVuc2Vydmlj", + "ZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLkRlZmluZWRDb2x1bW5TY2hl", + "bWESUQoKaW5kZXhfbWV0YRgEIAMoCzI9LmNvbS5hbGljbG91ZC5vcGVuc2Vy", + "dmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLkluZGV4TWV0YSKJAQoJ", + "Q29uZGl0aW9uEmIKDXJvd19leGlzdGVuY2UYASACKA4ySy5jb20uYWxpY2xv", + "dWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5Sb3dF", + "eGlzdGVuY2VFeHBlY3RhdGlvbhIYChBjb2x1bW5fY29uZGl0aW9uGAIgASgM", + "IisKDENhcGFjaXR5VW5pdBIMCgRyZWFkGAEgASgFEg0KBXdyaXRlGAIgASgF", + "IqwBChlSZXNlcnZlZFRocm91Z2hwdXREZXRhaWxzElcKDWNhcGFjaXR5X3Vu", + "aXQYASACKAsyQC5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3Rv", + "cmUuY29yZS5wcm90b2NvbC5DYXBhY2l0eVVuaXQSGgoSbGFzdF9pbmNyZWFz", + "ZV90aW1lGAIgAigDEhoKEmxhc3RfZGVjcmVhc2VfdGltZRgDIAEoAyJtChJS", + "ZXNlcnZlZFRocm91Z2hwdXQSVwoNY2FwYWNpdHlfdW5pdBgBIAIoCzJALmNv", + "bS5hbGljbG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3Rv", + "Y29sLkNhcGFjaXR5VW5pdCJrChBDb25zdW1lZENhcGFjaXR5ElcKDWNhcGFj", + "aXR5X3VuaXQYASACKAsyQC5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRh", + "Ymxlc3RvcmUuY29yZS5wcm90b2NvbC5DYXBhY2l0eVVuaXQiRQoTU3RyZWFt", + "U3BlY2lmaWNhdGlvbhIVCg1lbmFibGVfc3RyZWFtGAEgAigIEhcKD2V4cGly", + "YXRpb25fdGltZRgCIAEoBSJsCg1TdHJlYW1EZXRhaWxzEhUKDWVuYWJsZV9z", + "dHJlYW0YASACKAgSEQoJc3RyZWFtX2lkGAIgASgJEhcKD2V4cGlyYXRpb25f", + "dGltZRgDIAEoBRIYChBsYXN0X2VuYWJsZV90aW1lGAQgASgDIq8EChJDcmVh", + "dGVUYWJsZVJlcXVlc3QSUQoKdGFibGVfbWV0YRgBIAIoCzI9LmNvbS5hbGlj", + "bG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlRh", + "YmxlTWV0YRJjChNyZXNlcnZlZF90aHJvdWdocHV0GAIgAigLMkYuY29tLmFs", + "aWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wu", + "UmVzZXJ2ZWRUaHJvdWdocHV0ElcKDXRhYmxlX29wdGlvbnMYAyABKAsyQC5j", + "b20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90", + "b2NvbC5UYWJsZU9wdGlvbnMSVgoKcGFydGl0aW9ucxgEIAMoCzJCLmNvbS5h", + "bGljbG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29s", + "LlBhcnRpdGlvblJhbmdlElwKC3N0cmVhbV9zcGVjGAUgASgLMkcuY29tLmFs", + "aWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wu", + "U3RyZWFtU3BlY2lmaWNhdGlvbhJSCgtpbmRleF9tZXRhcxgHIAMoCzI9LmNv", + "bS5hbGljbG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3Rv", + "Y29sLkluZGV4TWV0YSIVChNDcmVhdGVUYWJsZVJlc3BvbnNlIpsBChJDcmVh", + "dGVJbmRleFJlcXVlc3QSFwoPbWFpbl90YWJsZV9uYW1lGAEgAigJElEKCmlu", + "ZGV4X21ldGEYAiACKAsyPS5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRh", + "Ymxlc3RvcmUuY29yZS5wcm90b2NvbC5JbmRleE1ldGESGQoRaW5jbHVkZV9i", + "YXNlX2RhdGEYAyABKAgiFQoTQ3JlYXRlSW5kZXhSZXNwb25zZSI/ChBEcm9w", + "SW5kZXhSZXF1ZXN0EhcKD21haW5fdGFibGVfbmFtZRgBIAIoCRISCgppbmRl", + "eF9uYW1lGAIgAigJIhMKEURyb3BJbmRleFJlc3BvbnNlIsQCChJVcGRhdGVU", + "YWJsZVJlcXVlc3QSEgoKdGFibGVfbmFtZRgBIAIoCRJjChNyZXNlcnZlZF90", + "aHJvdWdocHV0GAIgASgLMkYuY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50", + "YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuUmVzZXJ2ZWRUaHJvdWdocHV0ElcK", + "DXRhYmxlX29wdGlvbnMYAyABKAsyQC5jb20uYWxpY2xvdWQub3BlbnNlcnZp", + "Y2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5UYWJsZU9wdGlvbnMSXAoL", + "c3RyZWFtX3NwZWMYBCABKAsyRy5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2Vz", + "LnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5TdHJlYW1TcGVjaWZpY2F0aW9u", + "Ir0CChNVcGRhdGVUYWJsZVJlc3BvbnNlEnIKG3Jlc2VydmVkX3Rocm91Z2hw", + "dXRfZGV0YWlscxgBIAIoCzJNLmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMu", + "dGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlJlc2VydmVkVGhyb3VnaHB1dERl", + "dGFpbHMSVwoNdGFibGVfb3B0aW9ucxgCIAIoCzJALmNvbS5hbGljbG91ZC5v", + "cGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlRhYmxlT3B0", + "aW9ucxJZCg5zdHJlYW1fZGV0YWlscxgDIAEoCzJBLmNvbS5hbGljbG91ZC5v", + "cGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlN0cmVhbURl", + "dGFpbHMiKgoURGVzY3JpYmVUYWJsZVJlcXVlc3QSEgoKdGFibGVfbmFtZRgB", + "IAIoCSLTBAoVRGVzY3JpYmVUYWJsZVJlc3BvbnNlElEKCnRhYmxlX21ldGEY", + "ASACKAsyPS5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUu", + "Y29yZS5wcm90b2NvbC5UYWJsZU1ldGEScgobcmVzZXJ2ZWRfdGhyb3VnaHB1", + "dF9kZXRhaWxzGAIgAigLMk0uY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50", + "YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuUmVzZXJ2ZWRUaHJvdWdocHV0RGV0", + "YWlscxJXCg10YWJsZV9vcHRpb25zGAMgAigLMkAuY29tLmFsaWNsb3VkLm9w", + "ZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuVGFibGVPcHRp", + "b25zElUKDHRhYmxlX3N0YXR1cxgEIAIoDjI/LmNvbS5hbGljbG91ZC5vcGVu", + "c2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlRhYmxlU3RhdHVz", + "ElkKDnN0cmVhbV9kZXRhaWxzGAUgASgLMkEuY29tLmFsaWNsb3VkLm9wZW5z", + "ZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuU3RyZWFtRGV0YWls", + "cxIUCgxzaGFyZF9zcGxpdHMYBiADKAwSUgoLaW5kZXhfbWV0YXMYCCADKAsy", + "PS5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5w", + "cm90b2NvbC5JbmRleE1ldGEiEgoQTGlzdFRhYmxlUmVxdWVzdCIoChFMaXN0", + "VGFibGVSZXNwb25zZRITCgt0YWJsZV9uYW1lcxgBIAMoCSIoChJEZWxldGVU", + "YWJsZVJlcXVlc3QSEgoKdGFibGVfbmFtZRgBIAIoCSIVChNEZWxldGVUYWJs", + "ZVJlc3BvbnNlIiYKEExvYWRUYWJsZVJlcXVlc3QSEgoKdGFibGVfbmFtZRgB", + "IAIoCSITChFMb2FkVGFibGVSZXNwb25zZSIoChJVbmxvYWRUYWJsZVJlcXVl", + "c3QSEgoKdGFibGVfbmFtZRgBIAIoCSIVChNVbmxvYWRUYWJsZVJlc3BvbnNl", + "IkgKCVRpbWVSYW5nZRISCgpzdGFydF90aW1lGAEgASgDEhAKCGVuZF90aW1l", + "GAIgASgDEhUKDXNwZWNpZmljX3RpbWUYAyABKAMigQEKDVJldHVybkNvbnRl", + "bnQSUwoLcmV0dXJuX3R5cGUYASABKA4yPi5jb20uYWxpY2xvdWQub3BlbnNl", + "cnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5SZXR1cm5UeXBlEhsK", + "E3JldHVybl9jb2x1bW5fbmFtZXMYAiADKAkitgIKDUdldFJvd1JlcXVlc3QS", + "EgoKdGFibGVfbmFtZRgBIAIoCRITCgtwcmltYXJ5X2tleRgCIAIoDBIWCg5j", + "b2x1bW5zX3RvX2dldBgDIAMoCRJRCgp0aW1lX3JhbmdlGAQgASgLMj0uY29t", + "LmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9j", + "b2wuVGltZVJhbmdlEhQKDG1heF92ZXJzaW9ucxgFIAEoBRIaCgxjYWNoZV9i", + "bG9ja3MYBiABKAg6BHRydWUSDgoGZmlsdGVyGAcgASgMEhQKDHN0YXJ0X2Nv", + "bHVtbhgIIAEoCRISCgplbmRfY29sdW1uGAkgASgJEg0KBXRva2VuGAogASgM", + "EhYKDnRyYW5zYWN0aW9uX2lkGAsgASgJIokBCg5HZXRSb3dSZXNwb25zZRJW", + "Cghjb25zdW1lZBgBIAIoCzJELmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMu", + "dGFibGVzdG9yZS5jb3JlLnByb3RvY29sLkNvbnN1bWVkQ2FwYWNpdHkSCwoD", + "cm93GAIgAigMEhIKCm5leHRfdG9rZW4YAyABKAwi/wEKEFVwZGF0ZVJvd1Jl", + "cXVlc3QSEgoKdGFibGVfbmFtZRgBIAIoCRISCgpyb3dfY2hhbmdlGAIgAigM", + "ElAKCWNvbmRpdGlvbhgDIAIoCzI9LmNvbS5hbGljbG91ZC5vcGVuc2Vydmlj", + "ZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLkNvbmRpdGlvbhJZCg5yZXR1", + "cm5fY29udGVudBgEIAEoCzJBLmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMu", + "dGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlJldHVybkNvbnRlbnQSFgoOdHJh", + "bnNhY3Rpb25faWQYBSABKAkieAoRVXBkYXRlUm93UmVzcG9uc2USVgoIY29u", + "c3VtZWQYASACKAsyRC5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxl", + "c3RvcmUuY29yZS5wcm90b2NvbC5Db25zdW1lZENhcGFjaXR5EgsKA3JvdxgC", + "IAEoDCL1AQoNUHV0Um93UmVxdWVzdBISCgp0YWJsZV9uYW1lGAEgAigJEgsK", + "A3JvdxgCIAIoDBJQCgljb25kaXRpb24YAyACKAsyPS5jb20uYWxpY2xvdWQu", + "b3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5Db25kaXRp", + "b24SWQoOcmV0dXJuX2NvbnRlbnQYBCABKAsyQS5jb20uYWxpY2xvdWQub3Bl", + "bnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5SZXR1cm5Db250", + "ZW50EhYKDnRyYW5zYWN0aW9uX2lkGAUgASgJInUKDlB1dFJvd1Jlc3BvbnNl", + "ElYKCGNvbnN1bWVkGAEgAigLMkQuY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNl", + "cy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuQ29uc3VtZWRDYXBhY2l0eRIL", + "CgNyb3cYAiABKAwigAIKEERlbGV0ZVJvd1JlcXVlc3QSEgoKdGFibGVfbmFt", + "ZRgBIAIoCRITCgtwcmltYXJ5X2tleRgCIAIoDBJQCgljb25kaXRpb24YAyAC", + "KAsyPS5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29y", + "ZS5wcm90b2NvbC5Db25kaXRpb24SWQoOcmV0dXJuX2NvbnRlbnQYBCABKAsy", + "QS5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5w", + "cm90b2NvbC5SZXR1cm5Db250ZW50EhYKDnRyYW5zYWN0aW9uX2lkGAUgASgJ", + "IngKEURlbGV0ZVJvd1Jlc3BvbnNlElYKCGNvbnN1bWVkGAEgAigLMkQuY29t", + "LmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9j", + "b2wuQ29uc3VtZWRDYXBhY2l0eRILCgNyb3cYAiABKAwiqgIKGVRhYmxlSW5C", + "YXRjaEdldFJvd1JlcXVlc3QSEgoKdGFibGVfbmFtZRgBIAIoCRITCgtwcmlt", + "YXJ5X2tleRgCIAMoDBINCgV0b2tlbhgDIAMoDBIWCg5jb2x1bW5zX3RvX2dl", + "dBgEIAMoCRJRCgp0aW1lX3JhbmdlGAUgASgLMj0uY29tLmFsaWNsb3VkLm9w", + "ZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuVGltZVJhbmdl", + "EhQKDG1heF92ZXJzaW9ucxgGIAEoBRIaCgxjYWNoZV9ibG9ja3MYByABKAg6", + "BHRydWUSDgoGZmlsdGVyGAggASgMEhQKDHN0YXJ0X2NvbHVtbhgJIAEoCRIS", + "CgplbmRfY29sdW1uGAogASgJInMKEkJhdGNoR2V0Um93UmVxdWVzdBJdCgZ0", + "YWJsZXMYASADKAsyTS5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxl", + "c3RvcmUuY29yZS5wcm90b2NvbC5UYWJsZUluQmF0Y2hHZXRSb3dSZXF1ZXN0", + "IuwBChhSb3dJbkJhdGNoR2V0Um93UmVzcG9uc2USDQoFaXNfb2sYASACKAgS", + "SAoFZXJyb3IYAiABKAsyOS5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRh", + "Ymxlc3RvcmUuY29yZS5wcm90b2NvbC5FcnJvchJWCghjb25zdW1lZBgDIAEo", + "CzJELmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9yZS5jb3Jl", + "LnByb3RvY29sLkNvbnN1bWVkQ2FwYWNpdHkSCwoDcm93GAQgASgMEhIKCm5l", + "eHRfdG9rZW4YBSABKAwijAEKGlRhYmxlSW5CYXRjaEdldFJvd1Jlc3BvbnNl", + "EhIKCnRhYmxlX25hbWUYASACKAkSWgoEcm93cxgCIAMoCzJMLmNvbS5hbGlj", + "bG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlJv", + "d0luQmF0Y2hHZXRSb3dSZXNwb25zZSJ1ChNCYXRjaEdldFJvd1Jlc3BvbnNl", + "El4KBnRhYmxlcxgBIAMoCzJOLmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMu", + "dGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlRhYmxlSW5CYXRjaEdldFJvd1Jl", + "c3BvbnNlIq0CChlSb3dJbkJhdGNoV3JpdGVSb3dSZXF1ZXN0Ek8KBHR5cGUY", + "ASACKA4yQS5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUu", + "Y29yZS5wcm90b2NvbC5PcGVyYXRpb25UeXBlEhIKCnJvd19jaGFuZ2UYAiAC", + "KAwSUAoJY29uZGl0aW9uGAMgAigLMj0uY29tLmFsaWNsb3VkLm9wZW5zZXJ2", + "aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuQ29uZGl0aW9uElkKDnJl", + "dHVybl9jb250ZW50GAQgASgLMkEuY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNl", + "cy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuUmV0dXJuQ29udGVudCKOAQob", + "VGFibGVJbkJhdGNoV3JpdGVSb3dSZXF1ZXN0EhIKCnRhYmxlX25hbWUYASAC", + "KAkSWwoEcm93cxgCIAMoCzJNLmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMu", + "dGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlJvd0luQmF0Y2hXcml0ZVJvd1Jl", + "cXVlc3QijwEKFEJhdGNoV3JpdGVSb3dSZXF1ZXN0El8KBnRhYmxlcxgBIAMo", + "CzJPLmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9yZS5jb3Jl", + "LnByb3RvY29sLlRhYmxlSW5CYXRjaFdyaXRlUm93UmVxdWVzdBIWCg50cmFu", + "c2FjdGlvbl9pZBgCIAEoCSLaAQoaUm93SW5CYXRjaFdyaXRlUm93UmVzcG9u", + "c2USDQoFaXNfb2sYASACKAgSSAoFZXJyb3IYAiABKAsyOS5jb20uYWxpY2xv", + "dWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5FcnJv", + "chJWCghjb25zdW1lZBgDIAEoCzJELmNvbS5hbGljbG91ZC5vcGVuc2Vydmlj", + "ZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLkNvbnN1bWVkQ2FwYWNpdHkS", + "CwoDcm93GAQgASgMIpABChxUYWJsZUluQmF0Y2hXcml0ZVJvd1Jlc3BvbnNl", + "EhIKCnRhYmxlX25hbWUYASACKAkSXAoEcm93cxgCIAMoCzJOLmNvbS5hbGlj", + "bG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlJv", + "d0luQmF0Y2hXcml0ZVJvd1Jlc3BvbnNlInkKFUJhdGNoV3JpdGVSb3dSZXNw", + "b25zZRJgCgZ0YWJsZXMYASADKAsyUC5jb20uYWxpY2xvdWQub3BlbnNlcnZp", + "Y2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5UYWJsZUluQmF0Y2hXcml0", + "ZVJvd1Jlc3BvbnNlItEFCg9HZXRSYW5nZVJlcXVlc3QSEgoKdGFibGVfbmFt", + "ZRgBIAIoCRJQCglkaXJlY3Rpb24YAiACKA4yPS5jb20uYWxpY2xvdWQub3Bl", + "bnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5EaXJlY3Rpb24S", + "FgoOY29sdW1uc190b19nZXQYAyADKAkSUQoKdGltZV9yYW5nZRgEIAEoCzI9", + "LmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnBy", + "b3RvY29sLlRpbWVSYW5nZRIUCgxtYXhfdmVyc2lvbnMYBSABKAUSDQoFbGlt", + "aXQYBiABKAUSIwobaW5jbHVzaXZlX3N0YXJ0X3ByaW1hcnlfa2V5GAcgAigM", + "EiEKGWV4Y2x1c2l2ZV9lbmRfcHJpbWFyeV9rZXkYCCACKAwSGgoMY2FjaGVf", + "YmxvY2tzGAkgASgIOgR0cnVlEg4KBmZpbHRlchgKIAEoDBIUCgxzdGFydF9j", + "b2x1bW4YCyABKAkSEgoKZW5kX2NvbHVtbhgMIAEoCRINCgV0b2tlbhgNIAEo", + "DBIWCg50cmFuc2FjdGlvbl9pZBgOIAEoCRJxChRkYXRhX2Jsb2NrX3R5cGVf", + "aGludBgPIAEoDjJBLmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMudGFibGVz", + "dG9yZS5jb3JlLnByb3RvY29sLkRhdGFCbG9ja1R5cGU6EERCVF9QTEFJTl9C", + "VUZGRVISKAoacmV0dXJuX2VudGlyZV9wcmltYXJ5X2tleXMYECABKAg6BHRy", + "dWUSZgoSY29tcHJlc3NfdHlwZV9oaW50GBEgASgOMkAuY29tLmFsaWNsb3Vk", + "Lm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuQ29tcHJl", + "c3NUeXBlOghDUFRfTk9ORSLhAgoQR2V0UmFuZ2VSZXNwb25zZRJWCghjb25z", + "dW1lZBgBIAIoCzJELmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMudGFibGVz", + "dG9yZS5jb3JlLnByb3RvY29sLkNvbnN1bWVkQ2FwYWNpdHkSDAoEcm93cxgC", + "IAIoDBIeChZuZXh0X3N0YXJ0X3ByaW1hcnlfa2V5GAMgASgMEhIKCm5leHRf", + "dG9rZW4YBCABKAwSWgoPZGF0YV9ibG9ja190eXBlGAUgASgOMkEuY29tLmFs", + "aWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wu", + "RGF0YUJsb2NrVHlwZRJXCg1jb21wcmVzc190eXBlGAYgASgOMkAuY29tLmFs", + "aWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wu", + "Q29tcHJlc3NUeXBlIj8KHFN0YXJ0TG9jYWxUcmFuc2FjdGlvblJlcXVlc3QS", + "EgoKdGFibGVfbmFtZRgBIAIoCRILCgNrZXkYAiACKAwiNwodU3RhcnRMb2Nh", + "bFRyYW5zYWN0aW9uUmVzcG9uc2USFgoOdHJhbnNhY3Rpb25faWQYASACKAki", + "MgoYQ29tbWl0VHJhbnNhY3Rpb25SZXF1ZXN0EhYKDnRyYW5zYWN0aW9uX2lk", + "GAEgAigJIhsKGUNvbW1pdFRyYW5zYWN0aW9uUmVzcG9uc2UiMQoXQWJvcnRU", + "cmFuc2FjdGlvblJlcXVlc3QSFgoOdHJhbnNhY3Rpb25faWQYASACKAkiGgoY", + "QWJvcnRUcmFuc2FjdGlvblJlc3BvbnNlIicKEUxpc3RTdHJlYW1SZXF1ZXN0", + "EhIKCnRhYmxlX25hbWUYASABKAkiRgoGU3RyZWFtEhEKCXN0cmVhbV9pZBgB", + "IAIoCRISCgp0YWJsZV9uYW1lGAIgAigJEhUKDWNyZWF0aW9uX3RpbWUYAyAC", + "KAMiYQoSTGlzdFN0cmVhbVJlc3BvbnNlEksKB3N0cmVhbXMYASADKAsyOi5j", + "b20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90", + "b2NvbC5TdHJlYW0iTQoLU3RyZWFtU2hhcmQSEAoIc2hhcmRfaWQYASACKAkS", + "EQoJcGFyZW50X2lkGAIgASgJEhkKEXBhcmVudF9zaWJsaW5nX2lkGAMgASgJ", + "ImEKFURlc2NyaWJlU3RyZWFtUmVxdWVzdBIRCglzdHJlYW1faWQYASACKAkS", + "IAoYaW5jbHVzaXZlX3N0YXJ0X3NoYXJkX2lkGAIgASgJEhMKC3NoYXJkX2xp", + "bWl0GAMgASgFIrACChZEZXNjcmliZVN0cmVhbVJlc3BvbnNlEhEKCXN0cmVh", + "bV9pZBgBIAIoCRIXCg9leHBpcmF0aW9uX3RpbWUYAiACKAUSEgoKdGFibGVf", + "bmFtZRgDIAIoCRIVCg1jcmVhdGlvbl90aW1lGAQgAigDElcKDXN0cmVhbV9z", + "dGF0dXMYBSACKA4yQC5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxl", + "c3RvcmUuY29yZS5wcm90b2NvbC5TdHJlYW1TdGF0dXMSTwoGc2hhcmRzGAYg", + "AygLMj8uY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNv", + "cmUucHJvdG9jb2wuU3RyZWFtU2hhcmQSFQoNbmV4dF9zaGFyZF9pZBgHIAEo", + "CSI+ChdHZXRTaGFyZEl0ZXJhdG9yUmVxdWVzdBIRCglzdHJlYW1faWQYASAC", + "KAkSEAoIc2hhcmRfaWQYAiACKAkiMgoYR2V0U2hhcmRJdGVyYXRvclJlc3Bv", + "bnNlEhYKDnNoYXJkX2l0ZXJhdG9yGAEgAigJIj8KFkdldFN0cmVhbVJlY29y", + "ZFJlcXVlc3QSFgoOc2hhcmRfaXRlcmF0b3IYASACKAkSDQoFbGltaXQYAiAB", + "KAUinQIKF0dldFN0cmVhbVJlY29yZFJlc3BvbnNlEnAKDnN0cmVhbV9yZWNv", + "cmRzGAEgAygLMlguY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0", + "b3JlLmNvcmUucHJvdG9jb2wuR2V0U3RyZWFtUmVjb3JkUmVzcG9uc2UuU3Ry", + "ZWFtUmVjb3JkEhsKE25leHRfc2hhcmRfaXRlcmF0b3IYAiABKAkacwoMU3Ry", + "ZWFtUmVjb3JkElMKC2FjdGlvbl90eXBlGAEgAigOMj4uY29tLmFsaWNsb3Vk", + "Lm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuQWN0aW9u", + "VHlwZRIOCgZyZWNvcmQYAiACKAwiagofQ29tcHV0ZVNwbGl0UG9pbnRzQnlT", + "aXplUmVxdWVzdBISCgp0YWJsZV9uYW1lGAEgAigJEhIKCnNwbGl0X3NpemUY", + "AiACKAMSHwoXc3BsaXRfc2l6ZV91bml0X2luX2J5dGUYAyABKAMikAMKIENv", + "bXB1dGVTcGxpdFBvaW50c0J5U2l6ZVJlc3BvbnNlElYKCGNvbnN1bWVkGAEg", + "AigLMkQuY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNv", + "cmUucHJvdG9jb2wuQ29uc3VtZWRDYXBhY2l0eRJUCgZzY2hlbWEYAiADKAsy", + "RC5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5w", + "cm90b2NvbC5QcmltYXJ5S2V5U2NoZW1hEhQKDHNwbGl0X3BvaW50cxgDIAMo", + "DBJ1Cglsb2NhdGlvbnMYBCADKAsyYi5jb20uYWxpY2xvdWQub3BlbnNlcnZp", + "Y2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5Db21wdXRlU3BsaXRQb2lu", + "dHNCeVNpemVSZXNwb25zZS5TcGxpdExvY2F0aW9uGjEKDVNwbGl0TG9jYXRp", + "b24SEAoIbG9jYXRpb24YASACKAkSDgoGcmVwZWF0GAIgAigSKjUKDlByaW1h", + "cnlLZXlUeXBlEgsKB0lOVEVHRVIQARIKCgZTVFJJTkcQAhIKCgZCSU5BUlkQ", + "AypjChFEZWZpbmVkQ29sdW1uVHlwZRIPCgtEQ1RfSU5URUdFUhABEg4KCkRD", + "VF9ET1VCTEUQAhIPCgtEQ1RfQk9PTEVBThADEg4KCkRDVF9TVFJJTkcQBBIM", + "CghEQ1RfQkxPQhAHKiYKEFByaW1hcnlLZXlPcHRpb24SEgoOQVVUT19JTkNS", + "RU1FTlQQASouCg9CbG9vbUZpbHRlclR5cGUSCAoETk9ORRABEggKBENFTEwQ", + "AhIHCgNST1cQAypACg1EYXRhQmxvY2tUeXBlEhQKEERCVF9QTEFJTl9CVUZG", + "RVIQABIZChVEQlRfU0lNUExFX1JPV19NQVRSSVgQASocCgxDb21wcmVzc1R5", + "cGUSDAoIQ1BUX05PTkUQACo6Cg9JbmRleFVwZGF0ZU1vZGUSEwoPSVVNX0FT", + "WU5DX0lOREVYEAASEgoOSVVNX1NZTkNfSU5ERVgQASo0CglJbmRleFR5cGUS", + "EwoPSVRfR0xPQkFMX0lOREVYEAASEgoOSVRfTE9DQUxfSU5ERVgQASpRCgtU", + "YWJsZVN0YXR1cxIKCgZBQ1RJVkUQARIMCghJTkFDVElWRRACEgsKB0xPQURJ", + "TkcQAxINCglVTkxPQURJTkcQBBIMCghVUERBVElORxAFKk0KF1Jvd0V4aXN0", + "ZW5jZUV4cGVjdGF0aW9uEgoKBklHTk9SRRAAEhAKDEVYUEVDVF9FWElTVBAB", + "EhQKEEVYUEVDVF9OT1RfRVhJU1QQAio5CgpSZXR1cm5UeXBlEgsKB1JUX05P", + "TkUQABIJCgVSVF9QSxABEhMKD1JUX0FGVEVSX01PRElGWRACKjAKDU9wZXJh", + "dGlvblR5cGUSBwoDUFVUEAESCgoGVVBEQVRFEAISCgoGREVMRVRFEAMqJgoJ", + "RGlyZWN0aW9uEgsKB0ZPUldBUkQQABIMCghCQUNLV0FSRBABKjYKDFN0cmVh", + "bVN0YXR1cxITCg9TVFJFQU1fRU5BQkxJTkcQARIRCg1TVFJFQU1fQUNUSVZF", + "EAIqOQoKQWN0aW9uVHlwZRILCgdQVVRfUk9XEAESDgoKVVBEQVRFX1JPVxAC", + "Eg4KCkRFTEVURV9ST1cQAw==")); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_com_alicloud_openservices_tablestore_core_protocol_Error__Descriptor = Descriptor.MessageTypes[0]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_Error__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_Error__Descriptor, + new string[] { "Code", "Message", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySchema__Descriptor = Descriptor.MessageTypes[1]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySchema__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySchema__Descriptor, + new string[] { "Name", "Type", "Option", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DefinedColumnSchema__Descriptor = Descriptor.MessageTypes[2]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DefinedColumnSchema__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DefinedColumnSchema__Descriptor, + new string[] { "Name", "Type", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_PartitionRange__Descriptor = Descriptor.MessageTypes[3]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_PartitionRange__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_PartitionRange__Descriptor, + new string[] { "Begin", "End", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_TableOptions__Descriptor = Descriptor.MessageTypes[4]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_TableOptions__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_TableOptions__Descriptor, + new string[] { "TimeToLive", "MaxVersions", "BloomFilterType", "BlockSize", "DeviationCellVersionInSec", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexMeta__Descriptor = Descriptor.MessageTypes[5]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexMeta__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexMeta__Descriptor, + new string[] { "Name", "PrimaryKey", "DefinedColumn", "IndexUpdateMode", "IndexType", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_TableMeta__Descriptor = Descriptor.MessageTypes[6]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_TableMeta__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_TableMeta__Descriptor, + new string[] { "TableName", "PrimaryKey", "DefinedColumn", "IndexMeta", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_Condition__Descriptor = Descriptor.MessageTypes[7]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_Condition__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_Condition__Descriptor, + new string[] { "RowExistence", "ColumnCondition", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_CapacityUnit__Descriptor = Descriptor.MessageTypes[8]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_CapacityUnit__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_CapacityUnit__Descriptor, + new string[] { "Read", "Write", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughputDetails__Descriptor = Descriptor.MessageTypes[9]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughputDetails__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughputDetails__Descriptor, + new string[] { "CapacityUnit", "LastIncreaseTime", "LastDecreaseTime", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughput__Descriptor = Descriptor.MessageTypes[10]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughput__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughput__Descriptor, + new string[] { "CapacityUnit", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ConsumedCapacity__Descriptor = Descriptor.MessageTypes[11]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ConsumedCapacity__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ConsumedCapacity__Descriptor, + new string[] { "CapacityUnit", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamSpecification__Descriptor = Descriptor.MessageTypes[12]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamSpecification__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamSpecification__Descriptor, + new string[] { "EnableStream", "ExpirationTime", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamDetails__Descriptor = Descriptor.MessageTypes[13]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamDetails__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamDetails__Descriptor, + new string[] { "EnableStream", "StreamId", "ExpirationTime", "LastEnableTime", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableRequest__Descriptor = Descriptor.MessageTypes[14]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableRequest__Descriptor, + new string[] { "TableMeta", "ReservedThroughput", "TableOptions", "Partitions", "StreamSpec", "IndexMetas", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableResponse__Descriptor = Descriptor.MessageTypes[15]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableResponse__Descriptor, + new string[] { }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexRequest__Descriptor = Descriptor.MessageTypes[16]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexRequest__Descriptor, + new string[] { "MainTableName", "IndexMeta", "IncludeBaseData", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexResponse__Descriptor = Descriptor.MessageTypes[17]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexResponse__Descriptor, + new string[] { }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexRequest__Descriptor = Descriptor.MessageTypes[18]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexRequest__Descriptor, + new string[] { "MainTableName", "IndexName", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexResponse__Descriptor = Descriptor.MessageTypes[19]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexResponse__Descriptor, + new string[] { }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableRequest__Descriptor = Descriptor.MessageTypes[20]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableRequest__Descriptor, + new string[] { "TableName", "ReservedThroughput", "TableOptions", "StreamSpec", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableResponse__Descriptor = Descriptor.MessageTypes[21]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableResponse__Descriptor, + new string[] { "ReservedThroughputDetails", "TableOptions", "StreamDetails", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableRequest__Descriptor = Descriptor.MessageTypes[22]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableRequest__Descriptor, + new string[] { "TableName", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableResponse__Descriptor = Descriptor.MessageTypes[23]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableResponse__Descriptor, + new string[] { "TableMeta", "ReservedThroughputDetails", "TableOptions", "TableStatus", "StreamDetails", "ShardSplits", "IndexMetas", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableRequest__Descriptor = Descriptor.MessageTypes[24]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableRequest__Descriptor, + new string[] { }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableResponse__Descriptor = Descriptor.MessageTypes[25]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableResponse__Descriptor, + new string[] { "TableNames", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableRequest__Descriptor = Descriptor.MessageTypes[26]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableRequest__Descriptor, + new string[] { "TableName", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableResponse__Descriptor = Descriptor.MessageTypes[27]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableResponse__Descriptor, + new string[] { }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableRequest__Descriptor = Descriptor.MessageTypes[28]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableRequest__Descriptor, + new string[] { "TableName", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableResponse__Descriptor = Descriptor.MessageTypes[29]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableResponse__Descriptor, + new string[] { }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableRequest__Descriptor = Descriptor.MessageTypes[30]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableRequest__Descriptor, + new string[] { "TableName", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableResponse__Descriptor = Descriptor.MessageTypes[31]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableResponse__Descriptor, + new string[] { }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_TimeRange__Descriptor = Descriptor.MessageTypes[32]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_TimeRange__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_TimeRange__Descriptor, + new string[] { "StartTime", "EndTime", "SpecificTime", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ReturnContent__Descriptor = Descriptor.MessageTypes[33]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ReturnContent__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ReturnContent__Descriptor, + new string[] { "ReturnType", "ReturnColumnNames", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowRequest__Descriptor = Descriptor.MessageTypes[34]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowRequest__Descriptor, + new string[] { "TableName", "PrimaryKey", "ColumnsToGet", "TimeRange", "MaxVersions", "CacheBlocks", "Filter", "StartColumn", "EndColumn", "Token", "TransactionId", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowResponse__Descriptor = Descriptor.MessageTypes[35]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowResponse__Descriptor, + new string[] { "Consumed", "Row", "NextToken", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowRequest__Descriptor = Descriptor.MessageTypes[36]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowRequest__Descriptor, + new string[] { "TableName", "RowChange", "Condition", "ReturnContent", "TransactionId", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowResponse__Descriptor = Descriptor.MessageTypes[37]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowResponse__Descriptor, + new string[] { "Consumed", "Row", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowRequest__Descriptor = Descriptor.MessageTypes[38]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowRequest__Descriptor, + new string[] { "TableName", "Row", "Condition", "ReturnContent", "TransactionId", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowResponse__Descriptor = Descriptor.MessageTypes[39]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowResponse__Descriptor, + new string[] { "Consumed", "Row", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowRequest__Descriptor = Descriptor.MessageTypes[40]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowRequest__Descriptor, + new string[] { "TableName", "PrimaryKey", "Condition", "ReturnContent", "TransactionId", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowResponse__Descriptor = Descriptor.MessageTypes[41]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowResponse__Descriptor, + new string[] { "Consumed", "Row", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowRequest__Descriptor = Descriptor.MessageTypes[42]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowRequest__Descriptor, + new string[] { "TableName", "PrimaryKey", "Token", "ColumnsToGet", "TimeRange", "MaxVersions", "CacheBlocks", "Filter", "StartColumn", "EndColumn", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowRequest__Descriptor = Descriptor.MessageTypes[43]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowRequest__Descriptor, + new string[] { "Tables", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchGetRowResponse__Descriptor = Descriptor.MessageTypes[44]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchGetRowResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchGetRowResponse__Descriptor, + new string[] { "IsOk", "Error", "Consumed", "Row", "NextToken", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowResponse__Descriptor = Descriptor.MessageTypes[45]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowResponse__Descriptor, + new string[] { "TableName", "Rows", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowResponse__Descriptor = Descriptor.MessageTypes[46]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowResponse__Descriptor, + new string[] { "Tables", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowRequest__Descriptor = Descriptor.MessageTypes[47]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowRequest__Descriptor, + new string[] { "Type", "RowChange", "Condition", "ReturnContent", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowRequest__Descriptor = Descriptor.MessageTypes[48]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowRequest__Descriptor, + new string[] { "TableName", "Rows", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowRequest__Descriptor = Descriptor.MessageTypes[49]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowRequest__Descriptor, + new string[] { "Tables", "TransactionId", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowResponse__Descriptor = Descriptor.MessageTypes[50]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowResponse__Descriptor, + new string[] { "IsOk", "Error", "Consumed", "Row", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowResponse__Descriptor = Descriptor.MessageTypes[51]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowResponse__Descriptor, + new string[] { "TableName", "Rows", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowResponse__Descriptor = Descriptor.MessageTypes[52]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowResponse__Descriptor, + new string[] { "Tables", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeRequest__Descriptor = Descriptor.MessageTypes[53]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeRequest__Descriptor, + new string[] { "TableName", "Direction", "ColumnsToGet", "TimeRange", "MaxVersions", "Limit", "InclusiveStartPrimaryKey", "ExclusiveEndPrimaryKey", "CacheBlocks", "Filter", "StartColumn", "EndColumn", "Token", "TransactionId", "DataBlockTypeHint", "ReturnEntirePrimaryKeys", "CompressTypeHint", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeResponse__Descriptor = Descriptor.MessageTypes[54]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeResponse__Descriptor, + new string[] { "Consumed", "Rows", "NextStartPrimaryKey", "NextToken", "DataBlockType", "CompressType", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionRequest__Descriptor = Descriptor.MessageTypes[55]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionRequest__Descriptor, + new string[] { "TableName", "Key", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionResponse__Descriptor = Descriptor.MessageTypes[56]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionResponse__Descriptor, + new string[] { "TransactionId", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionRequest__Descriptor = Descriptor.MessageTypes[57]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionRequest__Descriptor, + new string[] { "TransactionId", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionResponse__Descriptor = Descriptor.MessageTypes[58]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionResponse__Descriptor, + new string[] { }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionRequest__Descriptor = Descriptor.MessageTypes[59]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionRequest__Descriptor, + new string[] { "TransactionId", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionResponse__Descriptor = Descriptor.MessageTypes[60]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionResponse__Descriptor, + new string[] { }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamRequest__Descriptor = Descriptor.MessageTypes[61]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamRequest__Descriptor, + new string[] { "TableName", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_Stream__Descriptor = Descriptor.MessageTypes[62]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_Stream__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_Stream__Descriptor, + new string[] { "StreamId", "TableName", "CreationTime", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamResponse__Descriptor = Descriptor.MessageTypes[63]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamResponse__Descriptor, + new string[] { "Streams", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamShard__Descriptor = Descriptor.MessageTypes[64]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamShard__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamShard__Descriptor, + new string[] { "ShardId", "ParentId", "ParentSiblingId", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamRequest__Descriptor = Descriptor.MessageTypes[65]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamRequest__Descriptor, + new string[] { "StreamId", "InclusiveStartShardId", "ShardLimit", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamResponse__Descriptor = Descriptor.MessageTypes[66]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamResponse__Descriptor, + new string[] { "StreamId", "ExpirationTime", "TableName", "CreationTime", "StreamStatus", "Shards", "NextShardId", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorRequest__Descriptor = Descriptor.MessageTypes[67]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorRequest__Descriptor, + new string[] { "StreamId", "ShardId", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorResponse__Descriptor = Descriptor.MessageTypes[68]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorResponse__Descriptor, + new string[] { "ShardIterator", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordRequest__Descriptor = Descriptor.MessageTypes[69]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordRequest__Descriptor, + new string[] { "ShardIterator", "Limit", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse__Descriptor = Descriptor.MessageTypes[70]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse__Descriptor, + new string[] { "StreamRecords", "NextShardIterator", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse_StreamRecord__Descriptor = internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse__Descriptor.NestedTypes[0]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse_StreamRecord__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse_StreamRecord__Descriptor, + new string[] { "ActionType", "Record", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeRequest__Descriptor = Descriptor.MessageTypes[71]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeRequest__Descriptor, + new string[] { "TableName", "SplitSize", "SplitSizeUnitInByte", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse__Descriptor = Descriptor.MessageTypes[72]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse__Descriptor, + new string[] { "Consumed", "Schema", "SplitPoints", "Locations", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse_SplitLocation__Descriptor = internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse__Descriptor.NestedTypes[0]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse_SplitLocation__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse_SplitLocation__Descriptor, + new string[] { "Location", "Repeat", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + #region Enums + public enum PrimaryKeyType { + INTEGER = 1, + STRING = 2, + BINARY = 3, + } + + public enum DefinedColumnType { + DCT_INTEGER = 1, + DCT_DOUBLE = 2, + DCT_BOOLEAN = 3, + DCT_STRING = 4, + DCT_BLOB = 7, + } + + public enum PrimaryKeyOption { + AUTO_INCREMENT = 1, + } + + public enum BloomFilterType { + NONE = 1, + CELL = 2, + ROW = 3, + } + + public enum DataBlockType { + DBT_PLAIN_BUFFER = 0, + DBT_SIMPLE_ROW_MATRIX = 1, + } + + public enum CompressType { + CPT_NONE = 0, + } + + public enum IndexUpdateMode { + IUM_ASYNC_INDEX = 0, + IUM_SYNC_INDEX = 1, + } + + public enum IndexType { + IT_GLOBAL_INDEX = 0, + IT_LOCAL_INDEX = 1, + } + + public enum TableStatus { + ACTIVE = 1, + INACTIVE = 2, + LOADING = 3, + UNLOADING = 4, + UPDATING = 5, + } + + public enum RowExistenceExpectation { + IGNORE = 0, + EXPECT_EXIST = 1, + EXPECT_NOT_EXIST = 2, + } + + public enum ReturnType { + RT_NONE = 0, + RT_PK = 1, + RT_AFTER_MODIFY = 2, + } + + public enum OperationType { + PUT = 1, + UPDATE = 2, + DELETE = 3, + } + + public enum Direction { + FORWARD = 0, + BACKWARD = 1, + } + + public enum StreamStatus { + STREAM_ENABLING = 1, + STREAM_ACTIVE = 2, + } + + public enum ActionType { + PUT_ROW = 1, + UPDATE_ROW = 2, + DELETE_ROW = 3, + } + + #endregion + + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Error : pb::GeneratedMessage { + private Error() { } + private static readonly Error defaultInstance = new Error().MakeReadOnly(); + private static readonly string[] _errorFieldNames = new string[] { "code", "message" }; + private static readonly uint[] _errorFieldTags = new uint[] { 10, 18 }; + public static Error DefaultInstance { + get { return defaultInstance; } + } + + public override Error DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Error ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_Error__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_Error__FieldAccessorTable; } + } + + public const int CodeFieldNumber = 1; + private bool hasCode; + private string code_ = ""; + public bool HasCode { + get { return hasCode; } + } + public string Code { + get { return code_; } + } + + public const int MessageFieldNumber = 2; + private bool hasMessage; + private string message_ = ""; + public bool HasMessage { + get { return hasMessage; } + } + public string Message { + get { return message_; } + } + + public override bool IsInitialized { + get { + if (!hasCode) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _errorFieldNames; + if (hasCode) { + output.WriteString(1, field_names[0], Code); + } + if (hasMessage) { + output.WriteString(2, field_names[1], Message); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCode) { + size += pb::CodedOutputStream.ComputeStringSize(1, Code); + } + if (hasMessage) { + size += pb::CodedOutputStream.ComputeStringSize(2, Message); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static Error ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Error ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Error ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Error ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Error ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Error ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Error ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Error ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Error ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Error ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Error MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Error prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Error cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Error result; + + private Error PrepareBuilder() { + if (resultIsReadOnly) { + Error original = result; + result = new Error(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Error MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Error.Descriptor; } + } + + public override Error DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Error.DefaultInstance; } + } + + public override Error BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Error) { + return MergeFrom((Error) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Error other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.Error.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCode) { + Code = other.Code; + } + if (other.HasMessage) { + Message = other.Message; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_errorFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _errorFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasCode = input.ReadString(ref result.code_); + break; + } + case 18: { + result.hasMessage = input.ReadString(ref result.message_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCode { + get { return result.hasCode; } + } + public string Code { + get { return result.Code; } + set { SetCode(value); } + } + public Builder SetCode(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCode = true; + result.code_ = value; + return this; + } + public Builder ClearCode() { + PrepareBuilder(); + result.hasCode = false; + result.code_ = ""; + return this; + } + + public bool HasMessage { + get { return result.hasMessage; } + } + public string Message { + get { return result.Message; } + set { SetMessage(value); } + } + public Builder SetMessage(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasMessage = true; + result.message_ = value; + return this; + } + public Builder ClearMessage() { + PrepareBuilder(); + result.hasMessage = false; + result.message_ = ""; + return this; + } + } + static Error() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class PrimaryKeySchema : pb::GeneratedMessage { + private PrimaryKeySchema() { } + private static readonly PrimaryKeySchema defaultInstance = new PrimaryKeySchema().MakeReadOnly(); + private static readonly string[] _primaryKeySchemaFieldNames = new string[] { "name", "option", "type" }; + private static readonly uint[] _primaryKeySchemaFieldTags = new uint[] { 10, 24, 16 }; + public static PrimaryKeySchema DefaultInstance { + get { return defaultInstance; } + } + + public override PrimaryKeySchema DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PrimaryKeySchema ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySchema__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySchema__FieldAccessorTable; } + } + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int TypeFieldNumber = 2; + private bool hasType; + private global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeyType type_ = global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeyType.INTEGER; + public bool HasType { + get { return hasType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeyType Type { + get { return type_; } + } + + public const int OptionFieldNumber = 3; + private bool hasOption; + private global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeyOption option_ = global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeyOption.AUTO_INCREMENT; + public bool HasOption { + get { return hasOption; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeyOption Option { + get { return option_; } + } + + public override bool IsInitialized { + get { + if (!hasName) return false; + if (!hasType) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _primaryKeySchemaFieldNames; + if (hasName) { + output.WriteString(1, field_names[0], Name); + } + if (hasType) { + output.WriteEnum(2, field_names[2], (int) Type, Type); + } + if (hasOption) { + output.WriteEnum(3, field_names[1], (int) Option, Option); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + if (hasType) { + size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Type); + } + if (hasOption) { + size += pb::CodedOutputStream.ComputeEnumSize(3, (int) Option); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static PrimaryKeySchema ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PrimaryKeySchema ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PrimaryKeySchema ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PrimaryKeySchema ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PrimaryKeySchema ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PrimaryKeySchema ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PrimaryKeySchema ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PrimaryKeySchema ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PrimaryKeySchema ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PrimaryKeySchema ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PrimaryKeySchema MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PrimaryKeySchema prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PrimaryKeySchema cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PrimaryKeySchema result; + + private PrimaryKeySchema PrepareBuilder() { + if (resultIsReadOnly) { + PrimaryKeySchema original = result; + result = new PrimaryKeySchema(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PrimaryKeySchema MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema.Descriptor; } + } + + public override PrimaryKeySchema DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema.DefaultInstance; } + } + + public override PrimaryKeySchema BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PrimaryKeySchema) { + return MergeFrom((PrimaryKeySchema) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PrimaryKeySchema other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + if (other.HasType) { + Type = other.Type; + } + if (other.HasOption) { + Option = other.Option; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_primaryKeySchemaFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _primaryKeySchemaFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 16: { + object unknown; + if(input.ReadEnum(ref result.type_, out unknown)) { + result.hasType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(2, (ulong)(int)unknown); + } + break; + } + case 24: { + object unknown; + if(input.ReadEnum(ref result.option_, out unknown)) { + result.hasOption = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(3, (ulong)(int)unknown); + } + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public bool HasType { + get { return result.hasType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeyType Type { + get { return result.Type; } + set { SetType(value); } + } + public Builder SetType(global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeyType value) { + PrepareBuilder(); + result.hasType = true; + result.type_ = value; + return this; + } + public Builder ClearType() { + PrepareBuilder(); + result.hasType = false; + result.type_ = global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeyType.INTEGER; + return this; + } + + public bool HasOption { + get { return result.hasOption; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeyOption Option { + get { return result.Option; } + set { SetOption(value); } + } + public Builder SetOption(global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeyOption value) { + PrepareBuilder(); + result.hasOption = true; + result.option_ = value; + return this; + } + public Builder ClearOption() { + PrepareBuilder(); + result.hasOption = false; + result.option_ = global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeyOption.AUTO_INCREMENT; + return this; + } + } + static PrimaryKeySchema() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DefinedColumnSchema : pb::GeneratedMessage { + private DefinedColumnSchema() { } + private static readonly DefinedColumnSchema defaultInstance = new DefinedColumnSchema().MakeReadOnly(); + private static readonly string[] _definedColumnSchemaFieldNames = new string[] { "name", "type" }; + private static readonly uint[] _definedColumnSchemaFieldTags = new uint[] { 10, 16 }; + public static DefinedColumnSchema DefaultInstance { + get { return defaultInstance; } + } + + public override DefinedColumnSchema DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DefinedColumnSchema ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DefinedColumnSchema__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DefinedColumnSchema__FieldAccessorTable; } + } + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int TypeFieldNumber = 2; + private bool hasType; + private global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnType type_ = global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnType.DCT_INTEGER; + public bool HasType { + get { return hasType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnType Type { + get { return type_; } + } + + public override bool IsInitialized { + get { + if (!hasName) return false; + if (!hasType) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _definedColumnSchemaFieldNames; + if (hasName) { + output.WriteString(1, field_names[0], Name); + } + if (hasType) { + output.WriteEnum(2, field_names[1], (int) Type, Type); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + if (hasType) { + size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Type); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DefinedColumnSchema ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DefinedColumnSchema ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DefinedColumnSchema ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DefinedColumnSchema ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DefinedColumnSchema ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DefinedColumnSchema ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DefinedColumnSchema ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DefinedColumnSchema ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DefinedColumnSchema ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DefinedColumnSchema ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DefinedColumnSchema MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DefinedColumnSchema prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DefinedColumnSchema cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DefinedColumnSchema result; + + private DefinedColumnSchema PrepareBuilder() { + if (resultIsReadOnly) { + DefinedColumnSchema original = result; + result = new DefinedColumnSchema(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DefinedColumnSchema MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnSchema.Descriptor; } + } + + public override DefinedColumnSchema DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnSchema.DefaultInstance; } + } + + public override DefinedColumnSchema BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DefinedColumnSchema) { + return MergeFrom((DefinedColumnSchema) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DefinedColumnSchema other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnSchema.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + if (other.HasType) { + Type = other.Type; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_definedColumnSchemaFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _definedColumnSchemaFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 16: { + object unknown; + if(input.ReadEnum(ref result.type_, out unknown)) { + result.hasType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(2, (ulong)(int)unknown); + } + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public bool HasType { + get { return result.hasType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnType Type { + get { return result.Type; } + set { SetType(value); } + } + public Builder SetType(global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnType value) { + PrepareBuilder(); + result.hasType = true; + result.type_ = value; + return this; + } + public Builder ClearType() { + PrepareBuilder(); + result.hasType = false; + result.type_ = global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnType.DCT_INTEGER; + return this; + } + } + static DefinedColumnSchema() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class PartitionRange : pb::GeneratedMessage { + private PartitionRange() { } + private static readonly PartitionRange defaultInstance = new PartitionRange().MakeReadOnly(); + private static readonly string[] _partitionRangeFieldNames = new string[] { "begin", "end" }; + private static readonly uint[] _partitionRangeFieldTags = new uint[] { 10, 18 }; + public static PartitionRange DefaultInstance { + get { return defaultInstance; } + } + + public override PartitionRange DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PartitionRange ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_PartitionRange__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_PartitionRange__FieldAccessorTable; } + } + + public const int BeginFieldNumber = 1; + private bool hasBegin; + private pb::ByteString begin_ = pb::ByteString.Empty; + public bool HasBegin { + get { return hasBegin; } + } + public pb::ByteString Begin { + get { return begin_; } + } + + public const int EndFieldNumber = 2; + private bool hasEnd; + private pb::ByteString end_ = pb::ByteString.Empty; + public bool HasEnd { + get { return hasEnd; } + } + public pb::ByteString End { + get { return end_; } + } + + public override bool IsInitialized { + get { + if (!hasBegin) return false; + if (!hasEnd) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _partitionRangeFieldNames; + if (hasBegin) { + output.WriteBytes(1, field_names[0], Begin); + } + if (hasEnd) { + output.WriteBytes(2, field_names[1], End); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasBegin) { + size += pb::CodedOutputStream.ComputeBytesSize(1, Begin); + } + if (hasEnd) { + size += pb::CodedOutputStream.ComputeBytesSize(2, End); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static PartitionRange ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PartitionRange ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PartitionRange ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PartitionRange ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PartitionRange ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PartitionRange ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PartitionRange ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PartitionRange ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PartitionRange ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PartitionRange ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PartitionRange MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PartitionRange prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PartitionRange cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PartitionRange result; + + private PartitionRange PrepareBuilder() { + if (resultIsReadOnly) { + PartitionRange original = result; + result = new PartitionRange(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PartitionRange MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.PartitionRange.Descriptor; } + } + + public override PartitionRange DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.PartitionRange.DefaultInstance; } + } + + public override PartitionRange BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PartitionRange) { + return MergeFrom((PartitionRange) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PartitionRange other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.PartitionRange.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasBegin) { + Begin = other.Begin; + } + if (other.HasEnd) { + End = other.End; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_partitionRangeFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _partitionRangeFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasBegin = input.ReadBytes(ref result.begin_); + break; + } + case 18: { + result.hasEnd = input.ReadBytes(ref result.end_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasBegin { + get { return result.hasBegin; } + } + public pb::ByteString Begin { + get { return result.Begin; } + set { SetBegin(value); } + } + public Builder SetBegin(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBegin = true; + result.begin_ = value; + return this; + } + public Builder ClearBegin() { + PrepareBuilder(); + result.hasBegin = false; + result.begin_ = pb::ByteString.Empty; + return this; + } + + public bool HasEnd { + get { return result.hasEnd; } + } + public pb::ByteString End { + get { return result.End; } + set { SetEnd(value); } + } + public Builder SetEnd(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEnd = true; + result.end_ = value; + return this; + } + public Builder ClearEnd() { + PrepareBuilder(); + result.hasEnd = false; + result.end_ = pb::ByteString.Empty; + return this; + } + } + static PartitionRange() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TableOptions : pb::GeneratedMessage { + private TableOptions() { } + private static readonly TableOptions defaultInstance = new TableOptions().MakeReadOnly(); + private static readonly string[] _tableOptionsFieldNames = new string[] { "block_size", "bloom_filter_type", "deviation_cell_version_in_sec", "max_versions", "time_to_live" }; + private static readonly uint[] _tableOptionsFieldTags = new uint[] { 32, 24, 40, 16, 8 }; + public static TableOptions DefaultInstance { + get { return defaultInstance; } + } + + public override TableOptions DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TableOptions ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TableOptions__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TableOptions__FieldAccessorTable; } + } + + public const int TimeToLiveFieldNumber = 1; + private bool hasTimeToLive; + private int timeToLive_; + public bool HasTimeToLive { + get { return hasTimeToLive; } + } + public int TimeToLive { + get { return timeToLive_; } + } + + public const int MaxVersionsFieldNumber = 2; + private bool hasMaxVersions; + private int maxVersions_; + public bool HasMaxVersions { + get { return hasMaxVersions; } + } + public int MaxVersions { + get { return maxVersions_; } + } + + public const int BloomFilterTypeFieldNumber = 3; + private bool hasBloomFilterType; + private global::com.alicloud.openservices.tablestore.core.protocol.BloomFilterType bloomFilterType_ = global::com.alicloud.openservices.tablestore.core.protocol.BloomFilterType.NONE; + public bool HasBloomFilterType { + get { return hasBloomFilterType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.BloomFilterType BloomFilterType { + get { return bloomFilterType_; } + } + + public const int BlockSizeFieldNumber = 4; + private bool hasBlockSize; + private int blockSize_; + public bool HasBlockSize { + get { return hasBlockSize; } + } + public int BlockSize { + get { return blockSize_; } + } + + public const int DeviationCellVersionInSecFieldNumber = 5; + private bool hasDeviationCellVersionInSec; + private long deviationCellVersionInSec_; + public bool HasDeviationCellVersionInSec { + get { return hasDeviationCellVersionInSec; } + } + public long DeviationCellVersionInSec { + get { return deviationCellVersionInSec_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _tableOptionsFieldNames; + if (hasTimeToLive) { + output.WriteInt32(1, field_names[4], TimeToLive); + } + if (hasMaxVersions) { + output.WriteInt32(2, field_names[3], MaxVersions); + } + if (hasBloomFilterType) { + output.WriteEnum(3, field_names[1], (int) BloomFilterType, BloomFilterType); + } + if (hasBlockSize) { + output.WriteInt32(4, field_names[0], BlockSize); + } + if (hasDeviationCellVersionInSec) { + output.WriteInt64(5, field_names[2], DeviationCellVersionInSec); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTimeToLive) { + size += pb::CodedOutputStream.ComputeInt32Size(1, TimeToLive); + } + if (hasMaxVersions) { + size += pb::CodedOutputStream.ComputeInt32Size(2, MaxVersions); + } + if (hasBloomFilterType) { + size += pb::CodedOutputStream.ComputeEnumSize(3, (int) BloomFilterType); + } + if (hasBlockSize) { + size += pb::CodedOutputStream.ComputeInt32Size(4, BlockSize); + } + if (hasDeviationCellVersionInSec) { + size += pb::CodedOutputStream.ComputeInt64Size(5, DeviationCellVersionInSec); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TableOptions ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TableOptions ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TableOptions ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TableOptions ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TableOptions ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TableOptions ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TableOptions ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TableOptions ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TableOptions ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TableOptions ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TableOptions MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TableOptions prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TableOptions cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TableOptions result; + + private TableOptions PrepareBuilder() { + if (resultIsReadOnly) { + TableOptions original = result; + result = new TableOptions(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TableOptions MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.Descriptor; } + } + + public override TableOptions DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.DefaultInstance; } + } + + public override TableOptions BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TableOptions) { + return MergeFrom((TableOptions) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TableOptions other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTimeToLive) { + TimeToLive = other.TimeToLive; + } + if (other.HasMaxVersions) { + MaxVersions = other.MaxVersions; + } + if (other.HasBloomFilterType) { + BloomFilterType = other.BloomFilterType; + } + if (other.HasBlockSize) { + BlockSize = other.BlockSize; + } + if (other.HasDeviationCellVersionInSec) { + DeviationCellVersionInSec = other.DeviationCellVersionInSec; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_tableOptionsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _tableOptionsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasTimeToLive = input.ReadInt32(ref result.timeToLive_); + break; + } + case 16: { + result.hasMaxVersions = input.ReadInt32(ref result.maxVersions_); + break; + } + case 24: { + object unknown; + if(input.ReadEnum(ref result.bloomFilterType_, out unknown)) { + result.hasBloomFilterType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(3, (ulong)(int)unknown); + } + break; + } + case 32: { + result.hasBlockSize = input.ReadInt32(ref result.blockSize_); + break; + } + case 40: { + result.hasDeviationCellVersionInSec = input.ReadInt64(ref result.deviationCellVersionInSec_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTimeToLive { + get { return result.hasTimeToLive; } + } + public int TimeToLive { + get { return result.TimeToLive; } + set { SetTimeToLive(value); } + } + public Builder SetTimeToLive(int value) { + PrepareBuilder(); + result.hasTimeToLive = true; + result.timeToLive_ = value; + return this; + } + public Builder ClearTimeToLive() { + PrepareBuilder(); + result.hasTimeToLive = false; + result.timeToLive_ = 0; + return this; + } + + public bool HasMaxVersions { + get { return result.hasMaxVersions; } + } + public int MaxVersions { + get { return result.MaxVersions; } + set { SetMaxVersions(value); } + } + public Builder SetMaxVersions(int value) { + PrepareBuilder(); + result.hasMaxVersions = true; + result.maxVersions_ = value; + return this; + } + public Builder ClearMaxVersions() { + PrepareBuilder(); + result.hasMaxVersions = false; + result.maxVersions_ = 0; + return this; + } + + public bool HasBloomFilterType { + get { return result.hasBloomFilterType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.BloomFilterType BloomFilterType { + get { return result.BloomFilterType; } + set { SetBloomFilterType(value); } + } + public Builder SetBloomFilterType(global::com.alicloud.openservices.tablestore.core.protocol.BloomFilterType value) { + PrepareBuilder(); + result.hasBloomFilterType = true; + result.bloomFilterType_ = value; + return this; + } + public Builder ClearBloomFilterType() { + PrepareBuilder(); + result.hasBloomFilterType = false; + result.bloomFilterType_ = global::com.alicloud.openservices.tablestore.core.protocol.BloomFilterType.NONE; + return this; + } + + public bool HasBlockSize { + get { return result.hasBlockSize; } + } + public int BlockSize { + get { return result.BlockSize; } + set { SetBlockSize(value); } + } + public Builder SetBlockSize(int value) { + PrepareBuilder(); + result.hasBlockSize = true; + result.blockSize_ = value; + return this; + } + public Builder ClearBlockSize() { + PrepareBuilder(); + result.hasBlockSize = false; + result.blockSize_ = 0; + return this; + } + + public bool HasDeviationCellVersionInSec { + get { return result.hasDeviationCellVersionInSec; } + } + public long DeviationCellVersionInSec { + get { return result.DeviationCellVersionInSec; } + set { SetDeviationCellVersionInSec(value); } + } + public Builder SetDeviationCellVersionInSec(long value) { + PrepareBuilder(); + result.hasDeviationCellVersionInSec = true; + result.deviationCellVersionInSec_ = value; + return this; + } + public Builder ClearDeviationCellVersionInSec() { + PrepareBuilder(); + result.hasDeviationCellVersionInSec = false; + result.deviationCellVersionInSec_ = 0L; + return this; + } + } + static TableOptions() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class IndexMeta : pb::GeneratedMessage { + private IndexMeta() { } + private static readonly IndexMeta defaultInstance = new IndexMeta().MakeReadOnly(); + private static readonly string[] _indexMetaFieldNames = new string[] { "defined_column", "index_type", "index_update_mode", "name", "primary_key" }; + private static readonly uint[] _indexMetaFieldTags = new uint[] { 26, 40, 32, 10, 18 }; + public static IndexMeta DefaultInstance { + get { return defaultInstance; } + } + + public override IndexMeta DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override IndexMeta ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexMeta__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexMeta__FieldAccessorTable; } + } + + public const int NameFieldNumber = 1; + private bool hasName; + private string name_ = ""; + public bool HasName { + get { return hasName; } + } + public string Name { + get { return name_; } + } + + public const int PrimaryKeyFieldNumber = 2; + private pbc::PopsicleList primaryKey_ = new pbc::PopsicleList(); + public scg::IList PrimaryKeyList { + get { return pbc::Lists.AsReadOnly(primaryKey_); } + } + public int PrimaryKeyCount { + get { return primaryKey_.Count; } + } + public string GetPrimaryKey(int index) { + return primaryKey_[index]; + } + + public const int DefinedColumnFieldNumber = 3; + private pbc::PopsicleList definedColumn_ = new pbc::PopsicleList(); + public scg::IList DefinedColumnList { + get { return pbc::Lists.AsReadOnly(definedColumn_); } + } + public int DefinedColumnCount { + get { return definedColumn_.Count; } + } + public string GetDefinedColumn(int index) { + return definedColumn_[index]; + } + + public const int IndexUpdateModeFieldNumber = 4; + private bool hasIndexUpdateMode; + private global::com.alicloud.openservices.tablestore.core.protocol.IndexUpdateMode indexUpdateMode_ = global::com.alicloud.openservices.tablestore.core.protocol.IndexUpdateMode.IUM_ASYNC_INDEX; + public bool HasIndexUpdateMode { + get { return hasIndexUpdateMode; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexUpdateMode IndexUpdateMode { + get { return indexUpdateMode_; } + } + + public const int IndexTypeFieldNumber = 5; + private bool hasIndexType; + private global::com.alicloud.openservices.tablestore.core.protocol.IndexType indexType_ = global::com.alicloud.openservices.tablestore.core.protocol.IndexType.IT_GLOBAL_INDEX; + public bool HasIndexType { + get { return hasIndexType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexType IndexType { + get { return indexType_; } + } + + public override bool IsInitialized { + get { + if (!hasName) return false; + if (!hasIndexUpdateMode) return false; + if (!hasIndexType) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _indexMetaFieldNames; + if (hasName) { + output.WriteString(1, field_names[3], Name); + } + if (primaryKey_.Count > 0) { + output.WriteStringArray(2, field_names[4], primaryKey_); + } + if (definedColumn_.Count > 0) { + output.WriteStringArray(3, field_names[0], definedColumn_); + } + if (hasIndexUpdateMode) { + output.WriteEnum(4, field_names[2], (int) IndexUpdateMode, IndexUpdateMode); + } + if (hasIndexType) { + output.WriteEnum(5, field_names[1], (int) IndexType, IndexType); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasName) { + size += pb::CodedOutputStream.ComputeStringSize(1, Name); + } + { + int dataSize = 0; + foreach (string element in PrimaryKeyList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * primaryKey_.Count; + } + { + int dataSize = 0; + foreach (string element in DefinedColumnList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * definedColumn_.Count; + } + if (hasIndexUpdateMode) { + size += pb::CodedOutputStream.ComputeEnumSize(4, (int) IndexUpdateMode); + } + if (hasIndexType) { + size += pb::CodedOutputStream.ComputeEnumSize(5, (int) IndexType); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static IndexMeta ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static IndexMeta ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static IndexMeta ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static IndexMeta ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static IndexMeta ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static IndexMeta ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static IndexMeta ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static IndexMeta ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static IndexMeta ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static IndexMeta ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private IndexMeta MakeReadOnly() { + primaryKey_.MakeReadOnly(); + definedColumn_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(IndexMeta prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(IndexMeta cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private IndexMeta result; + + private IndexMeta PrepareBuilder() { + if (resultIsReadOnly) { + IndexMeta original = result; + result = new IndexMeta(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override IndexMeta MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.Descriptor; } + } + + public override IndexMeta DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.DefaultInstance; } + } + + public override IndexMeta BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is IndexMeta) { + return MergeFrom((IndexMeta) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(IndexMeta other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasName) { + Name = other.Name; + } + if (other.primaryKey_.Count != 0) { + result.primaryKey_.Add(other.primaryKey_); + } + if (other.definedColumn_.Count != 0) { + result.definedColumn_.Add(other.definedColumn_); + } + if (other.HasIndexUpdateMode) { + IndexUpdateMode = other.IndexUpdateMode; + } + if (other.HasIndexType) { + IndexType = other.IndexType; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_indexMetaFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _indexMetaFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasName = input.ReadString(ref result.name_); + break; + } + case 18: { + input.ReadStringArray(tag, field_name, result.primaryKey_); + break; + } + case 26: { + input.ReadStringArray(tag, field_name, result.definedColumn_); + break; + } + case 32: { + object unknown; + if(input.ReadEnum(ref result.indexUpdateMode_, out unknown)) { + result.hasIndexUpdateMode = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(4, (ulong)(int)unknown); + } + break; + } + case 40: { + object unknown; + if(input.ReadEnum(ref result.indexType_, out unknown)) { + result.hasIndexType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(5, (ulong)(int)unknown); + } + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasName { + get { return result.hasName; } + } + public string Name { + get { return result.Name; } + set { SetName(value); } + } + public Builder SetName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasName = true; + result.name_ = value; + return this; + } + public Builder ClearName() { + PrepareBuilder(); + result.hasName = false; + result.name_ = ""; + return this; + } + + public pbc::IPopsicleList PrimaryKeyList { + get { return PrepareBuilder().primaryKey_; } + } + public int PrimaryKeyCount { + get { return result.PrimaryKeyCount; } + } + public string GetPrimaryKey(int index) { + return result.GetPrimaryKey(index); + } + public Builder SetPrimaryKey(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.primaryKey_[index] = value; + return this; + } + public Builder AddPrimaryKey(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.primaryKey_.Add(value); + return this; + } + public Builder AddRangePrimaryKey(scg::IEnumerable values) { + PrepareBuilder(); + result.primaryKey_.Add(values); + return this; + } + public Builder ClearPrimaryKey() { + PrepareBuilder(); + result.primaryKey_.Clear(); + return this; + } + + public pbc::IPopsicleList DefinedColumnList { + get { return PrepareBuilder().definedColumn_; } + } + public int DefinedColumnCount { + get { return result.DefinedColumnCount; } + } + public string GetDefinedColumn(int index) { + return result.GetDefinedColumn(index); + } + public Builder SetDefinedColumn(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.definedColumn_[index] = value; + return this; + } + public Builder AddDefinedColumn(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.definedColumn_.Add(value); + return this; + } + public Builder AddRangeDefinedColumn(scg::IEnumerable values) { + PrepareBuilder(); + result.definedColumn_.Add(values); + return this; + } + public Builder ClearDefinedColumn() { + PrepareBuilder(); + result.definedColumn_.Clear(); + return this; + } + + public bool HasIndexUpdateMode { + get { return result.hasIndexUpdateMode; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexUpdateMode IndexUpdateMode { + get { return result.IndexUpdateMode; } + set { SetIndexUpdateMode(value); } + } + public Builder SetIndexUpdateMode(global::com.alicloud.openservices.tablestore.core.protocol.IndexUpdateMode value) { + PrepareBuilder(); + result.hasIndexUpdateMode = true; + result.indexUpdateMode_ = value; + return this; + } + public Builder ClearIndexUpdateMode() { + PrepareBuilder(); + result.hasIndexUpdateMode = false; + result.indexUpdateMode_ = global::com.alicloud.openservices.tablestore.core.protocol.IndexUpdateMode.IUM_ASYNC_INDEX; + return this; + } + + public bool HasIndexType { + get { return result.hasIndexType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexType IndexType { + get { return result.IndexType; } + set { SetIndexType(value); } + } + public Builder SetIndexType(global::com.alicloud.openservices.tablestore.core.protocol.IndexType value) { + PrepareBuilder(); + result.hasIndexType = true; + result.indexType_ = value; + return this; + } + public Builder ClearIndexType() { + PrepareBuilder(); + result.hasIndexType = false; + result.indexType_ = global::com.alicloud.openservices.tablestore.core.protocol.IndexType.IT_GLOBAL_INDEX; + return this; + } + } + static IndexMeta() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TableMeta : pb::GeneratedMessage { + private TableMeta() { } + private static readonly TableMeta defaultInstance = new TableMeta().MakeReadOnly(); + private static readonly string[] _tableMetaFieldNames = new string[] { "defined_column", "index_meta", "primary_key", "table_name" }; + private static readonly uint[] _tableMetaFieldTags = new uint[] { 26, 34, 18, 10 }; + public static TableMeta DefaultInstance { + get { return defaultInstance; } + } + + public override TableMeta DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TableMeta ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TableMeta__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TableMeta__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int PrimaryKeyFieldNumber = 2; + private pbc::PopsicleList primaryKey_ = new pbc::PopsicleList(); + public scg::IList PrimaryKeyList { + get { return primaryKey_; } + } + public int PrimaryKeyCount { + get { return primaryKey_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema GetPrimaryKey(int index) { + return primaryKey_[index]; + } + + public const int DefinedColumnFieldNumber = 3; + private pbc::PopsicleList definedColumn_ = new pbc::PopsicleList(); + public scg::IList DefinedColumnList { + get { return definedColumn_; } + } + public int DefinedColumnCount { + get { return definedColumn_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnSchema GetDefinedColumn(int index) { + return definedColumn_[index]; + } + + public const int IndexMetaFieldNumber = 4; + private pbc::PopsicleList indexMeta_ = new pbc::PopsicleList(); + public scg::IList IndexMetaList { + get { return indexMeta_; } + } + public int IndexMetaCount { + get { return indexMeta_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta GetIndexMeta(int index) { + return indexMeta_[index]; + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema element in PrimaryKeyList) { + if (!element.IsInitialized) return false; + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnSchema element in DefinedColumnList) { + if (!element.IsInitialized) return false; + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta element in IndexMetaList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _tableMetaFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[3], TableName); + } + if (primaryKey_.Count > 0) { + output.WriteMessageArray(2, field_names[2], primaryKey_); + } + if (definedColumn_.Count > 0) { + output.WriteMessageArray(3, field_names[0], definedColumn_); + } + if (indexMeta_.Count > 0) { + output.WriteMessageArray(4, field_names[1], indexMeta_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema element in PrimaryKeyList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnSchema element in DefinedColumnList) { + size += pb::CodedOutputStream.ComputeMessageSize(3, element); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta element in IndexMetaList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TableMeta ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TableMeta ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TableMeta ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TableMeta ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TableMeta ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TableMeta ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TableMeta ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TableMeta ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TableMeta ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TableMeta ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TableMeta MakeReadOnly() { + primaryKey_.MakeReadOnly(); + definedColumn_.MakeReadOnly(); + indexMeta_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TableMeta prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TableMeta cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TableMeta result; + + private TableMeta PrepareBuilder() { + if (resultIsReadOnly) { + TableMeta original = result; + result = new TableMeta(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TableMeta MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.Descriptor; } + } + + public override TableMeta DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.DefaultInstance; } + } + + public override TableMeta BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TableMeta) { + return MergeFrom((TableMeta) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TableMeta other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.primaryKey_.Count != 0) { + result.primaryKey_.Add(other.primaryKey_); + } + if (other.definedColumn_.Count != 0) { + result.definedColumn_.Add(other.definedColumn_); + } + if (other.indexMeta_.Count != 0) { + result.indexMeta_.Add(other.indexMeta_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_tableMetaFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _tableMetaFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.primaryKey_, global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema.DefaultInstance, extensionRegistry); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.definedColumn_, global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnSchema.DefaultInstance, extensionRegistry); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.indexMeta_, global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public pbc::IPopsicleList PrimaryKeyList { + get { return PrepareBuilder().primaryKey_; } + } + public int PrimaryKeyCount { + get { return result.PrimaryKeyCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema GetPrimaryKey(int index) { + return result.GetPrimaryKey(index); + } + public Builder SetPrimaryKey(int index, global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.primaryKey_[index] = value; + return this; + } + public Builder SetPrimaryKey(int index, global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.primaryKey_[index] = builderForValue.Build(); + return this; + } + public Builder AddPrimaryKey(global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.primaryKey_.Add(value); + return this; + } + public Builder AddPrimaryKey(global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.primaryKey_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangePrimaryKey(scg::IEnumerable values) { + PrepareBuilder(); + result.primaryKey_.Add(values); + return this; + } + public Builder ClearPrimaryKey() { + PrepareBuilder(); + result.primaryKey_.Clear(); + return this; + } + + public pbc::IPopsicleList DefinedColumnList { + get { return PrepareBuilder().definedColumn_; } + } + public int DefinedColumnCount { + get { return result.DefinedColumnCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnSchema GetDefinedColumn(int index) { + return result.GetDefinedColumn(index); + } + public Builder SetDefinedColumn(int index, global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnSchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.definedColumn_[index] = value; + return this; + } + public Builder SetDefinedColumn(int index, global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnSchema.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.definedColumn_[index] = builderForValue.Build(); + return this; + } + public Builder AddDefinedColumn(global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnSchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.definedColumn_.Add(value); + return this; + } + public Builder AddDefinedColumn(global::com.alicloud.openservices.tablestore.core.protocol.DefinedColumnSchema.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.definedColumn_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeDefinedColumn(scg::IEnumerable values) { + PrepareBuilder(); + result.definedColumn_.Add(values); + return this; + } + public Builder ClearDefinedColumn() { + PrepareBuilder(); + result.definedColumn_.Clear(); + return this; + } + + public pbc::IPopsicleList IndexMetaList { + get { return PrepareBuilder().indexMeta_; } + } + public int IndexMetaCount { + get { return result.IndexMetaCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta GetIndexMeta(int index) { + return result.GetIndexMeta(index); + } + public Builder SetIndexMeta(int index, global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.indexMeta_[index] = value; + return this; + } + public Builder SetIndexMeta(int index, global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.indexMeta_[index] = builderForValue.Build(); + return this; + } + public Builder AddIndexMeta(global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.indexMeta_.Add(value); + return this; + } + public Builder AddIndexMeta(global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.indexMeta_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeIndexMeta(scg::IEnumerable values) { + PrepareBuilder(); + result.indexMeta_.Add(values); + return this; + } + public Builder ClearIndexMeta() { + PrepareBuilder(); + result.indexMeta_.Clear(); + return this; + } + } + static TableMeta() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Condition : pb::GeneratedMessage { + private Condition() { } + private static readonly Condition defaultInstance = new Condition().MakeReadOnly(); + private static readonly string[] _conditionFieldNames = new string[] { "column_condition", "row_existence" }; + private static readonly uint[] _conditionFieldTags = new uint[] { 18, 8 }; + public static Condition DefaultInstance { + get { return defaultInstance; } + } + + public override Condition DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Condition ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_Condition__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_Condition__FieldAccessorTable; } + } + + public const int RowExistenceFieldNumber = 1; + private bool hasRowExistence; + private global::com.alicloud.openservices.tablestore.core.protocol.RowExistenceExpectation rowExistence_ = global::com.alicloud.openservices.tablestore.core.protocol.RowExistenceExpectation.IGNORE; + public bool HasRowExistence { + get { return hasRowExistence; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.RowExistenceExpectation RowExistence { + get { return rowExistence_; } + } + + public const int ColumnConditionFieldNumber = 2; + private bool hasColumnCondition; + private pb::ByteString columnCondition_ = pb::ByteString.Empty; + public bool HasColumnCondition { + get { return hasColumnCondition; } + } + public pb::ByteString ColumnCondition { + get { return columnCondition_; } + } + + public override bool IsInitialized { + get { + if (!hasRowExistence) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _conditionFieldNames; + if (hasRowExistence) { + output.WriteEnum(1, field_names[1], (int) RowExistence, RowExistence); + } + if (hasColumnCondition) { + output.WriteBytes(2, field_names[0], ColumnCondition); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasRowExistence) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) RowExistence); + } + if (hasColumnCondition) { + size += pb::CodedOutputStream.ComputeBytesSize(2, ColumnCondition); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static Condition ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Condition ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Condition ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Condition ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Condition ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Condition ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Condition ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Condition ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Condition ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Condition ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Condition MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Condition prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Condition cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Condition result; + + private Condition PrepareBuilder() { + if (resultIsReadOnly) { + Condition original = result; + result = new Condition(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Condition MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Condition.Descriptor; } + } + + public override Condition DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Condition.DefaultInstance; } + } + + public override Condition BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Condition) { + return MergeFrom((Condition) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Condition other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.Condition.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasRowExistence) { + RowExistence = other.RowExistence; + } + if (other.HasColumnCondition) { + ColumnCondition = other.ColumnCondition; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_conditionFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _conditionFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.rowExistence_, out unknown)) { + result.hasRowExistence = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + case 18: { + result.hasColumnCondition = input.ReadBytes(ref result.columnCondition_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasRowExistence { + get { return result.hasRowExistence; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.RowExistenceExpectation RowExistence { + get { return result.RowExistence; } + set { SetRowExistence(value); } + } + public Builder SetRowExistence(global::com.alicloud.openservices.tablestore.core.protocol.RowExistenceExpectation value) { + PrepareBuilder(); + result.hasRowExistence = true; + result.rowExistence_ = value; + return this; + } + public Builder ClearRowExistence() { + PrepareBuilder(); + result.hasRowExistence = false; + result.rowExistence_ = global::com.alicloud.openservices.tablestore.core.protocol.RowExistenceExpectation.IGNORE; + return this; + } + + public bool HasColumnCondition { + get { return result.hasColumnCondition; } + } + public pb::ByteString ColumnCondition { + get { return result.ColumnCondition; } + set { SetColumnCondition(value); } + } + public Builder SetColumnCondition(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasColumnCondition = true; + result.columnCondition_ = value; + return this; + } + public Builder ClearColumnCondition() { + PrepareBuilder(); + result.hasColumnCondition = false; + result.columnCondition_ = pb::ByteString.Empty; + return this; + } + } + static Condition() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class CapacityUnit : pb::GeneratedMessage { + private CapacityUnit() { } + private static readonly CapacityUnit defaultInstance = new CapacityUnit().MakeReadOnly(); + private static readonly string[] _capacityUnitFieldNames = new string[] { "read", "write" }; + private static readonly uint[] _capacityUnitFieldTags = new uint[] { 8, 16 }; + public static CapacityUnit DefaultInstance { + get { return defaultInstance; } + } + + public override CapacityUnit DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CapacityUnit ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CapacityUnit__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CapacityUnit__FieldAccessorTable; } + } + + public const int ReadFieldNumber = 1; + private bool hasRead; + private int read_; + public bool HasRead { + get { return hasRead; } + } + public int Read { + get { return read_; } + } + + public const int WriteFieldNumber = 2; + private bool hasWrite; + private int write_; + public bool HasWrite { + get { return hasWrite; } + } + public int Write { + get { return write_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _capacityUnitFieldNames; + if (hasRead) { + output.WriteInt32(1, field_names[0], Read); + } + if (hasWrite) { + output.WriteInt32(2, field_names[1], Write); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasRead) { + size += pb::CodedOutputStream.ComputeInt32Size(1, Read); + } + if (hasWrite) { + size += pb::CodedOutputStream.ComputeInt32Size(2, Write); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static CapacityUnit ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CapacityUnit ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CapacityUnit ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CapacityUnit ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CapacityUnit ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CapacityUnit ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CapacityUnit ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CapacityUnit ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CapacityUnit ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CapacityUnit ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CapacityUnit MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CapacityUnit prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CapacityUnit cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CapacityUnit result; + + private CapacityUnit PrepareBuilder() { + if (resultIsReadOnly) { + CapacityUnit original = result; + result = new CapacityUnit(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CapacityUnit MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.Descriptor; } + } + + public override CapacityUnit DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.DefaultInstance; } + } + + public override CapacityUnit BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CapacityUnit) { + return MergeFrom((CapacityUnit) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CapacityUnit other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasRead) { + Read = other.Read; + } + if (other.HasWrite) { + Write = other.Write; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_capacityUnitFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _capacityUnitFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasRead = input.ReadInt32(ref result.read_); + break; + } + case 16: { + result.hasWrite = input.ReadInt32(ref result.write_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasRead { + get { return result.hasRead; } + } + public int Read { + get { return result.Read; } + set { SetRead(value); } + } + public Builder SetRead(int value) { + PrepareBuilder(); + result.hasRead = true; + result.read_ = value; + return this; + } + public Builder ClearRead() { + PrepareBuilder(); + result.hasRead = false; + result.read_ = 0; + return this; + } + + public bool HasWrite { + get { return result.hasWrite; } + } + public int Write { + get { return result.Write; } + set { SetWrite(value); } + } + public Builder SetWrite(int value) { + PrepareBuilder(); + result.hasWrite = true; + result.write_ = value; + return this; + } + public Builder ClearWrite() { + PrepareBuilder(); + result.hasWrite = false; + result.write_ = 0; + return this; + } + } + static CapacityUnit() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ReservedThroughputDetails : pb::GeneratedMessage { + private ReservedThroughputDetails() { } + private static readonly ReservedThroughputDetails defaultInstance = new ReservedThroughputDetails().MakeReadOnly(); + private static readonly string[] _reservedThroughputDetailsFieldNames = new string[] { "capacity_unit", "last_decrease_time", "last_increase_time" }; + private static readonly uint[] _reservedThroughputDetailsFieldTags = new uint[] { 10, 24, 16 }; + public static ReservedThroughputDetails DefaultInstance { + get { return defaultInstance; } + } + + public override ReservedThroughputDetails DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ReservedThroughputDetails ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughputDetails__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughputDetails__FieldAccessorTable; } + } + + public const int CapacityUnitFieldNumber = 1; + private bool hasCapacityUnit; + private global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit capacityUnit_; + public bool HasCapacityUnit { + get { return hasCapacityUnit; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit CapacityUnit { + get { return capacityUnit_ ?? global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.DefaultInstance; } + } + + public const int LastIncreaseTimeFieldNumber = 2; + private bool hasLastIncreaseTime; + private long lastIncreaseTime_; + public bool HasLastIncreaseTime { + get { return hasLastIncreaseTime; } + } + public long LastIncreaseTime { + get { return lastIncreaseTime_; } + } + + public const int LastDecreaseTimeFieldNumber = 3; + private bool hasLastDecreaseTime; + private long lastDecreaseTime_; + public bool HasLastDecreaseTime { + get { return hasLastDecreaseTime; } + } + public long LastDecreaseTime { + get { return lastDecreaseTime_; } + } + + public override bool IsInitialized { + get { + if (!hasCapacityUnit) return false; + if (!hasLastIncreaseTime) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _reservedThroughputDetailsFieldNames; + if (hasCapacityUnit) { + output.WriteMessage(1, field_names[0], CapacityUnit); + } + if (hasLastIncreaseTime) { + output.WriteInt64(2, field_names[2], LastIncreaseTime); + } + if (hasLastDecreaseTime) { + output.WriteInt64(3, field_names[1], LastDecreaseTime); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCapacityUnit) { + size += pb::CodedOutputStream.ComputeMessageSize(1, CapacityUnit); + } + if (hasLastIncreaseTime) { + size += pb::CodedOutputStream.ComputeInt64Size(2, LastIncreaseTime); + } + if (hasLastDecreaseTime) { + size += pb::CodedOutputStream.ComputeInt64Size(3, LastDecreaseTime); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ReservedThroughputDetails ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReservedThroughputDetails ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReservedThroughputDetails ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReservedThroughputDetails ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReservedThroughputDetails ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReservedThroughputDetails ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ReservedThroughputDetails ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ReservedThroughputDetails ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ReservedThroughputDetails ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReservedThroughputDetails ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ReservedThroughputDetails MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ReservedThroughputDetails prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ReservedThroughputDetails cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ReservedThroughputDetails result; + + private ReservedThroughputDetails PrepareBuilder() { + if (resultIsReadOnly) { + ReservedThroughputDetails original = result; + result = new ReservedThroughputDetails(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ReservedThroughputDetails MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.Descriptor; } + } + + public override ReservedThroughputDetails DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.DefaultInstance; } + } + + public override ReservedThroughputDetails BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ReservedThroughputDetails) { + return MergeFrom((ReservedThroughputDetails) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ReservedThroughputDetails other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCapacityUnit) { + MergeCapacityUnit(other.CapacityUnit); + } + if (other.HasLastIncreaseTime) { + LastIncreaseTime = other.LastIncreaseTime; + } + if (other.HasLastDecreaseTime) { + LastDecreaseTime = other.LastDecreaseTime; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_reservedThroughputDetailsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _reservedThroughputDetailsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.CreateBuilder(); + if (result.hasCapacityUnit) { + subBuilder.MergeFrom(CapacityUnit); + } + input.ReadMessage(subBuilder, extensionRegistry); + CapacityUnit = subBuilder.BuildPartial(); + break; + } + case 16: { + result.hasLastIncreaseTime = input.ReadInt64(ref result.lastIncreaseTime_); + break; + } + case 24: { + result.hasLastDecreaseTime = input.ReadInt64(ref result.lastDecreaseTime_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCapacityUnit { + get { return result.hasCapacityUnit; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit CapacityUnit { + get { return result.CapacityUnit; } + set { SetCapacityUnit(value); } + } + public Builder SetCapacityUnit(global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCapacityUnit = true; + result.capacityUnit_ = value; + return this; + } + public Builder SetCapacityUnit(global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasCapacityUnit = true; + result.capacityUnit_ = builderForValue.Build(); + return this; + } + public Builder MergeCapacityUnit(global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasCapacityUnit && + result.capacityUnit_ != global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.DefaultInstance) { + result.capacityUnit_ = global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.CreateBuilder(result.capacityUnit_).MergeFrom(value).BuildPartial(); + } else { + result.capacityUnit_ = value; + } + result.hasCapacityUnit = true; + return this; + } + public Builder ClearCapacityUnit() { + PrepareBuilder(); + result.hasCapacityUnit = false; + result.capacityUnit_ = null; + return this; + } + + public bool HasLastIncreaseTime { + get { return result.hasLastIncreaseTime; } + } + public long LastIncreaseTime { + get { return result.LastIncreaseTime; } + set { SetLastIncreaseTime(value); } + } + public Builder SetLastIncreaseTime(long value) { + PrepareBuilder(); + result.hasLastIncreaseTime = true; + result.lastIncreaseTime_ = value; + return this; + } + public Builder ClearLastIncreaseTime() { + PrepareBuilder(); + result.hasLastIncreaseTime = false; + result.lastIncreaseTime_ = 0L; + return this; + } + + public bool HasLastDecreaseTime { + get { return result.hasLastDecreaseTime; } + } + public long LastDecreaseTime { + get { return result.LastDecreaseTime; } + set { SetLastDecreaseTime(value); } + } + public Builder SetLastDecreaseTime(long value) { + PrepareBuilder(); + result.hasLastDecreaseTime = true; + result.lastDecreaseTime_ = value; + return this; + } + public Builder ClearLastDecreaseTime() { + PrepareBuilder(); + result.hasLastDecreaseTime = false; + result.lastDecreaseTime_ = 0L; + return this; + } + } + static ReservedThroughputDetails() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ReservedThroughput : pb::GeneratedMessage { + private ReservedThroughput() { } + private static readonly ReservedThroughput defaultInstance = new ReservedThroughput().MakeReadOnly(); + private static readonly string[] _reservedThroughputFieldNames = new string[] { "capacity_unit" }; + private static readonly uint[] _reservedThroughputFieldTags = new uint[] { 10 }; + public static ReservedThroughput DefaultInstance { + get { return defaultInstance; } + } + + public override ReservedThroughput DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ReservedThroughput ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughput__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ReservedThroughput__FieldAccessorTable; } + } + + public const int CapacityUnitFieldNumber = 1; + private bool hasCapacityUnit; + private global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit capacityUnit_; + public bool HasCapacityUnit { + get { return hasCapacityUnit; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit CapacityUnit { + get { return capacityUnit_ ?? global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasCapacityUnit) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _reservedThroughputFieldNames; + if (hasCapacityUnit) { + output.WriteMessage(1, field_names[0], CapacityUnit); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCapacityUnit) { + size += pb::CodedOutputStream.ComputeMessageSize(1, CapacityUnit); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ReservedThroughput ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReservedThroughput ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReservedThroughput ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReservedThroughput ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReservedThroughput ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReservedThroughput ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ReservedThroughput ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ReservedThroughput ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ReservedThroughput ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReservedThroughput ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ReservedThroughput MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ReservedThroughput prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ReservedThroughput cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ReservedThroughput result; + + private ReservedThroughput PrepareBuilder() { + if (resultIsReadOnly) { + ReservedThroughput original = result; + result = new ReservedThroughput(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ReservedThroughput MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.Descriptor; } + } + + public override ReservedThroughput DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.DefaultInstance; } + } + + public override ReservedThroughput BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ReservedThroughput) { + return MergeFrom((ReservedThroughput) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ReservedThroughput other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCapacityUnit) { + MergeCapacityUnit(other.CapacityUnit); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_reservedThroughputFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _reservedThroughputFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.CreateBuilder(); + if (result.hasCapacityUnit) { + subBuilder.MergeFrom(CapacityUnit); + } + input.ReadMessage(subBuilder, extensionRegistry); + CapacityUnit = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCapacityUnit { + get { return result.hasCapacityUnit; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit CapacityUnit { + get { return result.CapacityUnit; } + set { SetCapacityUnit(value); } + } + public Builder SetCapacityUnit(global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCapacityUnit = true; + result.capacityUnit_ = value; + return this; + } + public Builder SetCapacityUnit(global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasCapacityUnit = true; + result.capacityUnit_ = builderForValue.Build(); + return this; + } + public Builder MergeCapacityUnit(global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasCapacityUnit && + result.capacityUnit_ != global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.DefaultInstance) { + result.capacityUnit_ = global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.CreateBuilder(result.capacityUnit_).MergeFrom(value).BuildPartial(); + } else { + result.capacityUnit_ = value; + } + result.hasCapacityUnit = true; + return this; + } + public Builder ClearCapacityUnit() { + PrepareBuilder(); + result.hasCapacityUnit = false; + result.capacityUnit_ = null; + return this; + } + } + static ReservedThroughput() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ConsumedCapacity : pb::GeneratedMessage { + private ConsumedCapacity() { } + private static readonly ConsumedCapacity defaultInstance = new ConsumedCapacity().MakeReadOnly(); + private static readonly string[] _consumedCapacityFieldNames = new string[] { "capacity_unit" }; + private static readonly uint[] _consumedCapacityFieldTags = new uint[] { 10 }; + public static ConsumedCapacity DefaultInstance { + get { return defaultInstance; } + } + + public override ConsumedCapacity DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ConsumedCapacity ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ConsumedCapacity__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ConsumedCapacity__FieldAccessorTable; } + } + + public const int CapacityUnitFieldNumber = 1; + private bool hasCapacityUnit; + private global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit capacityUnit_; + public bool HasCapacityUnit { + get { return hasCapacityUnit; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit CapacityUnit { + get { return capacityUnit_ ?? global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasCapacityUnit) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _consumedCapacityFieldNames; + if (hasCapacityUnit) { + output.WriteMessage(1, field_names[0], CapacityUnit); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCapacityUnit) { + size += pb::CodedOutputStream.ComputeMessageSize(1, CapacityUnit); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ConsumedCapacity ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ConsumedCapacity ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ConsumedCapacity ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ConsumedCapacity ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ConsumedCapacity ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ConsumedCapacity ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ConsumedCapacity ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ConsumedCapacity ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ConsumedCapacity ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ConsumedCapacity ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ConsumedCapacity MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ConsumedCapacity prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ConsumedCapacity cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ConsumedCapacity result; + + private ConsumedCapacity PrepareBuilder() { + if (resultIsReadOnly) { + ConsumedCapacity original = result; + result = new ConsumedCapacity(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ConsumedCapacity MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Descriptor; } + } + + public override ConsumedCapacity DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance; } + } + + public override ConsumedCapacity BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ConsumedCapacity) { + return MergeFrom((ConsumedCapacity) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ConsumedCapacity other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCapacityUnit) { + MergeCapacityUnit(other.CapacityUnit); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_consumedCapacityFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _consumedCapacityFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.CreateBuilder(); + if (result.hasCapacityUnit) { + subBuilder.MergeFrom(CapacityUnit); + } + input.ReadMessage(subBuilder, extensionRegistry); + CapacityUnit = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCapacityUnit { + get { return result.hasCapacityUnit; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit CapacityUnit { + get { return result.CapacityUnit; } + set { SetCapacityUnit(value); } + } + public Builder SetCapacityUnit(global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCapacityUnit = true; + result.capacityUnit_ = value; + return this; + } + public Builder SetCapacityUnit(global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasCapacityUnit = true; + result.capacityUnit_ = builderForValue.Build(); + return this; + } + public Builder MergeCapacityUnit(global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasCapacityUnit && + result.capacityUnit_ != global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.DefaultInstance) { + result.capacityUnit_ = global::com.alicloud.openservices.tablestore.core.protocol.CapacityUnit.CreateBuilder(result.capacityUnit_).MergeFrom(value).BuildPartial(); + } else { + result.capacityUnit_ = value; + } + result.hasCapacityUnit = true; + return this; + } + public Builder ClearCapacityUnit() { + PrepareBuilder(); + result.hasCapacityUnit = false; + result.capacityUnit_ = null; + return this; + } + } + static ConsumedCapacity() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class StreamSpecification : pb::GeneratedMessage { + private StreamSpecification() { } + private static readonly StreamSpecification defaultInstance = new StreamSpecification().MakeReadOnly(); + private static readonly string[] _streamSpecificationFieldNames = new string[] { "enable_stream", "expiration_time" }; + private static readonly uint[] _streamSpecificationFieldTags = new uint[] { 8, 16 }; + public static StreamSpecification DefaultInstance { + get { return defaultInstance; } + } + + public override StreamSpecification DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override StreamSpecification ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamSpecification__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamSpecification__FieldAccessorTable; } + } + + public const int EnableStreamFieldNumber = 1; + private bool hasEnableStream; + private bool enableStream_; + public bool HasEnableStream { + get { return hasEnableStream; } + } + public bool EnableStream { + get { return enableStream_; } + } + + public const int ExpirationTimeFieldNumber = 2; + private bool hasExpirationTime; + private int expirationTime_; + public bool HasExpirationTime { + get { return hasExpirationTime; } + } + public int ExpirationTime { + get { return expirationTime_; } + } + + public override bool IsInitialized { + get { + if (!hasEnableStream) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _streamSpecificationFieldNames; + if (hasEnableStream) { + output.WriteBool(1, field_names[0], EnableStream); + } + if (hasExpirationTime) { + output.WriteInt32(2, field_names[1], ExpirationTime); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasEnableStream) { + size += pb::CodedOutputStream.ComputeBoolSize(1, EnableStream); + } + if (hasExpirationTime) { + size += pb::CodedOutputStream.ComputeInt32Size(2, ExpirationTime); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static StreamSpecification ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StreamSpecification ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StreamSpecification ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StreamSpecification ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StreamSpecification ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StreamSpecification ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static StreamSpecification ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static StreamSpecification ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static StreamSpecification ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StreamSpecification ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private StreamSpecification MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(StreamSpecification prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(StreamSpecification cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private StreamSpecification result; + + private StreamSpecification PrepareBuilder() { + if (resultIsReadOnly) { + StreamSpecification original = result; + result = new StreamSpecification(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override StreamSpecification MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.Descriptor; } + } + + public override StreamSpecification DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.DefaultInstance; } + } + + public override StreamSpecification BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is StreamSpecification) { + return MergeFrom((StreamSpecification) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(StreamSpecification other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasEnableStream) { + EnableStream = other.EnableStream; + } + if (other.HasExpirationTime) { + ExpirationTime = other.ExpirationTime; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_streamSpecificationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _streamSpecificationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasEnableStream = input.ReadBool(ref result.enableStream_); + break; + } + case 16: { + result.hasExpirationTime = input.ReadInt32(ref result.expirationTime_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasEnableStream { + get { return result.hasEnableStream; } + } + public bool EnableStream { + get { return result.EnableStream; } + set { SetEnableStream(value); } + } + public Builder SetEnableStream(bool value) { + PrepareBuilder(); + result.hasEnableStream = true; + result.enableStream_ = value; + return this; + } + public Builder ClearEnableStream() { + PrepareBuilder(); + result.hasEnableStream = false; + result.enableStream_ = false; + return this; + } + + public bool HasExpirationTime { + get { return result.hasExpirationTime; } + } + public int ExpirationTime { + get { return result.ExpirationTime; } + set { SetExpirationTime(value); } + } + public Builder SetExpirationTime(int value) { + PrepareBuilder(); + result.hasExpirationTime = true; + result.expirationTime_ = value; + return this; + } + public Builder ClearExpirationTime() { + PrepareBuilder(); + result.hasExpirationTime = false; + result.expirationTime_ = 0; + return this; + } + } + static StreamSpecification() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class StreamDetails : pb::GeneratedMessage { + private StreamDetails() { } + private static readonly StreamDetails defaultInstance = new StreamDetails().MakeReadOnly(); + private static readonly string[] _streamDetailsFieldNames = new string[] { "enable_stream", "expiration_time", "last_enable_time", "stream_id" }; + private static readonly uint[] _streamDetailsFieldTags = new uint[] { 8, 24, 32, 18 }; + public static StreamDetails DefaultInstance { + get { return defaultInstance; } + } + + public override StreamDetails DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override StreamDetails ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamDetails__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamDetails__FieldAccessorTable; } + } + + public const int EnableStreamFieldNumber = 1; + private bool hasEnableStream; + private bool enableStream_; + public bool HasEnableStream { + get { return hasEnableStream; } + } + public bool EnableStream { + get { return enableStream_; } + } + + public const int StreamIdFieldNumber = 2; + private bool hasStreamId; + private string streamId_ = ""; + public bool HasStreamId { + get { return hasStreamId; } + } + public string StreamId { + get { return streamId_; } + } + + public const int ExpirationTimeFieldNumber = 3; + private bool hasExpirationTime; + private int expirationTime_; + public bool HasExpirationTime { + get { return hasExpirationTime; } + } + public int ExpirationTime { + get { return expirationTime_; } + } + + public const int LastEnableTimeFieldNumber = 4; + private bool hasLastEnableTime; + private long lastEnableTime_; + public bool HasLastEnableTime { + get { return hasLastEnableTime; } + } + public long LastEnableTime { + get { return lastEnableTime_; } + } + + public override bool IsInitialized { + get { + if (!hasEnableStream) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _streamDetailsFieldNames; + if (hasEnableStream) { + output.WriteBool(1, field_names[0], EnableStream); + } + if (hasStreamId) { + output.WriteString(2, field_names[3], StreamId); + } + if (hasExpirationTime) { + output.WriteInt32(3, field_names[1], ExpirationTime); + } + if (hasLastEnableTime) { + output.WriteInt64(4, field_names[2], LastEnableTime); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasEnableStream) { + size += pb::CodedOutputStream.ComputeBoolSize(1, EnableStream); + } + if (hasStreamId) { + size += pb::CodedOutputStream.ComputeStringSize(2, StreamId); + } + if (hasExpirationTime) { + size += pb::CodedOutputStream.ComputeInt32Size(3, ExpirationTime); + } + if (hasLastEnableTime) { + size += pb::CodedOutputStream.ComputeInt64Size(4, LastEnableTime); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static StreamDetails ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StreamDetails ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StreamDetails ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StreamDetails ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StreamDetails ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StreamDetails ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static StreamDetails ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static StreamDetails ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static StreamDetails ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StreamDetails ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private StreamDetails MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(StreamDetails prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(StreamDetails cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private StreamDetails result; + + private StreamDetails PrepareBuilder() { + if (resultIsReadOnly) { + StreamDetails original = result; + result = new StreamDetails(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override StreamDetails MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.Descriptor; } + } + + public override StreamDetails DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.DefaultInstance; } + } + + public override StreamDetails BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is StreamDetails) { + return MergeFrom((StreamDetails) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(StreamDetails other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasEnableStream) { + EnableStream = other.EnableStream; + } + if (other.HasStreamId) { + StreamId = other.StreamId; + } + if (other.HasExpirationTime) { + ExpirationTime = other.ExpirationTime; + } + if (other.HasLastEnableTime) { + LastEnableTime = other.LastEnableTime; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_streamDetailsFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _streamDetailsFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasEnableStream = input.ReadBool(ref result.enableStream_); + break; + } + case 18: { + result.hasStreamId = input.ReadString(ref result.streamId_); + break; + } + case 24: { + result.hasExpirationTime = input.ReadInt32(ref result.expirationTime_); + break; + } + case 32: { + result.hasLastEnableTime = input.ReadInt64(ref result.lastEnableTime_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasEnableStream { + get { return result.hasEnableStream; } + } + public bool EnableStream { + get { return result.EnableStream; } + set { SetEnableStream(value); } + } + public Builder SetEnableStream(bool value) { + PrepareBuilder(); + result.hasEnableStream = true; + result.enableStream_ = value; + return this; + } + public Builder ClearEnableStream() { + PrepareBuilder(); + result.hasEnableStream = false; + result.enableStream_ = false; + return this; + } + + public bool HasStreamId { + get { return result.hasStreamId; } + } + public string StreamId { + get { return result.StreamId; } + set { SetStreamId(value); } + } + public Builder SetStreamId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStreamId = true; + result.streamId_ = value; + return this; + } + public Builder ClearStreamId() { + PrepareBuilder(); + result.hasStreamId = false; + result.streamId_ = ""; + return this; + } + + public bool HasExpirationTime { + get { return result.hasExpirationTime; } + } + public int ExpirationTime { + get { return result.ExpirationTime; } + set { SetExpirationTime(value); } + } + public Builder SetExpirationTime(int value) { + PrepareBuilder(); + result.hasExpirationTime = true; + result.expirationTime_ = value; + return this; + } + public Builder ClearExpirationTime() { + PrepareBuilder(); + result.hasExpirationTime = false; + result.expirationTime_ = 0; + return this; + } + + public bool HasLastEnableTime { + get { return result.hasLastEnableTime; } + } + public long LastEnableTime { + get { return result.LastEnableTime; } + set { SetLastEnableTime(value); } + } + public Builder SetLastEnableTime(long value) { + PrepareBuilder(); + result.hasLastEnableTime = true; + result.lastEnableTime_ = value; + return this; + } + public Builder ClearLastEnableTime() { + PrepareBuilder(); + result.hasLastEnableTime = false; + result.lastEnableTime_ = 0L; + return this; + } + } + static StreamDetails() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class CreateTableRequest : pb::GeneratedMessage { + private CreateTableRequest() { } + private static readonly CreateTableRequest defaultInstance = new CreateTableRequest().MakeReadOnly(); + private static readonly string[] _createTableRequestFieldNames = new string[] { "index_metas", "partitions", "reserved_throughput", "stream_spec", "table_meta", "table_options" }; + private static readonly uint[] _createTableRequestFieldTags = new uint[] { 58, 34, 18, 42, 10, 26 }; + public static CreateTableRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CreateTableRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateTableRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableRequest__FieldAccessorTable; } + } + + public const int TableMetaFieldNumber = 1; + private bool hasTableMeta; + private global::com.alicloud.openservices.tablestore.core.protocol.TableMeta tableMeta_; + public bool HasTableMeta { + get { return hasTableMeta; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableMeta TableMeta { + get { return tableMeta_ ?? global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.DefaultInstance; } + } + + public const int ReservedThroughputFieldNumber = 2; + private bool hasReservedThroughput; + private global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput reservedThroughput_; + public bool HasReservedThroughput { + get { return hasReservedThroughput; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput ReservedThroughput { + get { return reservedThroughput_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.DefaultInstance; } + } + + public const int TableOptionsFieldNumber = 3; + private bool hasTableOptions; + private global::com.alicloud.openservices.tablestore.core.protocol.TableOptions tableOptions_; + public bool HasTableOptions { + get { return hasTableOptions; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableOptions TableOptions { + get { return tableOptions_ ?? global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.DefaultInstance; } + } + + public const int PartitionsFieldNumber = 4; + private pbc::PopsicleList partitions_ = new pbc::PopsicleList(); + public scg::IList PartitionsList { + get { return partitions_; } + } + public int PartitionsCount { + get { return partitions_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.PartitionRange GetPartitions(int index) { + return partitions_[index]; + } + + public const int StreamSpecFieldNumber = 5; + private bool hasStreamSpec; + private global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification streamSpec_; + public bool HasStreamSpec { + get { return hasStreamSpec; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification StreamSpec { + get { return streamSpec_ ?? global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.DefaultInstance; } + } + + public const int IndexMetasFieldNumber = 7; + private pbc::PopsicleList indexMetas_ = new pbc::PopsicleList(); + public scg::IList IndexMetasList { + get { return indexMetas_; } + } + public int IndexMetasCount { + get { return indexMetas_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta GetIndexMetas(int index) { + return indexMetas_[index]; + } + + public override bool IsInitialized { + get { + if (!hasTableMeta) return false; + if (!hasReservedThroughput) return false; + if (!TableMeta.IsInitialized) return false; + if (!ReservedThroughput.IsInitialized) return false; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.PartitionRange element in PartitionsList) { + if (!element.IsInitialized) return false; + } + if (HasStreamSpec) { + if (!StreamSpec.IsInitialized) return false; + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta element in IndexMetasList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _createTableRequestFieldNames; + if (hasTableMeta) { + output.WriteMessage(1, field_names[4], TableMeta); + } + if (hasReservedThroughput) { + output.WriteMessage(2, field_names[2], ReservedThroughput); + } + if (hasTableOptions) { + output.WriteMessage(3, field_names[5], TableOptions); + } + if (partitions_.Count > 0) { + output.WriteMessageArray(4, field_names[1], partitions_); + } + if (hasStreamSpec) { + output.WriteMessage(5, field_names[3], StreamSpec); + } + if (indexMetas_.Count > 0) { + output.WriteMessageArray(7, field_names[0], indexMetas_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableMeta) { + size += pb::CodedOutputStream.ComputeMessageSize(1, TableMeta); + } + if (hasReservedThroughput) { + size += pb::CodedOutputStream.ComputeMessageSize(2, ReservedThroughput); + } + if (hasTableOptions) { + size += pb::CodedOutputStream.ComputeMessageSize(3, TableOptions); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.PartitionRange element in PartitionsList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + if (hasStreamSpec) { + size += pb::CodedOutputStream.ComputeMessageSize(5, StreamSpec); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta element in IndexMetasList) { + size += pb::CodedOutputStream.ComputeMessageSize(7, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static CreateTableRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateTableRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateTableRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateTableRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateTableRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateTableRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateTableRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateTableRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateTableRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateTableRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateTableRequest MakeReadOnly() { + partitions_.MakeReadOnly(); + indexMetas_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateTableRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateTableRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateTableRequest result; + + private CreateTableRequest PrepareBuilder() { + if (resultIsReadOnly) { + CreateTableRequest original = result; + result = new CreateTableRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateTableRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CreateTableRequest.Descriptor; } + } + + public override CreateTableRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CreateTableRequest.DefaultInstance; } + } + + public override CreateTableRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateTableRequest) { + return MergeFrom((CreateTableRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateTableRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.CreateTableRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableMeta) { + MergeTableMeta(other.TableMeta); + } + if (other.HasReservedThroughput) { + MergeReservedThroughput(other.ReservedThroughput); + } + if (other.HasTableOptions) { + MergeTableOptions(other.TableOptions); + } + if (other.partitions_.Count != 0) { + result.partitions_.Add(other.partitions_); + } + if (other.HasStreamSpec) { + MergeStreamSpec(other.StreamSpec); + } + if (other.indexMetas_.Count != 0) { + result.indexMetas_.Add(other.indexMetas_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createTableRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createTableRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.CreateBuilder(); + if (result.hasTableMeta) { + subBuilder.MergeFrom(TableMeta); + } + input.ReadMessage(subBuilder, extensionRegistry); + TableMeta = subBuilder.BuildPartial(); + break; + } + case 18: { + global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.CreateBuilder(); + if (result.hasReservedThroughput) { + subBuilder.MergeFrom(ReservedThroughput); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReservedThroughput = subBuilder.BuildPartial(); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.CreateBuilder(); + if (result.hasTableOptions) { + subBuilder.MergeFrom(TableOptions); + } + input.ReadMessage(subBuilder, extensionRegistry); + TableOptions = subBuilder.BuildPartial(); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.partitions_, global::com.alicloud.openservices.tablestore.core.protocol.PartitionRange.DefaultInstance, extensionRegistry); + break; + } + case 42: { + global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.CreateBuilder(); + if (result.hasStreamSpec) { + subBuilder.MergeFrom(StreamSpec); + } + input.ReadMessage(subBuilder, extensionRegistry); + StreamSpec = subBuilder.BuildPartial(); + break; + } + case 58: { + input.ReadMessageArray(tag, field_name, result.indexMetas_, global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableMeta { + get { return result.hasTableMeta; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableMeta TableMeta { + get { return result.TableMeta; } + set { SetTableMeta(value); } + } + public Builder SetTableMeta(global::com.alicloud.openservices.tablestore.core.protocol.TableMeta value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableMeta = true; + result.tableMeta_ = value; + return this; + } + public Builder SetTableMeta(global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTableMeta = true; + result.tableMeta_ = builderForValue.Build(); + return this; + } + public Builder MergeTableMeta(global::com.alicloud.openservices.tablestore.core.protocol.TableMeta value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTableMeta && + result.tableMeta_ != global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.DefaultInstance) { + result.tableMeta_ = global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.CreateBuilder(result.tableMeta_).MergeFrom(value).BuildPartial(); + } else { + result.tableMeta_ = value; + } + result.hasTableMeta = true; + return this; + } + public Builder ClearTableMeta() { + PrepareBuilder(); + result.hasTableMeta = false; + result.tableMeta_ = null; + return this; + } + + public bool HasReservedThroughput { + get { return result.hasReservedThroughput; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput ReservedThroughput { + get { return result.ReservedThroughput; } + set { SetReservedThroughput(value); } + } + public Builder SetReservedThroughput(global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReservedThroughput = true; + result.reservedThroughput_ = value; + return this; + } + public Builder SetReservedThroughput(global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReservedThroughput = true; + result.reservedThroughput_ = builderForValue.Build(); + return this; + } + public Builder MergeReservedThroughput(global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReservedThroughput && + result.reservedThroughput_ != global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.DefaultInstance) { + result.reservedThroughput_ = global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.CreateBuilder(result.reservedThroughput_).MergeFrom(value).BuildPartial(); + } else { + result.reservedThroughput_ = value; + } + result.hasReservedThroughput = true; + return this; + } + public Builder ClearReservedThroughput() { + PrepareBuilder(); + result.hasReservedThroughput = false; + result.reservedThroughput_ = null; + return this; + } + + public bool HasTableOptions { + get { return result.hasTableOptions; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableOptions TableOptions { + get { return result.TableOptions; } + set { SetTableOptions(value); } + } + public Builder SetTableOptions(global::com.alicloud.openservices.tablestore.core.protocol.TableOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableOptions = true; + result.tableOptions_ = value; + return this; + } + public Builder SetTableOptions(global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTableOptions = true; + result.tableOptions_ = builderForValue.Build(); + return this; + } + public Builder MergeTableOptions(global::com.alicloud.openservices.tablestore.core.protocol.TableOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTableOptions && + result.tableOptions_ != global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.DefaultInstance) { + result.tableOptions_ = global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.CreateBuilder(result.tableOptions_).MergeFrom(value).BuildPartial(); + } else { + result.tableOptions_ = value; + } + result.hasTableOptions = true; + return this; + } + public Builder ClearTableOptions() { + PrepareBuilder(); + result.hasTableOptions = false; + result.tableOptions_ = null; + return this; + } + + public pbc::IPopsicleList PartitionsList { + get { return PrepareBuilder().partitions_; } + } + public int PartitionsCount { + get { return result.PartitionsCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.PartitionRange GetPartitions(int index) { + return result.GetPartitions(index); + } + public Builder SetPartitions(int index, global::com.alicloud.openservices.tablestore.core.protocol.PartitionRange value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.partitions_[index] = value; + return this; + } + public Builder SetPartitions(int index, global::com.alicloud.openservices.tablestore.core.protocol.PartitionRange.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.partitions_[index] = builderForValue.Build(); + return this; + } + public Builder AddPartitions(global::com.alicloud.openservices.tablestore.core.protocol.PartitionRange value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.partitions_.Add(value); + return this; + } + public Builder AddPartitions(global::com.alicloud.openservices.tablestore.core.protocol.PartitionRange.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.partitions_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangePartitions(scg::IEnumerable values) { + PrepareBuilder(); + result.partitions_.Add(values); + return this; + } + public Builder ClearPartitions() { + PrepareBuilder(); + result.partitions_.Clear(); + return this; + } + + public bool HasStreamSpec { + get { return result.hasStreamSpec; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification StreamSpec { + get { return result.StreamSpec; } + set { SetStreamSpec(value); } + } + public Builder SetStreamSpec(global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStreamSpec = true; + result.streamSpec_ = value; + return this; + } + public Builder SetStreamSpec(global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasStreamSpec = true; + result.streamSpec_ = builderForValue.Build(); + return this; + } + public Builder MergeStreamSpec(global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasStreamSpec && + result.streamSpec_ != global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.DefaultInstance) { + result.streamSpec_ = global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.CreateBuilder(result.streamSpec_).MergeFrom(value).BuildPartial(); + } else { + result.streamSpec_ = value; + } + result.hasStreamSpec = true; + return this; + } + public Builder ClearStreamSpec() { + PrepareBuilder(); + result.hasStreamSpec = false; + result.streamSpec_ = null; + return this; + } + + public pbc::IPopsicleList IndexMetasList { + get { return PrepareBuilder().indexMetas_; } + } + public int IndexMetasCount { + get { return result.IndexMetasCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta GetIndexMetas(int index) { + return result.GetIndexMetas(index); + } + public Builder SetIndexMetas(int index, global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.indexMetas_[index] = value; + return this; + } + public Builder SetIndexMetas(int index, global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.indexMetas_[index] = builderForValue.Build(); + return this; + } + public Builder AddIndexMetas(global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.indexMetas_.Add(value); + return this; + } + public Builder AddIndexMetas(global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.indexMetas_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeIndexMetas(scg::IEnumerable values) { + PrepareBuilder(); + result.indexMetas_.Add(values); + return this; + } + public Builder ClearIndexMetas() { + PrepareBuilder(); + result.indexMetas_.Clear(); + return this; + } + } + static CreateTableRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class CreateTableResponse : pb::GeneratedMessage { + private CreateTableResponse() { } + private static readonly CreateTableResponse defaultInstance = new CreateTableResponse().MakeReadOnly(); + private static readonly string[] _createTableResponseFieldNames = new string[] { }; + private static readonly uint[] _createTableResponseFieldTags = new uint[] { }; + public static CreateTableResponse DefaultInstance { + get { return defaultInstance; } + } + + public override CreateTableResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateTableResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateTableResponse__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _createTableResponseFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static CreateTableResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateTableResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateTableResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateTableResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateTableResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateTableResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateTableResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateTableResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateTableResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateTableResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateTableResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateTableResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateTableResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateTableResponse result; + + private CreateTableResponse PrepareBuilder() { + if (resultIsReadOnly) { + CreateTableResponse original = result; + result = new CreateTableResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateTableResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CreateTableResponse.Descriptor; } + } + + public override CreateTableResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CreateTableResponse.DefaultInstance; } + } + + public override CreateTableResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateTableResponse) { + return MergeFrom((CreateTableResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateTableResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.CreateTableResponse.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createTableResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createTableResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static CreateTableResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class CreateIndexRequest : pb::GeneratedMessage { + private CreateIndexRequest() { } + private static readonly CreateIndexRequest defaultInstance = new CreateIndexRequest().MakeReadOnly(); + private static readonly string[] _createIndexRequestFieldNames = new string[] { "include_base_data", "index_meta", "main_table_name" }; + private static readonly uint[] _createIndexRequestFieldTags = new uint[] { 24, 18, 10 }; + public static CreateIndexRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CreateIndexRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateIndexRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexRequest__FieldAccessorTable; } + } + + public const int MainTableNameFieldNumber = 1; + private bool hasMainTableName; + private string mainTableName_ = ""; + public bool HasMainTableName { + get { return hasMainTableName; } + } + public string MainTableName { + get { return mainTableName_; } + } + + public const int IndexMetaFieldNumber = 2; + private bool hasIndexMeta; + private global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta indexMeta_; + public bool HasIndexMeta { + get { return hasIndexMeta; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta IndexMeta { + get { return indexMeta_ ?? global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.DefaultInstance; } + } + + public const int IncludeBaseDataFieldNumber = 3; + private bool hasIncludeBaseData; + private bool includeBaseData_; + public bool HasIncludeBaseData { + get { return hasIncludeBaseData; } + } + public bool IncludeBaseData { + get { return includeBaseData_; } + } + + public override bool IsInitialized { + get { + if (!hasMainTableName) return false; + if (!hasIndexMeta) return false; + if (!IndexMeta.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _createIndexRequestFieldNames; + if (hasMainTableName) { + output.WriteString(1, field_names[2], MainTableName); + } + if (hasIndexMeta) { + output.WriteMessage(2, field_names[1], IndexMeta); + } + if (hasIncludeBaseData) { + output.WriteBool(3, field_names[0], IncludeBaseData); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasMainTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, MainTableName); + } + if (hasIndexMeta) { + size += pb::CodedOutputStream.ComputeMessageSize(2, IndexMeta); + } + if (hasIncludeBaseData) { + size += pb::CodedOutputStream.ComputeBoolSize(3, IncludeBaseData); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static CreateIndexRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateIndexRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateIndexRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateIndexRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateIndexRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateIndexRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateIndexRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateIndexRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateIndexRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateIndexRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateIndexRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateIndexRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateIndexRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateIndexRequest result; + + private CreateIndexRequest PrepareBuilder() { + if (resultIsReadOnly) { + CreateIndexRequest original = result; + result = new CreateIndexRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateIndexRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CreateIndexRequest.Descriptor; } + } + + public override CreateIndexRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CreateIndexRequest.DefaultInstance; } + } + + public override CreateIndexRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateIndexRequest) { + return MergeFrom((CreateIndexRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateIndexRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.CreateIndexRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasMainTableName) { + MainTableName = other.MainTableName; + } + if (other.HasIndexMeta) { + MergeIndexMeta(other.IndexMeta); + } + if (other.HasIncludeBaseData) { + IncludeBaseData = other.IncludeBaseData; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createIndexRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createIndexRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasMainTableName = input.ReadString(ref result.mainTableName_); + break; + } + case 18: { + global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.CreateBuilder(); + if (result.hasIndexMeta) { + subBuilder.MergeFrom(IndexMeta); + } + input.ReadMessage(subBuilder, extensionRegistry); + IndexMeta = subBuilder.BuildPartial(); + break; + } + case 24: { + result.hasIncludeBaseData = input.ReadBool(ref result.includeBaseData_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasMainTableName { + get { return result.hasMainTableName; } + } + public string MainTableName { + get { return result.MainTableName; } + set { SetMainTableName(value); } + } + public Builder SetMainTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasMainTableName = true; + result.mainTableName_ = value; + return this; + } + public Builder ClearMainTableName() { + PrepareBuilder(); + result.hasMainTableName = false; + result.mainTableName_ = ""; + return this; + } + + public bool HasIndexMeta { + get { return result.hasIndexMeta; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta IndexMeta { + get { return result.IndexMeta; } + set { SetIndexMeta(value); } + } + public Builder SetIndexMeta(global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasIndexMeta = true; + result.indexMeta_ = value; + return this; + } + public Builder SetIndexMeta(global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasIndexMeta = true; + result.indexMeta_ = builderForValue.Build(); + return this; + } + public Builder MergeIndexMeta(global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasIndexMeta && + result.indexMeta_ != global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.DefaultInstance) { + result.indexMeta_ = global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.CreateBuilder(result.indexMeta_).MergeFrom(value).BuildPartial(); + } else { + result.indexMeta_ = value; + } + result.hasIndexMeta = true; + return this; + } + public Builder ClearIndexMeta() { + PrepareBuilder(); + result.hasIndexMeta = false; + result.indexMeta_ = null; + return this; + } + + public bool HasIncludeBaseData { + get { return result.hasIncludeBaseData; } + } + public bool IncludeBaseData { + get { return result.IncludeBaseData; } + set { SetIncludeBaseData(value); } + } + public Builder SetIncludeBaseData(bool value) { + PrepareBuilder(); + result.hasIncludeBaseData = true; + result.includeBaseData_ = value; + return this; + } + public Builder ClearIncludeBaseData() { + PrepareBuilder(); + result.hasIncludeBaseData = false; + result.includeBaseData_ = false; + return this; + } + } + static CreateIndexRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class CreateIndexResponse : pb::GeneratedMessage { + private CreateIndexResponse() { } + private static readonly CreateIndexResponse defaultInstance = new CreateIndexResponse().MakeReadOnly(); + private static readonly string[] _createIndexResponseFieldNames = new string[] { }; + private static readonly uint[] _createIndexResponseFieldTags = new uint[] { }; + public static CreateIndexResponse DefaultInstance { + get { return defaultInstance; } + } + + public override CreateIndexResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateIndexResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateIndexResponse__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _createIndexResponseFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static CreateIndexResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateIndexResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateIndexResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateIndexResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateIndexResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateIndexResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateIndexResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateIndexResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateIndexResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateIndexResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateIndexResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateIndexResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateIndexResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateIndexResponse result; + + private CreateIndexResponse PrepareBuilder() { + if (resultIsReadOnly) { + CreateIndexResponse original = result; + result = new CreateIndexResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateIndexResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CreateIndexResponse.Descriptor; } + } + + public override CreateIndexResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CreateIndexResponse.DefaultInstance; } + } + + public override CreateIndexResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateIndexResponse) { + return MergeFrom((CreateIndexResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateIndexResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.CreateIndexResponse.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createIndexResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createIndexResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static CreateIndexResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DropIndexRequest : pb::GeneratedMessage { + private DropIndexRequest() { } + private static readonly DropIndexRequest defaultInstance = new DropIndexRequest().MakeReadOnly(); + private static readonly string[] _dropIndexRequestFieldNames = new string[] { "index_name", "main_table_name" }; + private static readonly uint[] _dropIndexRequestFieldTags = new uint[] { 18, 10 }; + public static DropIndexRequest DefaultInstance { + get { return defaultInstance; } + } + + public override DropIndexRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DropIndexRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexRequest__FieldAccessorTable; } + } + + public const int MainTableNameFieldNumber = 1; + private bool hasMainTableName; + private string mainTableName_ = ""; + public bool HasMainTableName { + get { return hasMainTableName; } + } + public string MainTableName { + get { return mainTableName_; } + } + + public const int IndexNameFieldNumber = 2; + private bool hasIndexName; + private string indexName_ = ""; + public bool HasIndexName { + get { return hasIndexName; } + } + public string IndexName { + get { return indexName_; } + } + + public override bool IsInitialized { + get { + if (!hasMainTableName) return false; + if (!hasIndexName) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _dropIndexRequestFieldNames; + if (hasMainTableName) { + output.WriteString(1, field_names[1], MainTableName); + } + if (hasIndexName) { + output.WriteString(2, field_names[0], IndexName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasMainTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, MainTableName); + } + if (hasIndexName) { + size += pb::CodedOutputStream.ComputeStringSize(2, IndexName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DropIndexRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DropIndexRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DropIndexRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DropIndexRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DropIndexRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DropIndexRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DropIndexRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DropIndexRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DropIndexRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DropIndexRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DropIndexRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DropIndexRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DropIndexRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DropIndexRequest result; + + private DropIndexRequest PrepareBuilder() { + if (resultIsReadOnly) { + DropIndexRequest original = result; + result = new DropIndexRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DropIndexRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DropIndexRequest.Descriptor; } + } + + public override DropIndexRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DropIndexRequest.DefaultInstance; } + } + + public override DropIndexRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DropIndexRequest) { + return MergeFrom((DropIndexRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DropIndexRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DropIndexRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasMainTableName) { + MainTableName = other.MainTableName; + } + if (other.HasIndexName) { + IndexName = other.IndexName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_dropIndexRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _dropIndexRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasMainTableName = input.ReadString(ref result.mainTableName_); + break; + } + case 18: { + result.hasIndexName = input.ReadString(ref result.indexName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasMainTableName { + get { return result.hasMainTableName; } + } + public string MainTableName { + get { return result.MainTableName; } + set { SetMainTableName(value); } + } + public Builder SetMainTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasMainTableName = true; + result.mainTableName_ = value; + return this; + } + public Builder ClearMainTableName() { + PrepareBuilder(); + result.hasMainTableName = false; + result.mainTableName_ = ""; + return this; + } + + public bool HasIndexName { + get { return result.hasIndexName; } + } + public string IndexName { + get { return result.IndexName; } + set { SetIndexName(value); } + } + public Builder SetIndexName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasIndexName = true; + result.indexName_ = value; + return this; + } + public Builder ClearIndexName() { + PrepareBuilder(); + result.hasIndexName = false; + result.indexName_ = ""; + return this; + } + } + static DropIndexRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DropIndexResponse : pb::GeneratedMessage { + private DropIndexResponse() { } + private static readonly DropIndexResponse defaultInstance = new DropIndexResponse().MakeReadOnly(); + private static readonly string[] _dropIndexResponseFieldNames = new string[] { }; + private static readonly uint[] _dropIndexResponseFieldTags = new uint[] { }; + public static DropIndexResponse DefaultInstance { + get { return defaultInstance; } + } + + public override DropIndexResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DropIndexResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DropIndexResponse__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _dropIndexResponseFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DropIndexResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DropIndexResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DropIndexResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DropIndexResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DropIndexResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DropIndexResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DropIndexResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DropIndexResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DropIndexResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DropIndexResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DropIndexResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DropIndexResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DropIndexResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DropIndexResponse result; + + private DropIndexResponse PrepareBuilder() { + if (resultIsReadOnly) { + DropIndexResponse original = result; + result = new DropIndexResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DropIndexResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DropIndexResponse.Descriptor; } + } + + public override DropIndexResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DropIndexResponse.DefaultInstance; } + } + + public override DropIndexResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DropIndexResponse) { + return MergeFrom((DropIndexResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DropIndexResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DropIndexResponse.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_dropIndexResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _dropIndexResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static DropIndexResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class UpdateTableRequest : pb::GeneratedMessage { + private UpdateTableRequest() { } + private static readonly UpdateTableRequest defaultInstance = new UpdateTableRequest().MakeReadOnly(); + private static readonly string[] _updateTableRequestFieldNames = new string[] { "reserved_throughput", "stream_spec", "table_name", "table_options" }; + private static readonly uint[] _updateTableRequestFieldTags = new uint[] { 18, 34, 10, 26 }; + public static UpdateTableRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UpdateTableRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UpdateTableRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int ReservedThroughputFieldNumber = 2; + private bool hasReservedThroughput; + private global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput reservedThroughput_; + public bool HasReservedThroughput { + get { return hasReservedThroughput; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput ReservedThroughput { + get { return reservedThroughput_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.DefaultInstance; } + } + + public const int TableOptionsFieldNumber = 3; + private bool hasTableOptions; + private global::com.alicloud.openservices.tablestore.core.protocol.TableOptions tableOptions_; + public bool HasTableOptions { + get { return hasTableOptions; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableOptions TableOptions { + get { return tableOptions_ ?? global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.DefaultInstance; } + } + + public const int StreamSpecFieldNumber = 4; + private bool hasStreamSpec; + private global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification streamSpec_; + public bool HasStreamSpec { + get { return hasStreamSpec; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification StreamSpec { + get { return streamSpec_ ?? global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + if (HasReservedThroughput) { + if (!ReservedThroughput.IsInitialized) return false; + } + if (HasStreamSpec) { + if (!StreamSpec.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _updateTableRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[2], TableName); + } + if (hasReservedThroughput) { + output.WriteMessage(2, field_names[0], ReservedThroughput); + } + if (hasTableOptions) { + output.WriteMessage(3, field_names[3], TableOptions); + } + if (hasStreamSpec) { + output.WriteMessage(4, field_names[1], StreamSpec); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + if (hasReservedThroughput) { + size += pb::CodedOutputStream.ComputeMessageSize(2, ReservedThroughput); + } + if (hasTableOptions) { + size += pb::CodedOutputStream.ComputeMessageSize(3, TableOptions); + } + if (hasStreamSpec) { + size += pb::CodedOutputStream.ComputeMessageSize(4, StreamSpec); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static UpdateTableRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateTableRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateTableRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateTableRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateTableRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateTableRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UpdateTableRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UpdateTableRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UpdateTableRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateTableRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UpdateTableRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UpdateTableRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UpdateTableRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UpdateTableRequest result; + + private UpdateTableRequest PrepareBuilder() { + if (resultIsReadOnly) { + UpdateTableRequest original = result; + result = new UpdateTableRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UpdateTableRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.UpdateTableRequest.Descriptor; } + } + + public override UpdateTableRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.UpdateTableRequest.DefaultInstance; } + } + + public override UpdateTableRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UpdateTableRequest) { + return MergeFrom((UpdateTableRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UpdateTableRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.UpdateTableRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasReservedThroughput) { + MergeReservedThroughput(other.ReservedThroughput); + } + if (other.HasTableOptions) { + MergeTableOptions(other.TableOptions); + } + if (other.HasStreamSpec) { + MergeStreamSpec(other.StreamSpec); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_updateTableRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateTableRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.CreateBuilder(); + if (result.hasReservedThroughput) { + subBuilder.MergeFrom(ReservedThroughput); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReservedThroughput = subBuilder.BuildPartial(); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.CreateBuilder(); + if (result.hasTableOptions) { + subBuilder.MergeFrom(TableOptions); + } + input.ReadMessage(subBuilder, extensionRegistry); + TableOptions = subBuilder.BuildPartial(); + break; + } + case 34: { + global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.CreateBuilder(); + if (result.hasStreamSpec) { + subBuilder.MergeFrom(StreamSpec); + } + input.ReadMessage(subBuilder, extensionRegistry); + StreamSpec = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasReservedThroughput { + get { return result.hasReservedThroughput; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput ReservedThroughput { + get { return result.ReservedThroughput; } + set { SetReservedThroughput(value); } + } + public Builder SetReservedThroughput(global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReservedThroughput = true; + result.reservedThroughput_ = value; + return this; + } + public Builder SetReservedThroughput(global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReservedThroughput = true; + result.reservedThroughput_ = builderForValue.Build(); + return this; + } + public Builder MergeReservedThroughput(global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReservedThroughput && + result.reservedThroughput_ != global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.DefaultInstance) { + result.reservedThroughput_ = global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughput.CreateBuilder(result.reservedThroughput_).MergeFrom(value).BuildPartial(); + } else { + result.reservedThroughput_ = value; + } + result.hasReservedThroughput = true; + return this; + } + public Builder ClearReservedThroughput() { + PrepareBuilder(); + result.hasReservedThroughput = false; + result.reservedThroughput_ = null; + return this; + } + + public bool HasTableOptions { + get { return result.hasTableOptions; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableOptions TableOptions { + get { return result.TableOptions; } + set { SetTableOptions(value); } + } + public Builder SetTableOptions(global::com.alicloud.openservices.tablestore.core.protocol.TableOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableOptions = true; + result.tableOptions_ = value; + return this; + } + public Builder SetTableOptions(global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTableOptions = true; + result.tableOptions_ = builderForValue.Build(); + return this; + } + public Builder MergeTableOptions(global::com.alicloud.openservices.tablestore.core.protocol.TableOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTableOptions && + result.tableOptions_ != global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.DefaultInstance) { + result.tableOptions_ = global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.CreateBuilder(result.tableOptions_).MergeFrom(value).BuildPartial(); + } else { + result.tableOptions_ = value; + } + result.hasTableOptions = true; + return this; + } + public Builder ClearTableOptions() { + PrepareBuilder(); + result.hasTableOptions = false; + result.tableOptions_ = null; + return this; + } + + public bool HasStreamSpec { + get { return result.hasStreamSpec; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification StreamSpec { + get { return result.StreamSpec; } + set { SetStreamSpec(value); } + } + public Builder SetStreamSpec(global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStreamSpec = true; + result.streamSpec_ = value; + return this; + } + public Builder SetStreamSpec(global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasStreamSpec = true; + result.streamSpec_ = builderForValue.Build(); + return this; + } + public Builder MergeStreamSpec(global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasStreamSpec && + result.streamSpec_ != global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.DefaultInstance) { + result.streamSpec_ = global::com.alicloud.openservices.tablestore.core.protocol.StreamSpecification.CreateBuilder(result.streamSpec_).MergeFrom(value).BuildPartial(); + } else { + result.streamSpec_ = value; + } + result.hasStreamSpec = true; + return this; + } + public Builder ClearStreamSpec() { + PrepareBuilder(); + result.hasStreamSpec = false; + result.streamSpec_ = null; + return this; + } + } + static UpdateTableRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class UpdateTableResponse : pb::GeneratedMessage { + private UpdateTableResponse() { } + private static readonly UpdateTableResponse defaultInstance = new UpdateTableResponse().MakeReadOnly(); + private static readonly string[] _updateTableResponseFieldNames = new string[] { "reserved_throughput_details", "stream_details", "table_options" }; + private static readonly uint[] _updateTableResponseFieldTags = new uint[] { 10, 26, 18 }; + public static UpdateTableResponse DefaultInstance { + get { return defaultInstance; } + } + + public override UpdateTableResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UpdateTableResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateTableResponse__FieldAccessorTable; } + } + + public const int ReservedThroughputDetailsFieldNumber = 1; + private bool hasReservedThroughputDetails; + private global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails reservedThroughputDetails_; + public bool HasReservedThroughputDetails { + get { return hasReservedThroughputDetails; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails ReservedThroughputDetails { + get { return reservedThroughputDetails_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.DefaultInstance; } + } + + public const int TableOptionsFieldNumber = 2; + private bool hasTableOptions; + private global::com.alicloud.openservices.tablestore.core.protocol.TableOptions tableOptions_; + public bool HasTableOptions { + get { return hasTableOptions; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableOptions TableOptions { + get { return tableOptions_ ?? global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.DefaultInstance; } + } + + public const int StreamDetailsFieldNumber = 3; + private bool hasStreamDetails; + private global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails streamDetails_; + public bool HasStreamDetails { + get { return hasStreamDetails; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails StreamDetails { + get { return streamDetails_ ?? global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasReservedThroughputDetails) return false; + if (!hasTableOptions) return false; + if (!ReservedThroughputDetails.IsInitialized) return false; + if (HasStreamDetails) { + if (!StreamDetails.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _updateTableResponseFieldNames; + if (hasReservedThroughputDetails) { + output.WriteMessage(1, field_names[0], ReservedThroughputDetails); + } + if (hasTableOptions) { + output.WriteMessage(2, field_names[2], TableOptions); + } + if (hasStreamDetails) { + output.WriteMessage(3, field_names[1], StreamDetails); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasReservedThroughputDetails) { + size += pb::CodedOutputStream.ComputeMessageSize(1, ReservedThroughputDetails); + } + if (hasTableOptions) { + size += pb::CodedOutputStream.ComputeMessageSize(2, TableOptions); + } + if (hasStreamDetails) { + size += pb::CodedOutputStream.ComputeMessageSize(3, StreamDetails); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static UpdateTableResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateTableResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateTableResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateTableResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateTableResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateTableResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UpdateTableResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UpdateTableResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UpdateTableResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateTableResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UpdateTableResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UpdateTableResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UpdateTableResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UpdateTableResponse result; + + private UpdateTableResponse PrepareBuilder() { + if (resultIsReadOnly) { + UpdateTableResponse original = result; + result = new UpdateTableResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UpdateTableResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.UpdateTableResponse.Descriptor; } + } + + public override UpdateTableResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.UpdateTableResponse.DefaultInstance; } + } + + public override UpdateTableResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UpdateTableResponse) { + return MergeFrom((UpdateTableResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UpdateTableResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.UpdateTableResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasReservedThroughputDetails) { + MergeReservedThroughputDetails(other.ReservedThroughputDetails); + } + if (other.HasTableOptions) { + MergeTableOptions(other.TableOptions); + } + if (other.HasStreamDetails) { + MergeStreamDetails(other.StreamDetails); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_updateTableResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateTableResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.CreateBuilder(); + if (result.hasReservedThroughputDetails) { + subBuilder.MergeFrom(ReservedThroughputDetails); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReservedThroughputDetails = subBuilder.BuildPartial(); + break; + } + case 18: { + global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.CreateBuilder(); + if (result.hasTableOptions) { + subBuilder.MergeFrom(TableOptions); + } + input.ReadMessage(subBuilder, extensionRegistry); + TableOptions = subBuilder.BuildPartial(); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.CreateBuilder(); + if (result.hasStreamDetails) { + subBuilder.MergeFrom(StreamDetails); + } + input.ReadMessage(subBuilder, extensionRegistry); + StreamDetails = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasReservedThroughputDetails { + get { return result.hasReservedThroughputDetails; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails ReservedThroughputDetails { + get { return result.ReservedThroughputDetails; } + set { SetReservedThroughputDetails(value); } + } + public Builder SetReservedThroughputDetails(global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReservedThroughputDetails = true; + result.reservedThroughputDetails_ = value; + return this; + } + public Builder SetReservedThroughputDetails(global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReservedThroughputDetails = true; + result.reservedThroughputDetails_ = builderForValue.Build(); + return this; + } + public Builder MergeReservedThroughputDetails(global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReservedThroughputDetails && + result.reservedThroughputDetails_ != global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.DefaultInstance) { + result.reservedThroughputDetails_ = global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.CreateBuilder(result.reservedThroughputDetails_).MergeFrom(value).BuildPartial(); + } else { + result.reservedThroughputDetails_ = value; + } + result.hasReservedThroughputDetails = true; + return this; + } + public Builder ClearReservedThroughputDetails() { + PrepareBuilder(); + result.hasReservedThroughputDetails = false; + result.reservedThroughputDetails_ = null; + return this; + } + + public bool HasTableOptions { + get { return result.hasTableOptions; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableOptions TableOptions { + get { return result.TableOptions; } + set { SetTableOptions(value); } + } + public Builder SetTableOptions(global::com.alicloud.openservices.tablestore.core.protocol.TableOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableOptions = true; + result.tableOptions_ = value; + return this; + } + public Builder SetTableOptions(global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTableOptions = true; + result.tableOptions_ = builderForValue.Build(); + return this; + } + public Builder MergeTableOptions(global::com.alicloud.openservices.tablestore.core.protocol.TableOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTableOptions && + result.tableOptions_ != global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.DefaultInstance) { + result.tableOptions_ = global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.CreateBuilder(result.tableOptions_).MergeFrom(value).BuildPartial(); + } else { + result.tableOptions_ = value; + } + result.hasTableOptions = true; + return this; + } + public Builder ClearTableOptions() { + PrepareBuilder(); + result.hasTableOptions = false; + result.tableOptions_ = null; + return this; + } + + public bool HasStreamDetails { + get { return result.hasStreamDetails; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails StreamDetails { + get { return result.StreamDetails; } + set { SetStreamDetails(value); } + } + public Builder SetStreamDetails(global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStreamDetails = true; + result.streamDetails_ = value; + return this; + } + public Builder SetStreamDetails(global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasStreamDetails = true; + result.streamDetails_ = builderForValue.Build(); + return this; + } + public Builder MergeStreamDetails(global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasStreamDetails && + result.streamDetails_ != global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.DefaultInstance) { + result.streamDetails_ = global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.CreateBuilder(result.streamDetails_).MergeFrom(value).BuildPartial(); + } else { + result.streamDetails_ = value; + } + result.hasStreamDetails = true; + return this; + } + public Builder ClearStreamDetails() { + PrepareBuilder(); + result.hasStreamDetails = false; + result.streamDetails_ = null; + return this; + } + } + static UpdateTableResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DescribeTableRequest : pb::GeneratedMessage { + private DescribeTableRequest() { } + private static readonly DescribeTableRequest defaultInstance = new DescribeTableRequest().MakeReadOnly(); + private static readonly string[] _describeTableRequestFieldNames = new string[] { "table_name" }; + private static readonly uint[] _describeTableRequestFieldTags = new uint[] { 10 }; + public static DescribeTableRequest DefaultInstance { + get { return defaultInstance; } + } + + public override DescribeTableRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DescribeTableRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _describeTableRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[0], TableName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DescribeTableRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescribeTableRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescribeTableRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescribeTableRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescribeTableRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescribeTableRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DescribeTableRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DescribeTableRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DescribeTableRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescribeTableRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DescribeTableRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DescribeTableRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DescribeTableRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DescribeTableRequest result; + + private DescribeTableRequest PrepareBuilder() { + if (resultIsReadOnly) { + DescribeTableRequest original = result; + result = new DescribeTableRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DescribeTableRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DescribeTableRequest.Descriptor; } + } + + public override DescribeTableRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DescribeTableRequest.DefaultInstance; } + } + + public override DescribeTableRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DescribeTableRequest) { + return MergeFrom((DescribeTableRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DescribeTableRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DescribeTableRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_describeTableRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _describeTableRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + } + static DescribeTableRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DescribeTableResponse : pb::GeneratedMessage { + private DescribeTableResponse() { } + private static readonly DescribeTableResponse defaultInstance = new DescribeTableResponse().MakeReadOnly(); + private static readonly string[] _describeTableResponseFieldNames = new string[] { "index_metas", "reserved_throughput_details", "shard_splits", "stream_details", "table_meta", "table_options", "table_status" }; + private static readonly uint[] _describeTableResponseFieldTags = new uint[] { 66, 18, 50, 42, 10, 26, 32 }; + public static DescribeTableResponse DefaultInstance { + get { return defaultInstance; } + } + + public override DescribeTableResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DescribeTableResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeTableResponse__FieldAccessorTable; } + } + + public const int TableMetaFieldNumber = 1; + private bool hasTableMeta; + private global::com.alicloud.openservices.tablestore.core.protocol.TableMeta tableMeta_; + public bool HasTableMeta { + get { return hasTableMeta; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableMeta TableMeta { + get { return tableMeta_ ?? global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.DefaultInstance; } + } + + public const int ReservedThroughputDetailsFieldNumber = 2; + private bool hasReservedThroughputDetails; + private global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails reservedThroughputDetails_; + public bool HasReservedThroughputDetails { + get { return hasReservedThroughputDetails; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails ReservedThroughputDetails { + get { return reservedThroughputDetails_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.DefaultInstance; } + } + + public const int TableOptionsFieldNumber = 3; + private bool hasTableOptions; + private global::com.alicloud.openservices.tablestore.core.protocol.TableOptions tableOptions_; + public bool HasTableOptions { + get { return hasTableOptions; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableOptions TableOptions { + get { return tableOptions_ ?? global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.DefaultInstance; } + } + + public const int TableStatusFieldNumber = 4; + private bool hasTableStatus; + private global::com.alicloud.openservices.tablestore.core.protocol.TableStatus tableStatus_ = global::com.alicloud.openservices.tablestore.core.protocol.TableStatus.ACTIVE; + public bool HasTableStatus { + get { return hasTableStatus; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableStatus TableStatus { + get { return tableStatus_; } + } + + public const int StreamDetailsFieldNumber = 5; + private bool hasStreamDetails; + private global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails streamDetails_; + public bool HasStreamDetails { + get { return hasStreamDetails; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails StreamDetails { + get { return streamDetails_ ?? global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.DefaultInstance; } + } + + public const int ShardSplitsFieldNumber = 6; + private pbc::PopsicleList shardSplits_ = new pbc::PopsicleList(); + public scg::IList ShardSplitsList { + get { return pbc::Lists.AsReadOnly(shardSplits_); } + } + public int ShardSplitsCount { + get { return shardSplits_.Count; } + } + public pb::ByteString GetShardSplits(int index) { + return shardSplits_[index]; + } + + public const int IndexMetasFieldNumber = 8; + private pbc::PopsicleList indexMetas_ = new pbc::PopsicleList(); + public scg::IList IndexMetasList { + get { return indexMetas_; } + } + public int IndexMetasCount { + get { return indexMetas_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta GetIndexMetas(int index) { + return indexMetas_[index]; + } + + public override bool IsInitialized { + get { + if (!hasTableMeta) return false; + if (!hasReservedThroughputDetails) return false; + if (!hasTableOptions) return false; + if (!hasTableStatus) return false; + if (!TableMeta.IsInitialized) return false; + if (!ReservedThroughputDetails.IsInitialized) return false; + if (HasStreamDetails) { + if (!StreamDetails.IsInitialized) return false; + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta element in IndexMetasList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _describeTableResponseFieldNames; + if (hasTableMeta) { + output.WriteMessage(1, field_names[4], TableMeta); + } + if (hasReservedThroughputDetails) { + output.WriteMessage(2, field_names[1], ReservedThroughputDetails); + } + if (hasTableOptions) { + output.WriteMessage(3, field_names[5], TableOptions); + } + if (hasTableStatus) { + output.WriteEnum(4, field_names[6], (int) TableStatus, TableStatus); + } + if (hasStreamDetails) { + output.WriteMessage(5, field_names[3], StreamDetails); + } + if (shardSplits_.Count > 0) { + output.WriteBytesArray(6, field_names[2], shardSplits_); + } + if (indexMetas_.Count > 0) { + output.WriteMessageArray(8, field_names[0], indexMetas_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableMeta) { + size += pb::CodedOutputStream.ComputeMessageSize(1, TableMeta); + } + if (hasReservedThroughputDetails) { + size += pb::CodedOutputStream.ComputeMessageSize(2, ReservedThroughputDetails); + } + if (hasTableOptions) { + size += pb::CodedOutputStream.ComputeMessageSize(3, TableOptions); + } + if (hasTableStatus) { + size += pb::CodedOutputStream.ComputeEnumSize(4, (int) TableStatus); + } + if (hasStreamDetails) { + size += pb::CodedOutputStream.ComputeMessageSize(5, StreamDetails); + } + { + int dataSize = 0; + foreach (pb::ByteString element in ShardSplitsList) { + dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); + } + size += dataSize; + size += 1 * shardSplits_.Count; + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta element in IndexMetasList) { + size += pb::CodedOutputStream.ComputeMessageSize(8, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DescribeTableResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescribeTableResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescribeTableResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescribeTableResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescribeTableResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescribeTableResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DescribeTableResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DescribeTableResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DescribeTableResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescribeTableResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DescribeTableResponse MakeReadOnly() { + shardSplits_.MakeReadOnly(); + indexMetas_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DescribeTableResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DescribeTableResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DescribeTableResponse result; + + private DescribeTableResponse PrepareBuilder() { + if (resultIsReadOnly) { + DescribeTableResponse original = result; + result = new DescribeTableResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DescribeTableResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DescribeTableResponse.Descriptor; } + } + + public override DescribeTableResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DescribeTableResponse.DefaultInstance; } + } + + public override DescribeTableResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DescribeTableResponse) { + return MergeFrom((DescribeTableResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DescribeTableResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DescribeTableResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableMeta) { + MergeTableMeta(other.TableMeta); + } + if (other.HasReservedThroughputDetails) { + MergeReservedThroughputDetails(other.ReservedThroughputDetails); + } + if (other.HasTableOptions) { + MergeTableOptions(other.TableOptions); + } + if (other.HasTableStatus) { + TableStatus = other.TableStatus; + } + if (other.HasStreamDetails) { + MergeStreamDetails(other.StreamDetails); + } + if (other.shardSplits_.Count != 0) { + result.shardSplits_.Add(other.shardSplits_); + } + if (other.indexMetas_.Count != 0) { + result.indexMetas_.Add(other.indexMetas_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_describeTableResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _describeTableResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.CreateBuilder(); + if (result.hasTableMeta) { + subBuilder.MergeFrom(TableMeta); + } + input.ReadMessage(subBuilder, extensionRegistry); + TableMeta = subBuilder.BuildPartial(); + break; + } + case 18: { + global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.CreateBuilder(); + if (result.hasReservedThroughputDetails) { + subBuilder.MergeFrom(ReservedThroughputDetails); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReservedThroughputDetails = subBuilder.BuildPartial(); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.CreateBuilder(); + if (result.hasTableOptions) { + subBuilder.MergeFrom(TableOptions); + } + input.ReadMessage(subBuilder, extensionRegistry); + TableOptions = subBuilder.BuildPartial(); + break; + } + case 32: { + object unknown; + if(input.ReadEnum(ref result.tableStatus_, out unknown)) { + result.hasTableStatus = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(4, (ulong)(int)unknown); + } + break; + } + case 42: { + global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.CreateBuilder(); + if (result.hasStreamDetails) { + subBuilder.MergeFrom(StreamDetails); + } + input.ReadMessage(subBuilder, extensionRegistry); + StreamDetails = subBuilder.BuildPartial(); + break; + } + case 50: { + input.ReadBytesArray(tag, field_name, result.shardSplits_); + break; + } + case 66: { + input.ReadMessageArray(tag, field_name, result.indexMetas_, global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableMeta { + get { return result.hasTableMeta; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableMeta TableMeta { + get { return result.TableMeta; } + set { SetTableMeta(value); } + } + public Builder SetTableMeta(global::com.alicloud.openservices.tablestore.core.protocol.TableMeta value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableMeta = true; + result.tableMeta_ = value; + return this; + } + public Builder SetTableMeta(global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTableMeta = true; + result.tableMeta_ = builderForValue.Build(); + return this; + } + public Builder MergeTableMeta(global::com.alicloud.openservices.tablestore.core.protocol.TableMeta value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTableMeta && + result.tableMeta_ != global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.DefaultInstance) { + result.tableMeta_ = global::com.alicloud.openservices.tablestore.core.protocol.TableMeta.CreateBuilder(result.tableMeta_).MergeFrom(value).BuildPartial(); + } else { + result.tableMeta_ = value; + } + result.hasTableMeta = true; + return this; + } + public Builder ClearTableMeta() { + PrepareBuilder(); + result.hasTableMeta = false; + result.tableMeta_ = null; + return this; + } + + public bool HasReservedThroughputDetails { + get { return result.hasReservedThroughputDetails; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails ReservedThroughputDetails { + get { return result.ReservedThroughputDetails; } + set { SetReservedThroughputDetails(value); } + } + public Builder SetReservedThroughputDetails(global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReservedThroughputDetails = true; + result.reservedThroughputDetails_ = value; + return this; + } + public Builder SetReservedThroughputDetails(global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReservedThroughputDetails = true; + result.reservedThroughputDetails_ = builderForValue.Build(); + return this; + } + public Builder MergeReservedThroughputDetails(global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReservedThroughputDetails && + result.reservedThroughputDetails_ != global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.DefaultInstance) { + result.reservedThroughputDetails_ = global::com.alicloud.openservices.tablestore.core.protocol.ReservedThroughputDetails.CreateBuilder(result.reservedThroughputDetails_).MergeFrom(value).BuildPartial(); + } else { + result.reservedThroughputDetails_ = value; + } + result.hasReservedThroughputDetails = true; + return this; + } + public Builder ClearReservedThroughputDetails() { + PrepareBuilder(); + result.hasReservedThroughputDetails = false; + result.reservedThroughputDetails_ = null; + return this; + } + + public bool HasTableOptions { + get { return result.hasTableOptions; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableOptions TableOptions { + get { return result.TableOptions; } + set { SetTableOptions(value); } + } + public Builder SetTableOptions(global::com.alicloud.openservices.tablestore.core.protocol.TableOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableOptions = true; + result.tableOptions_ = value; + return this; + } + public Builder SetTableOptions(global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTableOptions = true; + result.tableOptions_ = builderForValue.Build(); + return this; + } + public Builder MergeTableOptions(global::com.alicloud.openservices.tablestore.core.protocol.TableOptions value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTableOptions && + result.tableOptions_ != global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.DefaultInstance) { + result.tableOptions_ = global::com.alicloud.openservices.tablestore.core.protocol.TableOptions.CreateBuilder(result.tableOptions_).MergeFrom(value).BuildPartial(); + } else { + result.tableOptions_ = value; + } + result.hasTableOptions = true; + return this; + } + public Builder ClearTableOptions() { + PrepareBuilder(); + result.hasTableOptions = false; + result.tableOptions_ = null; + return this; + } + + public bool HasTableStatus { + get { return result.hasTableStatus; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableStatus TableStatus { + get { return result.TableStatus; } + set { SetTableStatus(value); } + } + public Builder SetTableStatus(global::com.alicloud.openservices.tablestore.core.protocol.TableStatus value) { + PrepareBuilder(); + result.hasTableStatus = true; + result.tableStatus_ = value; + return this; + } + public Builder ClearTableStatus() { + PrepareBuilder(); + result.hasTableStatus = false; + result.tableStatus_ = global::com.alicloud.openservices.tablestore.core.protocol.TableStatus.ACTIVE; + return this; + } + + public bool HasStreamDetails { + get { return result.hasStreamDetails; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails StreamDetails { + get { return result.StreamDetails; } + set { SetStreamDetails(value); } + } + public Builder SetStreamDetails(global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStreamDetails = true; + result.streamDetails_ = value; + return this; + } + public Builder SetStreamDetails(global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasStreamDetails = true; + result.streamDetails_ = builderForValue.Build(); + return this; + } + public Builder MergeStreamDetails(global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasStreamDetails && + result.streamDetails_ != global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.DefaultInstance) { + result.streamDetails_ = global::com.alicloud.openservices.tablestore.core.protocol.StreamDetails.CreateBuilder(result.streamDetails_).MergeFrom(value).BuildPartial(); + } else { + result.streamDetails_ = value; + } + result.hasStreamDetails = true; + return this; + } + public Builder ClearStreamDetails() { + PrepareBuilder(); + result.hasStreamDetails = false; + result.streamDetails_ = null; + return this; + } + + public pbc::IPopsicleList ShardSplitsList { + get { return PrepareBuilder().shardSplits_; } + } + public int ShardSplitsCount { + get { return result.ShardSplitsCount; } + } + public pb::ByteString GetShardSplits(int index) { + return result.GetShardSplits(index); + } + public Builder SetShardSplits(int index, pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.shardSplits_[index] = value; + return this; + } + public Builder AddShardSplits(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.shardSplits_.Add(value); + return this; + } + public Builder AddRangeShardSplits(scg::IEnumerable values) { + PrepareBuilder(); + result.shardSplits_.Add(values); + return this; + } + public Builder ClearShardSplits() { + PrepareBuilder(); + result.shardSplits_.Clear(); + return this; + } + + public pbc::IPopsicleList IndexMetasList { + get { return PrepareBuilder().indexMetas_; } + } + public int IndexMetasCount { + get { return result.IndexMetasCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta GetIndexMetas(int index) { + return result.GetIndexMetas(index); + } + public Builder SetIndexMetas(int index, global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.indexMetas_[index] = value; + return this; + } + public Builder SetIndexMetas(int index, global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.indexMetas_[index] = builderForValue.Build(); + return this; + } + public Builder AddIndexMetas(global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.indexMetas_.Add(value); + return this; + } + public Builder AddIndexMetas(global::com.alicloud.openservices.tablestore.core.protocol.IndexMeta.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.indexMetas_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeIndexMetas(scg::IEnumerable values) { + PrepareBuilder(); + result.indexMetas_.Add(values); + return this; + } + public Builder ClearIndexMetas() { + PrepareBuilder(); + result.indexMetas_.Clear(); + return this; + } + } + static DescribeTableResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ListTableRequest : pb::GeneratedMessage { + private ListTableRequest() { } + private static readonly ListTableRequest defaultInstance = new ListTableRequest().MakeReadOnly(); + private static readonly string[] _listTableRequestFieldNames = new string[] { }; + private static readonly uint[] _listTableRequestFieldTags = new uint[] { }; + public static ListTableRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ListTableRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ListTableRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableRequest__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _listTableRequestFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ListTableRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ListTableRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ListTableRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ListTableRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ListTableRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ListTableRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ListTableRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ListTableRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ListTableRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ListTableRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ListTableRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ListTableRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ListTableRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ListTableRequest result; + + private ListTableRequest PrepareBuilder() { + if (resultIsReadOnly) { + ListTableRequest original = result; + result = new ListTableRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ListTableRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ListTableRequest.Descriptor; } + } + + public override ListTableRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ListTableRequest.DefaultInstance; } + } + + public override ListTableRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ListTableRequest) { + return MergeFrom((ListTableRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ListTableRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ListTableRequest.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_listTableRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _listTableRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static ListTableRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ListTableResponse : pb::GeneratedMessage { + private ListTableResponse() { } + private static readonly ListTableResponse defaultInstance = new ListTableResponse().MakeReadOnly(); + private static readonly string[] _listTableResponseFieldNames = new string[] { "table_names" }; + private static readonly uint[] _listTableResponseFieldTags = new uint[] { 10 }; + public static ListTableResponse DefaultInstance { + get { return defaultInstance; } + } + + public override ListTableResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ListTableResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ListTableResponse__FieldAccessorTable; } + } + + public const int TableNamesFieldNumber = 1; + private pbc::PopsicleList tableNames_ = new pbc::PopsicleList(); + public scg::IList TableNamesList { + get { return pbc::Lists.AsReadOnly(tableNames_); } + } + public int TableNamesCount { + get { return tableNames_.Count; } + } + public string GetTableNames(int index) { + return tableNames_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _listTableResponseFieldNames; + if (tableNames_.Count > 0) { + output.WriteStringArray(1, field_names[0], tableNames_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + foreach (string element in TableNamesList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * tableNames_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ListTableResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ListTableResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ListTableResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ListTableResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ListTableResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ListTableResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ListTableResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ListTableResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ListTableResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ListTableResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ListTableResponse MakeReadOnly() { + tableNames_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ListTableResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ListTableResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ListTableResponse result; + + private ListTableResponse PrepareBuilder() { + if (resultIsReadOnly) { + ListTableResponse original = result; + result = new ListTableResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ListTableResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ListTableResponse.Descriptor; } + } + + public override ListTableResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ListTableResponse.DefaultInstance; } + } + + public override ListTableResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ListTableResponse) { + return MergeFrom((ListTableResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ListTableResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ListTableResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.tableNames_.Count != 0) { + result.tableNames_.Add(other.tableNames_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_listTableResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _listTableResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadStringArray(tag, field_name, result.tableNames_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList TableNamesList { + get { return PrepareBuilder().tableNames_; } + } + public int TableNamesCount { + get { return result.TableNamesCount; } + } + public string GetTableNames(int index) { + return result.GetTableNames(index); + } + public Builder SetTableNames(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.tableNames_[index] = value; + return this; + } + public Builder AddTableNames(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.tableNames_.Add(value); + return this; + } + public Builder AddRangeTableNames(scg::IEnumerable values) { + PrepareBuilder(); + result.tableNames_.Add(values); + return this; + } + public Builder ClearTableNames() { + PrepareBuilder(); + result.tableNames_.Clear(); + return this; + } + } + static ListTableResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DeleteTableRequest : pb::GeneratedMessage { + private DeleteTableRequest() { } + private static readonly DeleteTableRequest defaultInstance = new DeleteTableRequest().MakeReadOnly(); + private static readonly string[] _deleteTableRequestFieldNames = new string[] { "table_name" }; + private static readonly uint[] _deleteTableRequestFieldTags = new uint[] { 10 }; + public static DeleteTableRequest DefaultInstance { + get { return defaultInstance; } + } + + public override DeleteTableRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DeleteTableRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _deleteTableRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[0], TableName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DeleteTableRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteTableRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteTableRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteTableRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteTableRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteTableRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DeleteTableRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DeleteTableRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DeleteTableRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteTableRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DeleteTableRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DeleteTableRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DeleteTableRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DeleteTableRequest result; + + private DeleteTableRequest PrepareBuilder() { + if (resultIsReadOnly) { + DeleteTableRequest original = result; + result = new DeleteTableRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DeleteTableRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DeleteTableRequest.Descriptor; } + } + + public override DeleteTableRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DeleteTableRequest.DefaultInstance; } + } + + public override DeleteTableRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DeleteTableRequest) { + return MergeFrom((DeleteTableRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DeleteTableRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DeleteTableRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_deleteTableRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _deleteTableRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + } + static DeleteTableRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DeleteTableResponse : pb::GeneratedMessage { + private DeleteTableResponse() { } + private static readonly DeleteTableResponse defaultInstance = new DeleteTableResponse().MakeReadOnly(); + private static readonly string[] _deleteTableResponseFieldNames = new string[] { }; + private static readonly uint[] _deleteTableResponseFieldTags = new uint[] { }; + public static DeleteTableResponse DefaultInstance { + get { return defaultInstance; } + } + + public override DeleteTableResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DeleteTableResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteTableResponse__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _deleteTableResponseFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DeleteTableResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteTableResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteTableResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteTableResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteTableResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteTableResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DeleteTableResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DeleteTableResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DeleteTableResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteTableResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DeleteTableResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DeleteTableResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DeleteTableResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DeleteTableResponse result; + + private DeleteTableResponse PrepareBuilder() { + if (resultIsReadOnly) { + DeleteTableResponse original = result; + result = new DeleteTableResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DeleteTableResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DeleteTableResponse.Descriptor; } + } + + public override DeleteTableResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DeleteTableResponse.DefaultInstance; } + } + + public override DeleteTableResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DeleteTableResponse) { + return MergeFrom((DeleteTableResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DeleteTableResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DeleteTableResponse.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_deleteTableResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _deleteTableResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static DeleteTableResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class LoadTableRequest : pb::GeneratedMessage { + private LoadTableRequest() { } + private static readonly LoadTableRequest defaultInstance = new LoadTableRequest().MakeReadOnly(); + private static readonly string[] _loadTableRequestFieldNames = new string[] { "table_name" }; + private static readonly uint[] _loadTableRequestFieldTags = new uint[] { 10 }; + public static LoadTableRequest DefaultInstance { + get { return defaultInstance; } + } + + public override LoadTableRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override LoadTableRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _loadTableRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[0], TableName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static LoadTableRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static LoadTableRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static LoadTableRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static LoadTableRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static LoadTableRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static LoadTableRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static LoadTableRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static LoadTableRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static LoadTableRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static LoadTableRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private LoadTableRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(LoadTableRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(LoadTableRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private LoadTableRequest result; + + private LoadTableRequest PrepareBuilder() { + if (resultIsReadOnly) { + LoadTableRequest original = result; + result = new LoadTableRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override LoadTableRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.LoadTableRequest.Descriptor; } + } + + public override LoadTableRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.LoadTableRequest.DefaultInstance; } + } + + public override LoadTableRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is LoadTableRequest) { + return MergeFrom((LoadTableRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(LoadTableRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.LoadTableRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_loadTableRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _loadTableRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + } + static LoadTableRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class LoadTableResponse : pb::GeneratedMessage { + private LoadTableResponse() { } + private static readonly LoadTableResponse defaultInstance = new LoadTableResponse().MakeReadOnly(); + private static readonly string[] _loadTableResponseFieldNames = new string[] { }; + private static readonly uint[] _loadTableResponseFieldTags = new uint[] { }; + public static LoadTableResponse DefaultInstance { + get { return defaultInstance; } + } + + public override LoadTableResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override LoadTableResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_LoadTableResponse__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _loadTableResponseFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static LoadTableResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static LoadTableResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static LoadTableResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static LoadTableResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static LoadTableResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static LoadTableResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static LoadTableResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static LoadTableResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static LoadTableResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static LoadTableResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private LoadTableResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(LoadTableResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(LoadTableResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private LoadTableResponse result; + + private LoadTableResponse PrepareBuilder() { + if (resultIsReadOnly) { + LoadTableResponse original = result; + result = new LoadTableResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override LoadTableResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.LoadTableResponse.Descriptor; } + } + + public override LoadTableResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.LoadTableResponse.DefaultInstance; } + } + + public override LoadTableResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is LoadTableResponse) { + return MergeFrom((LoadTableResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(LoadTableResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.LoadTableResponse.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_loadTableResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _loadTableResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static LoadTableResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class UnloadTableRequest : pb::GeneratedMessage { + private UnloadTableRequest() { } + private static readonly UnloadTableRequest defaultInstance = new UnloadTableRequest().MakeReadOnly(); + private static readonly string[] _unloadTableRequestFieldNames = new string[] { "table_name" }; + private static readonly uint[] _unloadTableRequestFieldTags = new uint[] { 10 }; + public static UnloadTableRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UnloadTableRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UnloadTableRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _unloadTableRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[0], TableName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static UnloadTableRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnloadTableRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnloadTableRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnloadTableRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnloadTableRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnloadTableRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UnloadTableRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UnloadTableRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UnloadTableRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnloadTableRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UnloadTableRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UnloadTableRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnloadTableRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnloadTableRequest result; + + private UnloadTableRequest PrepareBuilder() { + if (resultIsReadOnly) { + UnloadTableRequest original = result; + result = new UnloadTableRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UnloadTableRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.UnloadTableRequest.Descriptor; } + } + + public override UnloadTableRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.UnloadTableRequest.DefaultInstance; } + } + + public override UnloadTableRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UnloadTableRequest) { + return MergeFrom((UnloadTableRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UnloadTableRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.UnloadTableRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unloadTableRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unloadTableRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + } + static UnloadTableRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class UnloadTableResponse : pb::GeneratedMessage { + private UnloadTableResponse() { } + private static readonly UnloadTableResponse defaultInstance = new UnloadTableResponse().MakeReadOnly(); + private static readonly string[] _unloadTableResponseFieldNames = new string[] { }; + private static readonly uint[] _unloadTableResponseFieldTags = new uint[] { }; + public static UnloadTableResponse DefaultInstance { + get { return defaultInstance; } + } + + public override UnloadTableResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UnloadTableResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_UnloadTableResponse__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _unloadTableResponseFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static UnloadTableResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnloadTableResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnloadTableResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UnloadTableResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UnloadTableResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnloadTableResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UnloadTableResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UnloadTableResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UnloadTableResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UnloadTableResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UnloadTableResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UnloadTableResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UnloadTableResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UnloadTableResponse result; + + private UnloadTableResponse PrepareBuilder() { + if (resultIsReadOnly) { + UnloadTableResponse original = result; + result = new UnloadTableResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UnloadTableResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.UnloadTableResponse.Descriptor; } + } + + public override UnloadTableResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.UnloadTableResponse.DefaultInstance; } + } + + public override UnloadTableResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UnloadTableResponse) { + return MergeFrom((UnloadTableResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UnloadTableResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.UnloadTableResponse.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_unloadTableResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _unloadTableResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static UnloadTableResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TimeRange : pb::GeneratedMessage { + private TimeRange() { } + private static readonly TimeRange defaultInstance = new TimeRange().MakeReadOnly(); + private static readonly string[] _timeRangeFieldNames = new string[] { "end_time", "specific_time", "start_time" }; + private static readonly uint[] _timeRangeFieldTags = new uint[] { 16, 24, 8 }; + public static TimeRange DefaultInstance { + get { return defaultInstance; } + } + + public override TimeRange DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TimeRange ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TimeRange__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TimeRange__FieldAccessorTable; } + } + + public const int StartTimeFieldNumber = 1; + private bool hasStartTime; + private long startTime_; + public bool HasStartTime { + get { return hasStartTime; } + } + public long StartTime { + get { return startTime_; } + } + + public const int EndTimeFieldNumber = 2; + private bool hasEndTime; + private long endTime_; + public bool HasEndTime { + get { return hasEndTime; } + } + public long EndTime { + get { return endTime_; } + } + + public const int SpecificTimeFieldNumber = 3; + private bool hasSpecificTime; + private long specificTime_; + public bool HasSpecificTime { + get { return hasSpecificTime; } + } + public long SpecificTime { + get { return specificTime_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _timeRangeFieldNames; + if (hasStartTime) { + output.WriteInt64(1, field_names[2], StartTime); + } + if (hasEndTime) { + output.WriteInt64(2, field_names[0], EndTime); + } + if (hasSpecificTime) { + output.WriteInt64(3, field_names[1], SpecificTime); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasStartTime) { + size += pb::CodedOutputStream.ComputeInt64Size(1, StartTime); + } + if (hasEndTime) { + size += pb::CodedOutputStream.ComputeInt64Size(2, EndTime); + } + if (hasSpecificTime) { + size += pb::CodedOutputStream.ComputeInt64Size(3, SpecificTime); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TimeRange ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TimeRange ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TimeRange ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TimeRange ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TimeRange ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TimeRange ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TimeRange ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TimeRange ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TimeRange ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TimeRange ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TimeRange MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TimeRange prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TimeRange cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TimeRange result; + + private TimeRange PrepareBuilder() { + if (resultIsReadOnly) { + TimeRange original = result; + result = new TimeRange(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TimeRange MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.Descriptor; } + } + + public override TimeRange DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.DefaultInstance; } + } + + public override TimeRange BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TimeRange) { + return MergeFrom((TimeRange) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TimeRange other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasStartTime) { + StartTime = other.StartTime; + } + if (other.HasEndTime) { + EndTime = other.EndTime; + } + if (other.HasSpecificTime) { + SpecificTime = other.SpecificTime; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_timeRangeFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _timeRangeFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasStartTime = input.ReadInt64(ref result.startTime_); + break; + } + case 16: { + result.hasEndTime = input.ReadInt64(ref result.endTime_); + break; + } + case 24: { + result.hasSpecificTime = input.ReadInt64(ref result.specificTime_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasStartTime { + get { return result.hasStartTime; } + } + public long StartTime { + get { return result.StartTime; } + set { SetStartTime(value); } + } + public Builder SetStartTime(long value) { + PrepareBuilder(); + result.hasStartTime = true; + result.startTime_ = value; + return this; + } + public Builder ClearStartTime() { + PrepareBuilder(); + result.hasStartTime = false; + result.startTime_ = 0L; + return this; + } + + public bool HasEndTime { + get { return result.hasEndTime; } + } + public long EndTime { + get { return result.EndTime; } + set { SetEndTime(value); } + } + public Builder SetEndTime(long value) { + PrepareBuilder(); + result.hasEndTime = true; + result.endTime_ = value; + return this; + } + public Builder ClearEndTime() { + PrepareBuilder(); + result.hasEndTime = false; + result.endTime_ = 0L; + return this; + } + + public bool HasSpecificTime { + get { return result.hasSpecificTime; } + } + public long SpecificTime { + get { return result.SpecificTime; } + set { SetSpecificTime(value); } + } + public Builder SetSpecificTime(long value) { + PrepareBuilder(); + result.hasSpecificTime = true; + result.specificTime_ = value; + return this; + } + public Builder ClearSpecificTime() { + PrepareBuilder(); + result.hasSpecificTime = false; + result.specificTime_ = 0L; + return this; + } + } + static TimeRange() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ReturnContent : pb::GeneratedMessage { + private ReturnContent() { } + private static readonly ReturnContent defaultInstance = new ReturnContent().MakeReadOnly(); + private static readonly string[] _returnContentFieldNames = new string[] { "return_column_names", "return_type" }; + private static readonly uint[] _returnContentFieldTags = new uint[] { 18, 8 }; + public static ReturnContent DefaultInstance { + get { return defaultInstance; } + } + + public override ReturnContent DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ReturnContent ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ReturnContent__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ReturnContent__FieldAccessorTable; } + } + + public const int ReturnTypeFieldNumber = 1; + private bool hasReturnType; + private global::com.alicloud.openservices.tablestore.core.protocol.ReturnType returnType_ = global::com.alicloud.openservices.tablestore.core.protocol.ReturnType.RT_NONE; + public bool HasReturnType { + get { return hasReturnType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReturnType ReturnType { + get { return returnType_; } + } + + public const int ReturnColumnNamesFieldNumber = 2; + private pbc::PopsicleList returnColumnNames_ = new pbc::PopsicleList(); + public scg::IList ReturnColumnNamesList { + get { return pbc::Lists.AsReadOnly(returnColumnNames_); } + } + public int ReturnColumnNamesCount { + get { return returnColumnNames_.Count; } + } + public string GetReturnColumnNames(int index) { + return returnColumnNames_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _returnContentFieldNames; + if (hasReturnType) { + output.WriteEnum(1, field_names[1], (int) ReturnType, ReturnType); + } + if (returnColumnNames_.Count > 0) { + output.WriteStringArray(2, field_names[0], returnColumnNames_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasReturnType) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) ReturnType); + } + { + int dataSize = 0; + foreach (string element in ReturnColumnNamesList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * returnColumnNames_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ReturnContent ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReturnContent ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReturnContent ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ReturnContent ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ReturnContent ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReturnContent ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ReturnContent ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ReturnContent ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ReturnContent ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ReturnContent ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ReturnContent MakeReadOnly() { + returnColumnNames_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ReturnContent prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ReturnContent cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ReturnContent result; + + private ReturnContent PrepareBuilder() { + if (resultIsReadOnly) { + ReturnContent original = result; + result = new ReturnContent(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ReturnContent MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.Descriptor; } + } + + public override ReturnContent DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.DefaultInstance; } + } + + public override ReturnContent BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ReturnContent) { + return MergeFrom((ReturnContent) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ReturnContent other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasReturnType) { + ReturnType = other.ReturnType; + } + if (other.returnColumnNames_.Count != 0) { + result.returnColumnNames_.Add(other.returnColumnNames_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_returnContentFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _returnContentFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.returnType_, out unknown)) { + result.hasReturnType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + case 18: { + input.ReadStringArray(tag, field_name, result.returnColumnNames_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasReturnType { + get { return result.hasReturnType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReturnType ReturnType { + get { return result.ReturnType; } + set { SetReturnType(value); } + } + public Builder SetReturnType(global::com.alicloud.openservices.tablestore.core.protocol.ReturnType value) { + PrepareBuilder(); + result.hasReturnType = true; + result.returnType_ = value; + return this; + } + public Builder ClearReturnType() { + PrepareBuilder(); + result.hasReturnType = false; + result.returnType_ = global::com.alicloud.openservices.tablestore.core.protocol.ReturnType.RT_NONE; + return this; + } + + public pbc::IPopsicleList ReturnColumnNamesList { + get { return PrepareBuilder().returnColumnNames_; } + } + public int ReturnColumnNamesCount { + get { return result.ReturnColumnNamesCount; } + } + public string GetReturnColumnNames(int index) { + return result.GetReturnColumnNames(index); + } + public Builder SetReturnColumnNames(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.returnColumnNames_[index] = value; + return this; + } + public Builder AddReturnColumnNames(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.returnColumnNames_.Add(value); + return this; + } + public Builder AddRangeReturnColumnNames(scg::IEnumerable values) { + PrepareBuilder(); + result.returnColumnNames_.Add(values); + return this; + } + public Builder ClearReturnColumnNames() { + PrepareBuilder(); + result.returnColumnNames_.Clear(); + return this; + } + } + static ReturnContent() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class GetRowRequest : pb::GeneratedMessage { + private GetRowRequest() { } + private static readonly GetRowRequest defaultInstance = new GetRowRequest().MakeReadOnly(); + private static readonly string[] _getRowRequestFieldNames = new string[] { "cache_blocks", "columns_to_get", "end_column", "filter", "max_versions", "primary_key", "start_column", "table_name", "time_range", "token", "transaction_id" }; + private static readonly uint[] _getRowRequestFieldTags = new uint[] { 48, 26, 74, 58, 40, 18, 66, 10, 34, 82, 90 }; + public static GetRowRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetRowRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetRowRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int PrimaryKeyFieldNumber = 2; + private bool hasPrimaryKey; + private pb::ByteString primaryKey_ = pb::ByteString.Empty; + public bool HasPrimaryKey { + get { return hasPrimaryKey; } + } + public pb::ByteString PrimaryKey { + get { return primaryKey_; } + } + + public const int ColumnsToGetFieldNumber = 3; + private pbc::PopsicleList columnsToGet_ = new pbc::PopsicleList(); + public scg::IList ColumnsToGetList { + get { return pbc::Lists.AsReadOnly(columnsToGet_); } + } + public int ColumnsToGetCount { + get { return columnsToGet_.Count; } + } + public string GetColumnsToGet(int index) { + return columnsToGet_[index]; + } + + public const int TimeRangeFieldNumber = 4; + private bool hasTimeRange; + private global::com.alicloud.openservices.tablestore.core.protocol.TimeRange timeRange_; + public bool HasTimeRange { + get { return hasTimeRange; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TimeRange TimeRange { + get { return timeRange_ ?? global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.DefaultInstance; } + } + + public const int MaxVersionsFieldNumber = 5; + private bool hasMaxVersions; + private int maxVersions_; + public bool HasMaxVersions { + get { return hasMaxVersions; } + } + public int MaxVersions { + get { return maxVersions_; } + } + + public const int CacheBlocksFieldNumber = 6; + private bool hasCacheBlocks; + private bool cacheBlocks_ = true; + public bool HasCacheBlocks { + get { return hasCacheBlocks; } + } + public bool CacheBlocks { + get { return cacheBlocks_; } + } + + public const int FilterFieldNumber = 7; + private bool hasFilter; + private pb::ByteString filter_ = pb::ByteString.Empty; + public bool HasFilter { + get { return hasFilter; } + } + public pb::ByteString Filter { + get { return filter_; } + } + + public const int StartColumnFieldNumber = 8; + private bool hasStartColumn; + private string startColumn_ = ""; + public bool HasStartColumn { + get { return hasStartColumn; } + } + public string StartColumn { + get { return startColumn_; } + } + + public const int EndColumnFieldNumber = 9; + private bool hasEndColumn; + private string endColumn_ = ""; + public bool HasEndColumn { + get { return hasEndColumn; } + } + public string EndColumn { + get { return endColumn_; } + } + + public const int TokenFieldNumber = 10; + private bool hasToken; + private pb::ByteString token_ = pb::ByteString.Empty; + public bool HasToken { + get { return hasToken; } + } + public pb::ByteString Token { + get { return token_; } + } + + public const int TransactionIdFieldNumber = 11; + private bool hasTransactionId; + private string transactionId_ = ""; + public bool HasTransactionId { + get { return hasTransactionId; } + } + public string TransactionId { + get { return transactionId_; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + if (!hasPrimaryKey) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _getRowRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[7], TableName); + } + if (hasPrimaryKey) { + output.WriteBytes(2, field_names[5], PrimaryKey); + } + if (columnsToGet_.Count > 0) { + output.WriteStringArray(3, field_names[1], columnsToGet_); + } + if (hasTimeRange) { + output.WriteMessage(4, field_names[8], TimeRange); + } + if (hasMaxVersions) { + output.WriteInt32(5, field_names[4], MaxVersions); + } + if (hasCacheBlocks) { + output.WriteBool(6, field_names[0], CacheBlocks); + } + if (hasFilter) { + output.WriteBytes(7, field_names[3], Filter); + } + if (hasStartColumn) { + output.WriteString(8, field_names[6], StartColumn); + } + if (hasEndColumn) { + output.WriteString(9, field_names[2], EndColumn); + } + if (hasToken) { + output.WriteBytes(10, field_names[9], Token); + } + if (hasTransactionId) { + output.WriteString(11, field_names[10], TransactionId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + if (hasPrimaryKey) { + size += pb::CodedOutputStream.ComputeBytesSize(2, PrimaryKey); + } + { + int dataSize = 0; + foreach (string element in ColumnsToGetList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * columnsToGet_.Count; + } + if (hasTimeRange) { + size += pb::CodedOutputStream.ComputeMessageSize(4, TimeRange); + } + if (hasMaxVersions) { + size += pb::CodedOutputStream.ComputeInt32Size(5, MaxVersions); + } + if (hasCacheBlocks) { + size += pb::CodedOutputStream.ComputeBoolSize(6, CacheBlocks); + } + if (hasFilter) { + size += pb::CodedOutputStream.ComputeBytesSize(7, Filter); + } + if (hasStartColumn) { + size += pb::CodedOutputStream.ComputeStringSize(8, StartColumn); + } + if (hasEndColumn) { + size += pb::CodedOutputStream.ComputeStringSize(9, EndColumn); + } + if (hasToken) { + size += pb::CodedOutputStream.ComputeBytesSize(10, Token); + } + if (hasTransactionId) { + size += pb::CodedOutputStream.ComputeStringSize(11, TransactionId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static GetRowRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetRowRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetRowRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetRowRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetRowRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetRowRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetRowRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetRowRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetRowRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetRowRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetRowRequest MakeReadOnly() { + columnsToGet_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetRowRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetRowRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetRowRequest result; + + private GetRowRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetRowRequest original = result; + result = new GetRowRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetRowRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetRowRequest.Descriptor; } + } + + public override GetRowRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetRowRequest.DefaultInstance; } + } + + public override GetRowRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetRowRequest) { + return MergeFrom((GetRowRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetRowRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.GetRowRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasPrimaryKey) { + PrimaryKey = other.PrimaryKey; + } + if (other.columnsToGet_.Count != 0) { + result.columnsToGet_.Add(other.columnsToGet_); + } + if (other.HasTimeRange) { + MergeTimeRange(other.TimeRange); + } + if (other.HasMaxVersions) { + MaxVersions = other.MaxVersions; + } + if (other.HasCacheBlocks) { + CacheBlocks = other.CacheBlocks; + } + if (other.HasFilter) { + Filter = other.Filter; + } + if (other.HasStartColumn) { + StartColumn = other.StartColumn; + } + if (other.HasEndColumn) { + EndColumn = other.EndColumn; + } + if (other.HasToken) { + Token = other.Token; + } + if (other.HasTransactionId) { + TransactionId = other.TransactionId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getRowRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getRowRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + result.hasPrimaryKey = input.ReadBytes(ref result.primaryKey_); + break; + } + case 26: { + input.ReadStringArray(tag, field_name, result.columnsToGet_); + break; + } + case 34: { + global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.CreateBuilder(); + if (result.hasTimeRange) { + subBuilder.MergeFrom(TimeRange); + } + input.ReadMessage(subBuilder, extensionRegistry); + TimeRange = subBuilder.BuildPartial(); + break; + } + case 40: { + result.hasMaxVersions = input.ReadInt32(ref result.maxVersions_); + break; + } + case 48: { + result.hasCacheBlocks = input.ReadBool(ref result.cacheBlocks_); + break; + } + case 58: { + result.hasFilter = input.ReadBytes(ref result.filter_); + break; + } + case 66: { + result.hasStartColumn = input.ReadString(ref result.startColumn_); + break; + } + case 74: { + result.hasEndColumn = input.ReadString(ref result.endColumn_); + break; + } + case 82: { + result.hasToken = input.ReadBytes(ref result.token_); + break; + } + case 90: { + result.hasTransactionId = input.ReadString(ref result.transactionId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasPrimaryKey { + get { return result.hasPrimaryKey; } + } + public pb::ByteString PrimaryKey { + get { return result.PrimaryKey; } + set { SetPrimaryKey(value); } + } + public Builder SetPrimaryKey(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPrimaryKey = true; + result.primaryKey_ = value; + return this; + } + public Builder ClearPrimaryKey() { + PrepareBuilder(); + result.hasPrimaryKey = false; + result.primaryKey_ = pb::ByteString.Empty; + return this; + } + + public pbc::IPopsicleList ColumnsToGetList { + get { return PrepareBuilder().columnsToGet_; } + } + public int ColumnsToGetCount { + get { return result.ColumnsToGetCount; } + } + public string GetColumnsToGet(int index) { + return result.GetColumnsToGet(index); + } + public Builder SetColumnsToGet(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.columnsToGet_[index] = value; + return this; + } + public Builder AddColumnsToGet(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.columnsToGet_.Add(value); + return this; + } + public Builder AddRangeColumnsToGet(scg::IEnumerable values) { + PrepareBuilder(); + result.columnsToGet_.Add(values); + return this; + } + public Builder ClearColumnsToGet() { + PrepareBuilder(); + result.columnsToGet_.Clear(); + return this; + } + + public bool HasTimeRange { + get { return result.hasTimeRange; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TimeRange TimeRange { + get { return result.TimeRange; } + set { SetTimeRange(value); } + } + public Builder SetTimeRange(global::com.alicloud.openservices.tablestore.core.protocol.TimeRange value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTimeRange = true; + result.timeRange_ = value; + return this; + } + public Builder SetTimeRange(global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTimeRange = true; + result.timeRange_ = builderForValue.Build(); + return this; + } + public Builder MergeTimeRange(global::com.alicloud.openservices.tablestore.core.protocol.TimeRange value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTimeRange && + result.timeRange_ != global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.DefaultInstance) { + result.timeRange_ = global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.CreateBuilder(result.timeRange_).MergeFrom(value).BuildPartial(); + } else { + result.timeRange_ = value; + } + result.hasTimeRange = true; + return this; + } + public Builder ClearTimeRange() { + PrepareBuilder(); + result.hasTimeRange = false; + result.timeRange_ = null; + return this; + } + + public bool HasMaxVersions { + get { return result.hasMaxVersions; } + } + public int MaxVersions { + get { return result.MaxVersions; } + set { SetMaxVersions(value); } + } + public Builder SetMaxVersions(int value) { + PrepareBuilder(); + result.hasMaxVersions = true; + result.maxVersions_ = value; + return this; + } + public Builder ClearMaxVersions() { + PrepareBuilder(); + result.hasMaxVersions = false; + result.maxVersions_ = 0; + return this; + } + + public bool HasCacheBlocks { + get { return result.hasCacheBlocks; } + } + public bool CacheBlocks { + get { return result.CacheBlocks; } + set { SetCacheBlocks(value); } + } + public Builder SetCacheBlocks(bool value) { + PrepareBuilder(); + result.hasCacheBlocks = true; + result.cacheBlocks_ = value; + return this; + } + public Builder ClearCacheBlocks() { + PrepareBuilder(); + result.hasCacheBlocks = false; + result.cacheBlocks_ = true; + return this; + } + + public bool HasFilter { + get { return result.hasFilter; } + } + public pb::ByteString Filter { + get { return result.Filter; } + set { SetFilter(value); } + } + public Builder SetFilter(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = value; + return this; + } + public Builder ClearFilter() { + PrepareBuilder(); + result.hasFilter = false; + result.filter_ = pb::ByteString.Empty; + return this; + } + + public bool HasStartColumn { + get { return result.hasStartColumn; } + } + public string StartColumn { + get { return result.StartColumn; } + set { SetStartColumn(value); } + } + public Builder SetStartColumn(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStartColumn = true; + result.startColumn_ = value; + return this; + } + public Builder ClearStartColumn() { + PrepareBuilder(); + result.hasStartColumn = false; + result.startColumn_ = ""; + return this; + } + + public bool HasEndColumn { + get { return result.hasEndColumn; } + } + public string EndColumn { + get { return result.EndColumn; } + set { SetEndColumn(value); } + } + public Builder SetEndColumn(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEndColumn = true; + result.endColumn_ = value; + return this; + } + public Builder ClearEndColumn() { + PrepareBuilder(); + result.hasEndColumn = false; + result.endColumn_ = ""; + return this; + } + + public bool HasToken { + get { return result.hasToken; } + } + public pb::ByteString Token { + get { return result.Token; } + set { SetToken(value); } + } + public Builder SetToken(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasToken = true; + result.token_ = value; + return this; + } + public Builder ClearToken() { + PrepareBuilder(); + result.hasToken = false; + result.token_ = pb::ByteString.Empty; + return this; + } + + public bool HasTransactionId { + get { return result.hasTransactionId; } + } + public string TransactionId { + get { return result.TransactionId; } + set { SetTransactionId(value); } + } + public Builder SetTransactionId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTransactionId = true; + result.transactionId_ = value; + return this; + } + public Builder ClearTransactionId() { + PrepareBuilder(); + result.hasTransactionId = false; + result.transactionId_ = ""; + return this; + } + } + static GetRowRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class GetRowResponse : pb::GeneratedMessage { + private GetRowResponse() { } + private static readonly GetRowResponse defaultInstance = new GetRowResponse().MakeReadOnly(); + private static readonly string[] _getRowResponseFieldNames = new string[] { "consumed", "next_token", "row" }; + private static readonly uint[] _getRowResponseFieldTags = new uint[] { 10, 26, 18 }; + public static GetRowResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetRowResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetRowResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRowResponse__FieldAccessorTable; } + } + + public const int ConsumedFieldNumber = 1; + private bool hasConsumed; + private global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity consumed_; + public bool HasConsumed { + get { return hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return consumed_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance; } + } + + public const int RowFieldNumber = 2; + private bool hasRow; + private pb::ByteString row_ = pb::ByteString.Empty; + public bool HasRow { + get { return hasRow; } + } + public pb::ByteString Row { + get { return row_; } + } + + public const int NextTokenFieldNumber = 3; + private bool hasNextToken; + private pb::ByteString nextToken_ = pb::ByteString.Empty; + public bool HasNextToken { + get { return hasNextToken; } + } + public pb::ByteString NextToken { + get { return nextToken_; } + } + + public override bool IsInitialized { + get { + if (!hasConsumed) return false; + if (!hasRow) return false; + if (!Consumed.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _getRowResponseFieldNames; + if (hasConsumed) { + output.WriteMessage(1, field_names[0], Consumed); + } + if (hasRow) { + output.WriteBytes(2, field_names[2], Row); + } + if (hasNextToken) { + output.WriteBytes(3, field_names[1], NextToken); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasConsumed) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Consumed); + } + if (hasRow) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Row); + } + if (hasNextToken) { + size += pb::CodedOutputStream.ComputeBytesSize(3, NextToken); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static GetRowResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetRowResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetRowResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetRowResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetRowResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetRowResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetRowResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetRowResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetRowResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetRowResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetRowResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetRowResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetRowResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetRowResponse result; + + private GetRowResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetRowResponse original = result; + result = new GetRowResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetRowResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetRowResponse.Descriptor; } + } + + public override GetRowResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetRowResponse.DefaultInstance; } + } + + public override GetRowResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetRowResponse) { + return MergeFrom((GetRowResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetRowResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.GetRowResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasConsumed) { + MergeConsumed(other.Consumed); + } + if (other.HasRow) { + Row = other.Row; + } + if (other.HasNextToken) { + NextToken = other.NextToken; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getRowResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getRowResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(); + if (result.hasConsumed) { + subBuilder.MergeFrom(Consumed); + } + input.ReadMessage(subBuilder, extensionRegistry); + Consumed = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasRow = input.ReadBytes(ref result.row_); + break; + } + case 26: { + result.hasNextToken = input.ReadBytes(ref result.nextToken_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasConsumed { + get { return result.hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return result.Consumed; } + set { SetConsumed(value); } + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = value; + return this; + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = builderForValue.Build(); + return this; + } + public Builder MergeConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasConsumed && + result.consumed_ != global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance) { + result.consumed_ = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(result.consumed_).MergeFrom(value).BuildPartial(); + } else { + result.consumed_ = value; + } + result.hasConsumed = true; + return this; + } + public Builder ClearConsumed() { + PrepareBuilder(); + result.hasConsumed = false; + result.consumed_ = null; + return this; + } + + public bool HasRow { + get { return result.hasRow; } + } + public pb::ByteString Row { + get { return result.Row; } + set { SetRow(value); } + } + public Builder SetRow(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRow = true; + result.row_ = value; + return this; + } + public Builder ClearRow() { + PrepareBuilder(); + result.hasRow = false; + result.row_ = pb::ByteString.Empty; + return this; + } + + public bool HasNextToken { + get { return result.hasNextToken; } + } + public pb::ByteString NextToken { + get { return result.NextToken; } + set { SetNextToken(value); } + } + public Builder SetNextToken(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNextToken = true; + result.nextToken_ = value; + return this; + } + public Builder ClearNextToken() { + PrepareBuilder(); + result.hasNextToken = false; + result.nextToken_ = pb::ByteString.Empty; + return this; + } + } + static GetRowResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class UpdateRowRequest : pb::GeneratedMessage { + private UpdateRowRequest() { } + private static readonly UpdateRowRequest defaultInstance = new UpdateRowRequest().MakeReadOnly(); + private static readonly string[] _updateRowRequestFieldNames = new string[] { "condition", "return_content", "row_change", "table_name", "transaction_id" }; + private static readonly uint[] _updateRowRequestFieldTags = new uint[] { 26, 34, 18, 10, 42 }; + public static UpdateRowRequest DefaultInstance { + get { return defaultInstance; } + } + + public override UpdateRowRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UpdateRowRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int RowChangeFieldNumber = 2; + private bool hasRowChange; + private pb::ByteString rowChange_ = pb::ByteString.Empty; + public bool HasRowChange { + get { return hasRowChange; } + } + public pb::ByteString RowChange { + get { return rowChange_; } + } + + public const int ConditionFieldNumber = 3; + private bool hasCondition; + private global::com.alicloud.openservices.tablestore.core.protocol.Condition condition_; + public bool HasCondition { + get { return hasCondition; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Condition Condition { + get { return condition_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Condition.DefaultInstance; } + } + + public const int ReturnContentFieldNumber = 4; + private bool hasReturnContent; + private global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent returnContent_; + public bool HasReturnContent { + get { return hasReturnContent; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent ReturnContent { + get { return returnContent_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.DefaultInstance; } + } + + public const int TransactionIdFieldNumber = 5; + private bool hasTransactionId; + private string transactionId_ = ""; + public bool HasTransactionId { + get { return hasTransactionId; } + } + public string TransactionId { + get { return transactionId_; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + if (!hasRowChange) return false; + if (!hasCondition) return false; + if (!Condition.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _updateRowRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[3], TableName); + } + if (hasRowChange) { + output.WriteBytes(2, field_names[2], RowChange); + } + if (hasCondition) { + output.WriteMessage(3, field_names[0], Condition); + } + if (hasReturnContent) { + output.WriteMessage(4, field_names[1], ReturnContent); + } + if (hasTransactionId) { + output.WriteString(5, field_names[4], TransactionId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + if (hasRowChange) { + size += pb::CodedOutputStream.ComputeBytesSize(2, RowChange); + } + if (hasCondition) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Condition); + } + if (hasReturnContent) { + size += pb::CodedOutputStream.ComputeMessageSize(4, ReturnContent); + } + if (hasTransactionId) { + size += pb::CodedOutputStream.ComputeStringSize(5, TransactionId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static UpdateRowRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateRowRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateRowRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateRowRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateRowRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateRowRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UpdateRowRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UpdateRowRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UpdateRowRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateRowRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UpdateRowRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UpdateRowRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UpdateRowRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UpdateRowRequest result; + + private UpdateRowRequest PrepareBuilder() { + if (resultIsReadOnly) { + UpdateRowRequest original = result; + result = new UpdateRowRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UpdateRowRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.UpdateRowRequest.Descriptor; } + } + + public override UpdateRowRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.UpdateRowRequest.DefaultInstance; } + } + + public override UpdateRowRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UpdateRowRequest) { + return MergeFrom((UpdateRowRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UpdateRowRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.UpdateRowRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasRowChange) { + RowChange = other.RowChange; + } + if (other.HasCondition) { + MergeCondition(other.Condition); + } + if (other.HasReturnContent) { + MergeReturnContent(other.ReturnContent); + } + if (other.HasTransactionId) { + TransactionId = other.TransactionId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_updateRowRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateRowRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + result.hasRowChange = input.ReadBytes(ref result.rowChange_); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.Condition.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Condition.CreateBuilder(); + if (result.hasCondition) { + subBuilder.MergeFrom(Condition); + } + input.ReadMessage(subBuilder, extensionRegistry); + Condition = subBuilder.BuildPartial(); + break; + } + case 34: { + global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.CreateBuilder(); + if (result.hasReturnContent) { + subBuilder.MergeFrom(ReturnContent); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReturnContent = subBuilder.BuildPartial(); + break; + } + case 42: { + result.hasTransactionId = input.ReadString(ref result.transactionId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasRowChange { + get { return result.hasRowChange; } + } + public pb::ByteString RowChange { + get { return result.RowChange; } + set { SetRowChange(value); } + } + public Builder SetRowChange(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRowChange = true; + result.rowChange_ = value; + return this; + } + public Builder ClearRowChange() { + PrepareBuilder(); + result.hasRowChange = false; + result.rowChange_ = pb::ByteString.Empty; + return this; + } + + public bool HasCondition { + get { return result.hasCondition; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Condition Condition { + get { return result.Condition; } + set { SetCondition(value); } + } + public Builder SetCondition(global::com.alicloud.openservices.tablestore.core.protocol.Condition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCondition = true; + result.condition_ = value; + return this; + } + public Builder SetCondition(global::com.alicloud.openservices.tablestore.core.protocol.Condition.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasCondition = true; + result.condition_ = builderForValue.Build(); + return this; + } + public Builder MergeCondition(global::com.alicloud.openservices.tablestore.core.protocol.Condition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasCondition && + result.condition_ != global::com.alicloud.openservices.tablestore.core.protocol.Condition.DefaultInstance) { + result.condition_ = global::com.alicloud.openservices.tablestore.core.protocol.Condition.CreateBuilder(result.condition_).MergeFrom(value).BuildPartial(); + } else { + result.condition_ = value; + } + result.hasCondition = true; + return this; + } + public Builder ClearCondition() { + PrepareBuilder(); + result.hasCondition = false; + result.condition_ = null; + return this; + } + + public bool HasReturnContent { + get { return result.hasReturnContent; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent ReturnContent { + get { return result.ReturnContent; } + set { SetReturnContent(value); } + } + public Builder SetReturnContent(global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReturnContent = true; + result.returnContent_ = value; + return this; + } + public Builder SetReturnContent(global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReturnContent = true; + result.returnContent_ = builderForValue.Build(); + return this; + } + public Builder MergeReturnContent(global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReturnContent && + result.returnContent_ != global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.DefaultInstance) { + result.returnContent_ = global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.CreateBuilder(result.returnContent_).MergeFrom(value).BuildPartial(); + } else { + result.returnContent_ = value; + } + result.hasReturnContent = true; + return this; + } + public Builder ClearReturnContent() { + PrepareBuilder(); + result.hasReturnContent = false; + result.returnContent_ = null; + return this; + } + + public bool HasTransactionId { + get { return result.hasTransactionId; } + } + public string TransactionId { + get { return result.TransactionId; } + set { SetTransactionId(value); } + } + public Builder SetTransactionId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTransactionId = true; + result.transactionId_ = value; + return this; + } + public Builder ClearTransactionId() { + PrepareBuilder(); + result.hasTransactionId = false; + result.transactionId_ = ""; + return this; + } + } + static UpdateRowRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class UpdateRowResponse : pb::GeneratedMessage { + private UpdateRowResponse() { } + private static readonly UpdateRowResponse defaultInstance = new UpdateRowResponse().MakeReadOnly(); + private static readonly string[] _updateRowResponseFieldNames = new string[] { "consumed", "row" }; + private static readonly uint[] _updateRowResponseFieldTags = new uint[] { 10, 18 }; + public static UpdateRowResponse DefaultInstance { + get { return defaultInstance; } + } + + public override UpdateRowResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override UpdateRowResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_UpdateRowResponse__FieldAccessorTable; } + } + + public const int ConsumedFieldNumber = 1; + private bool hasConsumed; + private global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity consumed_; + public bool HasConsumed { + get { return hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return consumed_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance; } + } + + public const int RowFieldNumber = 2; + private bool hasRow; + private pb::ByteString row_ = pb::ByteString.Empty; + public bool HasRow { + get { return hasRow; } + } + public pb::ByteString Row { + get { return row_; } + } + + public override bool IsInitialized { + get { + if (!hasConsumed) return false; + if (!Consumed.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _updateRowResponseFieldNames; + if (hasConsumed) { + output.WriteMessage(1, field_names[0], Consumed); + } + if (hasRow) { + output.WriteBytes(2, field_names[1], Row); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasConsumed) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Consumed); + } + if (hasRow) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Row); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static UpdateRowResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateRowResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateRowResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static UpdateRowResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static UpdateRowResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateRowResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static UpdateRowResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static UpdateRowResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static UpdateRowResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static UpdateRowResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private UpdateRowResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(UpdateRowResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(UpdateRowResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private UpdateRowResponse result; + + private UpdateRowResponse PrepareBuilder() { + if (resultIsReadOnly) { + UpdateRowResponse original = result; + result = new UpdateRowResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override UpdateRowResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.UpdateRowResponse.Descriptor; } + } + + public override UpdateRowResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.UpdateRowResponse.DefaultInstance; } + } + + public override UpdateRowResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is UpdateRowResponse) { + return MergeFrom((UpdateRowResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(UpdateRowResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.UpdateRowResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasConsumed) { + MergeConsumed(other.Consumed); + } + if (other.HasRow) { + Row = other.Row; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_updateRowResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _updateRowResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(); + if (result.hasConsumed) { + subBuilder.MergeFrom(Consumed); + } + input.ReadMessage(subBuilder, extensionRegistry); + Consumed = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasRow = input.ReadBytes(ref result.row_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasConsumed { + get { return result.hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return result.Consumed; } + set { SetConsumed(value); } + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = value; + return this; + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = builderForValue.Build(); + return this; + } + public Builder MergeConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasConsumed && + result.consumed_ != global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance) { + result.consumed_ = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(result.consumed_).MergeFrom(value).BuildPartial(); + } else { + result.consumed_ = value; + } + result.hasConsumed = true; + return this; + } + public Builder ClearConsumed() { + PrepareBuilder(); + result.hasConsumed = false; + result.consumed_ = null; + return this; + } + + public bool HasRow { + get { return result.hasRow; } + } + public pb::ByteString Row { + get { return result.Row; } + set { SetRow(value); } + } + public Builder SetRow(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRow = true; + result.row_ = value; + return this; + } + public Builder ClearRow() { + PrepareBuilder(); + result.hasRow = false; + result.row_ = pb::ByteString.Empty; + return this; + } + } + static UpdateRowResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class PutRowRequest : pb::GeneratedMessage { + private PutRowRequest() { } + private static readonly PutRowRequest defaultInstance = new PutRowRequest().MakeReadOnly(); + private static readonly string[] _putRowRequestFieldNames = new string[] { "condition", "return_content", "row", "table_name", "transaction_id" }; + private static readonly uint[] _putRowRequestFieldTags = new uint[] { 26, 34, 18, 10, 42 }; + public static PutRowRequest DefaultInstance { + get { return defaultInstance; } + } + + public override PutRowRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PutRowRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int RowFieldNumber = 2; + private bool hasRow; + private pb::ByteString row_ = pb::ByteString.Empty; + public bool HasRow { + get { return hasRow; } + } + public pb::ByteString Row { + get { return row_; } + } + + public const int ConditionFieldNumber = 3; + private bool hasCondition; + private global::com.alicloud.openservices.tablestore.core.protocol.Condition condition_; + public bool HasCondition { + get { return hasCondition; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Condition Condition { + get { return condition_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Condition.DefaultInstance; } + } + + public const int ReturnContentFieldNumber = 4; + private bool hasReturnContent; + private global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent returnContent_; + public bool HasReturnContent { + get { return hasReturnContent; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent ReturnContent { + get { return returnContent_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.DefaultInstance; } + } + + public const int TransactionIdFieldNumber = 5; + private bool hasTransactionId; + private string transactionId_ = ""; + public bool HasTransactionId { + get { return hasTransactionId; } + } + public string TransactionId { + get { return transactionId_; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + if (!hasRow) return false; + if (!hasCondition) return false; + if (!Condition.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _putRowRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[3], TableName); + } + if (hasRow) { + output.WriteBytes(2, field_names[2], Row); + } + if (hasCondition) { + output.WriteMessage(3, field_names[0], Condition); + } + if (hasReturnContent) { + output.WriteMessage(4, field_names[1], ReturnContent); + } + if (hasTransactionId) { + output.WriteString(5, field_names[4], TransactionId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + if (hasRow) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Row); + } + if (hasCondition) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Condition); + } + if (hasReturnContent) { + size += pb::CodedOutputStream.ComputeMessageSize(4, ReturnContent); + } + if (hasTransactionId) { + size += pb::CodedOutputStream.ComputeStringSize(5, TransactionId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static PutRowRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PutRowRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PutRowRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PutRowRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PutRowRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PutRowRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PutRowRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PutRowRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PutRowRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PutRowRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PutRowRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PutRowRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PutRowRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PutRowRequest result; + + private PutRowRequest PrepareBuilder() { + if (resultIsReadOnly) { + PutRowRequest original = result; + result = new PutRowRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PutRowRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.PutRowRequest.Descriptor; } + } + + public override PutRowRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.PutRowRequest.DefaultInstance; } + } + + public override PutRowRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PutRowRequest) { + return MergeFrom((PutRowRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PutRowRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.PutRowRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasRow) { + Row = other.Row; + } + if (other.HasCondition) { + MergeCondition(other.Condition); + } + if (other.HasReturnContent) { + MergeReturnContent(other.ReturnContent); + } + if (other.HasTransactionId) { + TransactionId = other.TransactionId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_putRowRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _putRowRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + result.hasRow = input.ReadBytes(ref result.row_); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.Condition.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Condition.CreateBuilder(); + if (result.hasCondition) { + subBuilder.MergeFrom(Condition); + } + input.ReadMessage(subBuilder, extensionRegistry); + Condition = subBuilder.BuildPartial(); + break; + } + case 34: { + global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.CreateBuilder(); + if (result.hasReturnContent) { + subBuilder.MergeFrom(ReturnContent); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReturnContent = subBuilder.BuildPartial(); + break; + } + case 42: { + result.hasTransactionId = input.ReadString(ref result.transactionId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasRow { + get { return result.hasRow; } + } + public pb::ByteString Row { + get { return result.Row; } + set { SetRow(value); } + } + public Builder SetRow(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRow = true; + result.row_ = value; + return this; + } + public Builder ClearRow() { + PrepareBuilder(); + result.hasRow = false; + result.row_ = pb::ByteString.Empty; + return this; + } + + public bool HasCondition { + get { return result.hasCondition; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Condition Condition { + get { return result.Condition; } + set { SetCondition(value); } + } + public Builder SetCondition(global::com.alicloud.openservices.tablestore.core.protocol.Condition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCondition = true; + result.condition_ = value; + return this; + } + public Builder SetCondition(global::com.alicloud.openservices.tablestore.core.protocol.Condition.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasCondition = true; + result.condition_ = builderForValue.Build(); + return this; + } + public Builder MergeCondition(global::com.alicloud.openservices.tablestore.core.protocol.Condition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasCondition && + result.condition_ != global::com.alicloud.openservices.tablestore.core.protocol.Condition.DefaultInstance) { + result.condition_ = global::com.alicloud.openservices.tablestore.core.protocol.Condition.CreateBuilder(result.condition_).MergeFrom(value).BuildPartial(); + } else { + result.condition_ = value; + } + result.hasCondition = true; + return this; + } + public Builder ClearCondition() { + PrepareBuilder(); + result.hasCondition = false; + result.condition_ = null; + return this; + } + + public bool HasReturnContent { + get { return result.hasReturnContent; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent ReturnContent { + get { return result.ReturnContent; } + set { SetReturnContent(value); } + } + public Builder SetReturnContent(global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReturnContent = true; + result.returnContent_ = value; + return this; + } + public Builder SetReturnContent(global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReturnContent = true; + result.returnContent_ = builderForValue.Build(); + return this; + } + public Builder MergeReturnContent(global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReturnContent && + result.returnContent_ != global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.DefaultInstance) { + result.returnContent_ = global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.CreateBuilder(result.returnContent_).MergeFrom(value).BuildPartial(); + } else { + result.returnContent_ = value; + } + result.hasReturnContent = true; + return this; + } + public Builder ClearReturnContent() { + PrepareBuilder(); + result.hasReturnContent = false; + result.returnContent_ = null; + return this; + } + + public bool HasTransactionId { + get { return result.hasTransactionId; } + } + public string TransactionId { + get { return result.TransactionId; } + set { SetTransactionId(value); } + } + public Builder SetTransactionId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTransactionId = true; + result.transactionId_ = value; + return this; + } + public Builder ClearTransactionId() { + PrepareBuilder(); + result.hasTransactionId = false; + result.transactionId_ = ""; + return this; + } + } + static PutRowRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class PutRowResponse : pb::GeneratedMessage { + private PutRowResponse() { } + private static readonly PutRowResponse defaultInstance = new PutRowResponse().MakeReadOnly(); + private static readonly string[] _putRowResponseFieldNames = new string[] { "consumed", "row" }; + private static readonly uint[] _putRowResponseFieldTags = new uint[] { 10, 18 }; + public static PutRowResponse DefaultInstance { + get { return defaultInstance; } + } + + public override PutRowResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PutRowResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_PutRowResponse__FieldAccessorTable; } + } + + public const int ConsumedFieldNumber = 1; + private bool hasConsumed; + private global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity consumed_; + public bool HasConsumed { + get { return hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return consumed_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance; } + } + + public const int RowFieldNumber = 2; + private bool hasRow; + private pb::ByteString row_ = pb::ByteString.Empty; + public bool HasRow { + get { return hasRow; } + } + public pb::ByteString Row { + get { return row_; } + } + + public override bool IsInitialized { + get { + if (!hasConsumed) return false; + if (!Consumed.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _putRowResponseFieldNames; + if (hasConsumed) { + output.WriteMessage(1, field_names[0], Consumed); + } + if (hasRow) { + output.WriteBytes(2, field_names[1], Row); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasConsumed) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Consumed); + } + if (hasRow) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Row); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static PutRowResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PutRowResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PutRowResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PutRowResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PutRowResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PutRowResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PutRowResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PutRowResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PutRowResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PutRowResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PutRowResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PutRowResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PutRowResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PutRowResponse result; + + private PutRowResponse PrepareBuilder() { + if (resultIsReadOnly) { + PutRowResponse original = result; + result = new PutRowResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PutRowResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.PutRowResponse.Descriptor; } + } + + public override PutRowResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.PutRowResponse.DefaultInstance; } + } + + public override PutRowResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PutRowResponse) { + return MergeFrom((PutRowResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PutRowResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.PutRowResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasConsumed) { + MergeConsumed(other.Consumed); + } + if (other.HasRow) { + Row = other.Row; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_putRowResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _putRowResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(); + if (result.hasConsumed) { + subBuilder.MergeFrom(Consumed); + } + input.ReadMessage(subBuilder, extensionRegistry); + Consumed = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasRow = input.ReadBytes(ref result.row_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasConsumed { + get { return result.hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return result.Consumed; } + set { SetConsumed(value); } + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = value; + return this; + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = builderForValue.Build(); + return this; + } + public Builder MergeConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasConsumed && + result.consumed_ != global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance) { + result.consumed_ = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(result.consumed_).MergeFrom(value).BuildPartial(); + } else { + result.consumed_ = value; + } + result.hasConsumed = true; + return this; + } + public Builder ClearConsumed() { + PrepareBuilder(); + result.hasConsumed = false; + result.consumed_ = null; + return this; + } + + public bool HasRow { + get { return result.hasRow; } + } + public pb::ByteString Row { + get { return result.Row; } + set { SetRow(value); } + } + public Builder SetRow(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRow = true; + result.row_ = value; + return this; + } + public Builder ClearRow() { + PrepareBuilder(); + result.hasRow = false; + result.row_ = pb::ByteString.Empty; + return this; + } + } + static PutRowResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DeleteRowRequest : pb::GeneratedMessage { + private DeleteRowRequest() { } + private static readonly DeleteRowRequest defaultInstance = new DeleteRowRequest().MakeReadOnly(); + private static readonly string[] _deleteRowRequestFieldNames = new string[] { "condition", "primary_key", "return_content", "table_name", "transaction_id" }; + private static readonly uint[] _deleteRowRequestFieldTags = new uint[] { 26, 18, 34, 10, 42 }; + public static DeleteRowRequest DefaultInstance { + get { return defaultInstance; } + } + + public override DeleteRowRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DeleteRowRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int PrimaryKeyFieldNumber = 2; + private bool hasPrimaryKey; + private pb::ByteString primaryKey_ = pb::ByteString.Empty; + public bool HasPrimaryKey { + get { return hasPrimaryKey; } + } + public pb::ByteString PrimaryKey { + get { return primaryKey_; } + } + + public const int ConditionFieldNumber = 3; + private bool hasCondition; + private global::com.alicloud.openservices.tablestore.core.protocol.Condition condition_; + public bool HasCondition { + get { return hasCondition; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Condition Condition { + get { return condition_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Condition.DefaultInstance; } + } + + public const int ReturnContentFieldNumber = 4; + private bool hasReturnContent; + private global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent returnContent_; + public bool HasReturnContent { + get { return hasReturnContent; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent ReturnContent { + get { return returnContent_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.DefaultInstance; } + } + + public const int TransactionIdFieldNumber = 5; + private bool hasTransactionId; + private string transactionId_ = ""; + public bool HasTransactionId { + get { return hasTransactionId; } + } + public string TransactionId { + get { return transactionId_; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + if (!hasPrimaryKey) return false; + if (!hasCondition) return false; + if (!Condition.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _deleteRowRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[3], TableName); + } + if (hasPrimaryKey) { + output.WriteBytes(2, field_names[1], PrimaryKey); + } + if (hasCondition) { + output.WriteMessage(3, field_names[0], Condition); + } + if (hasReturnContent) { + output.WriteMessage(4, field_names[2], ReturnContent); + } + if (hasTransactionId) { + output.WriteString(5, field_names[4], TransactionId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + if (hasPrimaryKey) { + size += pb::CodedOutputStream.ComputeBytesSize(2, PrimaryKey); + } + if (hasCondition) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Condition); + } + if (hasReturnContent) { + size += pb::CodedOutputStream.ComputeMessageSize(4, ReturnContent); + } + if (hasTransactionId) { + size += pb::CodedOutputStream.ComputeStringSize(5, TransactionId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DeleteRowRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteRowRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteRowRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteRowRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteRowRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteRowRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DeleteRowRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DeleteRowRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DeleteRowRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteRowRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DeleteRowRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DeleteRowRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DeleteRowRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DeleteRowRequest result; + + private DeleteRowRequest PrepareBuilder() { + if (resultIsReadOnly) { + DeleteRowRequest original = result; + result = new DeleteRowRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DeleteRowRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DeleteRowRequest.Descriptor; } + } + + public override DeleteRowRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DeleteRowRequest.DefaultInstance; } + } + + public override DeleteRowRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DeleteRowRequest) { + return MergeFrom((DeleteRowRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DeleteRowRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DeleteRowRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasPrimaryKey) { + PrimaryKey = other.PrimaryKey; + } + if (other.HasCondition) { + MergeCondition(other.Condition); + } + if (other.HasReturnContent) { + MergeReturnContent(other.ReturnContent); + } + if (other.HasTransactionId) { + TransactionId = other.TransactionId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_deleteRowRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _deleteRowRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + result.hasPrimaryKey = input.ReadBytes(ref result.primaryKey_); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.Condition.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Condition.CreateBuilder(); + if (result.hasCondition) { + subBuilder.MergeFrom(Condition); + } + input.ReadMessage(subBuilder, extensionRegistry); + Condition = subBuilder.BuildPartial(); + break; + } + case 34: { + global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.CreateBuilder(); + if (result.hasReturnContent) { + subBuilder.MergeFrom(ReturnContent); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReturnContent = subBuilder.BuildPartial(); + break; + } + case 42: { + result.hasTransactionId = input.ReadString(ref result.transactionId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasPrimaryKey { + get { return result.hasPrimaryKey; } + } + public pb::ByteString PrimaryKey { + get { return result.PrimaryKey; } + set { SetPrimaryKey(value); } + } + public Builder SetPrimaryKey(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPrimaryKey = true; + result.primaryKey_ = value; + return this; + } + public Builder ClearPrimaryKey() { + PrepareBuilder(); + result.hasPrimaryKey = false; + result.primaryKey_ = pb::ByteString.Empty; + return this; + } + + public bool HasCondition { + get { return result.hasCondition; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Condition Condition { + get { return result.Condition; } + set { SetCondition(value); } + } + public Builder SetCondition(global::com.alicloud.openservices.tablestore.core.protocol.Condition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCondition = true; + result.condition_ = value; + return this; + } + public Builder SetCondition(global::com.alicloud.openservices.tablestore.core.protocol.Condition.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasCondition = true; + result.condition_ = builderForValue.Build(); + return this; + } + public Builder MergeCondition(global::com.alicloud.openservices.tablestore.core.protocol.Condition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasCondition && + result.condition_ != global::com.alicloud.openservices.tablestore.core.protocol.Condition.DefaultInstance) { + result.condition_ = global::com.alicloud.openservices.tablestore.core.protocol.Condition.CreateBuilder(result.condition_).MergeFrom(value).BuildPartial(); + } else { + result.condition_ = value; + } + result.hasCondition = true; + return this; + } + public Builder ClearCondition() { + PrepareBuilder(); + result.hasCondition = false; + result.condition_ = null; + return this; + } + + public bool HasReturnContent { + get { return result.hasReturnContent; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent ReturnContent { + get { return result.ReturnContent; } + set { SetReturnContent(value); } + } + public Builder SetReturnContent(global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReturnContent = true; + result.returnContent_ = value; + return this; + } + public Builder SetReturnContent(global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReturnContent = true; + result.returnContent_ = builderForValue.Build(); + return this; + } + public Builder MergeReturnContent(global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReturnContent && + result.returnContent_ != global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.DefaultInstance) { + result.returnContent_ = global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.CreateBuilder(result.returnContent_).MergeFrom(value).BuildPartial(); + } else { + result.returnContent_ = value; + } + result.hasReturnContent = true; + return this; + } + public Builder ClearReturnContent() { + PrepareBuilder(); + result.hasReturnContent = false; + result.returnContent_ = null; + return this; + } + + public bool HasTransactionId { + get { return result.hasTransactionId; } + } + public string TransactionId { + get { return result.TransactionId; } + set { SetTransactionId(value); } + } + public Builder SetTransactionId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTransactionId = true; + result.transactionId_ = value; + return this; + } + public Builder ClearTransactionId() { + PrepareBuilder(); + result.hasTransactionId = false; + result.transactionId_ = ""; + return this; + } + } + static DeleteRowRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DeleteRowResponse : pb::GeneratedMessage { + private DeleteRowResponse() { } + private static readonly DeleteRowResponse defaultInstance = new DeleteRowResponse().MakeReadOnly(); + private static readonly string[] _deleteRowResponseFieldNames = new string[] { "consumed", "row" }; + private static readonly uint[] _deleteRowResponseFieldTags = new uint[] { 10, 18 }; + public static DeleteRowResponse DefaultInstance { + get { return defaultInstance; } + } + + public override DeleteRowResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DeleteRowResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteRowResponse__FieldAccessorTable; } + } + + public const int ConsumedFieldNumber = 1; + private bool hasConsumed; + private global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity consumed_; + public bool HasConsumed { + get { return hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return consumed_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance; } + } + + public const int RowFieldNumber = 2; + private bool hasRow; + private pb::ByteString row_ = pb::ByteString.Empty; + public bool HasRow { + get { return hasRow; } + } + public pb::ByteString Row { + get { return row_; } + } + + public override bool IsInitialized { + get { + if (!hasConsumed) return false; + if (!Consumed.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _deleteRowResponseFieldNames; + if (hasConsumed) { + output.WriteMessage(1, field_names[0], Consumed); + } + if (hasRow) { + output.WriteBytes(2, field_names[1], Row); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasConsumed) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Consumed); + } + if (hasRow) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Row); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DeleteRowResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteRowResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteRowResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteRowResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteRowResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteRowResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DeleteRowResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DeleteRowResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DeleteRowResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteRowResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DeleteRowResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DeleteRowResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DeleteRowResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DeleteRowResponse result; + + private DeleteRowResponse PrepareBuilder() { + if (resultIsReadOnly) { + DeleteRowResponse original = result; + result = new DeleteRowResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DeleteRowResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DeleteRowResponse.Descriptor; } + } + + public override DeleteRowResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DeleteRowResponse.DefaultInstance; } + } + + public override DeleteRowResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DeleteRowResponse) { + return MergeFrom((DeleteRowResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DeleteRowResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DeleteRowResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasConsumed) { + MergeConsumed(other.Consumed); + } + if (other.HasRow) { + Row = other.Row; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_deleteRowResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _deleteRowResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(); + if (result.hasConsumed) { + subBuilder.MergeFrom(Consumed); + } + input.ReadMessage(subBuilder, extensionRegistry); + Consumed = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasRow = input.ReadBytes(ref result.row_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasConsumed { + get { return result.hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return result.Consumed; } + set { SetConsumed(value); } + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = value; + return this; + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = builderForValue.Build(); + return this; + } + public Builder MergeConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasConsumed && + result.consumed_ != global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance) { + result.consumed_ = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(result.consumed_).MergeFrom(value).BuildPartial(); + } else { + result.consumed_ = value; + } + result.hasConsumed = true; + return this; + } + public Builder ClearConsumed() { + PrepareBuilder(); + result.hasConsumed = false; + result.consumed_ = null; + return this; + } + + public bool HasRow { + get { return result.hasRow; } + } + public pb::ByteString Row { + get { return result.Row; } + set { SetRow(value); } + } + public Builder SetRow(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRow = true; + result.row_ = value; + return this; + } + public Builder ClearRow() { + PrepareBuilder(); + result.hasRow = false; + result.row_ = pb::ByteString.Empty; + return this; + } + } + static DeleteRowResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TableInBatchGetRowRequest : pb::GeneratedMessage { + private TableInBatchGetRowRequest() { } + private static readonly TableInBatchGetRowRequest defaultInstance = new TableInBatchGetRowRequest().MakeReadOnly(); + private static readonly string[] _tableInBatchGetRowRequestFieldNames = new string[] { "cache_blocks", "columns_to_get", "end_column", "filter", "max_versions", "primary_key", "start_column", "table_name", "time_range", "token" }; + private static readonly uint[] _tableInBatchGetRowRequestFieldTags = new uint[] { 56, 34, 82, 66, 48, 18, 74, 10, 42, 26 }; + public static TableInBatchGetRowRequest DefaultInstance { + get { return defaultInstance; } + } + + public override TableInBatchGetRowRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TableInBatchGetRowRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int PrimaryKeyFieldNumber = 2; + private pbc::PopsicleList primaryKey_ = new pbc::PopsicleList(); + public scg::IList PrimaryKeyList { + get { return pbc::Lists.AsReadOnly(primaryKey_); } + } + public int PrimaryKeyCount { + get { return primaryKey_.Count; } + } + public pb::ByteString GetPrimaryKey(int index) { + return primaryKey_[index]; + } + + public const int TokenFieldNumber = 3; + private pbc::PopsicleList token_ = new pbc::PopsicleList(); + public scg::IList TokenList { + get { return pbc::Lists.AsReadOnly(token_); } + } + public int TokenCount { + get { return token_.Count; } + } + public pb::ByteString GetToken(int index) { + return token_[index]; + } + + public const int ColumnsToGetFieldNumber = 4; + private pbc::PopsicleList columnsToGet_ = new pbc::PopsicleList(); + public scg::IList ColumnsToGetList { + get { return pbc::Lists.AsReadOnly(columnsToGet_); } + } + public int ColumnsToGetCount { + get { return columnsToGet_.Count; } + } + public string GetColumnsToGet(int index) { + return columnsToGet_[index]; + } + + public const int TimeRangeFieldNumber = 5; + private bool hasTimeRange; + private global::com.alicloud.openservices.tablestore.core.protocol.TimeRange timeRange_; + public bool HasTimeRange { + get { return hasTimeRange; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TimeRange TimeRange { + get { return timeRange_ ?? global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.DefaultInstance; } + } + + public const int MaxVersionsFieldNumber = 6; + private bool hasMaxVersions; + private int maxVersions_; + public bool HasMaxVersions { + get { return hasMaxVersions; } + } + public int MaxVersions { + get { return maxVersions_; } + } + + public const int CacheBlocksFieldNumber = 7; + private bool hasCacheBlocks; + private bool cacheBlocks_ = true; + public bool HasCacheBlocks { + get { return hasCacheBlocks; } + } + public bool CacheBlocks { + get { return cacheBlocks_; } + } + + public const int FilterFieldNumber = 8; + private bool hasFilter; + private pb::ByteString filter_ = pb::ByteString.Empty; + public bool HasFilter { + get { return hasFilter; } + } + public pb::ByteString Filter { + get { return filter_; } + } + + public const int StartColumnFieldNumber = 9; + private bool hasStartColumn; + private string startColumn_ = ""; + public bool HasStartColumn { + get { return hasStartColumn; } + } + public string StartColumn { + get { return startColumn_; } + } + + public const int EndColumnFieldNumber = 10; + private bool hasEndColumn; + private string endColumn_ = ""; + public bool HasEndColumn { + get { return hasEndColumn; } + } + public string EndColumn { + get { return endColumn_; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _tableInBatchGetRowRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[7], TableName); + } + if (primaryKey_.Count > 0) { + output.WriteBytesArray(2, field_names[5], primaryKey_); + } + if (token_.Count > 0) { + output.WriteBytesArray(3, field_names[9], token_); + } + if (columnsToGet_.Count > 0) { + output.WriteStringArray(4, field_names[1], columnsToGet_); + } + if (hasTimeRange) { + output.WriteMessage(5, field_names[8], TimeRange); + } + if (hasMaxVersions) { + output.WriteInt32(6, field_names[4], MaxVersions); + } + if (hasCacheBlocks) { + output.WriteBool(7, field_names[0], CacheBlocks); + } + if (hasFilter) { + output.WriteBytes(8, field_names[3], Filter); + } + if (hasStartColumn) { + output.WriteString(9, field_names[6], StartColumn); + } + if (hasEndColumn) { + output.WriteString(10, field_names[2], EndColumn); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + { + int dataSize = 0; + foreach (pb::ByteString element in PrimaryKeyList) { + dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); + } + size += dataSize; + size += 1 * primaryKey_.Count; + } + { + int dataSize = 0; + foreach (pb::ByteString element in TokenList) { + dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); + } + size += dataSize; + size += 1 * token_.Count; + } + { + int dataSize = 0; + foreach (string element in ColumnsToGetList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * columnsToGet_.Count; + } + if (hasTimeRange) { + size += pb::CodedOutputStream.ComputeMessageSize(5, TimeRange); + } + if (hasMaxVersions) { + size += pb::CodedOutputStream.ComputeInt32Size(6, MaxVersions); + } + if (hasCacheBlocks) { + size += pb::CodedOutputStream.ComputeBoolSize(7, CacheBlocks); + } + if (hasFilter) { + size += pb::CodedOutputStream.ComputeBytesSize(8, Filter); + } + if (hasStartColumn) { + size += pb::CodedOutputStream.ComputeStringSize(9, StartColumn); + } + if (hasEndColumn) { + size += pb::CodedOutputStream.ComputeStringSize(10, EndColumn); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TableInBatchGetRowRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TableInBatchGetRowRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TableInBatchGetRowRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TableInBatchGetRowRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TableInBatchGetRowRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TableInBatchGetRowRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TableInBatchGetRowRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TableInBatchGetRowRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TableInBatchGetRowRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TableInBatchGetRowRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TableInBatchGetRowRequest MakeReadOnly() { + primaryKey_.MakeReadOnly(); + token_.MakeReadOnly(); + columnsToGet_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TableInBatchGetRowRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TableInBatchGetRowRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TableInBatchGetRowRequest result; + + private TableInBatchGetRowRequest PrepareBuilder() { + if (resultIsReadOnly) { + TableInBatchGetRowRequest original = result; + result = new TableInBatchGetRowRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TableInBatchGetRowRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowRequest.Descriptor; } + } + + public override TableInBatchGetRowRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowRequest.DefaultInstance; } + } + + public override TableInBatchGetRowRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TableInBatchGetRowRequest) { + return MergeFrom((TableInBatchGetRowRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TableInBatchGetRowRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.primaryKey_.Count != 0) { + result.primaryKey_.Add(other.primaryKey_); + } + if (other.token_.Count != 0) { + result.token_.Add(other.token_); + } + if (other.columnsToGet_.Count != 0) { + result.columnsToGet_.Add(other.columnsToGet_); + } + if (other.HasTimeRange) { + MergeTimeRange(other.TimeRange); + } + if (other.HasMaxVersions) { + MaxVersions = other.MaxVersions; + } + if (other.HasCacheBlocks) { + CacheBlocks = other.CacheBlocks; + } + if (other.HasFilter) { + Filter = other.Filter; + } + if (other.HasStartColumn) { + StartColumn = other.StartColumn; + } + if (other.HasEndColumn) { + EndColumn = other.EndColumn; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_tableInBatchGetRowRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _tableInBatchGetRowRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + input.ReadBytesArray(tag, field_name, result.primaryKey_); + break; + } + case 26: { + input.ReadBytesArray(tag, field_name, result.token_); + break; + } + case 34: { + input.ReadStringArray(tag, field_name, result.columnsToGet_); + break; + } + case 42: { + global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.CreateBuilder(); + if (result.hasTimeRange) { + subBuilder.MergeFrom(TimeRange); + } + input.ReadMessage(subBuilder, extensionRegistry); + TimeRange = subBuilder.BuildPartial(); + break; + } + case 48: { + result.hasMaxVersions = input.ReadInt32(ref result.maxVersions_); + break; + } + case 56: { + result.hasCacheBlocks = input.ReadBool(ref result.cacheBlocks_); + break; + } + case 66: { + result.hasFilter = input.ReadBytes(ref result.filter_); + break; + } + case 74: { + result.hasStartColumn = input.ReadString(ref result.startColumn_); + break; + } + case 82: { + result.hasEndColumn = input.ReadString(ref result.endColumn_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public pbc::IPopsicleList PrimaryKeyList { + get { return PrepareBuilder().primaryKey_; } + } + public int PrimaryKeyCount { + get { return result.PrimaryKeyCount; } + } + public pb::ByteString GetPrimaryKey(int index) { + return result.GetPrimaryKey(index); + } + public Builder SetPrimaryKey(int index, pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.primaryKey_[index] = value; + return this; + } + public Builder AddPrimaryKey(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.primaryKey_.Add(value); + return this; + } + public Builder AddRangePrimaryKey(scg::IEnumerable values) { + PrepareBuilder(); + result.primaryKey_.Add(values); + return this; + } + public Builder ClearPrimaryKey() { + PrepareBuilder(); + result.primaryKey_.Clear(); + return this; + } + + public pbc::IPopsicleList TokenList { + get { return PrepareBuilder().token_; } + } + public int TokenCount { + get { return result.TokenCount; } + } + public pb::ByteString GetToken(int index) { + return result.GetToken(index); + } + public Builder SetToken(int index, pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.token_[index] = value; + return this; + } + public Builder AddToken(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.token_.Add(value); + return this; + } + public Builder AddRangeToken(scg::IEnumerable values) { + PrepareBuilder(); + result.token_.Add(values); + return this; + } + public Builder ClearToken() { + PrepareBuilder(); + result.token_.Clear(); + return this; + } + + public pbc::IPopsicleList ColumnsToGetList { + get { return PrepareBuilder().columnsToGet_; } + } + public int ColumnsToGetCount { + get { return result.ColumnsToGetCount; } + } + public string GetColumnsToGet(int index) { + return result.GetColumnsToGet(index); + } + public Builder SetColumnsToGet(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.columnsToGet_[index] = value; + return this; + } + public Builder AddColumnsToGet(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.columnsToGet_.Add(value); + return this; + } + public Builder AddRangeColumnsToGet(scg::IEnumerable values) { + PrepareBuilder(); + result.columnsToGet_.Add(values); + return this; + } + public Builder ClearColumnsToGet() { + PrepareBuilder(); + result.columnsToGet_.Clear(); + return this; + } + + public bool HasTimeRange { + get { return result.hasTimeRange; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TimeRange TimeRange { + get { return result.TimeRange; } + set { SetTimeRange(value); } + } + public Builder SetTimeRange(global::com.alicloud.openservices.tablestore.core.protocol.TimeRange value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTimeRange = true; + result.timeRange_ = value; + return this; + } + public Builder SetTimeRange(global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTimeRange = true; + result.timeRange_ = builderForValue.Build(); + return this; + } + public Builder MergeTimeRange(global::com.alicloud.openservices.tablestore.core.protocol.TimeRange value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTimeRange && + result.timeRange_ != global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.DefaultInstance) { + result.timeRange_ = global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.CreateBuilder(result.timeRange_).MergeFrom(value).BuildPartial(); + } else { + result.timeRange_ = value; + } + result.hasTimeRange = true; + return this; + } + public Builder ClearTimeRange() { + PrepareBuilder(); + result.hasTimeRange = false; + result.timeRange_ = null; + return this; + } + + public bool HasMaxVersions { + get { return result.hasMaxVersions; } + } + public int MaxVersions { + get { return result.MaxVersions; } + set { SetMaxVersions(value); } + } + public Builder SetMaxVersions(int value) { + PrepareBuilder(); + result.hasMaxVersions = true; + result.maxVersions_ = value; + return this; + } + public Builder ClearMaxVersions() { + PrepareBuilder(); + result.hasMaxVersions = false; + result.maxVersions_ = 0; + return this; + } + + public bool HasCacheBlocks { + get { return result.hasCacheBlocks; } + } + public bool CacheBlocks { + get { return result.CacheBlocks; } + set { SetCacheBlocks(value); } + } + public Builder SetCacheBlocks(bool value) { + PrepareBuilder(); + result.hasCacheBlocks = true; + result.cacheBlocks_ = value; + return this; + } + public Builder ClearCacheBlocks() { + PrepareBuilder(); + result.hasCacheBlocks = false; + result.cacheBlocks_ = true; + return this; + } + + public bool HasFilter { + get { return result.hasFilter; } + } + public pb::ByteString Filter { + get { return result.Filter; } + set { SetFilter(value); } + } + public Builder SetFilter(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = value; + return this; + } + public Builder ClearFilter() { + PrepareBuilder(); + result.hasFilter = false; + result.filter_ = pb::ByteString.Empty; + return this; + } + + public bool HasStartColumn { + get { return result.hasStartColumn; } + } + public string StartColumn { + get { return result.StartColumn; } + set { SetStartColumn(value); } + } + public Builder SetStartColumn(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStartColumn = true; + result.startColumn_ = value; + return this; + } + public Builder ClearStartColumn() { + PrepareBuilder(); + result.hasStartColumn = false; + result.startColumn_ = ""; + return this; + } + + public bool HasEndColumn { + get { return result.hasEndColumn; } + } + public string EndColumn { + get { return result.EndColumn; } + set { SetEndColumn(value); } + } + public Builder SetEndColumn(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEndColumn = true; + result.endColumn_ = value; + return this; + } + public Builder ClearEndColumn() { + PrepareBuilder(); + result.hasEndColumn = false; + result.endColumn_ = ""; + return this; + } + } + static TableInBatchGetRowRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class BatchGetRowRequest : pb::GeneratedMessage { + private BatchGetRowRequest() { } + private static readonly BatchGetRowRequest defaultInstance = new BatchGetRowRequest().MakeReadOnly(); + private static readonly string[] _batchGetRowRequestFieldNames = new string[] { "tables" }; + private static readonly uint[] _batchGetRowRequestFieldTags = new uint[] { 10 }; + public static BatchGetRowRequest DefaultInstance { + get { return defaultInstance; } + } + + public override BatchGetRowRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BatchGetRowRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowRequest__FieldAccessorTable; } + } + + public const int TablesFieldNumber = 1; + private pbc::PopsicleList tables_ = new pbc::PopsicleList(); + public scg::IList TablesList { + get { return tables_; } + } + public int TablesCount { + get { return tables_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowRequest GetTables(int index) { + return tables_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowRequest element in TablesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _batchGetRowRequestFieldNames; + if (tables_.Count > 0) { + output.WriteMessageArray(1, field_names[0], tables_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowRequest element in TablesList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static BatchGetRowRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BatchGetRowRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BatchGetRowRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BatchGetRowRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BatchGetRowRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BatchGetRowRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BatchGetRowRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BatchGetRowRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BatchGetRowRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BatchGetRowRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BatchGetRowRequest MakeReadOnly() { + tables_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BatchGetRowRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BatchGetRowRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BatchGetRowRequest result; + + private BatchGetRowRequest PrepareBuilder() { + if (resultIsReadOnly) { + BatchGetRowRequest original = result; + result = new BatchGetRowRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BatchGetRowRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.BatchGetRowRequest.Descriptor; } + } + + public override BatchGetRowRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.BatchGetRowRequest.DefaultInstance; } + } + + public override BatchGetRowRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BatchGetRowRequest) { + return MergeFrom((BatchGetRowRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BatchGetRowRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.BatchGetRowRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.tables_.Count != 0) { + result.tables_.Add(other.tables_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_batchGetRowRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _batchGetRowRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.tables_, global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowRequest.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList TablesList { + get { return PrepareBuilder().tables_; } + } + public int TablesCount { + get { return result.TablesCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowRequest GetTables(int index) { + return result.GetTables(index); + } + public Builder SetTables(int index, global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowRequest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.tables_[index] = value; + return this; + } + public Builder SetTables(int index, global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowRequest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.tables_[index] = builderForValue.Build(); + return this; + } + public Builder AddTables(global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowRequest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.tables_.Add(value); + return this; + } + public Builder AddTables(global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowRequest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.tables_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeTables(scg::IEnumerable values) { + PrepareBuilder(); + result.tables_.Add(values); + return this; + } + public Builder ClearTables() { + PrepareBuilder(); + result.tables_.Clear(); + return this; + } + } + static BatchGetRowRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class RowInBatchGetRowResponse : pb::GeneratedMessage { + private RowInBatchGetRowResponse() { } + private static readonly RowInBatchGetRowResponse defaultInstance = new RowInBatchGetRowResponse().MakeReadOnly(); + private static readonly string[] _rowInBatchGetRowResponseFieldNames = new string[] { "consumed", "error", "is_ok", "next_token", "row" }; + private static readonly uint[] _rowInBatchGetRowResponseFieldTags = new uint[] { 26, 18, 8, 42, 34 }; + public static RowInBatchGetRowResponse DefaultInstance { + get { return defaultInstance; } + } + + public override RowInBatchGetRowResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RowInBatchGetRowResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchGetRowResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchGetRowResponse__FieldAccessorTable; } + } + + public const int IsOkFieldNumber = 1; + private bool hasIsOk; + private bool isOk_; + public bool HasIsOk { + get { return hasIsOk; } + } + public bool IsOk { + get { return isOk_; } + } + + public const int ErrorFieldNumber = 2; + private bool hasError; + private global::com.alicloud.openservices.tablestore.core.protocol.Error error_; + public bool HasError { + get { return hasError; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Error Error { + get { return error_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Error.DefaultInstance; } + } + + public const int ConsumedFieldNumber = 3; + private bool hasConsumed; + private global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity consumed_; + public bool HasConsumed { + get { return hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return consumed_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance; } + } + + public const int RowFieldNumber = 4; + private bool hasRow; + private pb::ByteString row_ = pb::ByteString.Empty; + public bool HasRow { + get { return hasRow; } + } + public pb::ByteString Row { + get { return row_; } + } + + public const int NextTokenFieldNumber = 5; + private bool hasNextToken; + private pb::ByteString nextToken_ = pb::ByteString.Empty; + public bool HasNextToken { + get { return hasNextToken; } + } + public pb::ByteString NextToken { + get { return nextToken_; } + } + + public override bool IsInitialized { + get { + if (!hasIsOk) return false; + if (HasError) { + if (!Error.IsInitialized) return false; + } + if (HasConsumed) { + if (!Consumed.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _rowInBatchGetRowResponseFieldNames; + if (hasIsOk) { + output.WriteBool(1, field_names[2], IsOk); + } + if (hasError) { + output.WriteMessage(2, field_names[1], Error); + } + if (hasConsumed) { + output.WriteMessage(3, field_names[0], Consumed); + } + if (hasRow) { + output.WriteBytes(4, field_names[4], Row); + } + if (hasNextToken) { + output.WriteBytes(5, field_names[3], NextToken); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasIsOk) { + size += pb::CodedOutputStream.ComputeBoolSize(1, IsOk); + } + if (hasError) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Error); + } + if (hasConsumed) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Consumed); + } + if (hasRow) { + size += pb::CodedOutputStream.ComputeBytesSize(4, Row); + } + if (hasNextToken) { + size += pb::CodedOutputStream.ComputeBytesSize(5, NextToken); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static RowInBatchGetRowResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RowInBatchGetRowResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RowInBatchGetRowResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RowInBatchGetRowResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RowInBatchGetRowResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RowInBatchGetRowResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RowInBatchGetRowResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RowInBatchGetRowResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RowInBatchGetRowResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RowInBatchGetRowResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RowInBatchGetRowResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RowInBatchGetRowResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RowInBatchGetRowResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RowInBatchGetRowResponse result; + + private RowInBatchGetRowResponse PrepareBuilder() { + if (resultIsReadOnly) { + RowInBatchGetRowResponse original = result; + result = new RowInBatchGetRowResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RowInBatchGetRowResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchGetRowResponse.Descriptor; } + } + + public override RowInBatchGetRowResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchGetRowResponse.DefaultInstance; } + } + + public override RowInBatchGetRowResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RowInBatchGetRowResponse) { + return MergeFrom((RowInBatchGetRowResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RowInBatchGetRowResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchGetRowResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasIsOk) { + IsOk = other.IsOk; + } + if (other.HasError) { + MergeError(other.Error); + } + if (other.HasConsumed) { + MergeConsumed(other.Consumed); + } + if (other.HasRow) { + Row = other.Row; + } + if (other.HasNextToken) { + NextToken = other.NextToken; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_rowInBatchGetRowResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _rowInBatchGetRowResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasIsOk = input.ReadBool(ref result.isOk_); + break; + } + case 18: { + global::com.alicloud.openservices.tablestore.core.protocol.Error.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Error.CreateBuilder(); + if (result.hasError) { + subBuilder.MergeFrom(Error); + } + input.ReadMessage(subBuilder, extensionRegistry); + Error = subBuilder.BuildPartial(); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(); + if (result.hasConsumed) { + subBuilder.MergeFrom(Consumed); + } + input.ReadMessage(subBuilder, extensionRegistry); + Consumed = subBuilder.BuildPartial(); + break; + } + case 34: { + result.hasRow = input.ReadBytes(ref result.row_); + break; + } + case 42: { + result.hasNextToken = input.ReadBytes(ref result.nextToken_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasIsOk { + get { return result.hasIsOk; } + } + public bool IsOk { + get { return result.IsOk; } + set { SetIsOk(value); } + } + public Builder SetIsOk(bool value) { + PrepareBuilder(); + result.hasIsOk = true; + result.isOk_ = value; + return this; + } + public Builder ClearIsOk() { + PrepareBuilder(); + result.hasIsOk = false; + result.isOk_ = false; + return this; + } + + public bool HasError { + get { return result.hasError; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Error Error { + get { return result.Error; } + set { SetError(value); } + } + public Builder SetError(global::com.alicloud.openservices.tablestore.core.protocol.Error value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasError = true; + result.error_ = value; + return this; + } + public Builder SetError(global::com.alicloud.openservices.tablestore.core.protocol.Error.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasError = true; + result.error_ = builderForValue.Build(); + return this; + } + public Builder MergeError(global::com.alicloud.openservices.tablestore.core.protocol.Error value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasError && + result.error_ != global::com.alicloud.openservices.tablestore.core.protocol.Error.DefaultInstance) { + result.error_ = global::com.alicloud.openservices.tablestore.core.protocol.Error.CreateBuilder(result.error_).MergeFrom(value).BuildPartial(); + } else { + result.error_ = value; + } + result.hasError = true; + return this; + } + public Builder ClearError() { + PrepareBuilder(); + result.hasError = false; + result.error_ = null; + return this; + } + + public bool HasConsumed { + get { return result.hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return result.Consumed; } + set { SetConsumed(value); } + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = value; + return this; + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = builderForValue.Build(); + return this; + } + public Builder MergeConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasConsumed && + result.consumed_ != global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance) { + result.consumed_ = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(result.consumed_).MergeFrom(value).BuildPartial(); + } else { + result.consumed_ = value; + } + result.hasConsumed = true; + return this; + } + public Builder ClearConsumed() { + PrepareBuilder(); + result.hasConsumed = false; + result.consumed_ = null; + return this; + } + + public bool HasRow { + get { return result.hasRow; } + } + public pb::ByteString Row { + get { return result.Row; } + set { SetRow(value); } + } + public Builder SetRow(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRow = true; + result.row_ = value; + return this; + } + public Builder ClearRow() { + PrepareBuilder(); + result.hasRow = false; + result.row_ = pb::ByteString.Empty; + return this; + } + + public bool HasNextToken { + get { return result.hasNextToken; } + } + public pb::ByteString NextToken { + get { return result.NextToken; } + set { SetNextToken(value); } + } + public Builder SetNextToken(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNextToken = true; + result.nextToken_ = value; + return this; + } + public Builder ClearNextToken() { + PrepareBuilder(); + result.hasNextToken = false; + result.nextToken_ = pb::ByteString.Empty; + return this; + } + } + static RowInBatchGetRowResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TableInBatchGetRowResponse : pb::GeneratedMessage { + private TableInBatchGetRowResponse() { } + private static readonly TableInBatchGetRowResponse defaultInstance = new TableInBatchGetRowResponse().MakeReadOnly(); + private static readonly string[] _tableInBatchGetRowResponseFieldNames = new string[] { "rows", "table_name" }; + private static readonly uint[] _tableInBatchGetRowResponseFieldTags = new uint[] { 18, 10 }; + public static TableInBatchGetRowResponse DefaultInstance { + get { return defaultInstance; } + } + + public override TableInBatchGetRowResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TableInBatchGetRowResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchGetRowResponse__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int RowsFieldNumber = 2; + private pbc::PopsicleList rows_ = new pbc::PopsicleList(); + public scg::IList RowsList { + get { return rows_; } + } + public int RowsCount { + get { return rows_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchGetRowResponse GetRows(int index) { + return rows_[index]; + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchGetRowResponse element in RowsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _tableInBatchGetRowResponseFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[1], TableName); + } + if (rows_.Count > 0) { + output.WriteMessageArray(2, field_names[0], rows_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchGetRowResponse element in RowsList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TableInBatchGetRowResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TableInBatchGetRowResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TableInBatchGetRowResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TableInBatchGetRowResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TableInBatchGetRowResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TableInBatchGetRowResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TableInBatchGetRowResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TableInBatchGetRowResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TableInBatchGetRowResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TableInBatchGetRowResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TableInBatchGetRowResponse MakeReadOnly() { + rows_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TableInBatchGetRowResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TableInBatchGetRowResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TableInBatchGetRowResponse result; + + private TableInBatchGetRowResponse PrepareBuilder() { + if (resultIsReadOnly) { + TableInBatchGetRowResponse original = result; + result = new TableInBatchGetRowResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TableInBatchGetRowResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowResponse.Descriptor; } + } + + public override TableInBatchGetRowResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowResponse.DefaultInstance; } + } + + public override TableInBatchGetRowResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TableInBatchGetRowResponse) { + return MergeFrom((TableInBatchGetRowResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TableInBatchGetRowResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.rows_.Count != 0) { + result.rows_.Add(other.rows_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_tableInBatchGetRowResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _tableInBatchGetRowResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.rows_, global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchGetRowResponse.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public pbc::IPopsicleList RowsList { + get { return PrepareBuilder().rows_; } + } + public int RowsCount { + get { return result.RowsCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchGetRowResponse GetRows(int index) { + return result.GetRows(index); + } + public Builder SetRows(int index, global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchGetRowResponse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.rows_[index] = value; + return this; + } + public Builder SetRows(int index, global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchGetRowResponse.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.rows_[index] = builderForValue.Build(); + return this; + } + public Builder AddRows(global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchGetRowResponse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.rows_.Add(value); + return this; + } + public Builder AddRows(global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchGetRowResponse.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.rows_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRows(scg::IEnumerable values) { + PrepareBuilder(); + result.rows_.Add(values); + return this; + } + public Builder ClearRows() { + PrepareBuilder(); + result.rows_.Clear(); + return this; + } + } + static TableInBatchGetRowResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class BatchGetRowResponse : pb::GeneratedMessage { + private BatchGetRowResponse() { } + private static readonly BatchGetRowResponse defaultInstance = new BatchGetRowResponse().MakeReadOnly(); + private static readonly string[] _batchGetRowResponseFieldNames = new string[] { "tables" }; + private static readonly uint[] _batchGetRowResponseFieldTags = new uint[] { 10 }; + public static BatchGetRowResponse DefaultInstance { + get { return defaultInstance; } + } + + public override BatchGetRowResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BatchGetRowResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchGetRowResponse__FieldAccessorTable; } + } + + public const int TablesFieldNumber = 1; + private pbc::PopsicleList tables_ = new pbc::PopsicleList(); + public scg::IList TablesList { + get { return tables_; } + } + public int TablesCount { + get { return tables_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowResponse GetTables(int index) { + return tables_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowResponse element in TablesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _batchGetRowResponseFieldNames; + if (tables_.Count > 0) { + output.WriteMessageArray(1, field_names[0], tables_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowResponse element in TablesList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static BatchGetRowResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BatchGetRowResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BatchGetRowResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BatchGetRowResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BatchGetRowResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BatchGetRowResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BatchGetRowResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BatchGetRowResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BatchGetRowResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BatchGetRowResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BatchGetRowResponse MakeReadOnly() { + tables_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BatchGetRowResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BatchGetRowResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BatchGetRowResponse result; + + private BatchGetRowResponse PrepareBuilder() { + if (resultIsReadOnly) { + BatchGetRowResponse original = result; + result = new BatchGetRowResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BatchGetRowResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.BatchGetRowResponse.Descriptor; } + } + + public override BatchGetRowResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.BatchGetRowResponse.DefaultInstance; } + } + + public override BatchGetRowResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BatchGetRowResponse) { + return MergeFrom((BatchGetRowResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BatchGetRowResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.BatchGetRowResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.tables_.Count != 0) { + result.tables_.Add(other.tables_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_batchGetRowResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _batchGetRowResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.tables_, global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowResponse.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList TablesList { + get { return PrepareBuilder().tables_; } + } + public int TablesCount { + get { return result.TablesCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowResponse GetTables(int index) { + return result.GetTables(index); + } + public Builder SetTables(int index, global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowResponse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.tables_[index] = value; + return this; + } + public Builder SetTables(int index, global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowResponse.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.tables_[index] = builderForValue.Build(); + return this; + } + public Builder AddTables(global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowResponse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.tables_.Add(value); + return this; + } + public Builder AddTables(global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchGetRowResponse.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.tables_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeTables(scg::IEnumerable values) { + PrepareBuilder(); + result.tables_.Add(values); + return this; + } + public Builder ClearTables() { + PrepareBuilder(); + result.tables_.Clear(); + return this; + } + } + static BatchGetRowResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class RowInBatchWriteRowRequest : pb::GeneratedMessage { + private RowInBatchWriteRowRequest() { } + private static readonly RowInBatchWriteRowRequest defaultInstance = new RowInBatchWriteRowRequest().MakeReadOnly(); + private static readonly string[] _rowInBatchWriteRowRequestFieldNames = new string[] { "condition", "return_content", "row_change", "type" }; + private static readonly uint[] _rowInBatchWriteRowRequestFieldTags = new uint[] { 26, 34, 18, 8 }; + public static RowInBatchWriteRowRequest DefaultInstance { + get { return defaultInstance; } + } + + public override RowInBatchWriteRowRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RowInBatchWriteRowRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowRequest__FieldAccessorTable; } + } + + public const int TypeFieldNumber = 1; + private bool hasType; + private global::com.alicloud.openservices.tablestore.core.protocol.OperationType type_ = global::com.alicloud.openservices.tablestore.core.protocol.OperationType.PUT; + public bool HasType { + get { return hasType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.OperationType Type { + get { return type_; } + } + + public const int RowChangeFieldNumber = 2; + private bool hasRowChange; + private pb::ByteString rowChange_ = pb::ByteString.Empty; + public bool HasRowChange { + get { return hasRowChange; } + } + public pb::ByteString RowChange { + get { return rowChange_; } + } + + public const int ConditionFieldNumber = 3; + private bool hasCondition; + private global::com.alicloud.openservices.tablestore.core.protocol.Condition condition_; + public bool HasCondition { + get { return hasCondition; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Condition Condition { + get { return condition_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Condition.DefaultInstance; } + } + + public const int ReturnContentFieldNumber = 4; + private bool hasReturnContent; + private global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent returnContent_; + public bool HasReturnContent { + get { return hasReturnContent; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent ReturnContent { + get { return returnContent_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasType) return false; + if (!hasRowChange) return false; + if (!hasCondition) return false; + if (!Condition.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _rowInBatchWriteRowRequestFieldNames; + if (hasType) { + output.WriteEnum(1, field_names[3], (int) Type, Type); + } + if (hasRowChange) { + output.WriteBytes(2, field_names[2], RowChange); + } + if (hasCondition) { + output.WriteMessage(3, field_names[0], Condition); + } + if (hasReturnContent) { + output.WriteMessage(4, field_names[1], ReturnContent); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasType) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Type); + } + if (hasRowChange) { + size += pb::CodedOutputStream.ComputeBytesSize(2, RowChange); + } + if (hasCondition) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Condition); + } + if (hasReturnContent) { + size += pb::CodedOutputStream.ComputeMessageSize(4, ReturnContent); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static RowInBatchWriteRowRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RowInBatchWriteRowRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RowInBatchWriteRowRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RowInBatchWriteRowRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RowInBatchWriteRowRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RowInBatchWriteRowRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RowInBatchWriteRowRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RowInBatchWriteRowRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RowInBatchWriteRowRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RowInBatchWriteRowRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RowInBatchWriteRowRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RowInBatchWriteRowRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RowInBatchWriteRowRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RowInBatchWriteRowRequest result; + + private RowInBatchWriteRowRequest PrepareBuilder() { + if (resultIsReadOnly) { + RowInBatchWriteRowRequest original = result; + result = new RowInBatchWriteRowRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RowInBatchWriteRowRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowRequest.Descriptor; } + } + + public override RowInBatchWriteRowRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowRequest.DefaultInstance; } + } + + public override RowInBatchWriteRowRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RowInBatchWriteRowRequest) { + return MergeFrom((RowInBatchWriteRowRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RowInBatchWriteRowRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasType) { + Type = other.Type; + } + if (other.HasRowChange) { + RowChange = other.RowChange; + } + if (other.HasCondition) { + MergeCondition(other.Condition); + } + if (other.HasReturnContent) { + MergeReturnContent(other.ReturnContent); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_rowInBatchWriteRowRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _rowInBatchWriteRowRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.type_, out unknown)) { + result.hasType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + case 18: { + result.hasRowChange = input.ReadBytes(ref result.rowChange_); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.Condition.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Condition.CreateBuilder(); + if (result.hasCondition) { + subBuilder.MergeFrom(Condition); + } + input.ReadMessage(subBuilder, extensionRegistry); + Condition = subBuilder.BuildPartial(); + break; + } + case 34: { + global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.CreateBuilder(); + if (result.hasReturnContent) { + subBuilder.MergeFrom(ReturnContent); + } + input.ReadMessage(subBuilder, extensionRegistry); + ReturnContent = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasType { + get { return result.hasType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.OperationType Type { + get { return result.Type; } + set { SetType(value); } + } + public Builder SetType(global::com.alicloud.openservices.tablestore.core.protocol.OperationType value) { + PrepareBuilder(); + result.hasType = true; + result.type_ = value; + return this; + } + public Builder ClearType() { + PrepareBuilder(); + result.hasType = false; + result.type_ = global::com.alicloud.openservices.tablestore.core.protocol.OperationType.PUT; + return this; + } + + public bool HasRowChange { + get { return result.hasRowChange; } + } + public pb::ByteString RowChange { + get { return result.RowChange; } + set { SetRowChange(value); } + } + public Builder SetRowChange(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRowChange = true; + result.rowChange_ = value; + return this; + } + public Builder ClearRowChange() { + PrepareBuilder(); + result.hasRowChange = false; + result.rowChange_ = pb::ByteString.Empty; + return this; + } + + public bool HasCondition { + get { return result.hasCondition; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Condition Condition { + get { return result.Condition; } + set { SetCondition(value); } + } + public Builder SetCondition(global::com.alicloud.openservices.tablestore.core.protocol.Condition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCondition = true; + result.condition_ = value; + return this; + } + public Builder SetCondition(global::com.alicloud.openservices.tablestore.core.protocol.Condition.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasCondition = true; + result.condition_ = builderForValue.Build(); + return this; + } + public Builder MergeCondition(global::com.alicloud.openservices.tablestore.core.protocol.Condition value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasCondition && + result.condition_ != global::com.alicloud.openservices.tablestore.core.protocol.Condition.DefaultInstance) { + result.condition_ = global::com.alicloud.openservices.tablestore.core.protocol.Condition.CreateBuilder(result.condition_).MergeFrom(value).BuildPartial(); + } else { + result.condition_ = value; + } + result.hasCondition = true; + return this; + } + public Builder ClearCondition() { + PrepareBuilder(); + result.hasCondition = false; + result.condition_ = null; + return this; + } + + public bool HasReturnContent { + get { return result.hasReturnContent; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent ReturnContent { + get { return result.ReturnContent; } + set { SetReturnContent(value); } + } + public Builder SetReturnContent(global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasReturnContent = true; + result.returnContent_ = value; + return this; + } + public Builder SetReturnContent(global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasReturnContent = true; + result.returnContent_ = builderForValue.Build(); + return this; + } + public Builder MergeReturnContent(global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasReturnContent && + result.returnContent_ != global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.DefaultInstance) { + result.returnContent_ = global::com.alicloud.openservices.tablestore.core.protocol.ReturnContent.CreateBuilder(result.returnContent_).MergeFrom(value).BuildPartial(); + } else { + result.returnContent_ = value; + } + result.hasReturnContent = true; + return this; + } + public Builder ClearReturnContent() { + PrepareBuilder(); + result.hasReturnContent = false; + result.returnContent_ = null; + return this; + } + } + static RowInBatchWriteRowRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TableInBatchWriteRowRequest : pb::GeneratedMessage { + private TableInBatchWriteRowRequest() { } + private static readonly TableInBatchWriteRowRequest defaultInstance = new TableInBatchWriteRowRequest().MakeReadOnly(); + private static readonly string[] _tableInBatchWriteRowRequestFieldNames = new string[] { "rows", "table_name" }; + private static readonly uint[] _tableInBatchWriteRowRequestFieldTags = new uint[] { 18, 10 }; + public static TableInBatchWriteRowRequest DefaultInstance { + get { return defaultInstance; } + } + + public override TableInBatchWriteRowRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TableInBatchWriteRowRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int RowsFieldNumber = 2; + private pbc::PopsicleList rows_ = new pbc::PopsicleList(); + public scg::IList RowsList { + get { return rows_; } + } + public int RowsCount { + get { return rows_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowRequest GetRows(int index) { + return rows_[index]; + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowRequest element in RowsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _tableInBatchWriteRowRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[1], TableName); + } + if (rows_.Count > 0) { + output.WriteMessageArray(2, field_names[0], rows_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowRequest element in RowsList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TableInBatchWriteRowRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TableInBatchWriteRowRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TableInBatchWriteRowRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TableInBatchWriteRowRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TableInBatchWriteRowRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TableInBatchWriteRowRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TableInBatchWriteRowRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TableInBatchWriteRowRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TableInBatchWriteRowRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TableInBatchWriteRowRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TableInBatchWriteRowRequest MakeReadOnly() { + rows_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TableInBatchWriteRowRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TableInBatchWriteRowRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TableInBatchWriteRowRequest result; + + private TableInBatchWriteRowRequest PrepareBuilder() { + if (resultIsReadOnly) { + TableInBatchWriteRowRequest original = result; + result = new TableInBatchWriteRowRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TableInBatchWriteRowRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowRequest.Descriptor; } + } + + public override TableInBatchWriteRowRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowRequest.DefaultInstance; } + } + + public override TableInBatchWriteRowRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TableInBatchWriteRowRequest) { + return MergeFrom((TableInBatchWriteRowRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TableInBatchWriteRowRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.rows_.Count != 0) { + result.rows_.Add(other.rows_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_tableInBatchWriteRowRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _tableInBatchWriteRowRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.rows_, global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowRequest.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public pbc::IPopsicleList RowsList { + get { return PrepareBuilder().rows_; } + } + public int RowsCount { + get { return result.RowsCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowRequest GetRows(int index) { + return result.GetRows(index); + } + public Builder SetRows(int index, global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowRequest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.rows_[index] = value; + return this; + } + public Builder SetRows(int index, global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowRequest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.rows_[index] = builderForValue.Build(); + return this; + } + public Builder AddRows(global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowRequest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.rows_.Add(value); + return this; + } + public Builder AddRows(global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowRequest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.rows_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRows(scg::IEnumerable values) { + PrepareBuilder(); + result.rows_.Add(values); + return this; + } + public Builder ClearRows() { + PrepareBuilder(); + result.rows_.Clear(); + return this; + } + } + static TableInBatchWriteRowRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class BatchWriteRowRequest : pb::GeneratedMessage { + private BatchWriteRowRequest() { } + private static readonly BatchWriteRowRequest defaultInstance = new BatchWriteRowRequest().MakeReadOnly(); + private static readonly string[] _batchWriteRowRequestFieldNames = new string[] { "tables", "transaction_id" }; + private static readonly uint[] _batchWriteRowRequestFieldTags = new uint[] { 10, 18 }; + public static BatchWriteRowRequest DefaultInstance { + get { return defaultInstance; } + } + + public override BatchWriteRowRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BatchWriteRowRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowRequest__FieldAccessorTable; } + } + + public const int TablesFieldNumber = 1; + private pbc::PopsicleList tables_ = new pbc::PopsicleList(); + public scg::IList TablesList { + get { return tables_; } + } + public int TablesCount { + get { return tables_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowRequest GetTables(int index) { + return tables_[index]; + } + + public const int TransactionIdFieldNumber = 2; + private bool hasTransactionId; + private string transactionId_ = ""; + public bool HasTransactionId { + get { return hasTransactionId; } + } + public string TransactionId { + get { return transactionId_; } + } + + public override bool IsInitialized { + get { + foreach (global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowRequest element in TablesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _batchWriteRowRequestFieldNames; + if (tables_.Count > 0) { + output.WriteMessageArray(1, field_names[0], tables_); + } + if (hasTransactionId) { + output.WriteString(2, field_names[1], TransactionId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowRequest element in TablesList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasTransactionId) { + size += pb::CodedOutputStream.ComputeStringSize(2, TransactionId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static BatchWriteRowRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BatchWriteRowRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BatchWriteRowRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BatchWriteRowRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BatchWriteRowRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BatchWriteRowRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BatchWriteRowRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BatchWriteRowRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BatchWriteRowRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BatchWriteRowRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BatchWriteRowRequest MakeReadOnly() { + tables_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BatchWriteRowRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BatchWriteRowRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BatchWriteRowRequest result; + + private BatchWriteRowRequest PrepareBuilder() { + if (resultIsReadOnly) { + BatchWriteRowRequest original = result; + result = new BatchWriteRowRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BatchWriteRowRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.BatchWriteRowRequest.Descriptor; } + } + + public override BatchWriteRowRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.BatchWriteRowRequest.DefaultInstance; } + } + + public override BatchWriteRowRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BatchWriteRowRequest) { + return MergeFrom((BatchWriteRowRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BatchWriteRowRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.BatchWriteRowRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.tables_.Count != 0) { + result.tables_.Add(other.tables_); + } + if (other.HasTransactionId) { + TransactionId = other.TransactionId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_batchWriteRowRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _batchWriteRowRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.tables_, global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowRequest.DefaultInstance, extensionRegistry); + break; + } + case 18: { + result.hasTransactionId = input.ReadString(ref result.transactionId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList TablesList { + get { return PrepareBuilder().tables_; } + } + public int TablesCount { + get { return result.TablesCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowRequest GetTables(int index) { + return result.GetTables(index); + } + public Builder SetTables(int index, global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowRequest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.tables_[index] = value; + return this; + } + public Builder SetTables(int index, global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowRequest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.tables_[index] = builderForValue.Build(); + return this; + } + public Builder AddTables(global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowRequest value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.tables_.Add(value); + return this; + } + public Builder AddTables(global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowRequest.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.tables_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeTables(scg::IEnumerable values) { + PrepareBuilder(); + result.tables_.Add(values); + return this; + } + public Builder ClearTables() { + PrepareBuilder(); + result.tables_.Clear(); + return this; + } + + public bool HasTransactionId { + get { return result.hasTransactionId; } + } + public string TransactionId { + get { return result.TransactionId; } + set { SetTransactionId(value); } + } + public Builder SetTransactionId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTransactionId = true; + result.transactionId_ = value; + return this; + } + public Builder ClearTransactionId() { + PrepareBuilder(); + result.hasTransactionId = false; + result.transactionId_ = ""; + return this; + } + } + static BatchWriteRowRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class RowInBatchWriteRowResponse : pb::GeneratedMessage { + private RowInBatchWriteRowResponse() { } + private static readonly RowInBatchWriteRowResponse defaultInstance = new RowInBatchWriteRowResponse().MakeReadOnly(); + private static readonly string[] _rowInBatchWriteRowResponseFieldNames = new string[] { "consumed", "error", "is_ok", "row" }; + private static readonly uint[] _rowInBatchWriteRowResponseFieldTags = new uint[] { 26, 18, 8, 34 }; + public static RowInBatchWriteRowResponse DefaultInstance { + get { return defaultInstance; } + } + + public override RowInBatchWriteRowResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RowInBatchWriteRowResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_RowInBatchWriteRowResponse__FieldAccessorTable; } + } + + public const int IsOkFieldNumber = 1; + private bool hasIsOk; + private bool isOk_; + public bool HasIsOk { + get { return hasIsOk; } + } + public bool IsOk { + get { return isOk_; } + } + + public const int ErrorFieldNumber = 2; + private bool hasError; + private global::com.alicloud.openservices.tablestore.core.protocol.Error error_; + public bool HasError { + get { return hasError; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Error Error { + get { return error_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Error.DefaultInstance; } + } + + public const int ConsumedFieldNumber = 3; + private bool hasConsumed; + private global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity consumed_; + public bool HasConsumed { + get { return hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return consumed_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance; } + } + + public const int RowFieldNumber = 4; + private bool hasRow; + private pb::ByteString row_ = pb::ByteString.Empty; + public bool HasRow { + get { return hasRow; } + } + public pb::ByteString Row { + get { return row_; } + } + + public override bool IsInitialized { + get { + if (!hasIsOk) return false; + if (HasError) { + if (!Error.IsInitialized) return false; + } + if (HasConsumed) { + if (!Consumed.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _rowInBatchWriteRowResponseFieldNames; + if (hasIsOk) { + output.WriteBool(1, field_names[2], IsOk); + } + if (hasError) { + output.WriteMessage(2, field_names[1], Error); + } + if (hasConsumed) { + output.WriteMessage(3, field_names[0], Consumed); + } + if (hasRow) { + output.WriteBytes(4, field_names[3], Row); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasIsOk) { + size += pb::CodedOutputStream.ComputeBoolSize(1, IsOk); + } + if (hasError) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Error); + } + if (hasConsumed) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Consumed); + } + if (hasRow) { + size += pb::CodedOutputStream.ComputeBytesSize(4, Row); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static RowInBatchWriteRowResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RowInBatchWriteRowResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RowInBatchWriteRowResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RowInBatchWriteRowResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RowInBatchWriteRowResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RowInBatchWriteRowResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RowInBatchWriteRowResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RowInBatchWriteRowResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RowInBatchWriteRowResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RowInBatchWriteRowResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RowInBatchWriteRowResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RowInBatchWriteRowResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RowInBatchWriteRowResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RowInBatchWriteRowResponse result; + + private RowInBatchWriteRowResponse PrepareBuilder() { + if (resultIsReadOnly) { + RowInBatchWriteRowResponse original = result; + result = new RowInBatchWriteRowResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RowInBatchWriteRowResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowResponse.Descriptor; } + } + + public override RowInBatchWriteRowResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowResponse.DefaultInstance; } + } + + public override RowInBatchWriteRowResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RowInBatchWriteRowResponse) { + return MergeFrom((RowInBatchWriteRowResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RowInBatchWriteRowResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasIsOk) { + IsOk = other.IsOk; + } + if (other.HasError) { + MergeError(other.Error); + } + if (other.HasConsumed) { + MergeConsumed(other.Consumed); + } + if (other.HasRow) { + Row = other.Row; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_rowInBatchWriteRowResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _rowInBatchWriteRowResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasIsOk = input.ReadBool(ref result.isOk_); + break; + } + case 18: { + global::com.alicloud.openservices.tablestore.core.protocol.Error.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Error.CreateBuilder(); + if (result.hasError) { + subBuilder.MergeFrom(Error); + } + input.ReadMessage(subBuilder, extensionRegistry); + Error = subBuilder.BuildPartial(); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(); + if (result.hasConsumed) { + subBuilder.MergeFrom(Consumed); + } + input.ReadMessage(subBuilder, extensionRegistry); + Consumed = subBuilder.BuildPartial(); + break; + } + case 34: { + result.hasRow = input.ReadBytes(ref result.row_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasIsOk { + get { return result.hasIsOk; } + } + public bool IsOk { + get { return result.IsOk; } + set { SetIsOk(value); } + } + public Builder SetIsOk(bool value) { + PrepareBuilder(); + result.hasIsOk = true; + result.isOk_ = value; + return this; + } + public Builder ClearIsOk() { + PrepareBuilder(); + result.hasIsOk = false; + result.isOk_ = false; + return this; + } + + public bool HasError { + get { return result.hasError; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Error Error { + get { return result.Error; } + set { SetError(value); } + } + public Builder SetError(global::com.alicloud.openservices.tablestore.core.protocol.Error value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasError = true; + result.error_ = value; + return this; + } + public Builder SetError(global::com.alicloud.openservices.tablestore.core.protocol.Error.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasError = true; + result.error_ = builderForValue.Build(); + return this; + } + public Builder MergeError(global::com.alicloud.openservices.tablestore.core.protocol.Error value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasError && + result.error_ != global::com.alicloud.openservices.tablestore.core.protocol.Error.DefaultInstance) { + result.error_ = global::com.alicloud.openservices.tablestore.core.protocol.Error.CreateBuilder(result.error_).MergeFrom(value).BuildPartial(); + } else { + result.error_ = value; + } + result.hasError = true; + return this; + } + public Builder ClearError() { + PrepareBuilder(); + result.hasError = false; + result.error_ = null; + return this; + } + + public bool HasConsumed { + get { return result.hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return result.Consumed; } + set { SetConsumed(value); } + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = value; + return this; + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = builderForValue.Build(); + return this; + } + public Builder MergeConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasConsumed && + result.consumed_ != global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance) { + result.consumed_ = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(result.consumed_).MergeFrom(value).BuildPartial(); + } else { + result.consumed_ = value; + } + result.hasConsumed = true; + return this; + } + public Builder ClearConsumed() { + PrepareBuilder(); + result.hasConsumed = false; + result.consumed_ = null; + return this; + } + + public bool HasRow { + get { return result.hasRow; } + } + public pb::ByteString Row { + get { return result.Row; } + set { SetRow(value); } + } + public Builder SetRow(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRow = true; + result.row_ = value; + return this; + } + public Builder ClearRow() { + PrepareBuilder(); + result.hasRow = false; + result.row_ = pb::ByteString.Empty; + return this; + } + } + static RowInBatchWriteRowResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TableInBatchWriteRowResponse : pb::GeneratedMessage { + private TableInBatchWriteRowResponse() { } + private static readonly TableInBatchWriteRowResponse defaultInstance = new TableInBatchWriteRowResponse().MakeReadOnly(); + private static readonly string[] _tableInBatchWriteRowResponseFieldNames = new string[] { "rows", "table_name" }; + private static readonly uint[] _tableInBatchWriteRowResponseFieldTags = new uint[] { 18, 10 }; + public static TableInBatchWriteRowResponse DefaultInstance { + get { return defaultInstance; } + } + + public override TableInBatchWriteRowResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TableInBatchWriteRowResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_TableInBatchWriteRowResponse__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int RowsFieldNumber = 2; + private pbc::PopsicleList rows_ = new pbc::PopsicleList(); + public scg::IList RowsList { + get { return rows_; } + } + public int RowsCount { + get { return rows_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowResponse GetRows(int index) { + return rows_[index]; + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowResponse element in RowsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _tableInBatchWriteRowResponseFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[1], TableName); + } + if (rows_.Count > 0) { + output.WriteMessageArray(2, field_names[0], rows_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowResponse element in RowsList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TableInBatchWriteRowResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TableInBatchWriteRowResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TableInBatchWriteRowResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TableInBatchWriteRowResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TableInBatchWriteRowResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TableInBatchWriteRowResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TableInBatchWriteRowResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TableInBatchWriteRowResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TableInBatchWriteRowResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TableInBatchWriteRowResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TableInBatchWriteRowResponse MakeReadOnly() { + rows_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TableInBatchWriteRowResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TableInBatchWriteRowResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TableInBatchWriteRowResponse result; + + private TableInBatchWriteRowResponse PrepareBuilder() { + if (resultIsReadOnly) { + TableInBatchWriteRowResponse original = result; + result = new TableInBatchWriteRowResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TableInBatchWriteRowResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowResponse.Descriptor; } + } + + public override TableInBatchWriteRowResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowResponse.DefaultInstance; } + } + + public override TableInBatchWriteRowResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TableInBatchWriteRowResponse) { + return MergeFrom((TableInBatchWriteRowResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TableInBatchWriteRowResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.rows_.Count != 0) { + result.rows_.Add(other.rows_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_tableInBatchWriteRowResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _tableInBatchWriteRowResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.rows_, global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowResponse.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public pbc::IPopsicleList RowsList { + get { return PrepareBuilder().rows_; } + } + public int RowsCount { + get { return result.RowsCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowResponse GetRows(int index) { + return result.GetRows(index); + } + public Builder SetRows(int index, global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowResponse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.rows_[index] = value; + return this; + } + public Builder SetRows(int index, global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowResponse.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.rows_[index] = builderForValue.Build(); + return this; + } + public Builder AddRows(global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowResponse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.rows_.Add(value); + return this; + } + public Builder AddRows(global::com.alicloud.openservices.tablestore.core.protocol.RowInBatchWriteRowResponse.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.rows_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeRows(scg::IEnumerable values) { + PrepareBuilder(); + result.rows_.Add(values); + return this; + } + public Builder ClearRows() { + PrepareBuilder(); + result.rows_.Clear(); + return this; + } + } + static TableInBatchWriteRowResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class BatchWriteRowResponse : pb::GeneratedMessage { + private BatchWriteRowResponse() { } + private static readonly BatchWriteRowResponse defaultInstance = new BatchWriteRowResponse().MakeReadOnly(); + private static readonly string[] _batchWriteRowResponseFieldNames = new string[] { "tables" }; + private static readonly uint[] _batchWriteRowResponseFieldTags = new uint[] { 10 }; + public static BatchWriteRowResponse DefaultInstance { + get { return defaultInstance; } + } + + public override BatchWriteRowResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BatchWriteRowResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_BatchWriteRowResponse__FieldAccessorTable; } + } + + public const int TablesFieldNumber = 1; + private pbc::PopsicleList tables_ = new pbc::PopsicleList(); + public scg::IList TablesList { + get { return tables_; } + } + public int TablesCount { + get { return tables_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowResponse GetTables(int index) { + return tables_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowResponse element in TablesList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _batchWriteRowResponseFieldNames; + if (tables_.Count > 0) { + output.WriteMessageArray(1, field_names[0], tables_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowResponse element in TablesList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static BatchWriteRowResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BatchWriteRowResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BatchWriteRowResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BatchWriteRowResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BatchWriteRowResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BatchWriteRowResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BatchWriteRowResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BatchWriteRowResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BatchWriteRowResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BatchWriteRowResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BatchWriteRowResponse MakeReadOnly() { + tables_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BatchWriteRowResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BatchWriteRowResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BatchWriteRowResponse result; + + private BatchWriteRowResponse PrepareBuilder() { + if (resultIsReadOnly) { + BatchWriteRowResponse original = result; + result = new BatchWriteRowResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BatchWriteRowResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.BatchWriteRowResponse.Descriptor; } + } + + public override BatchWriteRowResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.BatchWriteRowResponse.DefaultInstance; } + } + + public override BatchWriteRowResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BatchWriteRowResponse) { + return MergeFrom((BatchWriteRowResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BatchWriteRowResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.BatchWriteRowResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.tables_.Count != 0) { + result.tables_.Add(other.tables_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_batchWriteRowResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _batchWriteRowResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.tables_, global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowResponse.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList TablesList { + get { return PrepareBuilder().tables_; } + } + public int TablesCount { + get { return result.TablesCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowResponse GetTables(int index) { + return result.GetTables(index); + } + public Builder SetTables(int index, global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowResponse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.tables_[index] = value; + return this; + } + public Builder SetTables(int index, global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowResponse.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.tables_[index] = builderForValue.Build(); + return this; + } + public Builder AddTables(global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowResponse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.tables_.Add(value); + return this; + } + public Builder AddTables(global::com.alicloud.openservices.tablestore.core.protocol.TableInBatchWriteRowResponse.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.tables_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeTables(scg::IEnumerable values) { + PrepareBuilder(); + result.tables_.Add(values); + return this; + } + public Builder ClearTables() { + PrepareBuilder(); + result.tables_.Clear(); + return this; + } + } + static BatchWriteRowResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class GetRangeRequest : pb::GeneratedMessage { + private GetRangeRequest() { } + private static readonly GetRangeRequest defaultInstance = new GetRangeRequest().MakeReadOnly(); + private static readonly string[] _getRangeRequestFieldNames = new string[] { "cache_blocks", "columns_to_get", "compress_type_hint", "data_block_type_hint", "direction", "end_column", "exclusive_end_primary_key", "filter", "inclusive_start_primary_key", "limit", "max_versions", "return_entire_primary_keys", "start_column", "table_name", "time_range", "token", "transaction_id" }; + private static readonly uint[] _getRangeRequestFieldTags = new uint[] { 72, 26, 136, 120, 16, 98, 66, 82, 58, 48, 40, 128, 90, 10, 34, 106, 114 }; + public static GetRangeRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetRangeRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetRangeRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int DirectionFieldNumber = 2; + private bool hasDirection; + private global::com.alicloud.openservices.tablestore.core.protocol.Direction direction_ = global::com.alicloud.openservices.tablestore.core.protocol.Direction.FORWARD; + public bool HasDirection { + get { return hasDirection; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Direction Direction { + get { return direction_; } + } + + public const int ColumnsToGetFieldNumber = 3; + private pbc::PopsicleList columnsToGet_ = new pbc::PopsicleList(); + public scg::IList ColumnsToGetList { + get { return pbc::Lists.AsReadOnly(columnsToGet_); } + } + public int ColumnsToGetCount { + get { return columnsToGet_.Count; } + } + public string GetColumnsToGet(int index) { + return columnsToGet_[index]; + } + + public const int TimeRangeFieldNumber = 4; + private bool hasTimeRange; + private global::com.alicloud.openservices.tablestore.core.protocol.TimeRange timeRange_; + public bool HasTimeRange { + get { return hasTimeRange; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TimeRange TimeRange { + get { return timeRange_ ?? global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.DefaultInstance; } + } + + public const int MaxVersionsFieldNumber = 5; + private bool hasMaxVersions; + private int maxVersions_; + public bool HasMaxVersions { + get { return hasMaxVersions; } + } + public int MaxVersions { + get { return maxVersions_; } + } + + public const int LimitFieldNumber = 6; + private bool hasLimit; + private int limit_; + public bool HasLimit { + get { return hasLimit; } + } + public int Limit { + get { return limit_; } + } + + public const int InclusiveStartPrimaryKeyFieldNumber = 7; + private bool hasInclusiveStartPrimaryKey; + private pb::ByteString inclusiveStartPrimaryKey_ = pb::ByteString.Empty; + public bool HasInclusiveStartPrimaryKey { + get { return hasInclusiveStartPrimaryKey; } + } + public pb::ByteString InclusiveStartPrimaryKey { + get { return inclusiveStartPrimaryKey_; } + } + + public const int ExclusiveEndPrimaryKeyFieldNumber = 8; + private bool hasExclusiveEndPrimaryKey; + private pb::ByteString exclusiveEndPrimaryKey_ = pb::ByteString.Empty; + public bool HasExclusiveEndPrimaryKey { + get { return hasExclusiveEndPrimaryKey; } + } + public pb::ByteString ExclusiveEndPrimaryKey { + get { return exclusiveEndPrimaryKey_; } + } + + public const int CacheBlocksFieldNumber = 9; + private bool hasCacheBlocks; + private bool cacheBlocks_ = true; + public bool HasCacheBlocks { + get { return hasCacheBlocks; } + } + public bool CacheBlocks { + get { return cacheBlocks_; } + } + + public const int FilterFieldNumber = 10; + private bool hasFilter; + private pb::ByteString filter_ = pb::ByteString.Empty; + public bool HasFilter { + get { return hasFilter; } + } + public pb::ByteString Filter { + get { return filter_; } + } + + public const int StartColumnFieldNumber = 11; + private bool hasStartColumn; + private string startColumn_ = ""; + public bool HasStartColumn { + get { return hasStartColumn; } + } + public string StartColumn { + get { return startColumn_; } + } + + public const int EndColumnFieldNumber = 12; + private bool hasEndColumn; + private string endColumn_ = ""; + public bool HasEndColumn { + get { return hasEndColumn; } + } + public string EndColumn { + get { return endColumn_; } + } + + public const int TokenFieldNumber = 13; + private bool hasToken; + private pb::ByteString token_ = pb::ByteString.Empty; + public bool HasToken { + get { return hasToken; } + } + public pb::ByteString Token { + get { return token_; } + } + + public const int TransactionIdFieldNumber = 14; + private bool hasTransactionId; + private string transactionId_ = ""; + public bool HasTransactionId { + get { return hasTransactionId; } + } + public string TransactionId { + get { return transactionId_; } + } + + public const int DataBlockTypeHintFieldNumber = 15; + private bool hasDataBlockTypeHint; + private global::com.alicloud.openservices.tablestore.core.protocol.DataBlockType dataBlockTypeHint_ = global::com.alicloud.openservices.tablestore.core.protocol.DataBlockType.DBT_PLAIN_BUFFER; + public bool HasDataBlockTypeHint { + get { return hasDataBlockTypeHint; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.DataBlockType DataBlockTypeHint { + get { return dataBlockTypeHint_; } + } + + public const int ReturnEntirePrimaryKeysFieldNumber = 16; + private bool hasReturnEntirePrimaryKeys; + private bool returnEntirePrimaryKeys_ = true; + public bool HasReturnEntirePrimaryKeys { + get { return hasReturnEntirePrimaryKeys; } + } + public bool ReturnEntirePrimaryKeys { + get { return returnEntirePrimaryKeys_; } + } + + public const int CompressTypeHintFieldNumber = 17; + private bool hasCompressTypeHint; + private global::com.alicloud.openservices.tablestore.core.protocol.CompressType compressTypeHint_ = global::com.alicloud.openservices.tablestore.core.protocol.CompressType.CPT_NONE; + public bool HasCompressTypeHint { + get { return hasCompressTypeHint; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.CompressType CompressTypeHint { + get { return compressTypeHint_; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + if (!hasDirection) return false; + if (!hasInclusiveStartPrimaryKey) return false; + if (!hasExclusiveEndPrimaryKey) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _getRangeRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[13], TableName); + } + if (hasDirection) { + output.WriteEnum(2, field_names[4], (int) Direction, Direction); + } + if (columnsToGet_.Count > 0) { + output.WriteStringArray(3, field_names[1], columnsToGet_); + } + if (hasTimeRange) { + output.WriteMessage(4, field_names[14], TimeRange); + } + if (hasMaxVersions) { + output.WriteInt32(5, field_names[10], MaxVersions); + } + if (hasLimit) { + output.WriteInt32(6, field_names[9], Limit); + } + if (hasInclusiveStartPrimaryKey) { + output.WriteBytes(7, field_names[8], InclusiveStartPrimaryKey); + } + if (hasExclusiveEndPrimaryKey) { + output.WriteBytes(8, field_names[6], ExclusiveEndPrimaryKey); + } + if (hasCacheBlocks) { + output.WriteBool(9, field_names[0], CacheBlocks); + } + if (hasFilter) { + output.WriteBytes(10, field_names[7], Filter); + } + if (hasStartColumn) { + output.WriteString(11, field_names[12], StartColumn); + } + if (hasEndColumn) { + output.WriteString(12, field_names[5], EndColumn); + } + if (hasToken) { + output.WriteBytes(13, field_names[15], Token); + } + if (hasTransactionId) { + output.WriteString(14, field_names[16], TransactionId); + } + if (hasDataBlockTypeHint) { + output.WriteEnum(15, field_names[3], (int) DataBlockTypeHint, DataBlockTypeHint); + } + if (hasReturnEntirePrimaryKeys) { + output.WriteBool(16, field_names[11], ReturnEntirePrimaryKeys); + } + if (hasCompressTypeHint) { + output.WriteEnum(17, field_names[2], (int) CompressTypeHint, CompressTypeHint); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + if (hasDirection) { + size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Direction); + } + { + int dataSize = 0; + foreach (string element in ColumnsToGetList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * columnsToGet_.Count; + } + if (hasTimeRange) { + size += pb::CodedOutputStream.ComputeMessageSize(4, TimeRange); + } + if (hasMaxVersions) { + size += pb::CodedOutputStream.ComputeInt32Size(5, MaxVersions); + } + if (hasLimit) { + size += pb::CodedOutputStream.ComputeInt32Size(6, Limit); + } + if (hasInclusiveStartPrimaryKey) { + size += pb::CodedOutputStream.ComputeBytesSize(7, InclusiveStartPrimaryKey); + } + if (hasExclusiveEndPrimaryKey) { + size += pb::CodedOutputStream.ComputeBytesSize(8, ExclusiveEndPrimaryKey); + } + if (hasCacheBlocks) { + size += pb::CodedOutputStream.ComputeBoolSize(9, CacheBlocks); + } + if (hasFilter) { + size += pb::CodedOutputStream.ComputeBytesSize(10, Filter); + } + if (hasStartColumn) { + size += pb::CodedOutputStream.ComputeStringSize(11, StartColumn); + } + if (hasEndColumn) { + size += pb::CodedOutputStream.ComputeStringSize(12, EndColumn); + } + if (hasToken) { + size += pb::CodedOutputStream.ComputeBytesSize(13, Token); + } + if (hasTransactionId) { + size += pb::CodedOutputStream.ComputeStringSize(14, TransactionId); + } + if (hasDataBlockTypeHint) { + size += pb::CodedOutputStream.ComputeEnumSize(15, (int) DataBlockTypeHint); + } + if (hasReturnEntirePrimaryKeys) { + size += pb::CodedOutputStream.ComputeBoolSize(16, ReturnEntirePrimaryKeys); + } + if (hasCompressTypeHint) { + size += pb::CodedOutputStream.ComputeEnumSize(17, (int) CompressTypeHint); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static GetRangeRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetRangeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetRangeRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetRangeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetRangeRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetRangeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetRangeRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetRangeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetRangeRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetRangeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetRangeRequest MakeReadOnly() { + columnsToGet_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetRangeRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetRangeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetRangeRequest result; + + private GetRangeRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetRangeRequest original = result; + result = new GetRangeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetRangeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetRangeRequest.Descriptor; } + } + + public override GetRangeRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetRangeRequest.DefaultInstance; } + } + + public override GetRangeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetRangeRequest) { + return MergeFrom((GetRangeRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetRangeRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.GetRangeRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasDirection) { + Direction = other.Direction; + } + if (other.columnsToGet_.Count != 0) { + result.columnsToGet_.Add(other.columnsToGet_); + } + if (other.HasTimeRange) { + MergeTimeRange(other.TimeRange); + } + if (other.HasMaxVersions) { + MaxVersions = other.MaxVersions; + } + if (other.HasLimit) { + Limit = other.Limit; + } + if (other.HasInclusiveStartPrimaryKey) { + InclusiveStartPrimaryKey = other.InclusiveStartPrimaryKey; + } + if (other.HasExclusiveEndPrimaryKey) { + ExclusiveEndPrimaryKey = other.ExclusiveEndPrimaryKey; + } + if (other.HasCacheBlocks) { + CacheBlocks = other.CacheBlocks; + } + if (other.HasFilter) { + Filter = other.Filter; + } + if (other.HasStartColumn) { + StartColumn = other.StartColumn; + } + if (other.HasEndColumn) { + EndColumn = other.EndColumn; + } + if (other.HasToken) { + Token = other.Token; + } + if (other.HasTransactionId) { + TransactionId = other.TransactionId; + } + if (other.HasDataBlockTypeHint) { + DataBlockTypeHint = other.DataBlockTypeHint; + } + if (other.HasReturnEntirePrimaryKeys) { + ReturnEntirePrimaryKeys = other.ReturnEntirePrimaryKeys; + } + if (other.HasCompressTypeHint) { + CompressTypeHint = other.CompressTypeHint; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getRangeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getRangeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 16: { + object unknown; + if(input.ReadEnum(ref result.direction_, out unknown)) { + result.hasDirection = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(2, (ulong)(int)unknown); + } + break; + } + case 26: { + input.ReadStringArray(tag, field_name, result.columnsToGet_); + break; + } + case 34: { + global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.CreateBuilder(); + if (result.hasTimeRange) { + subBuilder.MergeFrom(TimeRange); + } + input.ReadMessage(subBuilder, extensionRegistry); + TimeRange = subBuilder.BuildPartial(); + break; + } + case 40: { + result.hasMaxVersions = input.ReadInt32(ref result.maxVersions_); + break; + } + case 48: { + result.hasLimit = input.ReadInt32(ref result.limit_); + break; + } + case 58: { + result.hasInclusiveStartPrimaryKey = input.ReadBytes(ref result.inclusiveStartPrimaryKey_); + break; + } + case 66: { + result.hasExclusiveEndPrimaryKey = input.ReadBytes(ref result.exclusiveEndPrimaryKey_); + break; + } + case 72: { + result.hasCacheBlocks = input.ReadBool(ref result.cacheBlocks_); + break; + } + case 82: { + result.hasFilter = input.ReadBytes(ref result.filter_); + break; + } + case 90: { + result.hasStartColumn = input.ReadString(ref result.startColumn_); + break; + } + case 98: { + result.hasEndColumn = input.ReadString(ref result.endColumn_); + break; + } + case 106: { + result.hasToken = input.ReadBytes(ref result.token_); + break; + } + case 114: { + result.hasTransactionId = input.ReadString(ref result.transactionId_); + break; + } + case 120: { + object unknown; + if(input.ReadEnum(ref result.dataBlockTypeHint_, out unknown)) { + result.hasDataBlockTypeHint = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(15, (ulong)(int)unknown); + } + break; + } + case 128: { + result.hasReturnEntirePrimaryKeys = input.ReadBool(ref result.returnEntirePrimaryKeys_); + break; + } + case 136: { + object unknown; + if(input.ReadEnum(ref result.compressTypeHint_, out unknown)) { + result.hasCompressTypeHint = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(17, (ulong)(int)unknown); + } + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasDirection { + get { return result.hasDirection; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Direction Direction { + get { return result.Direction; } + set { SetDirection(value); } + } + public Builder SetDirection(global::com.alicloud.openservices.tablestore.core.protocol.Direction value) { + PrepareBuilder(); + result.hasDirection = true; + result.direction_ = value; + return this; + } + public Builder ClearDirection() { + PrepareBuilder(); + result.hasDirection = false; + result.direction_ = global::com.alicloud.openservices.tablestore.core.protocol.Direction.FORWARD; + return this; + } + + public pbc::IPopsicleList ColumnsToGetList { + get { return PrepareBuilder().columnsToGet_; } + } + public int ColumnsToGetCount { + get { return result.ColumnsToGetCount; } + } + public string GetColumnsToGet(int index) { + return result.GetColumnsToGet(index); + } + public Builder SetColumnsToGet(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.columnsToGet_[index] = value; + return this; + } + public Builder AddColumnsToGet(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.columnsToGet_.Add(value); + return this; + } + public Builder AddRangeColumnsToGet(scg::IEnumerable values) { + PrepareBuilder(); + result.columnsToGet_.Add(values); + return this; + } + public Builder ClearColumnsToGet() { + PrepareBuilder(); + result.columnsToGet_.Clear(); + return this; + } + + public bool HasTimeRange { + get { return result.hasTimeRange; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.TimeRange TimeRange { + get { return result.TimeRange; } + set { SetTimeRange(value); } + } + public Builder SetTimeRange(global::com.alicloud.openservices.tablestore.core.protocol.TimeRange value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTimeRange = true; + result.timeRange_ = value; + return this; + } + public Builder SetTimeRange(global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasTimeRange = true; + result.timeRange_ = builderForValue.Build(); + return this; + } + public Builder MergeTimeRange(global::com.alicloud.openservices.tablestore.core.protocol.TimeRange value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasTimeRange && + result.timeRange_ != global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.DefaultInstance) { + result.timeRange_ = global::com.alicloud.openservices.tablestore.core.protocol.TimeRange.CreateBuilder(result.timeRange_).MergeFrom(value).BuildPartial(); + } else { + result.timeRange_ = value; + } + result.hasTimeRange = true; + return this; + } + public Builder ClearTimeRange() { + PrepareBuilder(); + result.hasTimeRange = false; + result.timeRange_ = null; + return this; + } + + public bool HasMaxVersions { + get { return result.hasMaxVersions; } + } + public int MaxVersions { + get { return result.MaxVersions; } + set { SetMaxVersions(value); } + } + public Builder SetMaxVersions(int value) { + PrepareBuilder(); + result.hasMaxVersions = true; + result.maxVersions_ = value; + return this; + } + public Builder ClearMaxVersions() { + PrepareBuilder(); + result.hasMaxVersions = false; + result.maxVersions_ = 0; + return this; + } + + public bool HasLimit { + get { return result.hasLimit; } + } + public int Limit { + get { return result.Limit; } + set { SetLimit(value); } + } + public Builder SetLimit(int value) { + PrepareBuilder(); + result.hasLimit = true; + result.limit_ = value; + return this; + } + public Builder ClearLimit() { + PrepareBuilder(); + result.hasLimit = false; + result.limit_ = 0; + return this; + } + + public bool HasInclusiveStartPrimaryKey { + get { return result.hasInclusiveStartPrimaryKey; } + } + public pb::ByteString InclusiveStartPrimaryKey { + get { return result.InclusiveStartPrimaryKey; } + set { SetInclusiveStartPrimaryKey(value); } + } + public Builder SetInclusiveStartPrimaryKey(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInclusiveStartPrimaryKey = true; + result.inclusiveStartPrimaryKey_ = value; + return this; + } + public Builder ClearInclusiveStartPrimaryKey() { + PrepareBuilder(); + result.hasInclusiveStartPrimaryKey = false; + result.inclusiveStartPrimaryKey_ = pb::ByteString.Empty; + return this; + } + + public bool HasExclusiveEndPrimaryKey { + get { return result.hasExclusiveEndPrimaryKey; } + } + public pb::ByteString ExclusiveEndPrimaryKey { + get { return result.ExclusiveEndPrimaryKey; } + set { SetExclusiveEndPrimaryKey(value); } + } + public Builder SetExclusiveEndPrimaryKey(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasExclusiveEndPrimaryKey = true; + result.exclusiveEndPrimaryKey_ = value; + return this; + } + public Builder ClearExclusiveEndPrimaryKey() { + PrepareBuilder(); + result.hasExclusiveEndPrimaryKey = false; + result.exclusiveEndPrimaryKey_ = pb::ByteString.Empty; + return this; + } + + public bool HasCacheBlocks { + get { return result.hasCacheBlocks; } + } + public bool CacheBlocks { + get { return result.CacheBlocks; } + set { SetCacheBlocks(value); } + } + public Builder SetCacheBlocks(bool value) { + PrepareBuilder(); + result.hasCacheBlocks = true; + result.cacheBlocks_ = value; + return this; + } + public Builder ClearCacheBlocks() { + PrepareBuilder(); + result.hasCacheBlocks = false; + result.cacheBlocks_ = true; + return this; + } + + public bool HasFilter { + get { return result.hasFilter; } + } + public pb::ByteString Filter { + get { return result.Filter; } + set { SetFilter(value); } + } + public Builder SetFilter(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = value; + return this; + } + public Builder ClearFilter() { + PrepareBuilder(); + result.hasFilter = false; + result.filter_ = pb::ByteString.Empty; + return this; + } + + public bool HasStartColumn { + get { return result.hasStartColumn; } + } + public string StartColumn { + get { return result.StartColumn; } + set { SetStartColumn(value); } + } + public Builder SetStartColumn(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStartColumn = true; + result.startColumn_ = value; + return this; + } + public Builder ClearStartColumn() { + PrepareBuilder(); + result.hasStartColumn = false; + result.startColumn_ = ""; + return this; + } + + public bool HasEndColumn { + get { return result.hasEndColumn; } + } + public string EndColumn { + get { return result.EndColumn; } + set { SetEndColumn(value); } + } + public Builder SetEndColumn(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasEndColumn = true; + result.endColumn_ = value; + return this; + } + public Builder ClearEndColumn() { + PrepareBuilder(); + result.hasEndColumn = false; + result.endColumn_ = ""; + return this; + } + + public bool HasToken { + get { return result.hasToken; } + } + public pb::ByteString Token { + get { return result.Token; } + set { SetToken(value); } + } + public Builder SetToken(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasToken = true; + result.token_ = value; + return this; + } + public Builder ClearToken() { + PrepareBuilder(); + result.hasToken = false; + result.token_ = pb::ByteString.Empty; + return this; + } + + public bool HasTransactionId { + get { return result.hasTransactionId; } + } + public string TransactionId { + get { return result.TransactionId; } + set { SetTransactionId(value); } + } + public Builder SetTransactionId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTransactionId = true; + result.transactionId_ = value; + return this; + } + public Builder ClearTransactionId() { + PrepareBuilder(); + result.hasTransactionId = false; + result.transactionId_ = ""; + return this; + } + + public bool HasDataBlockTypeHint { + get { return result.hasDataBlockTypeHint; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.DataBlockType DataBlockTypeHint { + get { return result.DataBlockTypeHint; } + set { SetDataBlockTypeHint(value); } + } + public Builder SetDataBlockTypeHint(global::com.alicloud.openservices.tablestore.core.protocol.DataBlockType value) { + PrepareBuilder(); + result.hasDataBlockTypeHint = true; + result.dataBlockTypeHint_ = value; + return this; + } + public Builder ClearDataBlockTypeHint() { + PrepareBuilder(); + result.hasDataBlockTypeHint = false; + result.dataBlockTypeHint_ = global::com.alicloud.openservices.tablestore.core.protocol.DataBlockType.DBT_PLAIN_BUFFER; + return this; + } + + public bool HasReturnEntirePrimaryKeys { + get { return result.hasReturnEntirePrimaryKeys; } + } + public bool ReturnEntirePrimaryKeys { + get { return result.ReturnEntirePrimaryKeys; } + set { SetReturnEntirePrimaryKeys(value); } + } + public Builder SetReturnEntirePrimaryKeys(bool value) { + PrepareBuilder(); + result.hasReturnEntirePrimaryKeys = true; + result.returnEntirePrimaryKeys_ = value; + return this; + } + public Builder ClearReturnEntirePrimaryKeys() { + PrepareBuilder(); + result.hasReturnEntirePrimaryKeys = false; + result.returnEntirePrimaryKeys_ = true; + return this; + } + + public bool HasCompressTypeHint { + get { return result.hasCompressTypeHint; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.CompressType CompressTypeHint { + get { return result.CompressTypeHint; } + set { SetCompressTypeHint(value); } + } + public Builder SetCompressTypeHint(global::com.alicloud.openservices.tablestore.core.protocol.CompressType value) { + PrepareBuilder(); + result.hasCompressTypeHint = true; + result.compressTypeHint_ = value; + return this; + } + public Builder ClearCompressTypeHint() { + PrepareBuilder(); + result.hasCompressTypeHint = false; + result.compressTypeHint_ = global::com.alicloud.openservices.tablestore.core.protocol.CompressType.CPT_NONE; + return this; + } + } + static GetRangeRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class GetRangeResponse : pb::GeneratedMessage { + private GetRangeResponse() { } + private static readonly GetRangeResponse defaultInstance = new GetRangeResponse().MakeReadOnly(); + private static readonly string[] _getRangeResponseFieldNames = new string[] { "compress_type", "consumed", "data_block_type", "next_start_primary_key", "next_token", "rows" }; + private static readonly uint[] _getRangeResponseFieldTags = new uint[] { 48, 10, 40, 26, 34, 18 }; + public static GetRangeResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetRangeResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetRangeResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetRangeResponse__FieldAccessorTable; } + } + + public const int ConsumedFieldNumber = 1; + private bool hasConsumed; + private global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity consumed_; + public bool HasConsumed { + get { return hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return consumed_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance; } + } + + public const int RowsFieldNumber = 2; + private bool hasRows; + private pb::ByteString rows_ = pb::ByteString.Empty; + public bool HasRows { + get { return hasRows; } + } + public pb::ByteString Rows { + get { return rows_; } + } + + public const int NextStartPrimaryKeyFieldNumber = 3; + private bool hasNextStartPrimaryKey; + private pb::ByteString nextStartPrimaryKey_ = pb::ByteString.Empty; + public bool HasNextStartPrimaryKey { + get { return hasNextStartPrimaryKey; } + } + public pb::ByteString NextStartPrimaryKey { + get { return nextStartPrimaryKey_; } + } + + public const int NextTokenFieldNumber = 4; + private bool hasNextToken; + private pb::ByteString nextToken_ = pb::ByteString.Empty; + public bool HasNextToken { + get { return hasNextToken; } + } + public pb::ByteString NextToken { + get { return nextToken_; } + } + + public const int DataBlockTypeFieldNumber = 5; + private bool hasDataBlockType; + private global::com.alicloud.openservices.tablestore.core.protocol.DataBlockType dataBlockType_ = global::com.alicloud.openservices.tablestore.core.protocol.DataBlockType.DBT_PLAIN_BUFFER; + public bool HasDataBlockType { + get { return hasDataBlockType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.DataBlockType DataBlockType { + get { return dataBlockType_; } + } + + public const int CompressTypeFieldNumber = 6; + private bool hasCompressType; + private global::com.alicloud.openservices.tablestore.core.protocol.CompressType compressType_ = global::com.alicloud.openservices.tablestore.core.protocol.CompressType.CPT_NONE; + public bool HasCompressType { + get { return hasCompressType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.CompressType CompressType { + get { return compressType_; } + } + + public override bool IsInitialized { + get { + if (!hasConsumed) return false; + if (!hasRows) return false; + if (!Consumed.IsInitialized) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _getRangeResponseFieldNames; + if (hasConsumed) { + output.WriteMessage(1, field_names[1], Consumed); + } + if (hasRows) { + output.WriteBytes(2, field_names[5], Rows); + } + if (hasNextStartPrimaryKey) { + output.WriteBytes(3, field_names[3], NextStartPrimaryKey); + } + if (hasNextToken) { + output.WriteBytes(4, field_names[4], NextToken); + } + if (hasDataBlockType) { + output.WriteEnum(5, field_names[2], (int) DataBlockType, DataBlockType); + } + if (hasCompressType) { + output.WriteEnum(6, field_names[0], (int) CompressType, CompressType); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasConsumed) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Consumed); + } + if (hasRows) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Rows); + } + if (hasNextStartPrimaryKey) { + size += pb::CodedOutputStream.ComputeBytesSize(3, NextStartPrimaryKey); + } + if (hasNextToken) { + size += pb::CodedOutputStream.ComputeBytesSize(4, NextToken); + } + if (hasDataBlockType) { + size += pb::CodedOutputStream.ComputeEnumSize(5, (int) DataBlockType); + } + if (hasCompressType) { + size += pb::CodedOutputStream.ComputeEnumSize(6, (int) CompressType); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static GetRangeResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetRangeResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetRangeResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetRangeResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetRangeResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetRangeResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetRangeResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetRangeResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetRangeResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetRangeResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetRangeResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetRangeResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetRangeResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetRangeResponse result; + + private GetRangeResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetRangeResponse original = result; + result = new GetRangeResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetRangeResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetRangeResponse.Descriptor; } + } + + public override GetRangeResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetRangeResponse.DefaultInstance; } + } + + public override GetRangeResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetRangeResponse) { + return MergeFrom((GetRangeResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetRangeResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.GetRangeResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasConsumed) { + MergeConsumed(other.Consumed); + } + if (other.HasRows) { + Rows = other.Rows; + } + if (other.HasNextStartPrimaryKey) { + NextStartPrimaryKey = other.NextStartPrimaryKey; + } + if (other.HasNextToken) { + NextToken = other.NextToken; + } + if (other.HasDataBlockType) { + DataBlockType = other.DataBlockType; + } + if (other.HasCompressType) { + CompressType = other.CompressType; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getRangeResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getRangeResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(); + if (result.hasConsumed) { + subBuilder.MergeFrom(Consumed); + } + input.ReadMessage(subBuilder, extensionRegistry); + Consumed = subBuilder.BuildPartial(); + break; + } + case 18: { + result.hasRows = input.ReadBytes(ref result.rows_); + break; + } + case 26: { + result.hasNextStartPrimaryKey = input.ReadBytes(ref result.nextStartPrimaryKey_); + break; + } + case 34: { + result.hasNextToken = input.ReadBytes(ref result.nextToken_); + break; + } + case 40: { + object unknown; + if(input.ReadEnum(ref result.dataBlockType_, out unknown)) { + result.hasDataBlockType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(5, (ulong)(int)unknown); + } + break; + } + case 48: { + object unknown; + if(input.ReadEnum(ref result.compressType_, out unknown)) { + result.hasCompressType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(6, (ulong)(int)unknown); + } + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasConsumed { + get { return result.hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return result.Consumed; } + set { SetConsumed(value); } + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = value; + return this; + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = builderForValue.Build(); + return this; + } + public Builder MergeConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasConsumed && + result.consumed_ != global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance) { + result.consumed_ = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(result.consumed_).MergeFrom(value).BuildPartial(); + } else { + result.consumed_ = value; + } + result.hasConsumed = true; + return this; + } + public Builder ClearConsumed() { + PrepareBuilder(); + result.hasConsumed = false; + result.consumed_ = null; + return this; + } + + public bool HasRows { + get { return result.hasRows; } + } + public pb::ByteString Rows { + get { return result.Rows; } + set { SetRows(value); } + } + public Builder SetRows(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRows = true; + result.rows_ = value; + return this; + } + public Builder ClearRows() { + PrepareBuilder(); + result.hasRows = false; + result.rows_ = pb::ByteString.Empty; + return this; + } + + public bool HasNextStartPrimaryKey { + get { return result.hasNextStartPrimaryKey; } + } + public pb::ByteString NextStartPrimaryKey { + get { return result.NextStartPrimaryKey; } + set { SetNextStartPrimaryKey(value); } + } + public Builder SetNextStartPrimaryKey(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNextStartPrimaryKey = true; + result.nextStartPrimaryKey_ = value; + return this; + } + public Builder ClearNextStartPrimaryKey() { + PrepareBuilder(); + result.hasNextStartPrimaryKey = false; + result.nextStartPrimaryKey_ = pb::ByteString.Empty; + return this; + } + + public bool HasNextToken { + get { return result.hasNextToken; } + } + public pb::ByteString NextToken { + get { return result.NextToken; } + set { SetNextToken(value); } + } + public Builder SetNextToken(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNextToken = true; + result.nextToken_ = value; + return this; + } + public Builder ClearNextToken() { + PrepareBuilder(); + result.hasNextToken = false; + result.nextToken_ = pb::ByteString.Empty; + return this; + } + + public bool HasDataBlockType { + get { return result.hasDataBlockType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.DataBlockType DataBlockType { + get { return result.DataBlockType; } + set { SetDataBlockType(value); } + } + public Builder SetDataBlockType(global::com.alicloud.openservices.tablestore.core.protocol.DataBlockType value) { + PrepareBuilder(); + result.hasDataBlockType = true; + result.dataBlockType_ = value; + return this; + } + public Builder ClearDataBlockType() { + PrepareBuilder(); + result.hasDataBlockType = false; + result.dataBlockType_ = global::com.alicloud.openservices.tablestore.core.protocol.DataBlockType.DBT_PLAIN_BUFFER; + return this; + } + + public bool HasCompressType { + get { return result.hasCompressType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.CompressType CompressType { + get { return result.CompressType; } + set { SetCompressType(value); } + } + public Builder SetCompressType(global::com.alicloud.openservices.tablestore.core.protocol.CompressType value) { + PrepareBuilder(); + result.hasCompressType = true; + result.compressType_ = value; + return this; + } + public Builder ClearCompressType() { + PrepareBuilder(); + result.hasCompressType = false; + result.compressType_ = global::com.alicloud.openservices.tablestore.core.protocol.CompressType.CPT_NONE; + return this; + } + } + static GetRangeResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class StartLocalTransactionRequest : pb::GeneratedMessage { + private StartLocalTransactionRequest() { } + private static readonly StartLocalTransactionRequest defaultInstance = new StartLocalTransactionRequest().MakeReadOnly(); + private static readonly string[] _startLocalTransactionRequestFieldNames = new string[] { "key", "table_name" }; + private static readonly uint[] _startLocalTransactionRequestFieldTags = new uint[] { 18, 10 }; + public static StartLocalTransactionRequest DefaultInstance { + get { return defaultInstance; } + } + + public override StartLocalTransactionRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override StartLocalTransactionRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int KeyFieldNumber = 2; + private bool hasKey; + private pb::ByteString key_ = pb::ByteString.Empty; + public bool HasKey { + get { return hasKey; } + } + public pb::ByteString Key { + get { return key_; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + if (!hasKey) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _startLocalTransactionRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[1], TableName); + } + if (hasKey) { + output.WriteBytes(2, field_names[0], Key); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + if (hasKey) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Key); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static StartLocalTransactionRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StartLocalTransactionRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StartLocalTransactionRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StartLocalTransactionRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StartLocalTransactionRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StartLocalTransactionRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static StartLocalTransactionRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static StartLocalTransactionRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static StartLocalTransactionRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StartLocalTransactionRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private StartLocalTransactionRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(StartLocalTransactionRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(StartLocalTransactionRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private StartLocalTransactionRequest result; + + private StartLocalTransactionRequest PrepareBuilder() { + if (resultIsReadOnly) { + StartLocalTransactionRequest original = result; + result = new StartLocalTransactionRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override StartLocalTransactionRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.StartLocalTransactionRequest.Descriptor; } + } + + public override StartLocalTransactionRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.StartLocalTransactionRequest.DefaultInstance; } + } + + public override StartLocalTransactionRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is StartLocalTransactionRequest) { + return MergeFrom((StartLocalTransactionRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(StartLocalTransactionRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.StartLocalTransactionRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasKey) { + Key = other.Key; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_startLocalTransactionRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _startLocalTransactionRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + result.hasKey = input.ReadBytes(ref result.key_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasKey { + get { return result.hasKey; } + } + public pb::ByteString Key { + get { return result.Key; } + set { SetKey(value); } + } + public Builder SetKey(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasKey = true; + result.key_ = value; + return this; + } + public Builder ClearKey() { + PrepareBuilder(); + result.hasKey = false; + result.key_ = pb::ByteString.Empty; + return this; + } + } + static StartLocalTransactionRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class StartLocalTransactionResponse : pb::GeneratedMessage { + private StartLocalTransactionResponse() { } + private static readonly StartLocalTransactionResponse defaultInstance = new StartLocalTransactionResponse().MakeReadOnly(); + private static readonly string[] _startLocalTransactionResponseFieldNames = new string[] { "transaction_id" }; + private static readonly uint[] _startLocalTransactionResponseFieldTags = new uint[] { 10 }; + public static StartLocalTransactionResponse DefaultInstance { + get { return defaultInstance; } + } + + public override StartLocalTransactionResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override StartLocalTransactionResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_StartLocalTransactionResponse__FieldAccessorTable; } + } + + public const int TransactionIdFieldNumber = 1; + private bool hasTransactionId; + private string transactionId_ = ""; + public bool HasTransactionId { + get { return hasTransactionId; } + } + public string TransactionId { + get { return transactionId_; } + } + + public override bool IsInitialized { + get { + if (!hasTransactionId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _startLocalTransactionResponseFieldNames; + if (hasTransactionId) { + output.WriteString(1, field_names[0], TransactionId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTransactionId) { + size += pb::CodedOutputStream.ComputeStringSize(1, TransactionId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static StartLocalTransactionResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StartLocalTransactionResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StartLocalTransactionResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StartLocalTransactionResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StartLocalTransactionResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StartLocalTransactionResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static StartLocalTransactionResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static StartLocalTransactionResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static StartLocalTransactionResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StartLocalTransactionResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private StartLocalTransactionResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(StartLocalTransactionResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(StartLocalTransactionResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private StartLocalTransactionResponse result; + + private StartLocalTransactionResponse PrepareBuilder() { + if (resultIsReadOnly) { + StartLocalTransactionResponse original = result; + result = new StartLocalTransactionResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override StartLocalTransactionResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.StartLocalTransactionResponse.Descriptor; } + } + + public override StartLocalTransactionResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.StartLocalTransactionResponse.DefaultInstance; } + } + + public override StartLocalTransactionResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is StartLocalTransactionResponse) { + return MergeFrom((StartLocalTransactionResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(StartLocalTransactionResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.StartLocalTransactionResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTransactionId) { + TransactionId = other.TransactionId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_startLocalTransactionResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _startLocalTransactionResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTransactionId = input.ReadString(ref result.transactionId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTransactionId { + get { return result.hasTransactionId; } + } + public string TransactionId { + get { return result.TransactionId; } + set { SetTransactionId(value); } + } + public Builder SetTransactionId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTransactionId = true; + result.transactionId_ = value; + return this; + } + public Builder ClearTransactionId() { + PrepareBuilder(); + result.hasTransactionId = false; + result.transactionId_ = ""; + return this; + } + } + static StartLocalTransactionResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class CommitTransactionRequest : pb::GeneratedMessage { + private CommitTransactionRequest() { } + private static readonly CommitTransactionRequest defaultInstance = new CommitTransactionRequest().MakeReadOnly(); + private static readonly string[] _commitTransactionRequestFieldNames = new string[] { "transaction_id" }; + private static readonly uint[] _commitTransactionRequestFieldTags = new uint[] { 10 }; + public static CommitTransactionRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CommitTransactionRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CommitTransactionRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionRequest__FieldAccessorTable; } + } + + public const int TransactionIdFieldNumber = 1; + private bool hasTransactionId; + private string transactionId_ = ""; + public bool HasTransactionId { + get { return hasTransactionId; } + } + public string TransactionId { + get { return transactionId_; } + } + + public override bool IsInitialized { + get { + if (!hasTransactionId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _commitTransactionRequestFieldNames; + if (hasTransactionId) { + output.WriteString(1, field_names[0], TransactionId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTransactionId) { + size += pb::CodedOutputStream.ComputeStringSize(1, TransactionId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static CommitTransactionRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CommitTransactionRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CommitTransactionRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CommitTransactionRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CommitTransactionRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CommitTransactionRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CommitTransactionRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CommitTransactionRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CommitTransactionRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CommitTransactionRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CommitTransactionRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CommitTransactionRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CommitTransactionRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CommitTransactionRequest result; + + private CommitTransactionRequest PrepareBuilder() { + if (resultIsReadOnly) { + CommitTransactionRequest original = result; + result = new CommitTransactionRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CommitTransactionRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CommitTransactionRequest.Descriptor; } + } + + public override CommitTransactionRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CommitTransactionRequest.DefaultInstance; } + } + + public override CommitTransactionRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CommitTransactionRequest) { + return MergeFrom((CommitTransactionRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CommitTransactionRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.CommitTransactionRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTransactionId) { + TransactionId = other.TransactionId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_commitTransactionRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _commitTransactionRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTransactionId = input.ReadString(ref result.transactionId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTransactionId { + get { return result.hasTransactionId; } + } + public string TransactionId { + get { return result.TransactionId; } + set { SetTransactionId(value); } + } + public Builder SetTransactionId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTransactionId = true; + result.transactionId_ = value; + return this; + } + public Builder ClearTransactionId() { + PrepareBuilder(); + result.hasTransactionId = false; + result.transactionId_ = ""; + return this; + } + } + static CommitTransactionRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class CommitTransactionResponse : pb::GeneratedMessage { + private CommitTransactionResponse() { } + private static readonly CommitTransactionResponse defaultInstance = new CommitTransactionResponse().MakeReadOnly(); + private static readonly string[] _commitTransactionResponseFieldNames = new string[] { }; + private static readonly uint[] _commitTransactionResponseFieldTags = new uint[] { }; + public static CommitTransactionResponse DefaultInstance { + get { return defaultInstance; } + } + + public override CommitTransactionResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CommitTransactionResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_CommitTransactionResponse__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _commitTransactionResponseFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static CommitTransactionResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CommitTransactionResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CommitTransactionResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CommitTransactionResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CommitTransactionResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CommitTransactionResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CommitTransactionResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CommitTransactionResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CommitTransactionResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CommitTransactionResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CommitTransactionResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CommitTransactionResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CommitTransactionResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CommitTransactionResponse result; + + private CommitTransactionResponse PrepareBuilder() { + if (resultIsReadOnly) { + CommitTransactionResponse original = result; + result = new CommitTransactionResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CommitTransactionResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CommitTransactionResponse.Descriptor; } + } + + public override CommitTransactionResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CommitTransactionResponse.DefaultInstance; } + } + + public override CommitTransactionResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CommitTransactionResponse) { + return MergeFrom((CommitTransactionResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CommitTransactionResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.CommitTransactionResponse.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_commitTransactionResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _commitTransactionResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static CommitTransactionResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class AbortTransactionRequest : pb::GeneratedMessage { + private AbortTransactionRequest() { } + private static readonly AbortTransactionRequest defaultInstance = new AbortTransactionRequest().MakeReadOnly(); + private static readonly string[] _abortTransactionRequestFieldNames = new string[] { "transaction_id" }; + private static readonly uint[] _abortTransactionRequestFieldTags = new uint[] { 10 }; + public static AbortTransactionRequest DefaultInstance { + get { return defaultInstance; } + } + + public override AbortTransactionRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AbortTransactionRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionRequest__FieldAccessorTable; } + } + + public const int TransactionIdFieldNumber = 1; + private bool hasTransactionId; + private string transactionId_ = ""; + public bool HasTransactionId { + get { return hasTransactionId; } + } + public string TransactionId { + get { return transactionId_; } + } + + public override bool IsInitialized { + get { + if (!hasTransactionId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _abortTransactionRequestFieldNames; + if (hasTransactionId) { + output.WriteString(1, field_names[0], TransactionId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTransactionId) { + size += pb::CodedOutputStream.ComputeStringSize(1, TransactionId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static AbortTransactionRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AbortTransactionRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AbortTransactionRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AbortTransactionRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AbortTransactionRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AbortTransactionRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AbortTransactionRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AbortTransactionRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AbortTransactionRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AbortTransactionRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AbortTransactionRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AbortTransactionRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AbortTransactionRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AbortTransactionRequest result; + + private AbortTransactionRequest PrepareBuilder() { + if (resultIsReadOnly) { + AbortTransactionRequest original = result; + result = new AbortTransactionRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AbortTransactionRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.AbortTransactionRequest.Descriptor; } + } + + public override AbortTransactionRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.AbortTransactionRequest.DefaultInstance; } + } + + public override AbortTransactionRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AbortTransactionRequest) { + return MergeFrom((AbortTransactionRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AbortTransactionRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.AbortTransactionRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTransactionId) { + TransactionId = other.TransactionId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_abortTransactionRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _abortTransactionRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTransactionId = input.ReadString(ref result.transactionId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTransactionId { + get { return result.hasTransactionId; } + } + public string TransactionId { + get { return result.TransactionId; } + set { SetTransactionId(value); } + } + public Builder SetTransactionId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTransactionId = true; + result.transactionId_ = value; + return this; + } + public Builder ClearTransactionId() { + PrepareBuilder(); + result.hasTransactionId = false; + result.transactionId_ = ""; + return this; + } + } + static AbortTransactionRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class AbortTransactionResponse : pb::GeneratedMessage { + private AbortTransactionResponse() { } + private static readonly AbortTransactionResponse defaultInstance = new AbortTransactionResponse().MakeReadOnly(); + private static readonly string[] _abortTransactionResponseFieldNames = new string[] { }; + private static readonly uint[] _abortTransactionResponseFieldTags = new uint[] { }; + public static AbortTransactionResponse DefaultInstance { + get { return defaultInstance; } + } + + public override AbortTransactionResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override AbortTransactionResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_AbortTransactionResponse__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _abortTransactionResponseFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static AbortTransactionResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AbortTransactionResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AbortTransactionResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static AbortTransactionResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static AbortTransactionResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AbortTransactionResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static AbortTransactionResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static AbortTransactionResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static AbortTransactionResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static AbortTransactionResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private AbortTransactionResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(AbortTransactionResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(AbortTransactionResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private AbortTransactionResponse result; + + private AbortTransactionResponse PrepareBuilder() { + if (resultIsReadOnly) { + AbortTransactionResponse original = result; + result = new AbortTransactionResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override AbortTransactionResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.AbortTransactionResponse.Descriptor; } + } + + public override AbortTransactionResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.AbortTransactionResponse.DefaultInstance; } + } + + public override AbortTransactionResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is AbortTransactionResponse) { + return MergeFrom((AbortTransactionResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(AbortTransactionResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.AbortTransactionResponse.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_abortTransactionResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _abortTransactionResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static AbortTransactionResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ListStreamRequest : pb::GeneratedMessage { + private ListStreamRequest() { } + private static readonly ListStreamRequest defaultInstance = new ListStreamRequest().MakeReadOnly(); + private static readonly string[] _listStreamRequestFieldNames = new string[] { "table_name" }; + private static readonly uint[] _listStreamRequestFieldTags = new uint[] { 10 }; + public static ListStreamRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ListStreamRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ListStreamRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _listStreamRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[0], TableName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ListStreamRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ListStreamRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ListStreamRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ListStreamRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ListStreamRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ListStreamRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ListStreamRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ListStreamRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ListStreamRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ListStreamRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ListStreamRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ListStreamRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ListStreamRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ListStreamRequest result; + + private ListStreamRequest PrepareBuilder() { + if (resultIsReadOnly) { + ListStreamRequest original = result; + result = new ListStreamRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ListStreamRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ListStreamRequest.Descriptor; } + } + + public override ListStreamRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ListStreamRequest.DefaultInstance; } + } + + public override ListStreamRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ListStreamRequest) { + return MergeFrom((ListStreamRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ListStreamRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ListStreamRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_listStreamRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _listStreamRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + } + static ListStreamRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Stream : pb::GeneratedMessage { + private Stream() { } + private static readonly Stream defaultInstance = new Stream().MakeReadOnly(); + private static readonly string[] _streamFieldNames = new string[] { "creation_time", "stream_id", "table_name" }; + private static readonly uint[] _streamFieldTags = new uint[] { 24, 10, 18 }; + public static Stream DefaultInstance { + get { return defaultInstance; } + } + + public override Stream DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Stream ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_Stream__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_Stream__FieldAccessorTable; } + } + + public const int StreamIdFieldNumber = 1; + private bool hasStreamId; + private string streamId_ = ""; + public bool HasStreamId { + get { return hasStreamId; } + } + public string StreamId { + get { return streamId_; } + } + + public const int TableNameFieldNumber = 2; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int CreationTimeFieldNumber = 3; + private bool hasCreationTime; + private long creationTime_; + public bool HasCreationTime { + get { return hasCreationTime; } + } + public long CreationTime { + get { return creationTime_; } + } + + public override bool IsInitialized { + get { + if (!hasStreamId) return false; + if (!hasTableName) return false; + if (!hasCreationTime) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _streamFieldNames; + if (hasStreamId) { + output.WriteString(1, field_names[1], StreamId); + } + if (hasTableName) { + output.WriteString(2, field_names[2], TableName); + } + if (hasCreationTime) { + output.WriteInt64(3, field_names[0], CreationTime); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasStreamId) { + size += pb::CodedOutputStream.ComputeStringSize(1, StreamId); + } + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(2, TableName); + } + if (hasCreationTime) { + size += pb::CodedOutputStream.ComputeInt64Size(3, CreationTime); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static Stream ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Stream ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Stream ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Stream ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Stream ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Stream ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Stream ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Stream ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Stream ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Stream ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Stream MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Stream prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Stream cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Stream result; + + private Stream PrepareBuilder() { + if (resultIsReadOnly) { + Stream original = result; + result = new Stream(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Stream MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Stream.Descriptor; } + } + + public override Stream DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Stream.DefaultInstance; } + } + + public override Stream BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Stream) { + return MergeFrom((Stream) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Stream other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.Stream.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasStreamId) { + StreamId = other.StreamId; + } + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasCreationTime) { + CreationTime = other.CreationTime; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_streamFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _streamFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasStreamId = input.ReadString(ref result.streamId_); + break; + } + case 18: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 24: { + result.hasCreationTime = input.ReadInt64(ref result.creationTime_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasStreamId { + get { return result.hasStreamId; } + } + public string StreamId { + get { return result.StreamId; } + set { SetStreamId(value); } + } + public Builder SetStreamId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStreamId = true; + result.streamId_ = value; + return this; + } + public Builder ClearStreamId() { + PrepareBuilder(); + result.hasStreamId = false; + result.streamId_ = ""; + return this; + } + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasCreationTime { + get { return result.hasCreationTime; } + } + public long CreationTime { + get { return result.CreationTime; } + set { SetCreationTime(value); } + } + public Builder SetCreationTime(long value) { + PrepareBuilder(); + result.hasCreationTime = true; + result.creationTime_ = value; + return this; + } + public Builder ClearCreationTime() { + PrepareBuilder(); + result.hasCreationTime = false; + result.creationTime_ = 0L; + return this; + } + } + static Stream() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ListStreamResponse : pb::GeneratedMessage { + private ListStreamResponse() { } + private static readonly ListStreamResponse defaultInstance = new ListStreamResponse().MakeReadOnly(); + private static readonly string[] _listStreamResponseFieldNames = new string[] { "streams" }; + private static readonly uint[] _listStreamResponseFieldTags = new uint[] { 10 }; + public static ListStreamResponse DefaultInstance { + get { return defaultInstance; } + } + + public override ListStreamResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ListStreamResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ListStreamResponse__FieldAccessorTable; } + } + + public const int StreamsFieldNumber = 1; + private pbc::PopsicleList streams_ = new pbc::PopsicleList(); + public scg::IList StreamsList { + get { return streams_; } + } + public int StreamsCount { + get { return streams_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Stream GetStreams(int index) { + return streams_[index]; + } + + public override bool IsInitialized { + get { + foreach (global::com.alicloud.openservices.tablestore.core.protocol.Stream element in StreamsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _listStreamResponseFieldNames; + if (streams_.Count > 0) { + output.WriteMessageArray(1, field_names[0], streams_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.Stream element in StreamsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ListStreamResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ListStreamResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ListStreamResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ListStreamResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ListStreamResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ListStreamResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ListStreamResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ListStreamResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ListStreamResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ListStreamResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ListStreamResponse MakeReadOnly() { + streams_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ListStreamResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ListStreamResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ListStreamResponse result; + + private ListStreamResponse PrepareBuilder() { + if (resultIsReadOnly) { + ListStreamResponse original = result; + result = new ListStreamResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ListStreamResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ListStreamResponse.Descriptor; } + } + + public override ListStreamResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ListStreamResponse.DefaultInstance; } + } + + public override ListStreamResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ListStreamResponse) { + return MergeFrom((ListStreamResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ListStreamResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ListStreamResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.streams_.Count != 0) { + result.streams_.Add(other.streams_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_listStreamResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _listStreamResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.streams_, global::com.alicloud.openservices.tablestore.core.protocol.Stream.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList StreamsList { + get { return PrepareBuilder().streams_; } + } + public int StreamsCount { + get { return result.StreamsCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Stream GetStreams(int index) { + return result.GetStreams(index); + } + public Builder SetStreams(int index, global::com.alicloud.openservices.tablestore.core.protocol.Stream value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.streams_[index] = value; + return this; + } + public Builder SetStreams(int index, global::com.alicloud.openservices.tablestore.core.protocol.Stream.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.streams_[index] = builderForValue.Build(); + return this; + } + public Builder AddStreams(global::com.alicloud.openservices.tablestore.core.protocol.Stream value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.streams_.Add(value); + return this; + } + public Builder AddStreams(global::com.alicloud.openservices.tablestore.core.protocol.Stream.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.streams_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeStreams(scg::IEnumerable values) { + PrepareBuilder(); + result.streams_.Add(values); + return this; + } + public Builder ClearStreams() { + PrepareBuilder(); + result.streams_.Clear(); + return this; + } + } + static ListStreamResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class StreamShard : pb::GeneratedMessage { + private StreamShard() { } + private static readonly StreamShard defaultInstance = new StreamShard().MakeReadOnly(); + private static readonly string[] _streamShardFieldNames = new string[] { "parent_id", "parent_sibling_id", "shard_id" }; + private static readonly uint[] _streamShardFieldTags = new uint[] { 18, 26, 10 }; + public static StreamShard DefaultInstance { + get { return defaultInstance; } + } + + public override StreamShard DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override StreamShard ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamShard__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_StreamShard__FieldAccessorTable; } + } + + public const int ShardIdFieldNumber = 1; + private bool hasShardId; + private string shardId_ = ""; + public bool HasShardId { + get { return hasShardId; } + } + public string ShardId { + get { return shardId_; } + } + + public const int ParentIdFieldNumber = 2; + private bool hasParentId; + private string parentId_ = ""; + public bool HasParentId { + get { return hasParentId; } + } + public string ParentId { + get { return parentId_; } + } + + public const int ParentSiblingIdFieldNumber = 3; + private bool hasParentSiblingId; + private string parentSiblingId_ = ""; + public bool HasParentSiblingId { + get { return hasParentSiblingId; } + } + public string ParentSiblingId { + get { return parentSiblingId_; } + } + + public override bool IsInitialized { + get { + if (!hasShardId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _streamShardFieldNames; + if (hasShardId) { + output.WriteString(1, field_names[2], ShardId); + } + if (hasParentId) { + output.WriteString(2, field_names[0], ParentId); + } + if (hasParentSiblingId) { + output.WriteString(3, field_names[1], ParentSiblingId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasShardId) { + size += pb::CodedOutputStream.ComputeStringSize(1, ShardId); + } + if (hasParentId) { + size += pb::CodedOutputStream.ComputeStringSize(2, ParentId); + } + if (hasParentSiblingId) { + size += pb::CodedOutputStream.ComputeStringSize(3, ParentSiblingId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static StreamShard ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StreamShard ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StreamShard ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StreamShard ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StreamShard ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StreamShard ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static StreamShard ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static StreamShard ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static StreamShard ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StreamShard ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private StreamShard MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(StreamShard prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(StreamShard cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private StreamShard result; + + private StreamShard PrepareBuilder() { + if (resultIsReadOnly) { + StreamShard original = result; + result = new StreamShard(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override StreamShard MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.StreamShard.Descriptor; } + } + + public override StreamShard DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.StreamShard.DefaultInstance; } + } + + public override StreamShard BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is StreamShard) { + return MergeFrom((StreamShard) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(StreamShard other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.StreamShard.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasShardId) { + ShardId = other.ShardId; + } + if (other.HasParentId) { + ParentId = other.ParentId; + } + if (other.HasParentSiblingId) { + ParentSiblingId = other.ParentSiblingId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_streamShardFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _streamShardFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasShardId = input.ReadString(ref result.shardId_); + break; + } + case 18: { + result.hasParentId = input.ReadString(ref result.parentId_); + break; + } + case 26: { + result.hasParentSiblingId = input.ReadString(ref result.parentSiblingId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasShardId { + get { return result.hasShardId; } + } + public string ShardId { + get { return result.ShardId; } + set { SetShardId(value); } + } + public Builder SetShardId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasShardId = true; + result.shardId_ = value; + return this; + } + public Builder ClearShardId() { + PrepareBuilder(); + result.hasShardId = false; + result.shardId_ = ""; + return this; + } + + public bool HasParentId { + get { return result.hasParentId; } + } + public string ParentId { + get { return result.ParentId; } + set { SetParentId(value); } + } + public Builder SetParentId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasParentId = true; + result.parentId_ = value; + return this; + } + public Builder ClearParentId() { + PrepareBuilder(); + result.hasParentId = false; + result.parentId_ = ""; + return this; + } + + public bool HasParentSiblingId { + get { return result.hasParentSiblingId; } + } + public string ParentSiblingId { + get { return result.ParentSiblingId; } + set { SetParentSiblingId(value); } + } + public Builder SetParentSiblingId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasParentSiblingId = true; + result.parentSiblingId_ = value; + return this; + } + public Builder ClearParentSiblingId() { + PrepareBuilder(); + result.hasParentSiblingId = false; + result.parentSiblingId_ = ""; + return this; + } + } + static StreamShard() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DescribeStreamRequest : pb::GeneratedMessage { + private DescribeStreamRequest() { } + private static readonly DescribeStreamRequest defaultInstance = new DescribeStreamRequest().MakeReadOnly(); + private static readonly string[] _describeStreamRequestFieldNames = new string[] { "inclusive_start_shard_id", "shard_limit", "stream_id" }; + private static readonly uint[] _describeStreamRequestFieldTags = new uint[] { 18, 24, 10 }; + public static DescribeStreamRequest DefaultInstance { + get { return defaultInstance; } + } + + public override DescribeStreamRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DescribeStreamRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamRequest__FieldAccessorTable; } + } + + public const int StreamIdFieldNumber = 1; + private bool hasStreamId; + private string streamId_ = ""; + public bool HasStreamId { + get { return hasStreamId; } + } + public string StreamId { + get { return streamId_; } + } + + public const int InclusiveStartShardIdFieldNumber = 2; + private bool hasInclusiveStartShardId; + private string inclusiveStartShardId_ = ""; + public bool HasInclusiveStartShardId { + get { return hasInclusiveStartShardId; } + } + public string InclusiveStartShardId { + get { return inclusiveStartShardId_; } + } + + public const int ShardLimitFieldNumber = 3; + private bool hasShardLimit; + private int shardLimit_; + public bool HasShardLimit { + get { return hasShardLimit; } + } + public int ShardLimit { + get { return shardLimit_; } + } + + public override bool IsInitialized { + get { + if (!hasStreamId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _describeStreamRequestFieldNames; + if (hasStreamId) { + output.WriteString(1, field_names[2], StreamId); + } + if (hasInclusiveStartShardId) { + output.WriteString(2, field_names[0], InclusiveStartShardId); + } + if (hasShardLimit) { + output.WriteInt32(3, field_names[1], ShardLimit); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasStreamId) { + size += pb::CodedOutputStream.ComputeStringSize(1, StreamId); + } + if (hasInclusiveStartShardId) { + size += pb::CodedOutputStream.ComputeStringSize(2, InclusiveStartShardId); + } + if (hasShardLimit) { + size += pb::CodedOutputStream.ComputeInt32Size(3, ShardLimit); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DescribeStreamRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescribeStreamRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescribeStreamRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescribeStreamRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescribeStreamRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescribeStreamRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DescribeStreamRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DescribeStreamRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DescribeStreamRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescribeStreamRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DescribeStreamRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DescribeStreamRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DescribeStreamRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DescribeStreamRequest result; + + private DescribeStreamRequest PrepareBuilder() { + if (resultIsReadOnly) { + DescribeStreamRequest original = result; + result = new DescribeStreamRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DescribeStreamRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DescribeStreamRequest.Descriptor; } + } + + public override DescribeStreamRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DescribeStreamRequest.DefaultInstance; } + } + + public override DescribeStreamRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DescribeStreamRequest) { + return MergeFrom((DescribeStreamRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DescribeStreamRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DescribeStreamRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasStreamId) { + StreamId = other.StreamId; + } + if (other.HasInclusiveStartShardId) { + InclusiveStartShardId = other.InclusiveStartShardId; + } + if (other.HasShardLimit) { + ShardLimit = other.ShardLimit; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_describeStreamRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _describeStreamRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasStreamId = input.ReadString(ref result.streamId_); + break; + } + case 18: { + result.hasInclusiveStartShardId = input.ReadString(ref result.inclusiveStartShardId_); + break; + } + case 24: { + result.hasShardLimit = input.ReadInt32(ref result.shardLimit_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasStreamId { + get { return result.hasStreamId; } + } + public string StreamId { + get { return result.StreamId; } + set { SetStreamId(value); } + } + public Builder SetStreamId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStreamId = true; + result.streamId_ = value; + return this; + } + public Builder ClearStreamId() { + PrepareBuilder(); + result.hasStreamId = false; + result.streamId_ = ""; + return this; + } + + public bool HasInclusiveStartShardId { + get { return result.hasInclusiveStartShardId; } + } + public string InclusiveStartShardId { + get { return result.InclusiveStartShardId; } + set { SetInclusiveStartShardId(value); } + } + public Builder SetInclusiveStartShardId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasInclusiveStartShardId = true; + result.inclusiveStartShardId_ = value; + return this; + } + public Builder ClearInclusiveStartShardId() { + PrepareBuilder(); + result.hasInclusiveStartShardId = false; + result.inclusiveStartShardId_ = ""; + return this; + } + + public bool HasShardLimit { + get { return result.hasShardLimit; } + } + public int ShardLimit { + get { return result.ShardLimit; } + set { SetShardLimit(value); } + } + public Builder SetShardLimit(int value) { + PrepareBuilder(); + result.hasShardLimit = true; + result.shardLimit_ = value; + return this; + } + public Builder ClearShardLimit() { + PrepareBuilder(); + result.hasShardLimit = false; + result.shardLimit_ = 0; + return this; + } + } + static DescribeStreamRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DescribeStreamResponse : pb::GeneratedMessage { + private DescribeStreamResponse() { } + private static readonly DescribeStreamResponse defaultInstance = new DescribeStreamResponse().MakeReadOnly(); + private static readonly string[] _describeStreamResponseFieldNames = new string[] { "creation_time", "expiration_time", "next_shard_id", "shards", "stream_id", "stream_status", "table_name" }; + private static readonly uint[] _describeStreamResponseFieldTags = new uint[] { 32, 16, 58, 50, 10, 40, 26 }; + public static DescribeStreamResponse DefaultInstance { + get { return defaultInstance; } + } + + public override DescribeStreamResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DescribeStreamResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeStreamResponse__FieldAccessorTable; } + } + + public const int StreamIdFieldNumber = 1; + private bool hasStreamId; + private string streamId_ = ""; + public bool HasStreamId { + get { return hasStreamId; } + } + public string StreamId { + get { return streamId_; } + } + + public const int ExpirationTimeFieldNumber = 2; + private bool hasExpirationTime; + private int expirationTime_; + public bool HasExpirationTime { + get { return hasExpirationTime; } + } + public int ExpirationTime { + get { return expirationTime_; } + } + + public const int TableNameFieldNumber = 3; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int CreationTimeFieldNumber = 4; + private bool hasCreationTime; + private long creationTime_; + public bool HasCreationTime { + get { return hasCreationTime; } + } + public long CreationTime { + get { return creationTime_; } + } + + public const int StreamStatusFieldNumber = 5; + private bool hasStreamStatus; + private global::com.alicloud.openservices.tablestore.core.protocol.StreamStatus streamStatus_ = global::com.alicloud.openservices.tablestore.core.protocol.StreamStatus.STREAM_ENABLING; + public bool HasStreamStatus { + get { return hasStreamStatus; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.StreamStatus StreamStatus { + get { return streamStatus_; } + } + + public const int ShardsFieldNumber = 6; + private pbc::PopsicleList shards_ = new pbc::PopsicleList(); + public scg::IList ShardsList { + get { return shards_; } + } + public int ShardsCount { + get { return shards_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.StreamShard GetShards(int index) { + return shards_[index]; + } + + public const int NextShardIdFieldNumber = 7; + private bool hasNextShardId; + private string nextShardId_ = ""; + public bool HasNextShardId { + get { return hasNextShardId; } + } + public string NextShardId { + get { return nextShardId_; } + } + + public override bool IsInitialized { + get { + if (!hasStreamId) return false; + if (!hasExpirationTime) return false; + if (!hasTableName) return false; + if (!hasCreationTime) return false; + if (!hasStreamStatus) return false; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.StreamShard element in ShardsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _describeStreamResponseFieldNames; + if (hasStreamId) { + output.WriteString(1, field_names[4], StreamId); + } + if (hasExpirationTime) { + output.WriteInt32(2, field_names[1], ExpirationTime); + } + if (hasTableName) { + output.WriteString(3, field_names[6], TableName); + } + if (hasCreationTime) { + output.WriteInt64(4, field_names[0], CreationTime); + } + if (hasStreamStatus) { + output.WriteEnum(5, field_names[5], (int) StreamStatus, StreamStatus); + } + if (shards_.Count > 0) { + output.WriteMessageArray(6, field_names[3], shards_); + } + if (hasNextShardId) { + output.WriteString(7, field_names[2], NextShardId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasStreamId) { + size += pb::CodedOutputStream.ComputeStringSize(1, StreamId); + } + if (hasExpirationTime) { + size += pb::CodedOutputStream.ComputeInt32Size(2, ExpirationTime); + } + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(3, TableName); + } + if (hasCreationTime) { + size += pb::CodedOutputStream.ComputeInt64Size(4, CreationTime); + } + if (hasStreamStatus) { + size += pb::CodedOutputStream.ComputeEnumSize(5, (int) StreamStatus); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.StreamShard element in ShardsList) { + size += pb::CodedOutputStream.ComputeMessageSize(6, element); + } + if (hasNextShardId) { + size += pb::CodedOutputStream.ComputeStringSize(7, NextShardId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DescribeStreamResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescribeStreamResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescribeStreamResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescribeStreamResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescribeStreamResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescribeStreamResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DescribeStreamResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DescribeStreamResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DescribeStreamResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescribeStreamResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DescribeStreamResponse MakeReadOnly() { + shards_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DescribeStreamResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DescribeStreamResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DescribeStreamResponse result; + + private DescribeStreamResponse PrepareBuilder() { + if (resultIsReadOnly) { + DescribeStreamResponse original = result; + result = new DescribeStreamResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DescribeStreamResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DescribeStreamResponse.Descriptor; } + } + + public override DescribeStreamResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DescribeStreamResponse.DefaultInstance; } + } + + public override DescribeStreamResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DescribeStreamResponse) { + return MergeFrom((DescribeStreamResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DescribeStreamResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DescribeStreamResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasStreamId) { + StreamId = other.StreamId; + } + if (other.HasExpirationTime) { + ExpirationTime = other.ExpirationTime; + } + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasCreationTime) { + CreationTime = other.CreationTime; + } + if (other.HasStreamStatus) { + StreamStatus = other.StreamStatus; + } + if (other.shards_.Count != 0) { + result.shards_.Add(other.shards_); + } + if (other.HasNextShardId) { + NextShardId = other.NextShardId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_describeStreamResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _describeStreamResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasStreamId = input.ReadString(ref result.streamId_); + break; + } + case 16: { + result.hasExpirationTime = input.ReadInt32(ref result.expirationTime_); + break; + } + case 26: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 32: { + result.hasCreationTime = input.ReadInt64(ref result.creationTime_); + break; + } + case 40: { + object unknown; + if(input.ReadEnum(ref result.streamStatus_, out unknown)) { + result.hasStreamStatus = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(5, (ulong)(int)unknown); + } + break; + } + case 50: { + input.ReadMessageArray(tag, field_name, result.shards_, global::com.alicloud.openservices.tablestore.core.protocol.StreamShard.DefaultInstance, extensionRegistry); + break; + } + case 58: { + result.hasNextShardId = input.ReadString(ref result.nextShardId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasStreamId { + get { return result.hasStreamId; } + } + public string StreamId { + get { return result.StreamId; } + set { SetStreamId(value); } + } + public Builder SetStreamId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStreamId = true; + result.streamId_ = value; + return this; + } + public Builder ClearStreamId() { + PrepareBuilder(); + result.hasStreamId = false; + result.streamId_ = ""; + return this; + } + + public bool HasExpirationTime { + get { return result.hasExpirationTime; } + } + public int ExpirationTime { + get { return result.ExpirationTime; } + set { SetExpirationTime(value); } + } + public Builder SetExpirationTime(int value) { + PrepareBuilder(); + result.hasExpirationTime = true; + result.expirationTime_ = value; + return this; + } + public Builder ClearExpirationTime() { + PrepareBuilder(); + result.hasExpirationTime = false; + result.expirationTime_ = 0; + return this; + } + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasCreationTime { + get { return result.hasCreationTime; } + } + public long CreationTime { + get { return result.CreationTime; } + set { SetCreationTime(value); } + } + public Builder SetCreationTime(long value) { + PrepareBuilder(); + result.hasCreationTime = true; + result.creationTime_ = value; + return this; + } + public Builder ClearCreationTime() { + PrepareBuilder(); + result.hasCreationTime = false; + result.creationTime_ = 0L; + return this; + } + + public bool HasStreamStatus { + get { return result.hasStreamStatus; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.StreamStatus StreamStatus { + get { return result.StreamStatus; } + set { SetStreamStatus(value); } + } + public Builder SetStreamStatus(global::com.alicloud.openservices.tablestore.core.protocol.StreamStatus value) { + PrepareBuilder(); + result.hasStreamStatus = true; + result.streamStatus_ = value; + return this; + } + public Builder ClearStreamStatus() { + PrepareBuilder(); + result.hasStreamStatus = false; + result.streamStatus_ = global::com.alicloud.openservices.tablestore.core.protocol.StreamStatus.STREAM_ENABLING; + return this; + } + + public pbc::IPopsicleList ShardsList { + get { return PrepareBuilder().shards_; } + } + public int ShardsCount { + get { return result.ShardsCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.StreamShard GetShards(int index) { + return result.GetShards(index); + } + public Builder SetShards(int index, global::com.alicloud.openservices.tablestore.core.protocol.StreamShard value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.shards_[index] = value; + return this; + } + public Builder SetShards(int index, global::com.alicloud.openservices.tablestore.core.protocol.StreamShard.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.shards_[index] = builderForValue.Build(); + return this; + } + public Builder AddShards(global::com.alicloud.openservices.tablestore.core.protocol.StreamShard value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.shards_.Add(value); + return this; + } + public Builder AddShards(global::com.alicloud.openservices.tablestore.core.protocol.StreamShard.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.shards_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeShards(scg::IEnumerable values) { + PrepareBuilder(); + result.shards_.Add(values); + return this; + } + public Builder ClearShards() { + PrepareBuilder(); + result.shards_.Clear(); + return this; + } + + public bool HasNextShardId { + get { return result.hasNextShardId; } + } + public string NextShardId { + get { return result.NextShardId; } + set { SetNextShardId(value); } + } + public Builder SetNextShardId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNextShardId = true; + result.nextShardId_ = value; + return this; + } + public Builder ClearNextShardId() { + PrepareBuilder(); + result.hasNextShardId = false; + result.nextShardId_ = ""; + return this; + } + } + static DescribeStreamResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class GetShardIteratorRequest : pb::GeneratedMessage { + private GetShardIteratorRequest() { } + private static readonly GetShardIteratorRequest defaultInstance = new GetShardIteratorRequest().MakeReadOnly(); + private static readonly string[] _getShardIteratorRequestFieldNames = new string[] { "shard_id", "stream_id" }; + private static readonly uint[] _getShardIteratorRequestFieldTags = new uint[] { 18, 10 }; + public static GetShardIteratorRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetShardIteratorRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetShardIteratorRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorRequest__FieldAccessorTable; } + } + + public const int StreamIdFieldNumber = 1; + private bool hasStreamId; + private string streamId_ = ""; + public bool HasStreamId { + get { return hasStreamId; } + } + public string StreamId { + get { return streamId_; } + } + + public const int ShardIdFieldNumber = 2; + private bool hasShardId; + private string shardId_ = ""; + public bool HasShardId { + get { return hasShardId; } + } + public string ShardId { + get { return shardId_; } + } + + public override bool IsInitialized { + get { + if (!hasStreamId) return false; + if (!hasShardId) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _getShardIteratorRequestFieldNames; + if (hasStreamId) { + output.WriteString(1, field_names[1], StreamId); + } + if (hasShardId) { + output.WriteString(2, field_names[0], ShardId); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasStreamId) { + size += pb::CodedOutputStream.ComputeStringSize(1, StreamId); + } + if (hasShardId) { + size += pb::CodedOutputStream.ComputeStringSize(2, ShardId); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static GetShardIteratorRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetShardIteratorRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetShardIteratorRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetShardIteratorRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetShardIteratorRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetShardIteratorRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetShardIteratorRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetShardIteratorRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetShardIteratorRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetShardIteratorRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetShardIteratorRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetShardIteratorRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetShardIteratorRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetShardIteratorRequest result; + + private GetShardIteratorRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetShardIteratorRequest original = result; + result = new GetShardIteratorRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetShardIteratorRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetShardIteratorRequest.Descriptor; } + } + + public override GetShardIteratorRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetShardIteratorRequest.DefaultInstance; } + } + + public override GetShardIteratorRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetShardIteratorRequest) { + return MergeFrom((GetShardIteratorRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetShardIteratorRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.GetShardIteratorRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasStreamId) { + StreamId = other.StreamId; + } + if (other.HasShardId) { + ShardId = other.ShardId; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getShardIteratorRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getShardIteratorRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasStreamId = input.ReadString(ref result.streamId_); + break; + } + case 18: { + result.hasShardId = input.ReadString(ref result.shardId_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasStreamId { + get { return result.hasStreamId; } + } + public string StreamId { + get { return result.StreamId; } + set { SetStreamId(value); } + } + public Builder SetStreamId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasStreamId = true; + result.streamId_ = value; + return this; + } + public Builder ClearStreamId() { + PrepareBuilder(); + result.hasStreamId = false; + result.streamId_ = ""; + return this; + } + + public bool HasShardId { + get { return result.hasShardId; } + } + public string ShardId { + get { return result.ShardId; } + set { SetShardId(value); } + } + public Builder SetShardId(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasShardId = true; + result.shardId_ = value; + return this; + } + public Builder ClearShardId() { + PrepareBuilder(); + result.hasShardId = false; + result.shardId_ = ""; + return this; + } + } + static GetShardIteratorRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class GetShardIteratorResponse : pb::GeneratedMessage { + private GetShardIteratorResponse() { } + private static readonly GetShardIteratorResponse defaultInstance = new GetShardIteratorResponse().MakeReadOnly(); + private static readonly string[] _getShardIteratorResponseFieldNames = new string[] { "shard_iterator" }; + private static readonly uint[] _getShardIteratorResponseFieldTags = new uint[] { 10 }; + public static GetShardIteratorResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetShardIteratorResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetShardIteratorResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetShardIteratorResponse__FieldAccessorTable; } + } + + public const int ShardIteratorFieldNumber = 1; + private bool hasShardIterator; + private string shardIterator_ = ""; + public bool HasShardIterator { + get { return hasShardIterator; } + } + public string ShardIterator { + get { return shardIterator_; } + } + + public override bool IsInitialized { + get { + if (!hasShardIterator) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _getShardIteratorResponseFieldNames; + if (hasShardIterator) { + output.WriteString(1, field_names[0], ShardIterator); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasShardIterator) { + size += pb::CodedOutputStream.ComputeStringSize(1, ShardIterator); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static GetShardIteratorResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetShardIteratorResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetShardIteratorResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetShardIteratorResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetShardIteratorResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetShardIteratorResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetShardIteratorResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetShardIteratorResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetShardIteratorResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetShardIteratorResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetShardIteratorResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetShardIteratorResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetShardIteratorResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetShardIteratorResponse result; + + private GetShardIteratorResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetShardIteratorResponse original = result; + result = new GetShardIteratorResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetShardIteratorResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetShardIteratorResponse.Descriptor; } + } + + public override GetShardIteratorResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetShardIteratorResponse.DefaultInstance; } + } + + public override GetShardIteratorResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetShardIteratorResponse) { + return MergeFrom((GetShardIteratorResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetShardIteratorResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.GetShardIteratorResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasShardIterator) { + ShardIterator = other.ShardIterator; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getShardIteratorResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getShardIteratorResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasShardIterator = input.ReadString(ref result.shardIterator_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasShardIterator { + get { return result.hasShardIterator; } + } + public string ShardIterator { + get { return result.ShardIterator; } + set { SetShardIterator(value); } + } + public Builder SetShardIterator(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasShardIterator = true; + result.shardIterator_ = value; + return this; + } + public Builder ClearShardIterator() { + PrepareBuilder(); + result.hasShardIterator = false; + result.shardIterator_ = ""; + return this; + } + } + static GetShardIteratorResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class GetStreamRecordRequest : pb::GeneratedMessage { + private GetStreamRecordRequest() { } + private static readonly GetStreamRecordRequest defaultInstance = new GetStreamRecordRequest().MakeReadOnly(); + private static readonly string[] _getStreamRecordRequestFieldNames = new string[] { "limit", "shard_iterator" }; + private static readonly uint[] _getStreamRecordRequestFieldTags = new uint[] { 16, 10 }; + public static GetStreamRecordRequest DefaultInstance { + get { return defaultInstance; } + } + + public override GetStreamRecordRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetStreamRecordRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordRequest__FieldAccessorTable; } + } + + public const int ShardIteratorFieldNumber = 1; + private bool hasShardIterator; + private string shardIterator_ = ""; + public bool HasShardIterator { + get { return hasShardIterator; } + } + public string ShardIterator { + get { return shardIterator_; } + } + + public const int LimitFieldNumber = 2; + private bool hasLimit; + private int limit_; + public bool HasLimit { + get { return hasLimit; } + } + public int Limit { + get { return limit_; } + } + + public override bool IsInitialized { + get { + if (!hasShardIterator) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _getStreamRecordRequestFieldNames; + if (hasShardIterator) { + output.WriteString(1, field_names[1], ShardIterator); + } + if (hasLimit) { + output.WriteInt32(2, field_names[0], Limit); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasShardIterator) { + size += pb::CodedOutputStream.ComputeStringSize(1, ShardIterator); + } + if (hasLimit) { + size += pb::CodedOutputStream.ComputeInt32Size(2, Limit); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static GetStreamRecordRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetStreamRecordRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetStreamRecordRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetStreamRecordRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetStreamRecordRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetStreamRecordRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetStreamRecordRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetStreamRecordRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetStreamRecordRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetStreamRecordRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetStreamRecordRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetStreamRecordRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetStreamRecordRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetStreamRecordRequest result; + + private GetStreamRecordRequest PrepareBuilder() { + if (resultIsReadOnly) { + GetStreamRecordRequest original = result; + result = new GetStreamRecordRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetStreamRecordRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordRequest.Descriptor; } + } + + public override GetStreamRecordRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordRequest.DefaultInstance; } + } + + public override GetStreamRecordRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetStreamRecordRequest) { + return MergeFrom((GetStreamRecordRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetStreamRecordRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasShardIterator) { + ShardIterator = other.ShardIterator; + } + if (other.HasLimit) { + Limit = other.Limit; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getStreamRecordRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getStreamRecordRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasShardIterator = input.ReadString(ref result.shardIterator_); + break; + } + case 16: { + result.hasLimit = input.ReadInt32(ref result.limit_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasShardIterator { + get { return result.hasShardIterator; } + } + public string ShardIterator { + get { return result.ShardIterator; } + set { SetShardIterator(value); } + } + public Builder SetShardIterator(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasShardIterator = true; + result.shardIterator_ = value; + return this; + } + public Builder ClearShardIterator() { + PrepareBuilder(); + result.hasShardIterator = false; + result.shardIterator_ = ""; + return this; + } + + public bool HasLimit { + get { return result.hasLimit; } + } + public int Limit { + get { return result.Limit; } + set { SetLimit(value); } + } + public Builder SetLimit(int value) { + PrepareBuilder(); + result.hasLimit = true; + result.limit_ = value; + return this; + } + public Builder ClearLimit() { + PrepareBuilder(); + result.hasLimit = false; + result.limit_ = 0; + return this; + } + } + static GetStreamRecordRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class GetStreamRecordResponse : pb::GeneratedMessage { + private GetStreamRecordResponse() { } + private static readonly GetStreamRecordResponse defaultInstance = new GetStreamRecordResponse().MakeReadOnly(); + private static readonly string[] _getStreamRecordResponseFieldNames = new string[] { "next_shard_iterator", "stream_records" }; + private static readonly uint[] _getStreamRecordResponseFieldTags = new uint[] { 18, 10 }; + public static GetStreamRecordResponse DefaultInstance { + get { return defaultInstance; } + } + + public override GetStreamRecordResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GetStreamRecordResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class StreamRecord : pb::GeneratedMessage { + private StreamRecord() { } + private static readonly StreamRecord defaultInstance = new StreamRecord().MakeReadOnly(); + private static readonly string[] _streamRecordFieldNames = new string[] { "action_type", "record" }; + private static readonly uint[] _streamRecordFieldTags = new uint[] { 8, 18 }; + public static StreamRecord DefaultInstance { + get { return defaultInstance; } + } + + public override StreamRecord DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override StreamRecord ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse_StreamRecord__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_GetStreamRecordResponse_StreamRecord__FieldAccessorTable; } + } + + public const int ActionTypeFieldNumber = 1; + private bool hasActionType; + private global::com.alicloud.openservices.tablestore.core.protocol.ActionType actionType_ = global::com.alicloud.openservices.tablestore.core.protocol.ActionType.PUT_ROW; + public bool HasActionType { + get { return hasActionType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ActionType ActionType { + get { return actionType_; } + } + + public const int RecordFieldNumber = 2; + private bool hasRecord; + private pb::ByteString record_ = pb::ByteString.Empty; + public bool HasRecord { + get { return hasRecord; } + } + public pb::ByteString Record { + get { return record_; } + } + + public override bool IsInitialized { + get { + if (!hasActionType) return false; + if (!hasRecord) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _streamRecordFieldNames; + if (hasActionType) { + output.WriteEnum(1, field_names[0], (int) ActionType, ActionType); + } + if (hasRecord) { + output.WriteBytes(2, field_names[1], Record); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasActionType) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) ActionType); + } + if (hasRecord) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Record); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static StreamRecord ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StreamRecord ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StreamRecord ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static StreamRecord ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static StreamRecord ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StreamRecord ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static StreamRecord ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static StreamRecord ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static StreamRecord ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static StreamRecord ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private StreamRecord MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(StreamRecord prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(StreamRecord cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private StreamRecord result; + + private StreamRecord PrepareBuilder() { + if (resultIsReadOnly) { + StreamRecord original = result; + result = new StreamRecord(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override StreamRecord MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.Types.StreamRecord.Descriptor; } + } + + public override StreamRecord DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.Types.StreamRecord.DefaultInstance; } + } + + public override StreamRecord BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is StreamRecord) { + return MergeFrom((StreamRecord) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(StreamRecord other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.Types.StreamRecord.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasActionType) { + ActionType = other.ActionType; + } + if (other.HasRecord) { + Record = other.Record; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_streamRecordFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _streamRecordFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.actionType_, out unknown)) { + result.hasActionType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + case 18: { + result.hasRecord = input.ReadBytes(ref result.record_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasActionType { + get { return result.hasActionType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ActionType ActionType { + get { return result.ActionType; } + set { SetActionType(value); } + } + public Builder SetActionType(global::com.alicloud.openservices.tablestore.core.protocol.ActionType value) { + PrepareBuilder(); + result.hasActionType = true; + result.actionType_ = value; + return this; + } + public Builder ClearActionType() { + PrepareBuilder(); + result.hasActionType = false; + result.actionType_ = global::com.alicloud.openservices.tablestore.core.protocol.ActionType.PUT_ROW; + return this; + } + + public bool HasRecord { + get { return result.hasRecord; } + } + public pb::ByteString Record { + get { return result.Record; } + set { SetRecord(value); } + } + public Builder SetRecord(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRecord = true; + result.record_ = value; + return this; + } + public Builder ClearRecord() { + PrepareBuilder(); + result.hasRecord = false; + result.record_ = pb::ByteString.Empty; + return this; + } + } + static StreamRecord() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + } + #endregion + + public const int StreamRecordsFieldNumber = 1; + private pbc::PopsicleList streamRecords_ = new pbc::PopsicleList(); + public scg::IList StreamRecordsList { + get { return streamRecords_; } + } + public int StreamRecordsCount { + get { return streamRecords_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.Types.StreamRecord GetStreamRecords(int index) { + return streamRecords_[index]; + } + + public const int NextShardIteratorFieldNumber = 2; + private bool hasNextShardIterator; + private string nextShardIterator_ = ""; + public bool HasNextShardIterator { + get { return hasNextShardIterator; } + } + public string NextShardIterator { + get { return nextShardIterator_; } + } + + public override bool IsInitialized { + get { + foreach (global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.Types.StreamRecord element in StreamRecordsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _getStreamRecordResponseFieldNames; + if (streamRecords_.Count > 0) { + output.WriteMessageArray(1, field_names[1], streamRecords_); + } + if (hasNextShardIterator) { + output.WriteString(2, field_names[0], NextShardIterator); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.Types.StreamRecord element in StreamRecordsList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasNextShardIterator) { + size += pb::CodedOutputStream.ComputeStringSize(2, NextShardIterator); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static GetStreamRecordResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetStreamRecordResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetStreamRecordResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GetStreamRecordResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GetStreamRecordResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetStreamRecordResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GetStreamRecordResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GetStreamRecordResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GetStreamRecordResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GetStreamRecordResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GetStreamRecordResponse MakeReadOnly() { + streamRecords_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GetStreamRecordResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GetStreamRecordResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GetStreamRecordResponse result; + + private GetStreamRecordResponse PrepareBuilder() { + if (resultIsReadOnly) { + GetStreamRecordResponse original = result; + result = new GetStreamRecordResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GetStreamRecordResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.Descriptor; } + } + + public override GetStreamRecordResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.DefaultInstance; } + } + + public override GetStreamRecordResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GetStreamRecordResponse) { + return MergeFrom((GetStreamRecordResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GetStreamRecordResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.streamRecords_.Count != 0) { + result.streamRecords_.Add(other.streamRecords_); + } + if (other.HasNextShardIterator) { + NextShardIterator = other.NextShardIterator; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_getStreamRecordResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _getStreamRecordResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.streamRecords_, global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.Types.StreamRecord.DefaultInstance, extensionRegistry); + break; + } + case 18: { + result.hasNextShardIterator = input.ReadString(ref result.nextShardIterator_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList StreamRecordsList { + get { return PrepareBuilder().streamRecords_; } + } + public int StreamRecordsCount { + get { return result.StreamRecordsCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.Types.StreamRecord GetStreamRecords(int index) { + return result.GetStreamRecords(index); + } + public Builder SetStreamRecords(int index, global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.Types.StreamRecord value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.streamRecords_[index] = value; + return this; + } + public Builder SetStreamRecords(int index, global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.Types.StreamRecord.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.streamRecords_[index] = builderForValue.Build(); + return this; + } + public Builder AddStreamRecords(global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.Types.StreamRecord value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.streamRecords_.Add(value); + return this; + } + public Builder AddStreamRecords(global::com.alicloud.openservices.tablestore.core.protocol.GetStreamRecordResponse.Types.StreamRecord.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.streamRecords_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeStreamRecords(scg::IEnumerable values) { + PrepareBuilder(); + result.streamRecords_.Add(values); + return this; + } + public Builder ClearStreamRecords() { + PrepareBuilder(); + result.streamRecords_.Clear(); + return this; + } + + public bool HasNextShardIterator { + get { return result.hasNextShardIterator; } + } + public string NextShardIterator { + get { return result.NextShardIterator; } + set { SetNextShardIterator(value); } + } + public Builder SetNextShardIterator(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNextShardIterator = true; + result.nextShardIterator_ = value; + return this; + } + public Builder ClearNextShardIterator() { + PrepareBuilder(); + result.hasNextShardIterator = false; + result.nextShardIterator_ = ""; + return this; + } + } + static GetStreamRecordResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ComputeSplitPointsBySizeRequest : pb::GeneratedMessage { + private ComputeSplitPointsBySizeRequest() { } + private static readonly ComputeSplitPointsBySizeRequest defaultInstance = new ComputeSplitPointsBySizeRequest().MakeReadOnly(); + private static readonly string[] _computeSplitPointsBySizeRequestFieldNames = new string[] { "split_size", "split_size_unit_in_byte", "table_name" }; + private static readonly uint[] _computeSplitPointsBySizeRequestFieldTags = new uint[] { 16, 24, 10 }; + public static ComputeSplitPointsBySizeRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ComputeSplitPointsBySizeRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ComputeSplitPointsBySizeRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int SplitSizeFieldNumber = 2; + private bool hasSplitSize; + private long splitSize_; + public bool HasSplitSize { + get { return hasSplitSize; } + } + public long SplitSize { + get { return splitSize_; } + } + + public const int SplitSizeUnitInByteFieldNumber = 3; + private bool hasSplitSizeUnitInByte; + private long splitSizeUnitInByte_; + public bool HasSplitSizeUnitInByte { + get { return hasSplitSizeUnitInByte; } + } + public long SplitSizeUnitInByte { + get { return splitSizeUnitInByte_; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + if (!hasSplitSize) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _computeSplitPointsBySizeRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[2], TableName); + } + if (hasSplitSize) { + output.WriteInt64(2, field_names[0], SplitSize); + } + if (hasSplitSizeUnitInByte) { + output.WriteInt64(3, field_names[1], SplitSizeUnitInByte); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + if (hasSplitSize) { + size += pb::CodedOutputStream.ComputeInt64Size(2, SplitSize); + } + if (hasSplitSizeUnitInByte) { + size += pb::CodedOutputStream.ComputeInt64Size(3, SplitSizeUnitInByte); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ComputeSplitPointsBySizeRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ComputeSplitPointsBySizeRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ComputeSplitPointsBySizeRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ComputeSplitPointsBySizeRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ComputeSplitPointsBySizeRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ComputeSplitPointsBySizeRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ComputeSplitPointsBySizeRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ComputeSplitPointsBySizeRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ComputeSplitPointsBySizeRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ComputeSplitPointsBySizeRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ComputeSplitPointsBySizeRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ComputeSplitPointsBySizeRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ComputeSplitPointsBySizeRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ComputeSplitPointsBySizeRequest result; + + private ComputeSplitPointsBySizeRequest PrepareBuilder() { + if (resultIsReadOnly) { + ComputeSplitPointsBySizeRequest original = result; + result = new ComputeSplitPointsBySizeRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ComputeSplitPointsBySizeRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeRequest.Descriptor; } + } + + public override ComputeSplitPointsBySizeRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeRequest.DefaultInstance; } + } + + public override ComputeSplitPointsBySizeRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ComputeSplitPointsBySizeRequest) { + return MergeFrom((ComputeSplitPointsBySizeRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ComputeSplitPointsBySizeRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasSplitSize) { + SplitSize = other.SplitSize; + } + if (other.HasSplitSizeUnitInByte) { + SplitSizeUnitInByte = other.SplitSizeUnitInByte; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_computeSplitPointsBySizeRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _computeSplitPointsBySizeRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 16: { + result.hasSplitSize = input.ReadInt64(ref result.splitSize_); + break; + } + case 24: { + result.hasSplitSizeUnitInByte = input.ReadInt64(ref result.splitSizeUnitInByte_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasSplitSize { + get { return result.hasSplitSize; } + } + public long SplitSize { + get { return result.SplitSize; } + set { SetSplitSize(value); } + } + public Builder SetSplitSize(long value) { + PrepareBuilder(); + result.hasSplitSize = true; + result.splitSize_ = value; + return this; + } + public Builder ClearSplitSize() { + PrepareBuilder(); + result.hasSplitSize = false; + result.splitSize_ = 0L; + return this; + } + + public bool HasSplitSizeUnitInByte { + get { return result.hasSplitSizeUnitInByte; } + } + public long SplitSizeUnitInByte { + get { return result.SplitSizeUnitInByte; } + set { SetSplitSizeUnitInByte(value); } + } + public Builder SetSplitSizeUnitInByte(long value) { + PrepareBuilder(); + result.hasSplitSizeUnitInByte = true; + result.splitSizeUnitInByte_ = value; + return this; + } + public Builder ClearSplitSizeUnitInByte() { + PrepareBuilder(); + result.hasSplitSizeUnitInByte = false; + result.splitSizeUnitInByte_ = 0L; + return this; + } + } + static ComputeSplitPointsBySizeRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ComputeSplitPointsBySizeResponse : pb::GeneratedMessage { + private ComputeSplitPointsBySizeResponse() { } + private static readonly ComputeSplitPointsBySizeResponse defaultInstance = new ComputeSplitPointsBySizeResponse().MakeReadOnly(); + private static readonly string[] _computeSplitPointsBySizeResponseFieldNames = new string[] { "consumed", "locations", "schema", "split_points" }; + private static readonly uint[] _computeSplitPointsBySizeResponseFieldTags = new uint[] { 10, 34, 18, 26 }; + public static ComputeSplitPointsBySizeResponse DefaultInstance { + get { return defaultInstance; } + } + + public override ComputeSplitPointsBySizeResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ComputeSplitPointsBySizeResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse__FieldAccessorTable; } + } + + #region Nested types + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class Types { + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SplitLocation : pb::GeneratedMessage { + private SplitLocation() { } + private static readonly SplitLocation defaultInstance = new SplitLocation().MakeReadOnly(); + private static readonly string[] _splitLocationFieldNames = new string[] { "location", "repeat" }; + private static readonly uint[] _splitLocationFieldTags = new uint[] { 10, 16 }; + public static SplitLocation DefaultInstance { + get { return defaultInstance; } + } + + public override SplitLocation DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SplitLocation ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse_SplitLocation__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStore.internal__static_com_alicloud_openservices_tablestore_core_protocol_ComputeSplitPointsBySizeResponse_SplitLocation__FieldAccessorTable; } + } + + public const int LocationFieldNumber = 1; + private bool hasLocation; + private string location_ = ""; + public bool HasLocation { + get { return hasLocation; } + } + public string Location { + get { return location_; } + } + + public const int RepeatFieldNumber = 2; + private bool hasRepeat; + private long repeat_; + public bool HasRepeat { + get { return hasRepeat; } + } + public long Repeat { + get { return repeat_; } + } + + public override bool IsInitialized { + get { + if (!hasLocation) return false; + if (!hasRepeat) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _splitLocationFieldNames; + if (hasLocation) { + output.WriteString(1, field_names[0], Location); + } + if (hasRepeat) { + output.WriteSInt64(2, field_names[1], Repeat); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasLocation) { + size += pb::CodedOutputStream.ComputeStringSize(1, Location); + } + if (hasRepeat) { + size += pb::CodedOutputStream.ComputeSInt64Size(2, Repeat); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static SplitLocation ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SplitLocation ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SplitLocation ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SplitLocation ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SplitLocation ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SplitLocation ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SplitLocation ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SplitLocation ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SplitLocation ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SplitLocation ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SplitLocation MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SplitLocation prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SplitLocation cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SplitLocation result; + + private SplitLocation PrepareBuilder() { + if (resultIsReadOnly) { + SplitLocation original = result; + result = new SplitLocation(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SplitLocation MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.Types.SplitLocation.Descriptor; } + } + + public override SplitLocation DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.Types.SplitLocation.DefaultInstance; } + } + + public override SplitLocation BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SplitLocation) { + return MergeFrom((SplitLocation) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SplitLocation other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.Types.SplitLocation.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasLocation) { + Location = other.Location; + } + if (other.HasRepeat) { + Repeat = other.Repeat; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_splitLocationFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _splitLocationFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasLocation = input.ReadString(ref result.location_); + break; + } + case 16: { + result.hasRepeat = input.ReadSInt64(ref result.repeat_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasLocation { + get { return result.hasLocation; } + } + public string Location { + get { return result.Location; } + set { SetLocation(value); } + } + public Builder SetLocation(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasLocation = true; + result.location_ = value; + return this; + } + public Builder ClearLocation() { + PrepareBuilder(); + result.hasLocation = false; + result.location_ = ""; + return this; + } + + public bool HasRepeat { + get { return result.hasRepeat; } + } + public long Repeat { + get { return result.Repeat; } + set { SetRepeat(value); } + } + public Builder SetRepeat(long value) { + PrepareBuilder(); + result.hasRepeat = true; + result.repeat_ = value; + return this; + } + public Builder ClearRepeat() { + PrepareBuilder(); + result.hasRepeat = false; + result.repeat_ = 0; + return this; + } + } + static SplitLocation() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + } + #endregion + + public const int ConsumedFieldNumber = 1; + private bool hasConsumed; + private global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity consumed_; + public bool HasConsumed { + get { return hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return consumed_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance; } + } + + public const int SchemaFieldNumber = 2; + private pbc::PopsicleList schema_ = new pbc::PopsicleList(); + public scg::IList SchemaList { + get { return schema_; } + } + public int SchemaCount { + get { return schema_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema GetSchema(int index) { + return schema_[index]; + } + + public const int SplitPointsFieldNumber = 3; + private pbc::PopsicleList splitPoints_ = new pbc::PopsicleList(); + public scg::IList SplitPointsList { + get { return pbc::Lists.AsReadOnly(splitPoints_); } + } + public int SplitPointsCount { + get { return splitPoints_.Count; } + } + public pb::ByteString GetSplitPoints(int index) { + return splitPoints_[index]; + } + + public const int LocationsFieldNumber = 4; + private pbc::PopsicleList locations_ = new pbc::PopsicleList(); + public scg::IList LocationsList { + get { return locations_; } + } + public int LocationsCount { + get { return locations_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.Types.SplitLocation GetLocations(int index) { + return locations_[index]; + } + + public override bool IsInitialized { + get { + if (!hasConsumed) return false; + if (!Consumed.IsInitialized) return false; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema element in SchemaList) { + if (!element.IsInitialized) return false; + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.Types.SplitLocation element in LocationsList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _computeSplitPointsBySizeResponseFieldNames; + if (hasConsumed) { + output.WriteMessage(1, field_names[0], Consumed); + } + if (schema_.Count > 0) { + output.WriteMessageArray(2, field_names[2], schema_); + } + if (splitPoints_.Count > 0) { + output.WriteBytesArray(3, field_names[3], splitPoints_); + } + if (locations_.Count > 0) { + output.WriteMessageArray(4, field_names[1], locations_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasConsumed) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Consumed); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema element in SchemaList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + { + int dataSize = 0; + foreach (pb::ByteString element in SplitPointsList) { + dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); + } + size += dataSize; + size += 1 * splitPoints_.Count; + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.Types.SplitLocation element in LocationsList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ComputeSplitPointsBySizeResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ComputeSplitPointsBySizeResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ComputeSplitPointsBySizeResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ComputeSplitPointsBySizeResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ComputeSplitPointsBySizeResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ComputeSplitPointsBySizeResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ComputeSplitPointsBySizeResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ComputeSplitPointsBySizeResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ComputeSplitPointsBySizeResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ComputeSplitPointsBySizeResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ComputeSplitPointsBySizeResponse MakeReadOnly() { + schema_.MakeReadOnly(); + splitPoints_.MakeReadOnly(); + locations_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ComputeSplitPointsBySizeResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ComputeSplitPointsBySizeResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ComputeSplitPointsBySizeResponse result; + + private ComputeSplitPointsBySizeResponse PrepareBuilder() { + if (resultIsReadOnly) { + ComputeSplitPointsBySizeResponse original = result; + result = new ComputeSplitPointsBySizeResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ComputeSplitPointsBySizeResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.Descriptor; } + } + + public override ComputeSplitPointsBySizeResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.DefaultInstance; } + } + + public override ComputeSplitPointsBySizeResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ComputeSplitPointsBySizeResponse) { + return MergeFrom((ComputeSplitPointsBySizeResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ComputeSplitPointsBySizeResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasConsumed) { + MergeConsumed(other.Consumed); + } + if (other.schema_.Count != 0) { + result.schema_.Add(other.schema_); + } + if (other.splitPoints_.Count != 0) { + result.splitPoints_.Add(other.splitPoints_); + } + if (other.locations_.Count != 0) { + result.locations_.Add(other.locations_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_computeSplitPointsBySizeResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _computeSplitPointsBySizeResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(); + if (result.hasConsumed) { + subBuilder.MergeFrom(Consumed); + } + input.ReadMessage(subBuilder, extensionRegistry); + Consumed = subBuilder.BuildPartial(); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.schema_, global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema.DefaultInstance, extensionRegistry); + break; + } + case 26: { + input.ReadBytesArray(tag, field_name, result.splitPoints_); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.locations_, global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.Types.SplitLocation.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasConsumed { + get { return result.hasConsumed; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity Consumed { + get { return result.Consumed; } + set { SetConsumed(value); } + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = value; + return this; + } + public Builder SetConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasConsumed = true; + result.consumed_ = builderForValue.Build(); + return this; + } + public Builder MergeConsumed(global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasConsumed && + result.consumed_ != global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.DefaultInstance) { + result.consumed_ = global::com.alicloud.openservices.tablestore.core.protocol.ConsumedCapacity.CreateBuilder(result.consumed_).MergeFrom(value).BuildPartial(); + } else { + result.consumed_ = value; + } + result.hasConsumed = true; + return this; + } + public Builder ClearConsumed() { + PrepareBuilder(); + result.hasConsumed = false; + result.consumed_ = null; + return this; + } + + public pbc::IPopsicleList SchemaList { + get { return PrepareBuilder().schema_; } + } + public int SchemaCount { + get { return result.SchemaCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema GetSchema(int index) { + return result.GetSchema(index); + } + public Builder SetSchema(int index, global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.schema_[index] = value; + return this; + } + public Builder SetSchema(int index, global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.schema_[index] = builderForValue.Build(); + return this; + } + public Builder AddSchema(global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.schema_.Add(value); + return this; + } + public Builder AddSchema(global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySchema.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.schema_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeSchema(scg::IEnumerable values) { + PrepareBuilder(); + result.schema_.Add(values); + return this; + } + public Builder ClearSchema() { + PrepareBuilder(); + result.schema_.Clear(); + return this; + } + + public pbc::IPopsicleList SplitPointsList { + get { return PrepareBuilder().splitPoints_; } + } + public int SplitPointsCount { + get { return result.SplitPointsCount; } + } + public pb::ByteString GetSplitPoints(int index) { + return result.GetSplitPoints(index); + } + public Builder SetSplitPoints(int index, pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.splitPoints_[index] = value; + return this; + } + public Builder AddSplitPoints(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.splitPoints_.Add(value); + return this; + } + public Builder AddRangeSplitPoints(scg::IEnumerable values) { + PrepareBuilder(); + result.splitPoints_.Add(values); + return this; + } + public Builder ClearSplitPoints() { + PrepareBuilder(); + result.splitPoints_.Clear(); + return this; + } + + public pbc::IPopsicleList LocationsList { + get { return PrepareBuilder().locations_; } + } + public int LocationsCount { + get { return result.LocationsCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.Types.SplitLocation GetLocations(int index) { + return result.GetLocations(index); + } + public Builder SetLocations(int index, global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.Types.SplitLocation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.locations_[index] = value; + return this; + } + public Builder SetLocations(int index, global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.Types.SplitLocation.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.locations_[index] = builderForValue.Build(); + return this; + } + public Builder AddLocations(global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.Types.SplitLocation value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.locations_.Add(value); + return this; + } + public Builder AddLocations(global::com.alicloud.openservices.tablestore.core.protocol.ComputeSplitPointsBySizeResponse.Types.SplitLocation.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.locations_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeLocations(scg::IEnumerable values) { + PrepareBuilder(); + result.locations_.Add(values); + return this; + } + public Builder ClearLocations() { + PrepareBuilder(); + result.locations_.Clear(); + return this; + } + } + static ComputeSplitPointsBySizeResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStore.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/TableStoreFilter.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/TableStoreFilter.cs new file mode 100644 index 0000000..c21e519 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/TableStoreFilter.cs @@ -0,0 +1,1582 @@ +// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT! +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace com.alicloud.openservices.tablestore.core.protocol { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class TableStoreFilter { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_SingleColumnValueFilter__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_SingleColumnValueFilter__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_CompositeColumnValueFilter__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_CompositeColumnValueFilter__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnPaginationFilter__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnPaginationFilter__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_Filter__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_Filter__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static TableStoreFilter() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Chh0YWJsZV9zdG9yZV9maWx0ZXIucHJvdG8SMmNvbS5hbGljbG91ZC5vcGVu", + "c2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sItQBChdTaW5nbGVD", + "b2x1bW5WYWx1ZUZpbHRlchJWCgpjb21wYXJhdG9yGAEgAigOMkIuY29tLmFs", + "aWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wu", + "Q29tcGFyYXRvclR5cGUSEwoLY29sdW1uX25hbWUYAiACKAkSFAoMY29sdW1u", + "X3ZhbHVlGAMgAigMEhkKEWZpbHRlcl9pZl9taXNzaW5nGAQgAigIEhsKE2xh", + "dGVzdF92ZXJzaW9uX29ubHkYBSACKAgixgEKGkNvbXBvc2l0ZUNvbHVtblZh", + "bHVlRmlsdGVyElcKCmNvbWJpbmF0b3IYASACKA4yQy5jb20uYWxpY2xvdWQu", + "b3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5Mb2dpY2Fs", + "T3BlcmF0b3ISTwoLc3ViX2ZpbHRlcnMYAiADKAsyOi5jb20uYWxpY2xvdWQu", + "b3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5GaWx0ZXIi", + "NwoWQ29sdW1uUGFnaW5hdGlvbkZpbHRlchIOCgZvZmZzZXQYASACKAUSDQoF", + "bGltaXQYAiACKAUiZgoGRmlsdGVyEkwKBHR5cGUYASACKA4yPi5jb20uYWxp", + "Y2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5G", + "aWx0ZXJUeXBlEg4KBmZpbHRlchgCIAIoDCphCgpGaWx0ZXJUeXBlEhoKFkZU", + "X1NJTkdMRV9DT0xVTU5fVkFMVUUQARIdChlGVF9DT01QT1NJVEVfQ09MVU1O", + "X1ZBTFVFEAISGAoURlRfQ09MVU1OX1BBR0lOQVRJT04QAyqAAQoOQ29tcGFy", + "YXRvclR5cGUSDAoIQ1RfRVFVQUwQARIQCgxDVF9OT1RfRVFVQUwQAhITCg9D", + "VF9HUkVBVEVSX1RIQU4QAxIUChBDVF9HUkVBVEVSX0VRVUFMEAQSEAoMQ1Rf", + "TEVTU19USEFOEAUSEQoNQ1RfTEVTU19FUVVBTBAGKjQKD0xvZ2ljYWxPcGVy", + "YXRvchIKCgZMT19OT1QQARIKCgZMT19BTkQQAhIJCgVMT19PUhAD")); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_com_alicloud_openservices_tablestore_core_protocol_SingleColumnValueFilter__Descriptor = Descriptor.MessageTypes[0]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_SingleColumnValueFilter__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_SingleColumnValueFilter__Descriptor, + new string[] { "Comparator", "ColumnName", "ColumnValue", "FilterIfMissing", "LatestVersionOnly", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_CompositeColumnValueFilter__Descriptor = Descriptor.MessageTypes[1]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_CompositeColumnValueFilter__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_CompositeColumnValueFilter__Descriptor, + new string[] { "Combinator", "SubFilters", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnPaginationFilter__Descriptor = Descriptor.MessageTypes[2]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnPaginationFilter__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnPaginationFilter__Descriptor, + new string[] { "Offset", "Limit", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_Filter__Descriptor = Descriptor.MessageTypes[3]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_Filter__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_Filter__Descriptor, + new string[] { "Type", "Filter_", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + #region Enums + public enum FilterType { + FT_SINGLE_COLUMN_VALUE = 1, + FT_COMPOSITE_COLUMN_VALUE = 2, + FT_COLUMN_PAGINATION = 3, + } + + public enum ComparatorType { + CT_EQUAL = 1, + CT_NOT_EQUAL = 2, + CT_GREATER_THAN = 3, + CT_GREATER_EQUAL = 4, + CT_LESS_THAN = 5, + CT_LESS_EQUAL = 6, + } + + public enum LogicalOperator { + LO_NOT = 1, + LO_AND = 2, + LO_OR = 3, + } + + #endregion + + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SingleColumnValueFilter : pb::GeneratedMessage { + private SingleColumnValueFilter() { } + private static readonly SingleColumnValueFilter defaultInstance = new SingleColumnValueFilter().MakeReadOnly(); + private static readonly string[] _singleColumnValueFilterFieldNames = new string[] { "column_name", "column_value", "comparator", "filter_if_missing", "latest_version_only" }; + private static readonly uint[] _singleColumnValueFilterFieldTags = new uint[] { 18, 26, 8, 32, 40 }; + public static SingleColumnValueFilter DefaultInstance { + get { return defaultInstance; } + } + + public override SingleColumnValueFilter DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SingleColumnValueFilter ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStoreFilter.internal__static_com_alicloud_openservices_tablestore_core_protocol_SingleColumnValueFilter__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStoreFilter.internal__static_com_alicloud_openservices_tablestore_core_protocol_SingleColumnValueFilter__FieldAccessorTable; } + } + + public const int ComparatorFieldNumber = 1; + private bool hasComparator; + private global::com.alicloud.openservices.tablestore.core.protocol.ComparatorType comparator_ = global::com.alicloud.openservices.tablestore.core.protocol.ComparatorType.CT_EQUAL; + public bool HasComparator { + get { return hasComparator; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ComparatorType Comparator { + get { return comparator_; } + } + + public const int ColumnNameFieldNumber = 2; + private bool hasColumnName; + private string columnName_ = ""; + public bool HasColumnName { + get { return hasColumnName; } + } + public string ColumnName { + get { return columnName_; } + } + + public const int ColumnValueFieldNumber = 3; + private bool hasColumnValue; + private pb::ByteString columnValue_ = pb::ByteString.Empty; + public bool HasColumnValue { + get { return hasColumnValue; } + } + public pb::ByteString ColumnValue { + get { return columnValue_; } + } + + public const int FilterIfMissingFieldNumber = 4; + private bool hasFilterIfMissing; + private bool filterIfMissing_; + public bool HasFilterIfMissing { + get { return hasFilterIfMissing; } + } + public bool FilterIfMissing { + get { return filterIfMissing_; } + } + + public const int LatestVersionOnlyFieldNumber = 5; + private bool hasLatestVersionOnly; + private bool latestVersionOnly_; + public bool HasLatestVersionOnly { + get { return hasLatestVersionOnly; } + } + public bool LatestVersionOnly { + get { return latestVersionOnly_; } + } + + public override bool IsInitialized { + get { + if (!hasComparator) return false; + if (!hasColumnName) return false; + if (!hasColumnValue) return false; + if (!hasFilterIfMissing) return false; + if (!hasLatestVersionOnly) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _singleColumnValueFilterFieldNames; + if (hasComparator) { + output.WriteEnum(1, field_names[2], (int) Comparator, Comparator); + } + if (hasColumnName) { + output.WriteString(2, field_names[0], ColumnName); + } + if (hasColumnValue) { + output.WriteBytes(3, field_names[1], ColumnValue); + } + if (hasFilterIfMissing) { + output.WriteBool(4, field_names[3], FilterIfMissing); + } + if (hasLatestVersionOnly) { + output.WriteBool(5, field_names[4], LatestVersionOnly); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasComparator) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Comparator); + } + if (hasColumnName) { + size += pb::CodedOutputStream.ComputeStringSize(2, ColumnName); + } + if (hasColumnValue) { + size += pb::CodedOutputStream.ComputeBytesSize(3, ColumnValue); + } + if (hasFilterIfMissing) { + size += pb::CodedOutputStream.ComputeBoolSize(4, FilterIfMissing); + } + if (hasLatestVersionOnly) { + size += pb::CodedOutputStream.ComputeBoolSize(5, LatestVersionOnly); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static SingleColumnValueFilter ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SingleColumnValueFilter ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SingleColumnValueFilter ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SingleColumnValueFilter ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SingleColumnValueFilter ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SingleColumnValueFilter ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SingleColumnValueFilter ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SingleColumnValueFilter ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SingleColumnValueFilter ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SingleColumnValueFilter ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SingleColumnValueFilter MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SingleColumnValueFilter prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SingleColumnValueFilter cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SingleColumnValueFilter result; + + private SingleColumnValueFilter PrepareBuilder() { + if (resultIsReadOnly) { + SingleColumnValueFilter original = result; + result = new SingleColumnValueFilter(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SingleColumnValueFilter MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.SingleColumnValueFilter.Descriptor; } + } + + public override SingleColumnValueFilter DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.SingleColumnValueFilter.DefaultInstance; } + } + + public override SingleColumnValueFilter BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SingleColumnValueFilter) { + return MergeFrom((SingleColumnValueFilter) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SingleColumnValueFilter other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.SingleColumnValueFilter.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasComparator) { + Comparator = other.Comparator; + } + if (other.HasColumnName) { + ColumnName = other.ColumnName; + } + if (other.HasColumnValue) { + ColumnValue = other.ColumnValue; + } + if (other.HasFilterIfMissing) { + FilterIfMissing = other.FilterIfMissing; + } + if (other.HasLatestVersionOnly) { + LatestVersionOnly = other.LatestVersionOnly; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_singleColumnValueFilterFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _singleColumnValueFilterFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.comparator_, out unknown)) { + result.hasComparator = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + case 18: { + result.hasColumnName = input.ReadString(ref result.columnName_); + break; + } + case 26: { + result.hasColumnValue = input.ReadBytes(ref result.columnValue_); + break; + } + case 32: { + result.hasFilterIfMissing = input.ReadBool(ref result.filterIfMissing_); + break; + } + case 40: { + result.hasLatestVersionOnly = input.ReadBool(ref result.latestVersionOnly_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasComparator { + get { return result.hasComparator; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ComparatorType Comparator { + get { return result.Comparator; } + set { SetComparator(value); } + } + public Builder SetComparator(global::com.alicloud.openservices.tablestore.core.protocol.ComparatorType value) { + PrepareBuilder(); + result.hasComparator = true; + result.comparator_ = value; + return this; + } + public Builder ClearComparator() { + PrepareBuilder(); + result.hasComparator = false; + result.comparator_ = global::com.alicloud.openservices.tablestore.core.protocol.ComparatorType.CT_EQUAL; + return this; + } + + public bool HasColumnName { + get { return result.hasColumnName; } + } + public string ColumnName { + get { return result.ColumnName; } + set { SetColumnName(value); } + } + public Builder SetColumnName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasColumnName = true; + result.columnName_ = value; + return this; + } + public Builder ClearColumnName() { + PrepareBuilder(); + result.hasColumnName = false; + result.columnName_ = ""; + return this; + } + + public bool HasColumnValue { + get { return result.hasColumnValue; } + } + public pb::ByteString ColumnValue { + get { return result.ColumnValue; } + set { SetColumnValue(value); } + } + public Builder SetColumnValue(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasColumnValue = true; + result.columnValue_ = value; + return this; + } + public Builder ClearColumnValue() { + PrepareBuilder(); + result.hasColumnValue = false; + result.columnValue_ = pb::ByteString.Empty; + return this; + } + + public bool HasFilterIfMissing { + get { return result.hasFilterIfMissing; } + } + public bool FilterIfMissing { + get { return result.FilterIfMissing; } + set { SetFilterIfMissing(value); } + } + public Builder SetFilterIfMissing(bool value) { + PrepareBuilder(); + result.hasFilterIfMissing = true; + result.filterIfMissing_ = value; + return this; + } + public Builder ClearFilterIfMissing() { + PrepareBuilder(); + result.hasFilterIfMissing = false; + result.filterIfMissing_ = false; + return this; + } + + public bool HasLatestVersionOnly { + get { return result.hasLatestVersionOnly; } + } + public bool LatestVersionOnly { + get { return result.LatestVersionOnly; } + set { SetLatestVersionOnly(value); } + } + public Builder SetLatestVersionOnly(bool value) { + PrepareBuilder(); + result.hasLatestVersionOnly = true; + result.latestVersionOnly_ = value; + return this; + } + public Builder ClearLatestVersionOnly() { + PrepareBuilder(); + result.hasLatestVersionOnly = false; + result.latestVersionOnly_ = false; + return this; + } + } + static SingleColumnValueFilter() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStoreFilter.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class CompositeColumnValueFilter : pb::GeneratedMessage { + private CompositeColumnValueFilter() { } + private static readonly CompositeColumnValueFilter defaultInstance = new CompositeColumnValueFilter().MakeReadOnly(); + private static readonly string[] _compositeColumnValueFilterFieldNames = new string[] { "combinator", "sub_filters" }; + private static readonly uint[] _compositeColumnValueFilterFieldTags = new uint[] { 8, 18 }; + public static CompositeColumnValueFilter DefaultInstance { + get { return defaultInstance; } + } + + public override CompositeColumnValueFilter DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CompositeColumnValueFilter ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStoreFilter.internal__static_com_alicloud_openservices_tablestore_core_protocol_CompositeColumnValueFilter__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStoreFilter.internal__static_com_alicloud_openservices_tablestore_core_protocol_CompositeColumnValueFilter__FieldAccessorTable; } + } + + public const int CombinatorFieldNumber = 1; + private bool hasCombinator; + private global::com.alicloud.openservices.tablestore.core.protocol.LogicalOperator combinator_ = global::com.alicloud.openservices.tablestore.core.protocol.LogicalOperator.LO_NOT; + public bool HasCombinator { + get { return hasCombinator; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.LogicalOperator Combinator { + get { return combinator_; } + } + + public const int SubFiltersFieldNumber = 2; + private pbc::PopsicleList subFilters_ = new pbc::PopsicleList(); + public scg::IList SubFiltersList { + get { return subFilters_; } + } + public int SubFiltersCount { + get { return subFilters_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Filter GetSubFilters(int index) { + return subFilters_[index]; + } + + public override bool IsInitialized { + get { + if (!hasCombinator) return false; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.Filter element in SubFiltersList) { + if (!element.IsInitialized) return false; + } + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _compositeColumnValueFilterFieldNames; + if (hasCombinator) { + output.WriteEnum(1, field_names[0], (int) Combinator, Combinator); + } + if (subFilters_.Count > 0) { + output.WriteMessageArray(2, field_names[1], subFilters_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasCombinator) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Combinator); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.Filter element in SubFiltersList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static CompositeColumnValueFilter ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CompositeColumnValueFilter ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CompositeColumnValueFilter ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CompositeColumnValueFilter ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CompositeColumnValueFilter ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CompositeColumnValueFilter ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CompositeColumnValueFilter ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CompositeColumnValueFilter ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CompositeColumnValueFilter ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CompositeColumnValueFilter ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CompositeColumnValueFilter MakeReadOnly() { + subFilters_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CompositeColumnValueFilter prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CompositeColumnValueFilter cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CompositeColumnValueFilter result; + + private CompositeColumnValueFilter PrepareBuilder() { + if (resultIsReadOnly) { + CompositeColumnValueFilter original = result; + result = new CompositeColumnValueFilter(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CompositeColumnValueFilter MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CompositeColumnValueFilter.Descriptor; } + } + + public override CompositeColumnValueFilter DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CompositeColumnValueFilter.DefaultInstance; } + } + + public override CompositeColumnValueFilter BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CompositeColumnValueFilter) { + return MergeFrom((CompositeColumnValueFilter) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CompositeColumnValueFilter other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.CompositeColumnValueFilter.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasCombinator) { + Combinator = other.Combinator; + } + if (other.subFilters_.Count != 0) { + result.subFilters_.Add(other.subFilters_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_compositeColumnValueFilterFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _compositeColumnValueFilterFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.combinator_, out unknown)) { + result.hasCombinator = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.subFilters_, global::com.alicloud.openservices.tablestore.core.protocol.Filter.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasCombinator { + get { return result.hasCombinator; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.LogicalOperator Combinator { + get { return result.Combinator; } + set { SetCombinator(value); } + } + public Builder SetCombinator(global::com.alicloud.openservices.tablestore.core.protocol.LogicalOperator value) { + PrepareBuilder(); + result.hasCombinator = true; + result.combinator_ = value; + return this; + } + public Builder ClearCombinator() { + PrepareBuilder(); + result.hasCombinator = false; + result.combinator_ = global::com.alicloud.openservices.tablestore.core.protocol.LogicalOperator.LO_NOT; + return this; + } + + public pbc::IPopsicleList SubFiltersList { + get { return PrepareBuilder().subFilters_; } + } + public int SubFiltersCount { + get { return result.SubFiltersCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Filter GetSubFilters(int index) { + return result.GetSubFilters(index); + } + public Builder SetSubFilters(int index, global::com.alicloud.openservices.tablestore.core.protocol.Filter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.subFilters_[index] = value; + return this; + } + public Builder SetSubFilters(int index, global::com.alicloud.openservices.tablestore.core.protocol.Filter.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.subFilters_[index] = builderForValue.Build(); + return this; + } + public Builder AddSubFilters(global::com.alicloud.openservices.tablestore.core.protocol.Filter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.subFilters_.Add(value); + return this; + } + public Builder AddSubFilters(global::com.alicloud.openservices.tablestore.core.protocol.Filter.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.subFilters_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeSubFilters(scg::IEnumerable values) { + PrepareBuilder(); + result.subFilters_.Add(values); + return this; + } + public Builder ClearSubFilters() { + PrepareBuilder(); + result.subFilters_.Clear(); + return this; + } + } + static CompositeColumnValueFilter() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStoreFilter.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ColumnPaginationFilter : pb::GeneratedMessage { + private ColumnPaginationFilter() { } + private static readonly ColumnPaginationFilter defaultInstance = new ColumnPaginationFilter().MakeReadOnly(); + private static readonly string[] _columnPaginationFilterFieldNames = new string[] { "limit", "offset" }; + private static readonly uint[] _columnPaginationFilterFieldTags = new uint[] { 16, 8 }; + public static ColumnPaginationFilter DefaultInstance { + get { return defaultInstance; } + } + + public override ColumnPaginationFilter DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ColumnPaginationFilter ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStoreFilter.internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnPaginationFilter__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStoreFilter.internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnPaginationFilter__FieldAccessorTable; } + } + + public const int OffsetFieldNumber = 1; + private bool hasOffset; + private int offset_; + public bool HasOffset { + get { return hasOffset; } + } + public int Offset { + get { return offset_; } + } + + public const int LimitFieldNumber = 2; + private bool hasLimit; + private int limit_; + public bool HasLimit { + get { return hasLimit; } + } + public int Limit { + get { return limit_; } + } + + public override bool IsInitialized { + get { + if (!hasOffset) return false; + if (!hasLimit) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _columnPaginationFilterFieldNames; + if (hasOffset) { + output.WriteInt32(1, field_names[1], Offset); + } + if (hasLimit) { + output.WriteInt32(2, field_names[0], Limit); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOffset) { + size += pb::CodedOutputStream.ComputeInt32Size(1, Offset); + } + if (hasLimit) { + size += pb::CodedOutputStream.ComputeInt32Size(2, Limit); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ColumnPaginationFilter ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ColumnPaginationFilter ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ColumnPaginationFilter ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ColumnPaginationFilter ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ColumnPaginationFilter ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ColumnPaginationFilter ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ColumnPaginationFilter ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ColumnPaginationFilter ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ColumnPaginationFilter ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ColumnPaginationFilter ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ColumnPaginationFilter MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ColumnPaginationFilter prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ColumnPaginationFilter cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ColumnPaginationFilter result; + + private ColumnPaginationFilter PrepareBuilder() { + if (resultIsReadOnly) { + ColumnPaginationFilter original = result; + result = new ColumnPaginationFilter(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ColumnPaginationFilter MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ColumnPaginationFilter.Descriptor; } + } + + public override ColumnPaginationFilter DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ColumnPaginationFilter.DefaultInstance; } + } + + public override ColumnPaginationFilter BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ColumnPaginationFilter) { + return MergeFrom((ColumnPaginationFilter) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ColumnPaginationFilter other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ColumnPaginationFilter.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOffset) { + Offset = other.Offset; + } + if (other.HasLimit) { + Limit = other.Limit; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_columnPaginationFilterFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _columnPaginationFilterFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasOffset = input.ReadInt32(ref result.offset_); + break; + } + case 16: { + result.hasLimit = input.ReadInt32(ref result.limit_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOffset { + get { return result.hasOffset; } + } + public int Offset { + get { return result.Offset; } + set { SetOffset(value); } + } + public Builder SetOffset(int value) { + PrepareBuilder(); + result.hasOffset = true; + result.offset_ = value; + return this; + } + public Builder ClearOffset() { + PrepareBuilder(); + result.hasOffset = false; + result.offset_ = 0; + return this; + } + + public bool HasLimit { + get { return result.hasLimit; } + } + public int Limit { + get { return result.Limit; } + set { SetLimit(value); } + } + public Builder SetLimit(int value) { + PrepareBuilder(); + result.hasLimit = true; + result.limit_ = value; + return this; + } + public Builder ClearLimit() { + PrepareBuilder(); + result.hasLimit = false; + result.limit_ = 0; + return this; + } + } + static ColumnPaginationFilter() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStoreFilter.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Filter : pb::GeneratedMessage { + private Filter() { } + private static readonly Filter defaultInstance = new Filter().MakeReadOnly(); + private static readonly string[] _filterFieldNames = new string[] { "filter", "type" }; + private static readonly uint[] _filterFieldTags = new uint[] { 18, 8 }; + public static Filter DefaultInstance { + get { return defaultInstance; } + } + + public override Filter DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Filter ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStoreFilter.internal__static_com_alicloud_openservices_tablestore_core_protocol_Filter__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TableStoreFilter.internal__static_com_alicloud_openservices_tablestore_core_protocol_Filter__FieldAccessorTable; } + } + + public const int TypeFieldNumber = 1; + private bool hasType; + private global::com.alicloud.openservices.tablestore.core.protocol.FilterType type_ = global::com.alicloud.openservices.tablestore.core.protocol.FilterType.FT_SINGLE_COLUMN_VALUE; + public bool HasType { + get { return hasType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.FilterType Type { + get { return type_; } + } + + public const int Filter_FieldNumber = 2; + private bool hasFilter_; + private pb::ByteString filter_ = pb::ByteString.Empty; + public bool HasFilter_ { + get { return hasFilter_; } + } + public pb::ByteString Filter_ { + get { return filter_; } + } + + public override bool IsInitialized { + get { + if (!hasType) return false; + if (!hasFilter_) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _filterFieldNames; + if (hasType) { + output.WriteEnum(1, field_names[1], (int) Type, Type); + } + if (hasFilter_) { + output.WriteBytes(2, field_names[0], Filter_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasType) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Type); + } + if (hasFilter_) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Filter_); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static Filter ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Filter ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Filter ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Filter ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Filter ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Filter ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Filter ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Filter ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Filter ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Filter ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Filter MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Filter prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Filter cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Filter result; + + private Filter PrepareBuilder() { + if (resultIsReadOnly) { + Filter original = result; + result = new Filter(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Filter MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Filter.Descriptor; } + } + + public override Filter DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Filter.DefaultInstance; } + } + + public override Filter BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Filter) { + return MergeFrom((Filter) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Filter other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.Filter.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasType) { + Type = other.Type; + } + if (other.HasFilter_) { + Filter_ = other.Filter_; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_filterFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _filterFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.type_, out unknown)) { + result.hasType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + case 18: { + result.hasFilter_ = input.ReadBytes(ref result.filter_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasType { + get { return result.hasType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.FilterType Type { + get { return result.Type; } + set { SetType(value); } + } + public Builder SetType(global::com.alicloud.openservices.tablestore.core.protocol.FilterType value) { + PrepareBuilder(); + result.hasType = true; + result.type_ = value; + return this; + } + public Builder ClearType() { + PrepareBuilder(); + result.hasType = false; + result.type_ = global::com.alicloud.openservices.tablestore.core.protocol.FilterType.FT_SINGLE_COLUMN_VALUE; + return this; + } + + public bool HasFilter_ { + get { return result.hasFilter_; } + } + public pb::ByteString Filter_ { + get { return result.Filter_; } + set { SetFilter_(value); } + } + public Builder SetFilter_(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFilter_ = true; + result.filter_ = value; + return this; + } + public Builder ClearFilter_() { + PrepareBuilder(); + result.hasFilter_ = false; + result.filter_ = pb::ByteString.Empty; + return this; + } + } + static Filter() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TableStoreFilter.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/TablestoreSearch.cs b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/TablestoreSearch.cs new file mode 100644 index 0000000..a322ee0 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/TablestoreSearch.cs @@ -0,0 +1,15965 @@ +// Generated by ProtoGen, Version=2.4.1.555, Culture=neutral, PublicKeyToken=17b3b1f090c3ea48. DO NOT EDIT! +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.ProtocolBuffers; +using pbc = global::Google.ProtocolBuffers.Collections; +using pbd = global::Google.ProtocolBuffers.Descriptors; +using scg = global::System.Collections.Generic; +namespace com.alicloud.openservices.tablestore.core.protocol { + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public static partial class TablestoreSearch { + + #region Extension registration + public static void RegisterAllExtensions(pb::ExtensionRegistry registry) { + } + #endregion + #region Static variables + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchPhraseQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchPhraseQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchAllQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchAllQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_TermQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_TermQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_TermsQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_TermsQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_RangeQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_RangeQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_PrefixQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_PrefixQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_WildcardQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_WildcardQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_BoolQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_BoolQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ConstScoreQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ConstScoreQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldValueFactor__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldValueFactor__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_FunctionScoreQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_FunctionScoreQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoBoundingBoxQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoBoundingBoxQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoPolygonQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoPolygonQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_Query__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_Query__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_Collapse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_Collapse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedFilter__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedFilter__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ScoreSort__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ScoreSort__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySort__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySort__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSort__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSort__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceSort__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceSort__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_Sorter__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_Sorter__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_Sort__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_Sort__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchQuery__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchQuery__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnsToGet__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnsToGet__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSchema__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSchema__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSchema__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSchema__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSetting__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSetting__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexInfo__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexInfo__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexResponse__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_SyncStat__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_SyncStat__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexRequest__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexRequest__FieldAccessorTable; + internal static pbd::MessageDescriptor internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexResponse__Descriptor; + internal static pb::FieldAccess.FieldAccessorTable internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexResponse__FieldAccessorTable; + #endregion + #region Descriptor + public static pbd::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbd::FileDescriptor descriptor; + + static TablestoreSearch() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Chd0YWJsZXN0b3JlX3NlYXJjaC5wcm90bxIyY29tLmFsaWNsb3VkLm9wZW5z", + "ZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wioQEKCk1hdGNoUXVl", + "cnkSEgoKZmllbGRfbmFtZRgBIAEoCRIMCgR0ZXh0GAIgASgJEhwKFG1pbmlt", + "dW1fc2hvdWxkX21hdGNoGAMgASgFElMKCG9wZXJhdG9yGAQgASgOMkEuY29t", + "LmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9j", + "b2wuUXVlcnlPcGVyYXRvciI0ChBNYXRjaFBocmFzZVF1ZXJ5EhIKCmZpZWxk", + "X25hbWUYASABKAkSDAoEdGV4dBgCIAEoCSIPCg1NYXRjaEFsbFF1ZXJ5Ii0K", + "CVRlcm1RdWVyeRISCgpmaWVsZF9uYW1lGAEgASgJEgwKBHRlcm0YAiABKAwi", + "LwoKVGVybXNRdWVyeRISCgpmaWVsZF9uYW1lGAEgASgJEg0KBXRlcm1zGAIg", + "AygMInQKClJhbmdlUXVlcnkSEgoKZmllbGRfbmFtZRgBIAEoCRISCgpyYW5n", + "ZV9mcm9tGAIgASgMEhAKCHJhbmdlX3RvGAMgASgMEhUKDWluY2x1ZGVfbG93", + "ZXIYBCABKAgSFQoNaW5jbHVkZV91cHBlchgFIAEoCCIxCgtQcmVmaXhRdWVy", + "eRISCgpmaWVsZF9uYW1lGAEgASgJEg4KBnByZWZpeBgCIAEoCSIyCg1XaWxk", + "Y2FyZFF1ZXJ5EhIKCmZpZWxkX25hbWUYASABKAkSDQoFdmFsdWUYAiABKAki", + "9QIKCUJvb2xRdWVyeRJPCgxtdXN0X3F1ZXJpZXMYASADKAsyOS5jb20uYWxp", + "Y2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5R", + "dWVyeRJTChBtdXN0X25vdF9xdWVyaWVzGAIgAygLMjkuY29tLmFsaWNsb3Vk", + "Lm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuUXVlcnkS", + "UQoOZmlsdGVyX3F1ZXJpZXMYAyADKAsyOS5jb20uYWxpY2xvdWQub3BlbnNl", + "cnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5RdWVyeRJRCg5zaG91", + "bGRfcXVlcmllcxgEIAMoCzI5LmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMu", + "dGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlF1ZXJ5EhwKFG1pbmltdW1fc2hv", + "dWxkX21hdGNoGAUgASgFIlwKD0NvbnN0U2NvcmVRdWVyeRJJCgZmaWx0ZXIY", + "ASABKAsyOS5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUu", + "Y29yZS5wcm90b2NvbC5RdWVyeSImChBGaWVsZFZhbHVlRmFjdG9yEhIKCmZp", + "ZWxkX25hbWUYASABKAkiwAEKEkZ1bmN0aW9uU2NvcmVRdWVyeRJICgVxdWVy", + "eRgBIAEoCzI5LmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9y", + "ZS5jb3JlLnByb3RvY29sLlF1ZXJ5EmAKEmZpZWxkX3ZhbHVlX2ZhY3RvchgC", + "IAEoCzJELmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9yZS5j", + "b3JlLnByb3RvY29sLkZpZWxkVmFsdWVGYWN0b3IiuAEKC05lc3RlZFF1ZXJ5", + "EgwKBHBhdGgYASABKAkSSAoFcXVlcnkYAiABKAsyOS5jb20uYWxpY2xvdWQu", + "b3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5RdWVyeRJR", + "CgpzY29yZV9tb2RlGAMgASgOMj0uY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNl", + "cy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuU2NvcmVNb2RlIlEKE0dlb0Jv", + "dW5kaW5nQm94UXVlcnkSEgoKZmllbGRfbmFtZRgBIAEoCRIQCgh0b3BfbGVm", + "dBgCIAEoCRIUCgxib3R0b21fcmlnaHQYAyABKAkiTgoQR2VvRGlzdGFuY2VR", + "dWVyeRISCgpmaWVsZF9uYW1lGAEgASgJEhQKDGNlbnRlcl9wb2ludBgCIAEo", + "CRIQCghkaXN0YW5jZRgDIAEoASI1Cg9HZW9Qb2x5Z29uUXVlcnkSEgoKZmll", + "bGRfbmFtZRgBIAEoCRIOCgZwb2ludHMYAiADKAkiYwoFUXVlcnkSSwoEdHlw", + "ZRgBIAEoDjI9LmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9y", + "ZS5jb3JlLnByb3RvY29sLlF1ZXJ5VHlwZRINCgVxdWVyeRgCIAEoDCIeCghD", + "b2xsYXBzZRISCgpmaWVsZF9uYW1lGAEgASgJImcKDE5lc3RlZEZpbHRlchIM", + "CgRwYXRoGAEgASgJEkkKBmZpbHRlchgCIAEoCzI5LmNvbS5hbGljbG91ZC5v", + "cGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlF1ZXJ5IlkK", + "CVNjb3JlU29ydBJMCgVvcmRlchgBIAEoDjI9LmNvbS5hbGljbG91ZC5vcGVu", + "c2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlNvcnRPcmRlciJe", + "Cg5QcmltYXJ5S2V5U29ydBJMCgVvcmRlchgBIAEoDjI9LmNvbS5hbGljbG91", + "ZC5vcGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlNvcnRP", + "cmRlciKSAgoJRmllbGRTb3J0EhIKCmZpZWxkX25hbWUYASABKAkSTAoFb3Jk", + "ZXIYAiABKA4yPS5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3Rv", + "cmUuY29yZS5wcm90b2NvbC5Tb3J0T3JkZXISSgoEbW9kZRgDIAEoDjI8LmNv", + "bS5hbGljbG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3Rv", + "Y29sLlNvcnRNb2RlElcKDW5lc3RlZF9maWx0ZXIYBCABKAsyQC5jb20uYWxp", + "Y2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5O", + "ZXN0ZWRGaWx0ZXIihAMKD0dlb0Rpc3RhbmNlU29ydBISCgpmaWVsZF9uYW1l", + "GAEgASgJEg4KBnBvaW50cxgCIAMoCRJMCgVvcmRlchgDIAEoDjI9LmNvbS5h", + "bGljbG91ZC5vcGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29s", + "LlNvcnRPcmRlchJKCgRtb2RlGAQgASgOMjwuY29tLmFsaWNsb3VkLm9wZW5z", + "ZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuU29ydE1vZGUSWgoN", + "ZGlzdGFuY2VfdHlwZRgFIAEoDjJDLmNvbS5hbGljbG91ZC5vcGVuc2Vydmlj", + "ZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLkdlb0Rpc3RhbmNlVHlwZRJX", + "Cg1uZXN0ZWRfZmlsdGVyGAYgASgLMkAuY29tLmFsaWNsb3VkLm9wZW5zZXJ2", + "aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuTmVzdGVkRmlsdGVyIuMC", + "CgZTb3J0ZXISUQoKZmllbGRfc29ydBgBIAEoCzI9LmNvbS5hbGljbG91ZC5v", + "cGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLkZpZWxkU29y", + "dBJeChFnZW9fZGlzdGFuY2Vfc29ydBgCIAEoCzJDLmNvbS5hbGljbG91ZC5v", + "cGVuc2VydmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLkdlb0Rpc3Rh", + "bmNlU29ydBJRCgpzY29yZV9zb3J0GAMgASgLMj0uY29tLmFsaWNsb3VkLm9w", + "ZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuU2NvcmVTb3J0", + "ElMKB3BrX3NvcnQYBCABKAsyQi5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2Vz", + "LnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5QcmltYXJ5S2V5U29ydCJSCgRT", + "b3J0EkoKBnNvcnRlchgBIAMoCzI6LmNvbS5hbGljbG91ZC5vcGVuc2Vydmlj", + "ZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLlNvcnRlciK0AgoLU2VhcmNo", + "UXVlcnkSDgoGb2Zmc2V0GAEgASgFEg0KBWxpbWl0GAIgASgFEkgKBXF1ZXJ5", + "GAQgASgLMjkuY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3Jl", + "LmNvcmUucHJvdG9jb2wuUXVlcnkSTgoIY29sbGFwc2UYBSABKAsyPC5jb20u", + "YWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3RvcmUuY29yZS5wcm90b2Nv", + "bC5Db2xsYXBzZRJGCgRzb3J0GAYgASgLMjguY29tLmFsaWNsb3VkLm9wZW5z", + "ZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuU29ydBIVCg1nZXRU", + "b3RhbENvdW50GAggASgIEg0KBXRva2VuGAkgASgMIn8KDENvbHVtbnNUb0dl", + "dBJZCgtyZXR1cm5fdHlwZRgBIAEoDjJELmNvbS5hbGljbG91ZC5vcGVuc2Vy", + "dmljZXMudGFibGVzdG9yZS5jb3JlLnByb3RvY29sLkNvbHVtblJldHVyblR5", + "cGUSFAoMY29sdW1uX25hbWVzGAIgAygJIr8BCg1TZWFyY2hSZXF1ZXN0EhIK", + "CnRhYmxlX25hbWUYASABKAkSEgoKaW5kZXhfbmFtZRgCIAEoCRJYCg5jb2x1", + "bW5zX3RvX2dldBgDIAEoCzJALmNvbS5hbGljbG91ZC5vcGVuc2VydmljZXMu", + "dGFibGVzdG9yZS5jb3JlLnByb3RvY29sLkNvbHVtbnNUb0dldBIUCgxzZWFy", + "Y2hfcXVlcnkYBCABKAwSFgoOcm91dGluZ192YWx1ZXMYBSADKAwiYAoOU2Vh", + "cmNoUmVzcG9uc2USEgoKdG90YWxfaGl0cxgBIAEoAxIMCgRyb3dzGAIgAygM", + "EhgKEGlzX2FsbF9zdWNjZWVkZWQYAyABKAgSEgoKbmV4dF90b2tlbhgGIAEo", + "DCL7AgoLRmllbGRTY2hlbWESEgoKZmllbGRfbmFtZRgBIAEoCRJRCgpmaWVs", + "ZF90eXBlGAIgASgOMj0uY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJs", + "ZXN0b3JlLmNvcmUucHJvdG9jb2wuRmllbGRUeXBlElcKDWluZGV4X29wdGlv", + "bnMYAyABKA4yQC5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxlc3Rv", + "cmUuY29yZS5wcm90b2NvbC5JbmRleE9wdGlvbnMSEAoIYW5hbHl6ZXIYBCAB", + "KAkSDQoFaW5kZXgYBSABKAgSEgoKZG9jX3ZhbHVlcxgGIAEoCBINCgVzdG9y", + "ZRgHIAEoCBJWCg1maWVsZF9zY2hlbWFzGAggAygLMj8uY29tLmFsaWNsb3Vk", + "Lm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuRmllbGRT", + "Y2hlbWESEAoIaXNfYXJyYXkYCSABKAgijAIKC0luZGV4U2NoZW1hElYKDWZp", + "ZWxkX3NjaGVtYXMYASADKAsyPy5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2Vz", + "LnRhYmxlc3RvcmUuY29yZS5wcm90b2NvbC5GaWVsZFNjaGVtYRJXCg1pbmRl", + "eF9zZXR0aW5nGAIgASgLMkAuY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50", + "YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuSW5kZXhTZXR0aW5nEkwKCmluZGV4", + "X3NvcnQYAyABKAsyOC5jb20uYWxpY2xvdWQub3BlbnNlcnZpY2VzLnRhYmxl", + "c3RvcmUuY29yZS5wcm90b2NvbC5Tb3J0ImAKDEluZGV4U2V0dGluZxIYChBu", + "dW1iZXJfb2Zfc2hhcmRzGAEgASgFEhYKDnJvdXRpbmdfZmllbGRzGAIgAygJ", + "Eh4KFnJvdXRpbmdfcGFydGl0aW9uX3NpemUYAyABKAUikwEKGENyZWF0ZVNl", + "YXJjaEluZGV4UmVxdWVzdBISCgp0YWJsZV9uYW1lGAEgAigJEhIKCmluZGV4", + "X25hbWUYAiACKAkSTwoGc2NoZW1hGAMgASgLMj8uY29tLmFsaWNsb3VkLm9w", + "ZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuSW5kZXhTY2hl", + "bWEiGwoZQ3JlYXRlU2VhcmNoSW5kZXhSZXNwb25zZSIzCglJbmRleEluZm8S", + "EgoKdGFibGVfbmFtZRgBIAEoCRISCgppbmRleF9uYW1lGAIgASgJIiwKFkxp", + "c3RTZWFyY2hJbmRleFJlcXVlc3QSEgoKdGFibGVfbmFtZRgBIAEoCSJpChdM", + "aXN0U2VhcmNoSW5kZXhSZXNwb25zZRJOCgdpbmRpY2VzGAEgAygLMj0uY29t", + "LmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9j", + "b2wuSW5kZXhJbmZvIkIKGERlbGV0ZVNlYXJjaEluZGV4UmVxdWVzdBISCgp0", + "YWJsZV9uYW1lGAEgASgJEhIKCmluZGV4X25hbWUYAiABKAkiGwoZRGVsZXRl", + "U2VhcmNoSW5kZXhSZXNwb25zZSJ9CghTeW5jU3RhdBJRCgpzeW5jX3BoYXNl", + "GAEgASgOMj0uY29tLmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3Jl", + "LmNvcmUucHJvdG9jb2wuU3luY1BoYXNlEh4KFmN1cnJlbnRfc3luY190aW1l", + "c3RhbXAYAiABKAMiRAoaRGVzY3JpYmVTZWFyY2hJbmRleFJlcXVlc3QSEgoK", + "dGFibGVfbmFtZRgBIAEoCRISCgppbmRleF9uYW1lGAIgASgJIr8BChtEZXNj", + "cmliZVNlYXJjaEluZGV4UmVzcG9uc2USTwoGc2NoZW1hGAEgASgLMj8uY29t", + "LmFsaWNsb3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9j", + "b2wuSW5kZXhTY2hlbWESTwoJc3luY19zdGF0GAIgASgLMjwuY29tLmFsaWNs", + "b3VkLm9wZW5zZXJ2aWNlcy50YWJsZXN0b3JlLmNvcmUucHJvdG9jb2wuU3lu", + "Y1N0YXQqvwIKCVF1ZXJ5VHlwZRIPCgtNQVRDSF9RVUVSWRABEhYKEk1BVENI", + "X1BIUkFTRV9RVUVSWRACEg4KClRFUk1fUVVFUlkQAxIPCgtSQU5HRV9RVUVS", + "WRAEEhAKDFBSRUZJWF9RVUVSWRAFEg4KCkJPT0xfUVVFUlkQBhIVChFDT05T", + "VF9TQ09SRV9RVUVSWRAHEhgKFEZVTkNUSU9OX1NDT1JFX1FVRVJZEAgSEAoM", + "TkVTVEVEX1FVRVJZEAkSEgoOV0lMRENBUkRfUVVFUlkQChITCg9NQVRDSF9B", + "TExfUVVFUlkQCxIaChZHRU9fQk9VTkRJTkdfQk9YX1FVRVJZEAwSFgoSR0VP", + "X0RJU1RBTkNFX1FVRVJZEA0SFQoRR0VPX1BPTFlHT05fUVVFUlkQDhIPCgtU", + "RVJNU19RVUVSWRAPKiAKDVF1ZXJ5T3BlcmF0b3ISBgoCT1IQARIHCgNBTkQQ", + "AipyCglTY29yZU1vZGUSEwoPU0NPUkVfTU9ERV9OT05FEAESEgoOU0NPUkVf", + "TU9ERV9BVkcQAhISCg5TQ09SRV9NT0RFX01BWBADEhQKEFNDT1JFX01PREVf", + "VE9UQUwQBBISCg5TQ09SRV9NT0RFX01JThAFKjQKCVNvcnRPcmRlchISCg5T", + "T1JUX09SREVSX0FTQxAAEhMKD1NPUlRfT1JERVJfREVTQxABKkMKCFNvcnRN", + "b2RlEhEKDVNPUlRfTU9ERV9NSU4QABIRCg1TT1JUX01PREVfTUFYEAESEQoN", + "U09SVF9NT0RFX0FWRxACKj8KD0dlb0Rpc3RhbmNlVHlwZRIUChBHRU9fRElT", + "VEFOQ0VfQVJDEAASFgoSR0VPX0RJU1RBTkNFX1BMQU5FEAEqSQoQQ29sdW1u", + "UmV0dXJuVHlwZRIOCgpSRVRVUk5fQUxMEAESFAoQUkVUVVJOX1NQRUNJRklF", + "RBACEg8KC1JFVFVSTl9OT05FEAMqPwoMSW5kZXhPcHRpb25zEggKBERPQ1MQ", + "ARIJCgVGUkVRUxACEg0KCVBPU0lUSU9OUxADEgsKB09GRlNFVFMQBCpgCglG", + "aWVsZFR5cGUSCAoETE9ORxABEgoKBkRPVUJMRRACEgsKB0JPT0xFQU4QAxIL", + "CgdLRVlXT1JEEAQSCAoEVEVYVBAFEgoKBk5FU1RFRBAGEg0KCUdFT19QT0lO", + "VBAHKh8KCVN5bmNQaGFzZRIICgRGVUxMEAESCAoESU5DUhAC")); + pbd::FileDescriptor.InternalDescriptorAssigner assigner = delegate(pbd::FileDescriptor root) { + descriptor = root; + internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchQuery__Descriptor = Descriptor.MessageTypes[0]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchQuery__Descriptor, + new string[] { "FieldName", "Text", "MinimumShouldMatch", "Operator", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchPhraseQuery__Descriptor = Descriptor.MessageTypes[1]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchPhraseQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchPhraseQuery__Descriptor, + new string[] { "FieldName", "Text", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchAllQuery__Descriptor = Descriptor.MessageTypes[2]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchAllQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchAllQuery__Descriptor, + new string[] { }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_TermQuery__Descriptor = Descriptor.MessageTypes[3]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_TermQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_TermQuery__Descriptor, + new string[] { "FieldName", "Term", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_TermsQuery__Descriptor = Descriptor.MessageTypes[4]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_TermsQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_TermsQuery__Descriptor, + new string[] { "FieldName", "Terms", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_RangeQuery__Descriptor = Descriptor.MessageTypes[5]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_RangeQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_RangeQuery__Descriptor, + new string[] { "FieldName", "RangeFrom", "RangeTo", "IncludeLower", "IncludeUpper", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_PrefixQuery__Descriptor = Descriptor.MessageTypes[6]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_PrefixQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_PrefixQuery__Descriptor, + new string[] { "FieldName", "Prefix", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_WildcardQuery__Descriptor = Descriptor.MessageTypes[7]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_WildcardQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_WildcardQuery__Descriptor, + new string[] { "FieldName", "Value", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_BoolQuery__Descriptor = Descriptor.MessageTypes[8]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_BoolQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_BoolQuery__Descriptor, + new string[] { "MustQueries", "MustNotQueries", "FilterQueries", "ShouldQueries", "MinimumShouldMatch", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ConstScoreQuery__Descriptor = Descriptor.MessageTypes[9]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ConstScoreQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ConstScoreQuery__Descriptor, + new string[] { "Filter", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldValueFactor__Descriptor = Descriptor.MessageTypes[10]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldValueFactor__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldValueFactor__Descriptor, + new string[] { "FieldName", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_FunctionScoreQuery__Descriptor = Descriptor.MessageTypes[11]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_FunctionScoreQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_FunctionScoreQuery__Descriptor, + new string[] { "Query", "FieldValueFactor", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedQuery__Descriptor = Descriptor.MessageTypes[12]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedQuery__Descriptor, + new string[] { "Path", "Query", "ScoreMode", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoBoundingBoxQuery__Descriptor = Descriptor.MessageTypes[13]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoBoundingBoxQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoBoundingBoxQuery__Descriptor, + new string[] { "FieldName", "TopLeft", "BottomRight", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceQuery__Descriptor = Descriptor.MessageTypes[14]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceQuery__Descriptor, + new string[] { "FieldName", "CenterPoint", "Distance", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoPolygonQuery__Descriptor = Descriptor.MessageTypes[15]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoPolygonQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoPolygonQuery__Descriptor, + new string[] { "FieldName", "Points", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_Query__Descriptor = Descriptor.MessageTypes[16]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_Query__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_Query__Descriptor, + new string[] { "Type", "Query_", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_Collapse__Descriptor = Descriptor.MessageTypes[17]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_Collapse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_Collapse__Descriptor, + new string[] { "FieldName", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedFilter__Descriptor = Descriptor.MessageTypes[18]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedFilter__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedFilter__Descriptor, + new string[] { "Path", "Filter", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ScoreSort__Descriptor = Descriptor.MessageTypes[19]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ScoreSort__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ScoreSort__Descriptor, + new string[] { "Order", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySort__Descriptor = Descriptor.MessageTypes[20]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySort__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySort__Descriptor, + new string[] { "Order", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSort__Descriptor = Descriptor.MessageTypes[21]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSort__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSort__Descriptor, + new string[] { "FieldName", "Order", "Mode", "NestedFilter", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceSort__Descriptor = Descriptor.MessageTypes[22]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceSort__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceSort__Descriptor, + new string[] { "FieldName", "Points", "Order", "Mode", "DistanceType", "NestedFilter", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_Sorter__Descriptor = Descriptor.MessageTypes[23]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_Sorter__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_Sorter__Descriptor, + new string[] { "FieldSort", "GeoDistanceSort", "ScoreSort", "PkSort", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_Sort__Descriptor = Descriptor.MessageTypes[24]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_Sort__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_Sort__Descriptor, + new string[] { "Sorter", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchQuery__Descriptor = Descriptor.MessageTypes[25]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchQuery__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchQuery__Descriptor, + new string[] { "Offset", "Limit", "Query", "Collapse", "Sort", "GetTotalCount", "Token", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnsToGet__Descriptor = Descriptor.MessageTypes[26]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnsToGet__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnsToGet__Descriptor, + new string[] { "ReturnType", "ColumnNames", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchRequest__Descriptor = Descriptor.MessageTypes[27]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchRequest__Descriptor, + new string[] { "TableName", "IndexName", "ColumnsToGet", "SearchQuery", "RoutingValues", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchResponse__Descriptor = Descriptor.MessageTypes[28]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchResponse__Descriptor, + new string[] { "TotalHits", "Rows", "IsAllSucceeded", "NextToken", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSchema__Descriptor = Descriptor.MessageTypes[29]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSchema__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSchema__Descriptor, + new string[] { "FieldName", "FieldType", "IndexOptions", "Analyzer", "Index", "DocValues", "Store", "FieldSchemas", "IsArray", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSchema__Descriptor = Descriptor.MessageTypes[30]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSchema__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSchema__Descriptor, + new string[] { "FieldSchemas", "IndexSetting", "IndexSort", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSetting__Descriptor = Descriptor.MessageTypes[31]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSetting__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSetting__Descriptor, + new string[] { "NumberOfShards", "RoutingFields", "RoutingPartitionSize", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexRequest__Descriptor = Descriptor.MessageTypes[32]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexRequest__Descriptor, + new string[] { "TableName", "IndexName", "Schema", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexResponse__Descriptor = Descriptor.MessageTypes[33]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexResponse__Descriptor, + new string[] { }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexInfo__Descriptor = Descriptor.MessageTypes[34]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexInfo__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexInfo__Descriptor, + new string[] { "TableName", "IndexName", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexRequest__Descriptor = Descriptor.MessageTypes[35]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexRequest__Descriptor, + new string[] { "TableName", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexResponse__Descriptor = Descriptor.MessageTypes[36]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexResponse__Descriptor, + new string[] { "Indices", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexRequest__Descriptor = Descriptor.MessageTypes[37]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexRequest__Descriptor, + new string[] { "TableName", "IndexName", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexResponse__Descriptor = Descriptor.MessageTypes[38]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexResponse__Descriptor, + new string[] { }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_SyncStat__Descriptor = Descriptor.MessageTypes[39]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_SyncStat__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_SyncStat__Descriptor, + new string[] { "SyncPhase", "CurrentSyncTimestamp", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexRequest__Descriptor = Descriptor.MessageTypes[40]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexRequest__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexRequest__Descriptor, + new string[] { "TableName", "IndexName", }); + internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexResponse__Descriptor = Descriptor.MessageTypes[41]; + internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexResponse__FieldAccessorTable = + new pb::FieldAccess.FieldAccessorTable(internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexResponse__Descriptor, + new string[] { "Schema", "SyncStat", }); + return null; + }; + pbd::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, + new pbd::FileDescriptor[] { + }, assigner); + } + #endregion + + } + #region Enums + public enum QueryType { + MATCH_QUERY = 1, + MATCH_PHRASE_QUERY = 2, + TERM_QUERY = 3, + RANGE_QUERY = 4, + PREFIX_QUERY = 5, + BOOL_QUERY = 6, + CONST_SCORE_QUERY = 7, + FUNCTION_SCORE_QUERY = 8, + NESTED_QUERY = 9, + WILDCARD_QUERY = 10, + MATCH_ALL_QUERY = 11, + GEO_BOUNDING_BOX_QUERY = 12, + GEO_DISTANCE_QUERY = 13, + GEO_POLYGON_QUERY = 14, + TERMS_QUERY = 15, + } + + public enum QueryOperator { + OR = 1, + AND = 2, + } + + public enum ScoreMode { + SCORE_MODE_NONE = 1, + SCORE_MODE_AVG = 2, + SCORE_MODE_MAX = 3, + SCORE_MODE_TOTAL = 4, + SCORE_MODE_MIN = 5, + } + + public enum SortOrder { + SORT_ORDER_ASC = 0, + SORT_ORDER_DESC = 1, + } + + public enum SortMode { + SORT_MODE_MIN = 0, + SORT_MODE_MAX = 1, + SORT_MODE_AVG = 2, + } + + public enum GeoDistanceType { + GEO_DISTANCE_ARC = 0, + GEO_DISTANCE_PLANE = 1, + } + + public enum ColumnReturnType { + RETURN_ALL = 1, + RETURN_SPECIFIED = 2, + RETURN_NONE = 3, + } + + public enum IndexOptions { + DOCS = 1, + FREQS = 2, + POSITIONS = 3, + OFFSETS = 4, + } + + public enum FieldType { + LONG = 1, + DOUBLE = 2, + BOOLEAN = 3, + KEYWORD = 4, + TEXT = 5, + NESTED = 6, + GEO_POINT = 7, + } + + public enum SyncPhase { + FULL = 1, + INCR = 2, + } + + #endregion + + #region Messages + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class MatchQuery : pb::GeneratedMessage { + private MatchQuery() { } + private static readonly MatchQuery defaultInstance = new MatchQuery().MakeReadOnly(); + private static readonly string[] _matchQueryFieldNames = new string[] { "field_name", "minimum_should_match", "operator", "text" }; + private static readonly uint[] _matchQueryFieldTags = new uint[] { 10, 24, 32, 18 }; + public static MatchQuery DefaultInstance { + get { return defaultInstance; } + } + + public override MatchQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override MatchQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchQuery__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public const int TextFieldNumber = 2; + private bool hasText; + private string text_ = ""; + public bool HasText { + get { return hasText; } + } + public string Text { + get { return text_; } + } + + public const int MinimumShouldMatchFieldNumber = 3; + private bool hasMinimumShouldMatch; + private int minimumShouldMatch_; + public bool HasMinimumShouldMatch { + get { return hasMinimumShouldMatch; } + } + public int MinimumShouldMatch { + get { return minimumShouldMatch_; } + } + + public const int OperatorFieldNumber = 4; + private bool hasOperator; + private global::com.alicloud.openservices.tablestore.core.protocol.QueryOperator operator_ = global::com.alicloud.openservices.tablestore.core.protocol.QueryOperator.OR; + public bool HasOperator { + get { return hasOperator; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.QueryOperator Operator { + get { return operator_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _matchQueryFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[0], FieldName); + } + if (hasText) { + output.WriteString(2, field_names[3], Text); + } + if (hasMinimumShouldMatch) { + output.WriteInt32(3, field_names[1], MinimumShouldMatch); + } + if (hasOperator) { + output.WriteEnum(4, field_names[2], (int) Operator, Operator); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + if (hasText) { + size += pb::CodedOutputStream.ComputeStringSize(2, Text); + } + if (hasMinimumShouldMatch) { + size += pb::CodedOutputStream.ComputeInt32Size(3, MinimumShouldMatch); + } + if (hasOperator) { + size += pb::CodedOutputStream.ComputeEnumSize(4, (int) Operator); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static MatchQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MatchQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MatchQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MatchQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MatchQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MatchQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static MatchQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static MatchQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static MatchQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MatchQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private MatchQuery MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(MatchQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(MatchQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private MatchQuery result; + + private MatchQuery PrepareBuilder() { + if (resultIsReadOnly) { + MatchQuery original = result; + result = new MatchQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override MatchQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.MatchQuery.Descriptor; } + } + + public override MatchQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.MatchQuery.DefaultInstance; } + } + + public override MatchQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is MatchQuery) { + return MergeFrom((MatchQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(MatchQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.MatchQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + if (other.HasText) { + Text = other.Text; + } + if (other.HasMinimumShouldMatch) { + MinimumShouldMatch = other.MinimumShouldMatch; + } + if (other.HasOperator) { + Operator = other.Operator; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_matchQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _matchQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + case 18: { + result.hasText = input.ReadString(ref result.text_); + break; + } + case 24: { + result.hasMinimumShouldMatch = input.ReadInt32(ref result.minimumShouldMatch_); + break; + } + case 32: { + object unknown; + if(input.ReadEnum(ref result.operator_, out unknown)) { + result.hasOperator = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(4, (ulong)(int)unknown); + } + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + + public bool HasText { + get { return result.hasText; } + } + public string Text { + get { return result.Text; } + set { SetText(value); } + } + public Builder SetText(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasText = true; + result.text_ = value; + return this; + } + public Builder ClearText() { + PrepareBuilder(); + result.hasText = false; + result.text_ = ""; + return this; + } + + public bool HasMinimumShouldMatch { + get { return result.hasMinimumShouldMatch; } + } + public int MinimumShouldMatch { + get { return result.MinimumShouldMatch; } + set { SetMinimumShouldMatch(value); } + } + public Builder SetMinimumShouldMatch(int value) { + PrepareBuilder(); + result.hasMinimumShouldMatch = true; + result.minimumShouldMatch_ = value; + return this; + } + public Builder ClearMinimumShouldMatch() { + PrepareBuilder(); + result.hasMinimumShouldMatch = false; + result.minimumShouldMatch_ = 0; + return this; + } + + public bool HasOperator { + get { return result.hasOperator; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.QueryOperator Operator { + get { return result.Operator; } + set { SetOperator(value); } + } + public Builder SetOperator(global::com.alicloud.openservices.tablestore.core.protocol.QueryOperator value) { + PrepareBuilder(); + result.hasOperator = true; + result.operator_ = value; + return this; + } + public Builder ClearOperator() { + PrepareBuilder(); + result.hasOperator = false; + result.operator_ = global::com.alicloud.openservices.tablestore.core.protocol.QueryOperator.OR; + return this; + } + } + static MatchQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class MatchPhraseQuery : pb::GeneratedMessage { + private MatchPhraseQuery() { } + private static readonly MatchPhraseQuery defaultInstance = new MatchPhraseQuery().MakeReadOnly(); + private static readonly string[] _matchPhraseQueryFieldNames = new string[] { "field_name", "text" }; + private static readonly uint[] _matchPhraseQueryFieldTags = new uint[] { 10, 18 }; + public static MatchPhraseQuery DefaultInstance { + get { return defaultInstance; } + } + + public override MatchPhraseQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override MatchPhraseQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchPhraseQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchPhraseQuery__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public const int TextFieldNumber = 2; + private bool hasText; + private string text_ = ""; + public bool HasText { + get { return hasText; } + } + public string Text { + get { return text_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _matchPhraseQueryFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[0], FieldName); + } + if (hasText) { + output.WriteString(2, field_names[1], Text); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + if (hasText) { + size += pb::CodedOutputStream.ComputeStringSize(2, Text); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static MatchPhraseQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MatchPhraseQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MatchPhraseQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MatchPhraseQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MatchPhraseQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MatchPhraseQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static MatchPhraseQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static MatchPhraseQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static MatchPhraseQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MatchPhraseQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private MatchPhraseQuery MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(MatchPhraseQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(MatchPhraseQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private MatchPhraseQuery result; + + private MatchPhraseQuery PrepareBuilder() { + if (resultIsReadOnly) { + MatchPhraseQuery original = result; + result = new MatchPhraseQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override MatchPhraseQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.MatchPhraseQuery.Descriptor; } + } + + public override MatchPhraseQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.MatchPhraseQuery.DefaultInstance; } + } + + public override MatchPhraseQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is MatchPhraseQuery) { + return MergeFrom((MatchPhraseQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(MatchPhraseQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.MatchPhraseQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + if (other.HasText) { + Text = other.Text; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_matchPhraseQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _matchPhraseQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + case 18: { + result.hasText = input.ReadString(ref result.text_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + + public bool HasText { + get { return result.hasText; } + } + public string Text { + get { return result.Text; } + set { SetText(value); } + } + public Builder SetText(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasText = true; + result.text_ = value; + return this; + } + public Builder ClearText() { + PrepareBuilder(); + result.hasText = false; + result.text_ = ""; + return this; + } + } + static MatchPhraseQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class MatchAllQuery : pb::GeneratedMessage { + private MatchAllQuery() { } + private static readonly MatchAllQuery defaultInstance = new MatchAllQuery().MakeReadOnly(); + private static readonly string[] _matchAllQueryFieldNames = new string[] { }; + private static readonly uint[] _matchAllQueryFieldTags = new uint[] { }; + public static MatchAllQuery DefaultInstance { + get { return defaultInstance; } + } + + public override MatchAllQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override MatchAllQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchAllQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_MatchAllQuery__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _matchAllQueryFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static MatchAllQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MatchAllQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MatchAllQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static MatchAllQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static MatchAllQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MatchAllQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static MatchAllQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static MatchAllQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static MatchAllQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static MatchAllQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private MatchAllQuery MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(MatchAllQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(MatchAllQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private MatchAllQuery result; + + private MatchAllQuery PrepareBuilder() { + if (resultIsReadOnly) { + MatchAllQuery original = result; + result = new MatchAllQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override MatchAllQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.MatchAllQuery.Descriptor; } + } + + public override MatchAllQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.MatchAllQuery.DefaultInstance; } + } + + public override MatchAllQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is MatchAllQuery) { + return MergeFrom((MatchAllQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(MatchAllQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.MatchAllQuery.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_matchAllQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _matchAllQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static MatchAllQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TermQuery : pb::GeneratedMessage { + private TermQuery() { } + private static readonly TermQuery defaultInstance = new TermQuery().MakeReadOnly(); + private static readonly string[] _termQueryFieldNames = new string[] { "field_name", "term" }; + private static readonly uint[] _termQueryFieldTags = new uint[] { 10, 18 }; + public static TermQuery DefaultInstance { + get { return defaultInstance; } + } + + public override TermQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TermQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_TermQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_TermQuery__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public const int TermFieldNumber = 2; + private bool hasTerm; + private pb::ByteString term_ = pb::ByteString.Empty; + public bool HasTerm { + get { return hasTerm; } + } + public pb::ByteString Term { + get { return term_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _termQueryFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[0], FieldName); + } + if (hasTerm) { + output.WriteBytes(2, field_names[1], Term); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + if (hasTerm) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Term); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TermQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TermQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TermQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TermQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TermQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TermQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TermQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TermQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TermQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TermQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TermQuery MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TermQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TermQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TermQuery result; + + private TermQuery PrepareBuilder() { + if (resultIsReadOnly) { + TermQuery original = result; + result = new TermQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TermQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TermQuery.Descriptor; } + } + + public override TermQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TermQuery.DefaultInstance; } + } + + public override TermQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TermQuery) { + return MergeFrom((TermQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TermQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.TermQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + if (other.HasTerm) { + Term = other.Term; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_termQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _termQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + case 18: { + result.hasTerm = input.ReadBytes(ref result.term_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + + public bool HasTerm { + get { return result.hasTerm; } + } + public pb::ByteString Term { + get { return result.Term; } + set { SetTerm(value); } + } + public Builder SetTerm(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTerm = true; + result.term_ = value; + return this; + } + public Builder ClearTerm() { + PrepareBuilder(); + result.hasTerm = false; + result.term_ = pb::ByteString.Empty; + return this; + } + } + static TermQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class TermsQuery : pb::GeneratedMessage { + private TermsQuery() { } + private static readonly TermsQuery defaultInstance = new TermsQuery().MakeReadOnly(); + private static readonly string[] _termsQueryFieldNames = new string[] { "field_name", "terms" }; + private static readonly uint[] _termsQueryFieldTags = new uint[] { 10, 18 }; + public static TermsQuery DefaultInstance { + get { return defaultInstance; } + } + + public override TermsQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override TermsQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_TermsQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_TermsQuery__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public const int TermsFieldNumber = 2; + private pbc::PopsicleList terms_ = new pbc::PopsicleList(); + public scg::IList TermsList { + get { return pbc::Lists.AsReadOnly(terms_); } + } + public int TermsCount { + get { return terms_.Count; } + } + public pb::ByteString GetTerms(int index) { + return terms_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _termsQueryFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[0], FieldName); + } + if (terms_.Count > 0) { + output.WriteBytesArray(2, field_names[1], terms_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + { + int dataSize = 0; + foreach (pb::ByteString element in TermsList) { + dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); + } + size += dataSize; + size += 1 * terms_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static TermsQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TermsQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TermsQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static TermsQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static TermsQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TermsQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static TermsQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static TermsQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static TermsQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static TermsQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private TermsQuery MakeReadOnly() { + terms_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(TermsQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(TermsQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private TermsQuery result; + + private TermsQuery PrepareBuilder() { + if (resultIsReadOnly) { + TermsQuery original = result; + result = new TermsQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override TermsQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TermsQuery.Descriptor; } + } + + public override TermsQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TermsQuery.DefaultInstance; } + } + + public override TermsQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is TermsQuery) { + return MergeFrom((TermsQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(TermsQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.TermsQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + if (other.terms_.Count != 0) { + result.terms_.Add(other.terms_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_termsQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _termsQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + case 18: { + input.ReadBytesArray(tag, field_name, result.terms_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + + public pbc::IPopsicleList TermsList { + get { return PrepareBuilder().terms_; } + } + public int TermsCount { + get { return result.TermsCount; } + } + public pb::ByteString GetTerms(int index) { + return result.GetTerms(index); + } + public Builder SetTerms(int index, pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.terms_[index] = value; + return this; + } + public Builder AddTerms(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.terms_.Add(value); + return this; + } + public Builder AddRangeTerms(scg::IEnumerable values) { + PrepareBuilder(); + result.terms_.Add(values); + return this; + } + public Builder ClearTerms() { + PrepareBuilder(); + result.terms_.Clear(); + return this; + } + } + static TermsQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class RangeQuery : pb::GeneratedMessage { + private RangeQuery() { } + private static readonly RangeQuery defaultInstance = new RangeQuery().MakeReadOnly(); + private static readonly string[] _rangeQueryFieldNames = new string[] { "field_name", "include_lower", "include_upper", "range_from", "range_to" }; + private static readonly uint[] _rangeQueryFieldTags = new uint[] { 10, 32, 40, 18, 26 }; + public static RangeQuery DefaultInstance { + get { return defaultInstance; } + } + + public override RangeQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override RangeQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_RangeQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_RangeQuery__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public const int RangeFromFieldNumber = 2; + private bool hasRangeFrom; + private pb::ByteString rangeFrom_ = pb::ByteString.Empty; + public bool HasRangeFrom { + get { return hasRangeFrom; } + } + public pb::ByteString RangeFrom { + get { return rangeFrom_; } + } + + public const int RangeToFieldNumber = 3; + private bool hasRangeTo; + private pb::ByteString rangeTo_ = pb::ByteString.Empty; + public bool HasRangeTo { + get { return hasRangeTo; } + } + public pb::ByteString RangeTo { + get { return rangeTo_; } + } + + public const int IncludeLowerFieldNumber = 4; + private bool hasIncludeLower; + private bool includeLower_; + public bool HasIncludeLower { + get { return hasIncludeLower; } + } + public bool IncludeLower { + get { return includeLower_; } + } + + public const int IncludeUpperFieldNumber = 5; + private bool hasIncludeUpper; + private bool includeUpper_; + public bool HasIncludeUpper { + get { return hasIncludeUpper; } + } + public bool IncludeUpper { + get { return includeUpper_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _rangeQueryFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[0], FieldName); + } + if (hasRangeFrom) { + output.WriteBytes(2, field_names[3], RangeFrom); + } + if (hasRangeTo) { + output.WriteBytes(3, field_names[4], RangeTo); + } + if (hasIncludeLower) { + output.WriteBool(4, field_names[1], IncludeLower); + } + if (hasIncludeUpper) { + output.WriteBool(5, field_names[2], IncludeUpper); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + if (hasRangeFrom) { + size += pb::CodedOutputStream.ComputeBytesSize(2, RangeFrom); + } + if (hasRangeTo) { + size += pb::CodedOutputStream.ComputeBytesSize(3, RangeTo); + } + if (hasIncludeLower) { + size += pb::CodedOutputStream.ComputeBoolSize(4, IncludeLower); + } + if (hasIncludeUpper) { + size += pb::CodedOutputStream.ComputeBoolSize(5, IncludeUpper); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static RangeQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RangeQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RangeQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static RangeQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static RangeQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RangeQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static RangeQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static RangeQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static RangeQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static RangeQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private RangeQuery MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(RangeQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(RangeQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private RangeQuery result; + + private RangeQuery PrepareBuilder() { + if (resultIsReadOnly) { + RangeQuery original = result; + result = new RangeQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override RangeQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.RangeQuery.Descriptor; } + } + + public override RangeQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.RangeQuery.DefaultInstance; } + } + + public override RangeQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is RangeQuery) { + return MergeFrom((RangeQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(RangeQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.RangeQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + if (other.HasRangeFrom) { + RangeFrom = other.RangeFrom; + } + if (other.HasRangeTo) { + RangeTo = other.RangeTo; + } + if (other.HasIncludeLower) { + IncludeLower = other.IncludeLower; + } + if (other.HasIncludeUpper) { + IncludeUpper = other.IncludeUpper; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_rangeQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _rangeQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + case 18: { + result.hasRangeFrom = input.ReadBytes(ref result.rangeFrom_); + break; + } + case 26: { + result.hasRangeTo = input.ReadBytes(ref result.rangeTo_); + break; + } + case 32: { + result.hasIncludeLower = input.ReadBool(ref result.includeLower_); + break; + } + case 40: { + result.hasIncludeUpper = input.ReadBool(ref result.includeUpper_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + + public bool HasRangeFrom { + get { return result.hasRangeFrom; } + } + public pb::ByteString RangeFrom { + get { return result.RangeFrom; } + set { SetRangeFrom(value); } + } + public Builder SetRangeFrom(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRangeFrom = true; + result.rangeFrom_ = value; + return this; + } + public Builder ClearRangeFrom() { + PrepareBuilder(); + result.hasRangeFrom = false; + result.rangeFrom_ = pb::ByteString.Empty; + return this; + } + + public bool HasRangeTo { + get { return result.hasRangeTo; } + } + public pb::ByteString RangeTo { + get { return result.RangeTo; } + set { SetRangeTo(value); } + } + public Builder SetRangeTo(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasRangeTo = true; + result.rangeTo_ = value; + return this; + } + public Builder ClearRangeTo() { + PrepareBuilder(); + result.hasRangeTo = false; + result.rangeTo_ = pb::ByteString.Empty; + return this; + } + + public bool HasIncludeLower { + get { return result.hasIncludeLower; } + } + public bool IncludeLower { + get { return result.IncludeLower; } + set { SetIncludeLower(value); } + } + public Builder SetIncludeLower(bool value) { + PrepareBuilder(); + result.hasIncludeLower = true; + result.includeLower_ = value; + return this; + } + public Builder ClearIncludeLower() { + PrepareBuilder(); + result.hasIncludeLower = false; + result.includeLower_ = false; + return this; + } + + public bool HasIncludeUpper { + get { return result.hasIncludeUpper; } + } + public bool IncludeUpper { + get { return result.IncludeUpper; } + set { SetIncludeUpper(value); } + } + public Builder SetIncludeUpper(bool value) { + PrepareBuilder(); + result.hasIncludeUpper = true; + result.includeUpper_ = value; + return this; + } + public Builder ClearIncludeUpper() { + PrepareBuilder(); + result.hasIncludeUpper = false; + result.includeUpper_ = false; + return this; + } + } + static RangeQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class PrefixQuery : pb::GeneratedMessage { + private PrefixQuery() { } + private static readonly PrefixQuery defaultInstance = new PrefixQuery().MakeReadOnly(); + private static readonly string[] _prefixQueryFieldNames = new string[] { "field_name", "prefix" }; + private static readonly uint[] _prefixQueryFieldTags = new uint[] { 10, 18 }; + public static PrefixQuery DefaultInstance { + get { return defaultInstance; } + } + + public override PrefixQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PrefixQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_PrefixQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_PrefixQuery__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public const int PrefixFieldNumber = 2; + private bool hasPrefix; + private string prefix_ = ""; + public bool HasPrefix { + get { return hasPrefix; } + } + public string Prefix { + get { return prefix_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _prefixQueryFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[0], FieldName); + } + if (hasPrefix) { + output.WriteString(2, field_names[1], Prefix); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + if (hasPrefix) { + size += pb::CodedOutputStream.ComputeStringSize(2, Prefix); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static PrefixQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PrefixQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PrefixQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PrefixQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PrefixQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PrefixQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PrefixQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PrefixQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PrefixQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PrefixQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PrefixQuery MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PrefixQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PrefixQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PrefixQuery result; + + private PrefixQuery PrepareBuilder() { + if (resultIsReadOnly) { + PrefixQuery original = result; + result = new PrefixQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PrefixQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.PrefixQuery.Descriptor; } + } + + public override PrefixQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.PrefixQuery.DefaultInstance; } + } + + public override PrefixQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PrefixQuery) { + return MergeFrom((PrefixQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PrefixQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.PrefixQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + if (other.HasPrefix) { + Prefix = other.Prefix; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_prefixQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _prefixQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + case 18: { + result.hasPrefix = input.ReadString(ref result.prefix_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + + public bool HasPrefix { + get { return result.hasPrefix; } + } + public string Prefix { + get { return result.Prefix; } + set { SetPrefix(value); } + } + public Builder SetPrefix(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPrefix = true; + result.prefix_ = value; + return this; + } + public Builder ClearPrefix() { + PrepareBuilder(); + result.hasPrefix = false; + result.prefix_ = ""; + return this; + } + } + static PrefixQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class WildcardQuery : pb::GeneratedMessage { + private WildcardQuery() { } + private static readonly WildcardQuery defaultInstance = new WildcardQuery().MakeReadOnly(); + private static readonly string[] _wildcardQueryFieldNames = new string[] { "field_name", "value" }; + private static readonly uint[] _wildcardQueryFieldTags = new uint[] { 10, 18 }; + public static WildcardQuery DefaultInstance { + get { return defaultInstance; } + } + + public override WildcardQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override WildcardQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_WildcardQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_WildcardQuery__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public const int ValueFieldNumber = 2; + private bool hasValue; + private string value_ = ""; + public bool HasValue { + get { return hasValue; } + } + public string Value { + get { return value_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _wildcardQueryFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[0], FieldName); + } + if (hasValue) { + output.WriteString(2, field_names[1], Value); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + if (hasValue) { + size += pb::CodedOutputStream.ComputeStringSize(2, Value); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static WildcardQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static WildcardQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static WildcardQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static WildcardQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static WildcardQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static WildcardQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static WildcardQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static WildcardQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static WildcardQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static WildcardQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private WildcardQuery MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(WildcardQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(WildcardQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private WildcardQuery result; + + private WildcardQuery PrepareBuilder() { + if (resultIsReadOnly) { + WildcardQuery original = result; + result = new WildcardQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override WildcardQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.WildcardQuery.Descriptor; } + } + + public override WildcardQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.WildcardQuery.DefaultInstance; } + } + + public override WildcardQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is WildcardQuery) { + return MergeFrom((WildcardQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(WildcardQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.WildcardQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + if (other.HasValue) { + Value = other.Value; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_wildcardQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _wildcardQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + case 18: { + result.hasValue = input.ReadString(ref result.value_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + + public bool HasValue { + get { return result.hasValue; } + } + public string Value { + get { return result.Value; } + set { SetValue(value); } + } + public Builder SetValue(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasValue = true; + result.value_ = value; + return this; + } + public Builder ClearValue() { + PrepareBuilder(); + result.hasValue = false; + result.value_ = ""; + return this; + } + } + static WildcardQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class BoolQuery : pb::GeneratedMessage { + private BoolQuery() { } + private static readonly BoolQuery defaultInstance = new BoolQuery().MakeReadOnly(); + private static readonly string[] _boolQueryFieldNames = new string[] { "filter_queries", "minimum_should_match", "must_not_queries", "must_queries", "should_queries" }; + private static readonly uint[] _boolQueryFieldTags = new uint[] { 26, 40, 18, 10, 34 }; + public static BoolQuery DefaultInstance { + get { return defaultInstance; } + } + + public override BoolQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override BoolQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_BoolQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_BoolQuery__FieldAccessorTable; } + } + + public const int MustQueriesFieldNumber = 1; + private pbc::PopsicleList mustQueries_ = new pbc::PopsicleList(); + public scg::IList MustQueriesList { + get { return mustQueries_; } + } + public int MustQueriesCount { + get { return mustQueries_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query GetMustQueries(int index) { + return mustQueries_[index]; + } + + public const int MustNotQueriesFieldNumber = 2; + private pbc::PopsicleList mustNotQueries_ = new pbc::PopsicleList(); + public scg::IList MustNotQueriesList { + get { return mustNotQueries_; } + } + public int MustNotQueriesCount { + get { return mustNotQueries_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query GetMustNotQueries(int index) { + return mustNotQueries_[index]; + } + + public const int FilterQueriesFieldNumber = 3; + private pbc::PopsicleList filterQueries_ = new pbc::PopsicleList(); + public scg::IList FilterQueriesList { + get { return filterQueries_; } + } + public int FilterQueriesCount { + get { return filterQueries_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query GetFilterQueries(int index) { + return filterQueries_[index]; + } + + public const int ShouldQueriesFieldNumber = 4; + private pbc::PopsicleList shouldQueries_ = new pbc::PopsicleList(); + public scg::IList ShouldQueriesList { + get { return shouldQueries_; } + } + public int ShouldQueriesCount { + get { return shouldQueries_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query GetShouldQueries(int index) { + return shouldQueries_[index]; + } + + public const int MinimumShouldMatchFieldNumber = 5; + private bool hasMinimumShouldMatch; + private int minimumShouldMatch_; + public bool HasMinimumShouldMatch { + get { return hasMinimumShouldMatch; } + } + public int MinimumShouldMatch { + get { return minimumShouldMatch_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _boolQueryFieldNames; + if (mustQueries_.Count > 0) { + output.WriteMessageArray(1, field_names[3], mustQueries_); + } + if (mustNotQueries_.Count > 0) { + output.WriteMessageArray(2, field_names[2], mustNotQueries_); + } + if (filterQueries_.Count > 0) { + output.WriteMessageArray(3, field_names[0], filterQueries_); + } + if (shouldQueries_.Count > 0) { + output.WriteMessageArray(4, field_names[4], shouldQueries_); + } + if (hasMinimumShouldMatch) { + output.WriteInt32(5, field_names[1], MinimumShouldMatch); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.Query element in MustQueriesList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.Query element in MustNotQueriesList) { + size += pb::CodedOutputStream.ComputeMessageSize(2, element); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.Query element in FilterQueriesList) { + size += pb::CodedOutputStream.ComputeMessageSize(3, element); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.Query element in ShouldQueriesList) { + size += pb::CodedOutputStream.ComputeMessageSize(4, element); + } + if (hasMinimumShouldMatch) { + size += pb::CodedOutputStream.ComputeInt32Size(5, MinimumShouldMatch); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static BoolQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BoolQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BoolQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static BoolQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static BoolQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BoolQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static BoolQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static BoolQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static BoolQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static BoolQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private BoolQuery MakeReadOnly() { + mustQueries_.MakeReadOnly(); + mustNotQueries_.MakeReadOnly(); + filterQueries_.MakeReadOnly(); + shouldQueries_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(BoolQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(BoolQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private BoolQuery result; + + private BoolQuery PrepareBuilder() { + if (resultIsReadOnly) { + BoolQuery original = result; + result = new BoolQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override BoolQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.BoolQuery.Descriptor; } + } + + public override BoolQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.BoolQuery.DefaultInstance; } + } + + public override BoolQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is BoolQuery) { + return MergeFrom((BoolQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(BoolQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.BoolQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.mustQueries_.Count != 0) { + result.mustQueries_.Add(other.mustQueries_); + } + if (other.mustNotQueries_.Count != 0) { + result.mustNotQueries_.Add(other.mustNotQueries_); + } + if (other.filterQueries_.Count != 0) { + result.filterQueries_.Add(other.filterQueries_); + } + if (other.shouldQueries_.Count != 0) { + result.shouldQueries_.Add(other.shouldQueries_); + } + if (other.HasMinimumShouldMatch) { + MinimumShouldMatch = other.MinimumShouldMatch; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_boolQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _boolQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.mustQueries_, global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance, extensionRegistry); + break; + } + case 18: { + input.ReadMessageArray(tag, field_name, result.mustNotQueries_, global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance, extensionRegistry); + break; + } + case 26: { + input.ReadMessageArray(tag, field_name, result.filterQueries_, global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance, extensionRegistry); + break; + } + case 34: { + input.ReadMessageArray(tag, field_name, result.shouldQueries_, global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance, extensionRegistry); + break; + } + case 40: { + result.hasMinimumShouldMatch = input.ReadInt32(ref result.minimumShouldMatch_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList MustQueriesList { + get { return PrepareBuilder().mustQueries_; } + } + public int MustQueriesCount { + get { return result.MustQueriesCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query GetMustQueries(int index) { + return result.GetMustQueries(index); + } + public Builder SetMustQueries(int index, global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.mustQueries_[index] = value; + return this; + } + public Builder SetMustQueries(int index, global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.mustQueries_[index] = builderForValue.Build(); + return this; + } + public Builder AddMustQueries(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.mustQueries_.Add(value); + return this; + } + public Builder AddMustQueries(global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.mustQueries_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeMustQueries(scg::IEnumerable values) { + PrepareBuilder(); + result.mustQueries_.Add(values); + return this; + } + public Builder ClearMustQueries() { + PrepareBuilder(); + result.mustQueries_.Clear(); + return this; + } + + public pbc::IPopsicleList MustNotQueriesList { + get { return PrepareBuilder().mustNotQueries_; } + } + public int MustNotQueriesCount { + get { return result.MustNotQueriesCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query GetMustNotQueries(int index) { + return result.GetMustNotQueries(index); + } + public Builder SetMustNotQueries(int index, global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.mustNotQueries_[index] = value; + return this; + } + public Builder SetMustNotQueries(int index, global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.mustNotQueries_[index] = builderForValue.Build(); + return this; + } + public Builder AddMustNotQueries(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.mustNotQueries_.Add(value); + return this; + } + public Builder AddMustNotQueries(global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.mustNotQueries_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeMustNotQueries(scg::IEnumerable values) { + PrepareBuilder(); + result.mustNotQueries_.Add(values); + return this; + } + public Builder ClearMustNotQueries() { + PrepareBuilder(); + result.mustNotQueries_.Clear(); + return this; + } + + public pbc::IPopsicleList FilterQueriesList { + get { return PrepareBuilder().filterQueries_; } + } + public int FilterQueriesCount { + get { return result.FilterQueriesCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query GetFilterQueries(int index) { + return result.GetFilterQueries(index); + } + public Builder SetFilterQueries(int index, global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.filterQueries_[index] = value; + return this; + } + public Builder SetFilterQueries(int index, global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.filterQueries_[index] = builderForValue.Build(); + return this; + } + public Builder AddFilterQueries(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.filterQueries_.Add(value); + return this; + } + public Builder AddFilterQueries(global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.filterQueries_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeFilterQueries(scg::IEnumerable values) { + PrepareBuilder(); + result.filterQueries_.Add(values); + return this; + } + public Builder ClearFilterQueries() { + PrepareBuilder(); + result.filterQueries_.Clear(); + return this; + } + + public pbc::IPopsicleList ShouldQueriesList { + get { return PrepareBuilder().shouldQueries_; } + } + public int ShouldQueriesCount { + get { return result.ShouldQueriesCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query GetShouldQueries(int index) { + return result.GetShouldQueries(index); + } + public Builder SetShouldQueries(int index, global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.shouldQueries_[index] = value; + return this; + } + public Builder SetShouldQueries(int index, global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.shouldQueries_[index] = builderForValue.Build(); + return this; + } + public Builder AddShouldQueries(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.shouldQueries_.Add(value); + return this; + } + public Builder AddShouldQueries(global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.shouldQueries_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeShouldQueries(scg::IEnumerable values) { + PrepareBuilder(); + result.shouldQueries_.Add(values); + return this; + } + public Builder ClearShouldQueries() { + PrepareBuilder(); + result.shouldQueries_.Clear(); + return this; + } + + public bool HasMinimumShouldMatch { + get { return result.hasMinimumShouldMatch; } + } + public int MinimumShouldMatch { + get { return result.MinimumShouldMatch; } + set { SetMinimumShouldMatch(value); } + } + public Builder SetMinimumShouldMatch(int value) { + PrepareBuilder(); + result.hasMinimumShouldMatch = true; + result.minimumShouldMatch_ = value; + return this; + } + public Builder ClearMinimumShouldMatch() { + PrepareBuilder(); + result.hasMinimumShouldMatch = false; + result.minimumShouldMatch_ = 0; + return this; + } + } + static BoolQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ConstScoreQuery : pb::GeneratedMessage { + private ConstScoreQuery() { } + private static readonly ConstScoreQuery defaultInstance = new ConstScoreQuery().MakeReadOnly(); + private static readonly string[] _constScoreQueryFieldNames = new string[] { "filter" }; + private static readonly uint[] _constScoreQueryFieldTags = new uint[] { 10 }; + public static ConstScoreQuery DefaultInstance { + get { return defaultInstance; } + } + + public override ConstScoreQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ConstScoreQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_ConstScoreQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_ConstScoreQuery__FieldAccessorTable; } + } + + public const int FilterFieldNumber = 1; + private bool hasFilter; + private global::com.alicloud.openservices.tablestore.core.protocol.Query filter_; + public bool HasFilter { + get { return hasFilter; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query Filter { + get { return filter_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _constScoreQueryFieldNames; + if (hasFilter) { + output.WriteMessage(1, field_names[0], Filter); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Filter); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ConstScoreQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ConstScoreQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ConstScoreQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ConstScoreQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ConstScoreQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ConstScoreQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ConstScoreQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ConstScoreQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ConstScoreQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ConstScoreQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ConstScoreQuery MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ConstScoreQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ConstScoreQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ConstScoreQuery result; + + private ConstScoreQuery PrepareBuilder() { + if (resultIsReadOnly) { + ConstScoreQuery original = result; + result = new ConstScoreQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ConstScoreQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ConstScoreQuery.Descriptor; } + } + + public override ConstScoreQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ConstScoreQuery.DefaultInstance; } + } + + public override ConstScoreQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ConstScoreQuery) { + return MergeFrom((ConstScoreQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ConstScoreQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ConstScoreQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFilter) { + MergeFilter(other.Filter); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_constScoreQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _constScoreQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Query.CreateBuilder(); + if (result.hasFilter) { + subBuilder.MergeFrom(Filter); + } + input.ReadMessage(subBuilder, extensionRegistry); + Filter = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFilter { + get { return result.hasFilter; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query Filter { + get { return result.Filter; } + set { SetFilter(value); } + } + public Builder SetFilter(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = value; + return this; + } + public Builder SetFilter(global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = builderForValue.Build(); + return this; + } + public Builder MergeFilter(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasFilter && + result.filter_ != global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance) { + result.filter_ = global::com.alicloud.openservices.tablestore.core.protocol.Query.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); + } else { + result.filter_ = value; + } + result.hasFilter = true; + return this; + } + public Builder ClearFilter() { + PrepareBuilder(); + result.hasFilter = false; + result.filter_ = null; + return this; + } + } + static ConstScoreQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class FieldValueFactor : pb::GeneratedMessage { + private FieldValueFactor() { } + private static readonly FieldValueFactor defaultInstance = new FieldValueFactor().MakeReadOnly(); + private static readonly string[] _fieldValueFactorFieldNames = new string[] { "field_name" }; + private static readonly uint[] _fieldValueFactorFieldTags = new uint[] { 10 }; + public static FieldValueFactor DefaultInstance { + get { return defaultInstance; } + } + + public override FieldValueFactor DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FieldValueFactor ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldValueFactor__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldValueFactor__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _fieldValueFactorFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[0], FieldName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static FieldValueFactor ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FieldValueFactor ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FieldValueFactor ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FieldValueFactor ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FieldValueFactor ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FieldValueFactor ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FieldValueFactor ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FieldValueFactor ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FieldValueFactor ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FieldValueFactor ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FieldValueFactor MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FieldValueFactor prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FieldValueFactor cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FieldValueFactor result; + + private FieldValueFactor PrepareBuilder() { + if (resultIsReadOnly) { + FieldValueFactor original = result; + result = new FieldValueFactor(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FieldValueFactor MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor.Descriptor; } + } + + public override FieldValueFactor DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor.DefaultInstance; } + } + + public override FieldValueFactor BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FieldValueFactor) { + return MergeFrom((FieldValueFactor) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FieldValueFactor other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_fieldValueFactorFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _fieldValueFactorFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + } + static FieldValueFactor() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class FunctionScoreQuery : pb::GeneratedMessage { + private FunctionScoreQuery() { } + private static readonly FunctionScoreQuery defaultInstance = new FunctionScoreQuery().MakeReadOnly(); + private static readonly string[] _functionScoreQueryFieldNames = new string[] { "field_value_factor", "query" }; + private static readonly uint[] _functionScoreQueryFieldTags = new uint[] { 18, 10 }; + public static FunctionScoreQuery DefaultInstance { + get { return defaultInstance; } + } + + public override FunctionScoreQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FunctionScoreQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_FunctionScoreQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_FunctionScoreQuery__FieldAccessorTable; } + } + + public const int QueryFieldNumber = 1; + private bool hasQuery; + private global::com.alicloud.openservices.tablestore.core.protocol.Query query_; + public bool HasQuery { + get { return hasQuery; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query Query { + get { return query_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance; } + } + + public const int FieldValueFactorFieldNumber = 2; + private bool hasFieldValueFactor; + private global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor fieldValueFactor_; + public bool HasFieldValueFactor { + get { return hasFieldValueFactor; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor FieldValueFactor { + get { return fieldValueFactor_ ?? global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor.DefaultInstance; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _functionScoreQueryFieldNames; + if (hasQuery) { + output.WriteMessage(1, field_names[1], Query); + } + if (hasFieldValueFactor) { + output.WriteMessage(2, field_names[0], FieldValueFactor); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasQuery) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Query); + } + if (hasFieldValueFactor) { + size += pb::CodedOutputStream.ComputeMessageSize(2, FieldValueFactor); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static FunctionScoreQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FunctionScoreQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FunctionScoreQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FunctionScoreQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FunctionScoreQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FunctionScoreQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FunctionScoreQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FunctionScoreQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FunctionScoreQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FunctionScoreQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FunctionScoreQuery MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FunctionScoreQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FunctionScoreQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FunctionScoreQuery result; + + private FunctionScoreQuery PrepareBuilder() { + if (resultIsReadOnly) { + FunctionScoreQuery original = result; + result = new FunctionScoreQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FunctionScoreQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.FunctionScoreQuery.Descriptor; } + } + + public override FunctionScoreQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.FunctionScoreQuery.DefaultInstance; } + } + + public override FunctionScoreQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FunctionScoreQuery) { + return MergeFrom((FunctionScoreQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FunctionScoreQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.FunctionScoreQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasQuery) { + MergeQuery(other.Query); + } + if (other.HasFieldValueFactor) { + MergeFieldValueFactor(other.FieldValueFactor); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_functionScoreQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _functionScoreQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Query.CreateBuilder(); + if (result.hasQuery) { + subBuilder.MergeFrom(Query); + } + input.ReadMessage(subBuilder, extensionRegistry); + Query = subBuilder.BuildPartial(); + break; + } + case 18: { + global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor.CreateBuilder(); + if (result.hasFieldValueFactor) { + subBuilder.MergeFrom(FieldValueFactor); + } + input.ReadMessage(subBuilder, extensionRegistry); + FieldValueFactor = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasQuery { + get { return result.hasQuery; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query Query { + get { return result.Query; } + set { SetQuery(value); } + } + public Builder SetQuery(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasQuery = true; + result.query_ = value; + return this; + } + public Builder SetQuery(global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasQuery = true; + result.query_ = builderForValue.Build(); + return this; + } + public Builder MergeQuery(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasQuery && + result.query_ != global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance) { + result.query_ = global::com.alicloud.openservices.tablestore.core.protocol.Query.CreateBuilder(result.query_).MergeFrom(value).BuildPartial(); + } else { + result.query_ = value; + } + result.hasQuery = true; + return this; + } + public Builder ClearQuery() { + PrepareBuilder(); + result.hasQuery = false; + result.query_ = null; + return this; + } + + public bool HasFieldValueFactor { + get { return result.hasFieldValueFactor; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor FieldValueFactor { + get { return result.FieldValueFactor; } + set { SetFieldValueFactor(value); } + } + public Builder SetFieldValueFactor(global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldValueFactor = true; + result.fieldValueFactor_ = value; + return this; + } + public Builder SetFieldValueFactor(global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasFieldValueFactor = true; + result.fieldValueFactor_ = builderForValue.Build(); + return this; + } + public Builder MergeFieldValueFactor(global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasFieldValueFactor && + result.fieldValueFactor_ != global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor.DefaultInstance) { + result.fieldValueFactor_ = global::com.alicloud.openservices.tablestore.core.protocol.FieldValueFactor.CreateBuilder(result.fieldValueFactor_).MergeFrom(value).BuildPartial(); + } else { + result.fieldValueFactor_ = value; + } + result.hasFieldValueFactor = true; + return this; + } + public Builder ClearFieldValueFactor() { + PrepareBuilder(); + result.hasFieldValueFactor = false; + result.fieldValueFactor_ = null; + return this; + } + } + static FunctionScoreQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class NestedQuery : pb::GeneratedMessage { + private NestedQuery() { } + private static readonly NestedQuery defaultInstance = new NestedQuery().MakeReadOnly(); + private static readonly string[] _nestedQueryFieldNames = new string[] { "path", "query", "score_mode" }; + private static readonly uint[] _nestedQueryFieldTags = new uint[] { 10, 18, 24 }; + public static NestedQuery DefaultInstance { + get { return defaultInstance; } + } + + public override NestedQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override NestedQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedQuery__FieldAccessorTable; } + } + + public const int PathFieldNumber = 1; + private bool hasPath; + private string path_ = ""; + public bool HasPath { + get { return hasPath; } + } + public string Path { + get { return path_; } + } + + public const int QueryFieldNumber = 2; + private bool hasQuery; + private global::com.alicloud.openservices.tablestore.core.protocol.Query query_; + public bool HasQuery { + get { return hasQuery; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query Query { + get { return query_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance; } + } + + public const int ScoreModeFieldNumber = 3; + private bool hasScoreMode; + private global::com.alicloud.openservices.tablestore.core.protocol.ScoreMode scoreMode_ = global::com.alicloud.openservices.tablestore.core.protocol.ScoreMode.SCORE_MODE_NONE; + public bool HasScoreMode { + get { return hasScoreMode; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ScoreMode ScoreMode { + get { return scoreMode_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _nestedQueryFieldNames; + if (hasPath) { + output.WriteString(1, field_names[0], Path); + } + if (hasQuery) { + output.WriteMessage(2, field_names[1], Query); + } + if (hasScoreMode) { + output.WriteEnum(3, field_names[2], (int) ScoreMode, ScoreMode); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPath) { + size += pb::CodedOutputStream.ComputeStringSize(1, Path); + } + if (hasQuery) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Query); + } + if (hasScoreMode) { + size += pb::CodedOutputStream.ComputeEnumSize(3, (int) ScoreMode); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static NestedQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static NestedQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static NestedQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static NestedQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private NestedQuery MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(NestedQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(NestedQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private NestedQuery result; + + private NestedQuery PrepareBuilder() { + if (resultIsReadOnly) { + NestedQuery original = result; + result = new NestedQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override NestedQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.NestedQuery.Descriptor; } + } + + public override NestedQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.NestedQuery.DefaultInstance; } + } + + public override NestedQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is NestedQuery) { + return MergeFrom((NestedQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(NestedQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.NestedQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPath) { + Path = other.Path; + } + if (other.HasQuery) { + MergeQuery(other.Query); + } + if (other.HasScoreMode) { + ScoreMode = other.ScoreMode; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_nestedQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _nestedQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasPath = input.ReadString(ref result.path_); + break; + } + case 18: { + global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Query.CreateBuilder(); + if (result.hasQuery) { + subBuilder.MergeFrom(Query); + } + input.ReadMessage(subBuilder, extensionRegistry); + Query = subBuilder.BuildPartial(); + break; + } + case 24: { + object unknown; + if(input.ReadEnum(ref result.scoreMode_, out unknown)) { + result.hasScoreMode = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(3, (ulong)(int)unknown); + } + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPath { + get { return result.hasPath; } + } + public string Path { + get { return result.Path; } + set { SetPath(value); } + } + public Builder SetPath(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPath = true; + result.path_ = value; + return this; + } + public Builder ClearPath() { + PrepareBuilder(); + result.hasPath = false; + result.path_ = ""; + return this; + } + + public bool HasQuery { + get { return result.hasQuery; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query Query { + get { return result.Query; } + set { SetQuery(value); } + } + public Builder SetQuery(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasQuery = true; + result.query_ = value; + return this; + } + public Builder SetQuery(global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasQuery = true; + result.query_ = builderForValue.Build(); + return this; + } + public Builder MergeQuery(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasQuery && + result.query_ != global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance) { + result.query_ = global::com.alicloud.openservices.tablestore.core.protocol.Query.CreateBuilder(result.query_).MergeFrom(value).BuildPartial(); + } else { + result.query_ = value; + } + result.hasQuery = true; + return this; + } + public Builder ClearQuery() { + PrepareBuilder(); + result.hasQuery = false; + result.query_ = null; + return this; + } + + public bool HasScoreMode { + get { return result.hasScoreMode; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ScoreMode ScoreMode { + get { return result.ScoreMode; } + set { SetScoreMode(value); } + } + public Builder SetScoreMode(global::com.alicloud.openservices.tablestore.core.protocol.ScoreMode value) { + PrepareBuilder(); + result.hasScoreMode = true; + result.scoreMode_ = value; + return this; + } + public Builder ClearScoreMode() { + PrepareBuilder(); + result.hasScoreMode = false; + result.scoreMode_ = global::com.alicloud.openservices.tablestore.core.protocol.ScoreMode.SCORE_MODE_NONE; + return this; + } + } + static NestedQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class GeoBoundingBoxQuery : pb::GeneratedMessage { + private GeoBoundingBoxQuery() { } + private static readonly GeoBoundingBoxQuery defaultInstance = new GeoBoundingBoxQuery().MakeReadOnly(); + private static readonly string[] _geoBoundingBoxQueryFieldNames = new string[] { "bottom_right", "field_name", "top_left" }; + private static readonly uint[] _geoBoundingBoxQueryFieldTags = new uint[] { 26, 10, 18 }; + public static GeoBoundingBoxQuery DefaultInstance { + get { return defaultInstance; } + } + + public override GeoBoundingBoxQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GeoBoundingBoxQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoBoundingBoxQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoBoundingBoxQuery__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public const int TopLeftFieldNumber = 2; + private bool hasTopLeft; + private string topLeft_ = ""; + public bool HasTopLeft { + get { return hasTopLeft; } + } + public string TopLeft { + get { return topLeft_; } + } + + public const int BottomRightFieldNumber = 3; + private bool hasBottomRight; + private string bottomRight_ = ""; + public bool HasBottomRight { + get { return hasBottomRight; } + } + public string BottomRight { + get { return bottomRight_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _geoBoundingBoxQueryFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[1], FieldName); + } + if (hasTopLeft) { + output.WriteString(2, field_names[2], TopLeft); + } + if (hasBottomRight) { + output.WriteString(3, field_names[0], BottomRight); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + if (hasTopLeft) { + size += pb::CodedOutputStream.ComputeStringSize(2, TopLeft); + } + if (hasBottomRight) { + size += pb::CodedOutputStream.ComputeStringSize(3, BottomRight); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static GeoBoundingBoxQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GeoBoundingBoxQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GeoBoundingBoxQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GeoBoundingBoxQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GeoBoundingBoxQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GeoBoundingBoxQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GeoBoundingBoxQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GeoBoundingBoxQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GeoBoundingBoxQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GeoBoundingBoxQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GeoBoundingBoxQuery MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GeoBoundingBoxQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GeoBoundingBoxQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GeoBoundingBoxQuery result; + + private GeoBoundingBoxQuery PrepareBuilder() { + if (resultIsReadOnly) { + GeoBoundingBoxQuery original = result; + result = new GeoBoundingBoxQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GeoBoundingBoxQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GeoBoundingBoxQuery.Descriptor; } + } + + public override GeoBoundingBoxQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GeoBoundingBoxQuery.DefaultInstance; } + } + + public override GeoBoundingBoxQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GeoBoundingBoxQuery) { + return MergeFrom((GeoBoundingBoxQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GeoBoundingBoxQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.GeoBoundingBoxQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + if (other.HasTopLeft) { + TopLeft = other.TopLeft; + } + if (other.HasBottomRight) { + BottomRight = other.BottomRight; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_geoBoundingBoxQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _geoBoundingBoxQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + case 18: { + result.hasTopLeft = input.ReadString(ref result.topLeft_); + break; + } + case 26: { + result.hasBottomRight = input.ReadString(ref result.bottomRight_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + + public bool HasTopLeft { + get { return result.hasTopLeft; } + } + public string TopLeft { + get { return result.TopLeft; } + set { SetTopLeft(value); } + } + public Builder SetTopLeft(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTopLeft = true; + result.topLeft_ = value; + return this; + } + public Builder ClearTopLeft() { + PrepareBuilder(); + result.hasTopLeft = false; + result.topLeft_ = ""; + return this; + } + + public bool HasBottomRight { + get { return result.hasBottomRight; } + } + public string BottomRight { + get { return result.BottomRight; } + set { SetBottomRight(value); } + } + public Builder SetBottomRight(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasBottomRight = true; + result.bottomRight_ = value; + return this; + } + public Builder ClearBottomRight() { + PrepareBuilder(); + result.hasBottomRight = false; + result.bottomRight_ = ""; + return this; + } + } + static GeoBoundingBoxQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class GeoDistanceQuery : pb::GeneratedMessage { + private GeoDistanceQuery() { } + private static readonly GeoDistanceQuery defaultInstance = new GeoDistanceQuery().MakeReadOnly(); + private static readonly string[] _geoDistanceQueryFieldNames = new string[] { "center_point", "distance", "field_name" }; + private static readonly uint[] _geoDistanceQueryFieldTags = new uint[] { 18, 25, 10 }; + public static GeoDistanceQuery DefaultInstance { + get { return defaultInstance; } + } + + public override GeoDistanceQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GeoDistanceQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceQuery__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public const int CenterPointFieldNumber = 2; + private bool hasCenterPoint; + private string centerPoint_ = ""; + public bool HasCenterPoint { + get { return hasCenterPoint; } + } + public string CenterPoint { + get { return centerPoint_; } + } + + public const int DistanceFieldNumber = 3; + private bool hasDistance; + private double distance_; + public bool HasDistance { + get { return hasDistance; } + } + public double Distance { + get { return distance_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _geoDistanceQueryFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[2], FieldName); + } + if (hasCenterPoint) { + output.WriteString(2, field_names[0], CenterPoint); + } + if (hasDistance) { + output.WriteDouble(3, field_names[1], Distance); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + if (hasCenterPoint) { + size += pb::CodedOutputStream.ComputeStringSize(2, CenterPoint); + } + if (hasDistance) { + size += pb::CodedOutputStream.ComputeDoubleSize(3, Distance); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static GeoDistanceQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GeoDistanceQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GeoDistanceQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GeoDistanceQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GeoDistanceQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GeoDistanceQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GeoDistanceQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GeoDistanceQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GeoDistanceQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GeoDistanceQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GeoDistanceQuery MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GeoDistanceQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GeoDistanceQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GeoDistanceQuery result; + + private GeoDistanceQuery PrepareBuilder() { + if (resultIsReadOnly) { + GeoDistanceQuery original = result; + result = new GeoDistanceQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GeoDistanceQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceQuery.Descriptor; } + } + + public override GeoDistanceQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceQuery.DefaultInstance; } + } + + public override GeoDistanceQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GeoDistanceQuery) { + return MergeFrom((GeoDistanceQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GeoDistanceQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + if (other.HasCenterPoint) { + CenterPoint = other.CenterPoint; + } + if (other.HasDistance) { + Distance = other.Distance; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_geoDistanceQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _geoDistanceQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + case 18: { + result.hasCenterPoint = input.ReadString(ref result.centerPoint_); + break; + } + case 25: { + result.hasDistance = input.ReadDouble(ref result.distance_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + + public bool HasCenterPoint { + get { return result.hasCenterPoint; } + } + public string CenterPoint { + get { return result.CenterPoint; } + set { SetCenterPoint(value); } + } + public Builder SetCenterPoint(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCenterPoint = true; + result.centerPoint_ = value; + return this; + } + public Builder ClearCenterPoint() { + PrepareBuilder(); + result.hasCenterPoint = false; + result.centerPoint_ = ""; + return this; + } + + public bool HasDistance { + get { return result.hasDistance; } + } + public double Distance { + get { return result.Distance; } + set { SetDistance(value); } + } + public Builder SetDistance(double value) { + PrepareBuilder(); + result.hasDistance = true; + result.distance_ = value; + return this; + } + public Builder ClearDistance() { + PrepareBuilder(); + result.hasDistance = false; + result.distance_ = 0D; + return this; + } + } + static GeoDistanceQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class GeoPolygonQuery : pb::GeneratedMessage { + private GeoPolygonQuery() { } + private static readonly GeoPolygonQuery defaultInstance = new GeoPolygonQuery().MakeReadOnly(); + private static readonly string[] _geoPolygonQueryFieldNames = new string[] { "field_name", "points" }; + private static readonly uint[] _geoPolygonQueryFieldTags = new uint[] { 10, 18 }; + public static GeoPolygonQuery DefaultInstance { + get { return defaultInstance; } + } + + public override GeoPolygonQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GeoPolygonQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoPolygonQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoPolygonQuery__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public const int PointsFieldNumber = 2; + private pbc::PopsicleList points_ = new pbc::PopsicleList(); + public scg::IList PointsList { + get { return pbc::Lists.AsReadOnly(points_); } + } + public int PointsCount { + get { return points_.Count; } + } + public string GetPoints(int index) { + return points_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _geoPolygonQueryFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[0], FieldName); + } + if (points_.Count > 0) { + output.WriteStringArray(2, field_names[1], points_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + { + int dataSize = 0; + foreach (string element in PointsList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * points_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static GeoPolygonQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GeoPolygonQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GeoPolygonQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GeoPolygonQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GeoPolygonQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GeoPolygonQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GeoPolygonQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GeoPolygonQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GeoPolygonQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GeoPolygonQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GeoPolygonQuery MakeReadOnly() { + points_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GeoPolygonQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GeoPolygonQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GeoPolygonQuery result; + + private GeoPolygonQuery PrepareBuilder() { + if (resultIsReadOnly) { + GeoPolygonQuery original = result; + result = new GeoPolygonQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GeoPolygonQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GeoPolygonQuery.Descriptor; } + } + + public override GeoPolygonQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GeoPolygonQuery.DefaultInstance; } + } + + public override GeoPolygonQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GeoPolygonQuery) { + return MergeFrom((GeoPolygonQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GeoPolygonQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.GeoPolygonQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + if (other.points_.Count != 0) { + result.points_.Add(other.points_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_geoPolygonQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _geoPolygonQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + case 18: { + input.ReadStringArray(tag, field_name, result.points_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + + public pbc::IPopsicleList PointsList { + get { return PrepareBuilder().points_; } + } + public int PointsCount { + get { return result.PointsCount; } + } + public string GetPoints(int index) { + return result.GetPoints(index); + } + public Builder SetPoints(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.points_[index] = value; + return this; + } + public Builder AddPoints(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.points_.Add(value); + return this; + } + public Builder AddRangePoints(scg::IEnumerable values) { + PrepareBuilder(); + result.points_.Add(values); + return this; + } + public Builder ClearPoints() { + PrepareBuilder(); + result.points_.Clear(); + return this; + } + } + static GeoPolygonQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Query : pb::GeneratedMessage { + private Query() { } + private static readonly Query defaultInstance = new Query().MakeReadOnly(); + private static readonly string[] _queryFieldNames = new string[] { "query", "type" }; + private static readonly uint[] _queryFieldTags = new uint[] { 18, 8 }; + public static Query DefaultInstance { + get { return defaultInstance; } + } + + public override Query DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Query ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_Query__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_Query__FieldAccessorTable; } + } + + public const int TypeFieldNumber = 1; + private bool hasType; + private global::com.alicloud.openservices.tablestore.core.protocol.QueryType type_ = global::com.alicloud.openservices.tablestore.core.protocol.QueryType.MATCH_QUERY; + public bool HasType { + get { return hasType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.QueryType Type { + get { return type_; } + } + + public const int Query_FieldNumber = 2; + private bool hasQuery_; + private pb::ByteString query_ = pb::ByteString.Empty; + public bool HasQuery_ { + get { return hasQuery_; } + } + public pb::ByteString Query_ { + get { return query_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _queryFieldNames; + if (hasType) { + output.WriteEnum(1, field_names[1], (int) Type, Type); + } + if (hasQuery_) { + output.WriteBytes(2, field_names[0], Query_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasType) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Type); + } + if (hasQuery_) { + size += pb::CodedOutputStream.ComputeBytesSize(2, Query_); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static Query ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Query ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Query ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Query ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Query ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Query ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Query ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Query ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Query ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Query ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Query MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Query prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Query cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Query result; + + private Query PrepareBuilder() { + if (resultIsReadOnly) { + Query original = result; + result = new Query(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Query MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Query.Descriptor; } + } + + public override Query DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance; } + } + + public override Query BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Query) { + return MergeFrom((Query) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Query other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasType) { + Type = other.Type; + } + if (other.HasQuery_) { + Query_ = other.Query_; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_queryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _queryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.type_, out unknown)) { + result.hasType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + case 18: { + result.hasQuery_ = input.ReadBytes(ref result.query_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasType { + get { return result.hasType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.QueryType Type { + get { return result.Type; } + set { SetType(value); } + } + public Builder SetType(global::com.alicloud.openservices.tablestore.core.protocol.QueryType value) { + PrepareBuilder(); + result.hasType = true; + result.type_ = value; + return this; + } + public Builder ClearType() { + PrepareBuilder(); + result.hasType = false; + result.type_ = global::com.alicloud.openservices.tablestore.core.protocol.QueryType.MATCH_QUERY; + return this; + } + + public bool HasQuery_ { + get { return result.hasQuery_; } + } + public pb::ByteString Query_ { + get { return result.Query_; } + set { SetQuery_(value); } + } + public Builder SetQuery_(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasQuery_ = true; + result.query_ = value; + return this; + } + public Builder ClearQuery_() { + PrepareBuilder(); + result.hasQuery_ = false; + result.query_ = pb::ByteString.Empty; + return this; + } + } + static Query() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Collapse : pb::GeneratedMessage { + private Collapse() { } + private static readonly Collapse defaultInstance = new Collapse().MakeReadOnly(); + private static readonly string[] _collapseFieldNames = new string[] { "field_name" }; + private static readonly uint[] _collapseFieldTags = new uint[] { 10 }; + public static Collapse DefaultInstance { + get { return defaultInstance; } + } + + public override Collapse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Collapse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_Collapse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_Collapse__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _collapseFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[0], FieldName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static Collapse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Collapse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Collapse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Collapse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Collapse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Collapse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Collapse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Collapse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Collapse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Collapse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Collapse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Collapse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Collapse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Collapse result; + + private Collapse PrepareBuilder() { + if (resultIsReadOnly) { + Collapse original = result; + result = new Collapse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Collapse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Collapse.Descriptor; } + } + + public override Collapse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Collapse.DefaultInstance; } + } + + public override Collapse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Collapse) { + return MergeFrom((Collapse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Collapse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.Collapse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_collapseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _collapseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + } + static Collapse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class NestedFilter : pb::GeneratedMessage { + private NestedFilter() { } + private static readonly NestedFilter defaultInstance = new NestedFilter().MakeReadOnly(); + private static readonly string[] _nestedFilterFieldNames = new string[] { "filter", "path" }; + private static readonly uint[] _nestedFilterFieldTags = new uint[] { 18, 10 }; + public static NestedFilter DefaultInstance { + get { return defaultInstance; } + } + + public override NestedFilter DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override NestedFilter ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedFilter__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_NestedFilter__FieldAccessorTable; } + } + + public const int PathFieldNumber = 1; + private bool hasPath; + private string path_ = ""; + public bool HasPath { + get { return hasPath; } + } + public string Path { + get { return path_; } + } + + public const int FilterFieldNumber = 2; + private bool hasFilter; + private global::com.alicloud.openservices.tablestore.core.protocol.Query filter_; + public bool HasFilter { + get { return hasFilter; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query Filter { + get { return filter_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _nestedFilterFieldNames; + if (hasPath) { + output.WriteString(1, field_names[1], Path); + } + if (hasFilter) { + output.WriteMessage(2, field_names[0], Filter); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasPath) { + size += pb::CodedOutputStream.ComputeStringSize(1, Path); + } + if (hasFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(2, Filter); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static NestedFilter ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedFilter ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedFilter ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static NestedFilter ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static NestedFilter ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedFilter ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static NestedFilter ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static NestedFilter ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static NestedFilter ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static NestedFilter ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private NestedFilter MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(NestedFilter prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(NestedFilter cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private NestedFilter result; + + private NestedFilter PrepareBuilder() { + if (resultIsReadOnly) { + NestedFilter original = result; + result = new NestedFilter(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override NestedFilter MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.Descriptor; } + } + + public override NestedFilter DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.DefaultInstance; } + } + + public override NestedFilter BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is NestedFilter) { + return MergeFrom((NestedFilter) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(NestedFilter other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasPath) { + Path = other.Path; + } + if (other.HasFilter) { + MergeFilter(other.Filter); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_nestedFilterFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _nestedFilterFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasPath = input.ReadString(ref result.path_); + break; + } + case 18: { + global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Query.CreateBuilder(); + if (result.hasFilter) { + subBuilder.MergeFrom(Filter); + } + input.ReadMessage(subBuilder, extensionRegistry); + Filter = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasPath { + get { return result.hasPath; } + } + public string Path { + get { return result.Path; } + set { SetPath(value); } + } + public Builder SetPath(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPath = true; + result.path_ = value; + return this; + } + public Builder ClearPath() { + PrepareBuilder(); + result.hasPath = false; + result.path_ = ""; + return this; + } + + public bool HasFilter { + get { return result.hasFilter; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query Filter { + get { return result.Filter; } + set { SetFilter(value); } + } + public Builder SetFilter(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = value; + return this; + } + public Builder SetFilter(global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasFilter = true; + result.filter_ = builderForValue.Build(); + return this; + } + public Builder MergeFilter(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasFilter && + result.filter_ != global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance) { + result.filter_ = global::com.alicloud.openservices.tablestore.core.protocol.Query.CreateBuilder(result.filter_).MergeFrom(value).BuildPartial(); + } else { + result.filter_ = value; + } + result.hasFilter = true; + return this; + } + public Builder ClearFilter() { + PrepareBuilder(); + result.hasFilter = false; + result.filter_ = null; + return this; + } + } + static NestedFilter() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ScoreSort : pb::GeneratedMessage { + private ScoreSort() { } + private static readonly ScoreSort defaultInstance = new ScoreSort().MakeReadOnly(); + private static readonly string[] _scoreSortFieldNames = new string[] { "order" }; + private static readonly uint[] _scoreSortFieldTags = new uint[] { 8 }; + public static ScoreSort DefaultInstance { + get { return defaultInstance; } + } + + public override ScoreSort DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ScoreSort ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_ScoreSort__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_ScoreSort__FieldAccessorTable; } + } + + public const int OrderFieldNumber = 1; + private bool hasOrder; + private global::com.alicloud.openservices.tablestore.core.protocol.SortOrder order_ = global::com.alicloud.openservices.tablestore.core.protocol.SortOrder.SORT_ORDER_ASC; + public bool HasOrder { + get { return hasOrder; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SortOrder Order { + get { return order_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _scoreSortFieldNames; + if (hasOrder) { + output.WriteEnum(1, field_names[0], (int) Order, Order); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrder) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Order); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ScoreSort ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ScoreSort ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ScoreSort ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ScoreSort ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ScoreSort ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ScoreSort ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ScoreSort ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ScoreSort ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ScoreSort ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ScoreSort ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ScoreSort MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ScoreSort prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ScoreSort cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ScoreSort result; + + private ScoreSort PrepareBuilder() { + if (resultIsReadOnly) { + ScoreSort original = result; + result = new ScoreSort(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ScoreSort MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort.Descriptor; } + } + + public override ScoreSort DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort.DefaultInstance; } + } + + public override ScoreSort BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ScoreSort) { + return MergeFrom((ScoreSort) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ScoreSort other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrder) { + Order = other.Order; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_scoreSortFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _scoreSortFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.order_, out unknown)) { + result.hasOrder = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrder { + get { return result.hasOrder; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SortOrder Order { + get { return result.Order; } + set { SetOrder(value); } + } + public Builder SetOrder(global::com.alicloud.openservices.tablestore.core.protocol.SortOrder value) { + PrepareBuilder(); + result.hasOrder = true; + result.order_ = value; + return this; + } + public Builder ClearOrder() { + PrepareBuilder(); + result.hasOrder = false; + result.order_ = global::com.alicloud.openservices.tablestore.core.protocol.SortOrder.SORT_ORDER_ASC; + return this; + } + } + static ScoreSort() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class PrimaryKeySort : pb::GeneratedMessage { + private PrimaryKeySort() { } + private static readonly PrimaryKeySort defaultInstance = new PrimaryKeySort().MakeReadOnly(); + private static readonly string[] _primaryKeySortFieldNames = new string[] { "order" }; + private static readonly uint[] _primaryKeySortFieldTags = new uint[] { 8 }; + public static PrimaryKeySort DefaultInstance { + get { return defaultInstance; } + } + + public override PrimaryKeySort DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override PrimaryKeySort ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySort__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_PrimaryKeySort__FieldAccessorTable; } + } + + public const int OrderFieldNumber = 1; + private bool hasOrder; + private global::com.alicloud.openservices.tablestore.core.protocol.SortOrder order_ = global::com.alicloud.openservices.tablestore.core.protocol.SortOrder.SORT_ORDER_ASC; + public bool HasOrder { + get { return hasOrder; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SortOrder Order { + get { return order_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _primaryKeySortFieldNames; + if (hasOrder) { + output.WriteEnum(1, field_names[0], (int) Order, Order); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOrder) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) Order); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static PrimaryKeySort ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PrimaryKeySort ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PrimaryKeySort ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static PrimaryKeySort ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static PrimaryKeySort ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PrimaryKeySort ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static PrimaryKeySort ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static PrimaryKeySort ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static PrimaryKeySort ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static PrimaryKeySort ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private PrimaryKeySort MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(PrimaryKeySort prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(PrimaryKeySort cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private PrimaryKeySort result; + + private PrimaryKeySort PrepareBuilder() { + if (resultIsReadOnly) { + PrimaryKeySort original = result; + result = new PrimaryKeySort(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override PrimaryKeySort MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort.Descriptor; } + } + + public override PrimaryKeySort DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort.DefaultInstance; } + } + + public override PrimaryKeySort BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is PrimaryKeySort) { + return MergeFrom((PrimaryKeySort) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(PrimaryKeySort other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOrder) { + Order = other.Order; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_primaryKeySortFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _primaryKeySortFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.order_, out unknown)) { + result.hasOrder = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOrder { + get { return result.hasOrder; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SortOrder Order { + get { return result.Order; } + set { SetOrder(value); } + } + public Builder SetOrder(global::com.alicloud.openservices.tablestore.core.protocol.SortOrder value) { + PrepareBuilder(); + result.hasOrder = true; + result.order_ = value; + return this; + } + public Builder ClearOrder() { + PrepareBuilder(); + result.hasOrder = false; + result.order_ = global::com.alicloud.openservices.tablestore.core.protocol.SortOrder.SORT_ORDER_ASC; + return this; + } + } + static PrimaryKeySort() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class FieldSort : pb::GeneratedMessage { + private FieldSort() { } + private static readonly FieldSort defaultInstance = new FieldSort().MakeReadOnly(); + private static readonly string[] _fieldSortFieldNames = new string[] { "field_name", "mode", "nested_filter", "order" }; + private static readonly uint[] _fieldSortFieldTags = new uint[] { 10, 24, 34, 16 }; + public static FieldSort DefaultInstance { + get { return defaultInstance; } + } + + public override FieldSort DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FieldSort ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSort__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSort__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public const int OrderFieldNumber = 2; + private bool hasOrder; + private global::com.alicloud.openservices.tablestore.core.protocol.SortOrder order_ = global::com.alicloud.openservices.tablestore.core.protocol.SortOrder.SORT_ORDER_ASC; + public bool HasOrder { + get { return hasOrder; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SortOrder Order { + get { return order_; } + } + + public const int ModeFieldNumber = 3; + private bool hasMode; + private global::com.alicloud.openservices.tablestore.core.protocol.SortMode mode_ = global::com.alicloud.openservices.tablestore.core.protocol.SortMode.SORT_MODE_MIN; + public bool HasMode { + get { return hasMode; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SortMode Mode { + get { return mode_; } + } + + public const int NestedFilterFieldNumber = 4; + private bool hasNestedFilter; + private global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter nestedFilter_; + public bool HasNestedFilter { + get { return hasNestedFilter; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter NestedFilter { + get { return nestedFilter_ ?? global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.DefaultInstance; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _fieldSortFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[0], FieldName); + } + if (hasOrder) { + output.WriteEnum(2, field_names[3], (int) Order, Order); + } + if (hasMode) { + output.WriteEnum(3, field_names[1], (int) Mode, Mode); + } + if (hasNestedFilter) { + output.WriteMessage(4, field_names[2], NestedFilter); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + if (hasOrder) { + size += pb::CodedOutputStream.ComputeEnumSize(2, (int) Order); + } + if (hasMode) { + size += pb::CodedOutputStream.ComputeEnumSize(3, (int) Mode); + } + if (hasNestedFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(4, NestedFilter); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static FieldSort ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FieldSort ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FieldSort ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FieldSort ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FieldSort ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FieldSort ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FieldSort ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FieldSort ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FieldSort ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FieldSort ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FieldSort MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FieldSort prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FieldSort cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FieldSort result; + + private FieldSort PrepareBuilder() { + if (resultIsReadOnly) { + FieldSort original = result; + result = new FieldSort(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FieldSort MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.FieldSort.Descriptor; } + } + + public override FieldSort DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.FieldSort.DefaultInstance; } + } + + public override FieldSort BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FieldSort) { + return MergeFrom((FieldSort) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FieldSort other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.FieldSort.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + if (other.HasOrder) { + Order = other.Order; + } + if (other.HasMode) { + Mode = other.Mode; + } + if (other.HasNestedFilter) { + MergeNestedFilter(other.NestedFilter); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_fieldSortFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _fieldSortFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + case 16: { + object unknown; + if(input.ReadEnum(ref result.order_, out unknown)) { + result.hasOrder = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(2, (ulong)(int)unknown); + } + break; + } + case 24: { + object unknown; + if(input.ReadEnum(ref result.mode_, out unknown)) { + result.hasMode = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(3, (ulong)(int)unknown); + } + break; + } + case 34: { + global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.CreateBuilder(); + if (result.hasNestedFilter) { + subBuilder.MergeFrom(NestedFilter); + } + input.ReadMessage(subBuilder, extensionRegistry); + NestedFilter = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + + public bool HasOrder { + get { return result.hasOrder; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SortOrder Order { + get { return result.Order; } + set { SetOrder(value); } + } + public Builder SetOrder(global::com.alicloud.openservices.tablestore.core.protocol.SortOrder value) { + PrepareBuilder(); + result.hasOrder = true; + result.order_ = value; + return this; + } + public Builder ClearOrder() { + PrepareBuilder(); + result.hasOrder = false; + result.order_ = global::com.alicloud.openservices.tablestore.core.protocol.SortOrder.SORT_ORDER_ASC; + return this; + } + + public bool HasMode { + get { return result.hasMode; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SortMode Mode { + get { return result.Mode; } + set { SetMode(value); } + } + public Builder SetMode(global::com.alicloud.openservices.tablestore.core.protocol.SortMode value) { + PrepareBuilder(); + result.hasMode = true; + result.mode_ = value; + return this; + } + public Builder ClearMode() { + PrepareBuilder(); + result.hasMode = false; + result.mode_ = global::com.alicloud.openservices.tablestore.core.protocol.SortMode.SORT_MODE_MIN; + return this; + } + + public bool HasNestedFilter { + get { return result.hasNestedFilter; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter NestedFilter { + get { return result.NestedFilter; } + set { SetNestedFilter(value); } + } + public Builder SetNestedFilter(global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNestedFilter = true; + result.nestedFilter_ = value; + return this; + } + public Builder SetNestedFilter(global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasNestedFilter = true; + result.nestedFilter_ = builderForValue.Build(); + return this; + } + public Builder MergeNestedFilter(global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasNestedFilter && + result.nestedFilter_ != global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.DefaultInstance) { + result.nestedFilter_ = global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.CreateBuilder(result.nestedFilter_).MergeFrom(value).BuildPartial(); + } else { + result.nestedFilter_ = value; + } + result.hasNestedFilter = true; + return this; + } + public Builder ClearNestedFilter() { + PrepareBuilder(); + result.hasNestedFilter = false; + result.nestedFilter_ = null; + return this; + } + } + static FieldSort() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class GeoDistanceSort : pb::GeneratedMessage { + private GeoDistanceSort() { } + private static readonly GeoDistanceSort defaultInstance = new GeoDistanceSort().MakeReadOnly(); + private static readonly string[] _geoDistanceSortFieldNames = new string[] { "distance_type", "field_name", "mode", "nested_filter", "order", "points" }; + private static readonly uint[] _geoDistanceSortFieldTags = new uint[] { 40, 10, 32, 50, 24, 18 }; + public static GeoDistanceSort DefaultInstance { + get { return defaultInstance; } + } + + public override GeoDistanceSort DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override GeoDistanceSort ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceSort__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_GeoDistanceSort__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public const int PointsFieldNumber = 2; + private pbc::PopsicleList points_ = new pbc::PopsicleList(); + public scg::IList PointsList { + get { return pbc::Lists.AsReadOnly(points_); } + } + public int PointsCount { + get { return points_.Count; } + } + public string GetPoints(int index) { + return points_[index]; + } + + public const int OrderFieldNumber = 3; + private bool hasOrder; + private global::com.alicloud.openservices.tablestore.core.protocol.SortOrder order_ = global::com.alicloud.openservices.tablestore.core.protocol.SortOrder.SORT_ORDER_ASC; + public bool HasOrder { + get { return hasOrder; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SortOrder Order { + get { return order_; } + } + + public const int ModeFieldNumber = 4; + private bool hasMode; + private global::com.alicloud.openservices.tablestore.core.protocol.SortMode mode_ = global::com.alicloud.openservices.tablestore.core.protocol.SortMode.SORT_MODE_MIN; + public bool HasMode { + get { return hasMode; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SortMode Mode { + get { return mode_; } + } + + public const int DistanceTypeFieldNumber = 5; + private bool hasDistanceType; + private global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceType distanceType_ = global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceType.GEO_DISTANCE_ARC; + public bool HasDistanceType { + get { return hasDistanceType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceType DistanceType { + get { return distanceType_; } + } + + public const int NestedFilterFieldNumber = 6; + private bool hasNestedFilter; + private global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter nestedFilter_; + public bool HasNestedFilter { + get { return hasNestedFilter; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter NestedFilter { + get { return nestedFilter_ ?? global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.DefaultInstance; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _geoDistanceSortFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[1], FieldName); + } + if (points_.Count > 0) { + output.WriteStringArray(2, field_names[5], points_); + } + if (hasOrder) { + output.WriteEnum(3, field_names[4], (int) Order, Order); + } + if (hasMode) { + output.WriteEnum(4, field_names[2], (int) Mode, Mode); + } + if (hasDistanceType) { + output.WriteEnum(5, field_names[0], (int) DistanceType, DistanceType); + } + if (hasNestedFilter) { + output.WriteMessage(6, field_names[3], NestedFilter); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + { + int dataSize = 0; + foreach (string element in PointsList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * points_.Count; + } + if (hasOrder) { + size += pb::CodedOutputStream.ComputeEnumSize(3, (int) Order); + } + if (hasMode) { + size += pb::CodedOutputStream.ComputeEnumSize(4, (int) Mode); + } + if (hasDistanceType) { + size += pb::CodedOutputStream.ComputeEnumSize(5, (int) DistanceType); + } + if (hasNestedFilter) { + size += pb::CodedOutputStream.ComputeMessageSize(6, NestedFilter); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static GeoDistanceSort ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GeoDistanceSort ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GeoDistanceSort ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static GeoDistanceSort ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static GeoDistanceSort ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GeoDistanceSort ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static GeoDistanceSort ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static GeoDistanceSort ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static GeoDistanceSort ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static GeoDistanceSort ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private GeoDistanceSort MakeReadOnly() { + points_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(GeoDistanceSort prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(GeoDistanceSort cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private GeoDistanceSort result; + + private GeoDistanceSort PrepareBuilder() { + if (resultIsReadOnly) { + GeoDistanceSort original = result; + result = new GeoDistanceSort(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override GeoDistanceSort MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort.Descriptor; } + } + + public override GeoDistanceSort DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort.DefaultInstance; } + } + + public override GeoDistanceSort BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is GeoDistanceSort) { + return MergeFrom((GeoDistanceSort) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(GeoDistanceSort other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + if (other.points_.Count != 0) { + result.points_.Add(other.points_); + } + if (other.HasOrder) { + Order = other.Order; + } + if (other.HasMode) { + Mode = other.Mode; + } + if (other.HasDistanceType) { + DistanceType = other.DistanceType; + } + if (other.HasNestedFilter) { + MergeNestedFilter(other.NestedFilter); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_geoDistanceSortFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _geoDistanceSortFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + case 18: { + input.ReadStringArray(tag, field_name, result.points_); + break; + } + case 24: { + object unknown; + if(input.ReadEnum(ref result.order_, out unknown)) { + result.hasOrder = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(3, (ulong)(int)unknown); + } + break; + } + case 32: { + object unknown; + if(input.ReadEnum(ref result.mode_, out unknown)) { + result.hasMode = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(4, (ulong)(int)unknown); + } + break; + } + case 40: { + object unknown; + if(input.ReadEnum(ref result.distanceType_, out unknown)) { + result.hasDistanceType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(5, (ulong)(int)unknown); + } + break; + } + case 50: { + global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.CreateBuilder(); + if (result.hasNestedFilter) { + subBuilder.MergeFrom(NestedFilter); + } + input.ReadMessage(subBuilder, extensionRegistry); + NestedFilter = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + + public pbc::IPopsicleList PointsList { + get { return PrepareBuilder().points_; } + } + public int PointsCount { + get { return result.PointsCount; } + } + public string GetPoints(int index) { + return result.GetPoints(index); + } + public Builder SetPoints(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.points_[index] = value; + return this; + } + public Builder AddPoints(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.points_.Add(value); + return this; + } + public Builder AddRangePoints(scg::IEnumerable values) { + PrepareBuilder(); + result.points_.Add(values); + return this; + } + public Builder ClearPoints() { + PrepareBuilder(); + result.points_.Clear(); + return this; + } + + public bool HasOrder { + get { return result.hasOrder; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SortOrder Order { + get { return result.Order; } + set { SetOrder(value); } + } + public Builder SetOrder(global::com.alicloud.openservices.tablestore.core.protocol.SortOrder value) { + PrepareBuilder(); + result.hasOrder = true; + result.order_ = value; + return this; + } + public Builder ClearOrder() { + PrepareBuilder(); + result.hasOrder = false; + result.order_ = global::com.alicloud.openservices.tablestore.core.protocol.SortOrder.SORT_ORDER_ASC; + return this; + } + + public bool HasMode { + get { return result.hasMode; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SortMode Mode { + get { return result.Mode; } + set { SetMode(value); } + } + public Builder SetMode(global::com.alicloud.openservices.tablestore.core.protocol.SortMode value) { + PrepareBuilder(); + result.hasMode = true; + result.mode_ = value; + return this; + } + public Builder ClearMode() { + PrepareBuilder(); + result.hasMode = false; + result.mode_ = global::com.alicloud.openservices.tablestore.core.protocol.SortMode.SORT_MODE_MIN; + return this; + } + + public bool HasDistanceType { + get { return result.hasDistanceType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceType DistanceType { + get { return result.DistanceType; } + set { SetDistanceType(value); } + } + public Builder SetDistanceType(global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceType value) { + PrepareBuilder(); + result.hasDistanceType = true; + result.distanceType_ = value; + return this; + } + public Builder ClearDistanceType() { + PrepareBuilder(); + result.hasDistanceType = false; + result.distanceType_ = global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceType.GEO_DISTANCE_ARC; + return this; + } + + public bool HasNestedFilter { + get { return result.hasNestedFilter; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter NestedFilter { + get { return result.NestedFilter; } + set { SetNestedFilter(value); } + } + public Builder SetNestedFilter(global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNestedFilter = true; + result.nestedFilter_ = value; + return this; + } + public Builder SetNestedFilter(global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasNestedFilter = true; + result.nestedFilter_ = builderForValue.Build(); + return this; + } + public Builder MergeNestedFilter(global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasNestedFilter && + result.nestedFilter_ != global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.DefaultInstance) { + result.nestedFilter_ = global::com.alicloud.openservices.tablestore.core.protocol.NestedFilter.CreateBuilder(result.nestedFilter_).MergeFrom(value).BuildPartial(); + } else { + result.nestedFilter_ = value; + } + result.hasNestedFilter = true; + return this; + } + public Builder ClearNestedFilter() { + PrepareBuilder(); + result.hasNestedFilter = false; + result.nestedFilter_ = null; + return this; + } + } + static GeoDistanceSort() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Sorter : pb::GeneratedMessage { + private Sorter() { } + private static readonly Sorter defaultInstance = new Sorter().MakeReadOnly(); + private static readonly string[] _sorterFieldNames = new string[] { "field_sort", "geo_distance_sort", "pk_sort", "score_sort" }; + private static readonly uint[] _sorterFieldTags = new uint[] { 10, 18, 34, 26 }; + public static Sorter DefaultInstance { + get { return defaultInstance; } + } + + public override Sorter DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Sorter ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_Sorter__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_Sorter__FieldAccessorTable; } + } + + public const int FieldSortFieldNumber = 1; + private bool hasFieldSort; + private global::com.alicloud.openservices.tablestore.core.protocol.FieldSort fieldSort_; + public bool HasFieldSort { + get { return hasFieldSort; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.FieldSort FieldSort { + get { return fieldSort_ ?? global::com.alicloud.openservices.tablestore.core.protocol.FieldSort.DefaultInstance; } + } + + public const int GeoDistanceSortFieldNumber = 2; + private bool hasGeoDistanceSort; + private global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort geoDistanceSort_; + public bool HasGeoDistanceSort { + get { return hasGeoDistanceSort; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort GeoDistanceSort { + get { return geoDistanceSort_ ?? global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort.DefaultInstance; } + } + + public const int ScoreSortFieldNumber = 3; + private bool hasScoreSort; + private global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort scoreSort_; + public bool HasScoreSort { + get { return hasScoreSort; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort ScoreSort { + get { return scoreSort_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort.DefaultInstance; } + } + + public const int PkSortFieldNumber = 4; + private bool hasPkSort; + private global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort pkSort_; + public bool HasPkSort { + get { return hasPkSort; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort PkSort { + get { return pkSort_ ?? global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort.DefaultInstance; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _sorterFieldNames; + if (hasFieldSort) { + output.WriteMessage(1, field_names[0], FieldSort); + } + if (hasGeoDistanceSort) { + output.WriteMessage(2, field_names[1], GeoDistanceSort); + } + if (hasScoreSort) { + output.WriteMessage(3, field_names[3], ScoreSort); + } + if (hasPkSort) { + output.WriteMessage(4, field_names[2], PkSort); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldSort) { + size += pb::CodedOutputStream.ComputeMessageSize(1, FieldSort); + } + if (hasGeoDistanceSort) { + size += pb::CodedOutputStream.ComputeMessageSize(2, GeoDistanceSort); + } + if (hasScoreSort) { + size += pb::CodedOutputStream.ComputeMessageSize(3, ScoreSort); + } + if (hasPkSort) { + size += pb::CodedOutputStream.ComputeMessageSize(4, PkSort); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static Sorter ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Sorter ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Sorter ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Sorter ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Sorter ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Sorter ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Sorter ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Sorter ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Sorter ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Sorter ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Sorter MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Sorter prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Sorter cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Sorter result; + + private Sorter PrepareBuilder() { + if (resultIsReadOnly) { + Sorter original = result; + result = new Sorter(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Sorter MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Sorter.Descriptor; } + } + + public override Sorter DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Sorter.DefaultInstance; } + } + + public override Sorter BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Sorter) { + return MergeFrom((Sorter) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Sorter other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.Sorter.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldSort) { + MergeFieldSort(other.FieldSort); + } + if (other.HasGeoDistanceSort) { + MergeGeoDistanceSort(other.GeoDistanceSort); + } + if (other.HasScoreSort) { + MergeScoreSort(other.ScoreSort); + } + if (other.HasPkSort) { + MergePkSort(other.PkSort); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_sorterFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _sorterFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.FieldSort.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.FieldSort.CreateBuilder(); + if (result.hasFieldSort) { + subBuilder.MergeFrom(FieldSort); + } + input.ReadMessage(subBuilder, extensionRegistry); + FieldSort = subBuilder.BuildPartial(); + break; + } + case 18: { + global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort.CreateBuilder(); + if (result.hasGeoDistanceSort) { + subBuilder.MergeFrom(GeoDistanceSort); + } + input.ReadMessage(subBuilder, extensionRegistry); + GeoDistanceSort = subBuilder.BuildPartial(); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort.CreateBuilder(); + if (result.hasScoreSort) { + subBuilder.MergeFrom(ScoreSort); + } + input.ReadMessage(subBuilder, extensionRegistry); + ScoreSort = subBuilder.BuildPartial(); + break; + } + case 34: { + global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort.CreateBuilder(); + if (result.hasPkSort) { + subBuilder.MergeFrom(PkSort); + } + input.ReadMessage(subBuilder, extensionRegistry); + PkSort = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldSort { + get { return result.hasFieldSort; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.FieldSort FieldSort { + get { return result.FieldSort; } + set { SetFieldSort(value); } + } + public Builder SetFieldSort(global::com.alicloud.openservices.tablestore.core.protocol.FieldSort value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldSort = true; + result.fieldSort_ = value; + return this; + } + public Builder SetFieldSort(global::com.alicloud.openservices.tablestore.core.protocol.FieldSort.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasFieldSort = true; + result.fieldSort_ = builderForValue.Build(); + return this; + } + public Builder MergeFieldSort(global::com.alicloud.openservices.tablestore.core.protocol.FieldSort value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasFieldSort && + result.fieldSort_ != global::com.alicloud.openservices.tablestore.core.protocol.FieldSort.DefaultInstance) { + result.fieldSort_ = global::com.alicloud.openservices.tablestore.core.protocol.FieldSort.CreateBuilder(result.fieldSort_).MergeFrom(value).BuildPartial(); + } else { + result.fieldSort_ = value; + } + result.hasFieldSort = true; + return this; + } + public Builder ClearFieldSort() { + PrepareBuilder(); + result.hasFieldSort = false; + result.fieldSort_ = null; + return this; + } + + public bool HasGeoDistanceSort { + get { return result.hasGeoDistanceSort; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort GeoDistanceSort { + get { return result.GeoDistanceSort; } + set { SetGeoDistanceSort(value); } + } + public Builder SetGeoDistanceSort(global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasGeoDistanceSort = true; + result.geoDistanceSort_ = value; + return this; + } + public Builder SetGeoDistanceSort(global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasGeoDistanceSort = true; + result.geoDistanceSort_ = builderForValue.Build(); + return this; + } + public Builder MergeGeoDistanceSort(global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasGeoDistanceSort && + result.geoDistanceSort_ != global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort.DefaultInstance) { + result.geoDistanceSort_ = global::com.alicloud.openservices.tablestore.core.protocol.GeoDistanceSort.CreateBuilder(result.geoDistanceSort_).MergeFrom(value).BuildPartial(); + } else { + result.geoDistanceSort_ = value; + } + result.hasGeoDistanceSort = true; + return this; + } + public Builder ClearGeoDistanceSort() { + PrepareBuilder(); + result.hasGeoDistanceSort = false; + result.geoDistanceSort_ = null; + return this; + } + + public bool HasScoreSort { + get { return result.hasScoreSort; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort ScoreSort { + get { return result.ScoreSort; } + set { SetScoreSort(value); } + } + public Builder SetScoreSort(global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasScoreSort = true; + result.scoreSort_ = value; + return this; + } + public Builder SetScoreSort(global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasScoreSort = true; + result.scoreSort_ = builderForValue.Build(); + return this; + } + public Builder MergeScoreSort(global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasScoreSort && + result.scoreSort_ != global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort.DefaultInstance) { + result.scoreSort_ = global::com.alicloud.openservices.tablestore.core.protocol.ScoreSort.CreateBuilder(result.scoreSort_).MergeFrom(value).BuildPartial(); + } else { + result.scoreSort_ = value; + } + result.hasScoreSort = true; + return this; + } + public Builder ClearScoreSort() { + PrepareBuilder(); + result.hasScoreSort = false; + result.scoreSort_ = null; + return this; + } + + public bool HasPkSort { + get { return result.hasPkSort; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort PkSort { + get { return result.PkSort; } + set { SetPkSort(value); } + } + public Builder SetPkSort(global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasPkSort = true; + result.pkSort_ = value; + return this; + } + public Builder SetPkSort(global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasPkSort = true; + result.pkSort_ = builderForValue.Build(); + return this; + } + public Builder MergePkSort(global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasPkSort && + result.pkSort_ != global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort.DefaultInstance) { + result.pkSort_ = global::com.alicloud.openservices.tablestore.core.protocol.PrimaryKeySort.CreateBuilder(result.pkSort_).MergeFrom(value).BuildPartial(); + } else { + result.pkSort_ = value; + } + result.hasPkSort = true; + return this; + } + public Builder ClearPkSort() { + PrepareBuilder(); + result.hasPkSort = false; + result.pkSort_ = null; + return this; + } + } + static Sorter() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Sort : pb::GeneratedMessage { + private Sort() { } + private static readonly Sort defaultInstance = new Sort().MakeReadOnly(); + private static readonly string[] _sortFieldNames = new string[] { "sorter" }; + private static readonly uint[] _sortFieldTags = new uint[] { 10 }; + public static Sort DefaultInstance { + get { return defaultInstance; } + } + + public override Sort DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override Sort ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_Sort__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_Sort__FieldAccessorTable; } + } + + public const int SorterFieldNumber = 1; + private pbc::PopsicleList sorter_ = new pbc::PopsicleList(); + public scg::IList SorterList { + get { return sorter_; } + } + public int SorterCount { + get { return sorter_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Sorter GetSorter(int index) { + return sorter_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _sortFieldNames; + if (sorter_.Count > 0) { + output.WriteMessageArray(1, field_names[0], sorter_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.Sorter element in SorterList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static Sort ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Sort ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Sort ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static Sort ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static Sort ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Sort ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static Sort ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static Sort ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static Sort ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static Sort ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private Sort MakeReadOnly() { + sorter_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(Sort prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(Sort cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private Sort result; + + private Sort PrepareBuilder() { + if (resultIsReadOnly) { + Sort original = result; + result = new Sort(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override Sort MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Sort.Descriptor; } + } + + public override Sort DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.Sort.DefaultInstance; } + } + + public override Sort BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is Sort) { + return MergeFrom((Sort) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(Sort other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.Sort.DefaultInstance) return this; + PrepareBuilder(); + if (other.sorter_.Count != 0) { + result.sorter_.Add(other.sorter_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_sortFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _sortFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.sorter_, global::com.alicloud.openservices.tablestore.core.protocol.Sorter.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList SorterList { + get { return PrepareBuilder().sorter_; } + } + public int SorterCount { + get { return result.SorterCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Sorter GetSorter(int index) { + return result.GetSorter(index); + } + public Builder SetSorter(int index, global::com.alicloud.openservices.tablestore.core.protocol.Sorter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.sorter_[index] = value; + return this; + } + public Builder SetSorter(int index, global::com.alicloud.openservices.tablestore.core.protocol.Sorter.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.sorter_[index] = builderForValue.Build(); + return this; + } + public Builder AddSorter(global::com.alicloud.openservices.tablestore.core.protocol.Sorter value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.sorter_.Add(value); + return this; + } + public Builder AddSorter(global::com.alicloud.openservices.tablestore.core.protocol.Sorter.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.sorter_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeSorter(scg::IEnumerable values) { + PrepareBuilder(); + result.sorter_.Add(values); + return this; + } + public Builder ClearSorter() { + PrepareBuilder(); + result.sorter_.Clear(); + return this; + } + } + static Sort() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SearchQuery : pb::GeneratedMessage { + private SearchQuery() { } + private static readonly SearchQuery defaultInstance = new SearchQuery().MakeReadOnly(); + private static readonly string[] _searchQueryFieldNames = new string[] { "collapse", "getTotalCount", "limit", "offset", "query", "sort", "token" }; + private static readonly uint[] _searchQueryFieldTags = new uint[] { 42, 64, 16, 8, 34, 50, 74 }; + public static SearchQuery DefaultInstance { + get { return defaultInstance; } + } + + public override SearchQuery DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SearchQuery ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchQuery__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchQuery__FieldAccessorTable; } + } + + public const int OffsetFieldNumber = 1; + private bool hasOffset; + private int offset_; + public bool HasOffset { + get { return hasOffset; } + } + public int Offset { + get { return offset_; } + } + + public const int LimitFieldNumber = 2; + private bool hasLimit; + private int limit_; + public bool HasLimit { + get { return hasLimit; } + } + public int Limit { + get { return limit_; } + } + + public const int QueryFieldNumber = 4; + private bool hasQuery; + private global::com.alicloud.openservices.tablestore.core.protocol.Query query_; + public bool HasQuery { + get { return hasQuery; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query Query { + get { return query_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance; } + } + + public const int CollapseFieldNumber = 5; + private bool hasCollapse; + private global::com.alicloud.openservices.tablestore.core.protocol.Collapse collapse_; + public bool HasCollapse { + get { return hasCollapse; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Collapse Collapse { + get { return collapse_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Collapse.DefaultInstance; } + } + + public const int SortFieldNumber = 6; + private bool hasSort; + private global::com.alicloud.openservices.tablestore.core.protocol.Sort sort_; + public bool HasSort { + get { return hasSort; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Sort Sort { + get { return sort_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Sort.DefaultInstance; } + } + + public const int GetTotalCountFieldNumber = 8; + private bool hasGetTotalCount; + private bool getTotalCount_; + public bool HasGetTotalCount { + get { return hasGetTotalCount; } + } + public bool GetTotalCount { + get { return getTotalCount_; } + } + + public const int TokenFieldNumber = 9; + private bool hasToken; + private pb::ByteString token_ = pb::ByteString.Empty; + public bool HasToken { + get { return hasToken; } + } + public pb::ByteString Token { + get { return token_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _searchQueryFieldNames; + if (hasOffset) { + output.WriteInt32(1, field_names[3], Offset); + } + if (hasLimit) { + output.WriteInt32(2, field_names[2], Limit); + } + if (hasQuery) { + output.WriteMessage(4, field_names[4], Query); + } + if (hasCollapse) { + output.WriteMessage(5, field_names[0], Collapse); + } + if (hasSort) { + output.WriteMessage(6, field_names[5], Sort); + } + if (hasGetTotalCount) { + output.WriteBool(8, field_names[1], GetTotalCount); + } + if (hasToken) { + output.WriteBytes(9, field_names[6], Token); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasOffset) { + size += pb::CodedOutputStream.ComputeInt32Size(1, Offset); + } + if (hasLimit) { + size += pb::CodedOutputStream.ComputeInt32Size(2, Limit); + } + if (hasQuery) { + size += pb::CodedOutputStream.ComputeMessageSize(4, Query); + } + if (hasCollapse) { + size += pb::CodedOutputStream.ComputeMessageSize(5, Collapse); + } + if (hasSort) { + size += pb::CodedOutputStream.ComputeMessageSize(6, Sort); + } + if (hasGetTotalCount) { + size += pb::CodedOutputStream.ComputeBoolSize(8, GetTotalCount); + } + if (hasToken) { + size += pb::CodedOutputStream.ComputeBytesSize(9, Token); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static SearchQuery ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchQuery ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchQuery ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchQuery ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchQuery ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchQuery ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SearchQuery ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SearchQuery ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SearchQuery ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchQuery ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SearchQuery MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SearchQuery prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SearchQuery cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SearchQuery result; + + private SearchQuery PrepareBuilder() { + if (resultIsReadOnly) { + SearchQuery original = result; + result = new SearchQuery(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SearchQuery MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.SearchQuery.Descriptor; } + } + + public override SearchQuery DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.SearchQuery.DefaultInstance; } + } + + public override SearchQuery BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SearchQuery) { + return MergeFrom((SearchQuery) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SearchQuery other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.SearchQuery.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasOffset) { + Offset = other.Offset; + } + if (other.HasLimit) { + Limit = other.Limit; + } + if (other.HasQuery) { + MergeQuery(other.Query); + } + if (other.HasCollapse) { + MergeCollapse(other.Collapse); + } + if (other.HasSort) { + MergeSort(other.Sort); + } + if (other.HasGetTotalCount) { + GetTotalCount = other.GetTotalCount; + } + if (other.HasToken) { + Token = other.Token; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_searchQueryFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _searchQueryFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasOffset = input.ReadInt32(ref result.offset_); + break; + } + case 16: { + result.hasLimit = input.ReadInt32(ref result.limit_); + break; + } + case 34: { + global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Query.CreateBuilder(); + if (result.hasQuery) { + subBuilder.MergeFrom(Query); + } + input.ReadMessage(subBuilder, extensionRegistry); + Query = subBuilder.BuildPartial(); + break; + } + case 42: { + global::com.alicloud.openservices.tablestore.core.protocol.Collapse.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Collapse.CreateBuilder(); + if (result.hasCollapse) { + subBuilder.MergeFrom(Collapse); + } + input.ReadMessage(subBuilder, extensionRegistry); + Collapse = subBuilder.BuildPartial(); + break; + } + case 50: { + global::com.alicloud.openservices.tablestore.core.protocol.Sort.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Sort.CreateBuilder(); + if (result.hasSort) { + subBuilder.MergeFrom(Sort); + } + input.ReadMessage(subBuilder, extensionRegistry); + Sort = subBuilder.BuildPartial(); + break; + } + case 64: { + result.hasGetTotalCount = input.ReadBool(ref result.getTotalCount_); + break; + } + case 74: { + result.hasToken = input.ReadBytes(ref result.token_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasOffset { + get { return result.hasOffset; } + } + public int Offset { + get { return result.Offset; } + set { SetOffset(value); } + } + public Builder SetOffset(int value) { + PrepareBuilder(); + result.hasOffset = true; + result.offset_ = value; + return this; + } + public Builder ClearOffset() { + PrepareBuilder(); + result.hasOffset = false; + result.offset_ = 0; + return this; + } + + public bool HasLimit { + get { return result.hasLimit; } + } + public int Limit { + get { return result.Limit; } + set { SetLimit(value); } + } + public Builder SetLimit(int value) { + PrepareBuilder(); + result.hasLimit = true; + result.limit_ = value; + return this; + } + public Builder ClearLimit() { + PrepareBuilder(); + result.hasLimit = false; + result.limit_ = 0; + return this; + } + + public bool HasQuery { + get { return result.hasQuery; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Query Query { + get { return result.Query; } + set { SetQuery(value); } + } + public Builder SetQuery(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasQuery = true; + result.query_ = value; + return this; + } + public Builder SetQuery(global::com.alicloud.openservices.tablestore.core.protocol.Query.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasQuery = true; + result.query_ = builderForValue.Build(); + return this; + } + public Builder MergeQuery(global::com.alicloud.openservices.tablestore.core.protocol.Query value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasQuery && + result.query_ != global::com.alicloud.openservices.tablestore.core.protocol.Query.DefaultInstance) { + result.query_ = global::com.alicloud.openservices.tablestore.core.protocol.Query.CreateBuilder(result.query_).MergeFrom(value).BuildPartial(); + } else { + result.query_ = value; + } + result.hasQuery = true; + return this; + } + public Builder ClearQuery() { + PrepareBuilder(); + result.hasQuery = false; + result.query_ = null; + return this; + } + + public bool HasCollapse { + get { return result.hasCollapse; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Collapse Collapse { + get { return result.Collapse; } + set { SetCollapse(value); } + } + public Builder SetCollapse(global::com.alicloud.openservices.tablestore.core.protocol.Collapse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasCollapse = true; + result.collapse_ = value; + return this; + } + public Builder SetCollapse(global::com.alicloud.openservices.tablestore.core.protocol.Collapse.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasCollapse = true; + result.collapse_ = builderForValue.Build(); + return this; + } + public Builder MergeCollapse(global::com.alicloud.openservices.tablestore.core.protocol.Collapse value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasCollapse && + result.collapse_ != global::com.alicloud.openservices.tablestore.core.protocol.Collapse.DefaultInstance) { + result.collapse_ = global::com.alicloud.openservices.tablestore.core.protocol.Collapse.CreateBuilder(result.collapse_).MergeFrom(value).BuildPartial(); + } else { + result.collapse_ = value; + } + result.hasCollapse = true; + return this; + } + public Builder ClearCollapse() { + PrepareBuilder(); + result.hasCollapse = false; + result.collapse_ = null; + return this; + } + + public bool HasSort { + get { return result.hasSort; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Sort Sort { + get { return result.Sort; } + set { SetSort(value); } + } + public Builder SetSort(global::com.alicloud.openservices.tablestore.core.protocol.Sort value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSort = true; + result.sort_ = value; + return this; + } + public Builder SetSort(global::com.alicloud.openservices.tablestore.core.protocol.Sort.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSort = true; + result.sort_ = builderForValue.Build(); + return this; + } + public Builder MergeSort(global::com.alicloud.openservices.tablestore.core.protocol.Sort value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSort && + result.sort_ != global::com.alicloud.openservices.tablestore.core.protocol.Sort.DefaultInstance) { + result.sort_ = global::com.alicloud.openservices.tablestore.core.protocol.Sort.CreateBuilder(result.sort_).MergeFrom(value).BuildPartial(); + } else { + result.sort_ = value; + } + result.hasSort = true; + return this; + } + public Builder ClearSort() { + PrepareBuilder(); + result.hasSort = false; + result.sort_ = null; + return this; + } + + public bool HasGetTotalCount { + get { return result.hasGetTotalCount; } + } + public bool GetTotalCount { + get { return result.GetTotalCount; } + set { SetGetTotalCount(value); } + } + public Builder SetGetTotalCount(bool value) { + PrepareBuilder(); + result.hasGetTotalCount = true; + result.getTotalCount_ = value; + return this; + } + public Builder ClearGetTotalCount() { + PrepareBuilder(); + result.hasGetTotalCount = false; + result.getTotalCount_ = false; + return this; + } + + public bool HasToken { + get { return result.hasToken; } + } + public pb::ByteString Token { + get { return result.Token; } + set { SetToken(value); } + } + public Builder SetToken(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasToken = true; + result.token_ = value; + return this; + } + public Builder ClearToken() { + PrepareBuilder(); + result.hasToken = false; + result.token_ = pb::ByteString.Empty; + return this; + } + } + static SearchQuery() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ColumnsToGet : pb::GeneratedMessage { + private ColumnsToGet() { } + private static readonly ColumnsToGet defaultInstance = new ColumnsToGet().MakeReadOnly(); + private static readonly string[] _columnsToGetFieldNames = new string[] { "column_names", "return_type" }; + private static readonly uint[] _columnsToGetFieldTags = new uint[] { 18, 8 }; + public static ColumnsToGet DefaultInstance { + get { return defaultInstance; } + } + + public override ColumnsToGet DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ColumnsToGet ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnsToGet__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_ColumnsToGet__FieldAccessorTable; } + } + + public const int ReturnTypeFieldNumber = 1; + private bool hasReturnType; + private global::com.alicloud.openservices.tablestore.core.protocol.ColumnReturnType returnType_ = global::com.alicloud.openservices.tablestore.core.protocol.ColumnReturnType.RETURN_ALL; + public bool HasReturnType { + get { return hasReturnType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ColumnReturnType ReturnType { + get { return returnType_; } + } + + public const int ColumnNamesFieldNumber = 2; + private pbc::PopsicleList columnNames_ = new pbc::PopsicleList(); + public scg::IList ColumnNamesList { + get { return pbc::Lists.AsReadOnly(columnNames_); } + } + public int ColumnNamesCount { + get { return columnNames_.Count; } + } + public string GetColumnNames(int index) { + return columnNames_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _columnsToGetFieldNames; + if (hasReturnType) { + output.WriteEnum(1, field_names[1], (int) ReturnType, ReturnType); + } + if (columnNames_.Count > 0) { + output.WriteStringArray(2, field_names[0], columnNames_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasReturnType) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) ReturnType); + } + { + int dataSize = 0; + foreach (string element in ColumnNamesList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * columnNames_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ColumnsToGet ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ColumnsToGet ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ColumnsToGet ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ColumnsToGet ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ColumnsToGet ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ColumnsToGet ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ColumnsToGet ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ColumnsToGet ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ColumnsToGet ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ColumnsToGet ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ColumnsToGet MakeReadOnly() { + columnNames_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ColumnsToGet prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ColumnsToGet cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ColumnsToGet result; + + private ColumnsToGet PrepareBuilder() { + if (resultIsReadOnly) { + ColumnsToGet original = result; + result = new ColumnsToGet(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ColumnsToGet MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet.Descriptor; } + } + + public override ColumnsToGet DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet.DefaultInstance; } + } + + public override ColumnsToGet BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ColumnsToGet) { + return MergeFrom((ColumnsToGet) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ColumnsToGet other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasReturnType) { + ReturnType = other.ReturnType; + } + if (other.columnNames_.Count != 0) { + result.columnNames_.Add(other.columnNames_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_columnsToGetFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _columnsToGetFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.returnType_, out unknown)) { + result.hasReturnType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + case 18: { + input.ReadStringArray(tag, field_name, result.columnNames_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasReturnType { + get { return result.hasReturnType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ColumnReturnType ReturnType { + get { return result.ReturnType; } + set { SetReturnType(value); } + } + public Builder SetReturnType(global::com.alicloud.openservices.tablestore.core.protocol.ColumnReturnType value) { + PrepareBuilder(); + result.hasReturnType = true; + result.returnType_ = value; + return this; + } + public Builder ClearReturnType() { + PrepareBuilder(); + result.hasReturnType = false; + result.returnType_ = global::com.alicloud.openservices.tablestore.core.protocol.ColumnReturnType.RETURN_ALL; + return this; + } + + public pbc::IPopsicleList ColumnNamesList { + get { return PrepareBuilder().columnNames_; } + } + public int ColumnNamesCount { + get { return result.ColumnNamesCount; } + } + public string GetColumnNames(int index) { + return result.GetColumnNames(index); + } + public Builder SetColumnNames(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.columnNames_[index] = value; + return this; + } + public Builder AddColumnNames(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.columnNames_.Add(value); + return this; + } + public Builder AddRangeColumnNames(scg::IEnumerable values) { + PrepareBuilder(); + result.columnNames_.Add(values); + return this; + } + public Builder ClearColumnNames() { + PrepareBuilder(); + result.columnNames_.Clear(); + return this; + } + } + static ColumnsToGet() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SearchRequest : pb::GeneratedMessage { + private SearchRequest() { } + private static readonly SearchRequest defaultInstance = new SearchRequest().MakeReadOnly(); + private static readonly string[] _searchRequestFieldNames = new string[] { "columns_to_get", "index_name", "routing_values", "search_query", "table_name" }; + private static readonly uint[] _searchRequestFieldTags = new uint[] { 26, 18, 42, 34, 10 }; + public static SearchRequest DefaultInstance { + get { return defaultInstance; } + } + + public override SearchRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SearchRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int IndexNameFieldNumber = 2; + private bool hasIndexName; + private string indexName_ = ""; + public bool HasIndexName { + get { return hasIndexName; } + } + public string IndexName { + get { return indexName_; } + } + + public const int ColumnsToGetFieldNumber = 3; + private bool hasColumnsToGet; + private global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet columnsToGet_; + public bool HasColumnsToGet { + get { return hasColumnsToGet; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet ColumnsToGet { + get { return columnsToGet_ ?? global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet.DefaultInstance; } + } + + public const int SearchQueryFieldNumber = 4; + private bool hasSearchQuery; + private pb::ByteString searchQuery_ = pb::ByteString.Empty; + public bool HasSearchQuery { + get { return hasSearchQuery; } + } + public pb::ByteString SearchQuery { + get { return searchQuery_; } + } + + public const int RoutingValuesFieldNumber = 5; + private pbc::PopsicleList routingValues_ = new pbc::PopsicleList(); + public scg::IList RoutingValuesList { + get { return pbc::Lists.AsReadOnly(routingValues_); } + } + public int RoutingValuesCount { + get { return routingValues_.Count; } + } + public pb::ByteString GetRoutingValues(int index) { + return routingValues_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _searchRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[4], TableName); + } + if (hasIndexName) { + output.WriteString(2, field_names[1], IndexName); + } + if (hasColumnsToGet) { + output.WriteMessage(3, field_names[0], ColumnsToGet); + } + if (hasSearchQuery) { + output.WriteBytes(4, field_names[3], SearchQuery); + } + if (routingValues_.Count > 0) { + output.WriteBytesArray(5, field_names[2], routingValues_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + if (hasIndexName) { + size += pb::CodedOutputStream.ComputeStringSize(2, IndexName); + } + if (hasColumnsToGet) { + size += pb::CodedOutputStream.ComputeMessageSize(3, ColumnsToGet); + } + if (hasSearchQuery) { + size += pb::CodedOutputStream.ComputeBytesSize(4, SearchQuery); + } + { + int dataSize = 0; + foreach (pb::ByteString element in RoutingValuesList) { + dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); + } + size += dataSize; + size += 1 * routingValues_.Count; + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static SearchRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SearchRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SearchRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SearchRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SearchRequest MakeReadOnly() { + routingValues_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SearchRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SearchRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SearchRequest result; + + private SearchRequest PrepareBuilder() { + if (resultIsReadOnly) { + SearchRequest original = result; + result = new SearchRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SearchRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.SearchRequest.Descriptor; } + } + + public override SearchRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.SearchRequest.DefaultInstance; } + } + + public override SearchRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SearchRequest) { + return MergeFrom((SearchRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SearchRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.SearchRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasIndexName) { + IndexName = other.IndexName; + } + if (other.HasColumnsToGet) { + MergeColumnsToGet(other.ColumnsToGet); + } + if (other.HasSearchQuery) { + SearchQuery = other.SearchQuery; + } + if (other.routingValues_.Count != 0) { + result.routingValues_.Add(other.routingValues_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_searchRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _searchRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + result.hasIndexName = input.ReadString(ref result.indexName_); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet.CreateBuilder(); + if (result.hasColumnsToGet) { + subBuilder.MergeFrom(ColumnsToGet); + } + input.ReadMessage(subBuilder, extensionRegistry); + ColumnsToGet = subBuilder.BuildPartial(); + break; + } + case 34: { + result.hasSearchQuery = input.ReadBytes(ref result.searchQuery_); + break; + } + case 42: { + input.ReadBytesArray(tag, field_name, result.routingValues_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasIndexName { + get { return result.hasIndexName; } + } + public string IndexName { + get { return result.IndexName; } + set { SetIndexName(value); } + } + public Builder SetIndexName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasIndexName = true; + result.indexName_ = value; + return this; + } + public Builder ClearIndexName() { + PrepareBuilder(); + result.hasIndexName = false; + result.indexName_ = ""; + return this; + } + + public bool HasColumnsToGet { + get { return result.hasColumnsToGet; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet ColumnsToGet { + get { return result.ColumnsToGet; } + set { SetColumnsToGet(value); } + } + public Builder SetColumnsToGet(global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasColumnsToGet = true; + result.columnsToGet_ = value; + return this; + } + public Builder SetColumnsToGet(global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasColumnsToGet = true; + result.columnsToGet_ = builderForValue.Build(); + return this; + } + public Builder MergeColumnsToGet(global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasColumnsToGet && + result.columnsToGet_ != global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet.DefaultInstance) { + result.columnsToGet_ = global::com.alicloud.openservices.tablestore.core.protocol.ColumnsToGet.CreateBuilder(result.columnsToGet_).MergeFrom(value).BuildPartial(); + } else { + result.columnsToGet_ = value; + } + result.hasColumnsToGet = true; + return this; + } + public Builder ClearColumnsToGet() { + PrepareBuilder(); + result.hasColumnsToGet = false; + result.columnsToGet_ = null; + return this; + } + + public bool HasSearchQuery { + get { return result.hasSearchQuery; } + } + public pb::ByteString SearchQuery { + get { return result.SearchQuery; } + set { SetSearchQuery(value); } + } + public Builder SetSearchQuery(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSearchQuery = true; + result.searchQuery_ = value; + return this; + } + public Builder ClearSearchQuery() { + PrepareBuilder(); + result.hasSearchQuery = false; + result.searchQuery_ = pb::ByteString.Empty; + return this; + } + + public pbc::IPopsicleList RoutingValuesList { + get { return PrepareBuilder().routingValues_; } + } + public int RoutingValuesCount { + get { return result.RoutingValuesCount; } + } + public pb::ByteString GetRoutingValues(int index) { + return result.GetRoutingValues(index); + } + public Builder SetRoutingValues(int index, pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.routingValues_[index] = value; + return this; + } + public Builder AddRoutingValues(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.routingValues_.Add(value); + return this; + } + public Builder AddRangeRoutingValues(scg::IEnumerable values) { + PrepareBuilder(); + result.routingValues_.Add(values); + return this; + } + public Builder ClearRoutingValues() { + PrepareBuilder(); + result.routingValues_.Clear(); + return this; + } + } + static SearchRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SearchResponse : pb::GeneratedMessage { + private SearchResponse() { } + private static readonly SearchResponse defaultInstance = new SearchResponse().MakeReadOnly(); + private static readonly string[] _searchResponseFieldNames = new string[] { "is_all_succeeded", "next_token", "rows", "total_hits" }; + private static readonly uint[] _searchResponseFieldTags = new uint[] { 24, 50, 18, 8 }; + public static SearchResponse DefaultInstance { + get { return defaultInstance; } + } + + public override SearchResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SearchResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_SearchResponse__FieldAccessorTable; } + } + + public const int TotalHitsFieldNumber = 1; + private bool hasTotalHits; + private long totalHits_; + public bool HasTotalHits { + get { return hasTotalHits; } + } + public long TotalHits { + get { return totalHits_; } + } + + public const int RowsFieldNumber = 2; + private pbc::PopsicleList rows_ = new pbc::PopsicleList(); + public scg::IList RowsList { + get { return pbc::Lists.AsReadOnly(rows_); } + } + public int RowsCount { + get { return rows_.Count; } + } + public pb::ByteString GetRows(int index) { + return rows_[index]; + } + + public const int IsAllSucceededFieldNumber = 3; + private bool hasIsAllSucceeded; + private bool isAllSucceeded_; + public bool HasIsAllSucceeded { + get { return hasIsAllSucceeded; } + } + public bool IsAllSucceeded { + get { return isAllSucceeded_; } + } + + public const int NextTokenFieldNumber = 6; + private bool hasNextToken; + private pb::ByteString nextToken_ = pb::ByteString.Empty; + public bool HasNextToken { + get { return hasNextToken; } + } + public pb::ByteString NextToken { + get { return nextToken_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _searchResponseFieldNames; + if (hasTotalHits) { + output.WriteInt64(1, field_names[3], TotalHits); + } + if (rows_.Count > 0) { + output.WriteBytesArray(2, field_names[2], rows_); + } + if (hasIsAllSucceeded) { + output.WriteBool(3, field_names[0], IsAllSucceeded); + } + if (hasNextToken) { + output.WriteBytes(6, field_names[1], NextToken); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTotalHits) { + size += pb::CodedOutputStream.ComputeInt64Size(1, TotalHits); + } + { + int dataSize = 0; + foreach (pb::ByteString element in RowsList) { + dataSize += pb::CodedOutputStream.ComputeBytesSizeNoTag(element); + } + size += dataSize; + size += 1 * rows_.Count; + } + if (hasIsAllSucceeded) { + size += pb::CodedOutputStream.ComputeBoolSize(3, IsAllSucceeded); + } + if (hasNextToken) { + size += pb::CodedOutputStream.ComputeBytesSize(6, NextToken); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static SearchResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SearchResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SearchResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SearchResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SearchResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SearchResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SearchResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SearchResponse MakeReadOnly() { + rows_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SearchResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SearchResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SearchResponse result; + + private SearchResponse PrepareBuilder() { + if (resultIsReadOnly) { + SearchResponse original = result; + result = new SearchResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SearchResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.SearchResponse.Descriptor; } + } + + public override SearchResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.SearchResponse.DefaultInstance; } + } + + public override SearchResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SearchResponse) { + return MergeFrom((SearchResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SearchResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.SearchResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTotalHits) { + TotalHits = other.TotalHits; + } + if (other.rows_.Count != 0) { + result.rows_.Add(other.rows_); + } + if (other.HasIsAllSucceeded) { + IsAllSucceeded = other.IsAllSucceeded; + } + if (other.HasNextToken) { + NextToken = other.NextToken; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_searchResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _searchResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasTotalHits = input.ReadInt64(ref result.totalHits_); + break; + } + case 18: { + input.ReadBytesArray(tag, field_name, result.rows_); + break; + } + case 24: { + result.hasIsAllSucceeded = input.ReadBool(ref result.isAllSucceeded_); + break; + } + case 50: { + result.hasNextToken = input.ReadBytes(ref result.nextToken_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTotalHits { + get { return result.hasTotalHits; } + } + public long TotalHits { + get { return result.TotalHits; } + set { SetTotalHits(value); } + } + public Builder SetTotalHits(long value) { + PrepareBuilder(); + result.hasTotalHits = true; + result.totalHits_ = value; + return this; + } + public Builder ClearTotalHits() { + PrepareBuilder(); + result.hasTotalHits = false; + result.totalHits_ = 0L; + return this; + } + + public pbc::IPopsicleList RowsList { + get { return PrepareBuilder().rows_; } + } + public int RowsCount { + get { return result.RowsCount; } + } + public pb::ByteString GetRows(int index) { + return result.GetRows(index); + } + public Builder SetRows(int index, pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.rows_[index] = value; + return this; + } + public Builder AddRows(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.rows_.Add(value); + return this; + } + public Builder AddRangeRows(scg::IEnumerable values) { + PrepareBuilder(); + result.rows_.Add(values); + return this; + } + public Builder ClearRows() { + PrepareBuilder(); + result.rows_.Clear(); + return this; + } + + public bool HasIsAllSucceeded { + get { return result.hasIsAllSucceeded; } + } + public bool IsAllSucceeded { + get { return result.IsAllSucceeded; } + set { SetIsAllSucceeded(value); } + } + public Builder SetIsAllSucceeded(bool value) { + PrepareBuilder(); + result.hasIsAllSucceeded = true; + result.isAllSucceeded_ = value; + return this; + } + public Builder ClearIsAllSucceeded() { + PrepareBuilder(); + result.hasIsAllSucceeded = false; + result.isAllSucceeded_ = false; + return this; + } + + public bool HasNextToken { + get { return result.hasNextToken; } + } + public pb::ByteString NextToken { + get { return result.NextToken; } + set { SetNextToken(value); } + } + public Builder SetNextToken(pb::ByteString value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasNextToken = true; + result.nextToken_ = value; + return this; + } + public Builder ClearNextToken() { + PrepareBuilder(); + result.hasNextToken = false; + result.nextToken_ = pb::ByteString.Empty; + return this; + } + } + static SearchResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class FieldSchema : pb::GeneratedMessage { + private FieldSchema() { } + private static readonly FieldSchema defaultInstance = new FieldSchema().MakeReadOnly(); + private static readonly string[] _fieldSchemaFieldNames = new string[] { "analyzer", "doc_values", "field_name", "field_schemas", "field_type", "index", "index_options", "is_array", "store" }; + private static readonly uint[] _fieldSchemaFieldTags = new uint[] { 34, 48, 10, 66, 16, 40, 24, 72, 56 }; + public static FieldSchema DefaultInstance { + get { return defaultInstance; } + } + + public override FieldSchema DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override FieldSchema ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSchema__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_FieldSchema__FieldAccessorTable; } + } + + public const int FieldNameFieldNumber = 1; + private bool hasFieldName; + private string fieldName_ = ""; + public bool HasFieldName { + get { return hasFieldName; } + } + public string FieldName { + get { return fieldName_; } + } + + public const int FieldTypeFieldNumber = 2; + private bool hasFieldType; + private global::com.alicloud.openservices.tablestore.core.protocol.FieldType fieldType_ = global::com.alicloud.openservices.tablestore.core.protocol.FieldType.LONG; + public bool HasFieldType { + get { return hasFieldType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.FieldType FieldType { + get { return fieldType_; } + } + + public const int IndexOptionsFieldNumber = 3; + private bool hasIndexOptions; + private global::com.alicloud.openservices.tablestore.core.protocol.IndexOptions indexOptions_ = global::com.alicloud.openservices.tablestore.core.protocol.IndexOptions.DOCS; + public bool HasIndexOptions { + get { return hasIndexOptions; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexOptions IndexOptions { + get { return indexOptions_; } + } + + public const int AnalyzerFieldNumber = 4; + private bool hasAnalyzer; + private string analyzer_ = ""; + public bool HasAnalyzer { + get { return hasAnalyzer; } + } + public string Analyzer { + get { return analyzer_; } + } + + public const int IndexFieldNumber = 5; + private bool hasIndex; + private bool index_; + public bool HasIndex { + get { return hasIndex; } + } + public bool Index { + get { return index_; } + } + + public const int DocValuesFieldNumber = 6; + private bool hasDocValues; + private bool docValues_; + public bool HasDocValues { + get { return hasDocValues; } + } + public bool DocValues { + get { return docValues_; } + } + + public const int StoreFieldNumber = 7; + private bool hasStore; + private bool store_; + public bool HasStore { + get { return hasStore; } + } + public bool Store { + get { return store_; } + } + + public const int FieldSchemasFieldNumber = 8; + private pbc::PopsicleList fieldSchemas_ = new pbc::PopsicleList(); + public scg::IList FieldSchemasList { + get { return fieldSchemas_; } + } + public int FieldSchemasCount { + get { return fieldSchemas_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema GetFieldSchemas(int index) { + return fieldSchemas_[index]; + } + + public const int IsArrayFieldNumber = 9; + private bool hasIsArray; + private bool isArray_; + public bool HasIsArray { + get { return hasIsArray; } + } + public bool IsArray { + get { return isArray_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _fieldSchemaFieldNames; + if (hasFieldName) { + output.WriteString(1, field_names[2], FieldName); + } + if (hasFieldType) { + output.WriteEnum(2, field_names[4], (int) FieldType, FieldType); + } + if (hasIndexOptions) { + output.WriteEnum(3, field_names[6], (int) IndexOptions, IndexOptions); + } + if (hasAnalyzer) { + output.WriteString(4, field_names[0], Analyzer); + } + if (hasIndex) { + output.WriteBool(5, field_names[5], Index); + } + if (hasDocValues) { + output.WriteBool(6, field_names[1], DocValues); + } + if (hasStore) { + output.WriteBool(7, field_names[8], Store); + } + if (fieldSchemas_.Count > 0) { + output.WriteMessageArray(8, field_names[3], fieldSchemas_); + } + if (hasIsArray) { + output.WriteBool(9, field_names[7], IsArray); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasFieldName) { + size += pb::CodedOutputStream.ComputeStringSize(1, FieldName); + } + if (hasFieldType) { + size += pb::CodedOutputStream.ComputeEnumSize(2, (int) FieldType); + } + if (hasIndexOptions) { + size += pb::CodedOutputStream.ComputeEnumSize(3, (int) IndexOptions); + } + if (hasAnalyzer) { + size += pb::CodedOutputStream.ComputeStringSize(4, Analyzer); + } + if (hasIndex) { + size += pb::CodedOutputStream.ComputeBoolSize(5, Index); + } + if (hasDocValues) { + size += pb::CodedOutputStream.ComputeBoolSize(6, DocValues); + } + if (hasStore) { + size += pb::CodedOutputStream.ComputeBoolSize(7, Store); + } + foreach (global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema element in FieldSchemasList) { + size += pb::CodedOutputStream.ComputeMessageSize(8, element); + } + if (hasIsArray) { + size += pb::CodedOutputStream.ComputeBoolSize(9, IsArray); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static FieldSchema ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FieldSchema ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FieldSchema ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static FieldSchema ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static FieldSchema ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FieldSchema ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static FieldSchema ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static FieldSchema ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static FieldSchema ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static FieldSchema ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private FieldSchema MakeReadOnly() { + fieldSchemas_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(FieldSchema prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(FieldSchema cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private FieldSchema result; + + private FieldSchema PrepareBuilder() { + if (resultIsReadOnly) { + FieldSchema original = result; + result = new FieldSchema(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override FieldSchema MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema.Descriptor; } + } + + public override FieldSchema DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema.DefaultInstance; } + } + + public override FieldSchema BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is FieldSchema) { + return MergeFrom((FieldSchema) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(FieldSchema other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasFieldName) { + FieldName = other.FieldName; + } + if (other.HasFieldType) { + FieldType = other.FieldType; + } + if (other.HasIndexOptions) { + IndexOptions = other.IndexOptions; + } + if (other.HasAnalyzer) { + Analyzer = other.Analyzer; + } + if (other.HasIndex) { + Index = other.Index; + } + if (other.HasDocValues) { + DocValues = other.DocValues; + } + if (other.HasStore) { + Store = other.Store; + } + if (other.fieldSchemas_.Count != 0) { + result.fieldSchemas_.Add(other.fieldSchemas_); + } + if (other.HasIsArray) { + IsArray = other.IsArray; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_fieldSchemaFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _fieldSchemaFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasFieldName = input.ReadString(ref result.fieldName_); + break; + } + case 16: { + object unknown; + if(input.ReadEnum(ref result.fieldType_, out unknown)) { + result.hasFieldType = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(2, (ulong)(int)unknown); + } + break; + } + case 24: { + object unknown; + if(input.ReadEnum(ref result.indexOptions_, out unknown)) { + result.hasIndexOptions = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(3, (ulong)(int)unknown); + } + break; + } + case 34: { + result.hasAnalyzer = input.ReadString(ref result.analyzer_); + break; + } + case 40: { + result.hasIndex = input.ReadBool(ref result.index_); + break; + } + case 48: { + result.hasDocValues = input.ReadBool(ref result.docValues_); + break; + } + case 56: { + result.hasStore = input.ReadBool(ref result.store_); + break; + } + case 66: { + input.ReadMessageArray(tag, field_name, result.fieldSchemas_, global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema.DefaultInstance, extensionRegistry); + break; + } + case 72: { + result.hasIsArray = input.ReadBool(ref result.isArray_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasFieldName { + get { return result.hasFieldName; } + } + public string FieldName { + get { return result.FieldName; } + set { SetFieldName(value); } + } + public Builder SetFieldName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasFieldName = true; + result.fieldName_ = value; + return this; + } + public Builder ClearFieldName() { + PrepareBuilder(); + result.hasFieldName = false; + result.fieldName_ = ""; + return this; + } + + public bool HasFieldType { + get { return result.hasFieldType; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.FieldType FieldType { + get { return result.FieldType; } + set { SetFieldType(value); } + } + public Builder SetFieldType(global::com.alicloud.openservices.tablestore.core.protocol.FieldType value) { + PrepareBuilder(); + result.hasFieldType = true; + result.fieldType_ = value; + return this; + } + public Builder ClearFieldType() { + PrepareBuilder(); + result.hasFieldType = false; + result.fieldType_ = global::com.alicloud.openservices.tablestore.core.protocol.FieldType.LONG; + return this; + } + + public bool HasIndexOptions { + get { return result.hasIndexOptions; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexOptions IndexOptions { + get { return result.IndexOptions; } + set { SetIndexOptions(value); } + } + public Builder SetIndexOptions(global::com.alicloud.openservices.tablestore.core.protocol.IndexOptions value) { + PrepareBuilder(); + result.hasIndexOptions = true; + result.indexOptions_ = value; + return this; + } + public Builder ClearIndexOptions() { + PrepareBuilder(); + result.hasIndexOptions = false; + result.indexOptions_ = global::com.alicloud.openservices.tablestore.core.protocol.IndexOptions.DOCS; + return this; + } + + public bool HasAnalyzer { + get { return result.hasAnalyzer; } + } + public string Analyzer { + get { return result.Analyzer; } + set { SetAnalyzer(value); } + } + public Builder SetAnalyzer(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasAnalyzer = true; + result.analyzer_ = value; + return this; + } + public Builder ClearAnalyzer() { + PrepareBuilder(); + result.hasAnalyzer = false; + result.analyzer_ = ""; + return this; + } + + public bool HasIndex { + get { return result.hasIndex; } + } + public bool Index { + get { return result.Index; } + set { SetIndex(value); } + } + public Builder SetIndex(bool value) { + PrepareBuilder(); + result.hasIndex = true; + result.index_ = value; + return this; + } + public Builder ClearIndex() { + PrepareBuilder(); + result.hasIndex = false; + result.index_ = false; + return this; + } + + public bool HasDocValues { + get { return result.hasDocValues; } + } + public bool DocValues { + get { return result.DocValues; } + set { SetDocValues(value); } + } + public Builder SetDocValues(bool value) { + PrepareBuilder(); + result.hasDocValues = true; + result.docValues_ = value; + return this; + } + public Builder ClearDocValues() { + PrepareBuilder(); + result.hasDocValues = false; + result.docValues_ = false; + return this; + } + + public bool HasStore { + get { return result.hasStore; } + } + public bool Store { + get { return result.Store; } + set { SetStore(value); } + } + public Builder SetStore(bool value) { + PrepareBuilder(); + result.hasStore = true; + result.store_ = value; + return this; + } + public Builder ClearStore() { + PrepareBuilder(); + result.hasStore = false; + result.store_ = false; + return this; + } + + public pbc::IPopsicleList FieldSchemasList { + get { return PrepareBuilder().fieldSchemas_; } + } + public int FieldSchemasCount { + get { return result.FieldSchemasCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema GetFieldSchemas(int index) { + return result.GetFieldSchemas(index); + } + public Builder SetFieldSchemas(int index, global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.fieldSchemas_[index] = value; + return this; + } + public Builder SetFieldSchemas(int index, global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.fieldSchemas_[index] = builderForValue.Build(); + return this; + } + public Builder AddFieldSchemas(global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.fieldSchemas_.Add(value); + return this; + } + public Builder AddFieldSchemas(global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.fieldSchemas_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeFieldSchemas(scg::IEnumerable values) { + PrepareBuilder(); + result.fieldSchemas_.Add(values); + return this; + } + public Builder ClearFieldSchemas() { + PrepareBuilder(); + result.fieldSchemas_.Clear(); + return this; + } + + public bool HasIsArray { + get { return result.hasIsArray; } + } + public bool IsArray { + get { return result.IsArray; } + set { SetIsArray(value); } + } + public Builder SetIsArray(bool value) { + PrepareBuilder(); + result.hasIsArray = true; + result.isArray_ = value; + return this; + } + public Builder ClearIsArray() { + PrepareBuilder(); + result.hasIsArray = false; + result.isArray_ = false; + return this; + } + } + static FieldSchema() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class IndexSchema : pb::GeneratedMessage { + private IndexSchema() { } + private static readonly IndexSchema defaultInstance = new IndexSchema().MakeReadOnly(); + private static readonly string[] _indexSchemaFieldNames = new string[] { "field_schemas", "index_setting", "index_sort" }; + private static readonly uint[] _indexSchemaFieldTags = new uint[] { 10, 18, 26 }; + public static IndexSchema DefaultInstance { + get { return defaultInstance; } + } + + public override IndexSchema DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override IndexSchema ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSchema__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSchema__FieldAccessorTable; } + } + + public const int FieldSchemasFieldNumber = 1; + private pbc::PopsicleList fieldSchemas_ = new pbc::PopsicleList(); + public scg::IList FieldSchemasList { + get { return fieldSchemas_; } + } + public int FieldSchemasCount { + get { return fieldSchemas_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema GetFieldSchemas(int index) { + return fieldSchemas_[index]; + } + + public const int IndexSettingFieldNumber = 2; + private bool hasIndexSetting; + private global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting indexSetting_; + public bool HasIndexSetting { + get { return hasIndexSetting; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting IndexSetting { + get { return indexSetting_ ?? global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting.DefaultInstance; } + } + + public const int IndexSortFieldNumber = 3; + private bool hasIndexSort; + private global::com.alicloud.openservices.tablestore.core.protocol.Sort indexSort_; + public bool HasIndexSort { + get { return hasIndexSort; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Sort IndexSort { + get { return indexSort_ ?? global::com.alicloud.openservices.tablestore.core.protocol.Sort.DefaultInstance; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _indexSchemaFieldNames; + if (fieldSchemas_.Count > 0) { + output.WriteMessageArray(1, field_names[0], fieldSchemas_); + } + if (hasIndexSetting) { + output.WriteMessage(2, field_names[1], IndexSetting); + } + if (hasIndexSort) { + output.WriteMessage(3, field_names[2], IndexSort); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema element in FieldSchemasList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + if (hasIndexSetting) { + size += pb::CodedOutputStream.ComputeMessageSize(2, IndexSetting); + } + if (hasIndexSort) { + size += pb::CodedOutputStream.ComputeMessageSize(3, IndexSort); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static IndexSchema ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static IndexSchema ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static IndexSchema ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static IndexSchema ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static IndexSchema ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static IndexSchema ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static IndexSchema ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static IndexSchema ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static IndexSchema ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static IndexSchema ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private IndexSchema MakeReadOnly() { + fieldSchemas_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(IndexSchema prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(IndexSchema cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private IndexSchema result; + + private IndexSchema PrepareBuilder() { + if (resultIsReadOnly) { + IndexSchema original = result; + result = new IndexSchema(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override IndexSchema MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.Descriptor; } + } + + public override IndexSchema DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.DefaultInstance; } + } + + public override IndexSchema BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is IndexSchema) { + return MergeFrom((IndexSchema) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(IndexSchema other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.DefaultInstance) return this; + PrepareBuilder(); + if (other.fieldSchemas_.Count != 0) { + result.fieldSchemas_.Add(other.fieldSchemas_); + } + if (other.HasIndexSetting) { + MergeIndexSetting(other.IndexSetting); + } + if (other.HasIndexSort) { + MergeIndexSort(other.IndexSort); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_indexSchemaFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _indexSchemaFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.fieldSchemas_, global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema.DefaultInstance, extensionRegistry); + break; + } + case 18: { + global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting.CreateBuilder(); + if (result.hasIndexSetting) { + subBuilder.MergeFrom(IndexSetting); + } + input.ReadMessage(subBuilder, extensionRegistry); + IndexSetting = subBuilder.BuildPartial(); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.Sort.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.Sort.CreateBuilder(); + if (result.hasIndexSort) { + subBuilder.MergeFrom(IndexSort); + } + input.ReadMessage(subBuilder, extensionRegistry); + IndexSort = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList FieldSchemasList { + get { return PrepareBuilder().fieldSchemas_; } + } + public int FieldSchemasCount { + get { return result.FieldSchemasCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema GetFieldSchemas(int index) { + return result.GetFieldSchemas(index); + } + public Builder SetFieldSchemas(int index, global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.fieldSchemas_[index] = value; + return this; + } + public Builder SetFieldSchemas(int index, global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.fieldSchemas_[index] = builderForValue.Build(); + return this; + } + public Builder AddFieldSchemas(global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.fieldSchemas_.Add(value); + return this; + } + public Builder AddFieldSchemas(global::com.alicloud.openservices.tablestore.core.protocol.FieldSchema.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.fieldSchemas_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeFieldSchemas(scg::IEnumerable values) { + PrepareBuilder(); + result.fieldSchemas_.Add(values); + return this; + } + public Builder ClearFieldSchemas() { + PrepareBuilder(); + result.fieldSchemas_.Clear(); + return this; + } + + public bool HasIndexSetting { + get { return result.hasIndexSetting; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting IndexSetting { + get { return result.IndexSetting; } + set { SetIndexSetting(value); } + } + public Builder SetIndexSetting(global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasIndexSetting = true; + result.indexSetting_ = value; + return this; + } + public Builder SetIndexSetting(global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasIndexSetting = true; + result.indexSetting_ = builderForValue.Build(); + return this; + } + public Builder MergeIndexSetting(global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasIndexSetting && + result.indexSetting_ != global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting.DefaultInstance) { + result.indexSetting_ = global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting.CreateBuilder(result.indexSetting_).MergeFrom(value).BuildPartial(); + } else { + result.indexSetting_ = value; + } + result.hasIndexSetting = true; + return this; + } + public Builder ClearIndexSetting() { + PrepareBuilder(); + result.hasIndexSetting = false; + result.indexSetting_ = null; + return this; + } + + public bool HasIndexSort { + get { return result.hasIndexSort; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.Sort IndexSort { + get { return result.IndexSort; } + set { SetIndexSort(value); } + } + public Builder SetIndexSort(global::com.alicloud.openservices.tablestore.core.protocol.Sort value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasIndexSort = true; + result.indexSort_ = value; + return this; + } + public Builder SetIndexSort(global::com.alicloud.openservices.tablestore.core.protocol.Sort.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasIndexSort = true; + result.indexSort_ = builderForValue.Build(); + return this; + } + public Builder MergeIndexSort(global::com.alicloud.openservices.tablestore.core.protocol.Sort value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasIndexSort && + result.indexSort_ != global::com.alicloud.openservices.tablestore.core.protocol.Sort.DefaultInstance) { + result.indexSort_ = global::com.alicloud.openservices.tablestore.core.protocol.Sort.CreateBuilder(result.indexSort_).MergeFrom(value).BuildPartial(); + } else { + result.indexSort_ = value; + } + result.hasIndexSort = true; + return this; + } + public Builder ClearIndexSort() { + PrepareBuilder(); + result.hasIndexSort = false; + result.indexSort_ = null; + return this; + } + } + static IndexSchema() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class IndexSetting : pb::GeneratedMessage { + private IndexSetting() { } + private static readonly IndexSetting defaultInstance = new IndexSetting().MakeReadOnly(); + private static readonly string[] _indexSettingFieldNames = new string[] { "number_of_shards", "routing_fields", "routing_partition_size" }; + private static readonly uint[] _indexSettingFieldTags = new uint[] { 8, 18, 24 }; + public static IndexSetting DefaultInstance { + get { return defaultInstance; } + } + + public override IndexSetting DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override IndexSetting ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSetting__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexSetting__FieldAccessorTable; } + } + + public const int NumberOfShardsFieldNumber = 1; + private bool hasNumberOfShards; + private int numberOfShards_; + public bool HasNumberOfShards { + get { return hasNumberOfShards; } + } + public int NumberOfShards { + get { return numberOfShards_; } + } + + public const int RoutingFieldsFieldNumber = 2; + private pbc::PopsicleList routingFields_ = new pbc::PopsicleList(); + public scg::IList RoutingFieldsList { + get { return pbc::Lists.AsReadOnly(routingFields_); } + } + public int RoutingFieldsCount { + get { return routingFields_.Count; } + } + public string GetRoutingFields(int index) { + return routingFields_[index]; + } + + public const int RoutingPartitionSizeFieldNumber = 3; + private bool hasRoutingPartitionSize; + private int routingPartitionSize_; + public bool HasRoutingPartitionSize { + get { return hasRoutingPartitionSize; } + } + public int RoutingPartitionSize { + get { return routingPartitionSize_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _indexSettingFieldNames; + if (hasNumberOfShards) { + output.WriteInt32(1, field_names[0], NumberOfShards); + } + if (routingFields_.Count > 0) { + output.WriteStringArray(2, field_names[1], routingFields_); + } + if (hasRoutingPartitionSize) { + output.WriteInt32(3, field_names[2], RoutingPartitionSize); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasNumberOfShards) { + size += pb::CodedOutputStream.ComputeInt32Size(1, NumberOfShards); + } + { + int dataSize = 0; + foreach (string element in RoutingFieldsList) { + dataSize += pb::CodedOutputStream.ComputeStringSizeNoTag(element); + } + size += dataSize; + size += 1 * routingFields_.Count; + } + if (hasRoutingPartitionSize) { + size += pb::CodedOutputStream.ComputeInt32Size(3, RoutingPartitionSize); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static IndexSetting ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static IndexSetting ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static IndexSetting ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static IndexSetting ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static IndexSetting ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static IndexSetting ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static IndexSetting ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static IndexSetting ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static IndexSetting ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static IndexSetting ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private IndexSetting MakeReadOnly() { + routingFields_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(IndexSetting prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(IndexSetting cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private IndexSetting result; + + private IndexSetting PrepareBuilder() { + if (resultIsReadOnly) { + IndexSetting original = result; + result = new IndexSetting(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override IndexSetting MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting.Descriptor; } + } + + public override IndexSetting DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting.DefaultInstance; } + } + + public override IndexSetting BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is IndexSetting) { + return MergeFrom((IndexSetting) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(IndexSetting other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.IndexSetting.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasNumberOfShards) { + NumberOfShards = other.NumberOfShards; + } + if (other.routingFields_.Count != 0) { + result.routingFields_.Add(other.routingFields_); + } + if (other.HasRoutingPartitionSize) { + RoutingPartitionSize = other.RoutingPartitionSize; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_indexSettingFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _indexSettingFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + result.hasNumberOfShards = input.ReadInt32(ref result.numberOfShards_); + break; + } + case 18: { + input.ReadStringArray(tag, field_name, result.routingFields_); + break; + } + case 24: { + result.hasRoutingPartitionSize = input.ReadInt32(ref result.routingPartitionSize_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasNumberOfShards { + get { return result.hasNumberOfShards; } + } + public int NumberOfShards { + get { return result.NumberOfShards; } + set { SetNumberOfShards(value); } + } + public Builder SetNumberOfShards(int value) { + PrepareBuilder(); + result.hasNumberOfShards = true; + result.numberOfShards_ = value; + return this; + } + public Builder ClearNumberOfShards() { + PrepareBuilder(); + result.hasNumberOfShards = false; + result.numberOfShards_ = 0; + return this; + } + + public pbc::IPopsicleList RoutingFieldsList { + get { return PrepareBuilder().routingFields_; } + } + public int RoutingFieldsCount { + get { return result.RoutingFieldsCount; } + } + public string GetRoutingFields(int index) { + return result.GetRoutingFields(index); + } + public Builder SetRoutingFields(int index, string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.routingFields_[index] = value; + return this; + } + public Builder AddRoutingFields(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.routingFields_.Add(value); + return this; + } + public Builder AddRangeRoutingFields(scg::IEnumerable values) { + PrepareBuilder(); + result.routingFields_.Add(values); + return this; + } + public Builder ClearRoutingFields() { + PrepareBuilder(); + result.routingFields_.Clear(); + return this; + } + + public bool HasRoutingPartitionSize { + get { return result.hasRoutingPartitionSize; } + } + public int RoutingPartitionSize { + get { return result.RoutingPartitionSize; } + set { SetRoutingPartitionSize(value); } + } + public Builder SetRoutingPartitionSize(int value) { + PrepareBuilder(); + result.hasRoutingPartitionSize = true; + result.routingPartitionSize_ = value; + return this; + } + public Builder ClearRoutingPartitionSize() { + PrepareBuilder(); + result.hasRoutingPartitionSize = false; + result.routingPartitionSize_ = 0; + return this; + } + } + static IndexSetting() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class CreateSearchIndexRequest : pb::GeneratedMessage { + private CreateSearchIndexRequest() { } + private static readonly CreateSearchIndexRequest defaultInstance = new CreateSearchIndexRequest().MakeReadOnly(); + private static readonly string[] _createSearchIndexRequestFieldNames = new string[] { "index_name", "schema", "table_name" }; + private static readonly uint[] _createSearchIndexRequestFieldTags = new uint[] { 18, 26, 10 }; + public static CreateSearchIndexRequest DefaultInstance { + get { return defaultInstance; } + } + + public override CreateSearchIndexRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateSearchIndexRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int IndexNameFieldNumber = 2; + private bool hasIndexName; + private string indexName_ = ""; + public bool HasIndexName { + get { return hasIndexName; } + } + public string IndexName { + get { return indexName_; } + } + + public const int SchemaFieldNumber = 3; + private bool hasSchema; + private global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema schema_; + public bool HasSchema { + get { return hasSchema; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema Schema { + get { return schema_ ?? global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.DefaultInstance; } + } + + public override bool IsInitialized { + get { + if (!hasTableName) return false; + if (!hasIndexName) return false; + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _createSearchIndexRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[2], TableName); + } + if (hasIndexName) { + output.WriteString(2, field_names[0], IndexName); + } + if (hasSchema) { + output.WriteMessage(3, field_names[1], Schema); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + if (hasIndexName) { + size += pb::CodedOutputStream.ComputeStringSize(2, IndexName); + } + if (hasSchema) { + size += pb::CodedOutputStream.ComputeMessageSize(3, Schema); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static CreateSearchIndexRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateSearchIndexRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateSearchIndexRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateSearchIndexRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateSearchIndexRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateSearchIndexRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateSearchIndexRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateSearchIndexRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateSearchIndexRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateSearchIndexRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateSearchIndexRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateSearchIndexRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateSearchIndexRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateSearchIndexRequest result; + + private CreateSearchIndexRequest PrepareBuilder() { + if (resultIsReadOnly) { + CreateSearchIndexRequest original = result; + result = new CreateSearchIndexRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateSearchIndexRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CreateSearchIndexRequest.Descriptor; } + } + + public override CreateSearchIndexRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CreateSearchIndexRequest.DefaultInstance; } + } + + public override CreateSearchIndexRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateSearchIndexRequest) { + return MergeFrom((CreateSearchIndexRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateSearchIndexRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.CreateSearchIndexRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasIndexName) { + IndexName = other.IndexName; + } + if (other.HasSchema) { + MergeSchema(other.Schema); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createSearchIndexRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createSearchIndexRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + result.hasIndexName = input.ReadString(ref result.indexName_); + break; + } + case 26: { + global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.CreateBuilder(); + if (result.hasSchema) { + subBuilder.MergeFrom(Schema); + } + input.ReadMessage(subBuilder, extensionRegistry); + Schema = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasIndexName { + get { return result.hasIndexName; } + } + public string IndexName { + get { return result.IndexName; } + set { SetIndexName(value); } + } + public Builder SetIndexName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasIndexName = true; + result.indexName_ = value; + return this; + } + public Builder ClearIndexName() { + PrepareBuilder(); + result.hasIndexName = false; + result.indexName_ = ""; + return this; + } + + public bool HasSchema { + get { return result.hasSchema; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema Schema { + get { return result.Schema; } + set { SetSchema(value); } + } + public Builder SetSchema(global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSchema = true; + result.schema_ = value; + return this; + } + public Builder SetSchema(global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSchema = true; + result.schema_ = builderForValue.Build(); + return this; + } + public Builder MergeSchema(global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSchema && + result.schema_ != global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.DefaultInstance) { + result.schema_ = global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.CreateBuilder(result.schema_).MergeFrom(value).BuildPartial(); + } else { + result.schema_ = value; + } + result.hasSchema = true; + return this; + } + public Builder ClearSchema() { + PrepareBuilder(); + result.hasSchema = false; + result.schema_ = null; + return this; + } + } + static CreateSearchIndexRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class CreateSearchIndexResponse : pb::GeneratedMessage { + private CreateSearchIndexResponse() { } + private static readonly CreateSearchIndexResponse defaultInstance = new CreateSearchIndexResponse().MakeReadOnly(); + private static readonly string[] _createSearchIndexResponseFieldNames = new string[] { }; + private static readonly uint[] _createSearchIndexResponseFieldTags = new uint[] { }; + public static CreateSearchIndexResponse DefaultInstance { + get { return defaultInstance; } + } + + public override CreateSearchIndexResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override CreateSearchIndexResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_CreateSearchIndexResponse__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _createSearchIndexResponseFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static CreateSearchIndexResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateSearchIndexResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateSearchIndexResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static CreateSearchIndexResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static CreateSearchIndexResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateSearchIndexResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static CreateSearchIndexResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static CreateSearchIndexResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static CreateSearchIndexResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static CreateSearchIndexResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private CreateSearchIndexResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(CreateSearchIndexResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(CreateSearchIndexResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private CreateSearchIndexResponse result; + + private CreateSearchIndexResponse PrepareBuilder() { + if (resultIsReadOnly) { + CreateSearchIndexResponse original = result; + result = new CreateSearchIndexResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override CreateSearchIndexResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CreateSearchIndexResponse.Descriptor; } + } + + public override CreateSearchIndexResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.CreateSearchIndexResponse.DefaultInstance; } + } + + public override CreateSearchIndexResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is CreateSearchIndexResponse) { + return MergeFrom((CreateSearchIndexResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(CreateSearchIndexResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.CreateSearchIndexResponse.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_createSearchIndexResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _createSearchIndexResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static CreateSearchIndexResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class IndexInfo : pb::GeneratedMessage { + private IndexInfo() { } + private static readonly IndexInfo defaultInstance = new IndexInfo().MakeReadOnly(); + private static readonly string[] _indexInfoFieldNames = new string[] { "index_name", "table_name" }; + private static readonly uint[] _indexInfoFieldTags = new uint[] { 18, 10 }; + public static IndexInfo DefaultInstance { + get { return defaultInstance; } + } + + public override IndexInfo DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override IndexInfo ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexInfo__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_IndexInfo__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int IndexNameFieldNumber = 2; + private bool hasIndexName; + private string indexName_ = ""; + public bool HasIndexName { + get { return hasIndexName; } + } + public string IndexName { + get { return indexName_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _indexInfoFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[1], TableName); + } + if (hasIndexName) { + output.WriteString(2, field_names[0], IndexName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + if (hasIndexName) { + size += pb::CodedOutputStream.ComputeStringSize(2, IndexName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static IndexInfo ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static IndexInfo ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static IndexInfo ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static IndexInfo ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static IndexInfo ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static IndexInfo ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static IndexInfo ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static IndexInfo ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static IndexInfo ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static IndexInfo ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private IndexInfo MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(IndexInfo prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(IndexInfo cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private IndexInfo result; + + private IndexInfo PrepareBuilder() { + if (resultIsReadOnly) { + IndexInfo original = result; + result = new IndexInfo(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override IndexInfo MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.IndexInfo.Descriptor; } + } + + public override IndexInfo DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.IndexInfo.DefaultInstance; } + } + + public override IndexInfo BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is IndexInfo) { + return MergeFrom((IndexInfo) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(IndexInfo other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.IndexInfo.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasIndexName) { + IndexName = other.IndexName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_indexInfoFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _indexInfoFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + result.hasIndexName = input.ReadString(ref result.indexName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasIndexName { + get { return result.hasIndexName; } + } + public string IndexName { + get { return result.IndexName; } + set { SetIndexName(value); } + } + public Builder SetIndexName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasIndexName = true; + result.indexName_ = value; + return this; + } + public Builder ClearIndexName() { + PrepareBuilder(); + result.hasIndexName = false; + result.indexName_ = ""; + return this; + } + } + static IndexInfo() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ListSearchIndexRequest : pb::GeneratedMessage { + private ListSearchIndexRequest() { } + private static readonly ListSearchIndexRequest defaultInstance = new ListSearchIndexRequest().MakeReadOnly(); + private static readonly string[] _listSearchIndexRequestFieldNames = new string[] { "table_name" }; + private static readonly uint[] _listSearchIndexRequestFieldTags = new uint[] { 10 }; + public static ListSearchIndexRequest DefaultInstance { + get { return defaultInstance; } + } + + public override ListSearchIndexRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ListSearchIndexRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _listSearchIndexRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[0], TableName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ListSearchIndexRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ListSearchIndexRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ListSearchIndexRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ListSearchIndexRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ListSearchIndexRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ListSearchIndexRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ListSearchIndexRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ListSearchIndexRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ListSearchIndexRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ListSearchIndexRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ListSearchIndexRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ListSearchIndexRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ListSearchIndexRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ListSearchIndexRequest result; + + private ListSearchIndexRequest PrepareBuilder() { + if (resultIsReadOnly) { + ListSearchIndexRequest original = result; + result = new ListSearchIndexRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ListSearchIndexRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ListSearchIndexRequest.Descriptor; } + } + + public override ListSearchIndexRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ListSearchIndexRequest.DefaultInstance; } + } + + public override ListSearchIndexRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ListSearchIndexRequest) { + return MergeFrom((ListSearchIndexRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ListSearchIndexRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ListSearchIndexRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_listSearchIndexRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _listSearchIndexRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + } + static ListSearchIndexRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class ListSearchIndexResponse : pb::GeneratedMessage { + private ListSearchIndexResponse() { } + private static readonly ListSearchIndexResponse defaultInstance = new ListSearchIndexResponse().MakeReadOnly(); + private static readonly string[] _listSearchIndexResponseFieldNames = new string[] { "indices" }; + private static readonly uint[] _listSearchIndexResponseFieldTags = new uint[] { 10 }; + public static ListSearchIndexResponse DefaultInstance { + get { return defaultInstance; } + } + + public override ListSearchIndexResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override ListSearchIndexResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_ListSearchIndexResponse__FieldAccessorTable; } + } + + public const int IndicesFieldNumber = 1; + private pbc::PopsicleList indices_ = new pbc::PopsicleList(); + public scg::IList IndicesList { + get { return indices_; } + } + public int IndicesCount { + get { return indices_.Count; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexInfo GetIndices(int index) { + return indices_[index]; + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _listSearchIndexResponseFieldNames; + if (indices_.Count > 0) { + output.WriteMessageArray(1, field_names[0], indices_); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + foreach (global::com.alicloud.openservices.tablestore.core.protocol.IndexInfo element in IndicesList) { + size += pb::CodedOutputStream.ComputeMessageSize(1, element); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static ListSearchIndexResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ListSearchIndexResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ListSearchIndexResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static ListSearchIndexResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static ListSearchIndexResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ListSearchIndexResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static ListSearchIndexResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static ListSearchIndexResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static ListSearchIndexResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static ListSearchIndexResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private ListSearchIndexResponse MakeReadOnly() { + indices_.MakeReadOnly(); + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(ListSearchIndexResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(ListSearchIndexResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private ListSearchIndexResponse result; + + private ListSearchIndexResponse PrepareBuilder() { + if (resultIsReadOnly) { + ListSearchIndexResponse original = result; + result = new ListSearchIndexResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override ListSearchIndexResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ListSearchIndexResponse.Descriptor; } + } + + public override ListSearchIndexResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.ListSearchIndexResponse.DefaultInstance; } + } + + public override ListSearchIndexResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is ListSearchIndexResponse) { + return MergeFrom((ListSearchIndexResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(ListSearchIndexResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.ListSearchIndexResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.indices_.Count != 0) { + result.indices_.Add(other.indices_); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_listSearchIndexResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _listSearchIndexResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + input.ReadMessageArray(tag, field_name, result.indices_, global::com.alicloud.openservices.tablestore.core.protocol.IndexInfo.DefaultInstance, extensionRegistry); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public pbc::IPopsicleList IndicesList { + get { return PrepareBuilder().indices_; } + } + public int IndicesCount { + get { return result.IndicesCount; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexInfo GetIndices(int index) { + return result.GetIndices(index); + } + public Builder SetIndices(int index, global::com.alicloud.openservices.tablestore.core.protocol.IndexInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.indices_[index] = value; + return this; + } + public Builder SetIndices(int index, global::com.alicloud.openservices.tablestore.core.protocol.IndexInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.indices_[index] = builderForValue.Build(); + return this; + } + public Builder AddIndices(global::com.alicloud.openservices.tablestore.core.protocol.IndexInfo value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.indices_.Add(value); + return this; + } + public Builder AddIndices(global::com.alicloud.openservices.tablestore.core.protocol.IndexInfo.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.indices_.Add(builderForValue.Build()); + return this; + } + public Builder AddRangeIndices(scg::IEnumerable values) { + PrepareBuilder(); + result.indices_.Add(values); + return this; + } + public Builder ClearIndices() { + PrepareBuilder(); + result.indices_.Clear(); + return this; + } + } + static ListSearchIndexResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DeleteSearchIndexRequest : pb::GeneratedMessage { + private DeleteSearchIndexRequest() { } + private static readonly DeleteSearchIndexRequest defaultInstance = new DeleteSearchIndexRequest().MakeReadOnly(); + private static readonly string[] _deleteSearchIndexRequestFieldNames = new string[] { "index_name", "table_name" }; + private static readonly uint[] _deleteSearchIndexRequestFieldTags = new uint[] { 18, 10 }; + public static DeleteSearchIndexRequest DefaultInstance { + get { return defaultInstance; } + } + + public override DeleteSearchIndexRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DeleteSearchIndexRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int IndexNameFieldNumber = 2; + private bool hasIndexName; + private string indexName_ = ""; + public bool HasIndexName { + get { return hasIndexName; } + } + public string IndexName { + get { return indexName_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _deleteSearchIndexRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[1], TableName); + } + if (hasIndexName) { + output.WriteString(2, field_names[0], IndexName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + if (hasIndexName) { + size += pb::CodedOutputStream.ComputeStringSize(2, IndexName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DeleteSearchIndexRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteSearchIndexRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteSearchIndexRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteSearchIndexRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteSearchIndexRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteSearchIndexRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DeleteSearchIndexRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DeleteSearchIndexRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DeleteSearchIndexRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteSearchIndexRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DeleteSearchIndexRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DeleteSearchIndexRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DeleteSearchIndexRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DeleteSearchIndexRequest result; + + private DeleteSearchIndexRequest PrepareBuilder() { + if (resultIsReadOnly) { + DeleteSearchIndexRequest original = result; + result = new DeleteSearchIndexRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DeleteSearchIndexRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DeleteSearchIndexRequest.Descriptor; } + } + + public override DeleteSearchIndexRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DeleteSearchIndexRequest.DefaultInstance; } + } + + public override DeleteSearchIndexRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DeleteSearchIndexRequest) { + return MergeFrom((DeleteSearchIndexRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DeleteSearchIndexRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DeleteSearchIndexRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasIndexName) { + IndexName = other.IndexName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_deleteSearchIndexRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _deleteSearchIndexRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + result.hasIndexName = input.ReadString(ref result.indexName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasIndexName { + get { return result.hasIndexName; } + } + public string IndexName { + get { return result.IndexName; } + set { SetIndexName(value); } + } + public Builder SetIndexName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasIndexName = true; + result.indexName_ = value; + return this; + } + public Builder ClearIndexName() { + PrepareBuilder(); + result.hasIndexName = false; + result.indexName_ = ""; + return this; + } + } + static DeleteSearchIndexRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DeleteSearchIndexResponse : pb::GeneratedMessage { + private DeleteSearchIndexResponse() { } + private static readonly DeleteSearchIndexResponse defaultInstance = new DeleteSearchIndexResponse().MakeReadOnly(); + private static readonly string[] _deleteSearchIndexResponseFieldNames = new string[] { }; + private static readonly uint[] _deleteSearchIndexResponseFieldTags = new uint[] { }; + public static DeleteSearchIndexResponse DefaultInstance { + get { return defaultInstance; } + } + + public override DeleteSearchIndexResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DeleteSearchIndexResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_DeleteSearchIndexResponse__FieldAccessorTable; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _deleteSearchIndexResponseFieldNames; + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DeleteSearchIndexResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteSearchIndexResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteSearchIndexResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DeleteSearchIndexResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DeleteSearchIndexResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteSearchIndexResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DeleteSearchIndexResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DeleteSearchIndexResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DeleteSearchIndexResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DeleteSearchIndexResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DeleteSearchIndexResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DeleteSearchIndexResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DeleteSearchIndexResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DeleteSearchIndexResponse result; + + private DeleteSearchIndexResponse PrepareBuilder() { + if (resultIsReadOnly) { + DeleteSearchIndexResponse original = result; + result = new DeleteSearchIndexResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DeleteSearchIndexResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DeleteSearchIndexResponse.Descriptor; } + } + + public override DeleteSearchIndexResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DeleteSearchIndexResponse.DefaultInstance; } + } + + public override DeleteSearchIndexResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DeleteSearchIndexResponse) { + return MergeFrom((DeleteSearchIndexResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DeleteSearchIndexResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DeleteSearchIndexResponse.DefaultInstance) return this; + PrepareBuilder(); + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_deleteSearchIndexResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _deleteSearchIndexResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + } + static DeleteSearchIndexResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class SyncStat : pb::GeneratedMessage { + private SyncStat() { } + private static readonly SyncStat defaultInstance = new SyncStat().MakeReadOnly(); + private static readonly string[] _syncStatFieldNames = new string[] { "current_sync_timestamp", "sync_phase" }; + private static readonly uint[] _syncStatFieldTags = new uint[] { 16, 8 }; + public static SyncStat DefaultInstance { + get { return defaultInstance; } + } + + public override SyncStat DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override SyncStat ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_SyncStat__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_SyncStat__FieldAccessorTable; } + } + + public const int SyncPhaseFieldNumber = 1; + private bool hasSyncPhase; + private global::com.alicloud.openservices.tablestore.core.protocol.SyncPhase syncPhase_ = global::com.alicloud.openservices.tablestore.core.protocol.SyncPhase.FULL; + public bool HasSyncPhase { + get { return hasSyncPhase; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SyncPhase SyncPhase { + get { return syncPhase_; } + } + + public const int CurrentSyncTimestampFieldNumber = 2; + private bool hasCurrentSyncTimestamp; + private long currentSyncTimestamp_; + public bool HasCurrentSyncTimestamp { + get { return hasCurrentSyncTimestamp; } + } + public long CurrentSyncTimestamp { + get { return currentSyncTimestamp_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _syncStatFieldNames; + if (hasSyncPhase) { + output.WriteEnum(1, field_names[1], (int) SyncPhase, SyncPhase); + } + if (hasCurrentSyncTimestamp) { + output.WriteInt64(2, field_names[0], CurrentSyncTimestamp); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasSyncPhase) { + size += pb::CodedOutputStream.ComputeEnumSize(1, (int) SyncPhase); + } + if (hasCurrentSyncTimestamp) { + size += pb::CodedOutputStream.ComputeInt64Size(2, CurrentSyncTimestamp); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static SyncStat ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SyncStat ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SyncStat ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static SyncStat ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static SyncStat ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SyncStat ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static SyncStat ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static SyncStat ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static SyncStat ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static SyncStat ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private SyncStat MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(SyncStat prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(SyncStat cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private SyncStat result; + + private SyncStat PrepareBuilder() { + if (resultIsReadOnly) { + SyncStat original = result; + result = new SyncStat(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override SyncStat MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.SyncStat.Descriptor; } + } + + public override SyncStat DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.SyncStat.DefaultInstance; } + } + + public override SyncStat BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is SyncStat) { + return MergeFrom((SyncStat) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(SyncStat other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.SyncStat.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasSyncPhase) { + SyncPhase = other.SyncPhase; + } + if (other.HasCurrentSyncTimestamp) { + CurrentSyncTimestamp = other.CurrentSyncTimestamp; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_syncStatFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _syncStatFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 8: { + object unknown; + if(input.ReadEnum(ref result.syncPhase_, out unknown)) { + result.hasSyncPhase = true; + } else if(unknown is int) { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + unknownFields.MergeVarintField(1, (ulong)(int)unknown); + } + break; + } + case 16: { + result.hasCurrentSyncTimestamp = input.ReadInt64(ref result.currentSyncTimestamp_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasSyncPhase { + get { return result.hasSyncPhase; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SyncPhase SyncPhase { + get { return result.SyncPhase; } + set { SetSyncPhase(value); } + } + public Builder SetSyncPhase(global::com.alicloud.openservices.tablestore.core.protocol.SyncPhase value) { + PrepareBuilder(); + result.hasSyncPhase = true; + result.syncPhase_ = value; + return this; + } + public Builder ClearSyncPhase() { + PrepareBuilder(); + result.hasSyncPhase = false; + result.syncPhase_ = global::com.alicloud.openservices.tablestore.core.protocol.SyncPhase.FULL; + return this; + } + + public bool HasCurrentSyncTimestamp { + get { return result.hasCurrentSyncTimestamp; } + } + public long CurrentSyncTimestamp { + get { return result.CurrentSyncTimestamp; } + set { SetCurrentSyncTimestamp(value); } + } + public Builder SetCurrentSyncTimestamp(long value) { + PrepareBuilder(); + result.hasCurrentSyncTimestamp = true; + result.currentSyncTimestamp_ = value; + return this; + } + public Builder ClearCurrentSyncTimestamp() { + PrepareBuilder(); + result.hasCurrentSyncTimestamp = false; + result.currentSyncTimestamp_ = 0L; + return this; + } + } + static SyncStat() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DescribeSearchIndexRequest : pb::GeneratedMessage { + private DescribeSearchIndexRequest() { } + private static readonly DescribeSearchIndexRequest defaultInstance = new DescribeSearchIndexRequest().MakeReadOnly(); + private static readonly string[] _describeSearchIndexRequestFieldNames = new string[] { "index_name", "table_name" }; + private static readonly uint[] _describeSearchIndexRequestFieldTags = new uint[] { 18, 10 }; + public static DescribeSearchIndexRequest DefaultInstance { + get { return defaultInstance; } + } + + public override DescribeSearchIndexRequest DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DescribeSearchIndexRequest ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexRequest__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexRequest__FieldAccessorTable; } + } + + public const int TableNameFieldNumber = 1; + private bool hasTableName; + private string tableName_ = ""; + public bool HasTableName { + get { return hasTableName; } + } + public string TableName { + get { return tableName_; } + } + + public const int IndexNameFieldNumber = 2; + private bool hasIndexName; + private string indexName_ = ""; + public bool HasIndexName { + get { return hasIndexName; } + } + public string IndexName { + get { return indexName_; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _describeSearchIndexRequestFieldNames; + if (hasTableName) { + output.WriteString(1, field_names[1], TableName); + } + if (hasIndexName) { + output.WriteString(2, field_names[0], IndexName); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasTableName) { + size += pb::CodedOutputStream.ComputeStringSize(1, TableName); + } + if (hasIndexName) { + size += pb::CodedOutputStream.ComputeStringSize(2, IndexName); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DescribeSearchIndexRequest ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescribeSearchIndexRequest ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescribeSearchIndexRequest ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescribeSearchIndexRequest ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescribeSearchIndexRequest ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescribeSearchIndexRequest ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DescribeSearchIndexRequest ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DescribeSearchIndexRequest ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DescribeSearchIndexRequest ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescribeSearchIndexRequest ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DescribeSearchIndexRequest MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DescribeSearchIndexRequest prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DescribeSearchIndexRequest cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DescribeSearchIndexRequest result; + + private DescribeSearchIndexRequest PrepareBuilder() { + if (resultIsReadOnly) { + DescribeSearchIndexRequest original = result; + result = new DescribeSearchIndexRequest(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DescribeSearchIndexRequest MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DescribeSearchIndexRequest.Descriptor; } + } + + public override DescribeSearchIndexRequest DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DescribeSearchIndexRequest.DefaultInstance; } + } + + public override DescribeSearchIndexRequest BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DescribeSearchIndexRequest) { + return MergeFrom((DescribeSearchIndexRequest) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DescribeSearchIndexRequest other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DescribeSearchIndexRequest.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasTableName) { + TableName = other.TableName; + } + if (other.HasIndexName) { + IndexName = other.IndexName; + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_describeSearchIndexRequestFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _describeSearchIndexRequestFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + result.hasTableName = input.ReadString(ref result.tableName_); + break; + } + case 18: { + result.hasIndexName = input.ReadString(ref result.indexName_); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasTableName { + get { return result.hasTableName; } + } + public string TableName { + get { return result.TableName; } + set { SetTableName(value); } + } + public Builder SetTableName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasTableName = true; + result.tableName_ = value; + return this; + } + public Builder ClearTableName() { + PrepareBuilder(); + result.hasTableName = false; + result.tableName_ = ""; + return this; + } + + public bool HasIndexName { + get { return result.hasIndexName; } + } + public string IndexName { + get { return result.IndexName; } + set { SetIndexName(value); } + } + public Builder SetIndexName(string value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasIndexName = true; + result.indexName_ = value; + return this; + } + public Builder ClearIndexName() { + PrepareBuilder(); + result.hasIndexName = false; + result.indexName_ = ""; + return this; + } + } + static DescribeSearchIndexRequest() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class DescribeSearchIndexResponse : pb::GeneratedMessage { + private DescribeSearchIndexResponse() { } + private static readonly DescribeSearchIndexResponse defaultInstance = new DescribeSearchIndexResponse().MakeReadOnly(); + private static readonly string[] _describeSearchIndexResponseFieldNames = new string[] { "schema", "sync_stat" }; + private static readonly uint[] _describeSearchIndexResponseFieldTags = new uint[] { 10, 18 }; + public static DescribeSearchIndexResponse DefaultInstance { + get { return defaultInstance; } + } + + public override DescribeSearchIndexResponse DefaultInstanceForType { + get { return DefaultInstance; } + } + + protected override DescribeSearchIndexResponse ThisMessage { + get { return this; } + } + + public static pbd::MessageDescriptor Descriptor { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexResponse__Descriptor; } + } + + protected override pb::FieldAccess.FieldAccessorTable InternalFieldAccessors { + get { return global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.internal__static_com_alicloud_openservices_tablestore_core_protocol_DescribeSearchIndexResponse__FieldAccessorTable; } + } + + public const int SchemaFieldNumber = 1; + private bool hasSchema; + private global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema schema_; + public bool HasSchema { + get { return hasSchema; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema Schema { + get { return schema_ ?? global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.DefaultInstance; } + } + + public const int SyncStatFieldNumber = 2; + private bool hasSyncStat; + private global::com.alicloud.openservices.tablestore.core.protocol.SyncStat syncStat_; + public bool HasSyncStat { + get { return hasSyncStat; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SyncStat SyncStat { + get { return syncStat_ ?? global::com.alicloud.openservices.tablestore.core.protocol.SyncStat.DefaultInstance; } + } + + public override bool IsInitialized { + get { + return true; + } + } + + public override void WriteTo(pb::ICodedOutputStream output) { + CalcSerializedSize(); + string[] field_names = _describeSearchIndexResponseFieldNames; + if (hasSchema) { + output.WriteMessage(1, field_names[0], Schema); + } + if (hasSyncStat) { + output.WriteMessage(2, field_names[1], SyncStat); + } + UnknownFields.WriteTo(output); + } + + private int memoizedSerializedSize = -1; + public override int SerializedSize { + get { + int size = memoizedSerializedSize; + if (size != -1) return size; + return CalcSerializedSize(); + } + } + + private int CalcSerializedSize() { + int size = memoizedSerializedSize; + if (size != -1) return size; + + size = 0; + if (hasSchema) { + size += pb::CodedOutputStream.ComputeMessageSize(1, Schema); + } + if (hasSyncStat) { + size += pb::CodedOutputStream.ComputeMessageSize(2, SyncStat); + } + size += UnknownFields.SerializedSize; + memoizedSerializedSize = size; + return size; + } + public static DescribeSearchIndexResponse ParseFrom(pb::ByteString data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescribeSearchIndexResponse ParseFrom(pb::ByteString data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescribeSearchIndexResponse ParseFrom(byte[] data) { + return ((Builder) CreateBuilder().MergeFrom(data)).BuildParsed(); + } + public static DescribeSearchIndexResponse ParseFrom(byte[] data, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(data, extensionRegistry)).BuildParsed(); + } + public static DescribeSearchIndexResponse ParseFrom(global::System.IO.Stream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescribeSearchIndexResponse ParseFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + public static DescribeSearchIndexResponse ParseDelimitedFrom(global::System.IO.Stream input) { + return CreateBuilder().MergeDelimitedFrom(input).BuildParsed(); + } + public static DescribeSearchIndexResponse ParseDelimitedFrom(global::System.IO.Stream input, pb::ExtensionRegistry extensionRegistry) { + return CreateBuilder().MergeDelimitedFrom(input, extensionRegistry).BuildParsed(); + } + public static DescribeSearchIndexResponse ParseFrom(pb::ICodedInputStream input) { + return ((Builder) CreateBuilder().MergeFrom(input)).BuildParsed(); + } + public static DescribeSearchIndexResponse ParseFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + return ((Builder) CreateBuilder().MergeFrom(input, extensionRegistry)).BuildParsed(); + } + private DescribeSearchIndexResponse MakeReadOnly() { + return this; + } + + public static Builder CreateBuilder() { return new Builder(); } + public override Builder ToBuilder() { return CreateBuilder(this); } + public override Builder CreateBuilderForType() { return new Builder(); } + public static Builder CreateBuilder(DescribeSearchIndexResponse prototype) { + return new Builder(prototype); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + public sealed partial class Builder : pb::GeneratedBuilder { + protected override Builder ThisBuilder { + get { return this; } + } + public Builder() { + result = DefaultInstance; + resultIsReadOnly = true; + } + internal Builder(DescribeSearchIndexResponse cloneFrom) { + result = cloneFrom; + resultIsReadOnly = true; + } + + private bool resultIsReadOnly; + private DescribeSearchIndexResponse result; + + private DescribeSearchIndexResponse PrepareBuilder() { + if (resultIsReadOnly) { + DescribeSearchIndexResponse original = result; + result = new DescribeSearchIndexResponse(); + resultIsReadOnly = false; + MergeFrom(original); + } + return result; + } + + public override bool IsInitialized { + get { return result.IsInitialized; } + } + + protected override DescribeSearchIndexResponse MessageBeingBuilt { + get { return PrepareBuilder(); } + } + + public override Builder Clear() { + result = DefaultInstance; + resultIsReadOnly = true; + return this; + } + + public override Builder Clone() { + if (resultIsReadOnly) { + return new Builder(result); + } else { + return new Builder().MergeFrom(result); + } + } + + public override pbd::MessageDescriptor DescriptorForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DescribeSearchIndexResponse.Descriptor; } + } + + public override DescribeSearchIndexResponse DefaultInstanceForType { + get { return global::com.alicloud.openservices.tablestore.core.protocol.DescribeSearchIndexResponse.DefaultInstance; } + } + + public override DescribeSearchIndexResponse BuildPartial() { + if (resultIsReadOnly) { + return result; + } + resultIsReadOnly = true; + return result.MakeReadOnly(); + } + + public override Builder MergeFrom(pb::IMessage other) { + if (other is DescribeSearchIndexResponse) { + return MergeFrom((DescribeSearchIndexResponse) other); + } else { + base.MergeFrom(other); + return this; + } + } + + public override Builder MergeFrom(DescribeSearchIndexResponse other) { + if (other == global::com.alicloud.openservices.tablestore.core.protocol.DescribeSearchIndexResponse.DefaultInstance) return this; + PrepareBuilder(); + if (other.HasSchema) { + MergeSchema(other.Schema); + } + if (other.HasSyncStat) { + MergeSyncStat(other.SyncStat); + } + this.MergeUnknownFields(other.UnknownFields); + return this; + } + + public override Builder MergeFrom(pb::ICodedInputStream input) { + return MergeFrom(input, pb::ExtensionRegistry.Empty); + } + + public override Builder MergeFrom(pb::ICodedInputStream input, pb::ExtensionRegistry extensionRegistry) { + PrepareBuilder(); + pb::UnknownFieldSet.Builder unknownFields = null; + uint tag; + string field_name; + while (input.ReadTag(out tag, out field_name)) { + if(tag == 0 && field_name != null) { + int field_ordinal = global::System.Array.BinarySearch(_describeSearchIndexResponseFieldNames, field_name, global::System.StringComparer.Ordinal); + if(field_ordinal >= 0) + tag = _describeSearchIndexResponseFieldTags[field_ordinal]; + else { + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + continue; + } + } + switch (tag) { + case 0: { + throw pb::InvalidProtocolBufferException.InvalidTag(); + } + default: { + if (pb::WireFormat.IsEndGroupTag(tag)) { + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + if (unknownFields == null) { + unknownFields = pb::UnknownFieldSet.CreateBuilder(this.UnknownFields); + } + ParseUnknownField(input, unknownFields, extensionRegistry, tag, field_name); + break; + } + case 10: { + global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.CreateBuilder(); + if (result.hasSchema) { + subBuilder.MergeFrom(Schema); + } + input.ReadMessage(subBuilder, extensionRegistry); + Schema = subBuilder.BuildPartial(); + break; + } + case 18: { + global::com.alicloud.openservices.tablestore.core.protocol.SyncStat.Builder subBuilder = global::com.alicloud.openservices.tablestore.core.protocol.SyncStat.CreateBuilder(); + if (result.hasSyncStat) { + subBuilder.MergeFrom(SyncStat); + } + input.ReadMessage(subBuilder, extensionRegistry); + SyncStat = subBuilder.BuildPartial(); + break; + } + } + } + + if (unknownFields != null) { + this.UnknownFields = unknownFields.Build(); + } + return this; + } + + + public bool HasSchema { + get { return result.hasSchema; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema Schema { + get { return result.Schema; } + set { SetSchema(value); } + } + public Builder SetSchema(global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSchema = true; + result.schema_ = value; + return this; + } + public Builder SetSchema(global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSchema = true; + result.schema_ = builderForValue.Build(); + return this; + } + public Builder MergeSchema(global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSchema && + result.schema_ != global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.DefaultInstance) { + result.schema_ = global::com.alicloud.openservices.tablestore.core.protocol.IndexSchema.CreateBuilder(result.schema_).MergeFrom(value).BuildPartial(); + } else { + result.schema_ = value; + } + result.hasSchema = true; + return this; + } + public Builder ClearSchema() { + PrepareBuilder(); + result.hasSchema = false; + result.schema_ = null; + return this; + } + + public bool HasSyncStat { + get { return result.hasSyncStat; } + } + public global::com.alicloud.openservices.tablestore.core.protocol.SyncStat SyncStat { + get { return result.SyncStat; } + set { SetSyncStat(value); } + } + public Builder SetSyncStat(global::com.alicloud.openservices.tablestore.core.protocol.SyncStat value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + result.hasSyncStat = true; + result.syncStat_ = value; + return this; + } + public Builder SetSyncStat(global::com.alicloud.openservices.tablestore.core.protocol.SyncStat.Builder builderForValue) { + pb::ThrowHelper.ThrowIfNull(builderForValue, "builderForValue"); + PrepareBuilder(); + result.hasSyncStat = true; + result.syncStat_ = builderForValue.Build(); + return this; + } + public Builder MergeSyncStat(global::com.alicloud.openservices.tablestore.core.protocol.SyncStat value) { + pb::ThrowHelper.ThrowIfNull(value, "value"); + PrepareBuilder(); + if (result.hasSyncStat && + result.syncStat_ != global::com.alicloud.openservices.tablestore.core.protocol.SyncStat.DefaultInstance) { + result.syncStat_ = global::com.alicloud.openservices.tablestore.core.protocol.SyncStat.CreateBuilder(result.syncStat_).MergeFrom(value).BuildPartial(); + } else { + result.syncStat_ = value; + } + result.hasSyncStat = true; + return this; + } + public Builder ClearSyncStat() { + PrepareBuilder(); + result.hasSyncStat = false; + result.syncStat_ = null; + return this; + } + } + static DescribeSearchIndexResponse() { + object.ReferenceEquals(global::com.alicloud.openservices.tablestore.core.protocol.TablestoreSearch.Descriptor, null); + } + } + + #endregion + +} + +#endregion Designer generated code diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/table_store.proto b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/table_store.proto new file mode 100644 index 0000000..cd4f726 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/table_store.proto @@ -0,0 +1,637 @@ +syntax = "proto2"; + +package com.alicloud.openservices.tablestore.core.protocol; + +message Error { + required string code = 1; + optional string message = 2; +} + +enum PrimaryKeyType { + INTEGER = 1; + STRING = 2; + BINARY = 3; +} + +enum DefinedColumnType { + DCT_INTEGER = 1; + DCT_DOUBLE = 2; + DCT_BOOLEAN = 3; + DCT_STRING = 4; + // field 5 is reserved for date type, not supported yet + // field 6 is reserved for decimal type, not supported yet + DCT_BLOB = 7; +} + +enum PrimaryKeyOption { + AUTO_INCREMENT = 1; +} + +message PrimaryKeySchema { + required string name = 1; + required PrimaryKeyType type = 2; + optional PrimaryKeyOption option = 3; +} + +message DefinedColumnSchema { + required string name = 1; + required DefinedColumnType type = 2; +} + +message PartitionRange { + required bytes begin = 1; // encoded as SQLVariant + required bytes end = 2; // encoded as SQLVariant +} + +enum BloomFilterType { + NONE = 1; + CELL = 2; + ROW = 3; +} + +enum DataBlockType { + DBT_PLAIN_BUFFER = 0; + DBT_SIMPLE_ROW_MATRIX = 1; +} + +enum CompressType { + CPT_NONE = 0; +} + +message TableOptions { + optional int32 time_to_live = 1; // 可以动态更改 + optional int32 max_versions = 2; // 可以动态更改 + optional BloomFilterType bloom_filter_type = 3; // 可以动态更改 + optional int32 block_size = 4; // 可以动态更改 + optional int64 deviation_cell_version_in_sec = 5; // 可以动态修改 +} + +enum IndexUpdateMode { + IUM_ASYNC_INDEX = 0; + IUM_SYNC_INDEX = 1; +} + +enum IndexType { + IT_GLOBAL_INDEX = 0; + IT_LOCAL_INDEX = 1; +} + +message IndexMeta { + required string name = 1; + repeated string primary_key = 2; + repeated string defined_column = 3; + required IndexUpdateMode index_update_mode = 4; + required IndexType index_type = 5; +} + +message TableMeta { + required string table_name = 1; + repeated PrimaryKeySchema primary_key = 2; + repeated DefinedColumnSchema defined_column = 3; + repeated IndexMeta index_meta = 4; +} + +/** + * 表的状态变更只与用户的操作对应,内部的机器failover等状况不对应表的状态变更。 + * 有三个考虑: + * 一是一般场景下用户只会在做了对表的修改操作后才会去检查表的状态; + * 二是内部机器failover导致访问异常到用户能够查看到表的状态变更这两个时刻之间会有一段延迟,无法将表的不可服务状态与用户查看到的表的状态完全匹配上。 + * 三是内部机器failover后不能说是表的整个状态变更,而应该是partition的状态变更,对应表的状态就是PARTIAL_FAILOVER,这个partial的粒度无法体现,会让用户更加困惑。 + */ +enum TableStatus { + ACTIVE = 1; // 表处于可服务状态。 + INACTIVE = 2; // 用户通过UnloadTable将表禁用。 + LOADING = 3; // 表正在被创建,partition还未全部加载完毕;或者表刚从INACTIVE状态被Enable。 + UNLOADING = 4; // 表正在被删除(从delete table到partition完全unload的这段期间)或者表从ACTIVE状态被Unload。 + UPDATING = 5; // 表正在被更新(table属性变更、预留吞吐量变更)。 +} + +enum RowExistenceExpectation { + IGNORE = 0; + EXPECT_EXIST = 1; + EXPECT_NOT_EXIST = 2; +} + +message Condition { + required RowExistenceExpectation row_existence = 1; + optional bytes column_condition = 2; +} + +message CapacityUnit { + optional int32 read = 1; + optional int32 write = 2; +} + +message ReservedThroughputDetails { + required CapacityUnit capacity_unit = 1; // 表当前的预留吞吐量的值。 + required int64 last_increase_time = 2; // 最后一次上调预留吞吐量的时间。 + optional int64 last_decrease_time = 3; // 最后一次下调预留吞吐量的时间。 +} + +message ReservedThroughput { + required CapacityUnit capacity_unit = 1; +} + +message ConsumedCapacity { + required CapacityUnit capacity_unit = 1; +} + +message StreamSpecification { + required bool enable_stream = 1; + optional int32 expiration_time = 2; +} + +message StreamDetails { + required bool enable_stream = 1; + optional string stream_id = 2; + optional int32 expiration_time = 3; + optional int64 last_enable_time = 4; +} + +/* ############################################# CreateTable ############################################# */ +/** + * table_meta用于存储表中不可更改的schema属性,可以更改的ReservedThroughput和TableOptions独立出来,作为UpdateTable的参数。 + * 加入GlobalIndex和LocalIndex之后,结构会变为: + * message CreateTableRequest { + * required TableMeta table_meta = 1; + * required ReservedThroughput reserved_throughput = 2; + * required TableOptions table_options = 3; + * repeated LocalIndex local_indexes = 4; // LocalIndex不再单独包含ReservedThroughput和TableOptions,其与主表共享配置。 + * repeated GlobalIndex global_indexes = 5; // GlobalIndex内单独包含ReservedThroughput和TableOptions + * } + */ +message CreateTableRequest { + required TableMeta table_meta = 1; + required ReservedThroughput reserved_throughput = 2; // 未放在TableOptions内,原因是UpdateTableResponse中会返回ReservedThroughputDetails,而TableOptions没有类似的返回结构。 + optional TableOptions table_options = 3; + repeated PartitionRange partitions = 4; + optional StreamSpecification stream_spec = 5; + repeated IndexMeta index_metas = 7; +} + +message CreateTableResponse { +} + +/* ######################################################################################################### */ + +/* ############################################# CreateIndex ############################################# */ + +message CreateIndexRequest { + required string main_table_name = 1; + required IndexMeta index_meta = 2; + optional bool include_base_data = 3; +} + +message CreateIndexResponse { +} + +/* ######################################################################################################### */ + +/* ############################################# DropIndex ############################################# */ + +message DropIndexRequest { + required string main_table_name = 1; + required string index_name = 2; +} + +message DropIndexResponse { +} + +/* ######################################################################################################### */ + +/* ############################################# UpdateTable ############################################# */ +message UpdateTableRequest { + required string table_name = 1; + optional ReservedThroughput reserved_throughput = 2; + optional TableOptions table_options = 3; + optional StreamSpecification stream_spec = 4; +} + +message UpdateTableResponse { + required ReservedThroughputDetails reserved_throughput_details = 1; + required TableOptions table_options = 2; + optional StreamDetails stream_details = 3; +} +/* ######################################################################################################### */ + +/* ############################################# DescribeTable ############################################# */ +message DescribeTableRequest { + required string table_name = 1; +} + +message DescribeTableResponse { + required TableMeta table_meta = 1; + required ReservedThroughputDetails reserved_throughput_details = 2; + required TableOptions table_options = 3; + required TableStatus table_status = 4; + optional StreamDetails stream_details = 5; + repeated bytes shard_splits = 6; + repeated IndexMeta index_metas = 8; +} +/* ########################################################################################################### */ + +/* ############################################# ListTable ############################################# */ +message ListTableRequest { +} + +/** + * 当前只返回一个简单的名称列表,需要讨论是否有业务场景需要获取除了表名之外的其他信息。 + * 其他信息可以包含预留吞吐量以及表的状态,这个信息只能是一个粗略的信息,表的详细信息还是需要通过DescribeTable来获取。 + */ +message ListTableResponse { + repeated string table_names = 1; +} +/* ####################################################################################################### */ + +/* ############################################# DeleteTable ############################################# */ +message DeleteTableRequest { + required string table_name = 1; +} + +message DeleteTableResponse { +} +/* ######################################################################################################### */ + +/* ############################################# LoadTable ############################################# */ +message LoadTableRequest { + required string table_name = 1; +} + +message LoadTableResponse { +} +/* ######################################################################################################### */ + +/* ############################################# UnloadTable ############################################# */ +message UnloadTableRequest { + required string table_name = 1; +} + +message UnloadTableResponse { + +} +/* ########################################################################################################## */ + +/** + * 时间戳的取值最小值为0,最大值为INT64.MAX + * 1. 若要查询一个范围,则指定start_time和end_time + * 2. 若要查询一个特定时间戳,则指定specific_time + */ +message TimeRange { + optional int64 start_time = 1; + optional int64 end_time = 2; + optional int64 specific_time = 3; +} + +/* ############################################# GetRow ############################################# */ + +enum ReturnType { + RT_NONE = 0; + RT_PK = 1; + RT_AFTER_MODIFY = 2; +} + +message ReturnContent { + optional ReturnType return_type = 1; + repeated string return_column_names = 2; +} + +/** + * 1. 支持用户指定版本时间戳范围或者特定的版本时间来读取指定版本的列 + * 2. 目前暂不支持行内的断点 + */ +message GetRowRequest { + required string table_name = 1; + required bytes primary_key = 2; // encoded as InplaceRowChangeSet, but only has primary key + repeated string columns_to_get = 3; // 不指定则读出所有的列 + optional TimeRange time_range = 4; + optional int32 max_versions = 5; + optional bool cache_blocks = 6 [default = true]; // 本次读出的数据是否进入BlockCache + optional bytes filter = 7; + optional string start_column = 8; + optional string end_column = 9; + optional bytes token = 10; + optional string transaction_id = 11; +} + +message GetRowResponse { + required ConsumedCapacity consumed = 1; + required bytes row = 2; // encoded as InplaceRowChangeSet + optional bytes next_token = 3; +} +/* #################################################################################################### */ + +/* ############################################# UpdateRow ############################################# */ +message UpdateRowRequest { + required string table_name = 1; + required bytes row_change = 2; + required Condition condition = 3; + optional ReturnContent return_content = 4; + optional string transaction_id = 5; +} + +message UpdateRowResponse { + required ConsumedCapacity consumed = 1; + optional bytes row = 2; +} +/* ####################################################################################################### */ + +/* ############################################# PutRow ############################################# */ +/** + * 这里允许用户为每列单独设置timestamp,而不是强制整行统一一个timestamp。 + * 原因是列都是用统一的结构,该结构本身是带timestamp的,其次强制统一timestamp增强了规范性但是丧失了灵活性,且该规范性没有明显的好处,反而带来了结构的复杂。 + */ +message PutRowRequest { + required string table_name = 1; + required bytes row = 2; // encoded as InplaceRowChangeSet + required Condition condition = 3; + optional ReturnContent return_content = 4; + optional string transaction_id = 5; +} + +message PutRowResponse { + required ConsumedCapacity consumed = 1; + optional bytes row = 2; +} +/* #################################################################################################### */ + +/* ############################################# DeleteRow ############################################# */ +/** + * OTS只支持删除该行的所有列所有版本,不支持: + * 1. 删除所有列的所有小于等于某个版本的所有版本 + */ +message DeleteRowRequest { + required string table_name = 1; + required bytes primary_key = 2; // encoded as InplaceRowChangeSet, but only has primary key + required Condition condition = 3; + optional ReturnContent return_content = 4; + optional string transaction_id = 5; +} + +message DeleteRowResponse { + required ConsumedCapacity consumed = 1; + optional bytes row = 2; +} +/* ####################################################################################################### */ + +/* ############################################# BatchGetRow ############################################# */ +/** + * HBase支持Batch操作的每行都拥有不同的查询参数,OTS不支持。 + */ +message TableInBatchGetRowRequest { + required string table_name = 1; + repeated bytes primary_key = 2; // encoded as InplaceRowChangeSet, but only has primary key + repeated bytes token = 3; + repeated string columns_to_get = 4; // 不指定则读出所有的列 + optional TimeRange time_range = 5; + optional int32 max_versions = 6; + optional bool cache_blocks = 7 [default = true]; // 本次读出的数据是否进入BlockCache + optional bytes filter = 8; + optional string start_column = 9; + optional string end_column = 10; +} + +message BatchGetRowRequest { + repeated TableInBatchGetRowRequest tables = 1; +} + +message RowInBatchGetRowResponse { + required bool is_ok = 1; + optional Error error = 2; + optional ConsumedCapacity consumed = 3; + optional bytes row = 4; // encoded as InplaceRowChangeSet + optional bytes next_token = 5; +} + +message TableInBatchGetRowResponse { + required string table_name = 1; + repeated RowInBatchGetRowResponse rows = 2; +} + +message BatchGetRowResponse { + repeated TableInBatchGetRowResponse tables = 1; +} +/* ######################################################################################################### */ + +/* ############################################# BatchWriteRow ############################################# */ + +enum OperationType { + PUT = 1; + UPDATE = 2; + DELETE = 3; +} + +message RowInBatchWriteRowRequest { + required OperationType type = 1; + required bytes row_change = 2; // encoded as InplaceRowChangeSet + required Condition condition = 3; + optional ReturnContent return_content = 4; +} + +message TableInBatchWriteRowRequest { + required string table_name = 1; + repeated RowInBatchWriteRowRequest rows = 2; +} + +message BatchWriteRowRequest { + repeated TableInBatchWriteRowRequest tables = 1; + optional string transaction_id = 2; +} + +message RowInBatchWriteRowResponse { + required bool is_ok = 1; + optional Error error = 2; + optional ConsumedCapacity consumed = 3; + optional bytes row = 4; +} + +message TableInBatchWriteRowResponse { + required string table_name = 1; + repeated RowInBatchWriteRowResponse rows = 2; +} + +message BatchWriteRowResponse { + repeated TableInBatchWriteRowResponse tables = 1; +} +/* ########################################################################################################### */ + +/* ############################################# GetRange ############################################# */ +enum Direction { + FORWARD = 0; + BACKWARD = 1; +} + +/** + * HBase支持以下参数: + * 1. TimeRange或指定time + * 2. Filter(根据列值或列名来过滤) + * 我们只支持给同版本的选择条件。 + */ +message GetRangeRequest { + required string table_name = 1; + required Direction direction = 2; + repeated string columns_to_get = 3; // 不指定则读出所有的列 + optional TimeRange time_range = 4; + optional int32 max_versions = 5; + optional int32 limit = 6; + required bytes inclusive_start_primary_key = 7; // encoded as InplaceRowChangeSet, but only has primary key + required bytes exclusive_end_primary_key = 8; // encoded as InplaceRowChangeSet, but only has primary key + optional bool cache_blocks = 9 [default = true]; // 本次读出的数据是否进入BlockCache + optional bytes filter = 10; + optional string start_column = 11; + optional string end_column = 12; + optional bytes token = 13; + optional string transaction_id = 14; + optional DataBlockType data_block_type_hint = 15 [default = DBT_PLAIN_BUFFER]; + optional bool return_entire_primary_keys = 16 [default = true]; + optional CompressType compress_type_hint = 17 [default = CPT_NONE]; +} + +message GetRangeResponse { + required ConsumedCapacity consumed = 1; + required bytes rows = 2; // encoded as InplaceRowChangeSet + optional bytes next_start_primary_key = 3; // 若为空,则代表数据全部读取完毕. encoded as InplaceRowChangeSet, but only has primary key + optional bytes next_token = 4; + optional DataBlockType data_block_type = 5; + optional CompressType compress_type = 6; +} + +/* ######################################################################################################### */ + +/* ########################################### LocalTransaction ########################################### */ +message StartLocalTransactionRequest { + required string table_name = 1; + required bytes key = 2; // encoded as SQLVariant +} + +message StartLocalTransactionResponse { + required string transaction_id = 1; +}; + +message CommitTransactionRequest { + required string transaction_id = 1; +} + +message CommitTransactionResponse { +}; + +message AbortTransactionRequest { + required string transaction_id = 1; +} + +message AbortTransactionResponse { +}; + +/* ######################################################################################################### */ + + +/* ###################################################################################################### */ +/* ############################################# Stream ############################################# */ + +message ListStreamRequest { + optional string table_name = 1; +} + +message Stream { + required string stream_id = 1; + required string table_name = 2; + required int64 creation_time = 3; +} + +message ListStreamResponse { + repeated Stream streams = 1; +} + +message StreamShard { + required string shard_id = 1; + optional string parent_id = 2; + optional string parent_sibling_id = 3; +} + +enum StreamStatus { + STREAM_ENABLING = 1; + STREAM_ACTIVE = 2; +} + +message DescribeStreamRequest { + required string stream_id = 1; + optional string inclusive_start_shard_id = 2; + optional int32 shard_limit = 3; +} + +message DescribeStreamResponse { + required string stream_id = 1; + required int32 expiration_time = 2; + required string table_name = 3; + required int64 creation_time = 4; + required StreamStatus stream_status = 5; + repeated StreamShard shards = 6; + optional string next_shard_id = 7; +} + +message GetShardIteratorRequest { + required string stream_id = 1; + required string shard_id = 2; +} + +message GetShardIteratorResponse { + required string shard_iterator = 1; +} + +message GetStreamRecordRequest { + required string shard_iterator = 1; + optional int32 limit = 2; +} + +enum ActionType { + PUT_ROW = 1; + UPDATE_ROW = 2; + DELETE_ROW = 3; +} + +message GetStreamRecordResponse { + message StreamRecord { + required ActionType action_type = 1; + required bytes record = 2; + } + repeated StreamRecord stream_records = 1; + optional string next_shard_iterator = 2; +} + +/* +++++ ComputeSplitPointsBySize +++++ */ +message ComputeSplitPointsBySizeRequest { + required string table_name = 1; + required int64 split_size = 2; // in 100MB + optional int64 split_size_unit_in_byte = 3; +} + +message ComputeSplitPointsBySizeResponse { + required ConsumedCapacity consumed = 1; + repeated PrimaryKeySchema schema = 2; + + /** + * Split points between splits, in the increasing order + * + * A split is a consecutive range of primary keys, + * whose data size is about split_size specified in the request. + * The size could be hard to be precise. + * + * A split point is an array of primary-key column w.r.t. table schema, + * which is never longer than that of table schema. + * Tailing -inf will be omitted to reduce transmission payloads. + */ + repeated bytes split_points = 3; + + /** + * Locations where splits lies in. + * + * By the managed nature of TableStore, these locations are no more than hints. + * If a location is not suitable to be seen, an empty string will be placed. + */ + message SplitLocation { + required string location = 1; + required sint64 repeat = 2; + } + repeated SplitLocation locations = 4; +} +/* -------------------------------------- */ + diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/table_store_filter.proto b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/table_store_filter.proto new file mode 100644 index 0000000..e8dabe5 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/table_store_filter.proto @@ -0,0 +1,46 @@ +syntax = "proto2"; +package com.alicloud.openservices.tablestore.core.protocol; + +enum FilterType { + FT_SINGLE_COLUMN_VALUE = 1; + FT_COMPOSITE_COLUMN_VALUE = 2; + FT_COLUMN_PAGINATION = 3; +} + +enum ComparatorType { + CT_EQUAL = 1; + CT_NOT_EQUAL = 2; + CT_GREATER_THAN = 3; + CT_GREATER_EQUAL = 4; + CT_LESS_THAN = 5; + CT_LESS_EQUAL = 6; +} + +message SingleColumnValueFilter { + required ComparatorType comparator = 1; + required string column_name = 2; + required bytes column_value = 3; // Serialized SQLVariant + required bool filter_if_missing = 4; + required bool latest_version_only = 5; +} + +enum LogicalOperator { + LO_NOT = 1; + LO_AND = 2; + LO_OR = 3; +} + +message CompositeColumnValueFilter { + required LogicalOperator combinator = 1; + repeated Filter sub_filters = 2; +} + +message ColumnPaginationFilter { + required int32 offset = 1; + required int32 limit = 2; +} + +message Filter { + required FilterType type = 1; + required bytes filter = 2; // Serialized string of filter of the type +} diff --git a/netstandard-sdk/Aliyun/OTS/ProtoBuffer/tablestore_search.proto b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/tablestore_search.proto new file mode 100644 index 0000000..ec7324d --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/ProtoBuffer/tablestore_search.proto @@ -0,0 +1,325 @@ +syntax = "proto2"; + +package com.alicloud.openservices.tablestore.core.protocol; + +enum QueryType { + MATCH_QUERY = 1; + MATCH_PHRASE_QUERY = 2; + TERM_QUERY = 3; + RANGE_QUERY = 4; + PREFIX_QUERY = 5; + BOOL_QUERY = 6; + CONST_SCORE_QUERY = 7; + FUNCTION_SCORE_QUERY = 8; + NESTED_QUERY = 9; + WILDCARD_QUERY = 10; + MATCH_ALL_QUERY = 11; + GEO_BOUNDING_BOX_QUERY = 12; + GEO_DISTANCE_QUERY = 13; + GEO_POLYGON_QUERY = 14; + TERMS_QUERY = 15; +} + +enum QueryOperator { + OR = 1; + AND = 2; +} + +message MatchQuery { + optional string field_name = 1; + optional string text = 2; + optional int32 minimum_should_match = 3; + optional QueryOperator operator = 4; +} + +message MatchPhraseQuery { + optional string field_name = 1; + optional string text = 2; +} + +message MatchAllQuery { +} + +message TermQuery { + optional string field_name = 1; + optional bytes term = 2; +} + +message TermsQuery { + optional string field_name = 1; + repeated bytes terms = 2; +} + +message RangeQuery { + optional string field_name = 1; + optional bytes range_from = 2; // variant value + optional bytes range_to = 3; // variant value + optional bool include_lower = 4; + optional bool include_upper = 5; +} + +message PrefixQuery { + optional string field_name = 1; + optional string prefix = 2; +} + +message WildcardQuery { + optional string field_name = 1; + optional string value = 2; +} + +message BoolQuery { + repeated Query must_queries = 1; + repeated Query must_not_queries = 2; + repeated Query filter_queries = 3; + repeated Query should_queries = 4; + optional int32 minimum_should_match = 5; +} + +message ConstScoreQuery { + optional Query filter = 1; +} + +message FieldValueFactor { + optional string field_name = 1; +} + +message FunctionScoreQuery { + optional Query query = 1; + optional FieldValueFactor field_value_factor = 2; +} + +enum ScoreMode { + SCORE_MODE_NONE = 1; + SCORE_MODE_AVG = 2; + SCORE_MODE_MAX = 3; + SCORE_MODE_TOTAL = 4; + SCORE_MODE_MIN = 5; +} + +message NestedQuery { + optional string path = 1; + optional Query query = 2; + optional ScoreMode score_mode = 3; +} + +message GeoBoundingBoxQuery { + optional string field_name = 1; + optional string top_left = 2; + optional string bottom_right = 3; +} + +message GeoDistanceQuery { + optional string field_name = 1; + optional string center_point = 2; + optional double distance = 3; +} + +message GeoPolygonQuery { + optional string field_name = 1; + repeated string points = 2; +} + +message Query { + optional QueryType type = 1; + optional bytes query = 2; +} + +message Collapse { + optional string field_name = 1; +} + +message NestedFilter { + optional string path = 1; + optional Query filter = 2; +} + +enum SortOrder { + SORT_ORDER_ASC = 0; + SORT_ORDER_DESC = 1; +} + +enum SortMode { + SORT_MODE_MIN = 0; + SORT_MODE_MAX = 1; + SORT_MODE_AVG = 2; +} + +message ScoreSort { + optional SortOrder order = 1; +} + +message PrimaryKeySort { + optional SortOrder order = 1; +} + +message FieldSort { + optional string field_name = 1; + optional SortOrder order = 2; + optional SortMode mode = 3; + optional NestedFilter nested_filter = 4; +} + +enum GeoDistanceType { + GEO_DISTANCE_ARC = 0; + GEO_DISTANCE_PLANE = 1; +} + +message GeoDistanceSort { + optional string field_name = 1; + repeated string points = 2; + optional SortOrder order = 3; + optional SortMode mode = 4; + optional GeoDistanceType distance_type = 5; + optional NestedFilter nested_filter = 6; +} + +message Sorter { + optional FieldSort field_sort = 1; + optional GeoDistanceSort geo_distance_sort = 2; + optional ScoreSort score_sort = 3; + optional PrimaryKeySort pk_sort = 4; +} + +message Sort { + repeated Sorter sorter = 1; +} + +message SearchQuery { + optional int32 offset = 1; + optional int32 limit = 2; + optional Query query = 4; + optional Collapse collapse = 5; + optional Sort sort = 6; + optional bool getTotalCount = 8; + optional bytes token = 9; +} + +enum ColumnReturnType { + RETURN_ALL = 1; + RETURN_SPECIFIED = 2; + RETURN_NONE = 3; +} + +message ColumnsToGet { + optional ColumnReturnType return_type = 1; + repeated string column_names = 2; +} + +message SearchRequest { + optional string table_name = 1; + optional string index_name = 2; + optional ColumnsToGet columns_to_get = 3; + optional bytes search_query = 4; + repeated bytes routing_values = 5; +} + +/** + * Response֣ + **/ +message SearchResponse { + optional int64 total_hits = 1; + repeated bytes rows = 2; + optional bool is_all_succeeded = 3; + optional bytes next_token = 6; +} + +/* Create Search Index */ + +enum IndexOptions { + DOCS = 1; + FREQS = 2; + POSITIONS = 3; + OFFSETS = 4; +} + +enum FieldType { + LONG = 1; + DOUBLE = 2; + BOOLEAN = 3; + KEYWORD = 4; + TEXT = 5; + NESTED = 6; + GEO_POINT = 7; +} + +message FieldSchema { + optional string field_name = 1; + optional FieldType field_type = 2; + optional IndexOptions index_options = 3; + optional string analyzer = 4; + optional bool index = 5; + optional bool doc_values = 6; + optional bool store = 7; + repeated FieldSchema field_schemas = 8; // only for nested type + optional bool is_array = 9; +} + +message IndexSchema { + repeated FieldSchema field_schemas = 1; + optional IndexSetting index_setting = 2; + optional Sort index_sort = 3; +} + +message IndexSetting { + optional int32 number_of_shards = 1; + repeated string routing_fields = 2; + optional int32 routing_partition_size = 3; +} + +message CreateSearchIndexRequest { + required string table_name = 1; + required string index_name = 2; + optional IndexSchema schema = 3; +} + +message CreateSearchIndexResponse { +} + +/* List Search Index */ + +message IndexInfo { + optional string table_name = 1; + optional string index_name = 2; +} + +message ListSearchIndexRequest { + optional string table_name = 1; +} + +message ListSearchIndexResponse { + repeated IndexInfo indices = 1; +} + +/* Delete Search Index */ + +message DeleteSearchIndexRequest { + optional string table_name = 1; + optional string index_name = 2; +} + +message DeleteSearchIndexResponse { +} + +/* Describe Search Index */ + +enum SyncPhase { + FULL = 1; + INCR = 2; +} + +message SyncStat { + optional SyncPhase sync_phase = 1; + optional int64 current_sync_timestamp = 2; // ͬȣοTunnelService +} + +message DescribeSearchIndexRequest { + optional string table_name = 1; + optional string index_name = 2; +} + +message DescribeSearchIndexResponse { + optional IndexSchema schema = 1; + optional SyncStat sync_stat = 2; +} + diff --git a/netstandard-sdk/Aliyun/OTS/Request/BatchGetRowRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/BatchGetRowRequest.cs new file mode 100644 index 0000000..5523345 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/BatchGetRowRequest.cs @@ -0,0 +1,132 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; +using System.Linq; +using System.Collections.Generic; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.DataModel.ConditionalUpdate; + +namespace Aliyun.OTS.Request +{ + public struct BatchGetRowRequestItem + { + public string TableName; + public IList PrimaryKeys; + public HashSet ColumnsToGet; + } + + /// + /// 表示一个BatchGetRow的请求。先构造它的实例,再使用Add方法添加读请求。 + /// + public class BatchGetRowRequest : OTSRequest + { + private readonly IDictionary rowQueryCriteriaDict; + + /// + /// 构造一个新的 + /// + public BatchGetRowRequest() + { + rowQueryCriteriaDict = new Dictionary(); + } + + /// + /// 添加一个表的多行读条件 + /// + /// 多行读的条件语句 + public void Add(MultiRowQueryCriteria rowQueryCriteria) + { + if (rowQueryCriteria != null && !string.IsNullOrEmpty(rowQueryCriteria.TableName)) + { + rowQueryCriteriaDict[rowQueryCriteria.TableName] = rowQueryCriteria; + } + } + + /// + /// 添加一个表的多行读请求。 + /// + /// 表名 + /// 多行的主键 + /// 要读取的列 + /// 过滤条件 + public void Add(string tableName, + List primaryKeys, + HashSet columnsToGet = null, + IColumnCondition condition = null) + { + var rowQueryCriteria = new MultiRowQueryCriteria(tableName); + rowQueryCriteria.SetRowKeys(primaryKeys); + + if (columnsToGet != null) + { + rowQueryCriteria.SetColumnsToGet(columnsToGet); + } + + if (condition != null) + { + rowQueryCriteria.Filter = condition.ToFilter(); + } + + rowQueryCriteriaDict[tableName] = rowQueryCriteria; + } + + /// + /// 按照表名称获取 + /// + /// 表名称 + /// 多行查询条件 + public MultiRowQueryCriteria GetCriteriasByTable(string tableName) + { + if (rowQueryCriteriaDict.ContainsKey(tableName)) + { + return rowQueryCriteriaDict[tableName]; + } + + return null; + } + + /// + /// 获取列表 + /// + /// + public IList GetCriterias() + { + return rowQueryCriteriaDict.Values.ToList(); + } + + /// + /// 表示BatchGetRow请求中每个表的行。 + /// + [Obsolete("ItemList is deprecated, please use GetCriterias instead.")] + public IList ItemList + { + get + { + IList itemList = new List(); + + foreach (KeyValuePair criteria in rowQueryCriteriaDict) + { + var item = new BatchGetRowRequestItem + { + TableName = criteria.Value.TableName, + PrimaryKeys = criteria.Value.GetRowKeys(), + ColumnsToGet = criteria.Value.GetColumnsToGet() + }; + + itemList.Add(item); + } + + return itemList; + } + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/BatchWriteRowRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/BatchWriteRowRequest.cs new file mode 100644 index 0000000..adb40a8 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/BatchWriteRowRequest.cs @@ -0,0 +1,43 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System.Collections.Generic; +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Request +{ + /// + /// 表示一个BatchWriteRow的请求。先构造实例,再使用Add方法添加写请求。 + /// + public class BatchWriteRowRequest : OTSRequest + { + + /// + /// 表示BatchWriteRow请求中每个表要修改的数据。 + /// + public IDictionary RowChangesGroupByTable { get; private set; } + + public BatchWriteRowRequest() + { + RowChangesGroupByTable = new Dictionary(); + } + + /// + /// 添加一个表中要修改的数据。 + /// + /// 表名 + /// 多行修改 + public void Add(string tableName, RowChanges rowChanges) + { + RowChangesGroupByTable.Add(tableName, rowChanges); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/CreateGlobalIndexRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/CreateGlobalIndexRequest.cs new file mode 100644 index 0000000..7217857 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/CreateGlobalIndexRequest.cs @@ -0,0 +1,19 @@ +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Request +{ + public class CreateGlobalIndexRequest : OTSRequest + { + public string MainTableName { get; set; } + + public IndexMeta IndexMeta { get; set; } + + public bool IncludeBaseData { get; set; } + + public CreateGlobalIndexRequest(string mainTableName, IndexMeta indexMeta) + { + this.MainTableName = mainTableName; + this.IndexMeta = indexMeta; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/CreateSearchIndexRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/CreateSearchIndexRequest.cs new file mode 100644 index 0000000..2754641 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/CreateSearchIndexRequest.cs @@ -0,0 +1,17 @@ +using Aliyun.OTS.DataModel.Search; + +namespace Aliyun.OTS.Request +{ + public class CreateSearchIndexRequest : OTSRequest + { + public string TableName { get; set; } + public string IndexName { get; set; } + public IndexSchema IndexSchame { get; set; } + + public CreateSearchIndexRequest(string tableName, string indexName) + { + this.TableName = tableName; + this.IndexName = indexName; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/CreateTableRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/CreateTableRequest.cs new file mode 100644 index 0000000..f7e8def --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/CreateTableRequest.cs @@ -0,0 +1,61 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +using System.Collections.Generic; +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Request +{ + /// + /// 表示一个CreateTable的请求。 + /// + public class CreateTableRequest : OTSRequest + { + /// + /// 表的元数据,包含表名和主键的设计。 + /// + public TableMeta TableMeta { get; set; } + + /// + /// 预留读写吞吐量。 + /// + public CapacityUnit ReservedThroughput { get; set; } + + + public TableOptions TableOptions { get; set; } + + + public StreamSpecification StreamSpecification { get; set; } + + + public List PartitionRange { get; set; } + + public List IndexMetas { get; set; } + + + public CreateTableRequest(TableMeta tableMeta, CapacityUnit reservedThroughput) + { + TableMeta = tableMeta; + ReservedThroughput = reservedThroughput; + TableOptions = new TableOptions(); + } + + public CreateTableRequest(TableMeta tableMeta, CapacityUnit reservedThroughput, List indexMetas) + { + TableMeta = tableMeta; + ReservedThroughput = reservedThroughput; + TableOptions = new TableOptions(); + IndexMetas = indexMetas; + } + + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/DeleteGlobalIndexRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/DeleteGlobalIndexRequest.cs new file mode 100644 index 0000000..fad04cf --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/DeleteGlobalIndexRequest.cs @@ -0,0 +1,15 @@ +namespace Aliyun.OTS.Request +{ + public class DeleteGlobalIndexRequest : OTSRequest + { + public string MainTableName { get; set; } + + public string IndexName { get; set; } + + public DeleteGlobalIndexRequest(string mainTableName, string indexName) + { + this.MainTableName = mainTableName; + this.IndexName = indexName; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/DeleteRowRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/DeleteRowRequest.cs new file mode 100644 index 0000000..971404a --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/DeleteRowRequest.cs @@ -0,0 +1,59 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Request +{ + /// + /// 表示一个DeleteRow请求。 + /// + public class DeleteRowRequest : OTSRequest + { + + /// + /// 表名 + /// + public string TableName { get; set; } + + /// + /// 操作条件。 + /// + public Condition Condition { get; set; } + + /// + /// 该行的主键 + /// + public PrimaryKey PrimaryKey { get; set; } + + public RowDeleteChange RowDeleteChange { get; set;} + + public DeleteRowRequest(string tableName, Condition condition, PrimaryKey primaryKey) + { + TableName = tableName; + Condition = condition; + PrimaryKey = primaryKey; + RowDeleteChange = new RowDeleteChange(tableName, primaryKey) + { + Condition = condition + }; + } + + public DeleteRowRequest(RowDeleteChange rowDeleteChange) + { + RowDeleteChange = rowDeleteChange; + TableName = rowDeleteChange.TableName; + Condition = rowDeleteChange.Condition; + PrimaryKey = rowDeleteChange.PrimaryKey; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/DeleteSearchIndexRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/DeleteSearchIndexRequest.cs new file mode 100644 index 0000000..61f8dc8 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/DeleteSearchIndexRequest.cs @@ -0,0 +1,13 @@ +namespace Aliyun.OTS.Request +{ + public class DeleteSearchIndexRequest : OTSRequest + { + public string TableName { get; set; } + public string IndexName { get; set; } + + public DeleteSearchIndexRequest(string tableName,string indexName) { + this.TableName = tableName; + this.IndexName = indexName; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/DeleteTableRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/DeleteTableRequest.cs new file mode 100644 index 0000000..0992cc2 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/DeleteTableRequest.cs @@ -0,0 +1,29 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +namespace Aliyun.OTS.Request +{ + /// + /// 表示一个DeleteTable请求。 + /// + public class DeleteTableRequest : OTSRequest + { + /// + /// 要删除的表的表名 + /// + public string TableName { get; set; } + public DeleteTableRequest(string tableName) + { + TableName = tableName; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/DescribeSearchIndexRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/DescribeSearchIndexRequest.cs new file mode 100644 index 0000000..f47e0e6 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/DescribeSearchIndexRequest.cs @@ -0,0 +1,14 @@ +namespace Aliyun.OTS.Request +{ + public class DescribeSearchIndexRequest : OTSRequest + { + public string TableName { get; set; } + public string IndexName { get; set; } + + public DescribeSearchIndexRequest(string tableName, string indexName) + { + this.TableName = tableName; + this.IndexName = indexName; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/DescribeTableRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/DescribeTableRequest.cs new file mode 100644 index 0000000..765a53f --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/DescribeTableRequest.cs @@ -0,0 +1,29 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +namespace Aliyun.OTS.Request +{ + /// + /// 表示一个DescribeTable请求。 + /// + public class DescribeTableRequest : OTSRequest + { + /// + /// 表名 + /// + public string TableName { get; set; } + public DescribeTableRequest(string tableName) + { + TableName = tableName; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/GetIteratorRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/GetIteratorRequest.cs new file mode 100644 index 0000000..654878c --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/GetIteratorRequest.cs @@ -0,0 +1,61 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; +using System.Collections.Generic; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.DataModel.ConditionalUpdate; + +namespace Aliyun.OTS.Request +{ + /// + /// 表示一个GetIterator请求。 + /// + public class GetIteratorRequest : GetRangeRequest + { + public CapacityUnit ConsumedCapacityUnitCounter { get; private set; } + + /// + /// 通过构造一个新的 + /// + /// + public GetIteratorRequest(RangeRowQueryCriteria queryCriteria, + CapacityUnit consumedCapacityUnitCounter) + : base(queryCriteria) + { + ConsumedCapacityUnitCounter = consumedCapacityUnitCounter; + } + + /// + /// 通过多个参数构造一个新的 + /// + /// 表名称 + /// 前向还是后向 + /// 区间开始位置,包含 + /// 区间结束位置,不包含 + /// 用户传入的CapacityUnit消耗计数器。 + /// 返回的列名称的列表 + /// 最大返回数 + public GetIteratorRequest(string tableName, + GetRangeDirection direction, + PrimaryKey inclusiveStartPrimaryKey, + PrimaryKey exclusiveEndPrimaryKey, + CapacityUnit consumedCapacityUnitCounter, + HashSet columnsToGet = null, + int? limit = null, + IColumnCondition condition = null) + : base(tableName, direction, inclusiveStartPrimaryKey, exclusiveEndPrimaryKey, + columnsToGet, limit, condition) + { + ConsumedCapacityUnitCounter = consumedCapacityUnitCounter; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/GetRangeRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/GetRangeRequest.cs new file mode 100644 index 0000000..16fca31 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/GetRangeRequest.cs @@ -0,0 +1,188 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; +using System.Collections.Generic; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.DataModel.ConditionalUpdate; + +namespace Aliyun.OTS.Request +{ + /// + /// 表示GetRange的方向的枚举类型,向前或者向后。 + /// + public enum GetRangeDirection + { + /// + /// 向前 + /// + Forward, + + /// + /// 向后 + /// + Backward, + } + + /// + /// 表示一个GetRange请求。 + /// + public class GetRangeRequest : OTSRequest + { + /// + /// 设置或获取 + /// + public RangeRowQueryCriteria QueryCriteria { get; set; } + + /// + /// 通过构造一个新的 + /// + /// + public GetRangeRequest(RangeRowQueryCriteria queryCriteria) + { + QueryCriteria = queryCriteria; + } + + /// + /// 通过多个参数构造一个新的 + /// + /// 表名称 + /// 前向还是后向 + /// 区间开始位置,包含 + /// 区间结束位置,不包含 + /// 返回的列名称的列表 + /// 最大返回数 + public GetRangeRequest(string tableName, + GetRangeDirection direction, + PrimaryKey inclusiveStartPrimaryKey, + PrimaryKey exclusiveEndPrimaryKey, + HashSet columnsToGet = null, + int? limit = null, + IColumnCondition condition = null) + { + QueryCriteria = new RangeRowQueryCriteria(tableName) + { + Direction = direction, + Limit = limit, + InclusiveStartPrimaryKey = inclusiveStartPrimaryKey, + ExclusiveEndPrimaryKey = exclusiveEndPrimaryKey + }; + + if (columnsToGet != null) + { + QueryCriteria.SetColumnsToGet(columnsToGet); + } + + if (condition != null) + { + QueryCriteria.Filter = condition.ToFilter(); + } + } + + /// + /// 表名 + /// + [Obsolete("TableName is deprecated, please use QueryCriteria.TableName instead.")] + public string TableName + { + get + { + return QueryCriteria.TableName; + } + + set + { + QueryCriteria.TableName = value; + } + } + + /// + /// 范围的方向,向前或者向后 + /// + [Obsolete("Direction is deprecated, please use QueryCriteria.Direction instead.")] + public GetRangeDirection Direction + { + get + { + return QueryCriteria.Direction; + } + + set + { + QueryCriteria.Direction = value; + } + } + + /// + /// 起始主键,包含。这里的主键列可以用表示最小值或者最大值 + /// [Obsolete("InclusiveStartPrimaryKey is deprecated, please use QueryCriteria.InclusiveStartPrimaryKey instead.")] public PrimaryKey InclusiveStartPrimaryKey + { + get + { + return QueryCriteria.InclusiveStartPrimaryKey; + } + set + { + QueryCriteria.InclusiveStartPrimaryKey = value; + } + + } + + /// + /// 结束主键,不包含。这里的主键列可以用表示最小值或者最大值 + /// + [Obsolete("ExclusiveEndPrimaryKey is deprecated, please use QueryCriteria.ExclusiveEndPrimaryKey instead.")] + public PrimaryKey ExclusiveEndPrimaryKey + { + get + { + return QueryCriteria.ExclusiveEndPrimaryKey; + } + set + { + QueryCriteria.ExclusiveEndPrimaryKey = value; + } + } + + /// + /// 每行要读取的列的列名;默认读取所有的列 + /// + [Obsolete("ColumnsToGet is deprecated, please use QueryCriteria.GetColumnsToGet() or QueryCriteria.SetColumnsToGet(value) instead.")] + public HashSet ColumnsToGet + { + get + { + return QueryCriteria.GetColumnsToGet(); + } + set + { + QueryCriteria.SetColumnsToGet(value); + } + } + + /// + /// 最多读取多少行;默认读取范围内所有的行 + /// + [Obsolete("Limit is deprecated, please use QueryCriteria.Limit instead.")] + public int? Limit + { + get + { + return QueryCriteria.Limit; + } + set + { + QueryCriteria.Limit = value; + } + } + + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/GetRowRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/GetRowRequest.cs new file mode 100644 index 0000000..703de59 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/GetRowRequest.cs @@ -0,0 +1,134 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + */ + +using System; +using System.Collections.Generic; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.DataModel.ConditionalUpdate; + +namespace Aliyun.OTS.Request +{ + /// + /// 表示一个GetRow请求。 + /// + public class GetRowRequest : OTSRequest + { + /// + /// 设置或获取过滤条件 + /// + public SingleRowQueryCriteria QueryCriteria { get; private set; } + + /// + /// 构造一个新的实例。 + /// + /// 条件 + public GetRowRequest(SingleRowQueryCriteria singleRowQueryCriteria) + { + QueryCriteria = singleRowQueryCriteria; + } + + /// + /// 构造一个新的实例。 + /// + /// 表名称 + /// 主键 + /// 获取的列名称列表,如果为空,则获取所有列 + /// 过滤条件 + public GetRowRequest(string tableName, + PrimaryKey primaryKey, + HashSet columnsToGet = null, + IColumnCondition condition = null, + TimeRange timeRange = null, + int? maxVersion = null, + bool? cacheBlocks = null, + string startColumn = null, + string endColumn = null, + byte[] token = null + ) + { + QueryCriteria = new SingleRowQueryCriteria(tableName) + { + RowPrimaryKey = primaryKey + }; + + if (columnsToGet != null) + { + QueryCriteria.SetColumnsToGet(columnsToGet); + } + + if (condition != null) + { + QueryCriteria.Filter = condition.ToFilter(); + } + + if (timeRange != null) + { + QueryCriteria.TimeRange = timeRange; + } + + QueryCriteria.MaxVersions = maxVersion; + QueryCriteria.CacheBlocks = cacheBlocks; + QueryCriteria.StartColumn = startColumn; + QueryCriteria.EndColumn = endColumn; + QueryCriteria.Token = token; + } + + /// + /// 主键 + /// + [Obsolete("PrimaryKey is deprecated, please use QueryCriteria.RowPrimaryKey instead.")] + public PrimaryKey PrimaryKey + { + get + { + return QueryCriteria.RowPrimaryKey; + } + + set + { + QueryCriteria.RowPrimaryKey = value; + } + } + + /// + /// 表名 + /// + [Obsolete("TableName is deprecated, please use QueryCriteria.TableName instead.")] + public string TableName + { + get + { + return QueryCriteria.TableName; + } + + set + { + QueryCriteria.TableName = value; + } + } + + /// + /// 要读取的列的列名;默认为读取所有的列。 + /// + [Obsolete("ColumnsToGet is deprecated, please use QueryCriteria.GetColumnsToGet() or QueryCriteria.SetColumnsToGet instead.")] + public HashSet ColumnsToGet + { + get + { + return QueryCriteria.GetColumnsToGet(); + } + + set + { + QueryCriteria.SetColumnsToGet(value); + } + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/ListSearchIndexRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/ListSearchIndexRequest.cs new file mode 100644 index 0000000..9c8dcbf --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/ListSearchIndexRequest.cs @@ -0,0 +1,15 @@ +namespace Aliyun.OTS.Request +{ + /// + /// 表示一个ListSearchIndex请求 + /// + public class ListSearchIndexRequest : OTSRequest + { + public ListSearchIndexRequest(string tableName) + { + this.TableName = tableName; + } + + public string TableName { get; set; } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/ListTableRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/ListTableRequest.cs new file mode 100644 index 0000000..536be55 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/ListTableRequest.cs @@ -0,0 +1,21 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +namespace Aliyun.OTS.Request +{ + /// + /// 表示一个ListTable请求 + /// + public class ListTableRequest : OTSRequest + { + public ListTableRequest() { } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/OTSRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/OTSRequest.cs new file mode 100644 index 0000000..d46a6c1 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/OTSRequest.cs @@ -0,0 +1,18 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +namespace Aliyun.OTS.Request +{ + public interface OTSRequest + { + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/PutRowRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/PutRowRequest.cs new file mode 100644 index 0000000..db8c423 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/PutRowRequest.cs @@ -0,0 +1,60 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Request +{ + /// + /// 表示一个PutRow请求。 + /// + public class PutRowRequest : OTSRequest + { + /// + /// 表名 + /// + public string TableName { get; set; } + + /// + /// 操作条件 + /// + public Condition Condition { get; set; } + + /// + /// PutRow操作的请求参数 + /// + /// The row put change. + public RowPutChange RowPutChange { get; set; } + + public PutRowRequest(string tableName, Condition condition) + { + TableName = tableName; + Condition = condition; + RowPutChange = new RowPutChange(tableName); + } + + public PutRowRequest(string tableName, Condition condition, PrimaryKey primaryKey, AttributeColumns columns):this(tableName, condition) + { + RowPutChange.PrimaryKey = primaryKey; + + if(columns != null) + { + var enumerator = columns.GetEnumerator(); + while (enumerator.MoveNext()) + { + var column = enumerator.Current; + RowPutChange.AddColumn(new Column(column.Key, column.Value)); + } + } + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/SearchRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/SearchRequest.cs new file mode 100644 index 0000000..b13872a --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/SearchRequest.cs @@ -0,0 +1,41 @@ +using System.Collections.Generic; +using Aliyun.OTS.DataModel; +using Aliyun.OTS.DataModel.Search; + +namespace Aliyun.OTS.Request +{ + public class SearchRequest : OTSRequest + { + public SearchRequest(string tableName, string indexName, SearchQuery searchQuery) + { + this.TableName = tableName; + this.IndexName = indexName; + this.SearchQuery = searchQuery; + } + + /// + /// TableStore的表名 + /// + public string TableName { get; set; } + /// + /// SearchIndex中的index名 + /// + public string IndexName { get; set; } + /// + /// 查询语句,具体参数详见{@link SearchQuery} + /// + public SearchQuery SearchQuery { get; set; } + /// + /// 指定哪些属性列需要返回 + ///如果SearchIndex中的属性列太多,而只想要某些属性列,则可以减少网络传输的数据量,提高响应速度 + /// + public ColumnsToGet ColumnsToGet { get; set; } + /// + /// 路由字段 + ///默认为空,大多数场景下不需要使用该值。如果使用了自定义路由,可以指定路由字段。 + ///注意:高级特性。如需了解或使用请提工单或联系开发人员 + /// + public List RoutingValues { get; set; } + + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/UpdateRowRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/UpdateRowRequest.cs new file mode 100644 index 0000000..3d4d862 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/UpdateRowRequest.cs @@ -0,0 +1,67 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Request +{ + /// + /// 表示一个UpdateRow请求。 + /// + public class UpdateRowRequest : OTSRequest + { + /// + /// 表名 + /// + public string TableName { get; set; } + + /// + /// 操作条件 + /// + public Condition Condition { get; set; } + + /// + /// 主键 + /// + public PrimaryKey PrimaryKey { get; set; } + + /// + /// 属性的修改 + /// + public UpdateOfAttribute UpdateOfAttribute { get; set; } + + public RowUpdateChange RowUpdateChange { get; set;} + + public UpdateRowRequest(string tableName, Condition condition, PrimaryKey primaryKey, + UpdateOfAttribute updateOfAttribute) + { + TableName = tableName; + Condition = condition; + PrimaryKey = primaryKey; + UpdateOfAttribute = updateOfAttribute; + RowUpdateChange = new RowUpdateChange(tableName, primaryKey) + { + Condition = condition + }; + + RowUpdateChange.FromUpdateOfAtrribute(updateOfAttribute); + } + + public UpdateRowRequest(RowUpdateChange rowUpdateChange) + { + this.RowUpdateChange = rowUpdateChange; + this.TableName = rowUpdateChange.TableName; + this.Condition = rowUpdateChange.Condition; + this.PrimaryKey = rowUpdateChange.PrimaryKey; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Request/UpdateTableRequest.cs b/netstandard-sdk/Aliyun/OTS/Request/UpdateTableRequest.cs new file mode 100644 index 0000000..ab6971f --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Request/UpdateTableRequest.cs @@ -0,0 +1,52 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Request +{ + /// + /// 表示一个UpdateTable请求。 + /// + public class UpdateTableRequest : OTSRequest + { + /// + /// 表名 + /// + public string TableName { get; set; } + + /// + /// 要更新的预留读写吞吐量。这里的预留读写吞吐量可以仅设置读或写。 + /// + public CapacityUnit ReservedThroughput { get; set; } + + /// + /// 要更新的预留读写吞吐量。这里的预留读写吞吐量可以仅设置读或写。 + /// + public TableOptions TableOptions { get; set; } + + /// + /// 要更新的预留读写吞吐量。这里的预留读写吞吐量可以仅设置读或写。 + /// + public StreamSpecification StreamSpecification { get; set; } + + public UpdateTableRequest(string tableName) + { + TableName = tableName; + } + + public UpdateTableRequest(string tableName, CapacityUnit reservedThroughput) + { + TableName = tableName; + ReservedThroughput = reservedThroughput; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/BatchGetRowErrorResponseItem.cs b/netstandard-sdk/Aliyun/OTS/Response/BatchGetRowErrorResponseItem.cs new file mode 100644 index 0000000..32bad84 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/BatchGetRowErrorResponseItem.cs @@ -0,0 +1,21 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +namespace Aliyun.OTS.Response +{ + public class BatchGetRowErrorResponseItem : BatchGetRowResponseItem + { + public BatchGetRowErrorResponseItem(string errorCode, string errorMessage) + : base(errorCode, errorMessage) + { + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/BatchGetRowResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/BatchGetRowResponse.cs new file mode 100644 index 0000000..0ebf438 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/BatchGetRowResponse.cs @@ -0,0 +1,54 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System.Collections.Generic; +using System.Linq; + +namespace Aliyun.OTS.Response +{ + /// + /// 表示BatchGetRow的返回。 + /// + public class BatchGetRowResponse : OTSResponse + { + /// + /// 每个表的返回数据。它是一个字段,Key是表名,Value是BatchGetRowResponseItem的List。 + /// 其中BatchGetRowResponseItem表示单行返回的结果。 + /// + public IDictionary> RowDataGroupByTable { get; private set; } + + public BatchGetRowResponse() + { + RowDataGroupByTable = new Dictionary>(); + } + + public void Add(string tableName, IList rowDataInTable) + { + RowDataGroupByTable.Add(tableName, rowDataInTable); + } + + public bool IsAllSucceed + { + get { return !GetFailedRows().Any(); } + } + + public IEnumerable GetFailedRows() + { + var result = new List(); + foreach (var tableResult in RowDataGroupByTable) + { + result.AddRange(tableResult.Value.Where(_ => !_.IsOK)); + } + + return result; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/BatchGetRowResponseItem.cs b/netstandard-sdk/Aliyun/OTS/Response/BatchGetRowResponseItem.cs new file mode 100644 index 0000000..3162590 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/BatchGetRowResponseItem.cs @@ -0,0 +1,104 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Response +{ + /// + /// 表示BatchGetRow操作中每一行的结果。 + /// + public class BatchGetRowResponseItem + { + /// + /// 该行的读取是否成功。 + /// + public bool IsOK = true; + + /// + /// 错误码 + /// + public string ErrorCode = null; + + /// + /// 错误信息 + /// + public string ErrorMessage = null; + + /// + /// 本次操作消耗的读写能力单元 + /// + public CapacityUnit Consumed { get; set; } + + /// + /// 该行的主键 + /// + public PrimaryKey PrimaryKey { get; set; } + + /// + /// 属性 + /// + public AttributeColumns Attribute { get; set; } + + + public string TableName { get; set; } + + public IRow Row { get; set; } + + public int Index { get; set; } + public byte[] NextToken { get; set; } + + public BatchGetRowResponseItem(string errorCode, string errorMessage) + { + IsOK = false; + ErrorCode = errorCode; + ErrorMessage = errorMessage; + } + + public BatchGetRowResponseItem(CapacityUnit consumed, PrimaryKey primaryKey, AttributeColumns attribute) + { + Consumed = consumed; + PrimaryKey = primaryKey; + Attribute = attribute; + } + + public BatchGetRowResponseItem(string tableName, IRow row, CapacityUnit consumed, int index) + { + TableName = tableName; + Row = row; + Consumed = consumed; + Index = index; + + if (row != null) + { + PrimaryKey = row.GetPrimaryKey(); + Attribute = (row as Row).AttributeColumns; + } + else + { + PrimaryKey = new PrimaryKey(); + Attribute = new AttributeColumns(); + } + } + + public BatchGetRowResponseItem(string tableName, IRow row, CapacityUnit consumed, int index, byte[] nextToken): + this(tableName, row, consumed, index) + { + NextToken = nextToken; + } + + public bool HasNextToken() + { + return (NextToken != null) && (NextToken.Length > 0); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/BatchGetRowSuccessResponseItem.cs b/netstandard-sdk/Aliyun/OTS/Response/BatchGetRowSuccessResponseItem.cs new file mode 100644 index 0000000..3015b03 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/BatchGetRowSuccessResponseItem.cs @@ -0,0 +1,25 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Response +{ + public class BatchGetRowSuccessResponseItem : BatchGetRowResponseItem + { + public BatchGetRowSuccessResponseItem( + CapacityUnit consumedCapacityUnit, + PrimaryKey primaryKey, + AttributeColumns attribute) + : base(consumedCapacityUnit, primaryKey, attribute) { } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/BatchWriteRowErrorResponseItem.cs b/netstandard-sdk/Aliyun/OTS/Response/BatchWriteRowErrorResponseItem.cs new file mode 100644 index 0000000..542bd65 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/BatchWriteRowErrorResponseItem.cs @@ -0,0 +1,22 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +namespace Aliyun.OTS.Response +{ + public class BatchWriteRowErrorResponseItem : BatchWriteRowResponseItem + { + public BatchWriteRowErrorResponseItem(string errorCode, string errorMessage, string tableName, int index) + : base(errorCode, errorMessage, tableName, index) + { + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/BatchWriteRowResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/BatchWriteRowResponse.cs new file mode 100644 index 0000000..cb8d772 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/BatchWriteRowResponse.cs @@ -0,0 +1,62 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Aliyun.OTS.Response +{ + public struct BatchWriteRowResponseForOneTable + { + [Obsolete("Please use Responses")] + public IList PutResponses; + + [Obsolete("Please use Responses")] + public IList UpdateResponses; + + [Obsolete("Please use Responses")] + public IList DeleteResponses; + + public IList Responses; + } + + /// + /// 表示BatchWriteRow的返回。 + /// + public class BatchWriteRowResponse : OTSResponse + { + /// + /// 表示每一个表中的每一行的操作状态。 + /// + public IDictionary TableRespones { get; private set; } + + public bool IsAllSucceed { + get { return !GetFailedRows().Any(); } + } + + public IEnumerable GetFailedRows() + { + var result = new List(); + foreach (var tableResponse in TableRespones) + { + result.AddRange(tableResponse.Value.Responses.Where(_ => !_.IsOK)); + } + + return result; + } + + public BatchWriteRowResponse() + { + TableRespones = new Dictionary(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/BatchWriteRowResponseItem.cs b/netstandard-sdk/Aliyun/OTS/Response/BatchWriteRowResponseItem.cs new file mode 100644 index 0000000..cfd04ce --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/BatchWriteRowResponseItem.cs @@ -0,0 +1,91 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Response +{ + /// + /// 表示 BatchWriteRow 操作中每一行的操作状态。 + /// + public class BatchWriteRowResponseItem + { + + /// + /// 操作是否成功 + /// + public bool IsOK = true; + + /// + /// 错误码 + /// + public string ErrorCode = null; + + /// + /// 错误消息 + /// + public string ErrorMessage = null; + + /// + /// 表名 + /// + public string TableName; + + /// + /// 更新编号 + /// + public int Index = 0; + + /// + /// 本次操作消耗的读写能力单元 + /// + public CapacityUnit Consumed { get; set; } + + public IRow Row{get;set;} + + public BatchWriteRowResponseItem(string errorCode, string errorMessage, string tableName, int index) + { + IsOK = false; + ErrorCode = errorCode; + ErrorMessage = errorMessage; + TableName = tableName; + Index = index; + } + + public BatchWriteRowResponseItem(CapacityUnit consumed, string tableName, int index) + { + IsOK = true; + Consumed = consumed; + TableName = tableName; + Index = index; + } + + public BatchWriteRowResponseItem(CapacityUnit consumed, string tableName, int index, IRow row):this(consumed, tableName, index) + { + this.Row = row; + } + + public BatchWriteRowResponseItem(string errorCode, string errorMessage, string tableName, int index, IRow row) : this(errorCode, errorMessage, tableName, index) + { + this.Row = row; + } + + public override string ToString() + { + if (IsOK) + { + return Index + "write success, table name: " + TableName + "; read:" + Consumed.Read + ", write:" + Consumed.Write; + } + + return Index + " write failed, error code: " + ErrorCode + ", error message: " + ErrorMessage; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/BatchWriteRowSuccessResponseItem.cs b/netstandard-sdk/Aliyun/OTS/Response/BatchWriteRowSuccessResponseItem.cs new file mode 100644 index 0000000..0df389e --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/BatchWriteRowSuccessResponseItem.cs @@ -0,0 +1,24 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Response +{ + public class BatchWriteRowSuccessResponseItem : BatchWriteRowResponseItem + { + public BatchWriteRowSuccessResponseItem(CapacityUnit consumedCapacityUnit, string tableName, int index) + : base(consumedCapacityUnit, tableName, index) + { + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/CreateGlobalIndexResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/CreateGlobalIndexResponse.cs new file mode 100644 index 0000000..6481bf2 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/CreateGlobalIndexResponse.cs @@ -0,0 +1,6 @@ +namespace Aliyun.OTS.Response +{ + public class CreateGlobalIndexResponse : OTSResponse + { + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/CreateSearchIndexResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/CreateSearchIndexResponse.cs new file mode 100644 index 0000000..61a16fa --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/CreateSearchIndexResponse.cs @@ -0,0 +1,7 @@ +namespace Aliyun.OTS.Response +{ + + public class CreateSearchIndexResponse : OTSResponse + { + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/CreateTableResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/CreateTableResponse.cs new file mode 100644 index 0000000..c7f9d1e --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/CreateTableResponse.cs @@ -0,0 +1,21 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +namespace Aliyun.OTS.Response +{ + /// + /// 表示CreateTable的返回。 + /// + public class CreateTableResponse : OTSResponse + { + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/DeleteGlobalIndexResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/DeleteGlobalIndexResponse.cs new file mode 100644 index 0000000..5692365 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/DeleteGlobalIndexResponse.cs @@ -0,0 +1,7 @@ +namespace Aliyun.OTS.Response +{ + public class DeleteGlobalIndexResponse : OTSResponse + { + + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/DeleteRowResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/DeleteRowResponse.cs new file mode 100644 index 0000000..d659988 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/DeleteRowResponse.cs @@ -0,0 +1,46 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Response +{ + /// + /// 表示DeleteRow的返回。 + /// + public class DeleteRowResponse : OTSResponse + { + /// + /// 本次操作消耗的读写能力单元。 + /// + public CapacityUnit ConsumedCapacityUnit; + + /// + /// 返回ReturnType指定的值 + /// + public Row Row { get; set; } + + + public DeleteRowResponse() {} + + public DeleteRowResponse(CapacityUnit consumedCapacityUnit) + { + ConsumedCapacityUnit = consumedCapacityUnit; + } + + public DeleteRowResponse(CapacityUnit consumedCapacityUnit, Row row) + { + ConsumedCapacityUnit = consumedCapacityUnit; + Row = row; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/DeleteSearchIndexResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/DeleteSearchIndexResponse.cs new file mode 100644 index 0000000..458ccf2 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/DeleteSearchIndexResponse.cs @@ -0,0 +1,6 @@ +namespace Aliyun.OTS.Response +{ + public class DeleteSearchIndexResponse : OTSResponse + { + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/DeleteTableResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/DeleteTableResponse.cs new file mode 100644 index 0000000..2a467b4 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/DeleteTableResponse.cs @@ -0,0 +1,21 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +namespace Aliyun.OTS.Response +{ + /// + /// 表示DeleteTable的返回。 + /// + public class DeleteTableResponse : OTSResponse + { + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/DescribeSearchIndexResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/DescribeSearchIndexResponse.cs new file mode 100644 index 0000000..6217b11 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/DescribeSearchIndexResponse.cs @@ -0,0 +1,11 @@ +using Aliyun.OTS.DataModel.Search; + +namespace Aliyun.OTS.Response +{ + public class DescribeSearchIndexResponse : OTSResponse + { + public IndexSchema Schema { get; set; } + public SyncStat SyncStat { get; set; } + + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/DescribeTableResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/DescribeTableResponse.cs new file mode 100644 index 0000000..d6b783c --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/DescribeTableResponse.cs @@ -0,0 +1,48 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Response +{ + /// + /// 表示DescribeTable的返回。 + /// + public class DescribeTableResponse : OTSResponse + { + /// + /// 表的元数据 + /// + public TableMeta TableMeta { get; set; } + + /// + /// 预留读写吞吐量的详细信息 + /// + public ReservedThroughputDetails ReservedThroughputDetails { get; set; } + + public TableOptions TableOptions { get; set; } + + + public StreamDetails StreamDetails { get; set; } + + public System.Collections.Generic.List ShardSplits { get; set; } + + public DescribeTableResponse() {} + + public DescribeTableResponse(TableMeta tableMeta, ReservedThroughputDetails reservedThroughputDetails, TableOptions tableOptions) + { + TableMeta = tableMeta; + ReservedThroughputDetails = reservedThroughputDetails; + TableOptions = tableOptions; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/GetRangeResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/GetRangeResponse.cs new file mode 100644 index 0000000..2e3aa5b --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/GetRangeResponse.cs @@ -0,0 +1,45 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System.Collections.Generic; + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Response +{ + /// + /// 表示GetRange的返回 + /// + public class GetRangeResponse : OTSResponse + { + /// + /// 本次操作消耗的读写能力单元。 + /// + public CapacityUnit ConsumedCapacityUnit { get; set; } + + /// + /// 下一个主键,用于继续读取。 + /// + public PrimaryKey NextPrimaryKey { get; set; } + + /// + /// 返回的每一行数据 + /// + public IList RowDataList { get; set; } + + public byte[] NextToken { get; set; } + + public GetRangeResponse() + { + RowDataList = new List(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/GetRowResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/GetRowResponse.cs new file mode 100644 index 0000000..5cb229b --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/GetRowResponse.cs @@ -0,0 +1,85 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Response +{ + /// + /// 表示GetRow的返回 + /// + public class GetRowResponse : OTSResponse + { + private AttributeColumns attributes = null; + + /// + /// 本次操作消耗的读写能力单元。 + /// + public CapacityUnit ConsumedCapacityUnit { get; private set; } + + /// + /// 主键 + /// + public PrimaryKey PrimaryKey { get; private set; } + + /// + /// 属性 + /// + public AttributeColumns Attribute + { + get + { + + if (this.attributes != null || Columns == null) + { + return this.attributes; + } + + this.attributes = new AttributeColumns(); + + foreach (var column in Columns) + { + this.attributes.Add(column); + } + + return this.attributes; + } + } + + public Column[] Columns { get; set;} + + public Row Row { get; set; } + + public GetRowResponse() {} + + public GetRowResponse(CapacityUnit consumedCapacityUnit, PrimaryKey primaryKey, AttributeColumns attribute) + { + ConsumedCapacityUnit = consumedCapacityUnit; + PrimaryKey = primaryKey; + this.attributes = attribute; + } + + public GetRowResponse(CapacityUnit consumedCapacityUnit, PrimaryKey primaryKey, Column[] columns) + { + ConsumedCapacityUnit = consumedCapacityUnit; + PrimaryKey = primaryKey; + Columns = columns; + } + + public GetRowResponse(CapacityUnit consumedCapacityUnit, IRow row) + { + ConsumedCapacityUnit = consumedCapacityUnit; + Row = row as Row; + PrimaryKey = Row.GetPrimaryKey(); + Columns = Row.GetColumns(); + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/ListSearchIndexResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/ListSearchIndexResponse.cs new file mode 100644 index 0000000..b34c46d --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/ListSearchIndexResponse.cs @@ -0,0 +1,15 @@ +using System.Collections.Generic; +using Aliyun.OTS.DataModel.Search; + +namespace Aliyun.OTS.Response +{ + /// + /// 表示ListSearchIndex的返回 + /// + public class ListSearchIndexResponse: OTSResponse + { + public ListSearchIndexResponse() { } + + public List IndexInfos { get; set; } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/ListTableResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/ListTableResponse.cs new file mode 100644 index 0000000..fdcf326 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/ListTableResponse.cs @@ -0,0 +1,27 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System.Collections.Generic; + +namespace Aliyun.OTS.Response +{ + /// + /// 表示ListTable的返回。 + /// + public class ListTableResponse : OTSResponse + { + /// + /// ListTable返回的表名 + /// + public IList TableNames {get; set;} + public ListTableResponse() {} + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/OTSResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/OTSResponse.cs new file mode 100644 index 0000000..51a515a --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/OTSResponse.cs @@ -0,0 +1,18 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +namespace Aliyun.OTS.Response +{ + public interface OTSResponse + { + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/PutRowResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/PutRowResponse.cs new file mode 100644 index 0000000..0b068c2 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/PutRowResponse.cs @@ -0,0 +1,44 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Response +{ + /// + /// 表示PutRow的返回 + /// + public class PutRowResponse : OTSResponse + { + /// + /// 本次操作消耗的读写能力单元。 + /// + public CapacityUnit ConsumedCapacityUnit { get; private set; } + + /// + /// 返回ReturnType指定的值 + /// + public Row Row { get; set; } + + public PutRowResponse() { } + + public PutRowResponse(CapacityUnit consumedCapacityUnit) + { + ConsumedCapacityUnit = consumedCapacityUnit; + } + + public PutRowResponse(CapacityUnit consumedCapacityUnit, Row row) + { + ConsumedCapacityUnit = consumedCapacityUnit; + Row = row; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/SearchResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/SearchResponse.cs new file mode 100644 index 0000000..e284a0f --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/SearchResponse.cs @@ -0,0 +1,27 @@ +using System.Collections.Generic; +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Response +{ + /// + /// SearchIndex的返回结果 + /// + public class SearchResponse : OTSResponse + { + /// + /// 根据输入的Query语句进行查询,SearchIndex引擎返回的总命中数 + ///注:是查询到的实际数量,不是该Response中返回的具体的行数。行数可以由其他参数来控制,进行类似分页的操作 + /// + public long TotalCount { get; set; } + /// + /// Query查询的具体返回结果列表 + /// + public List Rows { get; set; } + /// + /// 是否查询成功 + /// + public bool IsAllSuccess { get; set; } + + public byte[] NextToken { get; set; } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/UpdateRowResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/UpdateRowResponse.cs new file mode 100644 index 0000000..49c1e93 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/UpdateRowResponse.cs @@ -0,0 +1,40 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Response +{ + /// + /// 表示UpdateRow的返回 + /// + public class UpdateRowResponse : OTSResponse + { + /// + /// ReturnType指定返回的值 + /// + public Row Row { get; set; } + + /// + /// 本次操作消耗的读写能力单元。 + /// + public CapacityUnit ConsumedCapacityUnit { get; private set; } + + public UpdateRowResponse() {} + + public UpdateRowResponse(CapacityUnit consumedCapacityUnit, IRow row) + { + ConsumedCapacityUnit = consumedCapacityUnit; + Row = row as Row; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Response/UpdateTableResponse.cs b/netstandard-sdk/Aliyun/OTS/Response/UpdateTableResponse.cs new file mode 100644 index 0000000..0984838 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Response/UpdateTableResponse.cs @@ -0,0 +1,34 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + + +using Aliyun.OTS.DataModel; + +namespace Aliyun.OTS.Response +{ + /// + /// 表示UpdateTable的返回。 + /// + public class UpdateTableResponse : OTSResponse + { + /// + /// UpdateTable接口返回的预留读写吞吐量的详情。 + /// + public ReservedThroughputDetails ReservedThroughputDetails { get; private set; } + + public UpdateTableResponse() {} + + public UpdateTableResponse(ReservedThroughputDetails reservedThroughputDetails) + { + ReservedThroughputDetails = reservedThroughputDetails; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Retry/PredefinedRetryPolicies.cs b/netstandard-sdk/Aliyun/OTS/Retry/PredefinedRetryPolicies.cs new file mode 100644 index 0000000..11aed00 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Retry/PredefinedRetryPolicies.cs @@ -0,0 +1,116 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using System; + +using Aliyun.OTS.Handler; + +namespace Aliyun.OTS.Retry +{ + public class DefaultRetryPolicy : RetryPolicy + { + public static int MaxRetryTimes = 3; + + private int MaxDelay = 2000; + + private int ScaleFactor = 2; + + private int ServerThrottlingExceptionDelayFactor = 500; + + private int StabilityExceptionDelayFactor = 200; + + private readonly Random RandomGenerator; + + public DefaultRetryPolicy() + { + RandomGenerator = new Random(); + } + + public DefaultRetryPolicy(int maxRetryTimes, int maxRetryDelay) + { + MaxRetryTimes = maxRetryTimes; + if (maxRetryTimes < 0) { + throw new OTSClientException("maxRetryTimes must be >= 0."); + } + + MaxDelay = maxRetryDelay; + if (maxRetryDelay < 0) { + throw new OTSClientException("maxRetryDelay must be >= 0."); + } + + RandomGenerator = new Random(); + } + + public override bool MaxRetryTimeReached(Context context, OTSException exception) + { + return context.RetryTimes >= MaxRetryTimes; + } + + public override bool CanRetry(Context context, OTSException exception) + { + if (exception == null) + { + // No exception ocurred + return false; + } + + if (RetryUtil.ShouldRetryNoMatterWhichAPI(exception)) + { + return true; + } + + if (RetryUtil.IsRepeatableAPI(context.APIName) && + RetryUtil.ShouldRetryWhenAPIRepeatable(exception)) + { + return true; + } + + return false; + } + + public override int DelayBeforeNextRetry(Context context, OTSException exception) + { + int delayFactor; + + if (RetryUtil.IsServerThrottlingException(exception)) { + delayFactor = ServerThrottlingExceptionDelayFactor; + } else { + delayFactor = StabilityExceptionDelayFactor; + } + + int delayLimit = delayFactor * (int)Math.Pow(ScaleFactor, context.RetryTimes); + + if (delayLimit >= MaxDelay) { + delayLimit = MaxDelay; + } + + int realDelay = RandomGenerator.Next(delayLimit / 2, delayLimit); + + return realDelay; + } + } + + public class RetryPolicyNoDelay : DefaultRetryPolicy + { + public override int DelayBeforeNextRetry(Context context, OTSException exception) + { + return 0; + } + } + + public class NoRetryPolicy : DefaultRetryPolicy + { + public override bool CanRetry(Context context, OTSException exception) + { + return false; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Retry/RetryPolicy.cs b/netstandard-sdk/Aliyun/OTS/Retry/RetryPolicy.cs new file mode 100644 index 0000000..3bd43d1 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Retry/RetryPolicy.cs @@ -0,0 +1,26 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +using Aliyun.OTS.Handler; + +namespace Aliyun.OTS.Retry +{ + public abstract class RetryPolicy + { + public static RetryPolicy DefaultRetryPolicy = new DefaultRetryPolicy(); + public static RetryPolicy RetryPolicyNoDelay = new RetryPolicyNoDelay(); + public static RetryPolicy NoRetryPolicy = new NoRetryPolicy(); + + public abstract bool MaxRetryTimeReached(Context context, OTSException exception); + public abstract bool CanRetry(Context context, OTSException exception); + public abstract int DelayBeforeNextRetry(Context context, OTSException exception); + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Retry/RetryUtil.cs b/netstandard-sdk/Aliyun/OTS/Retry/RetryUtil.cs new file mode 100644 index 0000000..a004f28 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Retry/RetryUtil.cs @@ -0,0 +1,97 @@ +/* + * Trade secret of Alibaba Group R&D. + * Copyright (c) 2015 Alibaba Group R&D. + * + * All rights reserved. This notice is intended as a precaution against + * inadvertent publication and does not imply publication or any waiver + * of confidentiality. The year included in the foregoing notice is the + * year of creation of the work. + * + */ + +namespace Aliyun.OTS.Retry +{ + public static class RetryUtil + { + public static bool ShouldRetryNoMatterWhichAPI(OTSException exception) + { + var e = exception as OTSServerException; + + if (e != null) + { + if (e.ErrorCode == "OTSRowOperationConflict" || + e.ErrorCode == "OTSNotEnoughCapacityUnit" || + e.ErrorCode == "OTSTableNotReady" || + e.ErrorCode == "OTSPartitionUnavailable" || + e.ErrorCode == "OTSServerBusy") + { + return true; + } + + if (e.ErrorCode == "OTSQuotaExhausted" && + e.ErrorMessage == "Too frequent table operations.") + { + return true; + } + } + + return false; + } + + public static bool IsRepeatableAPI(string apiName) + { + if (apiName == "/ListTable" || + apiName == "/DescribeTable" || + apiName == "/GetRow" || + apiName == "/BatchGetRow" || + apiName == "/GetRange") + { + return true; + } + + return false; + } + + public static bool ShouldRetryWhenAPIRepeatable(OTSException exception) + { + var e = exception as OTSServerException; + + if (e != null) + { + if (e.ErrorCode == "OTSTimeout" || + e.ErrorCode == "OTSInternalServerError" || + e.ErrorCode == "OTSServerUnavailable") + { + return true; + } + + int code = (int)e.HttpStatusCode; + if (code == 500 || code == 502 || code == 503) + { + return true; + } + + // TODO handle network error & timeout + } + + return false; + } + + public static bool IsServerThrottlingException(OTSException exception) + { + var e = exception as OTSServerException; + + if (e != null) + { + if (e.ErrorCode == "OTSServerBusy" || + e.ErrorCode == "OTSNotEnoughCapacityUnit" || + (e.ErrorCode == "OTSQuotaExhausted" && e.ErrorMessage == "Too frequent table operations.")) + { + return true; + } + } + + return false; + } + } +} diff --git a/netstandard-sdk/Aliyun/OTS/Util/OtsUtils.cs b/netstandard-sdk/Aliyun/OTS/Util/OtsUtils.cs new file mode 100644 index 0000000..2e396a9 --- /dev/null +++ b/netstandard-sdk/Aliyun/OTS/Util/OtsUtils.cs @@ -0,0 +1,76 @@ +using System; +using System.Text; + +namespace Aliyun.OTS.Util +{ + public static class OtsUtils + { + public static string DetermineSystemArchitecture() + { + return (IntPtr.Size == 8) ? "x86_64" : "x86"; + } + + public static string DetermineOsVersion() + { + try + { + var os = Environment.OSVersion; + return "windows " + os.Version.Major + "." + os.Version.Minor; + } + catch (InvalidOperationException) + { + return "Unknown OSVersion"; + } + } + + public static string FormatDateTimeStr(DateTime dt) + { + return dt.ToString("yyyy-MM-ddTHH:mm:ss.000Z"); + } + + /// + /// 计算字符串的大小(按照UTF-8编码) + /// + /// 返回字符串的字节数 + /// String. + public static int CalcStringSizeInBytes(string str) + { + return String2Bytes(str).Length; + } + + public static byte[] String2Bytes(string str) + { + return Encoding.UTF8.GetBytes(str); + } + + public static int CompareByteArrayInLexOrder(byte[] buffer1, int offset1, int length1, + byte[] buffer2, int offset2, int length2) + { + // Short circuit equal case + if (buffer1 == buffer2 && + offset1 == offset2 && + length1 == length2) + { + return 0; + } + // Bring WritableComparator code local + int end1 = offset1 + length1; + int end2 = offset2 + length2; + for (int i = offset1, j = offset2; i < end1 && j < end2; i++, j++) + { + int a = (buffer1[i] & 0xff); + int b = (buffer2[j] & 0xff); + if (a != b) + { + return a - b; + } + } + return length1 - length2; + } + + public static string Bytes2UTF8String(byte[] buffer) + { + return Encoding.UTF8.GetString(buffer); + } + } +} diff --git a/netstandard-sdk/aliyun-tablestore-netstandard-sdk.csproj b/netstandard-sdk/aliyun-tablestore-netstandard-sdk.csproj new file mode 100644 index 0000000..27bf7c3 --- /dev/null +++ b/netstandard-sdk/aliyun-tablestore-netstandard-sdk.csproj @@ -0,0 +1,18 @@ + + + + netstandard2.0 + aliyun_tablestore_netcore_sdk + OSS.Clients.Ali.TableStore + 迁移至 Aliyun.TableStore.SDK 的标准库实现,同时支持.Net Core 和 .Net Framework + + + + \aliyun-tablestore-netstandard-sdk.xml + + + + + + + diff --git a/sample/App.config b/sample/App.config index 74ade9d..8d23437 100644 --- a/sample/App.config +++ b/sample/App.config @@ -1,6 +1,6 @@ - + diff --git a/sample/aliyun-tablestore-sdk-sample.csproj b/sample/aliyun-tablestore-sdk-sample.csproj index 34bfe00..a79007b 100644 --- a/sample/aliyun-tablestore-sdk-sample.csproj +++ b/sample/aliyun-tablestore-sdk-sample.csproj @@ -1,5 +1,5 @@  - + Debug @@ -14,6 +14,7 @@ 8.0.30703 2.0 + v4.6.2 true @@ -23,6 +24,7 @@ DEBUG;TRACE prompt 4 + false AnyCPU @@ -32,6 +34,7 @@ TRACE prompt 4 + false Aliyun.OTS.Samples.Samples.SearchIndexSample diff --git a/sdk/aliyun-tablestore-sdk.csproj b/sdk/aliyun-tablestore-sdk.csproj index b746a90..9bafa7d 100644 --- a/sdk/aliyun-tablestore-sdk.csproj +++ b/sdk/aliyun-tablestore-sdk.csproj @@ -1,5 +1,5 @@  - + Debug @@ -11,6 +11,8 @@ 512 8.0.30703 2.0 + v4.6.2 + true @@ -22,6 +24,7 @@ 4 AnyCPU 4 + false pdbonly @@ -31,6 +34,7 @@ prompt 4 4 + false diff --git a/sdk/packages.config b/sdk/packages.config index 79f7852..53f52f2 100644 --- a/sdk/packages.config +++ b/sdk/packages.config @@ -2,6 +2,6 @@ - + \ No newline at end of file diff --git a/test/aliyun-tablestore-sdk-test.csproj b/test/aliyun-tablestore-sdk-test.csproj index a0bb3bb..ead6847 100644 --- a/test/aliyun-tablestore-sdk-test.csproj +++ b/test/aliyun-tablestore-sdk-test.csproj @@ -1,5 +1,5 @@  - + @@ -14,6 +14,7 @@ 8.0.30703 2.0 + v4.6.2 true @@ -25,6 +26,7 @@ 4 MixedMinimumRules.ruleset true + false pdbonly @@ -35,6 +37,7 @@ 4 x86 true + false