コード例 #1
0
  public static Map<String, String> getInputJobProperties(
      HCatStorageHandler storageHandler, InputJobInfo inputJobInfo) {
    TableDesc tableDesc =
        new TableDesc(
            storageHandler.getSerDeClass(),
            storageHandler.getInputFormatClass(),
            storageHandler.getOutputFormatClass(),
            inputJobInfo.getTableInfo().getStorerInfo().getProperties());
    if (tableDesc.getJobProperties() == null) {
      tableDesc.setJobProperties(new HashMap<String, String>());
    }

    Map<String, String> jobProperties = new HashMap<String, String>();
    try {
      tableDesc
          .getJobProperties()
          .put(HCatConstants.HCAT_KEY_JOB_INFO, HCatUtil.serialize(inputJobInfo));

      storageHandler.configureInputJobProperties(tableDesc, jobProperties);

    } catch (IOException e) {
      throw new IllegalStateException("Failed to configure StorageHandler", e);
    }

    return jobProperties;
  }