Examples of BitArray


Examples of com.google.common.hash.BloomFilterStrategies.BitArray

      this.numHashFunctions = bf.numHashFunctions;
      this.funnel = bf.funnel;
      this.strategy = bf.strategy;
    }
    Object readResolve() {
      return new BloomFilter<T>(new BitArray(data), numHashFunctions, funnel, strategy);
    }
View Full Code Here

Examples of com.google.common.hash.BloomFilterStrategies.BitArray

public class BloomFilterTest extends TestCase {
  public void testLargeBloomFilterDoesntOverflow() {
    long numBits = Integer.MAX_VALUE;
    numBits++;

    BitArray bitArray = new BitArray(numBits);
    assertTrue(
        "BitArray.bitSize() must return a positive number, but was " + bitArray.bitSize(),
        bitArray.bitSize() > 0);

    // Ideally we would also test the bitSize() overflow of this BF, but it runs out of heap space
    // BloomFilter.create(Funnels.unencodedCharsFunnel(), 244412641, 1e-11);
  }
View Full Code Here

Examples of com.google.common.hash.BloomFilterStrategies.BitArray

* @author Ben Yu
*/

public class PackageSanityTests extends AbstractPackageSanityTests {
  public PackageSanityTests() {
    setDefault(BitArray.class, new BitArray(1));
    setDefault(HashCode.class, HashCode.fromInt(1));
    setDefault(String.class, "MD5");
    setDefault(int.class, 32);
  }
View Full Code Here

Examples of com.google_voltpatches.common.hash.BloomFilterStrategies.BitArray

     * which is less than 10kb. Who cares!
     */
    long numBits = optimalNumOfBits(expectedInsertions, fpp);
    int numHashFunctions = optimalNumOfHashFunctions(expectedInsertions, numBits);
    try {
      return new BloomFilter<T>(new BitArray(numBits), numHashFunctions, funnel, strategy);
    } catch (IllegalArgumentException e) {
      throw new IllegalArgumentException("Could not create BloomFilter of " + numBits + " bits", e);
    }
  }
View Full Code Here

Examples of com.sun.org.apache.xalan.internal.xsltc.dom.BitArray

    long bitOffset = bitMapIndex % 32;

    file.seek(allocatorBitMapOffset + dwordOffset * 4);

    int[] bitmap = { file.readLittleEndianInt() };
    BitArray bits = new BitArray(32, bitmap);

    return bits.getBit((int) bitOffset);
  }
View Full Code Here

Examples of dijjer.util.BitArray

public class BitArrayTest extends TestCase {

  public static final String VERSION = "$Id: BitArrayTest.java,v 1.5 2005/04/12 13:04:15 sanity Exp $";

  public void testBitArray() {
    BitArray ba = new BitArray(100);
    for (int x = 5; x < 100; x++) {
      ba.setBit(x, true);
    }
    System.out.println(ba);
  }
View Full Code Here

Examples of freenet.support.BitArray

    this.usm = usm;
    long blocks = (size + blockSize - 1) / blockSize;
    if(blocks > Integer.MAX_VALUE)
      throw new IllegalArgumentException("Too big");
    this.blocks = (int)blocks;
    blocksReceived = new BitArray(this.blocks);
    if(initialState) {
      blocksReceived.setAllOnes();
      blocksReceivedCount = this.blocks;
    }
    assert(raf.size() >= size);
View Full Code Here

Examples of freenet.support.BitArray

   * Clone the blocksReceived BitArray. Used by BulkTransmitter to find what blocks are available on
   * creation. BulkTransmitter will have already taken the lock and will keep it over the add() also.
   * @return A copy of blocksReceived.
   */
  synchronized BitArray cloneBlocksReceived() {
    return new BitArray(blocksReceived);
  }
View Full Code Here

Examples of freenet.support.BitArray

    _prb = source;
    _ctr = ctr;
    if(_ctr == null) throw new NullPointerException();
    PACKET_SIZE = DMT.packetTransmitSize(_prb._packetSize, _prb._packets);
    try {
      _sentPackets = new BitArray(_prb.getNumPackets());
    } catch (AbortedException e) {
      Logger.error(this, "Aborted during setup");
      // Will throw on running
    }
    this.blockTimeCallback = blockTimes;
View Full Code Here

Examples of freenet.support.BitArray

        running = true;
      }
      try {
        while(true) {
          int packetNo = -1;
          BitArray copy;
          synchronized(_senderThread) {
            if(_failed || _receivedSendCompletion || _completed) return;
            if(_unsent.size() == 0) {
              // Wait for PRB callback to tell us we have more packets.
              return;
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.