OLD | NEW |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 """gzip-based storage. | 2 """gzip-based storage. |
3 | 3 |
4 Only supports task storage at the moment. | 4 Only supports task storage at the moment. |
5 """ | 5 """ |
6 | 6 |
7 import gzip | 7 import gzip |
8 import os | 8 import os |
9 import time | 9 import time |
10 | 10 |
11 from plaso.lib import definitions | 11 from plaso.lib import definitions |
12 from plaso.lib import platform_specific | 12 from plaso.lib import platform_specific |
13 from plaso.serializer import json_serializer | 13 from plaso.serializer import json_serializer |
14 from plaso.storage import identifiers | 14 from plaso.storage import identifiers |
15 from plaso.storage import interface | 15 from plaso.storage import interface |
16 | 16 |
17 | 17 |
18 class GZIPStorageFile(interface.BaseFileStorage): | 18 class GZIPStorageFile(interface.BaseFileStorage): |
19 """Class that defines the gzip-based storage file.""" | 19 """gzip-based storage file.""" |
20 | 20 |
21 # pylint: disable=abstract-method | 21 # pylint: disable=abstract-method |
22 | 22 |
23 _COMPRESSION_LEVEL = 9 | 23 _COMPRESSION_LEVEL = 9 |
24 | 24 |
25 _DATA_BUFFER_SIZE = 1 * 1024 * 1024 | 25 _DATA_BUFFER_SIZE = 1 * 1024 * 1024 |
26 | 26 |
27 def __init__(self, storage_type=definitions.STORAGE_TYPE_TASK): | 27 def __init__(self, storage_type=definitions.STORAGE_TYPE_TASK): |
28 """Initializes a storage. | 28 """Initializes a storage. |
29 | 29 |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 | 471 |
472 def __init__(self, path): | 472 def __init__(self, path): |
473 """Initializes a storage reader. | 473 """Initializes a storage reader. |
474 | 474 |
475 Args: | 475 Args: |
476 path (str): path to the input file. | 476 path (str): path to the input file. |
477 """ | 477 """ |
478 super(GZIPStorageFileReader, self).__init__(path) | 478 super(GZIPStorageFileReader, self).__init__(path) |
479 self._storage_file = GZIPStorageFile() | 479 self._storage_file = GZIPStorageFile() |
480 self._storage_file.Open(path=path) | 480 self._storage_file.Open(path=path) |
OLD | NEW |