Search in sources :

Example 1 with HTraceConfiguration

use of org.apache.htrace.core.HTraceConfiguration in project hadoop by apache.

the class TestTraceUtils method testExtraConfig.

@Test
public void testExtraConfig() {
    String key = "test.extra.config";
    String oldValue = "old value";
    String newValue = "new value";
    Configuration conf = new Configuration();
    conf.set(TEST_PREFIX + key, oldValue);
    LinkedList<ConfigurationPair> extraConfig = new LinkedList<ConfigurationPair>();
    extraConfig.add(new ConfigurationPair(TEST_PREFIX + key, newValue));
    HTraceConfiguration wrapped = TraceUtils.wrapHadoopConf(TEST_PREFIX, conf, extraConfig);
    assertEquals(newValue, wrapped.get(key));
}
Also used : HTraceConfiguration(org.apache.htrace.core.HTraceConfiguration) Configuration(org.apache.hadoop.conf.Configuration) HTraceConfiguration(org.apache.htrace.core.HTraceConfiguration) LinkedList(java.util.LinkedList) ConfigurationPair(org.apache.hadoop.tracing.SpanReceiverInfo.ConfigurationPair) Test(org.junit.Test)

Example 2 with HTraceConfiguration

use of org.apache.htrace.core.HTraceConfiguration in project hadoop by apache.

the class TestTraceUtils method testWrappedHadoopConf.

@Test
public void testWrappedHadoopConf() {
    String key = "sampler";
    String value = "ProbabilitySampler";
    Configuration conf = new Configuration();
    conf.set(TEST_PREFIX + key, value);
    HTraceConfiguration wrapped = TraceUtils.wrapHadoopConf(TEST_PREFIX, conf);
    assertEquals(value, wrapped.get(key));
}
Also used : HTraceConfiguration(org.apache.htrace.core.HTraceConfiguration) Configuration(org.apache.hadoop.conf.Configuration) HTraceConfiguration(org.apache.htrace.core.HTraceConfiguration) Test(org.junit.Test)

Aggregations

Configuration (org.apache.hadoop.conf.Configuration)2 HTraceConfiguration (org.apache.htrace.core.HTraceConfiguration)2 Test (org.junit.Test)2 LinkedList (java.util.LinkedList)1 ConfigurationPair (org.apache.hadoop.tracing.SpanReceiverInfo.ConfigurationPair)1