コード例 #1
0
 private void loadVarCharDataAddress() {
   DrillBuf buf = vector.getDataVector().getBuffer();
   checkBuf(buf);
   this.characterData = buf.memoryAddress();
   this.characterDataOriginal = buf.memoryAddress();
   this.characterDataMax = buf.memoryAddress() + buf.capacity();
 }
コード例 #2
0
 private void loadRepeatedOffsetAddress() {
   DrillBuf buf = vector.getOffsetVector().getBuffer();
   checkBuf(buf);
   this.repeatedOffset = buf.memoryAddress() + 4;
   this.repeatedOffsetOriginal = buf.memoryAddress() + 4;
   this.repeatedOffsetMax = buf.memoryAddress() + buf.capacity();
 }
コード例 #3
0
 private void loadVarCharOffsetAddress() {
   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();
 }
コード例 #4
0
 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);
 }
コード例 #5
0
ファイル: DrillBuf.java プロジェクト: mdaparte/drill
  private DrillBuf(
      BufferAllocator allocator,
      Accountor a,
      ByteBuf replacement,
      DrillBuf buffer,
      int index,
      int length,
      boolean root) {
    super(length);
    if (index < 0 || index > buffer.capacity() - length) {
      throw new IndexOutOfBoundsException(
          buffer.toString() + ".slice(" + index + ", " + length + ')');
    }

    this.length = length;
    writerIndex(length);

    this.b = replacement;
    this.addr = buffer.memoryAddress() + index;
    this.offset = index;
    this.acct = a;
    this.length = length;
    this.rootBuffer = root;
    this.allocator = allocator;
  }
コード例 #6
0
ファイル: XXHash.java プロジェクト: CloudLab-NEU/drill
  public static long hash64(long start, long end, DrillBuf buffer, long seed) {
    if (BoundsChecking.BOUNDS_CHECKING_ENABLED) {
      buffer.checkBytes((int) start, (int) end);
    }

    long s = buffer.memoryAddress() + start;
    long e = buffer.memoryAddress() + end;

    return hash64bytes(s, e, seed);
  }
コード例 #7
0
 public DrillBuf getManagedBuffer(int size) {
   DrillBuf newBuf = allocator.buffer(size, this);
   managedBuffers.put(newBuf.memoryAddress(), newBuf);
   return newBuf;
 }
コード例 #8
0
ファイル: DrillBuf.java プロジェクト: mdaparte/drill
 private static ByteBuf getUnderlying(DrillBuf b) {
   ByteBuf underlying = b.unwrap().unwrap();
   return underlying.slice((int) (b.memoryAddress() - underlying.memoryAddress()), b.length);
 }