private void readDao(GtfsReader reader) throws IOException { dao = new GtfsRelationalDaoImpl(); reader.setEntityStore(dao); reader.setDefaultAgencyId(getFeedId().getId()); reader.run(); }
public void run(List<File> inputPaths, File outputPath) throws IOException { GtfsRelationalDaoImpl mergedDao = new GtfsRelationalDaoImpl(); mergedDao.setPackShapePoints(true); mergedDao.setPackStopTimes(true); reader.setInputLocation(inputPath); GtfsRelationalDaoImpl dao = new GtfsRelationalDaoImpl(); dao.setPackShapePoints(true); dao.setPackStopTimes(true); reader.setEntityStore(dao); reader.run();
public static void clearCaches(GtfsRelationalDao source) { if (source instanceof GtfsRelationalDaoImpl) { ((GtfsRelationalDaoImpl) source).clearAllCaches(); } }
@Override public List<AgencyAndId> getAllServiceIds() { ensureCalendarDatesByServiceIdRelation(); ensureCalendarsByServiceIdRelation(); Set<AgencyAndId> serviceIds = new HashSet<AgencyAndId>(); serviceIds.addAll(_calendarDatesByServiceId.keySet()); serviceIds.addAll(_calendarsByServiceId.keySet()); return new ArrayList<AgencyAndId>(serviceIds); }
@Override public List<ShapePoint> getShapePointsForShapeId(AgencyAndId shapeId) { ensureShapePointRelation(); return list(_shapePointsByShapeId.get(shapeId)); }
@Override public ServiceCalendar getCalendarForServiceId(AgencyAndId serviceId) { ensureCalendarsByServiceIdRelation(); List<ServiceCalendar> calendars = list(_calendarsByServiceId.get(serviceId)); switch (calendars.size()) { case 0: return null; case 1: return calendars.get(0); } throw new MultipleCalendarsForServiceIdException(serviceId); }
@Override public List<ServiceCalendarDate> getCalendarDatesForServiceId( AgencyAndId serviceId) { ensureCalendarDatesByServiceIdRelation(); return list(_calendarDatesByServiceId.get(serviceId)); }
@Override public List<AgencyAndId> getAllShapeIds() { ensureShapePointRelation(); return new ArrayList<AgencyAndId>(_shapePointsByShapeId.keySet()); }
public void clearAllCaches() { _tripAgencyIdsByServiceId = clearMap(_tripAgencyIdsByServiceId); _routesByAgency = clearMap(_routesByAgency); _stopsByStation = clearMap(_stopsByStation); _stopTimesByTrip = clearMap(_stopTimesByTrip); _stopTimesByStop = clearMap(_stopTimesByStop); _tripsByRoute = clearMap(_tripsByRoute); _tripsByShapeId = clearMap(_tripsByShapeId); _tripsByServiceId = clearMap(_tripsByServiceId); _tripsByBlockId = clearMap(_tripsByBlockId); _shapePointsByShapeId = clearMap(_shapePointsByShapeId); _frequenciesByTrip = clearMap(_frequenciesByTrip); _calendarDatesByServiceId = clearMap(_calendarDatesByServiceId); _calendarsByServiceId = clearMap(_calendarsByServiceId); _fareRulesByFareAttribute = clearMap(_fareRulesByFareAttribute); }
public void run(List<File> inputPaths, File outputPath) throws IOException { GtfsRelationalDaoImpl mergedDao = new GtfsRelationalDaoImpl(); mergedDao.setPackShapePoints(true); mergedDao.setPackStopTimes(true); reader.setInputLocation(inputPath); GtfsRelationalDaoImpl dao = new GtfsRelationalDaoImpl(); dao.setPackShapePoints(true); dao.setPackStopTimes(true); reader.setEntityStore(dao); reader.run();
public static void clearDaoCache(GtfsRelationalDao dao) { if (dao instanceof GtfsRelationalDaoImpl) { GtfsRelationalDaoImpl daoImpl = (GtfsRelationalDaoImpl) dao; daoImpl.clearAllCaches(); } } }
@Override public List<AgencyAndId> getAllServiceIds() { ensureCalendarDatesByServiceIdRelation(); ensureCalendarsByServiceIdRelation(); Set<AgencyAndId> serviceIds = new HashSet<AgencyAndId>(); serviceIds.addAll(_calendarDatesByServiceId.keySet()); serviceIds.addAll(_calendarsByServiceId.keySet()); return new ArrayList<AgencyAndId>(serviceIds); }
@Override public List<ShapePoint> getShapePointsForShapeId(AgencyAndId shapeId) { ensureShapePointRelation(); return list(_shapePointsByShapeId.get(shapeId)); }
@Override public ServiceCalendar getCalendarForServiceId(AgencyAndId serviceId) { ensureCalendarsByServiceIdRelation(); List<ServiceCalendar> calendars = list(_calendarsByServiceId.get(serviceId)); switch (calendars.size()) { case 0: return null; case 1: return calendars.get(0); } throw new MultipleCalendarsForServiceIdException(serviceId); }
@Override public List<ServiceCalendarDate> getCalendarDatesForServiceId( AgencyAndId serviceId) { ensureCalendarDatesByServiceIdRelation(); return list(_calendarDatesByServiceId.get(serviceId)); }
@Override public List<AgencyAndId> getAllShapeIds() { ensureShapePointRelation(); return new ArrayList<AgencyAndId>(_shapePointsByShapeId.keySet()); }
public void clearAllCaches() { _tripAgencyIdsByServiceId = clearMap(_tripAgencyIdsByServiceId); _routesByAgency = clearMap(_routesByAgency); _stopsByStation = clearMap(_stopsByStation); _stopTimesByTrip = clearMap(_stopTimesByTrip); _stopTimesByStop = clearMap(_stopTimesByStop); _tripsByRoute = clearMap(_tripsByRoute); _tripsByShapeId = clearMap(_tripsByShapeId); _tripsByServiceId = clearMap(_tripsByServiceId); _tripsByBlockId = clearMap(_tripsByBlockId); _shapePointsByShapeId = clearMap(_shapePointsByShapeId); _frequenciesByTrip = clearMap(_frequenciesByTrip); _calendarDatesByServiceId = clearMap(_calendarDatesByServiceId); _calendarsByServiceId = clearMap(_calendarsByServiceId); _fareRulesByFareAttribute = clearMap(_fareRulesByFareAttribute); _ridershipByTrip = clearMap(_ridershipByTrip); }
throws IOException { StoreImpl store = new StoreImpl(new GtfsRelationalDaoImpl()); store.open(); LOG.info("reading {}", gtfsBundle.toString());
public static void clearCaches(GtfsRelationalDao source) { if (source instanceof GtfsRelationalDaoImpl) { ((GtfsRelationalDaoImpl) source).clearAllCaches(); } }
private void readReferenceGtfs() throws IOException { _log.info("reading reference GTFS at " + _gtfsReferenceDirectory); GenericMutableDao dao = new GtfsRelationalDaoImpl(); _referenceReader.setEntityStore(dao); if (_agencyId != null) _referenceReader.setDefaultAgencyId(_agencyId); _referenceReader.setInputLocation(_gtfsReferenceDirectory); _referenceReader.run(); _context.setReferenceReader(_referenceReader); }