def list_topic_data_files(self, *, topic):
    topic_re = re.compile((('(?P<topic>' + re.escape(topic)) + ')-(?P<partition>[0-9]+)-(?P<offset>[0-9]+)(?P<suffix>[.a-z]*)'))
    topic_partition_files = {}
    for item in self.object_storage.list_items():
        matches = topic_re.match(item.name)
        if matches:
            partition = int(matches.group('partition'))
            if (partition not in topic_partition_files):
                topic_partition_files[partition] = []
            begin_offset = matches.group('offset')
            record = {'begin_offset': int(begin_offset), 'last_modified': item.last_modified, 'object_name': item.name}
            if (matches.group('suffix') == '.gz'):
                record['compression'] = 'gzip'
            topic_partition_files[partition].append(record)
    for partition in topic_partition_files:
        topic_partition_files[partition] = sorted(topic_partition_files[partition], key=(lambda x: x['begin_offset']))
    return topic_partition_files
def list_topic_data_files(self, *, topic):
    topic_re = re.compile((('(?P<topic>' + re.escape(topic)) + ')-(?P<partition>[0-9]+)-(?P<offset>[0-9]+)(?P<suffix>[.a-z]*)'))
    topic_partition_files = {}
    for item in self.object_storage.list_items():
        matches = topic_re.match(item.name)
        if matches:
            partition = int(matches.group('partition'))
            if (partition not in topic_partition_files):
                topic_partition_files[partition] = []
            begin_offset = matches.group('offset')
            record = {'begin_offset': int(begin_offset), 'last_modified': item.last_modified, 'object_name': item.name}
            if (matches.group('suffix') == '.gz'):
                record['compression'] = 'gzip'
            topic_partition_files[partition].append(record)
    for partition in topic_partition_files:
        topic_partition_files[partition] = sorted(topic_partition_files[partition], key=(lambda x: x['begin_offset']))
    return topic_partition_files