public Lua Init(string name, LuaMonoBehaviour target, ref int tid) { tid = id++; var env = new Lua(); dicLuaMonoBehaviour = new Dictionary <string, LuaMonoBehaviour>(); env.LoadCLRPackage(); var path = Application.streamingAssetsPath + "/lua/?.lua"; env["package.path"] = env["package.path"] + ";" + path; var csHelper = new CsHelper(); env.RegisterFunction("newList", csHelper, typeof(CsHelper).GetMethod("newDFList")); Register(name + tid, target); return(env); }
public async Task <IHttpActionResult> Insts() { CsHelper cs = new CsHelper(); List <InsertRowData> lstr = new List <InsertRowData>(); for (int i = 0; i < 10; i++) { InsertRowData ir = new InsertRowData(); ir.RowKey = await cs.CreateRowkey(2337); ir.Columns = new List <InsertCellData> { new InsertCellData { Family = "m", Column = "u", Value = DateTime.Now }, new InsertCellData { Family = "m", Column = "s", Value = DateTime.Now }, new InsertCellData { Family = "m", Column = "t", Value = DateTime.Now }, new InsertCellData { Family = "m", Column = "r", Value = DateTime.Now }, new InsertCellData { Family = "m", Column = "c", Value = DateTime.Now } }; lstr.Add(ir); if (i > 0 && i / 2 == 0) { HBaseHelper hbs = new HBaseHelper(); hbs.Insert("t", lstr); lstr.Clear(); } } return(Ok(true)); }
public async Task <IHttpActionResult> Inst() { CsHelper cs = new CsHelper(); var rowkey = await cs.CreateRowkey(2337); var hbasemsg = new List <InsertCellData> { new InsertCellData { Family = "m", Column = "u", Value = "你" }, new InsertCellData { Family = "m", Column = "s", Value = "是" }, new InsertCellData { Family = "m", Column = "t", Value = "她他它" }, new InsertCellData { Family = "m", Column = "r", Value = "日" }, new InsertCellData { Family = "m", Column = "c", Value = "哈哈哈!" } }; HBaseHelper hbs = new HBaseHelper(); hbs.Insert("t", rowkey, hbasemsg); return(Ok(true)); }