Package org.fusesource.hawtdb.api

Examples of org.fusesource.hawtdb.api.PageFileFactory


    @Test
    public void testBugOnBigIndex() throws IOException {
        File tmpFile = File.createTempFile("hawtdb", "test");

        PageFileFactory pageFactory = new PageFileFactory();
        pageFactory.setFile(tmpFile);
        pageFactory.open();

        PageFile page = pageFactory.getPageFile();

        BTreeIndexFactory<String, String> indexFactory = new BTreeIndexFactory<String, String>();
        indexFactory.setComparator(new Comparator<String>() {
            public int compare(String o1, String o2) {
                return o1.compareTo(o2) * -1;
            }
        });

        SortedIndex<String, String> index = indexFactory.create(page);

        int total = 10000;
        Random generator = new Random();
        for (int i = 0; i < total; i++) {
            index.put("" + generator.nextLong(), "");
        }

        pageFactory.close();
    }
View Full Code Here


  private PageFileFactory pff;
    private PageFile paged;

    protected PageFileFactory createPageFileFactory() {
      PageFileFactory rc = new PageFileFactory();
      rc.setMappingSegementSize(rc.getPageSize()*3);
      rc.setFile(new File("target/test-data/"+getClass().getName()+".db"));
      return rc;
  }
View Full Code Here

    private PageFile pf;
    SortedIndex<Long, String> index;


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

TOP

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

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.