Why hadoop uses default Longwritable or Intwritable

to create new topics or reply. | New User Registration

This topic contains 1 reply, has 2 voices, and was last updated by  Steve Loughran 1 year, 2 months ago.

  • Creator
  • #55417

    Hutashan Chandrakar

    Why hadoop uses default Longwritable or Intwritable ? Why Hadoop framework didnt use some other class to write.

Viewing 1 replies (of 1 total)

You must be to reply to this topic. | Create Account

  • Author
  • #55420

    Steve Loughran

    they’ve got two features that are relevant

    1. they have the “Writable” interface -they know how to write to a DataOutput stream and read from a DataInput stream -explicitly.
    2. they have their contents updates via the set() operation. This lets you reuse the same value, repeatedly, without creating new instances. It’s a lot more efficient if the same mapper or reducer is called repeatedly: you just create your instances of the writables in the constructor and reuse them

      In comparison, Java’s Serializable framework “magically” serializes objects -but it does it in a way that is a bit brittle and is generally impossible to read in values generated by older versions of a class. the Java Object stream is designed to send a graph of objects back -it has to remember every object reference pushed out already, and do the same on the way back. The writables are designed to be self contained.

Viewing 1 replies (of 1 total)
Hortonworks Data Platform
The Hortonworks Data Platform is a 100% open source distribution of Apache Hadoop that is truly enterprise grade having been built, tested and hardened with enterprise rigor.
Get started with Sandbox
Hortonworks Sandbox is a self-contained virtual machine with Apache Hadoop pre-configured alongside a set of hands-on, step-by-step Hadoop tutorials.
Modern Data Architecture
Tackle the challenges of big data. Hadoop integrates with existing EDW, RDBMS and MPP systems to deliver lower cost, higher capacity infrastructure.