----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/57215/#review167568 -----------------------------------------------------------
ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java Line 99 (original), 100 (patched) <https://reviews.apache.org/r/57215/#comment239462> This was previously comparing `Annotation` to `Class` which didn't match. ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java Lines 526-527 (original), 526-527 (patched) <https://reviews.apache.org/r/57215/#comment239461> This is really the only important change here - essentially Spring's annotation scanning was taking like 19 seconds. We have a classpath scanner that uses Google's Reflections library which is much faster. - Jonathan Hurley On March 1, 2017, 3:51 p.m., Jonathan Hurley wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/57215/ > ----------------------------------------------------------- > > (Updated March 1, 2017, 3:51 p.m.) > > > Review request for Ambari, Nate Cole and Robert Levas. > > > Bugs: AMBARI-20262 > https://issues.apache.org/jira/browse/AMBARI-20262 > > > Repository: ambari > > > Description > ------- > > Currently, Ambari uses Spring's > {{ClassPathScanningCandidateComponentProvider}} along with an > {{AnnotationTypeFilter}} to find classes annotated in our classpath: > > ``` > ClassPathScanningCandidateComponentProvider scanner = > new ClassPathScanningCandidateComponentProvider(false); > > // match only singletons that are eager listeners > for (Class<? extends Annotation> cls : classes) { > scanner.addIncludeFilter(new AnnotationTypeFilter(cls)); > } > > beanDefinitions = scanner.findCandidateComponents(AMBARI_PACKAGE); > ``` > > This takes roughly 19 seconds on normal deployments. We can reduce this time > to roughly 8 seconds by switching over to Google's {{ClassPath}} via our > internal {{ClasspathScannerUtils}} > > > Diffs > ----- > > > ambari-server/src/main/java/org/apache/ambari/server/audit/AuditLoggerModule.java > d8b8466 > > ambari-server/src/main/java/org/apache/ambari/server/cleanup/ClasspathScannerUtils.java > 01487f0 > > ambari-server/src/main/java/org/apache/ambari/server/cleanup/CleanupModule.java > d2a7583 > > ambari-server/src/main/java/org/apache/ambari/server/controller/ControllerModule.java > 8646e51 > > ambari-server/src/test/java/org/apache/ambari/server/orm/InMemoryDefaultTestModule.java > 3090108 > > > Diff: https://reviews.apache.org/r/57215/diff/1/ > > > Testing > ------- > > PENDING > > > Thanks, > > Jonathan Hurley > >