public TableConfig getTableConfig() { FileUploadDownloadClient fileUploadDownloadClient = new FileUploadDownloadClient(); List<URI> tableConfigURIs = new ArrayList<>(); try { for (PushLocation pushLocation : _pushLocations) { tableConfigURIs.add(FileUploadDownloadClient .getRetrieveTableConfigURI(pushLocation.getHost(), pushLocation.getPort(), _tableName)); } } catch (URISyntaxException e) { LOGGER.error("Could not construct table config URI for table {}", _tableName); throw new RuntimeException(e); } // Return the first table config it can retrieve for (URI uri : tableConfigURIs) { try { SimpleHttpResponse response = fileUploadDownloadClient.getTableConfig(uri); JsonNode offlineTableConfig = JsonUtils.stringToJsonNode(response.getResponse()).get(OFFLINE); if (offlineTableConfig != null) { LOGGER.info("Got table config {}", offlineTableConfig); return TableConfig.fromJSONConfig(offlineTableConfig); } } catch (Exception e) { LOGGER.warn("Caught exception while trying to get table config for " + _tableName + " " + e); } } LOGGER.error("Could not get table configs from any push locations provided for " + _tableName); throw new RuntimeException("Could not get table config for table " + _tableName); }