@Override
  public void checkOutputSpecs(JobContext context) throws IOException, InterruptedException {
    Configuration hConf = getConf();
    if (hConf == null) {
      hConf = context.getConfiguration();
    }

    try (Connection connection = createConnection(hConf); Admin admin = connection.getAdmin()) {
      TableName tableName = TableName.valueOf(hConf.get(OUTPUT_TABLE));
      if (!admin.tableExists(tableName)) {
        throw new TableNotFoundException(
          "Can't write, table does not exist:" + tableName.getNameAsString());
      }

      if (!admin.isTableEnabled(tableName)) {
        throw new TableNotEnabledException(
          "Can't write, table is not enabled: " + tableName.getNameAsString());
      }
    }
  }
Checks if the output table exists and is enabled.
@param context The current context.
@throws IOException          When the check fails.
@throws InterruptedException When the job is aborted.
@see OutputFormat#checkOutputSpecs(JobContext)
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/TableOutputFormat.java