List of usage examples for org.apache.hadoop.conf Configuration setBoolean
public void setBoolean(String name, boolean value)
name
property to a boolean
. From source file:org.apache.ambari.servicemonitor.utils.DFSUtils.java
License:Apache License
/** * Take a configuration and add the parameters to make it blocking * * @param conf configuration to patch/* w ww. j av a 2 s . c o m*/ */ public static void makeDfsCallsNonBlocking(Configuration conf) { conf.setBoolean(DFS_CLIENT_RETRY_POLICY_ENABLED, false); conf.setInt(IPC_CLIENT_CONNECT_MAX_RETRIES, 0); }
From source file:org.apache.ambari.servicemonitor.utils.MonitorConfigHelper.java
License:Apache License
public static void enableWebProbe(Configuration conf, String url) { conf.setBoolean(WEB_PROBE_ENABLED, true); conf.set(MonitorKeys.WEB_PROBE_URL, url); }
From source file:org.apache.ambari.servicemonitor.utils.MonitorConfigHelper.java
License:Apache License
public static void enablePortPobe(Configuration conf, String host, int port) { conf.setBoolean(PORT_PROBE_ENABLED, true); conf.set(PORT_PROBE_HOST, host);/* ww w. j av a 2 s.c om*/ conf.setInt(PORT_PROBE_PORT, port); }
From source file:org.apache.ambari.servicemonitor.utils.MonitorConfigHelper.java
License:Apache License
/** * assumes filesystem is set/*from w ww .j a v a 2s. c o m*/ * @param conf * @param path */ public static void enableFSLsProbe(Configuration conf, String path) { conf.setBoolean(LS_PROBE_ENABLED, true); conf.set(LS_PROBE_PATH, path); }
From source file:org.apache.ambari.servicemonitor.utils.MonitorConfigHelper.java
License:Apache License
public static void enableJTProbe(Configuration conf, String jtURI) { conf.setBoolean(JT_PROBE_ENABLED, true); conf.set(MAPRED_JOB_TRACKER, jtURI); }
From source file:org.apache.apex.engine.YarnAppLauncherImpl.java
License:Apache License
private void setConfiguration(Configuration conf, String property, Object value) { if (value instanceof Integer) { conf.setInt(property, (Integer) value); } else if (value instanceof Boolean) { conf.setBoolean(property, (Boolean) value); } else if (value instanceof Long) { conf.setLong(property, (Long) value); } else if (value instanceof Float) { conf.setFloat(property, (Float) value); } else if (value instanceof Double) { conf.setDouble(property, (Double) value); } else {/*from w w w. ja v a 2 s .c o m*/ conf.set(property, value.toString()); } }
From source file:org.apache.avro.mapreduce.TestAvroKeyOutputFormat.java
License:Apache License
@Test public void testWithDeflateCodec() throws IOException { Configuration conf = new Configuration(); conf.setBoolean("mapred.output.compress", true); conf.setInt(org.apache.avro.mapred.AvroOutputFormat.DEFLATE_LEVEL_KEY, 3); testGetRecordWriter(conf, CodecFactory.deflateCodec(3)); }
From source file:org.apache.avro.mapreduce.TestAvroKeyOutputFormat.java
License:Apache License
@Test public void testWithSnappyCode() throws IOException { Configuration conf = new Configuration(); conf.setBoolean("mapred.output.compress", true); conf.set(AvroJob.CONF_OUTPUT_CODEC, DataFileConstants.SNAPPY_CODEC); testGetRecordWriter(conf, CodecFactory.snappyCodec()); }
From source file:org.apache.avro.mapreduce.TestAvroKeyOutputFormat.java
License:Apache License
@Test public void testWithBZip2Code() throws IOException { Configuration conf = new Configuration(); conf.setBoolean("mapred.output.compress", true); conf.set(AvroJob.CONF_OUTPUT_CODEC, DataFileConstants.BZIP2_CODEC); testGetRecordWriter(conf, CodecFactory.bzip2Codec()); }
From source file:org.apache.avro.mapreduce.TestAvroKeyOutputFormat.java
License:Apache License
@Test public void testWithDeflateCodeWithHadoopConfig() throws IOException { Configuration conf = new Configuration(); conf.setBoolean("mapred.output.compress", true); conf.set("mapred.output.compression.codec", "org.apache.hadoop.io.compress.DeflateCodec"); conf.setInt(org.apache.avro.mapred.AvroOutputFormat.DEFLATE_LEVEL_KEY, -1); }