Package com.franz.agraph.repository

Examples of com.franz.agraph.repository.AGRepository


        super(conf);
        this.enableLogging = enableLogging;
    }

    public Sail makeSail() throws SailException, PropertyException {
        AGRepository repo;
        try {
            repo = makeAGRepository();
        } catch (RepositoryException e) {
            throw new SailException(e);
        }
View Full Code Here


                + " on host " + host);
        AGServer server = new AGServer(host, userName, password);

        AGCatalog cat = new AGCatalog(server, catName);

        AGRepository repo = new AGRepository(cat, name);
        repo.initialize();
        return repo;
    }
View Full Code Here

    // Over the LAN:
    //     1 trans/upload -- 60 t/s
    //     100 trans/upload -- 160 t/s
    private void testRdfTransactionPersister(final int commitsPerUpload) throws Exception {
        AGRepository repo = new AGRepositorySailFactory(TwitLogic.getConfiguration(), false).makeAGRepository();
        repo.initialize();
        try {
            AGRepositoryConnection rc = repo.getConnection();
            try {
                //rc.begin();
                Sail tSail = new MemoryStore();
                tSail.initialize();

                try {
                    Sail sail = new AGTransactionSail(tSail, rc, commitsPerUpload);
                    try {

                        TweetStore store = new TweetStore(sail);
                        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 {
                                tc.close();
                            }
                        } finally {
                            store.shutDown();
                        }
                    } finally {
                        sail.shutDown();
                    }
                } finally {
                    tSail.shutDown();
                }


            } finally {
                //rc.rollback();
                rc.close();
            }
        } finally {
            repo.shutDown();
        }
    }
View Full Code Here

TOP

Related Classes of com.franz.agraph.repository.AGRepository

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.