gpt4 book ai didi

com.yahoo.memory.WritableMemory.getByte()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-23 21:23:05 26 4
gpt4 key购买 nike

本文整理了Java中com.yahoo.memory.WritableMemory.getByte()方法的一些代码示例,展示了WritableMemory.getByte()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WritableMemory.getByte()方法的具体详情如下:
包路径:com.yahoo.memory.WritableMemory
类名称:WritableMemory
方法名:getByte

WritableMemory.getByte介绍

暂无

代码示例

代码示例来源:origin: DataSketches/sketches-core

DirectCouponHashSet(final int lgConfigK, final TgtHllType tgtHllType,
  final WritableMemory wmem) {
 super(lgConfigK, tgtHllType, CurMode.SET, wmem);
 assert wmem.getByte(LG_K_BYTE) > 7;
}

代码示例来源:origin: DataSketches/sketches-core

@Override
int getLgArrLongs() {
 return mem_.getByte(LG_ARR_LONGS_BYTE) & 0XFF;
}

代码示例来源:origin: DataSketches/sketches-core

@Override
public boolean isEmpty() {
 return (mem_.getByte(FLAGS_BYTE) & EMPTY_FLAG_MASK) > 0;
}

代码示例来源:origin: DataSketches/sketches-core

@Override
public int getNominalEntries() {
 return 1 << mem_.getByte(LG_NOM_ENTRIES_BYTE);
}

代码示例来源:origin: DataSketches/sketches-core

static void insertOooFlag(final WritableMemory wmem, final boolean oooFlag) {
 int flags = wmem.getByte(FLAGS_BYTE);
 if (oooFlag) { flags |= OUT_OF_ORDER_FLAG_MASK; }
 else { flags &= ~OUT_OF_ORDER_FLAG_MASK; }
 wmem.putByte(FLAGS_BYTE, (byte) flags);
}

代码示例来源:origin: DataSketches/sketches-core

@Override
public int getCurrentBytes(final boolean compact) {
 if (!compact) {
  final byte lgArrLongs = mem_.getByte(LG_ARR_LONGS_BYTE);
  final int preambleLongs = mem_.getByte(PREAMBLE_LONGS_BYTE) & 0X3F;
  final int lengthBytes = (preambleLongs + (1 << lgArrLongs)) << 3;
  return lengthBytes;
 }
 final int preLongs = getCurrentPreambleLongs(true);
 final int curCount = getRetainedEntries(true);
 return (preLongs + curCount) << 3;
}

代码示例来源:origin: DataSketches/sketches-core

@Override
public Family getFamily() {
 final int familyID = mem_.getByte(FAMILY_BYTE) & 0XFF;
 return Family.idToFamily(familyID);
}

代码示例来源:origin: DataSketches/sketches-core

@Override
public byte[] toByteArray() { //MY_FAMILY is stored in mem_
 final byte lgArrLongs = mem_.getByte(LG_ARR_LONGS_BYTE);
 final int preambleLongs = mem_.getByte(PREAMBLE_LONGS_BYTE) & 0X3F;
 final int lengthBytes = (preambleLongs + (1 << lgArrLongs)) << 3;
 final byte[] byteArray = new byte[lengthBytes];
 final WritableMemory mem = WritableMemory.wrap(byteArray);
 mem_.copyTo(0, mem, 0, lengthBytes);
 return byteArray;
}

代码示例来源:origin: DataSketches/sketches-core

static void insertLgResizeFactor(final WritableMemory wmem, final int rf) {
 final int curByte = wmem.getByte(PREAMBLE_LONGS_BYTE) & 0xFF;
 final int shift = LG_RESIZE_FACTOR_BIT; // shift in bits
 final int mask = 3;
 final byte newByte = (byte) (((rf & mask) << shift) | (~(mask << shift) & curByte));
 wmem.putByte(PREAMBLE_LONGS_BYTE, newByte);
}

代码示例来源:origin: DataSketches/sketches-core

static void setEmpty(final WritableMemory wmem) {
 int flags = wmem.getByte(FLAGS_BYTE) & 0XFF;
 flags |= EMPTY_FLAG_MASK;
 wmem.putByte(FLAGS_BYTE, (byte) flags);
}

代码示例来源:origin: DataSketches/sketches-core

static void insertLgResizeFactor(final WritableMemory wmem, final int rf) {
 final int curByte = wmem.getByte(PREAMBLE_LONGS_BYTE);
 final int shift = LG_RESIZE_FACTOR_BIT; // shift in bits
 final int mask = 3;
 final byte newByte = (byte) (((rf & mask) << shift) | (~(mask << shift) & curByte));
 wmem.putByte(PREAMBLE_LONGS_BYTE, newByte);
}

代码示例来源:origin: DataSketches/sketches-core

@Override
long[] getCache() {
 final long lgArrLongs = mem_.getByte(LG_ARR_LONGS_BYTE) & 0XFF;
 final int preambleLongs = mem_.getByte(PREAMBLE_LONGS_BYTE) & 0X3F;
 final long[] cacheArr = new long[1 << lgArrLongs];
 final WritableMemory mem = WritableMemory.wrap(cacheArr);
 mem_.copyTo(preambleLongs << 3, mem, 0, 8 << lgArrLongs);
 return cacheArr;
}

代码示例来源:origin: DataSketches/sketches-core

static void clearEmpty(final WritableMemory wmem) {
 int flags = wmem.getByte(FLAGS_BYTE) & 0XFF;
 flags &= ~EMPTY_FLAG_MASK;
 wmem.putByte(FLAGS_BYTE, (byte) flags);
}

代码示例来源:origin: DataSketches/sketches-core

static void insertCompactFlag(final WritableMemory wmem, final boolean compact) {
 int flags = wmem.getByte(FLAGS_BYTE);
 if (compact) { flags |= COMPACT_FLAG_MASK; }
 else { flags &= ~COMPACT_FLAG_MASK; }
 wmem.putByte(FLAGS_BYTE, (byte) flags);
}

代码示例来源:origin: DataSketches/sketches-core

static void insertPreLongs(final WritableMemory wmem, final int preLongs) {
 final int curByte = wmem.getByte(PREAMBLE_LONGS_BYTE);
 final int mask = 0x3F;
 final byte newByte = (byte) ((preLongs & mask) | (~mask & curByte));
 wmem.putByte(PREAMBLE_LONGS_BYTE, newByte);
}

代码示例来源:origin: DataSketches/sketches-core

static void insertEmptyFlag(final WritableMemory wmem, final boolean empty) {
 int flags = wmem.getByte(FLAGS_BYTE);
 if (empty) { flags |= EMPTY_FLAG_MASK; }
 else { flags &= ~EMPTY_FLAG_MASK; }
 wmem.putByte(FLAGS_BYTE, (byte) flags);
}

代码示例来源:origin: DataSketches/sketches-core

@Override
public ResizeFactor getResizeFactor() {
 return ResizeFactor.getRF(mem_.getByte(LG_RESIZE_FACTOR_BYTE));
}

代码示例来源:origin: DataSketches/sketches-core

static void insertTgtHllType(final WritableMemory wmem, final TgtHllType tgtHllType) {
 final int typeId = tgtHllType.ordinal();
 int mode = wmem.getByte(MODE_BYTE) & ~TGT_HLL_TYPE_MASK; //strip bits 2, 3
 mode |= (typeId << 2) & TGT_HLL_TYPE_MASK;
 wmem.putByte(MODE_BYTE, (byte) mode);
}

代码示例来源:origin: DataSketches/sketches-core

static void insertCurMode(final WritableMemory wmem, final CurMode curMode) {
 final int curModeId = curMode.ordinal();
 int mode = wmem.getByte(MODE_BYTE)  & ~CUR_MODE_MASK; //strip bits 0, 1
 mode |= (curModeId & CUR_MODE_MASK);
 wmem.putByte(MODE_BYTE, (byte) mode);
}

代码示例来源:origin: DataSketches/sketches-core

@Override
public UpdateSketch rebuild() {
 final int lgNomLongs = getLgNomLongs();
 final int preambleLongs = mem_.getByte(PREAMBLE_LONGS_BYTE) & 0X3F;
 if (getRetainedEntries(true) > (1 << lgNomLongs)) {
  quickSelectAndRebuild(mem_, preambleLongs, lgNomLongs);
 }
 return this;
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com