MCPcopy Create free account
hub / github.com/crate/crate / execute

Method execute

app/src/main/java/io/crate/bootstrap/CrateDB.java:100–121  ·  view source on GitHub ↗
(Terminal terminal, OptionSet options, Environment env)

Source from the content-addressed store, hash-verified

98 }
99
100 @Override
101 protected void execute(Terminal terminal, OptionSet options, Environment env) throws Exception {
102 if (options.nonOptionArguments().isEmpty() == false) {
103 throw new UserException(ExitCodes.USAGE, "Positional arguments not allowed, found " + options.nonOptionArguments());
104 }
105 if (options.has(versionOption)) {
106 terminal.println("Version: " + Version.CURRENT
107 + ", Build: " + Build.CURRENT.hashShort() + "/" + Build.CURRENT.timestamp()
108 + ", JVM: " + JvmInfo.jvmInfo().version());
109 return;
110 }
111
112 try {
113 Bootstrap.init(env);
114 } catch (BootstrapException | RuntimeException e) {
115 // format exceptions to the console in a special way
116 // to avoid 2MB stacktraces from guice, etc.
117 throw new StartupExceptionProxy(e);
118 } catch (NodeValidationException e) {
119 throw new UserException(ExitCodes.CONFIG, e.getMessage());
120 }
121 }
122
123 /**
124 * Required method that's called by Apache Commons procrun when

Callers

nothing calls this directly

Calls 8

jvmInfoMethod · 0.95
initMethod · 0.95
hashShortMethod · 0.80
getMessageMethod · 0.65
isEmptyMethod · 0.45
printlnMethod · 0.45
timestampMethod · 0.45
versionMethod · 0.45

Tested by

no test coverage detected