public static CompactionInfo compactionStructToInfo(CompactionInfoStruct cr) {
    if (cr == null) {
      return null;
    }
    CompactionInfo ci = new CompactionInfo(cr.getDbname(), cr.getTablename(), cr.getPartitionname(), cr.getType());
    ci.id = cr.getId();
    ci.runAs = cr.getRunas();
    ci.properties = cr.getProperties();
    if (cr.isSetToomanyaborts()) {
      ci.tooManyAborts = cr.isToomanyaborts();
    }
    if (cr.isSetHasoldabort()) {
      ci.hasOldAbort = cr.isHasoldabort();
    }
    if (cr.isSetState() && cr.getState().length() != 1) {
      throw new IllegalStateException("State should only be one character but it was set to " + cr.getState());
    } else if (cr.isSetState()) {
      ci.state = cr.getState().charAt(0);
    }
    ci.workerId = cr.getWorkerId();
    if (cr.isSetStart()) {
      ci.start = cr.getStart();
    }
    if (cr.isSetHighestWriteId()) {
      ci.highestWriteId = cr.getHighestWriteId();
    }
    if (cr.isSetErrorMessage()) {
      ci.errorMessage = cr.getErrorMessage();
    }
    if (cr.isSetEnqueueTime()) {
      ci.enqueueTime = cr.getEnqueueTime();
    }
    if (cr.isSetRetryRetention()) {
      ci.retryRetention = cr.getRetryRetention();
    }
    if (cr.isSetPoolname()) {
      ci.poolName = cr.getPoolname();
    }
    if (cr.isSetNumberOfBuckets()) {
      ci.numberOfBuckets = cr.getNumberOfBuckets();
    }
    if (cr.isSetOrderByClause()) {
      ci.orderByClause = cr.getOrderByClause();
    }
    return ci;
  }
loads object from a row in Select * from COMPACTION_QUEUE
@param rs ResultSet after call to rs.next()
@throws SQLException
standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/entities/CompactionInfo.java