concept time in category hadoop

appears as: time, times, time, The time
Hadoop in Practice, Second Edition

This is an excerpt from Manning's book Hadoop in Practice, Second Edition.

Scalability and availability are also key traits of HDFS, achieved in part due to data replication and fault tolerance. HDFS replicates files for a configured number of times, is tolerant of both software and hardware failure, and automatically re-replicates data blocks on nodes that have failed.

Figure 4.5. Compression and decompression times for a single 100 MB text file (smaller values are better)
  • Interceptors, which provide the ability to modify or drop events. They are useful for annotating events with host, time, and unique identifiers, which are useful for deduplication.
  • If the timestamp isn’t set, then Camus will create a new timestamp at the time the wrapper is created. This timestamp and other metadata is used in Camus when determining the HDFS location of output records. You’ll see an example of this shortly.

    $ hadoop job -history <history file>
    
    Hadoop job: job_1398974791337_0037
    =====================================
    User: aholmes
    JobName: hip-2.0.0.jar
    JobConf: hdfs://localhost:8020/tmp/hadoop-yarn/...
    Submitted At: 11-May-2014 13:06:48
    Launched At: 11-May-2014 13:07:07 (19sec)
    Finished At: 11-May-2014 13:07:17 (10sec)
    Status: SUCCEEDED
    Counters:
    
    |Group Name  |Counter name                   |Map Value |Reduce |Total |
    -----------------------------------------------------------------------
    |File System |FILE: Number of bytes read      |0         |288       |288
    |File System |FILE: Number of bytes written   |242,236 |121,304 |363,540
    |File System |FILE: Number of read operations |0         |0         |0
    |File System |FILE: Number of write operations|0         |0         |0
    
    ...
    
    Task Summary
    ============================
    Kind  Total Successful Failed Killed StartTime FinishTime
    
    Setup   0 0 0 0
    Map     2 2 0 0  11-May-2014 13:07:09  11-May-2014 13:07:13
    Reduce  1 1 0 0  11-May-2014 13:07:15  11-May-2014 13:07:17
    ============================
    
    
    Analysis
    =========
    
    Time taken by best performing map task task_1398974791337_0037_m_000001:
      3sec
    Average time taken by map tasks: 3sec
    Worse performing map tasks:
    TaskId        Timetaken
    task_1398974791337_0037_m_000000 3sec
    task_1398974791337_0037_m_000001 3sec
    The last map task task_1398974791337_0037_m_000000 finished at
    
    (relative to the Job launch time): 11-May-2014 13:07:13 (5sec)
    
    Time taken by best performing shuffle task
    task_1398974791337_0037_r_000000: 1sec
    Average time taken by shuffle tasks: 1sec
    Worse performing shuffle tasks:
    TaskId        Timetaken
    task_1398974791337_0037_r_000000 1sec
    The last shuffle task task_1398974791337_0037_r_000000 finished at
    (relative to the Job launch time): 11-May-2014 13:07:17 (9sec)
    
    Time taken by best performing reduce task
    task_1398974791337_0037_r_000000: 0sec
    Average time taken by reduce tasks: 0sec
    Worse performing reduce tasks:
    TaskId        Timetaken
    task_1398974791337_0037_r_000000 0sec
    The last reduce task task_1398974791337_0037_r_000000 finished at
    (relative to the Job launch time): 11-May-2014 13:07:17 (10sec)
    =========
    Hadoop in Action

    This is an excerpt from Manning's book Hadoop in Action.

  • The output of all the mappers are (conceptually) aggregated into one giant list of <k2, v2> pairs. All pairs sharing the same k2 are grouped together into a new (key/value) pair, <k2, list(v2)>. The framework asks the reducer to process each one of these aggregated (key/value) pairs individually. Following our word counting example, the map output for one document may be a list with pair <"foo", 1> three times, and the map output for another document may be a list with pair <"foo", 1> twice. The aggregated pair the reducer will see is <"foo", list(1,1,1,1,1)>. In word counting, the output of our reducer is <"foo", 5>, which is the total number of times “foo” has occurred in our document set. Each reducer works on a different word. The MapReduce framework automatically collects all the <k3, v3> pairs and writes them to file(s). Note that for the word counting example, the data types k2 and k3 are the same and v2 and v3 are also the same. This will not always be the case for other data processing applications.
  • After running the previous example, we now have a data set that counts the number of citations for each patent. A neat exercise would be to count the counts. Let’s build a histogram of the citation counts. We expect a large number of patents to have been only cited once, and a small number may have been cited hundreds of times. It would be interesting to see the distribution of the citation counts.

    We can use any executable script that processes a line-oriented data stream from STDIN and outputs to STDOUT with Hadoop Streaming. For example, the Python script in listing 4.4 randomly samples data from STDIN. For those who don’t know Python, the program has a for loop that reads STDIN one line at a time. For each line, we choose a random integer between 1 and 100 and check against the user-given argument (sys.argv[1]). The comparison determines whether to pass that line on to the output or ignore it. You can use the script in Unix to uniformly sample a line-oriented data file, for example: