/** * Sets the connector information needed to communicate with Accumulo in this job. * * <p> * Stores the password in a file in HDFS and pulls that into the Distributed Cache in an attempt * to be more secure than storing it in the Configuration. * * @param job * the Hadoop job instance to be configured * @param principal * a valid Accumulo user name (user must have Table.CREATE permission if * {@link #setCreateTables(JobConf, boolean)} is set to true) * @param tokenFile * the path to the password file * @since 1.6.0 */ public static void setConnectorInfo(JobConf job, String principal, String tokenFile) throws AccumuloSecurityException { OutputConfigurator.setConnectorInfo(CLASS, job, principal, tokenFile); }
/** * Determines whether tables are permitted to be created as needed. * * @param job * the Hadoop context for the configured job * @return true if the feature is disabled, false otherwise * @since 1.5.0 * @see #setCreateTables(JobConf, boolean) */ protected static Boolean canCreateTables(JobConf job) { return OutputConfigurator.canCreateTables(CLASS, job); }
/** * Gets the default table name from the configuration. * * @param implementingClass * the class whose name will be used as a prefix for the property configuration key * @param conf * the Hadoop configuration object to configure * @return the default table name * @since 1.6.0 * @see #setDefaultTableName(Class, Configuration, String) */ public static String getDefaultTableName(Class<?> implementingClass, Configuration conf) { return conf.get(enumToConfKey(implementingClass, WriteOpts.DEFAULT_TABLE_NAME)); }
/** * Gets the default table name from the configuration. * * @param job * the Hadoop context for the configured job * @return the default table name * @since 1.5.0 * @see #setDefaultTableName(JobConf, String) */ protected static String getDefaultTableName(JobConf job) { return OutputConfigurator.getDefaultTableName(CLASS, job); }
/** * Determines whether this feature is enabled. * * @param job * the Hadoop context for the configured job * @return true if the feature is enabled, false otherwise * @since 1.5.0 * @see #setSimulationMode(JobConf, boolean) */ protected static Boolean getSimulationMode(JobConf job) { return OutputConfigurator.getSimulationMode(CLASS, job); }
/** * Gets the {@link BatchWriterConfig} settings. * * @param job * the Hadoop context for the configured job * @return the configuration object * @since 1.5.0 * @see #setBatchWriterOptions(JobConf, BatchWriterConfig) */ protected static BatchWriterConfig getBatchWriterOptions(JobConf job) { return OutputConfigurator.getBatchWriterOptions(CLASS, job); }
/** * Gets the principal from the configuration. * * @param job * the Hadoop context for the configured job * @return the user name * @since 1.5.0 * @see #setConnectorInfo(JobConf, String, AuthenticationToken) */ protected static String getPrincipal(JobConf job) { return OutputConfigurator.getPrincipal(CLASS, job); }
/** * Gets the log level from this configuration. * * @param job * the Hadoop context for the configured job * @return the log level * @since 1.5.0 * @see #setLogLevel(JobConf, Level) */ protected static Level getLogLevel(JobConf job) { return OutputConfigurator.getLogLevel(CLASS, job); }
/** * Initializes an Accumulo {@link Instance} based on the configuration. * * @param job * the Hadoop context for the configured job * @return an Accumulo instance * @since 1.5.0 * @see #setZooKeeperInstance(JobConf, ClientConfiguration) */ protected static Instance getInstance(JobConf job) { return OutputConfigurator.getInstance(CLASS, job); }
/** * Gets the authenticated token from either the specified token file or directly from the * configuration, whichever was used when the job was configured. * * @param job * the Hadoop job instance to be configured * @return the principal's authentication token * @since 1.6.0 * @see #setConnectorInfo(JobConf, String, AuthenticationToken) * @see #setConnectorInfo(JobConf, String, String) */ protected static AuthenticationToken getAuthenticationToken(JobConf job) { AuthenticationToken token = OutputConfigurator.getAuthenticationToken(CLASS, job); return ConfiguratorBase.unwrapAuthenticationToken(job, token); }
/** * Gets the default table name from the configuration. * * @param job * the Hadoop context for the configured job * @return the default table name * @since 1.5.0 * @see #setDefaultTableName(JobConf, String) */ protected static String getDefaultTableName(JobConf job) { return OutputConfigurator.getDefaultTableName(CLASS, job); }
/** * Determines whether this feature is enabled. * * @param job * the Hadoop context for the configured job * @return true if the feature is enabled, false otherwise * @since 1.5.0 * @see #setSimulationMode(JobConf, boolean) */ protected static Boolean getSimulationMode(JobConf job) { return OutputConfigurator.getSimulationMode(CLASS, job); }
/** * Gets the {@link BatchWriterConfig} settings. * * @param job * the Hadoop context for the configured job * @return the configuration object * @since 1.5.0 * @see #setBatchWriterOptions(JobConf, BatchWriterConfig) */ protected static BatchWriterConfig getBatchWriterOptions(JobConf job) { return OutputConfigurator.getBatchWriterOptions(CLASS, job); }
/** * Gets the principal from the configuration. * * @param job * the Hadoop context for the configured job * @return the user name * @since 1.5.0 * @see #setConnectorInfo(JobConf, String, AuthenticationToken) */ protected static String getPrincipal(JobConf job) { return OutputConfigurator.getPrincipal(CLASS, job); }
/** * Gets the log level from this configuration. * * @param job * the Hadoop context for the configured job * @return the log level * @since 1.5.0 * @see #setLogLevel(JobConf, Level) */ protected static Level getLogLevel(JobConf job) { return OutputConfigurator.getLogLevel(CLASS, job); }
/** * Initializes an Accumulo {@link Instance} based on the configuration. * * @param context * the Hadoop context for the configured job * @return an Accumulo instance * @since 1.5.0 * @see #setZooKeeperInstance(Job, ClientConfiguration) */ protected static Instance getInstance(JobContext context) { return OutputConfigurator.getInstance(CLASS, context.getConfiguration()); }
/** * Gets the authenticated token from either the specified token file or directly from the * configuration, whichever was used when the job was configured. * * @param job * the Hadoop job instance to be configured * @return the principal's authentication token * @since 1.6.0 * @see #setConnectorInfo(JobConf, String, AuthenticationToken) * @see #setConnectorInfo(JobConf, String, String) */ protected static AuthenticationToken getAuthenticationToken(JobConf job) { AuthenticationToken token = OutputConfigurator.getAuthenticationToken(CLASS, job); return ConfiguratorBase.unwrapAuthenticationToken(job, token); }
/** * Sets the connector information needed to communicate with Accumulo in this job. * * <p> * Stores the password in a file in HDFS and pulls that into the Distributed Cache in an attempt * to be more secure than storing it in the Configuration. * * @param job * the Hadoop job instance to be configured * @param principal * a valid Accumulo user name (user must have Table.CREATE permission if * {@link #setCreateTables(Job, boolean)} is set to true) * @param tokenFile * the path to the token file * @since 1.6.0 */ public static void setConnectorInfo(Job job, String principal, String tokenFile) throws AccumuloSecurityException { OutputConfigurator.setConnectorInfo(CLASS, job.getConfiguration(), principal, tokenFile); }
/** * Determines whether this feature is enabled. * * @param implementingClass * the class whose name will be used as a prefix for the property configuration key * @param conf * the Hadoop configuration object to configure * @return true if the feature is enabled, false otherwise * @since 1.6.0 * @see #setSimulationMode(Class, Configuration, boolean) */ public static Boolean getSimulationMode(Class<?> implementingClass, Configuration conf) { return conf.getBoolean(enumToConfKey(implementingClass, Features.SIMULATION_MODE), false); }
/** * Gets the default table name from the configuration. * * @param context * the Hadoop context for the configured job * @return the default table name * @since 1.5.0 * @see #setDefaultTableName(Job, String) */ protected static String getDefaultTableName(JobContext context) { return OutputConfigurator.getDefaultTableName(CLASS, context.getConfiguration()); }