Package org.apache.pig.builtin

Examples of org.apache.pig.builtin.Bloom


        BuildBloom.Initial map =
                new BuildBloom.Initial(hashFunc, "fixed", size, numHash);
        t = map.exec(input);

        Bloom bloom = new Bloom("bla");
        bloom.setFilter((DataByteArray)t.get(0));

        // Test that everything we put in passes.
        Tuple t1 = tf.newTuple(1);
        t1.set(0, 1);
        assertTrue(bloom.exec(t1));

        // A few that don't pass
        for (int i = 100; i < 10; i++) {
            Tuple t2 = tf.newTuple(1);
            t2.set(0, i);
            assertFalse(bloom.exec(t2));
        }
    }
View Full Code Here


        t.set(0, combinerBag);
        BuildBloom.Intermediate combiner =
                new BuildBloom.Intermediate(hashFunc, "fixed", size, numHash);
        t = combiner.exec(t);

        Bloom bloom = new Bloom("bla");
        bloom.setFilter((DataByteArray)t.get(0));

        // Test that everything we put in passes.
        for (int j = 0; j < 3; j++) {
            Tuple t1 = tf.newTuple(1);
            t1.set(0, 10 + j);
            assertTrue(bloom.exec(t1));
        }

        // A few that don't pass
        for (int i = 100; i < 10; i++) {
            Tuple t2 = tf.newTuple(1);
            t2.set(0, i);
            assertFalse(bloom.exec(t2));
        }
    }
View Full Code Here

        t.set(0, reducerBag);
        BuildBloom.Final reducer =
                new BuildBloom.Final(hashFunc, "fixed", size, numHash);
        DataByteArray dba = reducer.exec(t);

        Bloom bloom = new Bloom("bla");
        bloom.setFilter(dba);

        // Test that everything we put in passes.
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                Tuple t1 = tf.newTuple(1);
                t1.set(0, i * 10 + j);
                assertTrue(bloom.exec(t1));
            }
        }

        // A few that don't pass
        for (int i = 100; i < 10; i++) {
            Tuple t1 = tf.newTuple(1);
            t1.set(0, i);
            assertFalse(bloom.exec(t1));
        }
    }
View Full Code Here

        t.set(0, reducerBag);
        BuildBloom.Final reducer =
                new BuildBloom.Final(hashFunc, numElements, falsePositive);
        DataByteArray dba = reducer.exec(t);

        Bloom bloom = new Bloom("bla");
        bloom.setFilter(dba);

        // Test that everything we put in passes.
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                Tuple t1 = tf.newTuple(2);
                t1.set(0, i * 10 + j);
                t1.set(1, strs[i][j]);
                assertTrue(bloom.exec(t1));
            }
        }

        // A few that don't pass
        for (int i = 100; i < 10; i++) {
            Tuple t1 = tf.newTuple(2);
            t1.set(0, i);
            t1.set(1, "ichabod");
            assertFalse(bloom.exec(t1));
        }
    }
View Full Code Here

       
        BuildBloom.Initial map =
            new BuildBloom.Initial(hashFunc, "fixed", size, numHash);
        t = map.exec(input);

        Bloom bloom = new Bloom("bla");
        bloom.setFilter((DataByteArray)t.get(0));

        // Test that everything we put in passes.
        Tuple t1 = tf.newTuple(1);
        t1.set(0, 1);
        assertTrue(bloom.exec(t1));

        // A few that don't pass
        for (int i = 100; i < 10; i++) {
            Tuple t2 = tf.newTuple(1);
            t2.set(0, i);
            assertFalse(bloom.exec(t2));
        }
    }
View Full Code Here

        t.set(0, combinerBag);
        BuildBloom.Intermediate combiner =
            new BuildBloom.Intermediate(hashFunc, "fixed", size, numHash);
        t = combiner.exec(t);

        Bloom bloom = new Bloom("bla");
        bloom.setFilter((DataByteArray)t.get(0));

        // Test that everything we put in passes.
        for (int j = 0; j < 3; j++) {
            Tuple t1 = tf.newTuple(1);
            t1.set(0, 10 + j);
            assertTrue(bloom.exec(t1));
        }

        // A few that don't pass
        for (int i = 100; i < 10; i++) {
            Tuple t2 = tf.newTuple(1);
            t2.set(0, i);
            assertFalse(bloom.exec(t2));
        }
    }
View Full Code Here

        t.set(0, reducerBag);
        BuildBloom.Final reducer =
            new BuildBloom.Final(hashFunc, "fixed", size, numHash);
        DataByteArray dba = reducer.exec(t);

        Bloom bloom = new Bloom("bla");
        bloom.setFilter(dba);

        // Test that everything we put in passes.
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                Tuple t1 = tf.newTuple(1);
                t1.set(0, i * 10 + j);
                assertTrue(bloom.exec(t1));
            }
        }

        // A few that don't pass
        for (int i = 100; i < 10; i++) {
            Tuple t1 = tf.newTuple(1);
            t1.set(0, i);
            assertFalse(bloom.exec(t1));
        }
    }
View Full Code Here

        t.set(0, reducerBag);
        BuildBloom.Final reducer =
            new BuildBloom.Final(hashFunc, numElements, falsePositive);
        DataByteArray dba = reducer.exec(t);

        Bloom bloom = new Bloom("bla");
        bloom.setFilter(dba);

        // Test that everything we put in passes.
        for (int i = 0; i < 3; i++) {
            for (int j = 0; j < 3; j++) {
                Tuple t1 = tf.newTuple(2);
                t1.set(0, i * 10 + j);
                t1.set(1, strs[i][j]);
                assertTrue(bloom.exec(t1));
            }
        }

        // A few that don't pass
        for (int i = 100; i < 10; i++) {
            Tuple t1 = tf.newTuple(2);
            t1.set(0, i);
            t1.set(1, "ichabod");
            assertFalse(bloom.exec(t1));
        }
    }}
View Full Code Here

TOP

Related Classes of org.apache.pig.builtin.Bloom

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.