Package com.ikanow.infinit.e.processing.generic.aggregation

Examples of com.ikanow.infinit.e.processing.generic.aggregation.AggregationManager


    // (then can store feeds - doesn't matter that the event/entities have been modified by the aggregation)
    // 3. (Scheduled for efficiency) Update all documents' frequencies based on new entities and events
    // 4. (Scheduled for efficiency) Synchronize with index [after this, queries can find them - so (2) must have happened]
      // (Syncronization currently "corrupts" the entities so needs to be run last)

    AggregationManager perSourceAggregation = null;
   
    if (!props.getAggregationDisabled()) {
      perSourceAggregation = new AggregationManager();
    }
   
    // 1+2]
    if (null != perSourceAggregation) {
      perSourceAggregation.doAggregation(toAdd, toDelete);
      perSourceAggregation.createOrUpdateFeatureEntries();
    }
   
    // Save feeds to feeds collection in MongoDb
    // (second field determines if content gets saved)
    if (null != perSourceAggregation) {
      perSourceAggregation.applyAggregationToDocs(toAdd);
        // (First save aggregated statistics back to the docs' entity/event instances)
    }
    storeFeeds(toAdd, (harvestType != InfiniteEnums.DATABASE), source);

    // Then finish aggregation:
   
    if (null != perSourceAggregation) {
      // 3] 
      perSourceAggregation.runScheduledDocumentUpdates();
     
      // 4] This needs to happen last because it "corrupts" the entities and events
      perSourceAggregation.runScheduledSynchronization();
    }
   
  }//TESTED (by eye - logic is v simple)
View Full Code Here


  }
  //___________________________________________________________________________________________________
 
  private void doAggregation(Map<ObjectId, LinkedList<DocumentPojo>> communityList, LinkedList<DocumentPojo> singleList) {
    if (null == communityList) { // just one community this one is easy
      AggregationManager aggManager = new AggregationManager();
      aggManager.doAggregation(singleList, new LinkedList<DocumentPojo>());     
      aggManager.createOrUpdateFeatureEntries();        
      aggManager.applyAggregationToDocs(singleList);
      aggManager.runScheduledDocumentUpdates();
      aggManager.runScheduledSynchronization();
    }
    else {         
      for (Map.Entry<ObjectId, LinkedList<DocumentPojo>> entry: communityList.entrySet()) {
        AggregationManager aggManager = new AggregationManager();
        aggManager.doAggregation(entry.getValue(), new LinkedList<DocumentPojo>());
        aggManager.createOrUpdateFeatureEntries();
        aggManager.applyAggregationToDocs(entry.getValue());
        aggManager.runScheduledDocumentUpdates();
        aggManager.runScheduledSynchronization();
      }
    }//TESTED
   
    // Finally, need to update all the docs (ick)
    DocumentPojo dummy = new DocumentPojo();
View Full Code Here

TOP

Related Classes of com.ikanow.infinit.e.processing.generic.aggregation.AggregationManager

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.