private void loadLatestModelsRelatedToGroups( JwMap<Integer, JwSet<Integer>> m, Integer bId, JwSet<Integer> groups) { enterMonitor("AcActionSnapshotLoader.loadGroups"); try { JwList<AcBatchItem> is; JwList<AcBatchNest> ns; JwList<AcBatchAlias> as; JwList<AcBatchFlight> fs; JwTimestamp utcTs = _batch.getStartUtcTs(); is = _access.getBatchItemDb().getLatestViewBeforeByBatchGroups(bId, groups, utcTs); ns = _access.getBatchNestDb().getLatestViewBeforeByBatchGroups(bId, groups, utcTs); as = _access.getBatchAliasDb().getLatestViewBeforeByBatchGroups(bId, groups, utcTs); fs = _access.getBatchFlightDb().getLatestViewBeforeByBatchGroups(bId, groups, utcTs); for (AcBatchItem e : is) { // if ( e.hasItemId(DEBUG_ITEM_ID) ) // { // debug("x","Item "+ e.getItemId()+ " batch "+ e.getBatchId()+ " group // "+ e.getGroupCode()); // Thread.dumpStack(); // } _items.putIfMissing(e.getItemId(), e); addBatchGroup(m, e.getBatchId(), e.getGroupCode()); } for (AcBatchNest e : ns) { _nests.putIfMissing(e.getNestId(), e); addBatchGroup(m, e.getBatchId(), e.getGroupCode()); } for (AcBatchAlias e : as) { _aliases.putIfMissing(e.getAliasId(), e); // if ( _aliases.putIfMissing(e.getAliasId(), e) ) // { // if ( e.hasAliasId(DEBUG_ALIAS_ID) ) // { // debug("x", "Alias " // + e.getAliasId() // + " batch " // + e.getBatchId() // + " group " // + e.getGroupCode()); // Thread.dumpStack(); // } // } addBatchGroup(m, e.getBatchId(), e.getGroupCode()); } for (AcBatchFlight e : fs) { _flights.putIfMissing(e.getFlightId(), e); addBatchGroup(m, e.getBatchId(), e.getGroupCode()); } } finally { exitMonitor(); } }
private void fillDatabaseNests(JwSet<Integer> nestIds) { JwList<AcBatchNest> v = _access.getBatchNestDb().getBatchNestsBefore(_batch.getStartUtcTs(), nestIds); for (AcBatchNest e : v) { Integer id = e.getNestId(); if (isNestLoaded(id)) continue; _nests.put(id, e); if (e.hasGroupCode()) { // debug("1", "Nest "+ e.getNestId()+ " batch "+ e.getBatchId()+ " group "+ // e.getGroupCode()); addBatchGroup(_batchGroups, e.getBatchId(), e.getGroupCode()); } } }