/** * Get the partition being compacted. * @param ci compaction info returned from the compaction queue * @return metastore partition, or null if there is not partition in this compaction info * @throws Exception if underlying calls throw, or if the partition name resolves to more than * one partition. */ protected Partition resolvePartition(CompactionInfo ci) throws Exception { if (ci.partName != null) { List<Partition> parts; try { parts = getPartitionsByNames(ci); if (parts == null || parts.size() == 0) { // The partition got dropped before we went looking for it. return null; } } catch (Exception e) { LOG.error("Unable to find partition " + ci.getFullPartitionName() + ", " + e.getMessage()); throw e; } if (parts.size() != 1) { LOG.error(ci.getFullPartitionName() + " does not refer to a single partition. " + parts); throw new MetaException("Too many partitions for : " + ci.getFullPartitionName()); } return parts.get(0); } else { return null; } }