Package jdbm

Examples of jdbm.RecordManager.commit()


                }
            }
            reader.close();

            // make the data persistent in the database
            recman.commit();
            recman.close();
        } catch (IOException ie) {
            final String name = dataFile.getAbsolutePath();
            throw new IndexingFailure(name, ie);
        }
View Full Code Here


                    indexPath.getAbsolutePath(), new Properties());
            PrimaryTreeMap<String, String> tree =
                    recman.treeMap(IndexerConstants.INDEX_TREE_KEY);
            tree.inverseHashView(IndexerConstants.INVERSE_KEY);
            tree.put(key, value);
            recman.commit();
            recman.close();
        } catch (IOException e) {
            e.printStackTrace();
            fail("Failure to create temporary folder for testing.");
        }
View Full Code Here

            PrimaryTreeMap<String, SkinnyUUID> tree =
                    recman.treeMap(IndexerConstants.INDEX_TREE_KEY,
                            new SkinnyUUIDSerializer());
            tree.inverseHashView(IndexerConstants.INVERSE_KEY);
            tree.put(key, value);
            recman.commit();
            recman.close();
        } catch (IOException e) {
            e.printStackTrace();
            fail("Failure to create temporary folder for testing.");
        }
View Full Code Here

                SkinnyUUID uuid = new SkinnyUUID(UUID.randomUUID());
                tree.put(String.valueOf(i), uuid);
                uuids.add(uuid);
            }

            recman.commit();
            recman.close();
        } catch (IOException e) {
            e.printStackTrace();
            fail("Failure to create temporary folder for testing.");
        }
View Full Code Here

    RecordManager recman = new BaseRecordManager(file);
    PrimaryTreeMap<Long, String> map = recman.treeMap("aa");
    for(long i = init; i<init+size;i++){
      map.put(i, "");     
    }
    recman.commit();
    recman.defrag();
    recman.close();
    long fileSize = new File(file+".dbr.0").length()/1024;
    System.out.println("file size: "+fileSize);
    assertTrue("file is too big, compression failed", fileSize<1000);
View Full Code Here

      map.put(i, "");
      ll.add(i);
    }
     

    recman.commit();
   
    recman.clearCache();
    for(Long i:ll){
      assertTrue("failed for "+i,map.containsKey(i));
    }
View Full Code Here

      map.put(i, "");
      ll.add(i);
    }
     

    recman.commit();
   
    recman.clearCache();
    for(Integer i:ll){
      assertTrue("failed for "+i,map.containsKey(i));
    }
View Full Code Here

    RecordManager recman = new BaseRecordManager(file);
    PrimaryTreeMap<String, String> map = recman.treeMap("aa");
    for(long i = init; i<init+size/10;i++){
      map.put("aaaaa"+i, "");     
    }
    recman.commit();
    recman.defrag();   
    recman.close();
    recman = new BaseRecordManager(file);
    map = recman.treeMap("aa");
    for(long i = init; i<init+size/10;i++){
View Full Code Here

    RecordManager r = RecordManagerFactory.createRecordManager(file);
    PrimaryTreeMap<Long,StoreReference<String>> t = r.treeMap("aaa");
   
    t.put(1l, new StoreReference(r,"1"));
    t.put(2l, new StoreReference(r,"2"));
    r.commit();
   
    assertEquals("1",t.get(1l).get(r));
    assertEquals("2",t.get(2l).get(r));
   
    //reopen store
View Full Code Here

        if ( root == 0 ) {
            // create a new one
            tree = HTree.createInstance( recman );
            root = tree.getRecid();
            recman.setNamedObject( "xyz", root );
            recman.commit();
        } else {
            tree = HTree.load( recman, root );
        }

        tree.put( "Foo", "Bar" );
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.