def _read_v4(filename): try: key = _bucket_v4.get_key(filename) key.open_read() return parse_heka_message(key) except ssl.SSLError: return []
def _read_v4_range(filename_chunk): try: filename, chunk = filename_chunk start = _chunk_size*chunk key = _bucket_v4.get_key(filename) key.open_read(headers={'Range': "bytes={}-".format(start)}) return parse_heka_message(key, boundary_bytes=_chunk_size) except ssl.SSLError: return []
def _read_v4_range(filename_chunk): try: filename, chunk = filename_chunk start = _chunk_size * chunk key = _bucket_v4.get_key(filename) key.open_read(headers={'Range': "bytes={}-".format(start)}) return parse_heka_message(key, boundary_bytes=_chunk_size) except ssl.SSLError: return []
def _read(filename): try: key = _bucket.get_key(filename) if key is None: # In some rare cases it's not possible to retrieve the content of a # file (see bug 1282441 for more details). # Let's log the problem and move on. logger.error("File not found: {}".format(filename)) return [] key.open_read() return parse_heka_message(key) except ssl.SSLError: return []