Topcoder Challenge Service - Update Challenge Listing API To Work With New Challenge Listing Index

Key Information

Register
Submit
The challenge is finished.

Challenge Overview

Background

Prevously, we have already updated the challenge listing api (/v3/challenges)  and member challenges api (v3/member/{handle}/challenges) to work with data from elasticsearch index only (no db querying) (mm-features branch), but the situation is that the elasticsearch index contains more rich and useless information , and the api have to do complex adapting in order to generate the final response, which causing big CPU usage when transforming.

Reference

1. check dev branch of elasticsearch feeder service, com.appirio.service.challengefeeder.api.ChallengeData is the main class holding the data that will be pushed to Elasticsearch.
2. check mm-features branch of challenge service, you can see complex adapt logic in com.appirio.service.challenge.adapter.BaseChallengeAdapter and com.appirio.service.challenge.adapter.UserChallengeAdapter.
 

Work Done On Elasticsearch Feeder

Previously, we have run challenges (see http://www.topcoder.com/challenge-details/30065165/?type=develop&noncache=true for more details) to generate a simplified elasticsearch index to meet the requirements for challenge listing api. 

see listing-detail-indexes branch of elasticsearch feeder service.

com.appirio.service.challengefeeder.api.challengelisting.ChallengeListingData is the main entity that will be used to populate the elasticsearch index.
 

Expectation

For this challenge, we'd like to update the challenge listing api (/v3/challenges)  and member challenges api (v3/member/{handle}/challenges) to use that simplified model, so the performance of both challenge listing api is working.

1. The change should be done based on mm-features branch of challenge service
2. drop the old com.appirio.service.challenge.model package, use the model (https://github.com/topcoder-platform/tc-elasticsearch-feeder-service/tree/listing-detail-indexes/src/main/java/com/appirio/service/challengefeeder/api) from elasticsearch feeder.

Don't rename the package name, we'd like to extract this model into a separate package, to avoid to reinvent the wheel.

3. Update the adapt logic to transfrom the result into the final response.

4. Update the filter logic correspondingly and make sure that is working properly, see (src/main/java/com/appirio/service/challenge/helper)
 

Local Setup

1. Following https://github.com/appirio-tech/tc-common-tutorials/tree/master/docker/direct-app to run all dependent services

1.1 you need to build from the latest code of direct app (see https://github.com/appirio-tech/tc-common-tutorials/tree/master/docker/direct-app#build-and-run-with-docker-compose)
1.2 also the elasticsearch service should be up, run like (docker-compose up -d elasticsearch)
2. Run the elasticsearch feeder service using mm-features branch, you probably should change the ports (8080, 8081 in src/main/resources/elasticsearch-feeder-service.yaml) due to port conflict.
3. Create some challenges through direct app, so the elasticsearch feeder will get the data populated into elasticsearch and they will be used by challenge service.

Final Submission Guidelines

- Code Changes based on mm-features branch of challenge service
- Setup and Verification Steps

ELIGIBLE EVENTS:

2018 Topcoder(R) Open

REVIEW STYLE:

Final Review:

Community Review Board

Approval:

User Sign-Off

SHARE:

ID: 30065552