@Override
  protected void map(Text key, NullWritable value, Context context)
    throws IOException, InterruptedException {

    int recordIndex = Integer.parseInt(key.toString());

    // <6-characters-region-boundary-prefix>_<15-random-chars>_<record-index-for-this-mapper-task>
    final String toolEventId =
      String.format("%0" + Utility.SPLIT_PREFIX_LENGTH + "d", recordIndex % (splitCount + 1)) + "_"
        + EnvironmentEdgeManager.currentTime() + (1e14 + (random.nextFloat() * 9e13)) + "_"
        + recordIndex;
    final String eventId = String.valueOf(Math.abs(random.nextInt(MAX_EVENT_ID)));
    final String vechileId = String.valueOf(Math.abs(random.nextInt(MAX_VEHICLE_ID)));
    final String speed = String.valueOf(Math.abs(random.nextInt(MAX_SPEED_KPH)));
    final String location = LOCATION_KEYS.get(random.nextInt(NUM_LOCATIONS));
    final Pair<BigDecimal, BigDecimal> coordinates = LOCATIONS.get(location);
    final BigDecimal latitude = coordinates.getFirst();
    final BigDecimal longitude = coordinates.getSecond();

    final ImmutableBytesWritable hKey =
      new ImmutableBytesWritable(String.format("%s:%s", toolEventId, ORG_ID).getBytes());
    addKeyValue(context, hKey, Utility.TableColumnNames.ORG_ID, ORG_ID);
    addKeyValue(context, hKey, Utility.TableColumnNames.TOOL_EVENT_ID, toolEventId);
    addKeyValue(context, hKey, Utility.TableColumnNames.EVENT_ID, eventId);
    addKeyValue(context, hKey, Utility.TableColumnNames.VEHICLE_ID, vechileId);
    addKeyValue(context, hKey, Utility.TableColumnNames.SPEED, speed);
    addKeyValue(context, hKey, Utility.TableColumnNames.LATITUDE, latitude.toString());
    addKeyValue(context, hKey, Utility.TableColumnNames.LONGITUDE, longitude.toString());
    addKeyValue(context, hKey, Utility.TableColumnNames.LOCATION, location);
    addKeyValue(context, hKey, Utility.TableColumnNames.TIMESTAMP,
      String.valueOf(EnvironmentEdgeManager.currentTime()));

    context.getCounter(Counters.ROWS_GENERATED).increment(1);
  }
Generates a single record based on value set to the key by
{@link BulkDataGeneratorRecordReader#getCurrentKey()}.
{@link Utility.TableColumnNames#TOOL_EVENT_ID} is first part of row key. Keeping first
{@link Utility#SPLIT_PREFIX_LENGTH} characters as index of the record to be generated ensures
that records are equally distributed across all regions of the table since region boundaries
are generated in similar fashion. Check {@link Utility#createTable(Admin, String, int, Map)}
method for region split info.
@param key     - The key having index of next record to be generated
@param value   - Value associated with the key (not used)
@param context - Context of the mapper container
hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/util/bulkdatagenerator/BulkDataGeneratorMapper.java