org.apache.hadoop.streaming.Environment Java Examples

The following examples show how to use org.apache.hadoop.streaming.Environment. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TrAppReduce.java    From hadoop with Apache License 2.0 6 votes vote down vote up
void testParentJobConfToEnvVars() throws IOException
{
  env = new Environment();
  // test that some JobConf properties are exposed as expected     
  // Note the dots translated to underscore: 
  // property names have been escaped in PipeMapRed.safeEnvVarName()
  expect("mapreduce_jobtracker_address", "local");
  //expect("mapred_local_dir", "build/test/mapred/local");
  expectDefined("mapreduce_cluster_local_dir");
  expect("mapred_output_format_class", "org.apache.hadoop.mapred.TextOutputFormat");
  expect("mapreduce_job_output_key_class", "org.apache.hadoop.io.Text");
  expect("mapreduce_job_output_value_class", "org.apache.hadoop.io.Text");

  expect("mapreduce_task_ismap", "false");
  expectDefined("mapreduce_task_attempt_id");

  expectDefined("mapreduce_task_io_sort_factor");

  // the FileSplit context properties are not available in local hadoop..
  // so can't check them in this test.

}
 
Example #2
Source File: TrApp.java    From hadoop with Apache License 2.0 6 votes vote down vote up
void testParentJobConfToEnvVars() throws IOException
{
  env = new Environment();
  // test that some JobConf properties are exposed as expected     
  // Note the dots translated to underscore: 
  // property names have been escaped in PipeMapRed.safeEnvVarName()
  expectDefined("mapreduce_cluster_local_dir");
  expect("mapreduce_map_output_key_class", "org.apache.hadoop.io.Text");
  expect("mapreduce_map_output_value_class", "org.apache.hadoop.io.Text");

  expect("mapreduce_task_ismap", "true");
  expectDefined("mapreduce_task_attempt_id");

  expectDefined("mapreduce_map_input_file");
  expectDefined("mapreduce_map_input_length");

  expectDefined("mapreduce_task_io_sort_factor");

  // the FileSplit context properties are not available in local hadoop..
  // so can't check them in this test.

  // verify some deprecated properties appear for older stream jobs
  expect("map_input_file", env.getProperty("mapreduce_map_input_file"));
  expect("map_input_length", env.getProperty("mapreduce_map_input_length"));
}
 
Example #3
Source File: TrAppReduce.java    From big-c with Apache License 2.0 6 votes vote down vote up
void testParentJobConfToEnvVars() throws IOException
{
  env = new Environment();
  // test that some JobConf properties are exposed as expected     
  // Note the dots translated to underscore: 
  // property names have been escaped in PipeMapRed.safeEnvVarName()
  expect("mapreduce_jobtracker_address", "local");
  //expect("mapred_local_dir", "build/test/mapred/local");
  expectDefined("mapreduce_cluster_local_dir");
  expect("mapred_output_format_class", "org.apache.hadoop.mapred.TextOutputFormat");
  expect("mapreduce_job_output_key_class", "org.apache.hadoop.io.Text");
  expect("mapreduce_job_output_value_class", "org.apache.hadoop.io.Text");

  expect("mapreduce_task_ismap", "false");
  expectDefined("mapreduce_task_attempt_id");

  expectDefined("mapreduce_task_io_sort_factor");

  // the FileSplit context properties are not available in local hadoop..
  // so can't check them in this test.

}
 
Example #4
Source File: TrApp.java    From big-c with Apache License 2.0 6 votes vote down vote up
void testParentJobConfToEnvVars() throws IOException
{
  env = new Environment();
  // test that some JobConf properties are exposed as expected     
  // Note the dots translated to underscore: 
  // property names have been escaped in PipeMapRed.safeEnvVarName()
  expectDefined("mapreduce_cluster_local_dir");
  expect("mapreduce_map_output_key_class", "org.apache.hadoop.io.Text");
  expect("mapreduce_map_output_value_class", "org.apache.hadoop.io.Text");

  expect("mapreduce_task_ismap", "true");
  expectDefined("mapreduce_task_attempt_id");

  expectDefined("mapreduce_map_input_file");
  expectDefined("mapreduce_map_input_length");

  expectDefined("mapreduce_task_io_sort_factor");

  // the FileSplit context properties are not available in local hadoop..
  // so can't check them in this test.

  // verify some deprecated properties appear for older stream jobs
  expect("map_input_file", env.getProperty("mapreduce_map_input_file"));
  expect("map_input_length", env.getProperty("mapreduce_map_input_length"));
}
 
Example #5
Source File: TrAppReduce.java    From RDFS with Apache License 2.0 6 votes vote down vote up
void testParentJobConfToEnvVars() throws IOException
{
  env = new Environment();
  // test that some JobConf properties are exposed as expected     
  // Note the dots translated to underscore: 
  // property names have been escaped in PipeMapRed.safeEnvVarName()
  expect("mapred_job_tracker", "local");
  //expect("mapred_local_dir", "build/test/mapred/local");
  expectDefined("mapred_local_dir");
  expect("mapred_output_format_class", "org.apache.hadoop.mapred.TextOutputFormat");
  expect("mapred_output_key_class", "org.apache.hadoop.io.Text");
  expect("mapred_output_value_class", "org.apache.hadoop.io.Text");

  expect("mapred_task_is_map", "false");
  expectDefined("mapred_task_id");

  expectDefined("io_sort_factor");

  // the FileSplit context properties are not available in local hadoop..
  // so can't check them in this test.

}
 
Example #6
Source File: TrApp.java    From RDFS with Apache License 2.0 6 votes vote down vote up
void testParentJobConfToEnvVars() throws IOException
{
  env = new Environment();
  // test that some JobConf properties are exposed as expected     
  // Note the dots translated to underscore: 
  // property names have been escaped in PipeMapRed.safeEnvVarName()
  expectDefined("mapred_local_dir");
  expect("mapred_output_format_class", "org.apache.hadoop.mapred.TextOutputFormat");
  expect("mapred_output_key_class", "org.apache.hadoop.io.Text");
  expect("mapred_output_value_class", "org.apache.hadoop.io.Text");

  expect("mapred_task_is_map", "true");
  expectDefined("mapred_task_id");

  expectDefined("map_input_file");
  expectDefined("map_input_length");

  expectDefined("io_sort_factor");

  // the FileSplit context properties are not available in local hadoop..
  // so can't check them in this test.

}
 
Example #7
Source File: TrAppReduce.java    From hadoop-gpu with Apache License 2.0 6 votes vote down vote up
void testParentJobConfToEnvVars() throws IOException
{
  env = new Environment();
  // test that some JobConf properties are exposed as expected     
  // Note the dots translated to underscore: 
  // property names have been escaped in PipeMapRed.safeEnvVarName()
  expect("mapred_job_tracker", "local");
  //expect("mapred_local_dir", "build/test/mapred/local");
  expectDefined("mapred_local_dir");
  expect("mapred_output_format_class", "org.apache.hadoop.mapred.TextOutputFormat");
  expect("mapred_output_key_class", "org.apache.hadoop.io.Text");
  expect("mapred_output_value_class", "org.apache.hadoop.io.Text");

  expect("mapred_task_is_map", "false");
  expectDefined("mapred_task_id");

  expectDefined("io_sort_factor");

  // the FileSplit context properties are not available in local hadoop..
  // so can't check them in this test.

}
 
Example #8
Source File: TrApp.java    From hadoop-gpu with Apache License 2.0 6 votes vote down vote up
void testParentJobConfToEnvVars() throws IOException
{
  env = new Environment();
  // test that some JobConf properties are exposed as expected     
  // Note the dots translated to underscore: 
  // property names have been escaped in PipeMapRed.safeEnvVarName()
  expect("mapred_job_tracker", "local");
  //expect("mapred_local_dir", "build/test/mapred/local");
  expectDefined("mapred_local_dir");
  expect("mapred_output_format_class", "org.apache.hadoop.mapred.TextOutputFormat");
  expect("mapred_output_key_class", "org.apache.hadoop.io.Text");
  expect("mapred_output_value_class", "org.apache.hadoop.io.Text");

  expect("mapred_task_is_map", "true");
  expectDefined("mapred_task_id");

  expectDefined("map_input_file");
  expect("map_input_start", "0");
  expectDefined("map_input_length");

  expectDefined("io_sort_factor");

  // the FileSplit context properties are not available in local hadoop..
  // so can't check them in this test.

}
 
Example #9
Source File: TrApp.java    From RDFS with Apache License 2.0 5 votes vote down vote up
void testParentJobConfToEnvVars() throws IOException
{
  env = new Environment();
  // test that some JobConf properties are exposed as expected     
  // Note the dots translated to underscore: 
  // property names have been escaped in PipeMapRed.safeEnvVarName()
  expect("mapred_input_format_class", "org.apache.hadoop.mapred.TextInputFormat");
  expect("mapred_job_tracker", "local");
  //expect("mapred_local_dir", "build/test/mapred/local");
  expectDefined("mapred_local_dir");
  expect("mapred_output_format_class", "org.apache.hadoop.mapred.TextOutputFormat");
  expect("mapred_output_key_class", "org.apache.hadoop.io.Text");
  expect("mapred_output_value_class", "org.apache.hadoop.io.Text");

  expect("mapred_task_is_map", "true");
  expectDefined("mapred_task_id");

  expectDefined("map_input_file");
  expect("map_input_start", "0");
  expectDefined("map_input_length");

  expectDefined("io_sort_factor");

  // the FileSplit context properties are not available in local hadoop..
  // so can't check them in this test.

}