Skip to content

Commit

Permalink
IGNITE-18473 Add getter of CdcMain instance in CdcCommandLineStartup
Browse files Browse the repository at this point in the history
  • Loading branch information
shishkovilja committed Dec 28, 2022
1 parent defb30d commit ccf77c6
Showing 1 changed file with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,22 @@ public class CdcCommandLineStartup {
/** Quite log flag. */
private static final boolean QUITE = IgniteSystemProperties.getBoolean(IgniteSystemProperties.IGNITE_QUIET);

/** Cdc instance. */
private final AtomicReference<CdcMain> cdc = new AtomicReference<>();

/**
* Main entry point.
*
* @param args Command line arguments.
*/
public static void main(String[] args) {
new CdcCommandLineStartup().start(args);
}

/**
* @param args Args.
*/
public void start(String[] args) {
if (!QUITE) {
X.println(" __________ ________________ ________ _____" + NL +
" / _/ ___/ |/ / _/_ __/ __/ / ___/ _ \\/ ___/" + NL +
Expand All @@ -75,8 +85,6 @@ public static void main(String[] args) {
if (args.length > 0 && args[0].charAt(0) == '-')
exit("Invalid arguments: " + args[0], true, -1);

AtomicReference<CdcMain> cdc = new AtomicReference<>();

try {
cdc.set(CdcLoader.loadCdc(args[0]));

Expand Down Expand Up @@ -113,7 +121,7 @@ public static void main(String[] args) {
* @param showUsage Whether or not to show usage information.
* @param exitCode Exit code.
*/
private static void exit(@Nullable String errMsg, boolean showUsage, int exitCode) {
private void exit(@Nullable String errMsg, boolean showUsage, int exitCode) {
if (errMsg != null)
X.error(errMsg);

Expand All @@ -134,4 +142,11 @@ private static void exit(@Nullable String errMsg, boolean showUsage, int exitCod

System.exit(exitCode);
}

/**
* @return Cdc instance.
*/
public CdcMain cdc() {
return cdc.get();
}
}

0 comments on commit ccf77c6

Please sign in to comment.