Example usage for org.apache.hadoop.mapreduce JobContext getConfiguration

List of usage examples for org.apache.hadoop.mapreduce JobContext getConfiguration

Introduction

In this page you can find the example usage for org.apache.hadoop.mapreduce JobContext getConfiguration.

Prototype

public Configuration getConfiguration();

Source Link

Document

Return the configuration for the job.

Usage

From source file:org.apache.accumulo.core.client.mapreduce.InputFormatBase.java

License:Apache License

/**
 * Gets the table name from the configuration.
 *
 * @param context// w ww  . j  a  v a 2s  .  com
 *          the Hadoop context for the configured job
 * @return the table name
 * @since 1.5.0
 * @see #setInputTableName(Job, String)
 */
protected static String getInputTableName(JobContext context) {
    return InputConfigurator.getInputTableName(CLASS, context.getConfiguration());
}

From source file:org.apache.accumulo.core.client.mapreduce.InputFormatBase.java

License:Apache License

/**
 * Gets the ranges to scan over from a job.
 *
 * @param context/*w  w  w .j a v a  2  s  .  c o m*/
 *          the Hadoop context for the configured job
 * @return the ranges
 * @since 1.5.0
 * @see #setRanges(Job, Collection)
 */
protected static List<Range> getRanges(JobContext context) throws IOException {
    return InputConfigurator.getRanges(CLASS, context.getConfiguration());
}

From source file:org.apache.accumulo.core.client.mapreduce.InputFormatBase.java

License:Apache License

/**
 * Gets the columns to be mapped over from this job.
 *
 * @param context/*  w w w  .  ja  v  a 2  s . com*/
 *          the Hadoop context for the configured job
 * @return a set of columns
 * @since 1.5.0
 * @see #fetchColumns(Job, Collection)
 */
protected static Set<Pair<Text, Text>> getFetchedColumns(JobContext context) {
    return InputConfigurator.getFetchedColumns(CLASS, context.getConfiguration());
}

From source file:org.apache.accumulo.core.client.mapreduce.InputFormatBase.java

License:Apache License

/**
 * Gets a list of the iterator settings (for iterators to apply to a scanner) from this configuration.
 *
 * @param context/*from   w w w  .  j  a  v a 2  s  . c  o  m*/
 *          the Hadoop context for the configured job
 * @return a list of iterators
 * @since 1.5.0
 * @see #addIterator(Job, IteratorSetting)
 */
protected static List<IteratorSetting> getIterators(JobContext context) {
    return InputConfigurator.getIterators(CLASS, context.getConfiguration());
}

From source file:org.apache.accumulo.core.client.mapreduce.InputFormatBase.java

License:Apache License

/**
 * Determines whether a configuration has auto-adjust ranges enabled. Must be enabled when {@link #setBatchScan(Job, boolean)} is true.
 *
 * @param context/*from   w  ww .j  a va2  s  .co m*/
 *          the Hadoop context for the configured job
 * @return false if the feature is disabled, true otherwise
 * @since 1.5.0
 * @see #setAutoAdjustRanges(Job, boolean)
 */
protected static boolean getAutoAdjustRanges(JobContext context) {
    return InputConfigurator.getAutoAdjustRanges(CLASS, context.getConfiguration());
}

From source file:org.apache.accumulo.core.client.mapreduce.InputFormatBase.java

License:Apache License

/**
 * Determines whether a configuration has isolation enabled.
 *
 * @param context/*  w w w  .  j  a  va  2s. c  om*/
 *          the Hadoop context for the configured job
 * @return true if the feature is enabled, false otherwise
 * @since 1.5.0
 * @see #setScanIsolation(Job, boolean)
 */
protected static boolean isIsolated(JobContext context) {
    return InputConfigurator.isIsolated(CLASS, context.getConfiguration());
}

From source file:org.apache.accumulo.core.client.mapreduce.InputFormatBase.java

License:Apache License

/**
 * Determines whether a configuration uses local iterators.
 *
 * @param context//ww w. j ava 2 s .c  o  m
 *          the Hadoop context for the configured job
 * @return true if the feature is enabled, false otherwise
 * @since 1.5.0
 * @see #setLocalIterators(Job, boolean)
 */
protected static boolean usesLocalIterators(JobContext context) {
    return InputConfigurator.usesLocalIterators(CLASS, context.getConfiguration());
}

From source file:org.apache.accumulo.core.client.mapreduce.InputFormatBase.java

License:Apache License

/**
 * Determines whether a configuration has the offline table scan feature enabled.
 *
 * @param context//ww  w.ja va2s  . co  m
 *          the Hadoop context for the configured job
 * @return true if the feature is enabled, false otherwise
 * @since 1.5.0
 * @see #setOfflineTableScan(Job, boolean)
 */
protected static boolean isOfflineScan(JobContext context) {
    return InputConfigurator.isOfflineScan(CLASS, context.getConfiguration());
}

From source file:org.apache.accumulo.core.client.mapreduce.InputFormatBase.java

License:Apache License

/**
 * Determines whether a configuration has the {@link org.apache.accumulo.core.client.BatchScanner} feature enabled.
 *
 * @param context//w w w  .  j  a v a2 s  .c o m
 *          the Hadoop context for the configured job
 * @since 1.7.0
 * @see #setBatchScan(Job, boolean)
 */
public static boolean isBatchScan(JobContext context) {
    return InputConfigurator.isBatchScan(CLASS, context.getConfiguration());
}

From source file:org.apache.accumulo.core.client.mapreduce.InputFormatBase.java

License:Apache License

/**
 * Initializes an Accumulo {@link org.apache.accumulo.core.client.impl.TabletLocator} based on the configuration.
 *
 * @param context//  w  w w  . j a v  a 2s .  co  m
 *          the Hadoop context for the configured job
 * @return an Accumulo tablet locator
 * @throws org.apache.accumulo.core.client.TableNotFoundException
 *           if the table name set on the configuration doesn't exist
 * @since 1.5.0
 * @deprecated since 1.6.0
 */
@Deprecated
protected static TabletLocator getTabletLocator(JobContext context) throws TableNotFoundException {
    return InputConfigurator.getTabletLocator(CLASS, context.getConfiguration(),
            InputConfigurator.getInputTableName(CLASS, context.getConfiguration()));
}