Package co.cask.cdap.explore.utils

Examples of co.cask.cdap.explore.utils.TablesArgs


  public void getJDBCTables(HttpRequest request, HttpResponder responder) {
    handleResponseEndpointExecution(request, responder, new EndpointCoreExecution<QueryHandle>() {
      @Override
      public QueryHandle execute(HttpRequest request, HttpResponder responder)
        throws IllegalArgumentException, SQLException, ExploreException, IOException {
        TablesArgs args = decodeArguments(request, TablesArgs.class, new TablesArgs(null, null, "%", null));
        LOG.trace("Received get tables with params: {}", args.toString());
        return exploreService.getTables(args.getCatalog(), args.getSchemaPattern(),
                                        args.getTableNamePattern(), args.getTableTypes());
      }
    });
  }
View Full Code Here


  }

  @Override
  public QueryHandle getTables(String catalog, String schemaPattern,
                               String tableNamePattern, List<String> tableTypes) throws ExploreException, SQLException {
    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

TOP

Related Classes of co.cask.cdap.explore.utils.TablesArgs

Copyright © 2018 www.massapicom. 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.