/// <summary> /// Create a new HBase table /// </summary> /// <param name="hbaseClient">client used to connect to HBase</param> public static void CreateHBaseTable(HBaseClient hbaseClient) { //Define the 'cf family //Set versions to retain to 5 ColumnSchema cf = new ColumnSchema() { name = Properties.Settings.Default.HBaseTableColumnFamily, maxVersions = 5 }; //Define the table TableSchema tableSchema = new TableSchema(); tableSchema.name = Properties.Settings.Default.HBaseTableName; tableSchema.columns.Add(cf); //Create the table hbaseClient.CreateTable(tableSchema); Console.WriteLine("Table created."); }
public async Task TestCreateTable() { try { var tableSchema = new TableSchema {name = "users", readOnly = false, inMemory = false}; var columnSchema = new ColumnSchema {name = "profile"}; tableSchema.columns.Add(columnSchema); var succeed = await _hbaseClient.CreateTableAsync(tableSchema); Assert.IsTrue(succeed); } catch (Exception e) { Assert.Fail(e.Message); } }