@@ -0,0 +1,1462 @@
+package com.gochinatv.cdn.api.bloom;%0A%0Aimport com.google.common.hash.BloomFilter;%0Aimport com.google.common.hash.Funnels;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A/**%0A * $%7BDESCRIPTION%7D%0A *%0A * @auhtor jacktomcat%0A * @create 2019-03-10 %E4%B8%8B%E5%8D%884:47%0A */%0Apublic class BloomFilterTest %7B%0A%0A%0A    private static int size = 10000000;%0A%0A    private static BloomFilter%3CInteger%3E bloomFilter = BloomFilter.create(Funnels.integerFunnel(), size);%0A%0A%0A%0A    public static void main(String%5B%5D args) %7B%0A        //bloomContains();%0A        mapContains();%0A    %7D%0A%0A%0A    public static void bloomContains() %7B%0A        long startTime = System.nanoTime(); // %E8%8E%B7%E5%8F%96%E5%BC%80%E5%A7%8B%E6%97%B6%E9%97%B4%0A        for (int i = 0; i %3C size; i++) %7B%0A            bloomFilter.put(i);%0A        %7D%0A%0A        //%E5%88%A4%E6%96%AD%E8%BF%99%E4%B8%80%E7%99%BE%E4%B8%87%E4%B8%AA%E6%95%B0%E4%B8%AD%E6%98%AF%E5%90%A6%E5%8C%85%E5%90%AB29999%E8%BF%99%E4%B8%AA%E6%95%B0%0A        if (bloomFilter.mightContain(29999)) %7B%0A            System.out.println(%22%E5%91%BD%E4%B8%AD%E4%BA%86%22);%0A        %7D%0A        long endTime = System.nanoTime();   // %E8%8E%B7%E5%8F%96%E7%BB%93%E6%9D%9F%E6%97%B6%E9%97%B4%0A%0A        System.out.println(%22%E7%A8%8B%E5%BA%8F%E8%BF%90%E8%A1%8C%E6%97%B6%E9%97%B4%EF%BC%9A %22 + (endTime - startTime) + %22%E7%BA%B3%E7%A7%92%22);%0A    %7D%0A%0A%0A    public static void mapContains() %7B%0A        long startTime = System.nanoTime(); // %E8%8E%B7%E5%8F%96%E5%BC%80%E5%A7%8B%E6%97%B6%E9%97%B4%0A        Map%3CInteger,Integer%3E data = new HashMap%3C%3E(size);%0A        for (int i = 0; i %3C size; i++) %7B%0A            data.put(i,i);%0A        %7D%0A%0A%0A        //%E5%88%A4%E6%96%AD%E8%BF%99%E4%B8%80%E7%99%BE%E4%B8%87%E4%B8%AA%E6%95%B0%E4%B8%AD%E6%98%AF%E5%90%A6%E5%8C%85%E5%90%AB29999%E8%BF%99%E4%B8%AA%E6%95%B0%0A        if (data.containsKey(29999)) %7B%0A            System.out.println(%22%E5%91%BD%E4%B8%AD%E4%BA%86%22);%0A        %7D%0A        long endTime = System.nanoTime();   // %E8%8E%B7%E5%8F%96%E7%BB%93%E6%9D%9F%E6%97%B6%E9%97%B4%0A%0A        System.out.println(%22%E7%A8%8B%E5%BA%8F%E8%BF%90%E8%A1%8C%E6%97%B6%E9%97%B4%EF%BC%9A %22 + (endTime - startTime) + %22%E7%BA%B3%E7%A7%92%22);%0A%0A    %7D%0A%0A%7D%0A

add bloom