Examples of ExploreException


Examples of co.cask.cdap.explore.service.ExploreException

    String body = GSON.toJson(new TablesArgs(catalog, schemaPattern, tableNamePattern, tableTypes));
    HttpResponse response = doPost("data/explore/jdbc/tables", body, null);
    if (HttpResponseStatus.OK.getCode() == response.getResponseCode()) {
      return QueryHandle.fromId(parseResponseAsMap(response, "handle"));
    }
    throw new ExploreException("Cannot get the tables. Reason: " + getDetails(response));
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

  public List<TableNameInfo> getTables(@Nullable String database) throws ExploreException {
    HttpResponse response = doGet(String.format("data/explore/tables%s", (database != null) ? "?db=" + database : ""));
    if (HttpResponseStatus.OK.getCode() == response.getResponseCode()) {
      return parseJson(response, TABLES_TYPE);
    }
    throw new ExploreException("Cannot get the tables. Reason: " + getDetails(response));
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

    if (HttpResponseStatus.OK.getCode() == response.getResponseCode()) {
      return parseJson(response, TableInfo.class);
    } else if (HttpResponseStatus.NOT_FOUND.getCode() == response.getResponseCode()) {
      throw new TableNotFoundException("Table " + tableNamePrefix + table + " not found.");
    }
    throw new ExploreException("Cannot get the schema of table " + tableNamePrefix + table +
                               ". Reason: " + getDetails(response));
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

  public QueryHandle getTableTypes() throws ExploreException, SQLException {
    HttpResponse response = doPost("data/explore/jdbc/tableTypes", null, null);
    if (HttpResponseStatus.OK.getCode() == response.getResponseCode()) {
      return QueryHandle.fromId(parseResponseAsMap(response, "handle"));
    }
    throw new ExploreException("Cannot get the tables. Reason: " + getDetails(response));
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

  public QueryHandle getTypeInfo() throws ExploreException, SQLException {
    HttpResponse response = doPost("data/explore/jdbc/types", null, null);
    if (HttpResponseStatus.OK.getCode() == response.getResponseCode()) {
      return QueryHandle.fromId(parseResponseAsMap(response, "handle"));
    }
    throw new ExploreException("Cannot get the tables. Reason: " + getDetails(response));
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

    }

    String message = String.format("Cannot find key %s in server response: %s", key,
                                   new String(response.getResponseBody(), Charsets.UTF_8));
    LOG.error(message);
    throw new ExploreException(message);
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

    try {
      return GSON.fromJson(responseString, type);
    } catch (JsonSyntaxException e) {
      String message = String.format("Cannot parse server response: %s", responseString);
      LOG.error(message, e);
      throw new ExploreException(message, e);
    } catch (JsonParseException e) {
      String message = String.format("Cannot parse server response as map: %s", responseString);
      LOG.error(message, e);
      throw new ExploreException(message, e);
    }
  }
View Full Code Here

Examples of co.cask.cdap.explore.service.ExploreException

      } else {
        return HttpRequests.execute(HttpRequest.builder(HttpMethod.valueOf(requestMethod), url)
                                      .addHeaders(newHeaders).build());
      }
    } catch (IOException e) {
      throw new ExploreException(
        String.format("Error connecting to Explore Service at %s while doing %s with headers %s and body %s",
                      resolvedUrl, requestMethod,
                      newHeaders == null ? "null" : Joiner.on(",").withKeyValueSeparator("=").join(newHeaders),
                      body == null ? "null" : body), e);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.