Revision 52916
Added by Sandro La Bruzzo over 5 years ago
ScholexplorerMapper.java | ||
---|---|---|
25 | 25 |
private String dsName; |
26 | 26 |
private String dsId; |
27 | 27 |
private String dateOfCollection; |
28 |
private Text keyout; |
|
29 |
private Text valueOut; |
|
28 | 30 |
private Map<String, ScholExplorerConfiguration> configurationMap= new HashMap<>(); |
29 | 31 |
|
30 | 32 |
@Override |
... | ... | |
48 | 50 |
dsName = context.getConfiguration().get("dsName"); |
49 | 51 |
dsId = context.getConfiguration().get("dsId"); |
50 | 52 |
dateOfCollection = context.getConfiguration().get("dateOfCollection", DateUtils.now_ISO8601()); |
53 |
keyout = new Text(""); |
|
54 |
valueOut = new Text(""); |
|
51 | 55 |
|
52 | 56 |
|
53 | 57 |
} |
... | ... | |
58 | 62 |
final String inputJson =value.toString(); |
59 | 63 |
final JsonObject rootElement = parser.parse(inputJson).getAsJsonObject(); |
60 | 64 |
final List<AtomicAction> actions = ScholixToActions.generateActionsFromScholix(rootElement, configurationMap, setName,agent, factory, nsPrefix, dsName, dsId, dateOfCollection); |
61 |
|
|
62 |
|
|
63 |
// factory.createAtomicAction(); |
|
64 |
|
|
65 |
for(final AtomicAction action : actions) { |
|
66 |
keyout.set(action.getRowKey()); |
|
67 |
valueOut.set(action.toJSON()); |
|
68 |
context.write(keyout, valueOut); |
|
69 |
} |
|
65 | 70 |
} |
66 | 71 |
|
67 | 72 |
|
Also available in: Unified diff
implemented mapper writing