本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例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();
}
示例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);
}
}
示例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;
}
示例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));
}
}
示例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();
}
示例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++;
}
}
}
示例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);
}
}
示例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);
}
}
示例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));
}
}
示例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;
}
示例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;
}