use of org.apache.gora.query.impl.FileSplitPartitionQuery in project gora by apache.
the class FileBackedDataStoreBase method getPartitions.
@Override
public List<PartitionQuery<K, T>> getPartitions(Query<K, T> query) {
List<InputSplit> splits = null;
List<PartitionQuery<K, T>> queries = null;
try {
splits = GoraMapReduceUtils.getSplits(getConf(), inputPath);
queries = new ArrayList<>(splits.size());
for (InputSplit split : splits) {
queries.add(new FileSplitPartitionQuery<>(query, (FileSplit) split));
}
} catch (IOException ex) {
LOG.error(ex.getMessage(), ex);
}
return queries;
}
use of org.apache.gora.query.impl.FileSplitPartitionQuery in project gora by apache.
the class GoraInputFormat method setInputPath.
@SuppressWarnings({ "rawtypes" })
private void setInputPath(PartitionQuery<K, T> partitionQuery) throws IOException {
//if the data store is file based
if (partitionQuery instanceof FileSplitPartitionQuery) {
FileSplit split = ((FileSplitPartitionQuery<K, T>) partitionQuery).getSplit();
//set the input path to FileSplit's path.
((FileBackedDataStore) partitionQuery.getDataStore()).setInputPath(split.getPath().toString());
}
}
Aggregations