/** * @param key * input key. * @return the ID of the first block that contains key >= input key. Or -1 * if no such block exists. */ public int lowerBound(RawComparable key) { if (comparator == null) { throw new RuntimeException("Cannot search in unsorted TFile"); } if (firstKey == null) { return -1; // not found } int ret = Utils.lowerBound(index, key, comparator); if (ret == index.size()) { return -1; } return ret; }
/** * Find the smallest Block index whose starting offset is greater than or * equal to the specified offset. * * @param offset * User-specific offset. * @return the index to the data Block if such block exists; or -1 * otherwise. */ public int getBlockIndexNear(long offset) { ArrayList<BlockRegion> list = dataIndex.getBlockRegionList(); int idx = Utils .lowerBound(list, new ScalarLong(offset), new ScalarComparator()); if (idx == list.size()) { return -1; } return idx; } }
/** * @param key * input key. * @return the ID of the first block that contains key >= input key. Or -1 * if no such block exists. */ public int lowerBound(RawComparable key) { if (comparator == null) { throw new RuntimeException("Cannot search in unsorted TFile"); } if (firstKey == null) { return -1; // not found } int ret = Utils.lowerBound(index, key, comparator); if (ret == index.size()) { return -1; } return ret; }
/** * @param key * input key. * @return the ID of the first block that contains key >= input key. Or -1 * if no such block exists. */ public int lowerBound(RawComparable key) { if (comparator == null) { throw new RuntimeException("Cannot search in unsorted TFile"); } if (firstKey == null) { return -1; // not found } int ret = Utils.lowerBound(index, key, comparator); if (ret == index.size()) { return -1; } return ret; }
/** * @param key * input key. * @return the ID of the first block that contains key >= input key. Or -1 * if no such block exists. */ public int lowerBound(RawComparable key) { if (comparator == null) { throw new RuntimeException("Cannot search in unsorted TFile"); } if (firstKey == null) { return -1; // not found } int ret = Utils.lowerBound(index, key, comparator); if (ret == index.size()) { return -1; } return ret; }
/** * @param key * input key. * @return the ID of the first block that contains key >= input key. Or -1 * if no such block exists. */ public int lowerBound(RawComparable key) { if (comparator == null) { throw new RuntimeException("Cannot search in unsorted TFile"); } if (firstKey == null) { return -1; // not found } int ret = Utils.lowerBound(index, key, comparator); if (ret == index.size()) { return -1; } return ret; }
/** * @param key * input key. * @return the ID of the first block that contains key >= input key. Or -1 * if no such block exists. */ public int lowerBound(RawComparable key) { if (comparator == null) { throw new RuntimeException("Cannot search in unsorted TFile"); } if (firstKey == null) { return -1; // not found } int ret = Utils.lowerBound(index, key, comparator); if (ret == index.size()) { return -1; } return ret; }
/** * @param key * input key. * @return the ID of the first block that contains key >= input key. Or -1 * if no such block exists. */ public int lowerBound(RawComparable key) { if (comparator == null) { throw new RuntimeException("Cannot search in unsorted TFile"); } if (firstKey == null) { return -1; // not found } int ret = Utils.lowerBound(index, key, comparator); if (ret == index.size()) { return -1; } return ret; }
/** * Find the smallest Block index whose starting offset is greater than or * equal to the specified offset. * * @param offset * User-specific offset. * @return the index to the data Block if such block exists; or -1 * otherwise. */ public int getBlockIndexNear(long offset) { ArrayList<BlockRegion> list = dataIndex.getBlockRegionList(); int idx = Utils .lowerBound(list, new ScalarLong(offset), new ScalarComparator()); if (idx == list.size()) { return -1; } return idx; } }
/** * Find the smallest Block index whose starting offset is greater than or * equal to the specified offset. * * @param offset * User-specific offset. * @return the index to the data Block if such block exists; or -1 * otherwise. */ public int getBlockIndexNear(long offset) { ArrayList<BlockRegion> list = dataIndex.getBlockRegionList(); int idx = Utils .lowerBound(list, new ScalarLong(offset), new ScalarComparator()); if (idx == list.size()) { return -1; } return idx; } }
/** * Find the smallest Block index whose starting offset is greater than or * equal to the specified offset. * * @param offset * User-specific offset. * @return the index to the data Block if such block exists; or -1 * otherwise. */ public int getBlockIndexNear(long offset) { ArrayList<BlockRegion> list = dataIndex.getBlockRegionList(); int idx = Utils .lowerBound(list, new ScalarLong(offset), new ScalarComparator()); if (idx == list.size()) { return -1; } return idx; } }
/** * Find the smallest Block index whose starting offset is greater than or * equal to the specified offset. * * @param offset * User-specific offset. * @return the index to the data Block if such block exists; or -1 * otherwise. */ public int getBlockIndexNear(long offset) { ArrayList<BlockRegion> list = dataIndex.getBlockRegionList(); int idx = Utils .lowerBound(list, new ScalarLong(offset), new ScalarComparator()); if (idx == list.size()) { return -1; } return idx; } }
/** * Find the smallest Block index whose starting offset is greater than or * equal to the specified offset. * * @param offset * User-specific offset. * @return the index to the data Block if such block exists; or -1 * otherwise. */ public int getBlockIndexNear(long offset) { ArrayList<BlockRegion> list = dataIndex.getBlockRegionList(); int idx = Utils .lowerBound(list, new ScalarLong(offset), new ScalarComparator()); if (idx == list.size()) { return -1; } return idx; } }
/** * Find the smallest Block index whose starting offset is greater than or * equal to the specified offset. * * @param offset * User-specific offset. * @return the index to the data Block if such block exists; or -1 * otherwise. */ public int getBlockIndexNear(long offset) { ArrayList<BlockRegion> list = dataIndex.getBlockRegionList(); int idx = Utils .lowerBound(list, new ScalarLong(offset), new ScalarComparator()); if (idx == list.size()) { return -1; } return idx; } }