Example usage for com.google.common.hash Funnels unencodedCharsFunnel

List of usage examples for com.google.common.hash Funnels unencodedCharsFunnel

Introduction

In this page you can find the example usage for com.google.common.hash Funnels unencodedCharsFunnel.

Prototype

public static Funnel<CharSequence> unencodedCharsFunnel() 

Source Link

Document

Returns a funnel that extracts the characters from a CharSequence , a character at a time, without performing any encoding.

Usage

From source file:no.nb.nna.broprox.frontier.worker.Frontier.java

public Frontier(RethinkDbAdapter db, HarvesterClient harvesterClient, RobotsServiceClient robotsServiceClient,
        DnsServiceClient dnsServiceClient) {
    this.db = db;
    this.harvesterClient = harvesterClient;
    this.robotsServiceClient = robotsServiceClient;
    this.dnsServiceClient = dnsServiceClient;
    this.alreadyIncluded = new CuckooFilter.Builder<>(Funnels.unencodedCharsFunnel(), EXPECTED_MAX_URIS)
            .build();/*  w w  w.j ava  2 s.  co m*/

    //        ForkJoinTask proc = EXECUTOR_SERVICE.submit(new Runnable() {
    //            @Override
    //            public void map() {
    //                try (Cursor<Map<String, Map<String, Object>>> cursor = db.executeRequest(r.table(TABLE_URI_QUEUE)
    //                        .changes());) {
    //                    for (Map<String, Map<String, Object>> doc : cursor) {
    //                        // Remove from already included filter when deleted from queue
    //                        DbObjectFactory.of(QueuedUri.class, doc.get("old_val"))
    //                                .ifPresent(q -> alreadyIncluded.delete(q.getSurt()));
    //
    //                        // Add to already included filter when added to queue
    //                        DbObjectFactory.of(QueuedUri.class, doc.get("new_val"))
    //                                .ifPresent(q -> alreadyIncluded.put(q.getSurt()));
    //                    }
    //                } catch (Exception e) {
    //                    e.printStackTrace();
    //                }
    //            }
    //
    //        });

    for (int i = 0; i < 30; i++) {
        EXECUTOR_SERVICE.submit(new QueueWorker(this));
    }
}

From source file:com.android.compatibility.common.util.ChecksumReporter.java

/***
 * Create new instance of ChecksumReporter
 * @param testCount the number of test results that will be stored
 * @param fpp the false positive percentage for result lookup misses
 *//*  ww  w.  jav a 2s  .  c o m*/
public ChecksumReporter(int testCount, double fpp, short version) {
    mResultChecksum = BloomFilter.create(Funnels.unencodedCharsFunnel(), testCount, fpp);
    mFileChecksum = new HashMap<>();
    mVersion = version;
}

From source file:com.duprasville.guava.probably.CuckooFilter.java

public static Funnel getfunnel() {
    return Funnels.unencodedCharsFunnel();
}