Examples of TOpenSessionReq


Examples of org.apache.hive.service.cli.thrift.TOpenSessionReq

    }
    return false;
  }

  private void openSession() throws SQLException {
    TOpenSessionReq openReq = new TOpenSessionReq();

    // set the session configuration
    // openReq.setConfiguration(null);

    try {
View Full Code Here

Examples of org.apache.hive.service.cli.thrift.TOpenSessionReq

      // We'll call an open/close here to send a test HTTP message to the server. Any
      // TTransportException caused by trying to connect to a non-available peer are thrown here.
      // Bubbling them up the call hierarchy so that a retry can happen in openTransport,
      // if dynamic service discovery is configured.
      TCLIService.Iface client = new TCLIService.Client(new TBinaryProtocol(transport));
      TOpenSessionResp openResp = client.OpenSession(new TOpenSessionReq());
      if (openResp != null) {
        client.CloseSession(new TCloseSessionReq(openResp.getSessionHandle()));
      }
    }
    catch (TException e) {
View Full Code Here

Examples of org.apache.hive.service.cli.thrift.TOpenSessionReq

    }
    return tokenStr;
  }

  private void openSession() throws SQLException {
    TOpenSessionReq openReq = new TOpenSessionReq();

    Map<String, String> openConf = new HashMap<String, String>();
    // for remote JDBC client, try to set the conf var using 'set foo=bar'
    for (Entry<String, String> hiveConf : connParams.getHiveConfs().entrySet()) {
      openConf.put("set:hiveconf:" + hiveConf.getKey(), hiveConf.getValue());
    }
    // For remote JDBC client, try to set the hive var using 'set hivevar:key=value'
    for (Entry<String, String> hiveVar : connParams.getHiveVars().entrySet()) {
      openConf.put("set:hivevar:" + hiveVar.getKey(), hiveVar.getValue());
    }
    // switch the database
    openConf.put("use:database", connParams.getDbName());

    // set the session configuration
    Map<String, String> sessVars = connParams.getSessionVars();
    if (sessVars.containsKey(HiveAuthFactory.HS2_PROXY_USER)) {
      openConf.put(HiveAuthFactory.HS2_PROXY_USER,
          sessVars.get(HiveAuthFactory.HS2_PROXY_USER));
    }
    openReq.setConfiguration(openConf);

    // Store the user name in the open request in case no non-sasl authentication
    if (JdbcConnectionParams.AUTH_SIMPLE.equals(sessConfMap.get(JdbcConnectionParams.AUTH_TYPE))) {
      openReq.setUsername(sessConfMap.get(JdbcConnectionParams.AUTH_USER));
      openReq.setPassword(sessConfMap.get(JdbcConnectionParams.AUTH_PASSWD));
    }

    try {
      TOpenSessionResp openResp = client.OpenSession(openReq);
View Full Code Here

Examples of org.apache.hive.service.cli.thrift.TOpenSessionReq

    }
    return tokenStr;
  }

  private void openSession(Map<String, String> sessVars) throws SQLException {
    TOpenSessionReq openReq = new TOpenSessionReq();

    // set the session configuration
    if (sessVars.containsKey(HiveAuthFactory.HS2_PROXY_USER)) {
      Map<String, String> openConf = new HashMap<String, String>();
      openConf.put(HiveAuthFactory.HS2_PROXY_USER,
          sessVars.get(HiveAuthFactory.HS2_PROXY_USER));
      openReq.setConfiguration(openConf);
    }

    try {
      TOpenSessionResp openResp = client.OpenSession(openReq);
View Full Code Here

Examples of org.apache.hive.service.cli.thrift.TOpenSessionReq

          + uri + ": " + e.getMessage(), " 08S01");
    }
  }

    private void openSession(String uri) throws SQLException {
      TOpenSessionReq openReq = new TOpenSessionReq();

      // set the session configuration
      // openReq.setConfiguration(null);

      try {
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.