/** * Instantiating HBaseConfiguration() is deprecated. Please use * HBaseConfiguration#create() to construct a plain Configuration * @deprecated Please use create() instead. */ @Deprecated public HBaseConfiguration() { //TODO:replace with private constructor, HBaseConfiguration should not extend Configuration super(); addHbaseResources(this); LOG.warn("instantiating HBaseConfiguration() is deprecated. Please use" + " HBaseConfiguration#create() to construct a plain Configuration"); }
/** * Creates a Configuration with HBase resources * @return a Configuration with HBase resources */ public static Configuration create() { Configuration conf = new Configuration(); // In case HBaseConfiguration is loaded from a different classloader than // Configuration, conf needs to be set with appropriate class loader to resolve // HBase resources. conf.setClassLoader(HBaseConfiguration.class.getClassLoader()); return addHbaseResources(conf); }
/** * Utility method to add hbase-default.xml and hbase-site.xml properties to a new map * if they are not already present in the jobConf. * @param jobConf Job configuration * @param newJobProperties Map to which new properties should be added */ private void addHBaseResources(Configuration jobConf, Map<String, String> newJobProperties) { Configuration conf = new Configuration(false); HBaseConfiguration.addHbaseResources(conf); for (Entry<String, String> entry : conf) { if (jobConf.get(entry.getKey()) == null) { newJobProperties.put(entry.getKey(), entry.getValue()); } } }
public static Map<String, String> initiateSparkConf(HiveConf hiveConf, String hiveSessionId) { Map<String, String> sparkConf = new HashMap<String, String>(); HBaseConfiguration.addHbaseResources(hiveConf);
public static Map<String, String> initiateSparkConf(HiveConf hiveConf) { Map<String, String> sparkConf = new HashMap<String, String>(); HBaseConfiguration.addHbaseResources(hiveConf);
/** * Utility method to add hbase-default.xml and hbase-site.xml properties to a new map * if they are not already present in the jobConf. * @param jobConf Job configuration * @param newJobProperties Map to which new properties should be added */ private void addHBaseResources(Configuration jobConf, Map<String, String> newJobProperties) { Configuration conf = new Configuration(false); HBaseConfiguration.addHbaseResources(conf); for (Map.Entry<String, String> entry : conf) { if (jobConf.get(entry.getKey()) == null) { newJobProperties.put(entry.getKey(), entry.getValue()); } } }
printHelpAndExit(e.getMessage(), getOptions()); final Configuration configuration = HBaseConfiguration.addHbaseResources(getConf()); connection = ConnectionUtil.getInputConnection(configuration); final String schemaName = cmdLine.getOptionValue(SCHEMA_NAME_OPTION.getOpt());
Connection connection = null; try { final Configuration configuration = HBaseConfiguration.addHbaseResources(getConf());
printHelpAndExit(e.getMessage(), getOptions()); final Configuration configuration = HBaseConfiguration.addHbaseResources(getConf()); final String schemaName = cmdLine.getOptionValue(SCHEMA_NAME_OPTION.getOpt()); final String dataTable = cmdLine.getOptionValue(DATA_TABLE_OPTION.getOpt());
/** * Creates a Configuration with HBase resources * @return a Configuration with HBase resources */ public static Configuration create() { Configuration conf = new Configuration(); return addHbaseResources(conf); }
/** * Instantinating HBaseConfiguration() is deprecated. Please use * HBaseConfiguration#create() to construct a plain Configuration */ @Deprecated public HBaseConfiguration() { //TODO:replace with private constructor, HBaseConfiguration should not extend Configuration super(); addHbaseResources(this); LOG.warn("instantiating HBaseConfiguration() is deprecated. Please use" + " HBaseConfiguration#create() to construct a plain Configuration"); }
/** * Instantiating HBaseConfiguration() is deprecated. Please use * HBaseConfiguration#create() to construct a plain Configuration * @deprecated Please use create() instead. */ @Deprecated public HBaseConfiguration() { //TODO:replace with private constructor, HBaseConfiguration should not extend Configuration super(); addHbaseResources(this); LOG.warn("instantiating HBaseConfiguration() is deprecated. Please use" + " HBaseConfiguration#create() to construct a plain Configuration"); }
/** * Creates a Configuration with HBase resources * @return a Configuration with HBase resources */ public static Configuration create() { Configuration conf = new Configuration(); // In case HBaseConfiguration is loaded from a different classloader than // Configuration, conf needs to be set with appropriate class loader to resolve // HBase resources. conf.setClassLoader(HBaseConfiguration.class.getClassLoader()); return addHbaseResources(conf); }
/** * Creates a Configuration with HBase resources * @return a Configuration with HBase resources */ public static Configuration create() { Configuration conf = new Configuration(); // In case HBaseConfiguration is loaded from a different classloader than // Configuration, conf needs to be set with appropriate class loader to resolve // HBase resources. conf.setClassLoader(HBaseConfiguration.class.getClassLoader()); return addHbaseResources(conf); }
@Override public void configureForMapReduce(Job job, PType<?> ptype, Path outputPath, String name) { Configuration conf = job.getConfiguration(); HBaseConfiguration.addHbaseResources(conf); conf.setStrings("io.serializations", conf.get("io.serializations"), KeyValueSerialization.class.getName()); super.configureForMapReduce(job, ptype, outputPath, name); }
@Override public void configureSource(Job job, int inputId) throws IOException { Configuration conf = job.getConfiguration(); job.setInputFormatClass(TableInputFormat.class); job.setMapperClass(CrunchMapper.class); HBaseConfiguration.addHbaseResources(conf); conf.set(TableInputFormat.INPUT_TABLE, table); conf.set(TableInputFormat.SCAN, convertScanToString(scan)); TableMapReduceUtil.addDependencyJars(job); }
@Override public void configureForMapReduce(Job job, PType<?> ptype, Path outputPath, String name) { Configuration conf = job.getConfiguration(); HBaseConfiguration.addHbaseResources(conf); job.setOutputFormatClass(TableOutputFormat.class); conf.set(TableOutputFormat.OUTPUT_TABLE, table); try { TableMapReduceUtil.addDependencyJars(job); } catch (IOException e) { throw new CrunchRuntimeException(e); } }
void copyHbaseConfToJobConf(Configuration jobConf, CredentialsProperties props) { // Create configuration using hbase-site.xml/hbase-default.xml Configuration hbaseConf = new Configuration(false); HBaseConfiguration.addHbaseResources(hbaseConf); // copy cred props to hbaseconf and override if values already exists addPropsConf(props, hbaseConf); // copy cred props to jobconf and override if values already exist addPropsConf(props, jobConf); // copy conf from hbaseConf to jobConf without overriding the // already existing values of jobConf injectConf(hbaseConf, jobConf); }
void copyHbaseConfToJobConf(Configuration jobConf, CredentialsProperties props) { // Create configuration using hbase-site.xml/hbase-default.xml Configuration hbaseConf = new Configuration(false); HBaseConfiguration.addHbaseResources(hbaseConf); // copy cred props to hbaseconf and override if values already exists addPropsConf(props, hbaseConf); // copy cred props to jobconf and override if values already exist addPropsConf(props, jobConf); // copy conf from hbaseConf to jobConf without overriding the // already existing values of jobConf injectConf(hbaseConf, jobConf); }
/** {@inheritDoc} */ @Override protected void setup() throws Exception { super.setup(); getConf().setInt(HConstants.ZOOKEEPER_CLIENT_PORT, mTargetURI.getZookeeperClientPort()); getConf().set(HConstants.ZOOKEEPER_QUORUM, Joiner.on(",").join(mTargetURI.getZookeeperQuorumOrdered())); setConf(HBaseConfiguration.addHbaseResources(getConf())); mHBaseAdmin = new HBaseAdmin(getConf()); }