Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove groups support #696

Merged
merged 4 commits into from Jan 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -18,7 +18,6 @@ public class ServiceEndpoint {
private Set<String> contentTypes;
private Map<String, String> tags;
private Collection<ServiceRegistration> serviceRegistrations;
private ServiceGroup serviceGroup;

/**
* Constructor for SerDe.
Expand All @@ -34,7 +33,6 @@ private ServiceEndpoint(Builder builder) {
this.tags = new HashMap<>(builder.tags);
this.serviceRegistrations =
Collections.unmodifiableCollection(new ArrayList<>(builder.serviceRegistrations));
this.serviceGroup = builder.serviceGroup;
}

public static Builder builder() {
Expand All @@ -57,10 +55,6 @@ public Map<String, String> tags() {
return tags;
}

public ServiceGroup serviceGroup() {
return serviceGroup;
}

/**
* Return collection of service registratrions.
*
Expand All @@ -84,12 +78,11 @@ public Collection<ServiceReference> serviceReferences() {
@Override
public String toString() {
return new StringJoiner(", ", ServiceEndpoint.class.getSimpleName() + "[", "]")
.add("id='" + id + "'")
.add("id=" + id)
.add("address=" + address)
.add("contentTypes=" + contentTypes)
.add("tags(" + tags.size() + ")")
.add("tags=" + tags)
.add("serviceRegistrations(" + serviceRegistrations.size() + ")")
.add("serviceGroup=" + serviceGroup)
.toString();
}

Expand All @@ -100,7 +93,6 @@ public static class Builder {
private Set<String> contentTypes = Collections.emptySet();
private Map<String, String> tags = Collections.emptyMap();
private Collection<ServiceRegistration> serviceRegistrations = new ArrayList<>();
private ServiceGroup serviceGroup;

private Builder() {}

Expand Down Expand Up @@ -135,11 +127,6 @@ public Builder serviceRegistrations(Collection<ServiceRegistration> serviceRegis
return this;
}

public Builder serviceGroup(String groupId, int groupSize) {
this.serviceGroup = new ServiceGroup(groupId, groupSize);
return this;
}

public ServiceEndpoint build() {
return new ServiceEndpoint(this);
}
Expand Down
51 changes: 0 additions & 51 deletions services-api/src/main/java/io/scalecube/services/ServiceGroup.java

This file was deleted.

Expand Up @@ -2,6 +2,7 @@

import java.util.Collections;
import java.util.Map;
import java.util.StringJoiner;

/**
* A Service Method Definition is a single method definition of a service inside service
Expand Down Expand Up @@ -76,14 +77,10 @@ public ServiceMethodDefinition setAuth(boolean auth) {

@Override
public String toString() {
return "ServiceMethodDefinition{"
+ "action='"
+ action
+ '\''
+ ", tags="
+ tags
+ ", auth="
+ auth
+ '}';
return new StringJoiner(", ", ServiceMethodDefinition.class.getSimpleName() + "[", "]")
.add("action=" + action)
.add("tags=" + tags)
.add("auth=" + auth)
.toString();
}
}
Expand Up @@ -6,6 +6,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import java.util.StringJoiner;

/**
* Service reference. This is merge of service method information together with service registration
Expand Down Expand Up @@ -88,30 +89,13 @@ private Map<String, String> mergeTags(

@Override
public String toString() {
return "ServiceReference{"
+ "qualifier='"
+ qualifier
+ '\''
+ ", endpointId='"
+ endpointId
+ '\''
+ ", address='"
+ address
+ '\''
+ ", namespace='"
+ namespace
+ '\''
+ ", contentTypes='"
+ contentTypes
+ '\''
+ ", tags="
+ tags
+ ", action='"
+ action
+ '\''
+ ", auth='"
+ auth
+ '\''
+ '}';
return new StringJoiner(", ", ServiceReference.class.getSimpleName() + "[", "]")
.add("endpointId=" + endpointId)
.add("address=" + address)
.add("qualifier=" + qualifier)
.add("contentTypes=" + contentTypes)
.add("tags=" + tags)
.add("auth=" + auth)
.toString();
}
}
Expand Up @@ -2,6 +2,7 @@

import java.util.Collection;
import java.util.Map;
import java.util.StringJoiner;

public class ServiceRegistration {

Expand Down Expand Up @@ -49,14 +50,10 @@ public ServiceRegistration setTags(Map<String, String> tags) {

@Override
public String toString() {
return "ServiceRegistration{"
+ "namespace='"
+ namespace
+ '\''
+ ", tags="
+ tags
+ ", methods="
+ methods
+ '}';
return new StringJoiner(", ", ServiceRegistration.class.getSimpleName() + "[", "]")
.add("namespace=" + namespace)
.add("tags=" + tags)
.add("methods(" + methods.size() + ")")
.toString();
}
}
@@ -1,5 +1,7 @@
package io.scalecube.services.api;

import java.util.StringJoiner;

public final class ErrorData {

private int errorCode;
Expand Down Expand Up @@ -33,6 +35,9 @@ public String getErrorMessage() {

@Override
public String toString() {
return "ErrorData{" + "errorCode=" + errorCode + ", errorMessage='" + errorMessage + '\'' + '}';
return new StringJoiner(", ", ErrorData.class.getSimpleName() + "[", "]")
.add("errorCode=" + errorCode)
.add("errorMessage=" + errorMessage)
.toString();
}
}
Expand Up @@ -5,6 +5,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.StringJoiner;

public final class ServiceMessage {

Expand Down Expand Up @@ -184,7 +185,10 @@ public int errorType() {

@Override
public String toString() {
return "ServiceMessage {headers: " + headers + ", data: " + data + '}';
return new StringJoiner(", ", ServiceMessage.class.getSimpleName() + "[", "]")
.add("headers(" + headers.size() + ")")
.add("data=" + (data != null ? data.getClass().getName() : null))
.toString();
}

public static class Builder {
Expand Down