This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch STREAMPIPES-319
in repository https://gitbox.apache.org/repos/asf/incubator-streampipes.git
The following commit(s) were added to refs/heads/STREAMPIPES-319 by this push:
new 8e6ddcf [STREAMPIPES-319] Add class to provide service tags
8e6ddcf is described below
commit 8e6ddcf70fbea476d1cf8414d21f5bd0ea80891a
Author: Dominik Riemer <[email protected]>
AuthorDate: Tue May 11 09:54:53 2021 +0200
[STREAMPIPES-319] Add class to provide service tags
---
.../backend/StreamPipesBackendApplication.java | 7 +++++-
.../standalone/init/StandaloneModelSubmitter.java | 6 +++--
.../streampipes/svcdiscovery/SpServiceTags.java | 27 ++++++++++++++++++++++
3 files changed, 37 insertions(+), 3 deletions(-)
diff --git
a/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesBackendApplication.java
b/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesBackendApplication.java
index c111d57..d99c090 100644
---
a/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesBackendApplication.java
+++
b/streampipes-backend/src/main/java/org/apache/streampipes/backend/StreamPipesBackendApplication.java
@@ -27,6 +27,7 @@ import
org.apache.streampipes.model.pipeline.PipelineOperationStatus;
import org.apache.streampipes.rest.notifications.NotificationListener;
import org.apache.streampipes.storage.management.StorageDispatcher;
import org.apache.streampipes.svcdiscovery.SpServiceDiscovery;
+import org.apache.streampipes.svcdiscovery.SpServiceTags;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
@@ -61,7 +62,11 @@ public class StreamPipesBackendApplication {
Integer port = Networking.getPort(8030);
SpServiceDiscovery
.getServiceDiscovery()
- .registerService("core", "core", host, port,
Arrays.asList("core", "connect-master"));
+ .registerService("core",
+ "core",
+ host,
+ port,
+ Arrays.asList(SpServiceTags.CORE,
SpServiceTags.CONNECT_MASTER));
SpringApplication.run(StreamPipesBackendApplication.class, args);
} catch (UnknownHostException e) {
diff --git
a/streampipes-container-standalone/src/main/java/org/apache/streampipes/container/standalone/init/StandaloneModelSubmitter.java
b/streampipes-container-standalone/src/main/java/org/apache/streampipes/container/standalone/init/StandaloneModelSubmitter.java
index 2dcd9b2..a6e863b 100644
---
a/streampipes-container-standalone/src/main/java/org/apache/streampipes/container/standalone/init/StandaloneModelSubmitter.java
+++
b/streampipes-container-standalone/src/main/java/org/apache/streampipes/container/standalone/init/StandaloneModelSubmitter.java
@@ -27,6 +27,7 @@ import org.apache.streampipes.container.model.PeConfig;
import org.apache.streampipes.container.model.SpServiceDefinition;
import org.apache.streampipes.container.util.ServiceDefinitionUtil;
import org.apache.streampipes.svcdiscovery.SpServiceDiscovery;
+import org.apache.streampipes.svcdiscovery.SpServiceTags;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.SpringApplication;
@@ -51,13 +52,14 @@ public abstract class StandaloneModelSubmitter extends
ModelSubmitter<PeConfig>
try {
String host = Networking.getHostname();
Integer port = Networking.getPort(serviceDef.getDefaultPort());
- List<String> appIds =
ServiceDefinitionUtil.extractAppIds(serviceDef.getDeclarers());
+ List<String> serviceTags =
ServiceDefinitionUtil.extractAppIds(serviceDef.getDeclarers());
+ serviceTags.add(SpServiceTags.PE);
DeclarersSingleton.getInstance().populate(host, port, serviceDef);
SpServiceDiscovery
.getServiceDiscovery()
- .registerPeService("pe/" +serviceDef.getServiceId(), host,
port, appIds);
+ .registerPeService("pe/" +serviceDef.getServiceId(), host,
port, serviceTags);
startService(port);
} catch (UnknownHostException e) {
diff --git
a/streampipes-service-discovery/src/main/java/org/apache/streampipes/svcdiscovery/SpServiceTags.java
b/streampipes-service-discovery/src/main/java/org/apache/streampipes/svcdiscovery/SpServiceTags.java
new file mode 100644
index 0000000..4520bd9
--- /dev/null
+++
b/streampipes-service-discovery/src/main/java/org/apache/streampipes/svcdiscovery/SpServiceTags.java
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.apache.streampipes.svcdiscovery;
+
+public class SpServiceTags {
+
+ public static final String CORE = "core";
+ public static final String PE = "pe";
+ public static final String CONNECT_MASTER = "connect-master";
+ public static final String CONNECT_WORKER = "connect-worker";
+ public static final String STREAMPIPES_CLIENT = "streampipes-client";
+}