Skip to content

Commit

Permalink
scylla_node: add datafiles param to ScyllaNode.dump_sstables()
Browse files Browse the repository at this point in the history
it turns out we do have a use case in dtest where the caller
of `node.run_sstable2json()` passes a single sstable to
this method. so let's cater its needs.

see compaction_additional_test.py

Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov authored and fruch committed Aug 2, 2023
1 parent b2a4b5a commit 1d2bf06
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions ccmlib/scylla_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import threading
from pathlib import Path
from collections import OrderedDict
from typing import Any, Dict, List
from typing import Any, Dict, List, Optional

import logging

Expand Down Expand Up @@ -1438,11 +1438,13 @@ def do_invoke(sstables):

def dump_sstables(self,
keyspace: str,
column_family: str) -> List[Dict[str, Any]]:
column_family: str,
datafiles: Optional[List[str]] = None) -> List[Dict[str, Any]]:
"""dump the partitions in the specified table using `scylla sstable dump-data`
:param keyspace: restrict the operation to sstables of this keyspace
:param column_family: restrict the operation to sstables of this column_family
:param datafiles: restrict the operation to the given sstables
:return: return all the partitions collected in the specified sstables
:raises: subprocess.CalledProcessError if scylla-sstable returns a non-zero exit code.
Expand Down Expand Up @@ -1474,6 +1476,7 @@ def dump_sstables(self,
sstable_dumps = self.run_scylla_sstable('dump-data', ['--merge'],
keyspace=keyspace,
column_families=[column_family],
datafiles=datafiles,
batch=True)
assert '' in sstable_dumps
stdout, _ = sstable_dumps['']
Expand Down

0 comments on commit 1d2bf06

Please sign in to comment.