public void setup(Context context) throws IOException, InterruptedException { Configuration conf = context.getConfiguration(); this.fieldSeparator = conf.get(FieldSelectionHelper.DATA_FIELD_SEPERATOR, "\t"); this.mapOutputKeyValueSpec = conf.get(FieldSelectionHelper.MAP_OUTPUT_KEY_VALUE_SPEC, "0-:"); try { this.ignoreInputKey = TextInputFormat.class.getCanonicalName().equals( context.getInputFormatClass().getCanonicalName()); } catch (ClassNotFoundException e) { throw new IOException("Input format class not found", e); } allMapValueFieldsFrom = FieldSelectionHelper.parseOutputKeyValueSpec( mapOutputKeyValueSpec, mapOutputKeyFieldList, mapOutputValueFieldList); LOG.info(FieldSelectionHelper.specToString(fieldSeparator, mapOutputKeyValueSpec, allMapValueFieldsFrom, mapOutputKeyFieldList, mapOutputValueFieldList) + "\nignoreInputKey:" + ignoreInputKey); }
public void setup(Context context) throws IOException, InterruptedException { Configuration conf = context.getConfiguration(); this.fieldSeparator = conf.get(FieldSelectionHelper.DATA_FIELD_SEPERATOR, "\t"); this.mapOutputKeyValueSpec = conf.get(FieldSelectionHelper.MAP_OUTPUT_KEY_VALUE_SPEC, "0-:"); try { this.ignoreInputKey = TextInputFormat.class.getCanonicalName().equals( context.getInputFormatClass().getCanonicalName()); } catch (ClassNotFoundException e) { throw new IOException("Input format class not found", e); } allMapValueFieldsFrom = FieldSelectionHelper.parseOutputKeyValueSpec( mapOutputKeyValueSpec, mapOutputKeyFieldList, mapOutputValueFieldList); LOG.info(FieldSelectionHelper.specToString(fieldSeparator, mapOutputKeyValueSpec, allMapValueFieldsFrom, mapOutputKeyFieldList, mapOutputValueFieldList) + "\nignoreInputKey:" + ignoreInputKey); }
public void setup(Context context) throws IOException, InterruptedException { Configuration conf = context.getConfiguration(); this.fieldSeparator = conf.get(FieldSelectionHelper.DATA_FIELD_SEPERATOR, "\t"); this.mapOutputKeyValueSpec = conf.get(FieldSelectionHelper.MAP_OUTPUT_KEY_VALUE_SPEC, "0-:"); try { this.ignoreInputKey = TextInputFormat.class.getCanonicalName().equals( context.getInputFormatClass().getCanonicalName()); } catch (ClassNotFoundException e) { throw new IOException("Input format class not found", e); } allMapValueFieldsFrom = FieldSelectionHelper.parseOutputKeyValueSpec( mapOutputKeyValueSpec, mapOutputKeyFieldList, mapOutputValueFieldList); LOG.info(FieldSelectionHelper.specToString(fieldSeparator, mapOutputKeyValueSpec, allMapValueFieldsFrom, mapOutputKeyFieldList, mapOutputValueFieldList) + "\nignoreInputKey:" + ignoreInputKey); }
public void setup(Context context) throws IOException, InterruptedException { Configuration conf = context.getConfiguration(); this.fieldSeparator = conf.get(FieldSelectionHelper.DATA_FIELD_SEPERATOR, "\t"); this.mapOutputKeyValueSpec = conf.get(FieldSelectionHelper.MAP_OUTPUT_KEY_VALUE_SPEC, "0-:"); try { this.ignoreInputKey = TextInputFormat.class.getCanonicalName().equals( context.getInputFormatClass().getCanonicalName()); } catch (ClassNotFoundException e) { throw new IOException("Input format class not found", e); } allMapValueFieldsFrom = FieldSelectionHelper.parseOutputKeyValueSpec( mapOutputKeyValueSpec, mapOutputKeyFieldList, mapOutputValueFieldList); LOG.info(FieldSelectionHelper.specToString(fieldSeparator, mapOutputKeyValueSpec, allMapValueFieldsFrom, mapOutputKeyFieldList, mapOutputValueFieldList) + "\nignoreInputKey:" + ignoreInputKey); }
public void setup(Context context) throws IOException, InterruptedException { Configuration conf = context.getConfiguration(); this.fieldSeparator = conf.get(FieldSelectionHelper.DATA_FIELD_SEPERATOR, "\t"); this.mapOutputKeyValueSpec = conf.get(FieldSelectionHelper.MAP_OUTPUT_KEY_VALUE_SPEC, "0-:"); try { this.ignoreInputKey = TextInputFormat.class.getCanonicalName().equals( context.getInputFormatClass().getCanonicalName()); } catch (ClassNotFoundException e) { throw new IOException("Input format class not found", e); } allMapValueFieldsFrom = FieldSelectionHelper.parseOutputKeyValueSpec( mapOutputKeyValueSpec, mapOutputKeyFieldList, mapOutputValueFieldList); LOG.info(FieldSelectionHelper.specToString(fieldSeparator, mapOutputKeyValueSpec, allMapValueFieldsFrom, mapOutputKeyFieldList, mapOutputValueFieldList) + "\nignoreInputKey:" + ignoreInputKey); }
@Override protected void setup(Context context) throws IOException, InterruptedException { // assert that the user gets FileInputSplit (as opposed to the MultiInputTaggedSplit) from the context Preconditions.checkArgument(context.getInputSplit() instanceof FileSplit); try { // assert that the user gets the TextInputFormat, as opposed to the MultiInputFormat from the context Preconditions.checkArgument(context.getInputFormatClass() == TextInputFormat.class); } catch (ClassNotFoundException e) { Throwables.propagate(e); } }