bug4811: added more abstractions and a new project for sailing-specific landscape modeling

This commit is contained in:
Axel Uhl
2020-09-25 16:16:43 +02:00
parent 4128794af6
commit 9713ea2e83
13 changed files with 133 additions and 2 deletions
+7
View File
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
</classpath>
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.sap.sailing.landscape</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
@@ -0,0 +1,8 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.8
@@ -0,0 +1,3 @@
eclipse.preferences.version=1
pluginProject.extensions=false
resolve.requirebundle=false
+11
View File
@@ -0,0 +1,11 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Landscape
Bundle-SymbolicName: com.sap.sailing.landscape
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: SAP
Automatic-Module-Name: com.sap.sailing.landscape
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Require-Bundle: com.sap.sse.landscape,
com.sap.sse.landscape.aws,
com.sap.sse.common
+4
View File
@@ -0,0 +1,4 @@
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<artifactId>root</artifactId>
<groupId>com.sap.sailing</groupId>
<version>1.0.0-SNAPSHOT</version>
</parent>
<artifactId>com.sap.sailing.landscape</artifactId>
<packaging>eclipse-plugin</packaging>
</project>
@@ -0,0 +1,7 @@
package com.sap.sailing.landscape;
import com.sap.sse.landscape.application.ApplicationProcessMetrics;
public interface SailingAnalyticsMaster<ShardingKey, MetricsT extends ApplicationProcessMetrics> extends SailingAnalyticsProcess<ShardingKey, MetricsT> {
}
@@ -0,0 +1,9 @@
package com.sap.sailing.landscape;
import com.sap.sse.landscape.application.ApplicationProcess;
import com.sap.sse.landscape.application.ApplicationProcessMetrics;
public interface SailingAnalyticsProcess<ShardingKey, MetricsT extends ApplicationProcessMetrics> extends ApplicationProcess<ShardingKey, MetricsT> {
int getTelnetPort();
int getExpeditionUdpPort();
}
@@ -0,0 +1,7 @@
package com.sap.sailing.landscape;
import com.sap.sse.landscape.application.ApplicationProcessMetrics;
public interface SailingAnalyticsReplica<ShardingKey, MetricsT extends ApplicationProcessMetrics> extends SailingAnalyticsProcess<ShardingKey, MetricsT> {
}
@@ -4,6 +4,7 @@ import com.sap.sse.landscape.Process;
import com.sap.sse.landscape.RotatingFileBasedLog;
public interface MongoProcess extends Process<RotatingFileBasedLog, MongoMetrics> {
int DEFAULT_PORT = 27017;
boolean isHidden();
int getPriority();
int getVotes();
@@ -1,15 +1,48 @@
package com.sap.sse.landscape.mongodb;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
public interface MongoReplicaSet {
import com.sap.sse.common.Named;
public interface MongoReplicaSet extends Named {
Iterable<MongoProcess> getInstances();
/**
* The {@code "mongodb://..."} URI that application use to connect to this replica set; not specific
* to any particular database managed by this replica set; see also {@link Database#getConnectionURI()}.
*/
URI getConnectionURI();
default URI getConnectionURI(Optional<Database> optionalDb) throws URISyntaxException {
final StringBuilder result = new StringBuilder("mongodb://");
final List<String> hostSpecs = new ArrayList<>();
for (final MongoProcess mongoProcess : getInstances()) {
final StringBuilder hostSpec = new StringBuilder();
hostSpec.append(mongoProcess.getHost().getPublicAddress().getCanonicalHostName());
if (mongoProcess.getPort() != MongoProcess.DEFAULT_PORT) {
hostSpec.append(":");
hostSpec.append(mongoProcess.getPort());
}
hostSpecs.add(hostSpec.toString());
}
result.append(String.join(",", hostSpecs));
result.append("/");
optionalDb.ifPresent(db->result.append(db.getName()));
result.append("?replicaSet=");
result.append(getName());
result.append("&retryWrites=true");
return new URI(result.toString());
}
void addReplica(MongoProcess newReplica);
void removeReplica(MongoProcess replicaToRemove);
Iterable<Database> getDatabases();
Database getDatabase(String dbName);
/**
* Imports a {@link Database} from another {@link MongoReplicaSet} which must be different from {@code this}
+1
View File
@@ -83,6 +83,7 @@
<module>com.sap.sse.landscape.aws</module>
<module>com.sap.sse.landscape.aws.test</module>
<module>com.sap.sse.landscape.aws.persistence</module>
<module>com.sap.sailing.landscape</module>
<module>com.sap.sse.jersey.jaxbdependencyfragment</module>
<module>com.sap.sse.jettyextensions</module>
<module>com.sap.sailing.routeconverterjava11extension</module>