Revision 53546
Added by Sandro La Bruzzo over 5 years ago
CrossRefImportMapper.java | ||
---|---|---|
10 | 10 |
import org.apache.hadoop.mapreduce.Mapper; |
11 | 11 |
|
12 | 12 |
import java.io.IOException; |
13 |
import java.util.List; |
|
13 | 14 |
|
14 | 15 |
public class CrossRefImportMapper extends Mapper<LongWritable, Text, Text, Text> { |
15 | 16 |
|
... | ... | |
37 | 38 |
final String inputJson = value.toString(); |
38 | 39 |
final JsonObject rootElement = parser.parse(inputJson).getAsJsonObject(); |
39 | 40 |
try { |
40 |
final AtomicAction action = CrossRefToActions.generateActionsFromDump(rootElement, factory, setName, agent, invisible); |
|
41 |
|
|
42 |
keyout.set(action.getRowKey()); |
|
43 |
valueOut.set(action.toJSON()); |
|
44 |
context.write(keyout, valueOut); |
|
45 |
|
|
41 |
List<AtomicAction> atomicActions = DOIBoostToActions.generatePublicationActionsFromDump(rootElement, factory, setName, agent, invisible); |
|
42 |
if (atomicActions!= null) { |
|
43 |
for (AtomicAction action: atomicActions){ |
|
44 |
keyout.set(action.getRowKey()); |
|
45 |
valueOut.set(action.toJSON()); |
|
46 |
context.write(keyout, valueOut); |
|
47 |
} |
|
48 |
} |
|
46 | 49 |
} catch (Throwable e) { |
47 | 50 |
System.err.println(inputJson); |
48 | 51 |
throw e; |
Also available in: Unified diff
Change Mapper to implement DOIBoostToAction