在Apache Drill中通过C#代码创建存储插件 [英] Creating Storage Plugin throught through C# code in Apache Drill

查看:447
本文介绍了在Apache Drill中通过C#代码创建存储插件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过C#(。NET)代码创建存储插件,当Drill在某些其他系统(不是本地)安装时。
是可能吗?

I want to create Storage Plugin through C#(.NET) code, when Drill is install in some other system(not in local).? Is it Possible?? If yes then how.?

推荐答案

我发现了一些解决方案:

I found out some solution for that:

           var request = (HttpWebRequest)WebRequest.Create(url);
           var postData = "name=" + name + "&config=" + config;
           var data = Encoding.ASCII.GetBytes(postData);
           request.Method = "POST";
           request.ContentType = "application/x-www-form-urlencoded";
           request.ContentLength = data.Length;
           using (var stream = request.GetRequestStream())
           {
               stream.Write(data, 0, data.Length);
           }
           var response = (HttpWebResponse)request.GetResponse();
           var responseString = new StreamReader(response.GetResponseStream()).ReadToEnd();
           if (responseString != null)
           {
               var jsonObject = Newtonsoft.Json.JsonConvert.DeserializeObject<dynamic>(responseString);
               return jsonObject.result == "success";
           }

这篇关于在Apache Drill中通过C#代码创建存储插件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆