What is IntWritable in MapReduce Hadoop

Viewing 2 reply threads
  • Author
    Posts
    • #6153
      DataFlair TeamDataFlair Team
      Spectator

      What is IntWritable in MapReduce Hadoop?
      What is the need of IntWritable?
      Why does Hadoop need IntWritable instead of int?

    • #6154
      DataFlair TeamDataFlair Team
      Spectator

      IntWritable is the Wrapper Class/Box Class in Hadoop similar to Integer Class in Java.
      IntWritable is the Hadoop flavour of Integer, which is optimized to provide serialization in Hadoop.
      Java Serialization is too big or too heavy for Hadoop, hence the box classes in Hadoop implements serialization through the Interface called Writable.

      Writable can serialize the object in a very light way.

    • #6156
      DataFlair TeamDataFlair Team
      Spectator

      IntWritable in Hadoop is similar to Integer in java. In hadoop we have interfaces such as

      Comparable —–> to compare two objects.
      Writable ——> writing the data to local disk in a serialization format
      WritableComparable ——> Combination of Comparable and Writable.

      So IntWritable is like Integer in Hadoop which is to be used for serialization. It is used to mention the datatype of argument in map method of mapper class and reduce method of reducer class.

Viewing 2 reply threads
  • You must be logged in to reply to this topic.