Exemplo n.º 1
0
  private void fillNests(JwSet<Integer> nestIds) {
    enterMonitor("AcActionSnapshotLoader.fillNest");
    try {
      if (nestIds.isEmpty()) return;

      // we need to continue loading nests until all parent and
      // top nests have been loaded into the snapshot.
      // also load all any aliases for nests newly loaded nests.
      JwSet<Integer> aliasIds = new JwSet<Integer>();
      while (nestIds.isNotEmpty()) {
        fillDatabaseNests(nestIds);
        fillMissingNests(nestIds);

        // determine missing nest ids
        JwSet<Integer> allNestIds = AcBatchNest.collectNestIds(_nests.values());
        JwSet<Integer> loadedNestIds = AcBatchNest.collectIds(_nests.values());
        nestIds = allNestIds;
        nestIds.removeAll(loadedNestIds);

        // determine missing alias ids
        JwSet<Integer> allAliasIds = AcBatchNest.collectAliasIds(_nests.values());
        JwSet<Integer> loadedAliasIds = AcBatchAlias.collectIds(_aliases.values());
        aliasIds = allAliasIds;
        aliasIds.removeAll(loadedAliasIds);
        fillAliases(aliasIds);
      }
    } finally {
      exitMonitor();
    }
  }
Exemplo n.º 2
0
  private void addMissingBatchGroups(
      JwMap<Integer, JwSet<Integer>> m1, JwMap<Integer, JwSet<Integer>> m2) {
    Iterator<Entry<Integer, JwSet<Integer>>> i = m2.entrySet().iterator();
    while (i.hasNext()) {
      Entry<Integer, JwSet<Integer>> entry = i.next();

      Integer batchId = entry.getKey();
      JwSet<Integer> ms = entry.getValue();

      JwSet<Integer> bs = m1.get(batchId);
      if (bs != null) ms.removeAll(bs);
      else {
        bs = new JwSet<Integer>();
        m1.put(batchId, bs);
      }

      if (ms.isEmpty()) i.remove();
      else bs.addAll(ms);
    }
  }
Exemplo n.º 3
0
 private void removeLoaded(JwSet<Integer> dbIds, Set<Integer> loadedIds) {
   dbIds.removeAll(loadedIds);
 }
Exemplo n.º 4
0
 private void removeLoadedIds(JwSet<Integer> ids, Set<Integer> loadedIds) {
   ids.removeAll(loadedIds);
 }