|
8 | 8 | import com.appirio.service.challengefeeder.resources.HealthCheckResource;
|
9 | 9 | import com.appirio.service.challengefeeder.util.JestClientUtils;
|
10 | 10 | import com.appirio.service.resourcefactory.ChallengeFeederFactory;
|
11 |
| -import com.appirio.service.resourcefactory.MmFeederResourceFactory; |
12 | 11 | import com.appirio.service.resourcefactory.MarathonMatchFeederFactory;
|
| 12 | +import com.appirio.service.resourcefactory.MmFeederResourceFactory; |
13 | 13 | import com.appirio.service.resourcefactory.SRMFeederFactory;
|
14 | 14 | import com.appirio.service.supply.resources.SupplyDatasourceFactory;
|
15 | 15 |
|
|
70 | 70 | * <li>Add job for LoadChangedChallengeDetailJob</li>
|
71 | 71 | * </ul>
|
72 | 72 | * </p>
|
| 73 | + * |
| 74 | + * <p> |
| 75 | + * Version 1.8 - Topcoder Elasticsearch Feeder Service - Jobs Cleanup And Improvement v1.0 |
| 76 | + * - remove the useless resources, jobs and logging of configuration values |
| 77 | + * </p> |
73 | 78 | * @author TCSCODER
|
74 |
| - * @version 1.7 |
| 79 | + * @version 1.8 |
75 | 80 | */
|
76 | 81 | public class ChallengeFeederServiceApplication extends BaseApplication<ChallengeFeederServiceConfiguration> {
|
77 | 82 | /**
|
@@ -107,19 +112,47 @@ protected void logServiceSpecificConfigs(ChallengeFeederServiceConfiguration con
|
107 | 112 | logger.info("\t\tAWS region : " + config.getJestClientConfiguration().getAwsRegion());
|
108 | 113 | logger.info("\t\tAWS service : " + config.getJestClientConfiguration().getAwsService());
|
109 | 114 |
|
110 |
| - logger.info("\tRedissonConfiguration "); |
111 |
| - logger.info("\t\tChallenges index: " + config.getRedissonConfiguration().getChallengesIndex()); |
112 |
| - logger.info("\t\tChallenges type: " + config.getRedissonConfiguration().getChallengesType()); |
113 |
| - logger.info("\t\tSingle server address: " + config.getRedissonConfiguration().getSingleServerAddress()); |
114 |
| - logger.info("\t\tLast run timestamp prefix for job LoadChangedChallengesJob: " + config.getRedissonConfiguration().getLoadChangedChallengesJobLastRunTimestampPrefix()); |
115 |
| - logger.info("\t\tLast run timestamp prefix for job MarathonMatchesJob: " + config.getRedissonConfiguration().getMarathonMatchesJobLastRunTimestampPrefix()); |
116 |
| - logger.info("\t\tLast run timestamp prefix for job SingleRoundMatchesJob: " + config.getRedissonConfiguration().getSingleRoundMatchesJobLastRunTimestampPrefix()); |
117 |
| - logger.info("\t\tCluster enabled: " + config.getRedissonConfiguration().isClusterEnabled()); |
118 |
| - logger.info("\t\tLoadChangedChallengesJob Locker key name: " + config.getRedissonConfiguration().getLoadChangedChallengesJobLockerKeyName()); |
119 |
| - logger.info("\t\tMarathonMatchesJob Locker key name: " + config.getRedissonConfiguration().getMarathonMatchesJobLockerKeyName()); |
120 |
| - logger.info("\t\tSingleRoundMatchesJob Locker key name: " + config.getRedissonConfiguration().getSingleRoundMatchesJobLockerKeyName()); |
121 |
| - logger.info("\t\tLock watchdog timeout: " + config.getRedissonConfiguration().getLockWatchdogTimeout()); |
122 |
| - logger.info("\t\tNode addresses: " + config.getRedissonConfiguration().getNodeAddresses()); |
| 115 | + logger.info("\tJobsConfiguration"); |
| 116 | + logger.info("\t\tRedissonConfiguration"); |
| 117 | + logger.info("\t\t\tSingle server address: " + config.getJobsConfiguration().getRedissonConfiguration().getSingleServerAddress()); |
| 118 | + logger.info("\t\t\tCluster enabled: " + config.getJobsConfiguration().getRedissonConfiguration().isClusterEnabled()); |
| 119 | + logger.info("\t\t\tLock watchdog timeout: " + config.getJobsConfiguration().getRedissonConfiguration().getLockWatchdogTimeout()); |
| 120 | + logger.info("\t\t\tNode addresses: " + config.getJobsConfiguration().getRedissonConfiguration().getNodeAddresses()); |
| 121 | + |
| 122 | + |
| 123 | + logger.info("\tJobs configuration"); |
| 124 | + logger.info("\t\t\tRedisson configuration"); |
| 125 | + logger.info("\t\t\t\t\tLock watchdog timeout : " + config.getJobsConfiguration().getRedissonConfiguration().getLockWatchdogTimeout()); |
| 126 | + logger.info("\t\t\t\t\tSingle server address : " + config.getJobsConfiguration().getRedissonConfiguration().getSingleServerAddress()); |
| 127 | + logger.info("\t\t\t\t\tCluster enabled : " + config.getJobsConfiguration().getRedissonConfiguration().isClusterEnabled()); |
| 128 | + logger.info("\t\t\tNode addresses: " + config.getJobsConfiguration().getRedissonConfiguration().getNodeAddresses()); |
| 129 | + logger.info("\t\t\t\t\tNode addresses"); |
| 130 | + logger.info("\t\t\tLoad changed challenges listing job"); |
| 131 | + logger.info("\t\t\t\t\tIndex name"); |
| 132 | + logger.info("\t\t\t\t\tBatch size : " + config.getJobsConfiguration().getLoadChangedChallengesListingJob().getBatchUpdateSize()); |
| 133 | + logger.info("\t\t\tLoad changed challenges detail job"); |
| 134 | + logger.info("\t\t\t\t\tIndex name"); |
| 135 | + logger.info("\t\t\t\t\tBatch size : " + config.getJobsConfiguration().getLoadChangedChallengesDetailJob().getBatchUpdateSize()); |
| 136 | + logger.info("\t\t\tLegacymm to challenge listing job"); |
| 137 | + logger.info("\t\t\t\t\tIndex name"); |
| 138 | + logger.info("\t\t\t\t\tBatch size : " + config.getJobsConfiguration().getLegacyMMToChallengeListingJob().getBatchUpdateSize()); |
| 139 | + logger.info("\t\t\t\t\tMarathon matches days to subtract : " + config.getJobsConfiguration().getLegacyMMToChallengeListingJob().getMarathonMatchesDaysToSubtract()); |
| 140 | + logger.info("\t\t\t\t\tMarathon matches forum url : " + config.getJobsConfiguration().getLegacyMMToChallengeListingJob().getMarathonMatchesForumUrl()); |
| 141 | + logger.info("\t\t\tLoad changedmm challenge detail job"); |
| 142 | + logger.info("\t\t\t\t\tIndex name"); |
| 143 | + logger.info("\t\t\t\t\tBatch size : " + config.getJobsConfiguration().getLoadChangedMMChallengeDetailJob().getBatchUpdateSize()); |
| 144 | + logger.info("\t\t\t\t\tMarathon matches days to subtract : " + config.getJobsConfiguration().getLoadChangedMMChallengeDetailJob().getMarathonMatchesDaysToSubtract()); |
| 145 | + logger.info("\t\t\t\t\tMarathon matches forum url : " + config.getJobsConfiguration().getLoadChangedMMChallengeDetailJob().getMarathonMatchesForumUrl()); |
| 146 | + logger.info("\t\t\tMarathon matches job"); |
| 147 | + logger.info("\t\t\t\t\tIndex name"); |
| 148 | + logger.info("\t\t\t\t\tBatch size : " + config.getJobsConfiguration().getMarathonMatchesJob().getBatchUpdateSize()); |
| 149 | + logger.info("\t\t\t\t\tMarathon matches days to subtract : " + config.getJobsConfiguration().getMarathonMatchesJob().getMarathonMatchesDaysToSubtract()); |
| 150 | + logger.info("\t\t\t\t\tMarathon matches forum url : " + config.getJobsConfiguration().getMarathonMatchesJob().getMarathonMatchesForumUrl()); |
| 151 | + logger.info("\t\t\tSingle round matches job"); |
| 152 | + logger.info("\t\t\t\t\tIndex name"); |
| 153 | + logger.info("\t\t\t\t\tBatch size : " + config.getJobsConfiguration().getSingleRoundMatchesJob().getBatchUpdateSize()); |
| 154 | + logger.info("\t\t\t\t\tSingle round matches days to subtract : " + config.getJobsConfiguration().getSingleRoundMatchesJob().getSingleRoundMatchesDaysToSubtract()); |
| 155 | + |
123 | 156 |
|
124 | 157 | logger.info("\tJobs ");
|
125 | 158 | logger.info("\t\tJobs: " + config.getJobs());
|
@@ -149,9 +182,9 @@ protected void registerResources(ChallengeFeederServiceConfiguration config, Env
|
149 | 182 | JestClient jestClient = JestClientUtils.get(config.getJestClientConfiguration());
|
150 | 183 |
|
151 | 184 | // Register resources here
|
| 185 | + env.jersey().register(new HealthCheckResource()); |
152 | 186 | env.jersey().register(new ChallengeFeederFactory(jestClient).getResourceInstance());
|
153 | 187 | env.jersey().register(new MmFeederResourceFactory(jestClient).getResourceInstance());
|
154 |
| - env.jersey().register(new HealthCheckResource()); |
155 | 188 | env.jersey().register(new MarathonMatchFeederFactory(jestClient).getResourceInstance());
|
156 | 189 | env.jersey().register(new SRMFeederFactory(jestClient).getResourceInstance());
|
157 | 190 | logger.info("Services registered");
|
@@ -182,7 +215,7 @@ public void initialize(Bootstrap<ChallengeFeederServiceConfiguration> bootstrap)
|
182 | 215 | bootstrap.setConfigurationSourceProvider(
|
183 | 216 | new SubstitutingSourceProvider(bootstrap.getConfigurationSourceProvider(), new EnvironmentVariableSubstitutor(false)));
|
184 | 217 |
|
185 |
| - bootstrap.addBundle(new JobsBundle(new LoadChangedChallengesListingJob(), new LegacyMMToChallengeListingJob(), |
186 |
| - new MarathonMatchesJob(), new SingleRoundMatchesJob(), new LoadChangedChallengesDetailJob(), new LoadChangedMMChallengeDetailJob())); |
| 218 | + bootstrap.addBundle(new JobsBundle(new LoadChangedChallengesListingJob(), new LegacyMMToChallengeListingJob(), new MarathonMatchesJob(), |
| 219 | + new SingleRoundMatchesJob(), new LoadChangedChallengesDetailJob(), new LoadChangedMMChallengeDetailJob())); |
187 | 220 | }
|
188 | 221 | }
|
0 commit comments