private List<Partition> convertToParts(String catName, String dbName, String tblName, List<MPartition> mparts) throws MetaException { List<Partition> parts = new ArrayList<>(mparts.size()); for (MPartition mp : mparts) { parts.add(convertToPart(catName, dbName, tblName, mp)); Deadline.checkTimeout(); } return parts; }
public void noopMethod() throws MetaException { Deadline.checkTimeout(); }
private List<Partition> convertToParts(List<MPartition> src, List<Partition> dest) throws MetaException { if (src == null) { return dest; } if (dest == null) { dest = new ArrayList<>(src.size()); } for (MPartition mp : src) { dest.add(convertToPart(mp)); Deadline.checkTimeout(); } return dest; }
public void exceptions() throws IllegalStateException, MetaException { Deadline.checkTimeout(); throw new IllegalStateException("throwing an exception"); } }
Deadline.checkTimeout();
/** * Drops Serde-s. Should be called with the list short enough to not trip up Oracle/etc. * @param serdeIdList The serde identifiers to drop * @throws MetaException If there is an SQL exception during the execution it converted to * MetaException */ private void dropSerdes(List<Object> serdeIdList) throws MetaException { String queryText; if (serdeIdList.isEmpty()) { return; } String serdeIds = getIdListForIn(serdeIdList); try { // Drop the serde params queryText = "delete from " + SERDE_PARAMS + " where \"SERDE_ID\" in (" + serdeIds + ")"; executeNoResult(queryText); Deadline.checkTimeout(); // Drop the serdes queryText = "delete from " + SERDES + " where \"SERDE_ID\" in (" + serdeIds + ")"; executeNoResult(queryText); } catch (SQLException sqlException) { LOG.warn("SQL error executing query while dropping serde.", sqlException); throw new MetaException("Encountered error while dropping serde."); } }
Deadline.checkTimeout();
Deadline.checkTimeout(); Deadline.checkTimeout(); Deadline.checkTimeout(); + sdIds + ")"; executeNoResult(queryText); Deadline.checkTimeout(); Deadline.checkTimeout(); + skewedStringListIds + ")"; executeNoResult(queryText); Deadline.checkTimeout(); + skewedStringListIds + ")"; executeNoResult(queryText); Deadline.checkTimeout(); Deadline.checkTimeout();
Deadline.checkTimeout(); Deadline.checkTimeout(); Deadline.checkTimeout(); + partitionIds + ")"; executeNoResult(queryText); Deadline.checkTimeout(); + partitionIds + ")"; executeNoResult(queryText); Deadline.checkTimeout(); Deadline.checkTimeout(); } catch (SQLException sqlException) { LOG.warn("SQL error executing query while dropping partition", sqlException); Deadline.checkTimeout(); Deadline.checkTimeout();
fields = null; Deadline.checkTimeout();
private ColumnStatistics makeColumnStats( List<Object[]> list, ColumnStatisticsDesc csd, int offset) throws MetaException { ColumnStatistics result = new ColumnStatistics(); result.setStatsDesc(csd); List<ColumnStatisticsObj> csos = new ArrayList<ColumnStatisticsObj>(list.size()); for (Object[] row : list) { // LastAnalyzed is stored per column but thrift has it per several; // get the lowest for now as nobody actually uses this field. Object laObj = row[offset + 15]; if (laObj != null && (!csd.isSetLastAnalyzed() || csd.getLastAnalyzed() > MetastoreDirectSqlUtils .extractSqlLong(laObj))) { csd.setLastAnalyzed(MetastoreDirectSqlUtils.extractSqlLong(laObj)); } csos.add(prepareCSObj(row, offset)); Deadline.checkTimeout(); } result.setStatsObj(csos); return result; }
ColumnStatisticsObj colStatObj = prepareCSObj(row, 2); colStatsForDB.add(new ColStatsObjWithSourceInfo(colStatObj, catName, dbName, tblName, partName)); Deadline.checkTimeout();
@Override protected ColumnStatistics getJdoResult( GetHelper<ColumnStatistics> ctx) throws MetaException { QueryWrapper queryWrapper = new QueryWrapper(); try { List<MTableColumnStatistics> mStats = getMTableColumnStatistics(getTable(), colNames, queryWrapper); if (mStats.isEmpty()) { return null; } // LastAnalyzed is stored per column, but thrift object has it per multiple columns. // Luckily, nobody actually uses it, so we will set to lowest value of all columns for now. ColumnStatisticsDesc desc = StatObjectConverter.getTableColumnStatisticsDesc(mStats.get(0)); List<ColumnStatisticsObj> statObjs = new ArrayList<>(mStats.size()); for (MTableColumnStatistics mStat : mStats) { if (desc.getLastAnalyzed() > mStat.getLastAnalyzed()) { desc.setLastAnalyzed(mStat.getLastAnalyzed()); } statObjs.add(StatObjectConverter.getTableColumnStatisticsObj(mStat, enableBitVector)); Deadline.checkTimeout(); } return new ColumnStatistics(desc, statObjs); } finally { queryWrapper.close(); } } }.run(true);
Deadline.checkTimeout();
long queryTime = LOG.isDebugEnabled() ? System.nanoTime() : 0; MetastoreDirectSqlUtils.timingTrace(LOG.isDebugEnabled(), queryText, start, queryTime); Deadline.checkTimeout(); final Long[] ids = new Long[4]; Object[] rowVals = new Object[1]; Deadline.checkTimeout();
for (Object[] row : list) { colStats.add(prepareCSObjWithAdjustedNDV(row, 0, useDensityFunctionForNDVEstimation, ndvTuner)); Deadline.checkTimeout(); extraColumnNameTypeParts.put(colName, new String[] { colType, String.valueOf(count) }); Deadline.checkTimeout(); for (Object[] row : list) { colStats.add(prepareCSObjWithAdjustedNDV(row, 0, useDensityFunctionForNDVEstimation, ndvTuner)); Deadline.checkTimeout(); Deadline.checkTimeout(); Deadline.checkTimeout();
List<Object[]> sqlResult = executeWithArray(query, null, queryText); long queryTime = doTrace ? System.nanoTime() : 0; Deadline.checkTimeout(); sd.setSerdeInfo(serde); Deadline.checkTimeout();
Deadline.checkTimeout(); } catch (MetaException e) { failInThread("should not timeout", e); Deadline.checkTimeout(); } catch (MetaException e) { failInThread("should not timeout", e); Deadline.checkTimeout(); failInThread("should timeout.", null); return;
Deadline.checkTimeout();
private List<Partition> convertToParts(String dbName, String tblName, List<MPartition> mparts) throws MetaException { List<Partition> parts = new ArrayList<Partition>(mparts.size()); for (MPartition mp : mparts) { parts.add(convertToPart(dbName, tblName, mp)); Deadline.checkTimeout(); } return parts; }