Depends on D3757.
Details
Details
- Reviewers
anlambert - Group Reviewers
Reviewers - Commits
- rDSTOb11b890894e9: cassandra.storage: remove dead code
Diff Detail
Diff Detail
- Repository
- rDSTO Storage manager
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Event Timeline
Comment Actions
Build is green
Patch application report for D3758 (id=13222)
Could not rebase; Attempt merge onto 7d332f5967...
Updating 7d332f59..b967ca48 Fast-forward swh/storage/cassandra/common.py | 8 +- swh/storage/cassandra/converters.py | 37 ++- swh/storage/cassandra/cql.py | 541 +++++++++++++++++------------------- swh/storage/cassandra/model.py | 196 +++++++++++++ swh/storage/cassandra/schema.py | 1 - swh/storage/cassandra/storage.py | 193 +++++++------ swh/storage/in_memory.py | 4 +- swh/storage/interface.py | 4 +- swh/storage/storage.py | 2 +- swh/storage/tests/test_cassandra.py | 30 +- 10 files changed, 602 insertions(+), 414 deletions(-) create mode 100644 swh/storage/cassandra/model.py
Changes applied before test
commit b967ca48ce6f97e9315bc25d5b8a48fb0bf59340
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Mon Aug 10 21:42:59 2020 +0200
cassandra.storage: remove dead code
commit 564a4d2590ae7f468f2b0b7377d0b2d91eeaac56
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Mon Aug 10 21:36:41 2020 +0200
Fix type of snapshot_count_branches.
commit 3d3ac1605129097740c24ccc48a8519a1b9b78a3
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Mon Aug 10 21:33:00 2020 +0200
cassandra.cql: Use static dataclasses instead of generating namedtuples on the fly.
Before this commit, python-cassandra used the default row factory,
which creates anonymous named tuple on each query, which makes it
impossible to type CqlRunner properly.
This commit replaces the row factory with dict_factory, which creates
only dicts, and converts them to well-defined dataclasses.
Additionally, this stop leaking python-cassandra internals to
cassandra.storage.
This also has some great side-effects:
* methods of CqlRunner are now consistent with each other (eg. _add_one
methods used to be a mix of objects, dictionaries, and taking each value
as argument)
* it will allow me to deduplicate more codes in further commits (I
already deduplicated insertions methods to use self._add_one, as
it was meant on the initial write of this class)
* CqlRunner no longer needs to define lists with column names, they are
automatically detected from the dataclassesSee https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/722/ for more details.
Comment Actions
Build is green
Patch application report for D3758 (id=13229)
Could not rebase; Attempt merge onto 7d332f5967...
Updating 7d332f59..b11b8908 Fast-forward swh/storage/cassandra/common.py | 8 +- swh/storage/cassandra/converters.py | 37 ++- swh/storage/cassandra/cql.py | 541 +++++++++++++++++------------------- swh/storage/cassandra/model.py | 196 +++++++++++++ swh/storage/cassandra/schema.py | 1 - swh/storage/cassandra/storage.py | 193 +++++++------ swh/storage/in_memory.py | 4 +- swh/storage/interface.py | 4 +- swh/storage/storage.py | 2 +- swh/storage/tests/test_cassandra.py | 30 +- 10 files changed, 602 insertions(+), 414 deletions(-) create mode 100644 swh/storage/cassandra/model.py
Changes applied before test
commit b11b890894e9112d403a3fe372cfd639d59b6953
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Mon Aug 10 21:42:59 2020 +0200
cassandra.storage: remove dead code
commit f954714d95fa3e2124fbeddd3e81ad09e18ca313
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Mon Aug 10 21:36:41 2020 +0200
Fix type of snapshot_count_branches.
commit 319de05d5fbebbebb47532209490a2f8380f5343
Author: Valentin Lorentz <vlorentz@softwareheritage.org>
Date: Mon Aug 10 21:33:00 2020 +0200
cassandra.cql: Use static dataclasses instead of generating namedtuples on the fly.
Before this commit, python-cassandra used the default row factory,
which creates anonymous named tuple on each query, which makes it
impossible to type CqlRunner properly.
This commit replaces the row factory with dict_factory, which creates
only dicts, and converts them to well-defined dataclasses.
Additionally, this stop leaking python-cassandra internals to
cassandra.storage.
This also has some great side-effects:
* methods of CqlRunner are now consistent with each other (eg. _add_one
methods used to be a mix of objects, dictionaries, and taking each value
as argument)
* it will allow me to deduplicate more codes in further commits (I
already deduplicated insertions methods to use self._add_one, as
it was meant on the initial write of this class)
* CqlRunner no longer needs to define lists with column names, they are
automatically detected from the dataclassesSee https://jenkins.softwareheritage.org/job/DSTO/job/tests-on-diff/728/ for more details.