@Override List<Partition> getPartitionsByNames(CompactionInfo ci) throws MetaException { try { return msc.getPartitionsByNames(getDefaultCatalog(conf), ci.dbname, ci.tableName, Collections.singletonList(ci.partName)); } catch (TException e) { LOG.error("Unable to get partitions by name for CompactionInfo=" + ci); throw new MetaException(e.toString()); } } }
/** * Poll the result set status by checking if isSetHasResultSet is set * @return * @throws SQLException */ private TGetOperationStatusResp waitForResultSetStatus() throws SQLException { TGetOperationStatusReq statusReq = new TGetOperationStatusReq(stmtHandle); TGetOperationStatusResp statusResp = null; while(statusResp == null || !statusResp.isSetHasResultSet()) { try { statusResp = client.GetOperationStatus(statusReq); } catch (TException e) { isLogBeingGenerated = false; throw new SQLException(e.toString(), "08S01", e); } } return statusResp; }
@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 void onCreateTable(CreateTableEvent tableEvent) throws MetaException { // Subscriber can get notification about addition of a table in HCAT // by listening on a topic named "HCAT" and message selector string // as "HCAT_EVENT = HCAT_ADD_TABLE" if (tableEvent.getStatus()) { Table tbl = tableEvent.getTable(); IHMSHandler handler = tableEvent.getIHMSHandler(); Configuration conf = handler.getConf(); Table newTbl; try { newTbl = handler.get_table_core(tbl.getCatName(), tbl.getDbName(), tbl.getTableName()) .deepCopy(); newTbl.getParameters().put( HCatConstants.HCAT_MSGBUS_TOPIC_NAME, getTopicPrefix(conf) + "." + newTbl.getDbName().toLowerCase() + "." + newTbl.getTableName().toLowerCase()); handler.alter_table(newTbl.getDbName(), newTbl.getTableName(), newTbl); } catch (TException e) { MetaException me = new MetaException(e.toString()); me.initCause(e); throw me; } String topicName = getTopicPrefix(conf) + "." + newTbl.getDbName().toLowerCase(); send(messageFactory.buildCreateTableMessage(newTbl), topicName); } }
server.compact(master.getMasterLock(), tableId.canonicalID(), startRow, endRow); } catch (TException ex) { LoggerFactory.getLogger(CompactionDriver.class).error(ex.toString());
ByteBufferUtil.toBytes(endRowBB)); } catch (TException ex) { Master.log.error(ex.toString());
public TBase deserialize(TBase t) throws IOException { TBase object; if(t == null) { object = (TBase) ReflectionUtils.newInstance(tClass, null); } else { object = t; object.clear(); } try { object.read(protocol); } catch (TException e) { throw new IOException(e.toString()); } return object; }
public void readFields(final DataInput in) throws IOException { // cast to InputStream - ugly, but should work since all // DataInput implementations in Hadoop are actually InputStreams transport.setInputStream((InputStream) in); try { tbase.read(protocol); } catch (TException e) { throw new IOException(e.toString()); } }
public void write(final DataOutput out) throws IOException { // cast to OutputStream - ugly, but should work transport.setOutputStream((OutputStream) out); try { tbase.write(protocol); } catch (TException e) { throw new IOException(e.toString()); } }
public TBase deserialize(TBase t) throws IOException { TBase object; if(t == null) { object = (TBase) ReflectionUtils.newInstance(tClass, null); } else { object = t; object.clear(); } try { object.read(protocol); } catch (TException e) { throw new IOException(e.toString()); } return object; }
/** * Poll the result set status by checking if isSetHasResultSet is set * @return * @throws SQLException */ private TGetOperationStatusResp waitForResultSetStatus() throws SQLException { TGetOperationStatusReq statusReq = new TGetOperationStatusReq(stmtHandle); TGetOperationStatusResp statusResp = null; while(statusResp == null || !statusResp.isSetHasResultSet()) { try { statusResp = client.GetOperationStatus(statusReq); } catch (TException e) { isLogBeingGenerated = false; throw new SQLException(e.toString(), "08S01", e); } } return statusResp; }
LOGGER.debug("Failed to execute task on " + (i + 1) + " attempts." + " Sleeping for " + retryStrategyWaitDurationMillis + " ms. Exception: " + ex.toString(), ex); exception = ex;
server.compact(master.getMasterLock(), tableId, startRow, endRow); } catch (TException ex) { Logger.getLogger(CompactionDriver.class).error(ex.toString());
server.compact(master.getMasterLock(), tableId, startRow, endRow); } catch (TException ex) { LoggerFactory.getLogger(CompactionDriver.class).error(ex.toString());
server.flush(masterLock, tableId, ByteBufferUtil.toBytes(startRow), ByteBufferUtil.toBytes(endRow)); } catch (TException ex) { log.error(ex.toString());
@Override public void onCreateTable(CreateTableEvent tableEvent) throws MetaException { // Subscriber can get notification about addition of a table in HCAT // by listening on a topic named "HCAT" and message selector string // as "HCAT_EVENT = HCAT_ADD_TABLE" if (tableEvent.getStatus()) { Table tbl = tableEvent.getTable(); IHMSHandler handler = tableEvent.getIHMSHandler(); Configuration conf = handler.getConf(); Table newTbl; try { newTbl = handler.get_table_core(tbl.getCatName(), tbl.getDbName(), tbl.getTableName()) .deepCopy(); newTbl.getParameters().put( HCatConstants.HCAT_MSGBUS_TOPIC_NAME, getTopicPrefix(conf) + "." + newTbl.getDbName().toLowerCase() + "." + newTbl.getTableName().toLowerCase()); handler.alter_table(newTbl.getDbName(), newTbl.getTableName(), newTbl); } catch (TException e) { MetaException me = new MetaException(e.toString()); me.initCause(e); throw me; } String topicName = getTopicPrefix(conf) + "." + newTbl.getDbName().toLowerCase(); send(messageFactory.buildCreateTableMessage(newTbl), topicName); } }
ByteBufferUtil.toBytes(endRow)); } catch (TException ex) { Master.log.error(ex.toString());