Exemplo n.º 1
0
 def get_lookback_dataset(self, key, time_range, deployments, request_id=None):
     first_metadata = get_first_before_metadata(key, time_range.start)
     if CASS_LOCATION_NAME in first_metadata:
         locations = first_metadata[CASS_LOCATION_NAME]
         return get_cass_lookback_dataset(key, time_range.start, locations.bin_list[0], deployments, request_id)
     elif SAN_LOCATION_NAME in first_metadata:
         locations = first_metadata[SAN_LOCATION_NAME]
         return get_san_lookback_dataset(key, TimeRange(locations.start_time, time_range.start),
                                         locations.bin_list[0], deployments)
     else:
         return None
Exemplo n.º 2
0
 def get_lookback_dataset(self,
                          key,
                          time_range,
                          deployments,
                          request_id=None):
     first_metadata = get_first_before_metadata(key, time_range.start)
     if CASS_LOCATION_NAME in first_metadata:
         locations = first_metadata[CASS_LOCATION_NAME]
         return get_cass_lookback_dataset(key, time_range.start,
                                          locations.bin_list[0],
                                          deployments, request_id)
     elif SAN_LOCATION_NAME in first_metadata:
         locations = first_metadata[SAN_LOCATION_NAME]
         return get_san_lookback_dataset(
             key, TimeRange(locations.start_time, time_range.start),
             locations.bin_list[0], deployments)
     else:
         return None
Exemplo n.º 3
0
    def get_lookback_dataset(self, key, request_time_range, deployment_start_time, request_id=None):
        first_metadata_before = get_first_before_metadata(key, request_time_range.start)
        if CASS_LOCATION_NAME in first_metadata_before:
            locations = first_metadata_before[CASS_LOCATION_NAME]

            return get_cass_lookback_dataset(key, request_time_range.start, locations.bin_list[0],
                                             deployment_start_time, request_id)
        elif SAN_LOCATION_NAME in first_metadata_before:
            locations = first_metadata_before[SAN_LOCATION_NAME]

            # Note that the deployments list was originally hardcoded to an empty list ([]) in
            # StreamDataset.fetch_raw_data(). That same hard code is moved to the function
            # call below to preserve the behavior of that function while changing the behavior
            # of the above call to get_cass_lookback_dataset. I would think that the
            # hard coded empty list of deployment numbers should be removed from the call
            # below at some point in the future as well. Note that since the list of deployments
            # is empty, the function call below returns an empty list.
            return get_san_lookback_dataset(key, TimeRange(locations.start_time, request_time_range.start),
                                            locations.bin_list[0], [])
        else:
            return None