Package org.fusesource.hawtdb.api

Examples of org.fusesource.hawtdb.api.TxPageFileFactory


    private TxPageFileFactory pff;
    private TxPageFile pf;


    protected TxPageFileFactory createConcurrentPageFileFactory() {
        TxPageFileFactory rc = new TxPageFileFactory();
        rc.setPageSize((short) 512);
        rc.setFile(new File("target/test-data/" + getClass().getName() + ".db"));
        return rc;
    }
View Full Code Here


            return new IndexActor();
        };
    };

    public IndexBenchmark() {
        TxPageFileFactory hawtPageFileFactory = new TxPageFileFactory();
        hawtPageFileFactory.setFile(new File("target/test-data/" + getClass().getName() + ".db"));
        hawtPageFileFactory.setSync(false);
         // Limit file growth to 1 Gig.
        hawtPageFileFactory.setMaxFileSize(1024*1024*1024);
        benchmark.setHawtPageFileFactory(hawtPageFileFactory);
    }
View Full Code Here

    private int samples = 3;
    private int period = 1000*5;
    private TxPageFileFactory hawtPageFileFactory;
   
    public void benchmark(int actorCount, BenchmarkAction<A> action) throws Exception {
        TxPageFileFactory pff = getHawtPageFileFactory();
        pff.getFile().delete();
        pff.open();
        try {
            if( setup!=null ) {
                setup.run(pff);
            }
            TxPageFile pf = pff.getTxPageFile();
            Benchmarker benchmark = new Benchmarker();
            benchmark.setSamples(samples);
            benchmark.setPeriod(period);
            benchmark.setName(action.getName());
            ArrayList<A> actors = createActors(pf, actorCount, action);
            benchmark.benchmark(actors, createMetrics(action));
        } finally {
            try {
                if( tearDown!=null ) {
                    tearDown.run(pff);
                }
            } finally {
                pff.close();
            }
        }
    }
View Full Code Here

    public void setHawtPageFileFactory(TxPageFileFactory hawtPageFileFactory) {
        this.hawtPageFileFactory = hawtPageFileFactory;
    }
    public TxPageFileFactory getHawtPageFileFactory() {
        if( hawtPageFileFactory==null ) {
            hawtPageFileFactory = new TxPageFileFactory();
            hawtPageFileFactory.setFile(new File("target/test-data/" + getClass().getName() + ".db"));
        }
        return hawtPageFileFactory;
    }   
View Full Code Here

    protected TxPageFile pf;
    protected Index<String,Long> index;
    protected Transaction tx;
   
    protected TxPageFileFactory createConcurrentPageFileFactory() {
        TxPageFileFactory rc = new TxPageFileFactory();
        rc.setFile(new File("target/test-data/" + getClass().getName() + ".db"));
        return rc;
    }
View Full Code Here

        //
        executor.shutdownNow();
    }

    protected TxPageFileFactory createConcurrentPageFileFactory() throws IOException {
        TxPageFileFactory rc = new TxPageFileFactory();
        rc.setFile(File.createTempFile(getClass().getName(), ".db"));
        return rc;
    }
View Full Code Here

      }

      try {

        logDbFactory = new TxPageFileFactory();

        logDbFactory.setFile(new File(logDbPath));
        logDbFactory.open();

        logDb = logDbFactory.getTxPageFile();
View Full Code Here

TOP

Related Classes of org.fusesource.hawtdb.api.TxPageFileFactory

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.