Package com.mongodb

Examples of com.mongodb.DBCollection.update()


    BasicDBObject update = new BasicDBObject(MongoDbManager.set_, new BasicDBObject(AssociationFeaturePojo.db_sync_prio_, dPrio));
    if (_diagnosticMode) {
      System.out.println("EntityAggregationUtils.markAssociationFeatureForSync, featureDB: " + query.toString() + " / " + update.toString());       
    }
    else {
      assocFeatureDb.update(query, update, false, true);
    }
  }//TESTED
}
View Full Code Here


              // Be efficient and write field-by-field vs using JSON conversion
              BasicDBObject query = new BasicDBObject(CompressedFullTextPojo.url_, gzippedContent.getUrl());
              query.put(CompressedFullTextPojo.sourceKey_, gzippedContent.getSourceKey());
              BasicDBObject update = gzippedContent.getUpdate();
              if (!_diagnosticMode) {
                contentDb.update(query, update, true, false); // (ie upsert, supported because query includes shard key==url)
              }
              else {
                System.out.println("StoreAndIndexManager.savedContent, save content: " + gzippedContent.getUrl());
              }
            }
View Full Code Here

                }
              }
             
              if (!_diagnosticMode) {
                // Store the object
                col.update(query, new BasicDBObject(MongoDbManager.set_, baseFields));
              }
              else {
                System.out.println("EntityAggregationUtils.updateEntityFeatures, not found: " + query.toString() + ": " + baseFields.toString());
              }
              entFeature.setDbSyncTime(null); // (ensures that index re-sync will occur)   
View Full Code Here

        synchronized (GenericProcessingController.class) {
          // Because this op can be slow, and traverse a lot of disk, need to ensure that
          // we don't allow all the threads to hammer it at once (the updates all yield to each other
          // enough that the disk goes totally crazy)
         
          docDb.update(query1, multiopA, false, true);
          DbManager.getDocument().getLastError(DbManager.getDocument().getMetadata().getName());
            // (enforce consecutive accesses for this potentially very slow operation)
        }
       
        // Was originally checked updatedExisting but for INF-1406, it sometimes seemed to be
View Full Code Here

        else {
          System.out.println("(WOULD NOT RUN) EntityAggregationUtils.synchronizeEntityFeature, featureDB: " + query.toString() + " / " + update.toString());         
        }
      }
      else {
        entityFeatureDb.update(query, update, false, true);
      }
    }

    if (_diagnosticMode) {
      System.out.println("EntityAggregationUtils.synchronizeEntityFeature, synchronize: " + new StringBuffer(entityFeature.getIndex()).append(':').append(communityId).toString() + " = " +
View Full Code Here

    BasicDBObject update = new BasicDBObject(MongoDbManager.set_, new BasicDBObject(EntityFeaturePojo.db_sync_prio_, dPrio));
    if (_diagnosticMode) {
      System.out.println("EntityAggregationUtils.markEntityFeatureForSynchronization, featureDB: " + query.toString() + " / " + update.toString());       
    }
    else {
      entityFeatureDb.update(query, update, false, true);
    }
  }//TESTED
}
View Full Code Here

          updateSub.put(EntityFeaturePojo.totalfreq_, val.totalfreq);
          updateSub.put(EntityFeaturePojo.db_sync_prio_, dPrio);
          BasicDBObject update = new BasicDBObject(MongoDbManager.set_, updateSub);
          //DEBUG
          //System.out.println("UPDATE: " + lookupKey.index + "/" + lookupKey.communityId + ": " + updateQuery + " / " + update.toString() + " (" + nUpdated);
          entityFeatureColl.update(updateQuery, update);
          nUpdated++;
        }//TESTED
        else {
          //DEBUG
          //System.out.println("IGNORE: " + lookupKey.index + "/" + lookupKey.communityId + ": " + val.doccount);         
View Full Code Here

      }
      update.put(SourcePojo.searchCycle_secs_, sourceToUpdate.getSearchCycle_secs());
    }
    DBCollection sourceDb = DbManager.getIngest().getSource();
    BasicDBObject query = new BasicDBObject(SourcePojo._id_, sourceToUpdate.getId());
    sourceDb.update(query, new BasicDBObject(MongoDbManager.set_, update));
  }
  /**
   * logMessage
   * Logs temporary messages
   * should switch sourcepojo to use correct id field and search on that.
View Full Code Here

        singleEvt.setEntity1_index(evt.getEntity1_index());
        singleEvt.setEntity2_index(evt.getEntity2_index());
        singleEvt.setVerb_category(evt.getVerb_category());
        singleEvt.setGeo_index(evt.getGeo_index());
        evt.setIndex(AssociationAggregationUtils.getEventFeatureIndex(singleEvt));
        eventFeatureDB.update(new BasicDBObject("_id", dbo.get("_id")),
                      new BasicDBObject(MongoDbManager.set_,
                          new BasicDBObject(AssociationFeaturePojo.index_, evt.getIndex())), false, true);
          // (has to be a multi-update even though it's unique because it's sharded on index)
      }
     
View Full Code Here

      lockObj.put(oneUp_, newOneUp);
      lockObj.put(lastUpdated_, new Date());
      BasicDBObject queryObj = new BasicDBObject();
      queryObj.put(hostname_, _savedHostname);
      queryObj.put(oneUp_, _savedOneUp);
      WriteResult wr = cachedCollection.update(queryObj, new BasicDBObject(MongoDbManager.set_, lockObj), false, true);
        // (need the true in case the db is sharded)
     
      if (wr.getN() > 0) {
        _savedOneUp = newOneUp;
        _bHaveControl = true;
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.