Examples of HowlException


Examples of org.apache.howl.common.HowlException

    }

    public void append(final HowlFieldSchema hfs) throws HowlException{

      if(hfs == null || fieldSchemas == null){
        throw new HowlException("Attempt to append null HowlFieldSchema in HowlSchema.");
      }
      //TODO Addition of existing field should not be allowed in Schema.
      //Need to enforce that. For that to happen, field schema needs to implement Comparable.
      // Also, HowlSchema needs to implement Comparable.
View Full Code Here

Examples of org.apache.howl.common.HowlException

    }

    public void remove(final HowlFieldSchema howlFieldSchema) throws HowlException {

      if(!fieldSchemas.contains(howlFieldSchema)){
        throw new HowlException("Attempt to delete a non-existent column from Howl Schema: "+ howlFieldSchema);
      }

      fieldSchemas.remove(howlFieldSchema);
      fieldPositionMap.remove(howlFieldSchema);
      fieldNames.remove(howlFieldSchema.getName());
View Full Code Here

Examples of org.apache.howl.common.HowlException

    }

    private static void assertTypeInCategory(Type type, Category category) throws HowlException {
        Category typeCategory = Category.fromType(type);
        if (typeCategory != category){
            throw new HowlException("Type category mismatch. Expected "+category+" but type "+type+" in category "+typeCategory);
        }
    }
View Full Code Here

Examples of org.apache.howl.common.HowlException

    }

    private static void assertTypeNotInCategory(Type type, Category category) throws HowlException {
        Category typeCategory = Category.fromType(type);
        if (typeCategory == category){
            throw new HowlException("Type category mismatch. Expected type "+type+" not in category "+category+" but was so.");
        }
    }
View Full Code Here

Examples of org.apache.howl.common.HowlException

        // No checks for Create Table, since its not possible to compute location
        // here easily. So, it is especially handled in CreateTable post hook.
        break;

      default:
        throw new HowlException(ErrorType.ERROR_INTERNAL_EXCEPTION, "Unexpected token: "+ast.getToken());
      }
    } catch(HowlException e){
      throw new SemanticException(e);
    } catch (MetaException e) {
      throw new SemanticException(e);
View Full Code Here

Examples of org.apache.howl.common.HowlException

        }
      } catch(Exception e) {
        if( e instanceof HowlException ) {
          throw (HowlException) e;
        } else {
          throw new HowlException(ErrorType.ERROR_PUBLISHING_PARTITION, e);
        }
      }

      Path src = new Path(jobInfo.getLocation());
      FileSystem fs = src.getFileSystem(jobContext.getConfiguration());
View Full Code Here

Examples of org.apache.howl.common.HowlException

            //baseCommitter.cleanupJob failed, try to clean up the metastore
            client.dropPartition(tableInfo.getDatabaseName(),
                    tableInfo.getTableName(), values);
          } catch(Exception te) {
            //Keep cause as the original exception
            throw new HowlException(ErrorType.ERROR_PUBLISHING_PARTITION, e);
          }
        }

        if( e instanceof HowlException ) {
          throw (HowlException) e;
        } else {
          throw new HowlException(ErrorType.ERROR_PUBLISHING_PARTITION, e);
        }
      } finally {
        if( client != null ) {
          client.close();
        }
View Full Code Here

Examples of org.apache.howl.common.HowlException

     * @throws IOException
     */
    static List<String> getPartitionValueList(Table table, Map<String, String> valueMap) throws IOException {

      if( valueMap.size() != table.getPartitionKeys().size() ) {
          throw new HowlException(ErrorType.ERROR_INVALID_PARTITION_VALUES,
              "Table "
              + table.getTableName() + " has " +
              table.getPartitionKeys().size() + " partition keys, got "+
              valueMap.size());
      }

      List<String> values = new ArrayList<String>();

      for(FieldSchema schema : table.getPartitionKeys()) {
        String value = valueMap.get(schema.getName().toLowerCase());

        if( value == null ) {
          throw new HowlException(ErrorType.ERROR_MISSING_PARTITION_KEY,
              "Key " + schema.getName() + " of table " + table.getTableName());
        }

        values.add(value);
      }
View Full Code Here

Examples of org.apache.howl.common.HowlException

      if (fs.isFile(file)) {
        Path finalOutputPath = getFinalPath(file, src, dest);

        if (!fs.rename(file, finalOutputPath)) {
          if (!fs.delete(finalOutputPath, true)) {
            throw new HowlException(ErrorType.ERROR_MOVE_FAILED, "Failed to delete existing path " + finalOutputPath);
          }
          if (!fs.rename(file, finalOutputPath)) {
            throw new HowlException(ErrorType.ERROR_MOVE_FAILED, "Failed to move output to " + dest);
          }
        }
      } else if(fs.getFileStatus(file).isDir()) {
        FileStatus[] paths = fs.listStatus(file);
        Path finalOutputPath = getFinalPath(file, src, dest);
View Full Code Here

Examples of org.apache.howl.common.HowlException

    private Path getFinalPath(Path file, Path src,
                              Path dest) throws IOException {
      URI taskOutputUri = file.toUri();
      URI relativePath = src.toUri().relativize(taskOutputUri);
      if (taskOutputUri == relativePath) {
        throw new HowlException(ErrorType.ERROR_MOVE_FAILED, "Can not get the relative path: base = " +
            src + " child = " + file);
      }
      if (relativePath.getPath().length() > 0) {
        return new Path(dest, relativePath.getPath());
      } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.