RollCycleEncodeSequence(LongValue writePositionAndSequence, int indexCount, int indexSpacing) { this.cycleShift = Math.max(32, Maths.intLog2(indexCount) * 2 + Maths.intLog2(indexSpacing)); this.sequenceMask = (1L << cycleShift) - 1; this.writePositionAndSequence = writePositionAndSequence instanceof TwoLongValue ? (TwoLongValue) writePositionAndSequence : null; }
RollCycles(String format, int length, int indexCount, int indexSpacing) { this.format = format; this.length = length; this.indexCount = Maths.nextPower2(indexCount, 8); this.indexSpacing = Maths.nextPower2(indexSpacing, 1); cycleShift = Math.max(32, Maths.intLog2(indexCount) * 2 + Maths.intLog2(indexSpacing)); sequenceMask = (1L << cycleShift) - 1; }
private SCQIndexing(int indexCount, int indexSpacing, LongValue index2Index, LongValue nextEntryToBeIndexed, Supplier<LongArrayValues> longArraySupplier) { this.indexCount = indexCount; this.indexCountBits = Maths.intLog2(indexCount); this.indexSpacing = indexSpacing; this.indexSpacingBits = Maths.intLog2(indexSpacing); this.index2Index = index2Index; this.nextEntryToBeIndexed = nextEntryToBeIndexed; this.longArraySupplier = longArraySupplier; this.index2indexArray = new ThreadLocal<>(); this.indexArray = new ThreadLocal<>(); this.index2IndexTemplate = w -> w.writeEventName(() -> "index2index").int64array(indexCount); this.indexTemplate = w -> w.writeEventName(() -> "index").int64array(indexCount); }
private static int coverBits(long options) { assert options > 0; if (options == 1) return 1; return Maths.intLog2(options - 1) + 1; }
private static int coverBits(long options) { assert options > 0; if (options == 1) return 1; return Maths.intLog2(options - 1) + 1; }
RollCycleEncodeSequence(LongValue writePositionAndSequence, int indexCount, int indexSpacing) { this.cycleShift = Math.max(32, Maths.intLog2(indexCount) * 2 + Maths.intLog2(indexSpacing)); this.sequenceMask = (1L << cycleShift) - 1; this.writePositionAndSequence = writePositionAndSequence instanceof TwoLongValue ? (TwoLongValue) writePositionAndSequence : null; }
public ParsingCache(int capacity, Function<String, E> eFunction) throws IllegalArgumentException { this.eFunction = eFunction; int n = Maths.nextPower2(capacity, 128); shift = Maths.intLog2(n); interner = new ParsedData[n]; mask = n - 1; }
public ParsingCache(int capacity, Function<String, E> eFunction) throws IllegalArgumentException { this.eFunction = eFunction; int n = Maths.nextPower2(capacity, 128); shift = Maths.intLog2(n); interner = new ParsedData[n]; mask = n - 1; }
public AbstractInterner(int capacity) throws IllegalArgumentException { int n = Maths.nextPower2(capacity, 128); shift = Maths.intLog2(n); entries = new InternerEntry[n]; mask = n - 1; }
public StringInterner(int capacity) throws IllegalArgumentException { int n = Maths.nextPower2(capacity, 128); shift = Maths.intLog2(n); interner = new String[n]; mask = n - 1; }
RollCycles(String format, int length, int indexCount, int indexSpacing) { this.format = format; this.length = length; this.indexCount = Maths.nextPower2(indexCount, 8); this.indexSpacing = Maths.nextPower2(indexSpacing, 1); cycleShift = Math.max(32, Maths.intLog2(indexCount) * 2 + Maths.intLog2(indexSpacing)); sequenceMask = (1L << cycleShift) - 1; }
public StringInterner(int capacity) throws IllegalArgumentException { int n = Maths.nextPower2(capacity, 128); shift = Maths.intLog2(n); interner = new String[n]; mask = n - 1; }
private SCQIndexing(int indexCount, int indexSpacing, LongValue index2Index, LongValue nextEntryToBeIndexed, Supplier<LongArrayValues> longArraySupplier) { this.indexCount = indexCount; this.indexCountBits = Maths.intLog2(indexCount); this.indexSpacing = indexSpacing; this.indexSpacingBits = Maths.intLog2(indexSpacing); this.index2Index = index2Index; this.nextEntryToBeIndexed = nextEntryToBeIndexed; this.longArraySupplier = longArraySupplier; this.index2indexArray = new ThreadLocal<>(); this.indexArray = new ThreadLocal<>(); this.index2IndexTemplate = w -> w.writeEventName(() -> "index2index").int64array(indexCount); this.indexTemplate = w -> w.writeEventName(() -> "index").int64array(indexCount); }
@Override int sizeInBits() { int elemSizeInBits = elemModel.sizeInBits(); int elemBitExtent = elemBitExtent(); int elemDontCrossBits = elemModel.dontCrossAlignmentInBits(); if (elemBitExtent <= elemDontCrossBits) { // A power of 2, for fast index computation int elemsInOneAlignment = 1 << Maths.intLog2(elemDontCrossBits / elemBitExtent); return (array.length() / elemsInOneAlignment) * elemDontCrossBits + ((array.length() % elemsInOneAlignment) - 1) * elemBitExtent + elemSizeInBits; } else { assert elemDontCrossBits == Align.NO_ALIGNMENT : "" + elemDontCrossBits; return elemBitExtent * (array.length() - 1) + elemSizeInBits; } }
@Override int sizeInBits() { int elemSizeInBits = elemModel.sizeInBits(); int elemBitExtent = elemBitExtent(); int elemDontCrossBits = elemModel.dontCrossAlignmentInBits(); if (elemBitExtent <= elemDontCrossBits) { // A power of 2, for fast index computation int elemsInOneAlignment = 1 << Maths.intLog2(elemDontCrossBits / elemBitExtent); return (array.length() / elemsInOneAlignment) * elemDontCrossBits + ((array.length() % elemsInOneAlignment) - 1) * elemBitExtent + elemSizeInBits; } else { assert elemDontCrossBits == Align.NO_ALIGNMENT : "" + elemDontCrossBits; return elemBitExtent * (array.length() - 1) + elemSizeInBits; } }
log2TiersInBulk = Maths.intLog2(tiersInBulk); tierBulkInnerOffsetToTiers = computeTierBulkInnerOffsetToTiers(tiersInBulk); tierBulkSizeInBytes = computeTierBulkBytesSize(tiersInBulk);