Examples of IdMapIterator


Examples of de.fhg.igd.mongomvcc.helper.IdMapIterator

    //mark dirty objects as inserted
    String instimeAttr = MongoDBConstants.LIFETIME + ".i" + getRootCid();
    for (Map.Entry<String, IdMap> e : dos.entrySet()) {
      DBCollection dbc = db.getCollection(e.getKey());
      IdMap m = e.getValue();
      IdMapIterator li = m.iterator();
      while (li.hasNext()) {
        li.advance();
        long oid = li.value();
        if (oid == -1) {
          //the document has been inserted and then deleted again
          //do not save time of insertion
          continue;
        }
View Full Code Here

Examples of de.fhg.igd.mongomvcc.helper.IdMapIterator

    o.put(PARENT_CID, commit.getParentCID());
    o.put(ROOT_CID, commit.getRootCID());
    DBObject objs = new BasicDBObject();
    for (Map.Entry<String, IdMap> e : commit.getObjects().entrySet()) {
      DBObject co = new BasicDBObject();
      IdMapIterator it = e.getValue().iterator();
      while (it.hasNext()) {
        it.advance();
        co.put(String.valueOf(it.key()), it.value());
      }
      objs.put(e.getKey(), co);
    }
    o.put(OBJECTS, objs);
    _commits.insert(o);
View Full Code Here

Examples of de.fhg.igd.mongomvcc.helper.IdMapIterator

    //read objects from the given commit and put them into the index
    for (Map.Entry<String, IdMap> e : c.getObjects().entrySet()) {
      IdMap m = getObjects(e.getKey());
      IdSet o = getOIDs(e.getKey());
      IdMapIterator it = e.getValue().iterator();
      while (it.hasNext()) {
        it.advance();
        if (it.value() < 0) {
          //deleted object
          long prev = m.get(it.key());
          if (prev != 0) {
            m.remove(it.key());
            o.remove(prev);
          }
        } else {
          long prev = m.put(it.key(), it.value());
          if (prev != 0) {
            //overwrite object with new value
            o.remove(prev);
          }
          o.add(it.value());
        }
      }
    }
  }
View Full Code Here

Examples of de.fhg.igd.mongomvcc.helper.IdMapIterator

      Commit c = Tree.deserializeCommit(o);
      Map<String, IdMap> allObjs = c.getObjects();
      IdMap objs = allObjs.get(collection);
      if (objs != null) {
        //eliminate OIDs referenced by this commit
        IdMapIterator mi = objs.iterator();
        while (mi.hasNext()) {
          mi.advance();
          oids.remove(mi.value());
        }
      }
    }
   
    //the remaining OIDs must be the unreferenced ones
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.