Examples of TweetPersister


Examples of net.fortytwo.twitlogic.persistence.TweetPersister

                        store.doNotRefreshCoreMetadata();
                        store.initialize();
                        try {
                            final SailConnection tc = tSail.getConnection();
                            try {
                                final TweetPersister p = new TweetPersister(store, null);

                                Handler<Tweet> h = new Handler<Tweet>() {
                                    public boolean isOpen() {
                                        return p.isOpen();
                                    }

                                    public void handle(final Tweet tweet) throws HandlerException {
                                        try {
                                            tc.clear();
                                            tc.commit();
                                            tc.begin();
                                        } catch (SailException e) {
                                            throw new HandlerException(e);
                                        }

                                        p.handle(tweet);
                                    }
                                };

                                stressTest(h, 100);
                            } finally {
View Full Code Here

Examples of net.fortytwo.twitlogic.persistence.TweetPersister

                try {
                    final SailConnection tc = transientSail.getConnection();

                    try {
                        tc.begin();
                        final TweetPersister p = new TweetPersister(store, null);

                        Handler<Tweet> h = new Handler<Tweet>() {
                            public boolean isOpen() {
                                return p.isOpen();
                            }

                            public void handle(final Tweet tweet) throws HandlerException {
                                try {
                                    tc.clear();
                                    tc.commit();
                                    tc.begin();
                                } catch (SailException e) {
                                    throw new HandlerException(e);
                                }
                                p.handle(tweet);
                            }
                        };

                        stressTest(h, 1000);
                    } finally {
View Full Code Here

Examples of net.fortytwo.twitlogic.persistence.TweetPersister

        try {
            TweetStore store = new TweetStore(sail);
            store.initialize();
            try {
                TweetPersister p = new TweetPersister(store, null);

                stressTest(p, 1000);
            } finally {
                store.shutDown();
            }
View Full Code Here

Examples of net.fortytwo.twitlogic.persistence.TweetPersister

        try {
            TweetStore store = new TweetStore(sail);
            store.initialize();
            try {
                TweetPersister p = new TweetPersister(store, null);

                stressTest(p, 10);
            } finally {
                store.shutDown();
            }
View Full Code Here

Examples of net.fortytwo.twitlogic.persistence.TweetPersister

                    // A connection with which to repeatedly clear the working store
                    final SailConnection c = workingSail.getConnection();

                    try {
                        // Offline persister
                        final TweetPersister p = new TweetPersister(store, null);

                        try {
                            Handler<Tweet> h = new Handler<Tweet>() {
                                public boolean isOpen() {
                                    return p.isOpen();
                                }

                                public void handle(final Tweet tweet) throws HandlerException {
                                    try {
                                        c.clear();
                                        c.commit();
                                        c.begin();
                                    } catch (SailException e) {
                                        throw new HandlerException(e);
                                    }

                                    p.handle(tweet);
                                }
                            };

                            stressTest(h, 1000);
                        } finally {
                            p.close();
                        }
                    } finally {
                        c.close();
                    }
                } finally {
View Full Code Here

Examples of net.fortytwo.twitlogic.persistence.TweetPersister

        try {
            CustomTwitterClient client = new CustomTwitterClient();

            store.startServer(client);

            TweetPersister persister = new TweetPersister(store, client);
            TweetDeleter d = new TweetDeleter(store);

            TweetPersistedLogger pLogger = new TweetPersistedLogger(client.getStatistics(), persister);
            TweetFilterCriterion crit = new TweetFilterCriterion(TwitLogic.getConfiguration());
            Filter<Tweet> f = new Filter<Tweet>(crit, pLogger);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.