@Override public boolean nextKeyValue() throws InterruptedException { boolean hasNext = delegate.nextKeyValue(); if (hasNext) { nextKey = convertKey(delegate.getCurrentKey()); nextValue = convertValue(delegate.getCurrentValue()); } return hasNext; }
@Override public RECORD getCurrentRecord() throws InterruptedException { return recordMaker.makeRecord(splitReader.getCurrentKey(), splitReader.getCurrentValue()); }
@Override public void close() { this.reader.close(); } }
/** * Returns an Input defined by a dataset. * @param datasetName the name of the input dataset * @param arguments the arguments to use when instantiating the dataset */ public static Input ofDataset(String datasetName, Map<String, String> arguments) { return ofDataset(datasetName, arguments, null); }
/** * Returns an Output defined by a dataset. * * @param datasetName the name of the output dataset */ public static Output ofDataset(String datasetName) { return ofDataset(datasetName, RuntimeArguments.NO_ARGUMENTS); }
@Override public void initialize(Split split) throws InterruptedException { delegate.initialize(split); nextKey = null; nextValue = null; }
@Override public float getProgress() throws InterruptedException { return splitReader.getProgress(); } };
/** * Returns an Output defined by a dataset. * @param datasetName the name of the output dataset * @param arguments the arguments to use when instantiating the dataset */ public static Output ofDataset(String datasetName, Map<String, String> arguments) { return new DatasetOutput(datasetName, arguments); }
/** * Returns an Output defined by an OutputFormatProvider. * * @param outputName the name of the output * @param outputFormatProvider an instance of an OutputFormatProvider. It can not be an instance of * a {@link DatasetOutputCommitter}. */ public static Output of(String outputName, OutputFormatProvider outputFormatProvider) { return new OutputFormatProviderOutput(outputName, outputFormatProvider); }
@Override public DatasetInput fromNamespace(String namespace) { return new DatasetInput(super.name, arguments, splits, namespace); } }
/** * Gets an attribute value. * @param name Name of the attribute to get the value of. * @return value Value of the attribute, or null if not found. */ public String get(String name) { return get(name, null); }
@Override public void onFailure() throws DataSetException { if (dataset instanceof DatasetOutputCommitter) { ((DatasetOutputCommitter) dataset).onFailure(); } } }
@Override public void onSuccess() throws DataSetException { if (dataset instanceof DatasetOutputCommitter) { ((DatasetOutputCommitter) dataset).onSuccess(); } }
/** * Returns an Input defined by an InputFormatProvider. * * @param inputName the name of the input */ public static Input of(String inputName, InputFormatProvider inputFormatProvider) { return new InputFormatProviderInput(inputName, inputFormatProvider); }
/** * Returns an Input defined by a dataset. * * @param datasetName the name of the input dataset */ public static Input ofDataset(String datasetName) { return ofDataset(datasetName, RuntimeArguments.NO_ARGUMENTS); }
@Override public void close() { tableSplitReader.close(); } }
@Override public float getProgress() throws InterruptedException { return splitReader.getProgress(); } };
@Override public DatasetOutput fromNamespace(String namespace) { return new DatasetOutput(super.name, arguments, namespace); } }
@Override public void close() { delegate.close(); nextKey = null; nextValue = null; } }
@Override public void close() throws IOException { splitReader.close(); } }