@Override public int getTupleEndOffset(int tupleIndex) { return IntSerDeUtils.getInt(array, tupleCountOffset - 4 * (tupleIndex + 1)); }
private int getPhysicalTupleCount() { return IntSerDeUtils.getInt(array, tupleCountOffset); }
@Override public int getTupleEndOffset(int tupleIndex) { return start + IntSerDeUtils.getInt(buffer.array(), tupleCountOffset - FrameConstants.SIZE_LEN * (tupleIndex + 1)); }
@Override public int getTupleStartOffset(int tupleIndex) { int offset = tupleIndex == 0 ? 0 : IntSerDeUtils.getInt(array, tupleCountOffset - 4 * tupleIndex); return Math.abs(offset); }
@Override public int getTupleStartOffset(int tupleIndex) { int offset = tupleIndex == 0 ? FrameConstants.TUPLE_START_OFFSET : IntSerDeUtils.getInt(buffer.array(), tupleCountOffset - 4 * tupleIndex); return start + offset; }
public static int deserializeNumOfMinFrame(ByteBuffer buffer, int start) { return IntSerDeUtils.getInt(buffer.array(), start + FrameConstants.META_DATA_FRAME_COUNT_OFFSET); }
private int getFreeDataEndOffset() { return tupleCount == 0 ? 0 : Math.abs(IntSerDeUtils.getInt(array, tupleCountOffset - tupleCount * 4)); }
@Override public int getTupleCount() { return IntSerDeUtils.getInt(buffer.array(), tupleCountOffset); }
private int getDeletedSpace() { return IntSerDeUtils.getInt(array, buffer.capacity() - SIZE_DELETED_SPACE); }
@Override public int getTupleStartOffset(int tupleIndex) { int offset = tupleIndex == 0 ? FrameConstants.TUPLE_START_OFFSET : IntSerDeUtils.getInt(getBuffer().array(), tupleCountOffset - 4 * tupleIndex); return offset; }
@Override public int getFieldStartOffset(int tupleIndex, int fIdx) { return fIdx == 0 ? 0 : IntSerDeUtils.getInt(buffer.array(), getTupleStartOffset(tupleIndex) + (fIdx - 1) * FrameConstants.SIZE_LEN); }
@Override public int getTupleEndOffset(int tupleIndex) { return IntSerDeUtils.getInt(getBuffer().array(), tupleCountOffset - 4 * (tupleIndex + 1)); }
@Override public int getFieldStartOffset(int tupleIndex, int fIdx) { return fIdx == 0 ? 0 : IntSerDeUtils.getInt(array, getTupleStartOffset(tupleIndex) + (fIdx - 1) * 4); }
@Override public int getFieldEndOffset(int tupleIndex, int fIdx) { return IntSerDeUtils.getInt(buffer.array(), getTupleStartOffset(tupleIndex) + fIdx * FrameConstants.SIZE_LEN); }
@Override public int getFieldEndOffset(int tupleIndex, int fIdx) { return IntSerDeUtils.getInt(array, getTupleStartOffset(tupleIndex) + fIdx * 4); }
@Override public int getFieldStartOffset(int tupleIndex, int fIdx) { return fIdx == 0 ? 0 : IntSerDeUtils.getInt(getBuffer().array(), getTupleStartOffset(tupleIndex) + (fIdx - 1) * 4); }
@Override public int getFieldEndOffset(int tupleIndex, int fIdx) { return IntSerDeUtils.getInt(getBuffer().array(), getTupleStartOffset(tupleIndex) + fIdx * 4); }
protected void reset(ByteBuffer buffer, boolean clear) { array = buffer.array(); if (clear) { IntSerDeUtils.putInt(array, FrameHelper.getTupleCountOffset(frame.getFrameSize()), 0); tupleCount = 0; tupleDataEndOffset = FrameConstants.TUPLE_START_OFFSET; } else { tupleCount = IntSerDeUtils.getInt(array, FrameHelper.getTupleCountOffset(frame.getFrameSize())); tupleDataEndOffset = tupleCount == 0 ? FrameConstants.TUPLE_START_OFFSET : IntSerDeUtils.getInt(array, FrameHelper.getTupleCountOffset(frame.getFrameSize()) - tupleCount * FrameConstants.SIZE_LEN); } }
/** * Cancels the lastly performed append operation. i.e. decreases the tuple count and resets the data end offset. */ @Override public boolean cancelAppend() throws HyracksDataException { // Decreases tupleCount by one. tupleCount = IntSerDeUtils.getInt(array, FrameHelper.getTupleCountOffset(frame.getFrameSize())); if (tupleCount == 0) { // There is no inserted tuple in the given frame. This should not happen. return false; } tupleCount = tupleCount - 1; // Resets tupleCount and DataEndOffset. IntSerDeUtils.putInt(array, FrameHelper.getTupleCountOffset(frame.getFrameSize()), tupleCount); tupleDataEndOffset = tupleCount == 0 ? FrameConstants.TUPLE_START_OFFSET : IntSerDeUtils.getInt(array, FrameHelper.getTupleCountOffset(frame.getFrameSize()) - tupleCount * FrameConstants.SIZE_LEN); return true; }
for (int f = 0; f < comparators.length; ++f) { int fIdx = sortFields[f]; int f1Start = fIdx == 0 ? 0 : IntSerDeUtils.getInt(b1, j1 + (fIdx - 1) * 4); int f1End = IntSerDeUtils.getInt(b1, j1 + fIdx * 4); int s1 = j1 + inputTupleAccessor.getFieldSlotsLength() + f1Start; int l1 = f1End - f1Start; int f2Start = fIdx == 0 ? 0 : IntSerDeUtils.getInt(b2, j2 + (fIdx - 1) * 4); int f2End = IntSerDeUtils.getInt(b2, j2 + fIdx * 4); int s2 = j2 + fta2.getFieldSlotsLength() + f2Start; int l2 = f2End - f2Start;