kevin butty
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # TP1 BDA **Kevin Butikofer, Charles-Lewis Jaggi** **Groupe : L1 GrK** ## TASK 1 ### Running the sample programs ![](https://i.imgur.com/ZQlhYhM.png) ## TASK 2 ### EMR Console ![](https://i.imgur.com/VJMtmuo.png) ### Cost - ![](https://i.imgur.com/NMLEni7.png) - **Trois m4.large instance.** Le temps écoulé est de 9 minutes et on a utlisé 3 instances donc : -> $(0.06 + 3 * 0.2 )*(1/60 *9) = 0.099$ $ ### key-value pairs process ``` Job JOBID="job_202002281331_0001" FINISH_TIME="1582897008124" JOB_STATUS="SUCCESS" FINISHED_MAPS="215" FINISHED_REDUCES="7" FAILED_MAPS="3" FAILED_REDUCES="1" MAP_COUNTERS="{(org\.apache\.hadoop\.mapred\.FileInputFormat$Counter) (File Input Format Counters )[(BYTES_READ)(Bytes Read)(85543660)]} {(FileSystemCounters)(FileSystemCounters)[(FILE_BYTES_WRITTEN) (FILE_BYTES_WRITTEN)(12696448)][(HDFS_BYTES_READ) (HDFS_BYTES_READ)(24080)][(S3_BYTES_READ)(S3_BYTES_READ)(85543660)]} {(org\.apache\.hadoop\.mapred\.Task$Counter)(Map-Reduce Framework) [(COMBINE_INPUT_RECORDS)(Combine input records)(0)] [(COMBINE_OUTPUT_RECORDS)(Combine output records)(0)] [(COMMITTED_HEAP_BYTES)(Total committed heap usage \\(bytes\\))(211067863040)] [(CPU_MILLISECONDS)(CPU time spent \\(ms\\))(71800)] [(MAP_INPUT_BYTES)(Map input bytes)(651778167)] [(MAP_INPUT_RECORDS)(Map input records)(2831380)] [(MAP_OUTPUT_BYTES)(Map output bytes)(31031858)] [(MAP_OUTPUT_MATERIALIZED_BYTES)(Map output materialized bytes)(7017005)] [(MAP_OUTPUT_RECORDS)(Map output records)(2821078)] [(PHYSICAL_MEMORY_BYTES)(Physical memory \\(bytes\\) snapshot)(202894118912)] [(SPILLED_RECORDS)(Spilled Records)(2821078)] [(SPLIT_RAW_BYTES)(SPLIT_RAW_BYTES)(24080)] [(VIRTUAL_MEMORY_BYTES)(Virtual memory \\(bytes\\) snapshot)(442712690688)]} " REDUCE_COUNTERS="{(org\.apache\.hadoop\.mapred\.FileOutputFormat$Counter)(File Output Format Counters ) [(BYTES_WRITTEN)(Bytes Written)(387)]} {(FileSystemCounters)(FileSystemCounters) [(FILE_BYTES_READ)(FILE_BYTES_READ)(6991478)] [(FILE_BYTES_WRITTEN)(FILE_BYTES_WRITTEN)(7175154)] [(S3_BYTES_WRITTEN)(S3_BYTES_WRITTEN)(387)]} {(org\.apache\.hadoop\.mapred\.Task$Counter)(Map-Reduce Framework) [(COMBINE_INPUT_RECORDS)(Combine input records)(0)] [(COMBINE_OUTPUT_RECORDS)(Combine output records)(0)] [(COMMITTED_HEAP_BYTES)(Total committed heap usage \\(bytes\\))(1734868992)] [(CPU_MILLISECONDS)(CPU time spent \\(ms\\))(12240)] [(PHYSICAL_MEMORY_BYTES)(Physical memory \\(bytes\\) snapshot)(1247551488)] [(REDUCE_INPUT_GROUPS)(Reduce input groups)(43)] [(REDUCE_INPUT_RECORDS)(Reduce input records)(2821078)] [(REDUCE_OUTPUT_RECORDS)(Reduce output records)(43)] [(REDUCE_SHUFFLE_BYTES)(Reduce shuffle bytes)(7017005)] [(SPILLED_RECORDS)(Spilled Records)(2821078)] [(VIRTUAL_MEMORY_BYTES)(Virtual memory \\(bytes\\) snapshot)(14553698304)]}" COUNTERS="{(org\.apache\.hadoop\.mapred\.FileInputFormat$Counter)(File Input Format Counters ) [(BYTES_READ)(Bytes Read)(85543660)]} {(org\.apache\.hadoop\.mapred\.JobInProgress$Counter) (Job Counters )[(FALLOW_SLOTS_MILLIS_MAPS)(Total time spent by all maps waiting after reserving slots \\(ms\\))(0)] [(FALLOW_SLOTS_MILLIS_REDUCES) (Total time spent by all reduces waiting after reserving slots \\(ms\\)) (0)][(RACK_LOCAL_MAPS)(Rack-local map tasks)(218)][(SLOTS_MILLIS_MAPS)(SLOTS_MILLIS_MAPS)(947587)] [(SLOTS_MILLIS_REDUCES)(SLOTS_MILLIS_REDUCES)(460841)][(TOTAL_LAUNCHED_MAPS)(Launched map tasks)(218)] [(TOTAL_LAUNCHED_REDUCES)(Launched reduce tasks)(8)]} {(org\.apache\.hadoop\.mapred\.FileOutputFormat$Counter) (File Output Format Counters ) [(BYTES_WRITTEN)(Bytes Written)(387)]} {(FileSystemCounters)(FileSystemCounters)[(FILE_BYTES_READ)(FILE_BYTES_READ)(6991478)] [(FILE_BYTES_WRITTEN)(FILE_BYTES_WRITTEN)(19871602)][(HDFS_BYTES_READ)(HDFS_BYTES_READ)(24080)] [(S3_BYTES_READ)(S3_BYTES_READ)(85543660)][(S3_BYTES_WRITTEN)(S3_BYTES_WRITTEN)(387)]} {(org\.apache\.hadoop\.mapred\.Task$Counter) (Map-Reduce Framework) [(COMBINE_INPUT_RECORDS)(Combine input records)(0)] [(COMBINE_OUTPUT_RECORDS)(Combine output records)(0)] [(COMMITTED_HEAP_BYTES)(Total committed heap usage \\(bytes\\))(212802732032)] [(CPU_MILLISECONDS)(CPU time spent \\(ms\\))(84040)][(MAP_INPUT_BYTES)(Map input bytes)(651778167)] [(MAP_INPUT_RECORDS)(Map input records)(2831380)] [(MAP_OUTPUT_BYTES)(Map output bytes)(31031858)] [(MAP_OUTPUT_MATERIALIZED_BYTES)(Map output materialized bytes)(7017005)] [(MAP_OUTPUT_RECORDS)(Map output records)(2821078)] [(PHYSICAL_MEMORY_BYTES)(Physical memory \\(bytes\\) snapshot)(204141670400)] [(REDUCE_INPUT_GROUPS)(Reduce input groups)(43)][(REDUCE_INPUT_RECORDS)(Reduce input records)(2821078)] [(REDUCE_OUTPUT_RECORDS)(Reduce output records)(43)] [(REDUCE_SHUFFLE_BYTES)(Reduce shuffle bytes)(7017005)] [(SPILLED_RECORDS)(Spilled Records)(5642156)] [(SPLIT_RAW_BYTES)(SPLIT_RAW_BYTES)(24080)] [(VIRTUAL_MEMORY_BYTES)(Virtual memory \\(bytes\\) snapshot)(457266388992)]} ``` ``` [(MAP_INPUT_RECORDS)(Map input records)(2831380)] ``` Mappers Input : 2'831'380 ``` [(REDUCE_INPUT_RECORDS)(Reduce input records)(2821078)] ``` Reducers Input : 2'821'078 ### Temparture Chart ![](https://i.imgur.com/9YfjkNE.png) Overall highest temperature : 38.0° en 2003 ## Task 3 - La température de 22° a 56'530 occurences - La température minimal est de -25° et la température maximal est de 38° - La température qui a le plus d'occurence est 13° avec 114'613 ![](https://i.imgur.com/jWQUxNr.png) ### Mapper ```python= #!/usr/bin/env python # # histo_temperature_map.py - Calculate histogram temperature from NCDC Global # Hourly Data - Mapper part import re # import regular expressions import sys # import system-specific parameters and functions # loop through the input, line by line for line in sys.stdin: # remove leading and trailing whitespace val = line.strip() # extract values for year, temperature and quality indicator year = val[15:19] temp = val[87:92] q = val[92:93] # temperature is valid if not +9999 and quality indicator is # one of 0, 1, 4, 5 or 9 if (temp != "+9999" and re.match("[01459]", q)): print "%s" % (int(float(temp)/10)) ``` ### Reducer ```python= #!/usr/bin/env python # # histo_temperature_reduce.py - Calculate histogram temperature from NCDC Global # Hourly Data - Reducer part #import collections import sys last_val = None cpt = 0 # loop through the input, line by line for line in sys.stdin: # each line contains a key and a value separated by a tab character val = line.strip() # Hadoop has sorted the input by key, so we get the values # for the same key immediately one after the other. # Test if we just got a new key, in this case output the maximum # temperature for the previous key and reinitialize the variables. # If not, keep calculating the maximum temperature. if last_val and last_val != val: print "%s\t%s" % (last_val, cpt) cpt = 1 else: cpt += 1 last_val = val # we've reached the end of the file, output what is left if last_val: print "%s\t%s" % (last_val, cpt) ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully