public long getOffsetAddr(){ return offsetVector.getBuffer().memoryAddress(); }
public long getOffsetAddr(){ return offsetVector.getBuffer().memoryAddress(); }
public long getOffsetAddr(){ return offsetVector.getBuffer().memoryAddress(); }
public long getOffsetAddr(){ return offsetVector.getBuffer().memoryAddress(); }
/** * Helper function to check for equality of bytes in two DrillBuffers * * @param left Left DrillBuf for comparison * @param lStart start offset in the buffer * @param lEnd end offset in the buffer * @param right Right DrillBuf for comparison * @param rStart start offset in the buffer * @param rEnd end offset in the buffer * @return 1 if left input is greater, -1 if left input is smaller, 0 otherwise */ public static final int equal(final DrillBuf left, int lStart, int lEnd, final DrillBuf right, int rStart, int rEnd){ rangeCheck(left, lStart, lEnd, right, rStart, rEnd); return memEqual(left.memoryAddress(), lStart, lEnd, right.memoryAddress(), rStart, rEnd); }
/** * Helper function to compare a set of bytes in two DrillBuffers. * * Function will check data before completing in the case that * * @param left Left DrillBuf to compare * @param lStart start offset in the buffer * @param lEnd end offset in the buffer * @param right Right DrillBuf to compare * @param rStart start offset in the buffer * @param rEnd end offset in the buffer * @return 1 if left input is greater, -1 if left input is smaller, 0 otherwise */ public static final int compare(final DrillBuf left, int lStart, int lEnd, final DrillBuf right, int rStart, int rEnd){ rangeCheck(left, lStart, lEnd, right, rStart, rEnd); return memcmp(left.memoryAddress(), lStart, lEnd, right.memoryAddress(), rStart, rEnd); }
/** * Helper function to compare a set of bytes in DrillBuf to a ByteArray. * * @param left Left DrillBuf for comparison purposes * @param lStart start offset in the buffer * @param lEnd end offset in the buffer * @param right second input to be compared * @param rStart start offset in the byte array * @param rEnd end offset in the byte array * @return 1 if left input is greater, -1 if left input is smaller, 0 otherwise */ public static final int compare(final DrillBuf left, int lStart, int lEnd, final byte[] right, int rStart, final int rEnd) { rangeCheck(left, lStart, lEnd); return memcmp(left.memoryAddress(), lStart, lEnd, right, rStart, rEnd); }
public ByteBuf setBytes(int index, ByteBuffer src, int srcIndex, int length) { if (src.isDirect()) { checkIndex(index, length); PlatformDependent.copyMemory(PlatformDependent.directBufferAddress(src) + srcIndex, this.memoryAddress() + index, length); } else { if (srcIndex == 0 && src.capacity() == length) { udle.setBytes(index + offset, src); } else { ByteBuffer newBuf = src.duplicate(); newBuf.position(srcIndex); newBuf.limit(srcIndex + length); udle.setBytes(index + offset, src); } } return this; }
public long getDataAddr() { return buffer.memoryAddress(); }
public static long hash64(long start, long end, DrillBuf buffer, long seed){ rangeCheck(buffer, (int)start, (int)end); long s = buffer.memoryAddress() + start; long e = buffer.memoryAddress() + end; return hash64bytes(s, e, seed); }
public long getOffsetAddr(){ return offsetVector.getBuffer().memoryAddress(); }
public long getOffsetAddr(){ return offsetVector.getBuffer().memoryAddress(); }
public long getOffsetAddr(){ return offsetVector.getBuffer().memoryAddress(); }
public long getOffsetAddr(){ return offsetVector.getBuffer().memoryAddress(); }
private void loadRepeatedOffsetAddress(){ @SuppressWarnings("resource") DrillBuf buf = vector.getOffsetVector().getBuffer(); checkBuf(buf); this.repeatedOffset = buf.memoryAddress() + 4; this.repeatedOffsetOriginal = buf.memoryAddress() + 4; this.repeatedOffsetMax = buf.memoryAddress() + buf.capacity(); }
private void loadVarCharDataAddress(){ @SuppressWarnings("resource") DrillBuf buf = vector.getDataVector().getBuffer(); checkBuf(buf); this.characterData = buf.memoryAddress(); this.characterDataOriginal = buf.memoryAddress(); this.characterDataMax = buf.memoryAddress() + buf.capacity(); }
private void loadVarCharOffsetAddress(){ @SuppressWarnings("resource") DrillBuf buf = vector.getDataVector().getOffsetVector().getBuffer(); checkBuf(buf); this.charLengthOffset = buf.memoryAddress() + 4; this.charLengthOffsetOriginal = buf.memoryAddress() + 4; // add four as offsets conceptually start at 1. (first item is 0..1) this.charLengthOffsetMax = buf.memoryAddress() + buf.capacity(); }
@Override public DrillBuf getManagedBuffer(int size) { DrillBuf newBuf = allocator.buffer(size, this); managedBuffers.put(newBuf.memoryAddress(), newBuf); return newBuf; } }
@Override public DrillBuf replace(DrillBuf old, int newSize) { if (managedBuffers.remove(old.memoryAddress()) == null) { throw new IllegalStateException("Tried to remove unmanaged buffer."); } old.release(1); return getManagedBuffer(newSize); }
public static long getDate(DrillBuf buf, int start, int end){ rangeCheck(buf, start, end); int[] dateFields = memGetDate(buf.memoryAddress(), start, end); return CHRONOLOGY.getDateTimeMillis(dateFields[0], dateFields[1], dateFields[2], 0); }