mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-09-21 13:15:35 +00:00
bug4811: added more abstractions and a new project for sailing-specific landscape modeling
This commit is contained in:
Executable
+7
@@ -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>
|
||||||
Executable
+28
@@ -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
@@ -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
@@ -0,0 +1,4 @@
|
|||||||
|
source.. = src/
|
||||||
|
output.. = bin/
|
||||||
|
bin.includes = META-INF/,\
|
||||||
|
.
|
||||||
Executable
+12
@@ -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>
|
||||||
+7
@@ -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> {
|
||||||
|
|
||||||
|
}
|
||||||
Executable
+9
@@ -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();
|
||||||
|
}
|
||||||
Executable
+7
@@ -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;
|
import com.sap.sse.landscape.RotatingFileBasedLog;
|
||||||
|
|
||||||
public interface MongoProcess extends Process<RotatingFileBasedLog, MongoMetrics> {
|
public interface MongoProcess extends Process<RotatingFileBasedLog, MongoMetrics> {
|
||||||
|
int DEFAULT_PORT = 27017;
|
||||||
boolean isHidden();
|
boolean isHidden();
|
||||||
int getPriority();
|
int getPriority();
|
||||||
int getVotes();
|
int getVotes();
|
||||||
|
|||||||
@@ -1,15 +1,48 @@
|
|||||||
package com.sap.sse.landscape.mongodb;
|
package com.sap.sse.landscape.mongodb;
|
||||||
|
|
||||||
import java.net.URI;
|
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();
|
Iterable<MongoProcess> getInstances();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@code "mongodb://..."} URI that application use to connect to this replica set; not specific
|
* 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()}.
|
* 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}
|
* Imports a {@link Database} from another {@link MongoReplicaSet} which must be different from {@code this}
|
||||||
|
|||||||
@@ -83,6 +83,7 @@
|
|||||||
<module>com.sap.sse.landscape.aws</module>
|
<module>com.sap.sse.landscape.aws</module>
|
||||||
<module>com.sap.sse.landscape.aws.test</module>
|
<module>com.sap.sse.landscape.aws.test</module>
|
||||||
<module>com.sap.sse.landscape.aws.persistence</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.jersey.jaxbdependencyfragment</module>
|
||||||
<module>com.sap.sse.jettyextensions</module>
|
<module>com.sap.sse.jettyextensions</module>
|
||||||
<module>com.sap.sailing.routeconverterjava11extension</module>
|
<module>com.sap.sailing.routeconverterjava11extension</module>
|
||||||
|
|||||||
Reference in New Issue
Block a user