当前位置: 首页>>代码示例>>C#>>正文


C# HBaseClient.DeleteTable方法代码示例

本文整理汇总了C#中HBaseClient.DeleteTable方法的典型用法代码示例。如果您正苦于以下问题:C# HBaseClient.DeleteTable方法的具体用法?C# HBaseClient.DeleteTable怎么用?C# HBaseClient.DeleteTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在HBaseClient的用法示例。


在下文中一共展示了HBaseClient.DeleteTable方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Context

        protected override void Context()
        {
            if (!_arrangementCompleted)
            {
                // at present, no tables are modified so only arrange the tables once per test pass
                // and putting the arrangement into a static context.
                // (this knocked test runs down to ~30 seconds from ~5 minutes).

                _credentials = ClusterCredentialsFactory.CreateFromFile(@".\credentials.txt");
                var client = new HBaseClient(_credentials);

                // ensure tables from previous tests are cleaned up
                TableList tables = client.ListTables();
                foreach (string name in tables.name)
                {
                    string pinnedName = name;
                    if (name.StartsWith(TableNamePrefix, StringComparison.Ordinal))
                    {
                        client.DeleteTable(pinnedName);
                    }
                }

                AddTable();
                PopulateTable();

                _arrangementCompleted = true;
            }
        }
开发者ID:gitter-badger,项目名称:hbase-sdk-for-net,代码行数:28,代码来源:FilterTests.cs

示例2: Context

        protected override void Context()
        {
            _credentials = ClusterCredentialsFactory.CreateFromFile(@".\credentials.txt");
            var client = new HBaseClient(_credentials);

            // ensure tables from previous tests are cleaned up
            
            TableList tables = client.ListTables();
            foreach (string name in tables.name)
            {
                if (name.StartsWith(TestTablePrefix, StringComparison.Ordinal))
                {
                    client.DeleteTable(name);
                }
            }

            // add a table specific to this test
            _testTableName = TestTablePrefix + _random.Next(10000);
            _testTableSchema = new TableSchema();
            _testTableSchema.name = _testTableName;
            _testTableSchema.columns.Add(new ColumnSchema { name = "d" });
           
            client.CreateTable(_testTableSchema);
        }
开发者ID:gitter-badger,项目名称:hbase-sdk-for-net,代码行数:24,代码来源:HBaseClientTests.cs

示例3: Main

            private static void Main(string[] args)
            {
                const string clusterURL = "http://localhost:5555";
                const string hadoopUsername = "root";
                const string hadoopUserPassword = "hadoop";
                var serializer = new JsonDotNetSerializer();
                // Create a new instance of an HBase client.
                var hbaseClient = new HBaseClient(new ClusterCredentials(new Uri(clusterURL), hadoopUsername, hadoopUserPassword));
                var itemMapper = new ItemMapper(serializer);
                hbaseClient.DeleteTable("Items");
                var tableSchema = itemMapper.CreateTableSchema("Items");
                hbaseClient.CreateTable(tableSchema);

                //var perfCheck = new PerformanceChecksManager(hbaseClient, "Items", itemMapper, new ItemsGenerator(),50,100);
                //perfCheck.RunPerformanceLoad();
                
                //Generating item.
                var itemsGenerator = new ItemsGenerator();
                var item = itemsGenerator.CreateItem("mycode");

                //Generating cells relevant to the generate item and saving the entity to Hbae.
                var itemCellSet = itemMapper.GetCells(item, "en-US");
                var stausCell = itemCellSet.rows.Single().values.Single(cell => Encoding.UTF8.GetString(cell.column).Equals("CF1:Status"));
                stausCell.data = new byte[0];
                hbaseClient.StoreCells("Items", itemCellSet);

                //making sure item stored well.
                var originalItemCells = hbaseClient.GetCells("Items", item.Code);
                var originalItemFetchedFromDb = itemMapper.GetDto(originalItemCells, "en-US");

                if (!string.IsNullOrEmpty(originalItemFetchedFromDb.Status))
                    throw new Exception();

                //Describing the conditional update expression.
                var cellToCheck = new Cell { column = Encoding.UTF8.GetBytes("CF1:Status"), data = new byte[0] };

                //manipulating original item.
                stausCell = itemCellSet.rows.Single().values.Single(cell => Encoding.UTF8.GetString(cell.column).Equals("CF1:Status"));
                var newStatusValue = Encoding.UTF8.GetBytes("new");
                stausCell.data = newStatusValue;
                
                //Testing new functionality...

                hbaseClient.CheckAndPutCells("Items", itemCellSet, cellToCheck);
                //Thread.Sleep(1);
                itemCellSet = hbaseClient.GetCells("Items", item.Code);
                var itemFromDb = itemMapper.GetDto(itemCellSet, "en-US");

                if (!itemFromDb.Status.Equals(Encoding.UTF8.GetString(newStatusValue)))
                    throw new Exception();


                #region Old-Helper
                //string clusterURL = "http://localhost:5555";
                //string hadoopUsername = "root";
                //string hadoopUserPassword = "hadoop";
                //string hbaseTableName = "MyCoolTable";

                //// Create a new instance of an HBase client.
                //ClusterCredentials creds = new ClusterCredentials(new Uri(clusterURL), hadoopUsername, hadoopUserPassword);
                //HBaseClient hbaseClient = new HBaseClient(creds);

                //var hbaseHelper = new Helper(hbaseClient, "ThisIsJustATableForShirly1", "DummyKey1ForShirly1");
                //hbaseHelper.CreateTable();
                //var myClass = new Dto()
                //{
                //    Field1 = "1",
                //    Field2 = "2",
                //    Field3 = "3",
                //    Field4 = "4",
                //    Field5 = "5",
                //    NestedData = new NestedDto() { Field1 = "n1", Field2 = "n2" }
                //};

                //hbaseHelper.SaveMyDto(myClass);

                //var dto = hbaseHelper.GetMyDto();
#endregion
            }
开发者ID:gitter-badger,项目名称:hbase-sdk-for-net,代码行数:79,代码来源:Program.cs

示例4: DeleteHBaseTable

 /// <summary>
 /// Delete the HBase table
 /// </summary>
 /// <param name="hbaseClient"></param>
 public static void DeleteHBaseTable(HBaseClient hbaseClient)
 {
     hbaseClient.DeleteTable(Properties.Settings.Default.HBaseTableName);
     Console.WriteLine("Table deleted.");
 }
开发者ID:Blackmist,项目名称:hdinsight-storm-dotnet-event-correlation,代码行数:9,代码来源:Program.cs


注:本文中的HBaseClient.DeleteTable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。