Package org.onelab.filter

Examples of org.onelab.filter.BloomFilter


        family.getBloomFilter().filterType;

      switch(type) {
     
      case BLOOMFILTER:
        bloomFilter = new BloomFilter();
        break;
       
      case COUNTING_BLOOMFILTER:
        bloomFilter = new CountingBloomFilter();
        break;
       
      case RETOUCHED_BLOOMFILTER:
        bloomFilter = new RetouchedBloomFilter();
        break;
     
      default:
        throw new IllegalArgumentException("unknown bloom filter type: " +
            type);
      }
      FSDataInputStream in = fs.open(filterFile);
      try {
        bloomFilter.readFields(in);
      } finally {
        fs.close();
      }
    } else {
      if (LOG.isDebugEnabled()) {
        LOG.debug("creating bloom filter for " + this.storeName);
      }

      BloomFilterDescriptor.BloomFilterType type =
        family.getBloomFilter().filterType;

      switch(type) {
     
      case BLOOMFILTER:
        bloomFilter = new BloomFilter(family.getBloomFilter().vectorSize,
            family.getBloomFilter().nbHash);
        break;
       
      case COUNTING_BLOOMFILTER:
        bloomFilter =
View Full Code Here


        Path filterFile = new Path(dirName, BLOOMFILTER_FILE_NAME);
        if(!fs.exists(filterFile)) {
          throw new FileNotFoundException("Could not find bloom filter: " +
              filterFile);
        }
        BloomFilter filter = new BloomFilter();
        FSDataInputStream in = fs.open(filterFile);
        try {
          bloomFilter.readFields(in);
        } finally {
          fs.close();
View Full Code Here

           * ( http://www.eecs.harvard.edu/~michaelm/NEWWORK/postscripts/BloomFilterSurvey.pdf )
           *
           * the probability of false positives is minimized when k is
           * approximately m/n ln(2).
           */
          this.bloomFilter = new BloomFilter(
              (int) DEFAULT_NUMBER_OF_HASH_FUNCTIONS,
              (int) Math.ceil(
                  (DEFAULT_NUMBER_OF_HASH_FUNCTIONS * (1.0 * nrows)) /
                  Math.log(2.0))
          );
View Full Code Here

        Path filterFile = new Path(dirName, BLOOMFILTER_FILE_NAME);
        if(!fs.exists(filterFile)) {
          throw new FileNotFoundException("Could not find bloom filter: " +
              filterFile);
        }
        BloomFilter filter = new BloomFilter();
        FSDataInputStream in = fs.open(filterFile);
        try {
          filter.readFields(in);
        } finally {
          in.close();
        }
        return filter;
      }
View Full Code Here

           * approximately m/n ln(2).
           *
           * If we fix the number of hash functions and know the number of
           * entries, then the optimal vector size m = (k * n) / ln(2)
           */
          this.bloomFilter = new BloomFilter(
              (int) Math.ceil(
                  (DEFAULT_NUMBER_OF_HASH_FUNCTIONS * (1.0 * nrows)) /
                  Math.log(2.0)),
              (int) DEFAULT_NUMBER_OF_HASH_FUNCTIONS
          );
View Full Code Here

        family.getBloomFilter().filterType;

      switch(type) {
     
      case BLOOMFILTER:
        bloomFilter = new BloomFilter();
        break;
       
      case COUNTING_BLOOMFILTER:
        bloomFilter = new CountingBloomFilter();
        break;
       
      case RETOUCHED_BLOOMFILTER:
        bloomFilter = new RetouchedBloomFilter();
        break;
     
      default:
        throw new IllegalArgumentException("unknown bloom filter type: " +
            type);
      }
      FSDataInputStream in = fs.open(filterFile);
      try {
        bloomFilter.readFields(in);
      } finally {
        fs.close();
      }
    } else {
      if (LOG.isDebugEnabled()) {
        LOG.debug("creating bloom filter for " + this.storeName);
      }

      BloomFilterDescriptor.BloomFilterType type =
        family.getBloomFilter().filterType;

      switch(type) {
     
      case BLOOMFILTER:
        bloomFilter = new BloomFilter(family.getBloomFilter().vectorSize,
            family.getBloomFilter().nbHash);
        break;
       
      case COUNTING_BLOOMFILTER:
        bloomFilter =
View Full Code Here

      Path filterFile = new Path(dirName, BLOOMFILTER_FILE_NAME);
      if(!fs.exists(filterFile)) {
        LOG.warn("FileNotFound: " + filterFile + "; proceeding without");
        return null;
      }
      BloomFilter filter = new BloomFilter();
      FSDataInputStream in = fs.open(filterFile);
      try {
        filter.readFields(in);
      } finally {
        in.close();
      }
      return filter;
    }
View Full Code Here

         * approximately m/n ln(2).
         *
         * If we fix the number of hash functions and know the number of
         * entries, then the optimal vector size m = (k * n) / ln(2)
         */
        BloomFilter f = null;
        try {
          f  = new BloomFilter(
            (int) Math.ceil(
                (DEFAULT_NUMBER_OF_HASH_FUNCTIONS * (1.0 * nrows)) /
                Math.log(2.0)),
            (int) DEFAULT_NUMBER_OF_HASH_FUNCTIONS,
            Hash.getHashType(conf)
View Full Code Here

TOP

Related Classes of org.onelab.filter.BloomFilter

Copyright © 2018 www.massapicom. 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.