Package co.nubetech.hiho.common

Examples of co.nubetech.hiho.common.HIHOException


        builder.append(")");
      }
      try {
        String buckets = clusterData.nextToken();
        if (buckets == null) {
          throw new HIHOException(
              "The number of buckets wih clustered by is not defined");

        }
        builder.append(" INTO " + buckets + " BUCKETS");
      } catch (NoSuchElementException e) {
        throw new HIHOException(
            "The number of buckets wih clustered by is not defined");

      }

    }
View Full Code Here


    case Types.VARCHAR:
    case Types.LONGVARCHAR:
      returnType = "string";
      break;
    default:
      throw new HIHOException("Unsupported type");
    }
    return returnType;
  }
View Full Code Here

    }
  }

  public void checkMandatoryConfs(Configuration conf) throws HIHOException {
    if (conf.get(DBConfiguration.DRIVER_CLASS_PROPERTY) == null) {
      throw new HIHOException(
          "JDBC driver configuration is not specified,please specify JDBC driver class");
    }
    if (conf.get(DBConfiguration.URL_PROPERTY) == null) {
      throw new HIHOException(
          "JDBC url path configuration is empty,please specify JDBC url path");
    }
    if (!conf.get(DBConfiguration.DRIVER_CLASS_PROPERTY).contains("hsqldb")) {
      if (conf.get(DBConfiguration.USERNAME_PROPERTY) == null) {
        throw new HIHOException(
            "JDBC user name configuration is empty,please specify JDBC user name");
      }
      if (conf.get(DBConfiguration.PASSWORD_PROPERTY) == null) {
        throw new HIHOException(
            "JDBC password configuration is empty,please specify JDBC password");
      }
    }
    if (conf.get(HIHOConf.INPUT_OUTPUT_PATH) == null) {
      throw new HIHOException(
          "Output path is not specified,please specify output path");
    }
    if (conf.get(HIHOConf.INPUT_OUTPUT_STRATEGY) != null
        && conf.get(HIHOConf.INPUT_OUTPUT_STRATEGY).equals("DELIMITED")) {
      if (conf.get(HIHOConf.INPUT_OUTPUT_DELIMITER) == null) {
        throw new HIHOException(
            "Delimiter is not specified,please specify delimiter");
      }

    }
    if (conf.get(DBConfiguration.INPUT_TABLE_NAME_PROPERTY) == null
        && conf.get(DBConfiguration.INPUT_QUERY) == null) {
      throw new HIHOException(
          "Input table name and input query both configurations are empty, please specify anyone of them");
    }
    if (conf.get(DBConfiguration.INPUT_QUERY) != null
        && conf.get(DBConfiguration.INPUT_BOUNDING_QUERY) == null) {
      throw new HIHOException(
          "Please specify input bounding query as it is mandatory to be defined with input query ");
    }
    if (conf.get(DBConfiguration.INPUT_TABLE_NAME_PROPERTY) != null
        && conf.get(DBConfiguration.INPUT_FIELD_NAMES_PROPERTY) == null) {
      conf.set(DBConfiguration.INPUT_FIELD_NAMES_PROPERTY, "*");
    }

    if (conf.get(HIHOConf.INPUT_OUTPUT_LOADTO) != null
        && conf.get(HIHOConf.INPUT_OUTPUT_LOADTO_PATH) == null) {
      throw new HIHOException(
          "Load to path configuration is empty, please specify path to load script in loadTOPath configuration");
    }
    if (conf.get(HIHOConf.INPUT_OUTPUT_LOADTO) != null
        && conf.get(HIHOConf.INPUT_OUTPUT_LOADTO).equals("hive")) {
      if (conf.get(HIHOConf.HIVE_URL) == null) {
        throw new HIHOException(
            "The Hive url is not defined, please specify hive url");
      }
      if (conf.get(HIHOConf.HIVE_DRIVER) == null) {
        throw new HIHOException(
            "The Hive driver is not defined, please specify hive driver");
      }
      if (checkForMultiplePartition(conf.get(HIHOConf.HIVE_PARTITION_BY))
          && conf.get(HIHOConf.HIVE_TABLE_NAME) == null) {
        throw new HIHOException("please specify hive table name");
      }

    }

  }
View Full Code Here

        partitionToken.nextToken(), ":");
    try {
      partitionData.nextToken();
      partitionData.nextToken();
    } catch (NoSuchElementException e) {
      throw new HIHOException(
          "Data not defined properly in partitionBy configuration");
    }
    if (partitionData.hasMoreTokens()) {
      int index = partitionData.nextToken().indexOf(",");
      if (index > -1) {
        isMultiplePartition = true;
        if (partitionToken.hasMoreTokens()) {
          throw new HIHOException(
              "Data not defined properly in partitionBy configuration");

        }

      }
View Full Code Here

            fos));
        w.write(pigScript);
        w.close();
        fos.close();
      } catch (Exception h) {
        throw new HIHOException("Unable to generate Pig script", h);
      }
    }

  }
View Full Code Here

    }
  }

  public void checkMandatoryConfs() throws HIHOException {
    if (inputFormat == null) {
      throw new HIHOException(
          "The provided input format is empty, please specify inputFormat");
    }
    if (mergeBy == null) {
      throw new HIHOException(
          "The provided value of dedupBy is empty, please specify either key or value");
    }
    if ((!mergeBy.equals("key")) && (!mergeBy.equals("value"))) {
      throw new HIHOException(
          "The provided value of mergeBy is Incorrect, please specify either key or value");
    }
    if (inputKeyClassName == null) {
      throw new HIHOException(
          "The provided input key class name is empty, please specify inputKeyClassName");
    }
    if (inputValueClassName == null) {
      throw new HIHOException(
          "The provided input value class name is empty, please specify inputValueClassName");
    }
    if (oldPath == null) {
      throw new HIHOException(
          "The provided old path is empty, please specify oldPath");
    }
    if (newPath == null) {
      throw new HIHOException(
          "The provided new path is empty, please specify newPath");
    }
    if (outputPath == null) {
      throw new HIHOException(
          "The provided output path is empty, please specify outputPath");
    }
    if (outputFormat == null) {
      System.out.println(outputFormat);
      throw new HIHOException(
          "The provided output format is empty, please specify outputFormat");
    }
  }
View Full Code Here

    if (conf.get(HIHOConf.INPUT_OUTPUT_LOADTO).equals("hive")) {
      try {
        HiveUtility.createTable(conf, job, getDBWritable(conf),
            jobCounter);
      } catch (Exception h) {
        throw new HIHOException("Unable to generate Hive script", h);
      }
    }

  }
View Full Code Here

          null);
      return writable;

    } catch (Exception e) {
      e.printStackTrace();
      throw new HIHOException("Unable to get metadata for the query", e);
    }
  }
View Full Code Here

    }
  }

  public void checkMandatoryConfs(Configuration conf) throws HIHOException {
    if (conf.get(DBConfiguration.DRIVER_CLASS_PROPERTY) == null) {
      throw new HIHOException(
          "JDBC driver configuration is not specified,please specify JDBC driver class.");
    }
    if (conf.get(DBConfiguration.URL_PROPERTY) == null) {
      throw new HIHOException(
          "JDBC url path configuration is empty,please specify JDBC url path.");
    }
    if (!conf.get(DBConfiguration.DRIVER_CLASS_PROPERTY).contains("hsqldb")) {
      if (conf.get(DBConfiguration.USERNAME_PROPERTY) == null) {
        throw new HIHOException(
            "JDBC user name configuration is empty,please specify JDBC user name.");
      }
      if (conf.get(DBConfiguration.PASSWORD_PROPERTY) == null) {
        throw new HIHOException(
            "JDBC password configuration is empty,please specify JDBC password.");
      }
    }
    if (conf.get(HIHOConf.INPUT_OUTPUT_DELIMITER) == null) {
      throw new HIHOException(
          "The provided delimiter is empty, please specify delimiter.");
    }
    if (conf.get(HIHOConf.NUMBER_MAPPERS) == null) {
      throw new HIHOException(
          "The provided number of mappers is empty, please specify number of mappers.");
    }
    if (inputPath == null) {
      throw new HIHOException(
          "The provided input path is empty, please specify inputPath.");
    }
    if (tableName == null) {
      throw new HIHOException(
          "The provided table name is empty, please specify tableName.");
    }
    if (columnNames == null) {
      throw new HIHOException(
          "The provided column name is empty, please specify columnName.");
    }
  }
View Full Code Here

    }
  }

  public void checkMandatoryConfs(Configuration conf) throws HIHOException {
    if (inputPath == null) {
      throw new HIHOException(
          "The provided inputPath is empty, please specify inputPath");
    }
    if (outputPath == null) {
      throw new HIHOException(
          "The outputPath is not defined, please specify outputPath");
    }
    if (conf.get(HIHOConf.FTP_USER) == null) {
      throw new HIHOException(
          "The FTP UserName is not defined, please specify FTP UserName");
    }
    if (conf.get(HIHOConf.FTP_ADDRESS) == null) {
      throw new HIHOException(
          "The FTP Address is not defined, please specify FTP Address");
    }
    if (conf.get(HIHOConf.FTP_PORT) == null) {
      throw new HIHOException(
          "The FTP Port Number is not defined, please specify FTP Port Number");
    }
    if (conf.get(HIHOConf.FTP_PASSWORD) == null) {
      throw new HIHOException(
          "The FTP Password is not defined, please specify FTP Password");
    }
  }
View Full Code Here

TOP

Related Classes of co.nubetech.hiho.common.HIHOException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.