Skip to content

Commit 8750ef7

Browse files
committed
Remove MMFiles only feature journalSize
Remove related journal rotation API method and error.
1 parent 1de3f24 commit 8750ef7

File tree

5 files changed

+3
-38
lines changed

5 files changed

+3
-38
lines changed

arango/collection.py

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
CollectionResponsibleShardError,
1616
CollectionRenameError,
1717
CollectionRevisionError,
18-
CollectionRotateJournalError,
1918
CollectionStatisticsError,
2019
CollectionTruncateError,
2120
CollectionUnloadError,
@@ -307,22 +306,18 @@ def response_handler(resp):
307306

308307
return self._execute(request, response_handler)
309308

310-
def configure(self, sync=None, journal_size=None):
309+
def configure(self, sync=None):
311310
"""Configure collection properties.
312311
313312
:param sync: Block until operations are synchronized to disk.
314313
:type sync: bool
315-
:param journal_size: Journal size in bytes.
316-
:type journal_size: int
317314
:return: New collection properties.
318315
:rtype: dict
319316
:raise arango.exceptions.CollectionConfigureError: If operation fails.
320317
"""
321318
data = {}
322319
if sync is not None:
323320
data['waitForSync'] = sync
324-
if journal_size is not None:
325-
data['journalSize'] = journal_size
326321

327322
request = Request(
328323
method='put',
@@ -470,25 +465,6 @@ def response_handler(resp):
470465

471466
return self._execute(request, response_handler)
472467

473-
def rotate(self):
474-
"""Rotate the collection journal.
475-
476-
:return: True if collection journal was rotated successfully.
477-
:rtype: bool
478-
:raise arango.exceptions.CollectionRotateJournalError: If rotate fails.
479-
"""
480-
request = Request(
481-
method='put',
482-
endpoint='/_api/collection/{}/rotate'.format(self.name),
483-
)
484-
485-
def response_handler(resp):
486-
if not resp.is_success:
487-
raise CollectionRotateJournalError(resp, request)
488-
return True # pragma: no cover
489-
490-
return self._execute(request, response_handler)
491-
492468
def truncate(self):
493469
"""Delete all documents in the collection.
494470

arango/database.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,6 @@ def create_collection(self,
949949
name,
950950
sync=False,
951951
system=False,
952-
journal_size=None,
953952
edge=False,
954953
user_keys=True,
955954
key_increment=None,
@@ -974,8 +973,6 @@ def create_collection(self,
974973
:param system: If set to True, a system collection is created. The
975974
collection name must have leading underscore "_" character.
976975
:type system: bool
977-
:param journal_size: Max size of the journal in bytes.
978-
:type journal_size: int
979976
:param edge: If set to True, an edge collection is created.
980977
:type edge: bool
981978
:param key_generator: Used for generating document keys. Allowed values
@@ -1055,8 +1052,6 @@ def create_collection(self,
10551052
'keyOptions': key_options,
10561053
'type': 3 if edge else 2
10571054
}
1058-
if journal_size is not None:
1059-
data['journalSize'] = journal_size
10601055
if shard_count is not None:
10611056
data['numberOfShards'] = shard_count
10621057
if shard_fields is not None:

arango/exceptions.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,10 +245,6 @@ class CollectionUnloadError(ArangoServerError):
245245
"""Failed to unload collection."""
246246

247247

248-
class CollectionRotateJournalError(ArangoServerError):
249-
"""Failed to rotate collection journal."""
250-
251-
252248
class CollectionRecalculateCountError(ArangoServerError):
253249
"""Failed to recalculate document count."""
254250

docs/collection.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Here is an example showing how you can manage standard collections:
4646
students.load()
4747
students.unload()
4848
students.truncate()
49-
students.configure(journal_size=3000000)
49+
students.configure()
5050

5151
# Delete the collection.
5252
db.delete_collection('students')

tests/test_collection.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,14 @@ def test_collection_misc_methods(col, bad_col, cluster):
4545
prev_sync = properties['sync']
4646
properties = col.configure(
4747
sync=not prev_sync,
48-
journal_size=10000000
4948
)
5049
assert properties['name'] == col.name
5150
assert properties['system'] is False
5251
assert properties['sync'] is not prev_sync
5352

5453
# Test configure properties with bad collection
5554
with assert_raises(CollectionConfigureError) as err:
56-
bad_col.configure(sync=True, journal_size=10000000)
55+
bad_col.configure(sync=True)
5756
assert err.value.error_code in {11, 1228}
5857

5958
# Test get statistics
@@ -151,7 +150,6 @@ def test_collection_management(db, bad_db, cluster):
151150
col = db.create_collection(
152151
name=col_name,
153152
sync=True,
154-
journal_size=7774208,
155153
system=False,
156154
key_generator='traditional',
157155
user_keys=False,

0 commit comments

Comments
 (0)