@Override
  public void updateLength(SizedWritable<?> key, SizedWritable<?> value) throws IOException {
    key.length = keySerializer.getLength(key.v);
    value.length = valueSerializer.getLength(value.v);
    return;
  }
@Test
  public void testUpdateLength() throws IOException {
    Mockito.mock(DataOutputStream.class);

    int kvLength = 0;
    for (int i = 0; i < inputArraySize; i++) {
      key.reset(inputArray[i].key);
      value.reset(inputArray[i].value);
      serializer.updateLength(key, value);

      // verify whether the size increase
      Assert.assertTrue(key.length + value.length > kvLength);
      kvLength = key.length + value.length;
    }
  }