/** * Create a range for the given split version of the dataset * * @param datasetId the dataset id * @param splitVersion the split version * @return a range which would contain all split ids for this dataset and the split version */ public static Range<DatasetSplitId> getSplitRange(EntityId datasetId, long splitVersion) { return getSplitRange(datasetId, splitVersion, splitVersion + 1); }
/** * Create a range for the current split version of the given dataset * * @param datasetConfig the dataset config * @return a range which would contain all split ids for this dataset and its current split version */ public static Range<DatasetSplitId> getCurrentSplitRange(DatasetConfig datasetConfig){ final long splitVersion = datasetConfig.getReadDefinition().getSplitVersion(); return getSplitRange(datasetConfig.getId(), splitVersion); }
public static FindByRange<DatasetSplitId> getSplitsRange(EntityId datasetId, long splitVersionId) { Range<DatasetSplitId> range = getSplitRange(datasetId, splitVersionId); return new FindByRange<DatasetSplitId>() .setStart(range.lowerEndpoint(), true) .setEnd(range.upperEndpoint(), false); }