42 |
42 |
@Override
|
43 |
43 |
protected void setup(final Context context) throws IOException, InterruptedException {
|
44 |
44 |
final String json = context.getConfiguration().get(JobParams.INDEX_ENTITY_LINKS);
|
45 |
|
log.info(JobParams.INDEX_ENTITY_LINKS + ":\n" + json);
|
|
45 |
|
46 |
46 |
entityConfigTable = IndexConfig.load(json).getConfigMap();
|
47 |
47 |
|
48 |
48 |
schemaLocation = context.getConfiguration().get("oaf.schema.location");
|
49 |
|
log.info("schema location" + ":\n" + schemaLocation);
|
50 |
49 |
|
51 |
50 |
final String contextMap = context.getConfiguration().get("contextmap");
|
52 |
|
log.info("contextmap:\n" + contextMap);
|
53 |
51 |
try {
|
54 |
52 |
contextMapper = ContextMapper.fromXml(contextMap);
|
55 |
|
log.info("context map:\n" + contextMapper);
|
56 |
53 |
} catch (final DocumentException e) {
|
57 |
54 |
throw new RuntimeException("unable to parse contextMap: " + contextMap, e);
|
58 |
55 |
}
|
59 |
56 |
|
60 |
57 |
final String relClassJson = context.getConfiguration().get("relClasses");
|
61 |
|
log.info("relClassesJson:\n" + relClassJson);
|
62 |
58 |
relClasses = new RelClasses(relClassJson);
|
63 |
|
log.info("relClasses:\n" + relClasses);
|
64 |
59 |
|
65 |
60 |
String otherDsTypesUI = context.getConfiguration().get("ui.other.datasourcetypes");
|
66 |
|
log.info("ui.other.datasourcetypes:" + otherDsTypesUI);
|
67 |
61 |
otherDatasourceTypesUForUI = Sets.newHashSet(Splitter.on(",").trimResults().omitEmptyStrings().split(otherDsTypesUI));
|
68 |
|
log.info("ui.other.datasourcetypes parsed:" + otherDatasourceTypesUForUI);
|
69 |
62 |
}
|
70 |
63 |
|
71 |
64 |
@Override
|
... | ... | |
88 |
81 |
}
|
89 |
82 |
} catch (final OutOfMemoryError e) {
|
90 |
83 |
context.getCounter("error", e.getClass().getName()).increment(1);
|
91 |
|
log.error(String.format("memory error building entity\nid: '%s'\ncounters: %s", keyDecoder.getKey(), builder.getRelCounters()), e);
|
|
84 |
//log.error(String.format("memory error building entity\nid: '%s'\ncounters: %s", keyDecoder.getKey(), builder.getRelCounters()), e);
|
92 |
85 |
throw e;
|
93 |
86 |
}
|
94 |
87 |
} catch (final Exception e) {
|
removed useless logs, they might clog the cluster resources