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


Java PlatformDependent.putLong方法代码示例

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


在下文中一共展示了PlatformDependent.putLong方法的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 int newVal = PlatformDependent.getInt(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: changeFree

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
private long changeFree(){
  long oldFree = this.freeValue;
  long newFree = nextFree(oldFree);
  final long[] controlAddrs = this.tableFixedAddresses;
  for(int batch =0; batch < controlAddrs.length; batch++){
    long addr = controlAddrs[batch];
    final long max = addr + MAX_VALUES_PER_BATCH * BLOCK_WIDTH;
    for(long oldControlAddr = addr; oldControlAddr < max; oldControlAddr += BLOCK_WIDTH){
      if(PlatformDependent.getLong(oldControlAddr) == oldFree){
        PlatformDependent.putLong(oldControlAddr, newFree);
      }
    }
  }
  this.freeValue = newFree;
  return newFree;
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:17,代码来源:LBlockHashTableEight.java

示例5: copy

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
@Override
public void copy(long compoundAddr, final int srcStart, final int count) {
  copyWatch.start();

  final long[] dstAddrs = this.dstAddrs;

  long srcAddr = source.getFieldBuffers().get(VALUE_BUFFER_ORDINAL).memoryAddress() + srcStart * SIZE;

  final long max = compoundAddr + count * OFFSET_SIZE;
  for (; compoundAddr < max; compoundAddr +=OFFSET_SIZE, srcAddr += SIZE) {
    final int compoundIdx = PlatformDependent.getInt(compoundAddr);
    final int batchIdx = compoundIdx >>> 16;
    final int rowIdx = compoundIdx & 65535;

    PlatformDependent.putLong(dstAddrs[batchIdx] + rowIdx * SIZE, PlatformDependent.getLong(srcAddr));
  }

  copyWatch.stop();
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:20,代码来源:MultiDestCopier.java

示例6: 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 double newVal = Double.longBitsToDouble(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, Double.doubleToLongBits(Double.longBitsToDouble(PlatformDependent.getLong(sumAddr)) + newVal));
    PlatformDependent.putInt(bitUpdateAddr, PlatformDependent.getInt(bitUpdateAddr) | bitUpdateVal);
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:23,代码来源:SumAccumulators.java

示例7: writeDouble

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
@Override
public ByteBuf writeDouble(double value) {
  ensure(8);
  PlatformDependent.putLong(addr(writerIndex), Double.doubleToRawLongBits(value));
  writerIndex += 8;
  return this;
}
 
开发者ID:skhalifa,项目名称:QDrill,代码行数:8,代码来源:DrillBuf.java

示例8: copy

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
@Override
public void copy(long offsetAddr, int count) {
  targetAlt.allocateNew(count);
  final List<ArrowBuf> targetBuffers = target.getFieldBuffers();
  final long max = offsetAddr + count * STEP_SIZE;
  final long[] srcAddrs = this.srcAddrs;
  long dstAddr = targetBuffers.get(VALUE_BUFFER_ORDINAL).memoryAddress();
  for(long addr = offsetAddr; addr < max; addr += STEP_SIZE, dstAddr += SIZE){
    final int sv4 = PlatformDependent.getInt(addr);
    PlatformDependent.putLong(dstAddr, PlatformDependent.getLong(srcAddrs[sv4 >>> BATCH_BITS] + (sv4 & MAX_BATCH) * SIZE));
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:13,代码来源:FieldBufferCopier4.java

示例9: internalInit

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
private void internalInit(final int capacity) {
  initTimer.start();
  this.capacity = capacity;
  this.maxSize = !QHashCapacities.isMaxCapacity(capacity, false) ? config.maxSize(capacity) : capacity - 1;
  this.batches = (int) Math.ceil( capacity / (MAX_VALUES_PER_BATCH * 1.0d) );
  final ControlBlock[] newControlBlocks = new ControlBlock[batches];
  tableControlAddresses = new long[batches];

  try(RollbackCloseable rollbackable = new RollbackCloseable()) {

    for(int i =0; i < batches; i++){
      newControlBlocks[i] = new ControlBlock(allocator);
      rollbackable.add(newControlBlocks[i]);
      tableControlAddresses[i] = newControlBlocks[i].getMemoryAddress();

      final long addr = newControlBlocks[i].getMemoryAddress();
      final long max = addr + MAX_VALUES_PER_BATCH * CONTROL_WIDTH;
      for(long l = addr; l < max; l+= QBlockHashTable.CONTROL_WIDTH){
        PlatformDependent.putLong(l, QBlockHashTable.LFREE);
      }
    }

    this.controlBlocks = newControlBlocks;
    rollbackable.commit();
  } catch (Exception e) {
    throw Throwables.propagate(e);
  }
  initTimer.stop();
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:30,代码来源:QBlockHashTable.java

示例10: writeWordwise

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
public static void writeWordwise(long addr, int length, long value) {
  if (length == 0) {
    return;
  }

  int nLong = length >>> 3;
  int nBytes = length & 7;
  for (int i = nLong; i > 0; i--) {
    PlatformDependent.putLong(addr, value);
    addr += 8;
  }
  if (nBytes == 4) {
    PlatformDependent.putInt(addr, (int) value);
    addr += 4;
  } else if (nBytes < 4) {
    for (int i = nBytes; i > 0; i--) {
      PlatformDependent.putByte(addr, (byte) value);
      addr++;
    }
  } else {
    PlatformDependent.putInt(addr, (int) value);
    addr += 4;
    for (int i = nBytes - 4; i > 0; i--) {
      PlatformDependent.putByte(addr, (byte) value);
      addr++;
    }
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:29,代码来源:BaseSingleAccumulator.java

示例11: accumulate

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
public void accumulate(final long offsetAddr, final int count){
  final long maxAddr = offsetAddr + count * 4;
  final long[] valueAddresses = this.valueAddresses;
  for(long ordinalAddr = offsetAddr; ordinalAddr < maxAddr; ordinalAddr += 4){
    final int tableIndex = PlatformDependent.getInt(ordinalAddr);
    final long countAddr = valueAddresses[tableIndex >>> LBlockHashTable.BITS_IN_CHUNK] + (tableIndex & LBlockHashTable.CHUNK_OFFSET_MASK) * 8;
    PlatformDependent.putLong(countAddr, PlatformDependent.getLong(countAddr) + 1);
  }

}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:11,代码来源:CountOneAccumulator.java

示例12: accumulate

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

  int incomingIndex = 0;

  for(long ordinalAddr = offsetAddr; ordinalAddr < maxAddr; ordinalAddr += 4, incomingIndex++){
    final int bitVal = (PlatformDependent.getByte(incomingBit + ((incomingIndex >>> 3))) >>> (incomingIndex & 7)) & 1;
    final int tableIndex = PlatformDependent.getInt(ordinalAddr);
    final long countAddr = valueAddresses[tableIndex >>> LBlockHashTable.BITS_IN_CHUNK] + (tableIndex & LBlockHashTable.CHUNK_OFFSET_MASK) * 8;
    PlatformDependent.putLong(countAddr, PlatformDependent.getLong(countAddr) + bitVal);
  }

}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:16,代码来源:CountColumnAccumulator.java

示例13: copy

import io.netty.util.internal.PlatformDependent; //导入方法依赖的package包/类
@Override
public void copy(long offsetAddr, int count) {
  targetAlt.allocateNew(count);
  final List<ArrowBuf> targetBuffers = target.getFieldBuffers();
  final long max = offsetAddr + count * BUILD_RECORD_LINK_SIZE;
  final long[] srcAddrs = this.srcAddrs;
  long dstAddr = targetBuffers.get(VALUE_BUFFER_ORDINAL).memoryAddress();
  for(long addr = offsetAddr; addr < max; addr += BUILD_RECORD_LINK_SIZE, dstAddr += SIZE){
    final int batchIndex = PlatformDependent.getInt(addr);
    final int batchOffset = PlatformDependent.getShort(addr + 4);
    final long src = srcAddrs[batchIndex] + batchOffset * SIZE;
    PlatformDependent.putLong(dstAddr, PlatformDependent.getLong(src));
    PlatformDependent.putLong(dstAddr+8, PlatformDependent.getLong(src + 8));
  }
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:16,代码来源:FieldBufferCopier6.java

示例14: setLong

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

示例15: setDouble

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


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