コード例 #1
0
 /** All done. */
 @Override
 public void closeOp(boolean abort) throws HiveException {
   if (handleSkewJoin) {
     skewJoinKeyContext.close(abort);
   }
   super.closeOp(abort);
 }
コード例 #2
0
 @Override
 protected void initializeOp(Configuration hconf) throws HiveException {
   super.initializeOp(hconf);
   initializeChildren(hconf);
   if (handleSkewJoin) {
     skewJoinKeyContext = new SkewJoinHandler(this);
     skewJoinKeyContext.initiliaze(hconf);
     skewJoinKeyContext.setSkewJoinJobCounter(skewjoin_followup_jobs);
   }
   statsMap.put(SkewkeyTableCounter.SKEWJOINFOLLOWUPJOBS, skewjoin_followup_jobs);
 }
コード例 #3
0
  @Override
  public void jobClose(Configuration hconf, boolean success, JobCloseFeedBack feedBack)
      throws HiveException {
    int numAliases = conf.getExprs().size();
    if (conf.getHandleSkewJoin()) {
      try {
        for (int i = 0; i < numAliases; i++) {
          String specPath = conf.getBigKeysDirMap().get((byte) i);
          mvFileToFinalPath(specPath, hconf, success, LOG);
          for (int j = 0; j < numAliases; j++) {
            if (j == i) {
              continue;
            }
            specPath = getConf().getSmallKeysDirMap().get((byte) i).get((byte) j);
            mvFileToFinalPath(specPath, hconf, success, LOG);
          }
        }

        if (success) {
          // move up files
          for (int i = 0; i < numAliases; i++) {
            String specPath = conf.getBigKeysDirMap().get((byte) i);
            moveUpFiles(specPath, hconf, LOG);
            for (int j = 0; j < numAliases; j++) {
              if (j == i) {
                continue;
              }
              specPath = getConf().getSmallKeysDirMap().get((byte) i).get((byte) j);
              moveUpFiles(specPath, hconf, LOG);
            }
          }
        }
      } catch (IOException e) {
        throw new HiveException(e);
      }
    }
    super.jobClose(hconf, success, feedBack);
  }