* @return List<InputSplit> A list of splits
*/
@Override
public List<InputSplit> getSplits(JobContext context, int minSplitCountHint)
throws IOException, InterruptedException {
KeyFactory kFact = null;
try {
kFact = (KeyFactory) getKeyFactoryClass().newInstance();
} catch (InstantiationException e) {
LOG.error("Key factory was not instantiated. Please verify.");
LOG.error(e.getMessage());
e.printStackTrace();
} catch (IllegalAccessException e) {
LOG.error("Key factory was not instantiated. Please verify.");
LOG.error(e.getMessage());
e.printStackTrace();
}
String sKey = GIRAPH_GORA_START_KEY.get(getConf());
String eKey = GIRAPH_GORA_END_KEY.get(getConf());
if (sKey == null || sKey.isEmpty()) {
LOG.warn("No start key has been defined.");
LOG.warn("Querying all the data store.");
sKey = null;
eKey = null;
}
kFact.setDataStore(getDataStore());
setStartKey(kFact.buildKey(sKey));
setEndKey(kFact.buildKey(eKey));
QueryBase tmpQuery = GoraUtils.getQuery(
getDataStore(), getStartKey(), getEndKey());
tmpQuery.setConf(context.getConfiguration());
GORA_INPUT_FORMAT.setQuery(tmpQuery);
List<InputSplit> splits = GORA_INPUT_FORMAT.getSplits(context);