Skip to content

Commit

Permalink
rewrite version parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
smiklosovic committed Sep 28, 2023
1 parent 21ca33d commit 327f3be
Show file tree
Hide file tree
Showing 8 changed files with 3 additions and 67 deletions.
2 changes: 0 additions & 2 deletions src/main/java/com/instaclustr/esop/cli/BackupApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@ public static void main(String[] args) {

@Override
public void run() {
Esop.logCommandVersionInformation(spec);

final List<Module> appSpecificModules = singletonList(new BackupModule());

Esop.init(this, jmxSpec, hashSpec, appSpecificModules);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import static com.instaclustr.operations.Operation.State.FAILED;
import static com.instaclustr.picocli.CLIApplication.execute;
import static com.instaclustr.picocli.JarManifestVersionProvider.logCommandVersionInformation;
import static java.lang.String.format;
import static java.util.Collections.singletonList;
import static org.awaitility.Awaitility.await;
Expand All @@ -30,8 +29,6 @@
)
public class CommitLogBackupApplication implements Runnable {

private static final Logger logger = LoggerFactory.getLogger(CommitLogBackupApplication.class);

@Spec
private CommandSpec spec;

Expand All @@ -53,8 +50,6 @@ public static void main(String[] args) {

@Override
public void run() {
logCommandVersionInformation(spec);

Esop.init(this, jmxSpec, hashSpec, singletonList(new CommitlogBackupModule()));

final Operation<?> operation = operationsService.submitOperationRequest(request);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package com.instaclustr.esop.cli;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.inject.Inject;
import com.instaclustr.esop.impl.hash.HashSpec;
import com.instaclustr.esop.impl.restore.RestoreCommitLogsOperationRequest;
Expand All @@ -16,7 +13,6 @@

import static com.instaclustr.operations.Operation.State.FAILED;
import static com.instaclustr.picocli.CLIApplication.execute;
import static com.instaclustr.picocli.JarManifestVersionProvider.logCommandVersionInformation;
import static java.lang.String.format;
import static java.util.Collections.singletonList;
import static org.awaitility.Awaitility.await;
Expand All @@ -29,8 +25,6 @@
)
public class CommitLogRestoreApplication implements Runnable {

private static final Logger logger = LoggerFactory.getLogger(CommitLogRestoreApplication.class);

@Spec
private CommandSpec spec;

Expand All @@ -49,8 +43,6 @@ public static void main(String[] args) {

@Override
public void run() {
logCommandVersionInformation(spec);

Esop.init(this, null, hashSpec, singletonList(new RestoreCommitlogModule()));

final Operation<?> operation = operationsService.submitOperationRequest(request);
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/instaclustr/esop/cli/Esop.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
import com.instaclustr.esop.impl.hash.HashModule;
import com.instaclustr.esop.impl.hash.HashSpec;
import com.instaclustr.esop.impl.restore.RestoreModules.DownloadingModule;
import com.instaclustr.esop.util.VersionParser;
import com.instaclustr.guice.GuiceInjectorHolder;
import com.instaclustr.jackson.JacksonModule;
import com.instaclustr.operations.OperationsModule;
import com.instaclustr.picocli.CLIApplication;
import com.instaclustr.picocli.CassandraJMXSpec;
import com.instaclustr.picocli.VersionParser;
import com.instaclustr.threading.ExecutorsModule;
import jmx.org.apache.cassandra.CassandraJMXConnectionInfo;
import jmx.org.apache.cassandra.service.cassandra3.StorageServiceMBean;
Expand Down Expand Up @@ -104,7 +104,7 @@ protected void configure() {
}

@Override
public String getImplementationTitle() {
public String title() {
return "instaclustr-esop";
}

Expand All @@ -116,6 +116,6 @@ public void run() {
@Override
public String[] getVersion() throws IOException
{
return VersionParser.parse(getImplementationTitle());
return VersionParser.parse(title());
}
}
2 changes: 0 additions & 2 deletions src/main/java/com/instaclustr/esop/cli/ListApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ public static void main(String[] args) {

@Override
public void run() {
Esop.logCommandVersionInformation(spec);

final List<Module> modules = Collections.singletonList(new ListModule());

Esop.init(this, jmxSpec, new HashSpec(), modules);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ public static void main(String[] args) {

@Override
public void run() {
Esop.logCommandVersionInformation(spec);

final List<Module> modules = Collections.singletonList(new RemoveBackupModule());

Esop.init(this, jmxSpec, new HashSpec(), modules);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import static com.instaclustr.operations.Operation.State.FAILED;
import static com.instaclustr.picocli.CLIApplication.execute;
import static com.instaclustr.picocli.JarManifestVersionProvider.logCommandVersionInformation;
import static java.lang.String.format;
import static org.awaitility.Awaitility.await;

Expand All @@ -33,8 +32,6 @@
)
public class RestoreApplication implements Runnable {

private static final Logger logger = LoggerFactory.getLogger(RestoreApplication.class);

@Spec
private CommandSpec spec;

Expand All @@ -59,8 +56,6 @@ public static void main(String[] args) {

@Override
public void run() {
logCommandVersionInformation(spec);

request.importing = importRequest;

Esop.init(this, jmxSpec, hashSpec, Arrays.asList(new RestoreModule(),
Expand Down
40 changes: 0 additions & 40 deletions src/main/java/com/instaclustr/esop/util/VersionParser.java

This file was deleted.

0 comments on commit 327f3be

Please sign in to comment.