Package org.apache.howl.common

Examples of org.apache.howl.common.HowlException


      // If partition columns occur in data, we want to remove them.
      partColsToDel = jobInfo.getPosOfPartCols();

      if(partColsToDel == null){
        throw new HowlException("It seems that setSchema() is not called on " +
            "HowlOutputFormat. Please make sure that method is called.");
      }

      this.storageDriver = HowlOutputFormat.getOutputDriverInstance(context, jobInfo);
      this.baseWriter = storageDriver.getOutputFormat().getRecordWriter(context);
View Full Code Here


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

        //For partitioned table, fail if partition is already present
        List<String> currentParts = client.listPartitionNames(outputInfo.getDatabaseName(),
            outputInfo.getTableName(), partitionValues, (short) 1);

        if( currentParts.size() > 0 ) {
          throw new HowlException(ErrorType.ERROR_DUPLICATE_PARTITION);
        }
      } else {
        Path tablePath = new Path(table.getSd().getLocation());
        FileSystem fs = tablePath.getFileSystem(job.getConfiguration());

        if ( fs.exists(tablePath) ) {
          FileStatus[] status = fs.globStatus(new Path(tablePath, "*"), hiddenFileFilter);

          if( status.length > 0 ) {
            throw new HowlException(ErrorType.ERROR_NON_EMPTY_TABLE,
                      table.getDbName() + "." + table.getTableName());
          }
        }
      }
    }
View Full Code Here

     * @throws IOException the IO exception
     */
    static OutputJobInfo getJobInfo(JobContext jobContext) throws IOException {
        String jobString = jobContext.getConfiguration().get(HOWL_KEY_OUTPUT_INFO);
        if( jobString == null ) {
            throw new HowlException(ErrorType.ERROR_NOT_INITIALIZED);
        }

        return (OutputJobInfo) HowlUtil.deserialize(jobString);
    }
View Full Code Here

            driver.initialize(jobContext, jobInfo.getStorerInfo().getProperties());

            return driver;
        } catch(Exception e) {
            throw new HowlException(ErrorType.ERROR_INIT_STORAGE_DRIVER, e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.howl.common.HowlException

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.