class WarehouseServiceImpl implements WarehouseService {

    private final List<AbstractRealTimeDataStorage> realTimeDataStorages;

    public WarehouseServiceImpl(List<AbstractRealTimeDataStorage> realTimeDataStorages) {
        this.realTimeDataStorages = realTimeDataStorages;
    }

    @Override
    public List<CollectRep.MetricsData> queryMonitorMetricsData(Long monitorId) {<FILL_FUNCTION_BODY>}
}

        AbstractRealTimeDataStorage realTimeDataStorage = realTimeDataStorages.stream()
                .filter(AbstractRealTimeDataStorage::isServerAvailable)
                .max((o1, o2) -> {
                    if (o1 instanceof RealTimeMemoryDataStorage) {
                        return -1;
                    } else if (o2 instanceof RealTimeMemoryDataStorage) {
                        return 1;
                    } else {
                        return 0;
                    }
                }).orElse(null);
        if (realTimeDataStorage == null) {
            log.error("real time store not available");
            return Collections.emptyList();
        }
        return realTimeDataStorage.getCurrentMetricsData(monitorId);
    
<no_super_class>