1, through the traditional Key-value class analysis data
When you create a key class, all keys inherit the Writablecomparable interface
public class Sendorkey implements Writablecomparable
{
Default Constructor+parameterized constructor
Implementation of ReadFields method
Implementation of Write method
Overriding the Compare to method
}
Sensorkey.java
Sensorvalue.java
"Note: The default constructor initializes the variable
Constructors with parameters initialize class variables with their parameter values
The default ReadFields method parameter is datainput, regardless of what the content is, we use the Readfield method to accept and pass the data entered into this class, regardless of the dataoutput content, the Write method will output the data
In the Compreto method logic, we will compare the different sensors
Each property contains a get and set method "
2, creating a customized Recordreader class (how to create a custom Recordreader Class)
"Note: The custom Recordreader will inherit the default Recordreader, his parameters when the custom Key,value type, in Nextkeyvalue, we get the current value from the reader that contains the full record. Records, the columns are split according to the TDB key, and the first three columns are assigned to the key class, and the value class is assigned a value of "
3.creating a customized InputFormat class
Java Program for MapReduce processing data