Example usage for org.apache.hadoop.mapred InvalidInputException getMessage

List of usage examples for org.apache.hadoop.mapred InvalidInputException getMessage

Introduction

In this page you can find the example usage for org.apache.hadoop.mapred InvalidInputException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Get a summary message of the problems found.

Usage

From source file:org.apache.hawq.pxf.plugins.hive.HiveDataFragmenter.java

License:Apache License

private void fetchMetaData(HiveTablePartition tablePartition) throws Exception {
    InputFormat<?, ?> fformat = makeInputFormat(tablePartition.storageDesc.getInputFormat(), jobConf);
    FileInputFormat.setInputPaths(jobConf, new Path(tablePartition.storageDesc.getLocation()));

    InputSplit[] splits = null;/*w w w.  ja va2s.com*/
    try {
        splits = fformat.getSplits(jobConf, 1);
    } catch (org.apache.hadoop.mapred.InvalidInputException e) {
        LOG.debug("getSplits failed on " + e.getMessage());
        return;
    }

    for (InputSplit split : splits) {
        FileSplit fsp = (FileSplit) split;
        String[] hosts = fsp.getLocations();
        String filepath = fsp.getPath().toUri().getPath();

        byte[] locationInfo = HdfsUtilities.prepareFragmentMetadata(fsp);
        Fragment fragment = new Fragment(filepath, hosts, locationInfo, makeUserData(tablePartition));
        fragments.add(fragment);
    }
}