throw new IOException(e.getMessage(), e);
throw new IOException(e.getMessage(), e);
public void cancelDelegationToken(String tokenStr) throws SQLException { TCancelDelegationTokenReq cancelReq = new TCancelDelegationTokenReq(sessHandle, tokenStr); try { TCancelDelegationTokenResp cancelResp = client.CancelDelegationToken(cancelReq); Utils.verifySuccess(cancelResp.getStatus()); return; } catch (TException e) { throw new SQLException("Could not cancel token: " + e.getMessage(), " 08S01", e); } }
private TGetInfoResp getServerInfo(TGetInfoType type) throws SQLException { TGetInfoReq req = new TGetInfoReq(sessHandle, type); TGetInfoResp resp; try { resp = client.GetInfo(req); } catch (TException e) { throw new SQLException(e.getMessage(), "08S01", e); } Utils.verifySuccess(resp.getStatus()); return resp; } }
@Override public List<NotificationEvent> getNextNotificationEvents( long pos, IMetaStoreClient.NotificationFilter filter) throws IOException { try { return hiveDb.getMSC().getNextNotification(pos,getBatchSize(), filter).getEvents(); } catch (TException e) { throw new IOException(e.getMessage(), e); } } }
public void updateCreationMetadata(String dbName, String tableName, CreationMetadata cm) throws HiveException { try { getMSC().updateCreationMetadata(dbName, tableName, cm); } catch (TException e) { throw new HiveException("Unable to update creation metadata " + e.getMessage(), e); } }
public void renewDelegationToken(String tokenStr) throws SQLException { TRenewDelegationTokenReq cancelReq = new TRenewDelegationTokenReq(sessHandle, tokenStr); try { TRenewDelegationTokenResp renewResp = client.RenewDelegationToken(cancelReq); Utils.verifySuccess(renewResp.getStatus()); return; } catch (TException e) { throw new SQLException("Could not renew token: " + e.getMessage(), " 08S01", e); } }
protected void encodeRequest(Channel channel, ChannelBuffer buffer, Request request) throws IOException { Invocation invocation = (Invocation) request.getData(); TProtocol protocol = newProtocol(channel.getUrl(), buffer); try { protocol.writeMessageBegin(new TMessage( invocation.getMethodName(), TMessageType.CALL, thriftSeq.getAndIncrement())); protocol.writeStructBegin(new TStruct(invocation.getMethodName() + "_args")); for (int i = 0; i < invocation.getParameterTypes().length; i++) { Class<?> type = invocation.getParameterTypes()[i]; } } catch (TException e) { throw new IOException(e.getMessage(), e); } }
protected void encodeRequest(Channel channel, ChannelBuffer buffer, Request request) throws IOException { Invocation invocation = (Invocation) request.getData(); TProtocol protocol = newProtocol(channel.getUrl(), buffer); try { protocol.writeMessageBegin(new TMessage( invocation.getMethodName(), TMessageType.CALL, thriftSeq.getAndIncrement())); protocol.writeStructBegin(new TStruct(invocation.getMethodName() + "_args")); for (int i = 0; i < invocation.getParameterTypes().length; i++) { Class<?> type = invocation.getParameterTypes()[i]; } } catch (TException e) { throw new IOException(e.getMessage(), e); } }
private static void assertCreateClientFails(HiveCluster cluster, String message) { try { cluster.createMetastoreClient(); fail("expected exception"); } catch (TException e) { assertContains(e.getMessage(), message); } }
public String getDelegationToken(String owner, String renewer) throws SQLException { TGetDelegationTokenReq req = new TGetDelegationTokenReq(sessHandle, owner, renewer); try { TGetDelegationTokenResp tokenResp = client.GetDelegationToken(req); Utils.verifySuccess(tokenResp.getStatus()); return tokenResp.getDelegationToken(); } catch (TException e) { throw new SQLException("Could not retrieve token: " + e.getMessage(), " 08S01", e); } }
@Override Table resolveTable(CompactionInfo ci) throws MetaException { try { return msc.getTable(getDefaultCatalog(conf), ci.dbname, ci.tableName); } catch (TException e) { LOG.error("Unable to find table " + ci.getFullTableName() + ", " + e.getMessage()); throw new MetaException(e.toString()); } }
@Override public List<String> listDatabaseNamesByPattern(String pattern) throws HCatException { List<String> dbNames = null; try { dbNames = hmsClient.getDatabases(pattern); } catch (MetaException exp) { throw new HCatException("MetaException while listing db names. " + exp.getMessage(), exp); } catch (TException e) { throw new HCatException("Transport Exception while listing db names. " + e.getMessage(), e); } return dbNames; }
public void alterDatabase(String dbName, Database db) throws HiveException { try { getMSC().alterDatabase(dbName, db); } catch (MetaException e) { throw new HiveException("Unable to alter database " + dbName + ". " + e.getMessage(), e); } catch (NoSuchObjectException e) { throw new HiveException("Database " + dbName + " does not exists.", e); } catch (TException e) { throw new HiveException("Unable to alter database " + dbName + ". " + e.getMessage(), e); } } /**
@Override public List<String> listTableNamesByPattern(String dbName, String tablePattern) throws HCatException { List<String> tableNames = null; try { tableNames = hmsClient.getTables(checkDB(dbName), tablePattern); } catch (MetaException e) { throw new HCatException("MetaException while fetching table names. " + e.getMessage(), e); } catch (UnknownDBException e) { throw new HCatException("UnknownDB " + dbName + " while fetching table names.", e); } catch (TException e) { throw new HCatException("Transport exception while fetching table names. " + e.getMessage(), e); } return tableNames; }
public void alterDatabase(String dbName, Database db) throws HiveException { try { getMSC().alterDatabase(dbName, db); } catch (MetaException e) { throw new HiveException("Unable to alter database " + dbName + ". " + e.getMessage(), e); } catch (NoSuchObjectException e) { throw new HiveException("Database " + dbName + " does not exists.", e); } catch (TException e) { throw new HiveException("Unable to alter database " + dbName + ". " + e.getMessage(), e); } } /**
public ResultSet getTableTypes() throws SQLException { TGetTableTypesResp tableTypeResp; try { tableTypeResp = client.GetTableTypes(new TGetTableTypesReq(sessHandle)); } catch (TException e) { throw new SQLException(e.getMessage(), "08S01", e); } Utils.verifySuccess(tableTypeResp.getStatus()); return new HiveQueryResultSet.Builder(connection) .setClient(client) .setSessionHandle(sessHandle) .setStmtHandle(tableTypeResp.getOperationHandle()) .build(); }
public ResultSet getCatalogs() throws SQLException { TGetCatalogsResp catalogResp; try { catalogResp = client.GetCatalogs(new TGetCatalogsReq(sessHandle)); } catch (TException e) { throw new SQLException(e.getMessage(), "08S01", e); } Utils.verifySuccess(catalogResp.getStatus()); return new HiveQueryResultSet.Builder(connection) .setClient(client) .setSessionHandle(sessHandle) .setStmtHandle(catalogResp.getOperationHandle()) .build(); }
public ResultSet getTypeInfo() throws SQLException { TGetTypeInfoResp getTypeInfoResp; TGetTypeInfoReq getTypeInfoReq = new TGetTypeInfoReq(); getTypeInfoReq.setSessionHandle(sessHandle); try { getTypeInfoResp = client.GetTypeInfo(getTypeInfoReq); } catch (TException e) { throw new SQLException(e.getMessage(), "08S01", e); } Utils.verifySuccess(getTypeInfoResp.getStatus()); return new HiveQueryResultSet.Builder(connection) .setClient(client) .setSessionHandle(sessHandle) .setStmtHandle(getTypeInfoResp.getOperationHandle()) .build(); }
public ResultSet getPrimaryKeys(String catalog, String schema, String table) throws SQLException { TGetPrimaryKeysResp getPKResp; TGetPrimaryKeysReq getPKReq = new TGetPrimaryKeysReq(sessHandle); getPKReq.setTableName(table); getPKReq.setSchemaName(schema); getPKReq.setCatalogName(catalog); try { getPKResp = client.GetPrimaryKeys(getPKReq); } catch (TException e) { throw new SQLException(e.getMessage(), "08S01", e); } Utils.verifySuccess(getPKResp.getStatus()); return new HiveQueryResultSet.Builder(connection) .setClient(client) .setSessionHandle(sessHandle) .setStmtHandle(getPKResp.getOperationHandle()) .build(); }