// Send some status perodically
numMapRowsRead++;
if (((numMapRowsRead % heartbeatInterval) == 0) && (reporter != null))
reporter.progress();
HTree hashTable = mapJoinTables.get(alias);
MapJoinObjectKey keyMap = new MapJoinObjectKey(metadataKeyTag, key);
MapJoinObjectValue o = (MapJoinObjectValue)hashTable.get(keyMap);
ArrayList<ArrayList<Object>> res = null;
if (o == null) {
res = new ArrayList<ArrayList<Object>>();
}
else {
res = o.getObj();
}
res.add(value);
if (metadataValueTag[tag] == -1) {
metadataValueTag[tag] = nextVal++;
tableDesc valueTableDesc = conf.getValueTblDescs().get(tag);
SerDe valueSerDe = (SerDe)ReflectionUtils.newInstance(valueTableDesc.getDeserializerClass(), null);
valueSerDe.initialize(null, valueTableDesc.getProperties());
mapMetadata.put(Integer.valueOf(metadataValueTag[tag]),
new MapJoinObjectCtx(
ObjectInspectorUtils.getStandardObjectInspector(valueSerDe.getObjectInspector(),
ObjectInspectorCopyOption.WRITABLE),
valueSerDe));
}
// Construct externalizable objects for key and value
MapJoinObjectKey keyObj = new MapJoinObjectKey(metadataKeyTag, key);
MapJoinObjectValue valueObj = new MapJoinObjectValue(metadataValueTag[tag], res);
if (res.size() > 1)
hashTable.remove(keyObj);
// This may potentially increase the size of the hashmap on the mapper
if (res.size() > mapJoinRowsKey) {
LOG.warn("Number of values for a given key " + keyObj + " are " + res.size());
LOG.warn("used memory " + Runtime.getRuntime().totalMemory());
}
hashTable.put(keyObj, valueObj);
return;
}
// Add the value to the ArrayList
storage.get(alias).add(value);