Examples of FastBitSet


Examples of javolution.util.FastBitSet

   */

  private FastBitSet[] deserialize(String s, int numBitVectors) {
    FastBitSet[] b = new FastBitSet[numBitVectors];
    for (int j=0; j < numBitVectors; j++) {
      b[j] = new FastBitSet(bitVectorSize);
      b[j].clear();
    }

    int vectorIndex =0;

View Full Code Here

Examples of javolution.util.FastBitSet

   */
  public NumDistinctValueEstimator(int numBitVectors) {
    this.numBitVectors = numBitVectors;
    bitVector = new FastBitSet[numBitVectors];
    for (int i=0; i< numBitVectors; i++) {
      bitVector[i] = new FastBitSet(bitVectorSize);
    }

    a = new int[numBitVectors];
    b = new int[numBitVectors];

View Full Code Here

Examples of javolution.util.FastBitSet

  protected transient int numEntriesHashTable;
  transient int countAfterReport;   // report or forward
  transient int heartbeatInterval;

  public static FastBitSet groupingSet2BitSet(int value) {
    FastBitSet bits = new FastBitSet();
    int index = 0;
    while (value != 0) {
      if (value % 2 != 0) {
        bits.set(index);
      }
      ++index;
      value = value >>> 1;
    }
    return bits;
View Full Code Here

Examples of javolution.util.FastBitSet

        for (int groupingSetPos = 0; groupingSetPos < groupingSets.size(); groupingSetPos++) {
          for (int keyPos = 0; keyPos < groupingSetsPosition; keyPos++) {
            newKeysArray[keyPos] = null;
          }

          FastBitSet bitset = groupingSetsBitSet.get(groupingSetPos);
          // Some keys need to be left to null corresponding to that grouping set.
          for (int keyPos = bitset.nextSetBit(0); keyPos >= 0;
            keyPos = bitset.nextSetBit(keyPos+1)) {
            newKeysArray[keyPos] = cloneNewKeysArray[keyPos];
          }

          newKeysArray[groupingSetsPosition] = newKeysGroupingSets.get(groupingSetPos);
          processKey(row, rowInspector);
View Full Code Here

Examples of javolution.util.FastBitSet

  transient int numEntriesHashTable;
  transient int countAfterReport;   // report or forward
  transient int heartbeatInterval;

  public static FastBitSet groupingSet2BitSet(int value) {
    FastBitSet bits = new FastBitSet();
    int index = 0;
    while (value != 0) {
      if (value % 2 != 0) {
        bits.set(index);
      }
      ++index;
      value = value >>> 1;
    }
    return bits;
View Full Code Here

Examples of javolution.util.FastBitSet

        for (int groupingSetPos = 0; groupingSetPos < groupingSets.size(); groupingSetPos++) {
          for (int keyPos = 0; keyPos < groupingSetsPosition; keyPos++) {
            newKeysArray[keyPos] = null;
          }

          FastBitSet bitset = groupingSetsBitSet.get(groupingSetPos);
          // Some keys need to be left to null corresponding to that grouping set.
          for (int keyPos = bitset.nextSetBit(0); keyPos >= 0;
            keyPos = bitset.nextSetBit(keyPos+1)) {
            newKeysArray[keyPos] = cloneNewKeysArray[keyPos];
          }

          newKeysArray[groupingSetsPosition] = newKeysGroupingSets.get(groupingSetPos);
          processKey(row, rowInspector);
View Full Code Here

Examples of net.timewalker.ffmq3.utils.FastBitSet

        this.maxSize = maxSize;
        this.nextEntry = new int[initialSize];
        this.previousEntry = new int[initialSize];
        this.firstEntry = -1;
        this.data = new Object[initialSize];
        this.locks = new FastBitSet(initialSize);
    }
View Full Code Here

Examples of net.timewalker.ffmq3.utils.FastBitSet

                 
                  if ((flags[n] & FLAG_START_BLOCK) > 0)
                    msgCount++;
                }
            }
            this.locks = new FastBitSet(blockCount);
            this.size = msgCount;
           
            log.debug(msgCount+" entries found");
        }
        catch (EOFException e)
View Full Code Here

Examples of net.timewalker.ffmq3.utils.FastBitSet

        }
    }
   
    private int guessFirstBlockIndex( int blockCount , int[] allocatedSize , int[] nextBlock )
    {
        FastBitSet referenced = new FastBitSet(blockCount);
       
        // Flag all referenced blocks
        for (int n = 0 ; n < blockCount ; n++)
            if (allocatedSize[n] != -1 && nextBlock[n] != -1)
                referenced.set(nextBlock[n]);
       
        // Find candidate
        for (int n = 0 ; n < blockCount ; n++)
            if (allocatedSize[n] != -1 &&
                nextBlock[n] != -1 &&
                !referenced.get(n))
                return n;
       
        return -1;
    }
View Full Code Here

Examples of net.timewalker.ffmq3.utils.FastBitSet

    }
   
    private boolean fixBlocks( int blockCount , int blockSize , int firstBlock , byte[] flags , int[] allocatedSize , int[] previousBlock , int[] nextBlock )
    {
        boolean changed = false;
        FastBitSet fixedBlocks = new FastBitSet(blockCount);
       
        // Fix reverse links first
        int previous = -1;
        int current = firstBlock;
        while (current != -1)
        {
            if (previousBlock[current] != previous)
            {
                log.debug("Fixing previous reference "+previousBlock[current]+" -> "+previous);
                previousBlock[current] = previous;
                changed = true;
            }
            fixedBlocks.set(current);
            previous = current;
            current = nextBlock[current];
        }
       
        // Look for lost blocks and fix allocated sizes
        for (int n = 0 ; n < blockCount ; n++)
        {
            if (allocatedSize[n] != -1 && !fixedBlocks.get(n))
            {
                log.warn("Lost block found : "+n);
                allocatedSize[n] = -1;
                changed = true;
            }
            if (fixedBlocks.get(n) && (allocatedSize[n] <= 0 || allocatedSize[n]>blockSize))
            {
                log.warn("Block has an invalid size ("+allocatedSize[n]+"), replacing by "+blockSize);
                allocatedSize[n] = blockSize;
                changed = true;
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.