|
@@ -245,8 +245,7 @@ public class StripedBlockUtil {
|
|
Arrays.sort(cpy);
|
|
Arrays.sort(cpy);
|
|
// full stripe is a stripe has at least dataBlkNum full cells.
|
|
// full stripe is a stripe has at least dataBlkNum full cells.
|
|
// lastFullStripeIdx is the index of the last full stripe.
|
|
// lastFullStripeIdx is the index of the last full stripe.
|
|
- int lastFullStripeIdx =
|
|
|
|
- (int) (cpy[cpy.length - dataBlkNum] / cellSize);
|
|
|
|
|
|
+ long lastFullStripeIdx = cpy[cpy.length - dataBlkNum] / cellSize;
|
|
return lastFullStripeIdx * stripeSize; // return the safeLength
|
|
return lastFullStripeIdx * stripeSize; // return the safeLength
|
|
// TODO: Include lastFullStripeIdx+1 stripe in safeLength, if there exists
|
|
// TODO: Include lastFullStripeIdx+1 stripe in safeLength, if there exists
|
|
// such a stripe (and it must be partial).
|
|
// such a stripe (and it must be partial).
|
|
@@ -271,9 +270,9 @@ public class StripedBlockUtil {
|
|
*/
|
|
*/
|
|
public static long offsetInBlkToOffsetInBG(int cellSize, int dataBlkNum,
|
|
public static long offsetInBlkToOffsetInBG(int cellSize, int dataBlkNum,
|
|
long offsetInBlk, int idxInBlockGroup) {
|
|
long offsetInBlk, int idxInBlockGroup) {
|
|
- int cellIdxInBlk = (int) (offsetInBlk / cellSize);
|
|
|
|
|
|
+ long cellIdxInBlk = offsetInBlk / cellSize;
|
|
return cellIdxInBlk * cellSize * dataBlkNum // n full stripes before offset
|
|
return cellIdxInBlk * cellSize * dataBlkNum // n full stripes before offset
|
|
- + idxInBlockGroup * cellSize // m full cells before offset
|
|
|
|
|
|
+ + (long)idxInBlockGroup * cellSize // m full cells before offset
|
|
+ offsetInBlk % cellSize; // partial cell
|
|
+ offsetInBlk % cellSize; // partial cell
|
|
}
|
|
}
|
|
|
|
|