validateQuery(query);
validateSplitSize(numSplits);
List<Query> splits = new ArrayList<Query>(numSplits);
List<Key> scatterKeys = getScatterKeys(numSplits, query, datastore);
Key lastKey = null;
for (Key nextKey : getSplitKey(scatterKeys, numSplits)) {
splits.add(createSplit(lastKey, nextKey, query));
lastKey = nextKey;
}
splits.add(createSplit(lastKey, null, query));