Beispiel #1
0
 @Test
 public void testGetHashMap() throws Exception {
   Map m1 = db.getHashMap("test");
   m1.put(1, 2);
   m1.put(3, 4);
   assertTrue(m1 == db.getHashMap("test"));
   assertEquals(m1, new DB(engine).getHashMap("test"));
 }
Beispiel #2
0
  @Test
  public void getAll() {
    db.createAtomicString("aa", "100");
    db.getHashMap("zz").put(11, "12");
    Map all = db.getAll();

    assertEquals(2, all.size());
    assertEquals("100", ((Atomic.String) all.get("aa")).get());
    assertEquals("12", ((HTreeMap) all.get("zz")).get(11));
  }
  public CAGtreeRanking(String dbName) {
    DBName = dbName;
    grid = new Grid(0f, 10000f, 0f, 10000f, (short) 2000);

    loadDB();
    //		docMap = db.getHashMap("docMap");
    textualMap = db.getHashMap("textualMap");
    //		spatialMap = db.getHashMap("spatialMap");
    gtreeAPI = new GTreeAPI();
    //		docLists = new HashMap<String, Vector<ItemSpatialDoc>>();
    textualLists = new HashMap<String, Vector<ItemTextual>>();
    //		spatialLists = new HashMap<String, Vector<ItemSpatialCurve>>();
  }
Beispiel #4
0
  public GitConverter(@NotNull File cachePath, @NotNull File basePath, @NotNull String[] suffixes)
      throws IOException {
    this.basePath = basePath;
    this.suffixes = suffixes.clone();

    tempPath = new File(basePath, "lfs/tmp");
    makeParentDirs(tempPath);
    makeParentDirs(cachePath);
    cache =
        DBMaker.newFileDB(new File(cachePath, "git-lfs-migrate.mapdb"))
            .asyncWriteEnable()
            .mmapFileEnable()
            .cacheSoftRefEnable()
            .make();
    cacheSha256 = cache.getHashMap("sha256");
  }
Beispiel #5
0
 @Test(expected = IllegalArgumentException.class)
 public void testCollectionExists() {
   db.getHashMap("test");
   db.checkNameNotExists("test");
 }
Beispiel #6
0
 @Test
 public void rename() {
   db.getHashMap("zz").put(11, "12");
   db.rename("zz", "aa");
   assertEquals("12", db.getHashMap("aa").get(11));
 }
Beispiel #7
0
 @Test(expected = IllegalAccessError.class)
 public void testClose() throws Exception {
   db.close();
   db.getHashMap("test");
 }