Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Rename buckets to data-sets
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-gravgaard committed May 14, 2014
1 parent 3510d0e commit 5675d6b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions migrations/008_convert_ga_data_sets_to_utc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

log = logging.getLogger(__name__)

GA_BUCKETS_TO_MIGRATE = [
GA_DATA_SETS_TO_MIGRATE = [
"carers_allowance_journey",
"deposit_foreign_marriage_journey",
"pay_foreign_marriage_certificates_journey",
Expand Down Expand Up @@ -75,7 +75,7 @@ def data_id(data_type, timestamp, period):


def up(db):
for name in GA_BUCKETS_TO_MIGRATE:
for name in GA_DATA_SETS_TO_MIGRATE:
collection = db.get_repository(name)

documents = collection.find({})
Expand Down
6 changes: 3 additions & 3 deletions migrations/009_fix_and_resize_capped_collections.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
Clean up capped collections:
- Update realtime buckets to be capped at 4mb (4194304b), which gives us
- Update realtime data-sets to be capped at 4mb (4194304b), which gives us
about 2 weeks worth of query depth with a few days tolerance.
- Copy any non realtime collections that are capped into uncapped collections
Expand Down Expand Up @@ -98,7 +98,7 @@ def remove_temporary_collections(mongo_db):
mongo_db[collection_name].drop()


def realtime_bucket_is_correctly_capped(mongo_db, collection_name):
def realtime_data_set_is_correctly_capped(mongo_db, collection_name):
stats = mongo_db[collection_name].options()
return stats.get('capped') is True and stats['size'] == CAP_SIZE

Expand All @@ -110,7 +110,7 @@ def up(db):

# Correctly cap all realtime collections
for collection_name in get_realtime_collection_names(mongo_db):
if realtime_bucket_is_correctly_capped(mongo_db, collection_name):
if realtime_data_set_is_correctly_capped(mongo_db, collection_name):
log.info("Skipping {0}, already correctly capped".format(
collection_name))
continue
Expand Down

0 comments on commit 5675d6b

Please sign in to comment.