-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#12048] Prepare for migration testing #13089
[#12048] Prepare for migration testing #13089
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for Oldest script
private static final int BATCH_SIZE = 100; | ||
|
||
private static final int MAX_BUFFER_SIZE = 1000; | ||
private static final AtomicLong NUMBER_TO_MIGRATE = new AtomicLong(50); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Important parts to note
protected Query<Course> getFilterQuery() { | ||
return ofy().load().type(teammates.storage.entity.Course.class) | ||
.filter("isMigrated", false) | ||
.order("-createdAt"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Descending time of created
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for Oldest, where it's ascending
if (numberOfScannedKey == NUMBER_TO_MIGRATE) { | ||
shouldContinue = false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Stops once we hit the number to migrate
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the PR
Part of #12048
DataMigrationForCourseEntitySql50Newest
andDataMigrationForCourseEntitySql50Oldest