Beispiel #1
0
def start_new_badge_mapreduce():
    """Start a new Mapper task for calling badge_update_map."""
    return control.start_map(
        name="UpdateUserBadges",
        handler_spec="badges.util_badges.badge_update_map",
        reader_spec=(
            "third_party.mapreduce.input_readers.DatastoreInputReader"),
        mapper_parameters={
            "input_reader": {"entity_kind": "user_models.UserData"},
            },
        mapreduce_parameters={"processing_rate": 250},
        shard_count=64,
        queue_name="user-badge-queue"
        )
Beispiel #2
0
def start_new_badge_mapreduce():
    """Start a new Mapper task for calling badge_update_map."""
    return control.start_map(
        name="UpdateUserBadges",
        handler_spec="badges.util_badges.badge_update_map",
        reader_spec=(
            "third_party.mapreduce.input_readers.DatastoreInputReader"),
        mapper_parameters={
            "input_reader": {
                "entity_kind": "user_models.UserData"
            },
        },
        mapreduce_parameters={"processing_rate": 250},
        shard_count=64,
        queue_name="user-badge-queue")
Beispiel #3
0
 def run_mapreduces(self):
     """Runs the mapreduces that update user info based on progress."""
     # TODO(csilvers): get this to work -- use mapreduce_stub.py
     # This is taken from badges/util_badges.py
     unused_badges_id = control.start_map(
         name="UpdateUserBadges",
         handler_spec="badges.util_badges.badge_update_map",
         reader_spec=(
             "third_party.mapreduce.input_readers.DatastoreInputReader"),
         mapper_parameters={
             "input_reader": {"entity_kind": "user_models.UserData"},
             },
         mapreduce_parameters={"processing_rate": 250},
         shard_count=64,
         queue_name="user-badge-queue"
         )
 def get(self):
     # Admin-only restriction is handled by /admin/* URL pattern
     # so this can be called by a cron job.
     # Start a new Mapper task for calling statistics_update_map
     mapreduce_id = control.start_map(
         name="DailyActivityLog",
         handler_spec="activity_summary.daily_activity_summary_map",
         reader_spec=(
             "third_party.mapreduce.input_readers.DatastoreInputReader"),
         mapper_parameters={
             "input_reader": {"entity_kind": "user_models.UserData"},
             "processing_rate": 250,
             },
         mapreduce_parameters={},
         shard_count=64,
         queue_name="activity-summary-queue")
     self.response.out.write("OK: " + str(mapreduce_id))
    def get(self):

        # Admin-only restriction is handled by /admin/* URL pattern
        # so this can be called by a cron job.

        # Start a new Mapper task for calling statistics_update_map
        mapreduce_id = control.start_map(
            name="UpdateExerciseStatistics",
            handler_spec="exercise_statistics.statistics_update_map",
            reader_spec=(
                "third_party.mapreduce.input_readers.DatastoreInputReader"),
            mapper_parameters={
                "input_reader": {"entity_kind": "exercise_models.Exercise"},
                },
            queue_name="exercise-statistics-mapreduce-queue",
            )

        self.response.out.write("OK: " + str(mapreduce_id))
Beispiel #6
0
    def get(self):

        # Admin-only restriction is handled by /admin/* URL pattern
        # so this can be called by a cron job.

        # Start a new Mapper task for calling badge_update_map
        mapreduce_id = control.start_map(
            name="UpdateFeedbackVotes",
            handler_spec="discussion.voting.vote_update_map",
            reader_spec=(
                "third_party.mapreduce.input_readers.DatastoreInputReader"),
            mapper_parameters={
                "input_reader": {"entity_kind":
                                 "discussion.discussion_models.Feedback"},
                },
            queue_name="backfill-mapreduce-queue",
            )

        self.response.out.write("OK: " + str(mapreduce_id))
 def get(self):
     # Admin-only restriction is handled by /admin/* URL pattern
     # so this can be called by a cron job.
     # Start a new Mapper task for calling statistics_update_map
     mapreduce_id = control.start_map(
         name="DailyActivityLog",
         handler_spec="activity_summary.daily_activity_summary_map",
         reader_spec=(
             "third_party.mapreduce.input_readers.DatastoreInputReader"),
         mapper_parameters={
             "input_reader": {
                 "entity_kind": "user_models.UserData"
             },
             "processing_rate": 250,
         },
         mapreduce_parameters={},
         shard_count=64,
         queue_name="activity-summary-queue")
     self.response.out.write("OK: " + str(mapreduce_id))
Beispiel #8
0
    def get(self):

        # Admin-only restriction is handled by /admin/* URL pattern
        # so this can be called by a cron job.

        # Start a new Mapper task for calling statistics_update_map
        mapreduce_id = control.start_map(
            name="UpdateExerciseStatistics",
            handler_spec="exercise_statistics.statistics_update_map",
            reader_spec=(
                "third_party.mapreduce.input_readers.DatastoreInputReader"),
            mapper_parameters={
                "input_reader": {
                    "entity_kind": "exercise_models.Exercise"
                },
            },
            queue_name="exercise-statistics-mapreduce-queue",
        )

        self.response.out.write("OK: " + str(mapreduce_id))
Beispiel #9
0
    def get(self):

        # Admin-only restriction is handled by /admin/* URL pattern
        # so this can be called by a cron job.

        # Start a new Mapper task for calling badge_update_map
        mapreduce_id = control.start_map(
            name="UpdateFeedbackVotes",
            handler_spec="discussion.voting.vote_update_map",
            reader_spec=(
                "third_party.mapreduce.input_readers.DatastoreInputReader"),
            mapper_parameters={
                "input_reader": {
                    "entity_kind": "discussion.discussion_models.Feedback"
                },
            },
            queue_name="backfill-mapreduce-queue",
        )

        self.response.out.write("OK: " + str(mapreduce_id))