Exemplo n.º 1
0
        /// <summary>
        /// 单独在表上再创建一个索引表2
        /// </summary>
        public static void CreateGlobalIndex()
        {
            OTSClient otsClient = Config.GetClient();

            Console.WriteLine("Start create globalIndex...");

            IndexMeta indexMeta = new IndexMeta(IndexName2);

            indexMeta.PrimaryKey = new List <string>()
            {
                Col2
            };
            indexMeta.DefinedColumns = new List <string>()
            {
                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);
        }
Exemplo n.º 2
0
 /// <summary>
 /// CreateGlobalIndex的异步形式。
 /// </summary>
 /// <param name="request"></param>
 /// <returns></returns>
 public Task <CreateGlobalIndexResponse> CreateGlobalIndexAsync(CreateGlobalIndexRequest request)
 {
     return(CallAsync <CreateGlobalIndexRequest, CreateGlobalIndexResponse>("/CreateIndex", request));
 }
Exemplo n.º 3
0
 public CreateGlobalIndexResponse CreateGlobalIndex(CreateGlobalIndexRequest request)
 {
     return(GetResponseFromAsyncTask(CreateGlobalIndexAsync(request)));
 }