@Override public OperationHandle getCatalogs(SessionHandle sessionHandle) throws HiveSQLException { OperationHandle opHandle = sessionManager.getSession(sessionHandle) .getCatalogs(); LOG.debug(sessionHandle + ": getCatalogs()"); return opHandle; }
@Override public void cancelDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException { sessionManager.getSession(sessionHandle). cancelDelegationToken(authFactory, tokenStr); LOG.info(sessionHandle + ": cancelDelegationToken()"); }
@Override public OperationHandle getColumns(SessionHandle sessionHandle, String catalogName, String schemaName, String tableName, String columnName) throws HiveSQLException { OperationHandle opHandle = sessionManager.getSession(sessionHandle) .getColumns(catalogName, schemaName, tableName, columnName); LOG.debug(sessionHandle + ": getColumns()"); return opHandle; }
@Override public String getDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, String owner, String renewer) throws HiveSQLException { String delegationToken = sessionManager.getSession(sessionHandle). getDelegationToken(authFactory, owner, renewer); LOG.info(sessionHandle + ": getDelegationToken()" + " owner: " + owner + ", renewer: " + renewer); return delegationToken; }
@Override public void renewDelegationToken(SessionHandle sessionHandle, HiveAuthFactory authFactory, String tokenStr) throws HiveSQLException { sessionManager.getSession(sessionHandle).renewDelegationToken(authFactory, tokenStr); LOG.info(sessionHandle + ": renewDelegationToken()"); }
@Override public OperationHandle getTypeInfo(SessionHandle sessionHandle) throws HiveSQLException { OperationHandle opHandle = sessionManager.getSession(sessionHandle) .getTypeInfo(); LOG.debug(sessionHandle + ": getTypeInfo()"); return opHandle; }
@Override public OperationHandle getSchemas(SessionHandle sessionHandle, String catalogName, String schemaName) throws HiveSQLException { OperationHandle opHandle = sessionManager.getSession(sessionHandle) .getSchemas(catalogName, schemaName); LOG.debug(sessionHandle + ": getSchemas()"); return opHandle; }
@Override public OperationHandle getPrimaryKeys(SessionHandle sessionHandle, String catalog, String schema, String table) throws HiveSQLException { OperationHandle opHandle = sessionManager.getSession(sessionHandle) .getPrimaryKeys(catalog, schema, table); LOG.debug(sessionHandle + ": getPrimaryKeys()"); return opHandle; }
@Override public GetInfoValue getInfo(SessionHandle sessionHandle, GetInfoType getInfoType) throws HiveSQLException { GetInfoValue infoValue = sessionManager.getSession(sessionHandle) .getInfo(getInfoType); LOG.debug(sessionHandle + ": getInfo()"); return infoValue; }
@Override public OperationHandle getTables(SessionHandle sessionHandle, String catalogName, String schemaName, String tableName, List<String> tableTypes) throws HiveSQLException { OperationHandle opHandle = sessionManager.getSession(sessionHandle) .getTables(catalogName, schemaName, tableName, tableTypes); LOG.debug(sessionHandle + ": getTables()"); return opHandle; }
@Override public OperationHandle getTableTypes(SessionHandle sessionHandle) throws HiveSQLException { OperationHandle opHandle = sessionManager.getSession(sessionHandle) .getTableTypes(); LOG.debug(sessionHandle + ": getTableTypes()"); return opHandle; }
@Override public OperationHandle getFunctions(SessionHandle sessionHandle, String catalogName, String schemaName, String functionName) throws HiveSQLException { OperationHandle opHandle = sessionManager.getSession(sessionHandle) .getFunctions(catalogName, schemaName, functionName); LOG.debug(sessionHandle + ": getFunctions()"); return opHandle; }
public HiveConf getSessionConf(SessionHandle sessionHandle) throws HiveSQLException { return sessionManager.getSession(sessionHandle).getSessionConf(); }
@Override public void setApplicationName(SessionHandle sh, String value) throws HiveSQLException { sessionManager.getSession(sh).setApplicationName(value); }
@Override public OperationHandle getCrossReference(SessionHandle sessionHandle, String primaryCatalog, String primarySchema, String primaryTable, String foreignCatalog, String foreignSchema, String foreignTable) throws HiveSQLException { OperationHandle opHandle = sessionManager.getSession(sessionHandle) .getCrossReference(primaryCatalog, primarySchema, primaryTable, foreignCatalog, foreignSchema, foreignTable); LOG.debug(sessionHandle + ": getCrossReference()"); return opHandle; }
/** * Execute statement on the server with a timeout. This is a blocking call. */ @Override public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, Map<String, String> confOverlay, long queryTimeout) throws HiveSQLException { HiveSession session = sessionManager.getSession(sessionHandle); // need to reset the monitor, as operation handle is not available down stream, Ideally the // monitor should be associated with the operation handle. session.getSessionState().updateProgressMonitor(null); OperationHandle opHandle = session.executeStatement(statement, confOverlay, queryTimeout); LOG.debug(sessionHandle + ": executeStatement()"); return opHandle; }
/** * Execute statement on the server. This is a blocking call. */ @Override public OperationHandle executeStatement(SessionHandle sessionHandle, String statement, Map<String, String> confOverlay) throws HiveSQLException { HiveSession session = sessionManager.getSession(sessionHandle); // need to reset the monitor, as operation handle is not available down stream, Ideally the // monitor should be associated with the operation handle. session.getSessionState().updateProgressMonitor(null); OperationHandle opHandle = session.executeStatement(statement, confOverlay); LOG.debug(sessionHandle + ": executeStatement()"); return opHandle; }
/** * Execute statement asynchronously on the server with a timeout. This is a non-blocking call */ @Override public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, Map<String, String> confOverlay, long queryTimeout) throws HiveSQLException { HiveSession session = sessionManager.getSession(sessionHandle); // need to reset the monitor, as operation handle is not available down stream, Ideally the // monitor should be associated with the operation handle. session.getSessionState().updateProgressMonitor(null); OperationHandle opHandle = session.executeStatementAsync(statement, confOverlay, queryTimeout); LOG.debug(sessionHandle + ": executeStatementAsync()"); return opHandle; }
/** * Execute statement asynchronously on the server. This is a non-blocking call */ @Override public OperationHandle executeStatementAsync(SessionHandle sessionHandle, String statement, Map<String, String> confOverlay) throws HiveSQLException { HiveSession session = sessionManager.getSession(sessionHandle); // need to reset the monitor, as operation handle is not available down stream, Ideally the // monitor should be associated with the operation handle. session.getSessionState().updateProgressMonitor(null); OperationHandle opHandle = session.executeStatementAsync(statement, confOverlay); LOG.debug(sessionHandle + ": executeStatementAsync()"); return opHandle; }
@Test public void testRestore() throws HiveSQLException { SessionHandle session = service.openSession("foo", "bar", null); service.stop(); service = getService(); try { service.getSessionManager().getSession(session); Assert.fail("session already exists before restore"); } catch (HiveSQLException e) { Assert.assertTrue(e.getMessage().contains("Invalid SessionHandle")); } service.createSessionWithSessionHandle(session, "foo", "bar", null); Assert.assertNotNull(service.getSessionManager().getSession(session)); service.stop(); }