import org.apache.hadoop.conf.Configuration; Configuration conf = new Configuration(); long maxRows = conf.getLong("input.max.rows", 0); System.out.println("Maximum rows: " + maxRows);
import org.apache.hadoop.conf.Configuration; Configuration conf = new Configuration(); long numMapTasks = conf.getLong("map.tasks", 1); System.out.println("Number of map tasks: " + numMapTasks);Here, we retrieve the value of "map.tasks" from the configuration and store it in the variable numMapTasks. If the parameter is not defined, the default value of 1 will be used. In both examples, we have used the getLong() method of the org.apache.hadoop.conf.Configuration class to retrieve configuration parameters from the Hadoop configuration.