MCPcopy Create free account
hub / github.com/GerritCodeReview/gerrit / run

Method run

java/com/google/gerrit/pgm/init/BaseInit.java:94–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

92 }
93
94 @Override
95 public int run() throws Exception {
96 final SiteInit init = createSiteInit();
97 if (beforeInit(init)) {
98 return 0;
99 }
100
101 init.flags.autoStart = getAutoStart() && init.site.isNew;
102 init.flags.dev = isDev() && init.site.isNew;
103 init.flags.skipPlugins = skipPlugins();
104 init.flags.deleteCaches = getDeleteCaches();
105 init.flags.isNew = init.site.isNew;
106
107 final SiteRun run;
108 try {
109 init.initializer.run();
110 init.flags.deleteOnFailure = false;
111
112 Injector sysInjector = createSysInjector(init);
113 run = createSiteRun(init);
114 try {
115 run.upgradeSchema();
116 } catch (StorageException e) {
117 String msg = "Couldn't upgrade schema. Expected if slave and read-only database";
118 System.err.println(msg);
119 logger.atSevere().withCause(e).log("%s", msg);
120 }
121
122 init.initializer.postRun(sysInjector);
123 } catch (Exception | Error failure) {
124 if (init.flags.deleteOnFailure) {
125 recursiveDelete(getSitePath());
126 }
127 throw failure;
128 }
129
130 System.err.println("Initialized " + getSitePath().toRealPath().normalize());
131 afterInit(run);
132 return 0;
133 }
134
135 protected boolean skipPlugins() {
136 return false;

Callers

nothing calls this directly

Calls 15

createSiteInitMethod · 0.95
beforeInitMethod · 0.95
getAutoStartMethod · 0.95
isDevMethod · 0.95
skipPluginsMethod · 0.95
getDeleteCachesMethod · 0.95
createSysInjectorMethod · 0.95
createSiteRunMethod · 0.95
upgradeSchemaMethod · 0.95
recursiveDeleteMethod · 0.95
afterInitMethod · 0.95
printlnMethod · 0.80

Tested by

no test coverage detected