Creating Storage Plugin throught through C# code in Apache Drill [duplicate]

坚强是说给别人听的谎言 提交于 2019-12-25 18:21:01

问题


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.?


回答1:


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";
           }


来源:https://stackoverflow.com/questions/35942826/creating-storage-plugin-throught-through-c-sharp-code-in-apache-drill

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!