private static void updateMeta(KylinConfig config) { String[] nodes = config.getRestServers(); for (String node : nodes) { RestClient restClient = new RestClient(node); try { logger.info("update meta cache for " + node); restClient.wipeCache(Broadcaster.SYNC_ALL, Broadcaster.Event.UPDATE.getType(), Broadcaster.SYNC_ALL); } catch (IOException e) { logger.error(e.getMessage()); } } }
@SuppressWarnings("unused") @Test public void basicTests() throws IOException { RestClient a = new RestClient("prod01:80"); //a.wipeCache("metadata", "a", "a"); //String aa = a.getKylinProperties(); //System.out.println(aa); RestClient b = new RestClient("sandbox.hortonworks.com:7070"); //b.wipeCache("metadata", "a", "a"); //String bb = b.getKylinProperties(); //System.out.println(bb); } }
for (final String node : restServers) { if (restClientMap.containsKey(node) == false) { restClientMap.put(node, new RestClient(node));
private void updateMeta(KylinConfig config, String projectName, String cubeName, DataModelDesc model) { String[] nodes = config.getRestServers(); Map<String, String> tableToProjects = new HashMap<>(); for (TableRef tableRef : model.getAllTables()) { tableToProjects.put(tableRef.getTableIdentity(), tableRef.getTableDesc().getProject()); } for (String node : nodes) { RestClient restClient = new RestClient(node); try { logger.info("update meta cache for " + node); restClient.clearCacheForCubeMigration(cubeName, projectName, model.getName(), tableToProjects); } catch (IOException e) { logger.error(e.getMessage()); } } }
logger.info("send build lookup table cache request to server: " + restServer); try { RestClient restClient = new RestClient(restServer); restClient.buildLookupSnapshotCache(projectName, tableName, snapshotID); serversNeedCheck.add(restServer); logger.info("check lookup table cache build status for server: " + restServer); try { RestClient restClient = new RestClient(restServer); String stateName = restClient.getLookupSnapshotCacheState(tableName, snapshotID); if (!stateName.equals(CacheState.IN_BUILDING.name())) {
try { KylinConfig config = new KylinConfig(); RestClient client = new RestClient(uri); String propertyText = client.getKylinProperties(); InputStream is = IOUtils.toInputStream(propertyText, Charset.defaultCharset());
RestClient restClient = new RestClient("username", "password"); String result = restClient.postForObject(...
@SuppressWarnings("unused") @Test public void basicTests() throws IOException { RestClient a = new RestClient("prod01:80"); //a.wipeCache("metadata", "a", "a"); //String aa = a.getKylinProperties(); //System.out.println(aa); RestClient b = new RestClient("sandbox.hortonworks.com:7070"); //b.wipeCache("metadata", "a", "a"); //String bb = b.getKylinProperties(); //System.out.println(bb); }
restClients.add(new RestClient(node));
RestClient client = new RestClient(); client.setApplicationPath("someApp"); String url = client.login("theuser", "123456"); UserPortfolio portfolio = client.template().getForObject(client.apiUrl("portfolio"), UserPortfolio.class);
try { KylinConfig config = new KylinConfig(); RestClient client = new RestClient(uri); String propertyText = client.getKylinProperties(); InputStream is = IOUtils.toInputStream(propertyText);
var client = new RestClient("http://localhost:8066"); var request = new RestRequest("/Student", Method.GET); request.AddParameter("id", "193"); IRestResponse response = client.Execute(request); var content = response.Content; Console.WriteLine("Response: " + content);
var rc = new RestClient("https://api-ssl.bitly.com"); var rr = new RestRequest("/v3/link/clicks?access_token={access_token}&link={bitlyUrl}", Method.GET); rr.AddUrlSegment("bitlyUrl", bitlyUrl); rr.AddUrlSegment("access_token", BityAccessToken); var response = rc.Execute(rr); dynamic json = Newtonsoft.Json.Linq.JObject.Parse(response.Content); var clicks = Convert.ToInt32(json.data.link_clicks.Value);
var client = new RestClient ("http://hellodadfadf"); client.Timeout = 1000; var request = new RestRequest (String.Format ("{0}/allinfo", "198440")); client.ExecuteAsync (request, response => { Console.WriteLine (response.Content); });
RestClient c = new RestClient("http://www.myserver.com/json.php"); c.AddParam("my_field_value", 1); try { c.Execute(RequestMethod.POST); // Here you can parse the JSON with an instance of Gson class. Gson jsonObject = new Gson(); String jsonOutput = jsonObject.toJson(c.getResponse()); // Do whatever you need with the data. } catch (Exception e) { e.printStackTrace(); }
private static void updateMeta(KylinConfig config) { String[] nodes = config.getRestServers(); for (String node : nodes) { RestClient restClient = new RestClient(node); try { logger.info("update meta cache for " + node); restClient.wipeCache(Broadcaster.SYNC_ALL, Broadcaster.Event.UPDATE.getType(), Broadcaster.SYNC_ALL); } catch (IOException e) { logger.error(e.getMessage()); } } }
protected String doInBackground(String... params) { RestClient client = new RestClient(params[0]); client.AddParam("username", params[1]); client.AddParam("password", params[2]); ... }
RestClient client = new RestClient("http://www.example.com/demo.php"); //Write your url here client.addParam("Name", "Bhavit"); //Here I am adding key-value parameters client.addParam("Age", "23"); client.addHeader("content-type", "application/json"); // Here I am specifying that the key-value pairs are sent in the JSON format try { String response = client.executePost(); // In case your server sends any response back, it will be saved in this response string. } catch (Exception e) { e.printStackTrace(); }
RestClient client = new RestClient("http://www.example.com/demo.php"); //Write your url here client.addParam("Name", "Bhavit"); //Here I am adding key-value parameters client.addParam("Age", "23"); client.addHeader("content-type", "application/json"); // Here I am specifying that the key-value pairs are sent in the JSON format try { String response = client.executePost(); // In case your server sends any response back, it will be saved in this response string. } catch (Exception e) { e.printStackTrace(); }
public void ShowAlert(String Message, String ConnectionId) { RestClient Client = new RestClient("http://localhost:8888"); RestRequest Request = new RestRequest("/Listener/SignalR", Method.POST); Request.Parameters.Add(new Parameter() { Name = "Message", Type = ParameterType.QueryString, Value = Message }); Request.Parameters.Add(new Parameter() { Name = "Type", Type = ParameterType.QueryString, Value = "ShowAlert" }); Request.Parameters.Add(new Parameter() { Name = "ConnectionId", Type = ParameterType.QueryString, Value = ConnectionId }); IRestResponse Response = Client.Execute(Request); } // end Show Alert