当前位置: 首页>>代码示例>>Java>>正文


Java PlatformDependent.getLong方法代码示例

本文整理汇总了Java中io.netty.util.internal.PlatformDependent.getLong方法的典型用法代码示例。如果您正苦于以下问题:Java PlatformDependent.getLong方法的具体用法?Java PlatformDependent.getLong怎么用?Java PlatformDependent.getLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.netty.util.internal.PlatformDependent的用法示例。


在下文中一共展示了PlatformDependent.getLong方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: accumulate

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
public void accumulate(final long memoryAddr, final int count) {
  final long maxMemAddr = memoryAddr + count * 4;
  List<ArrowBuf> buffers = getInput().getFieldBuffers();
  final long incomaxgBit = buffers.get(0).memoryAddress();
  final long incomaxgValue = buffers.get(1).memoryAddress();
  final long[] bitAddresses = this.bitAddresses;
  final long[] valueAddresses = this.valueAddresses;

  int incomaxgIndex = 0;
  for(long ordinalAddr = memoryAddr; ordinalAddr < maxMemAddr; ordinalAddr += 4, incomaxgIndex++){

    final long newVal = PlatformDependent.getLong(incomaxgValue + (incomaxgIndex * WIDTH));
    final int tableIndex = PlatformDependent.getInt(ordinalAddr);
    int chunkIndex = tableIndex >>> LBlockHashTable.BITS_IN_CHUNK;
    int chunkOffset = tableIndex & LBlockHashTable.CHUNK_OFFSET_MASK;
    final long maxAddr = valueAddresses[chunkIndex] + (chunkOffset) * 8;
    final long bitUpdateAddr = bitAddresses[chunkIndex] + ((chunkOffset >>> 5) * 4);
    final int bitVal = (PlatformDependent.getByte(incomaxgBit + ((incomaxgIndex >>> 3))) >>> (incomaxgIndex & 7)) & 1;
    final int bitUpdateVal = bitVal << (chunkOffset & 31);
    PlatformDependent.putLong(maxAddr, max(PlatformDependent.getLong(maxAddr), newVal, bitVal));
    PlatformDependent.putInt(bitUpdateAddr, PlatformDependent.getInt(bitUpdateAddr) | bitUpdateVal);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:24,代码来源:MaxAccumulators.java

示例2: accumulate

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
public void accumulate(final long memoryAddr, final int count) {
  final long maxAddr = memoryAddr + count * 4;
  List<ArrowBuf> buffers = getInput().getFieldBuffers();
  final long incomingBit = buffers.get(0).memoryAddress();
  final long incomingValue = buffers.get(1).memoryAddress();
  final long[] valueAddresses = this.valueAddresses;

  int incomingIndex = 0;
  for(long ordinalAddr = memoryAddr; ordinalAddr < maxAddr; ordinalAddr += 4, incomingIndex++){
    final int bitVal = (PlatformDependent.getByte(incomingBit + ((incomingIndex >>> 3))) >>> (incomingIndex & 7)) & 1;
    final long newVal = PlatformDependent.getLong(incomingValue + (incomingIndex * WIDTH)) * bitVal;
    final int tableIndex = PlatformDependent.getInt(ordinalAddr);
    final long sumAddr = valueAddresses[tableIndex >>> LBlockHashTable.BITS_IN_CHUNK] + (tableIndex & LBlockHashTable.CHUNK_OFFSET_MASK) * 8;
    PlatformDependent.putLong(sumAddr, PlatformDependent.getLong(sumAddr) + newVal);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:17,代码来源:SumZeroAccumulators.java

示例3: accumulate

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
public void accumulate(final long memoryAddr, final int count) {
  final long maxAddr = memoryAddr + count * 4;
  List<ArrowBuf> buffers = getInput().getFieldBuffers();
  final long incomingBit = buffers.get(0).memoryAddress();
  final long incomingValue = buffers.get(1).memoryAddress();
  final long[] bitAddresses = this.bitAddresses;
  final long[] valueAddresses = this.valueAddresses;

  int incomingIndex = 0;
  for(long ordinalAddr = memoryAddr; ordinalAddr < maxAddr; ordinalAddr += 4, incomingIndex++){

    final long newVal = PlatformDependent.getLong(incomingValue + (incomingIndex * WIDTH));
    final int tableIndex = PlatformDependent.getInt(ordinalAddr);
    int chunkIndex = tableIndex >>> LBlockHashTable.BITS_IN_CHUNK;
    int chunkOffset = tableIndex & LBlockHashTable.CHUNK_OFFSET_MASK;
    final long minAddr = valueAddresses[chunkIndex] + (chunkOffset) * 8;
    final long bitUpdateAddr = bitAddresses[chunkIndex] + ((chunkOffset >>> 5) * 4);
    final int bitVal = (PlatformDependent.getByte(incomingBit + ((incomingIndex >>> 3))) >>> (incomingIndex & 7)) & 1;
    final int bitUpdateVal = bitVal << (chunkOffset & 31);
    PlatformDependent.putLong(minAddr, min(PlatformDependent.getLong(minAddr), newVal, bitVal));
    PlatformDependent.putInt(bitUpdateAddr, PlatformDependent.getInt(bitUpdateAddr) | bitUpdateVal);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:24,代码来源:MinAccumulators.java

示例4: accumulate

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
public void accumulate(final long memoryAddr, final int count) {
  final long maxAddr = memoryAddr + count * 4;
  List<ArrowBuf> buffers = getInput().getFieldBuffers();
  final long incomingBit = buffers.get(0).memoryAddress();
  final long incomingValue = buffers.get(1).memoryAddress();
  final long[] bitAddresses = this.bitAddresses;
  final long[] valueAddresses = this.valueAddresses;

  int incomingIndex = 0;
  for(long ordinalAddr = memoryAddr; ordinalAddr < maxAddr; ordinalAddr += 4, incomingIndex++){
    final int bitVal = (PlatformDependent.getByte(incomingBit + ((incomingIndex >>> 3))) >>> (incomingIndex & 7)) & 1;
    final long newVal = PlatformDependent.getLong(incomingValue + (incomingIndex * WIDTH)) * bitVal;
    final int tableIndex = PlatformDependent.getInt(ordinalAddr);
    int chunkIndex = tableIndex >>> LBlockHashTable.BITS_IN_CHUNK;
    int chunkOffset = tableIndex & LBlockHashTable.CHUNK_OFFSET_MASK;
    final long sumAddr = valueAddresses[chunkIndex] + (chunkOffset) * 8;
    final long bitUpdateAddr = bitAddresses[chunkIndex] + ((chunkOffset >>> 5) * 4);
    final int bitUpdateVal = bitVal << (chunkOffset & 31);
    PlatformDependent.putLong(sumAddr, PlatformDependent.getLong(sumAddr) + newVal);
    PlatformDependent.putInt(bitUpdateAddr, PlatformDependent.getInt(bitUpdateAddr) | bitUpdateVal);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:23,代码来源:SumAccumulators.java

示例5: memEqual

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
private static final int memEqual(final long laddr, int lStart, int lEnd, final long raddr, int rStart,
    final int rEnd) {

  int n = lEnd - lStart;
  if (n == rEnd - rStart) {
    long lPos = laddr + lStart;
    long rPos = raddr + rStart;

    while (n > 7) {
      long leftLong = PlatformDependent.getLong(lPos);
      long rightLong = PlatformDependent.getLong(rPos);
      if (leftLong != rightLong) {
        return 0;
      }
      lPos += 8;
      rPos += 8;
      n -= 8;
    }
    while (n-- != 0) {
      byte leftByte = PlatformDependent.getByte(lPos);
      byte rightByte = PlatformDependent.getByte(rPos);
      if (leftByte != rightByte) {
        return 0;
      }
      lPos++;
      rPos++;
    }
    return 1;
  } else {
    return 0;
  }
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:33,代码来源:ByteFunctionHelpers.java

示例6: unpivotBytes8

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
public static void unpivotBytes8(final long srcFixedAddr, final int blockWidth, final long target, final int byteOffset, int count) {
  final long startAddr = srcFixedAddr;
  long maxAddr = startAddr + (count * blockWidth);
  long targetAddr = target;

  for(long srcAddr = startAddr; srcAddr < maxAddr; srcAddr += blockWidth, targetAddr+=8){
    final long value = PlatformDependent.getLong(srcAddr + byteOffset);
    PlatformDependent.putLong(targetAddr, value);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:11,代码来源:Unpivots.java

示例7: copy

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
@Override
public void copy(long sv4Addr, int count) {
  final Reallocator realloc = this.realloc;

  final long maxSV4 = sv4Addr + count * STEP_SIZE;
  final long srcOffsetAddrs[] = this.srcOffsetAddrs;
  final long srcDataAddrs[] = this.srcDataAddrs;

  targetAlt.allocateNew(AVG_VAR_WIDTH * count, count);
  long dstOffsetAddr = target.getFieldBuffers().get(OFFSET_BUFFER_ORDINAL).memoryAddress() + 4;
  long initDataAddr = realloc.addr();
  long curDataAddr = realloc.addr();
  long maxDataAddr = realloc.max();
  int lastOffset = 0;

  for(; sv4Addr < maxSV4; sv4Addr += STEP_SIZE, dstOffsetAddr += 4){
    final int batchNOFF = PlatformDependent.getInt(sv4Addr);
    final int batchNumber =  batchNOFF >>> BATCH_BITS;
    final int batchOffset = batchNOFF & MAX_BATCH;

    final long startAndEnd = PlatformDependent.getLong(srcOffsetAddrs[batchNumber] + batchOffset * 4);
    final int firstOffset = (int) startAndEnd;
    final int secondOffset = (int) (startAndEnd >> 32);
    final int len = secondOffset - firstOffset;
    if(curDataAddr + len > maxDataAddr){
      initDataAddr = realloc.ensure(lastOffset + len);
      curDataAddr = initDataAddr + lastOffset;
      maxDataAddr = realloc.max();
    }

    lastOffset += len;
    PlatformDependent.putInt(dstOffsetAddr, lastOffset);
    com.dremio.sabot.op.common.ht2.Copier.copy(srcDataAddrs[batchNumber] + firstOffset, curDataAddr, len);
    curDataAddr += len;
  }

  realloc.setCount(count);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:39,代码来源:FieldBufferCopier4.java

示例8: copy

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
@Override
public void copy(long srcAddr, int count) {
  final Reallocator realloc = this.realloc;

  final long maxSrcAddr = srcAddr + count * BUILD_RECORD_LINK_SIZE;
  final long srcOffsetAddrs[] = this.srcOffsetAddrs;
  final long srcDataAddrs[] = this.srcDataAddrs;

  targetAlt.allocateNew(AVG_VAR_WIDTH * count, count);
  long dstOffsetAddr = target.getFieldBuffers().get(OFFSET_BUFFER_ORDINAL).memoryAddress() + 4;
  long initDataAddr = realloc.addr();
  long curDataAddr = realloc.addr();
  long maxDataAddr = realloc.max();
  int lastOffset = 0;

  for(; srcAddr < maxSrcAddr; srcAddr += BUILD_RECORD_LINK_SIZE, dstOffsetAddr += 4){
    final int batchIndex = PlatformDependent.getInt(srcAddr);
    final int batchOffset = PlatformDependent.getShort(srcAddr+ 4);

    final long startAndEnd = PlatformDependent.getLong(srcOffsetAddrs[batchIndex] + batchOffset * 4);
    final int firstOffset = (int) startAndEnd;
    final int secondOffset = (int) (startAndEnd >> 32);
    final int len = secondOffset - firstOffset;
    if(curDataAddr + len > maxDataAddr){
      initDataAddr = realloc.ensure(lastOffset + len);
      curDataAddr = initDataAddr + lastOffset;
      maxDataAddr = realloc.max();
    }

    lastOffset += len;
    PlatformDependent.putInt(dstOffsetAddr, lastOffset);
    com.dremio.sabot.op.common.ht2.Copier.copy(srcDataAddrs[batchIndex] + firstOffset, curDataAddr, len);
    curDataAddr += len;
  }

  realloc.setCount(count);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:38,代码来源:FieldBufferCopier6.java

示例9: memEqual

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
private static final boolean memEqual(final long laddr, final long raddr, int len) {
  int n = len;
  long lPos = laddr;
  long rPos = raddr;

  while (n > 7) {
    long leftLong = PlatformDependent.getLong(lPos);
    long rightLong = PlatformDependent.getLong(rPos);
    if (leftLong != rightLong) {
      return false;
    }
    lPos += 8;
    rPos += 8;
    n -= 8;
  }
  while (n > 3) {
    int leftInt = PlatformDependent.getInt(lPos);
    int rightInt = PlatformDependent.getInt(rPos);
    if (leftInt != rightInt) {
      return false;
    }
    lPos += 4;
    rPos += 4;
    n -= 4;
  }
  while (n-- != 0) {
    byte leftByte = PlatformDependent.getByte(lPos);
    byte rightByte = PlatformDependent.getByte(rPos);
    if (leftByte != rightByte) {
      return false;
    }
    lPos++;
    rPos++;
  }
  return true;
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:37,代码来源:LBlockHashTable.java

示例10: getLong

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
@Override
public long getLong(int index) {
  chk(index, 8);
  long v = PlatformDependent.getLong(addr(index));
  return v;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:7,代码来源:DrillBuf.java

示例11: getLong

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
@Override
    public long getLong(int index) {
//        wrapped.checkIndex(index, 8);
        long v = PlatformDependent.getLong(addr(index));
        return v;
    }
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:7,代码来源:UnsafeDirectLittleEndian.java

示例12: getOrInsert

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
private final int getOrInsert(long key, boolean insertNew) {

    long free = this.freeValue;

    int index;
    long cur;
    final int capacityMask = this.capacityMask;
    index = SeparateKVLongKeyMixing.mix(key) & capacityMask;
    int chunkIndex = index >>> BITS_IN_CHUNK;
    int valueIndex = (index & CHUNK_OFFSET_MASK);
    long addr = tableFixedAddresses[chunkIndex] + (valueIndex * BLOCK_WIDTH);

    keyAbsent:
    if ((cur = PlatformDependent.getLong(addr)) != free) {
        if (cur == key) {
          return PlatformDependent.getInt(addr + KEY_WIDTH);
        } else {
          while (true) {
              index = (index - 1) & capacityMask;
              chunkIndex = index >>> BITS_IN_CHUNK;
              valueIndex = (index & CHUNK_OFFSET_MASK);
              addr = tableFixedAddresses[chunkIndex] + (valueIndex * BLOCK_WIDTH);

              if ((cur = PlatformDependent.getLong(addr)) == free) {
                break keyAbsent;
              } else if (cur == key) {
                return PlatformDependent.getInt(addr + KEY_WIDTH);
              }
            }
        }
    }


    if(!insertNew){
      return -1;
    } else {

      int insertedOrdinal = currentOrdinal;
      // set the ordinal value for the insertion.
      PlatformDependent.putLong(addr, key);
      PlatformDependent.putInt(addr + KEY_WIDTH, insertedOrdinal);

      currentOrdinal++;

      // check if can resize.
      if (currentOrdinal > maxSize) {
        tryRehashForExpansion();
      }

      return insertedOrdinal;
    }
  }
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:53,代码来源:LBlockHashTableEight.java

示例13: l

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
private static long l(long addr){
  return PlatformDependent.getLong(addr);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:4,代码来源:XXH64.java

示例14: rehash

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
private final void rehash(int newCapacity) {
  final long free = this.freeValue;
  // grab old references.

  final long[] oldFixedAddrs = this.tableFixedAddresses;

  try(RollbackCloseable closer = new RollbackCloseable()){ // Close old control blocks when done rehashing.
    for(FixedBlockVector cb : this.fixedBlocks){
      closer.add(cb);
    }

    internalInit(newCapacity);
    final int capacityMask = this.capacityMask;
    final long[] newFixedAddrs = this.tableFixedAddresses;

    for(int batch = 0; batch < oldFixedAddrs.length; batch++){
      long addr = oldFixedAddrs[batch];
      final long max = addr + (MAX_VALUES_PER_BATCH * BLOCK_WIDTH);
      for(long oldFixedAddr = addr; oldFixedAddr < max; oldFixedAddr += BLOCK_WIDTH){
        long key = PlatformDependent.getLong(oldFixedAddr);

        if(key != free){
          int newIndex = hash(key) & capacityMask; // get previously computed hash and slice it.
          long newFixedAddr = newFixedAddrs[newIndex >>> BITS_IN_CHUNK] + ((newIndex & CHUNK_OFFSET_MASK) * BLOCK_WIDTH);

          if (PlatformDependent.getLong(newFixedAddr) != free) {
            while (true) {
              newIndex = (newIndex - 1) & capacityMask;
              newFixedAddr = newFixedAddrs[newIndex >>> BITS_IN_CHUNK] + ((newIndex & CHUNK_OFFSET_MASK) * BLOCK_WIDTH);
              if (PlatformDependent.getLong(newFixedAddr) == free) {
                break;
              }
            }
          }

          final int ordinalValue = PlatformDependent.getInt(oldFixedAddr + KEY_WIDTH);
          PlatformDependent.putLong(newFixedAddr, key);
          PlatformDependent.putInt(newFixedAddr + KEY_WIDTH, ordinalValue);

        }
      }
    }

  } catch (Exception e) {
    throw Throwables.propagate(e);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:48,代码来源:LBlockHashTableEight.java

示例15: copy

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
@Override
public void copy(long offsetAddr, int count) {
  final Reallocator realloc = this.realloc;

  final long maxOffsetAddr = offsetAddr + count * BUILD_RECORD_LINK_SIZE;
  final long[] srcOffsetAddrs = this.srcOffsetAddrs;
  final long[] srcDataAddr = this.srcDataAddr;

  targetAlt.allocateNew(AVG_VAR_WIDTH * count, count);
  long dstOffsetAddr = target.getFieldBuffers().get(OFFSET_BUFFER_ORDINAL).memoryAddress() + 4;
  long initDataAddr = realloc.addr();
  long curDataAddr = realloc.addr();
  long maxDataAddr = realloc.max();
  int lastOffset = 0;

  for(; offsetAddr < maxOffsetAddr; offsetAddr += BUILD_RECORD_LINK_SIZE, dstOffsetAddr += 4){
    final int batchIndex = PlatformDependent.getInt(offsetAddr);
    if(batchIndex == SKIP){
      PlatformDependent.putInt(dstOffsetAddr, lastOffset);
    } else {
      final int batchOffset = PlatformDependent.getShort(offsetAddr + 4);

      final long startAndEnd = PlatformDependent.getLong(srcOffsetAddrs[batchIndex] + batchOffset * 4);
      final int firstOffset = (int) startAndEnd;
      final int secondOffset = (int) (startAndEnd >> 32);
      final int len = secondOffset - firstOffset;
      if(curDataAddr + len > maxDataAddr){
        initDataAddr = realloc.ensure(lastOffset + len);
        curDataAddr = initDataAddr + lastOffset;
        maxDataAddr = realloc.max();
      }

      lastOffset += len;
      PlatformDependent.putInt(dstOffsetAddr, lastOffset);
      com.dremio.sabot.op.common.ht2.Copier.copy(srcDataAddr[batchIndex] + firstOffset, curDataAddr, len);
      curDataAddr += len;
    }

  }

  realloc.setCount(count);
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:43,代码来源:ConditionalFieldBufferCopier6.java


注:本文中的io.netty.util.internal.PlatformDependent.getLong方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。