private BloomFilter<Long> makeBloomFilter() { return BloomFilter.create(Funnels.longFunnel(), expectedInsertions, fpp); } }
public void testForLongs_null() { assertNullsThrowException(Funnels.longFunnel()); }
public void testForLongs() { Long value = 1234L; PrimitiveSink primitiveSink = mock(PrimitiveSink.class); Funnels.longFunnel().funnel(value, primitiveSink); verify(primitiveSink).putLong(1234); }
public void testEquals() { new EqualsTester() .addEqualityGroup(Funnels.byteArrayFunnel()) .addEqualityGroup(Funnels.integerFunnel()) .addEqualityGroup(Funnels.longFunnel()) .addEqualityGroup(Funnels.unencodedCharsFunnel()) .addEqualityGroup(Funnels.stringFunnel(Charsets.UTF_8)) .addEqualityGroup(Funnels.stringFunnel(Charsets.US_ASCII)) .addEqualityGroup( Funnels.sequentialFunnel(Funnels.integerFunnel()), SerializableTester.reserialize(Funnels.sequentialFunnel(Funnels.integerFunnel()))) .addEqualityGroup(Funnels.sequentialFunnel(Funnels.longFunnel())) .testEquals(); } }
public void testSerialization() { assertSame( Funnels.byteArrayFunnel(), SerializableTester.reserialize(Funnels.byteArrayFunnel())); assertSame(Funnels.integerFunnel(), SerializableTester.reserialize(Funnels.integerFunnel())); assertSame(Funnels.longFunnel(), SerializableTester.reserialize(Funnels.longFunnel())); assertSame( Funnels.unencodedCharsFunnel(), SerializableTester.reserialize(Funnels.unencodedCharsFunnel())); assertEquals( Funnels.sequentialFunnel(Funnels.integerFunnel()), SerializableTester.reserialize(Funnels.sequentialFunnel(Funnels.integerFunnel()))); assertEquals( Funnels.stringFunnel(Charsets.US_ASCII), SerializableTester.reserialize(Funnels.stringFunnel(Charsets.US_ASCII))); }
private BloomFilter<Long> makeBloomFilter() { return BloomFilter.create(Funnels.longFunnel(), expectedInsertions, fpp); } }
@Override public Void run() throws SQLException { if(tripleBatch != null && tripleBatch.size() > 0) { flushBatch(); } deletedStatementsLog = BloomFilter.create(Funnels.longFunnel(), 100000); if(connection != null) { connection.commit(); } return null; } });
@Override public Void run() throws SQLException { if(tripleBatch != null && tripleBatch.size() > 0) { flushBatch(); } deletedStatementsLog = BloomFilter.create(Funnels.longFunnel(), 100000); if(connection != null) { connection.commit(); } return null; } });
public void testForLongs_null() { assertNullsThrowException(Funnels.longFunnel()); }
public KiWiConnection(KiWiPersistence persistence, KiWiDialect dialect, CacheManager cacheManager) throws SQLException { this.cacheManager = cacheManager; this.dialect = dialect; this.persistence = persistence; this.batchCommit = dialect.isBatchSupported(); this.deletedStatementsLog = BloomFilter.create(Funnels.longFunnel(), 100000); this.transactionId = getNextSequence(); initCachePool(); }
public void testForLongs() { Long value = 1234L; PrimitiveSink primitiveSink = mock(PrimitiveSink.class); Funnels.longFunnel().funnel(value, primitiveSink); verify(primitiveSink).putLong(1234); }
public KiWiConnection(KiWiPersistence persistence, KiWiDialect dialect, CacheManager cacheManager) throws SQLException { this.cacheManager = cacheManager; this.dialect = dialect; this.persistence = persistence; this.batchCommit = dialect.isBatchSupported(); this.deletedStatementsLog = BloomFilter.create(Funnels.longFunnel(), 100000); this.transactionId = getNextSequence(); initCachePool(); }
@Override public void funnel(RevPerson from, PrimitiveSink into) { NullableStringFunnel.funnel(from.getName().orNull(), into); NullableStringFunnel.funnel(from.getEmail().orNull(), into); Funnels.longFunnel().funnel(from.getTimestamp(), into); Funnels.integerFunnel().funnel(from.getTimeZoneOffset(), into); } });
/** * Undoes all changes made in the current transaction * and releases any database locks currently held * by this <code>Connection</code> object. This method should be * used only when auto-commit mode has been disabled. * * @exception java.sql.SQLException if a database access error occurs, * this method is called while participating in a distributed transaction, * this method is called on a closed connection or this * <code>Connection</code> object is in auto-commit mode * @see #setAutoCommit */ public void rollback() throws SQLException { if (tripleBatch != null && tripleBatch.size() > 0) { synchronized (tripleBatch) { for(KiWiTriple triple : tripleBatch) { triple.setId(-1L); } tripleBatch.clear(); } } deletedStatementsLog = BloomFilter.create(Funnels.longFunnel(), 100000); if(connection != null && !connection.isClosed()) { connection.rollback(); } this.transactionId = getNextSequence(); }
/** * Undoes all changes made in the current transaction * and releases any database locks currently held * by this <code>Connection</code> object. This method should be * used only when auto-commit mode has been disabled. * * @exception java.sql.SQLException if a database access error occurs, * this method is called while participating in a distributed transaction, * this method is called on a closed connection or this * <code>Connection</code> object is in auto-commit mode * @see #setAutoCommit */ public void rollback() throws SQLException { if (tripleBatch != null && tripleBatch.size() > 0) { synchronized (tripleBatch) { for(KiWiTriple triple : tripleBatch) { triple.setId(-1L); } tripleBatch.clear(); } } deletedStatementsLog = BloomFilter.create(Funnels.longFunnel(), 100000); if(connection != null && !connection.isClosed()) { connection.rollback(); } this.transactionId = getNextSequence(); }
@Override public void funnel(RevPerson from, PrimitiveSink into) { NullableStringFunnel.funnel(from.getName().orNull(), into); NullableStringFunnel.funnel(from.getEmail().orNull(), into); Funnels.longFunnel().funnel(from.getTimestamp(), into); Funnels.integerFunnel().funnel(from.getTimeZoneOffset(), into); } });
@Override public void funnel(RevPerson from, PrimitiveSink into) { NullableStringFunnel.funnel(from.getName().orNull(), into); NullableStringFunnel.funnel(from.getEmail().orNull(), into); Funnels.longFunnel().funnel(from.getTimestamp(), into); Funnels.integerFunnel().funnel(from.getTimeZoneOffset(), into); } });
public void testEquals() { new EqualsTester() .addEqualityGroup(Funnels.byteArrayFunnel()) .addEqualityGroup(Funnels.integerFunnel()) .addEqualityGroup(Funnels.longFunnel()) .addEqualityGroup(Funnels.unencodedCharsFunnel()) .addEqualityGroup(Funnels.stringFunnel(Charsets.UTF_8)) .addEqualityGroup(Funnels.stringFunnel(Charsets.US_ASCII)) .addEqualityGroup(Funnels.sequentialFunnel(Funnels.integerFunnel()), SerializableTester.reserialize(Funnels.sequentialFunnel( Funnels.integerFunnel()))) .addEqualityGroup(Funnels.sequentialFunnel(Funnels.longFunnel())) .testEquals(); } }
public void testSerialization() { assertSame( Funnels.byteArrayFunnel(), SerializableTester.reserialize(Funnels.byteArrayFunnel())); assertSame( Funnels.integerFunnel(), SerializableTester.reserialize(Funnels.integerFunnel())); assertSame( Funnels.longFunnel(), SerializableTester.reserialize(Funnels.longFunnel())); assertSame( Funnels.unencodedCharsFunnel(), SerializableTester.reserialize(Funnels.unencodedCharsFunnel())); assertEquals( Funnels.sequentialFunnel(Funnels.integerFunnel()), SerializableTester.reserialize(Funnels.sequentialFunnel(Funnels.integerFunnel()))); assertEquals( Funnels.stringFunnel(Charsets.US_ASCII), SerializableTester.reserialize(Funnels.stringFunnel(Charsets.US_ASCII))); }