Skip to content

Commit

Permalink
Revert "connection mapper"
Browse files Browse the repository at this point in the history
This reverts commit ccf7dc9.
  • Loading branch information
dzdx committed May 25, 2022
1 parent 0421cb7 commit 4138898
Show file tree
Hide file tree
Showing 71 changed files with 372 additions and 430 deletions.
2 changes: 1 addition & 1 deletion client/all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.alipay.sofa</groupId>
<artifactId>registry-client-all</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>

<name>${project.groupId}:${project.artifactId}</name>
<url>http://github.com/alipay/sofa-registry</url>
Expand Down
2 changes: 1 addition & 1 deletion client/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-client-parent</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ public class BaseRegistration {

protected String appName;

protected String instanceId;

protected String ip;

/**
* Getter method for property <tt>dataId</tt>.
*
Expand Down Expand Up @@ -88,22 +84,6 @@ public void setAppName(String appName) {
this.appName = appName;
}

public String getInstanceId() {
return instanceId;
}

public void setInstanceId(String instanceId) {
this.instanceId = instanceId;
}

public String getIp() {
return ip;
}

public void setIp(String ip) {
this.ip = ip;
}

/** @see Object#toString() */
@Override
public String toString() {
Expand Down
2 changes: 1 addition & 1 deletion client/impl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-client-parent</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,7 @@ public Object assembly() {
readLock.lock();
ConfiguratorRegister register = new ConfiguratorRegister();
try {
if (StringUtils.isNotEmpty(registration.getInstanceId())) {
register.setInstanceId(registration.getInstanceId());
} else {
register.setInstanceId(config.getInstanceId());
}
register.setInstanceId(config.getInstanceId());
if (StringUtils.isNotEmpty(config.getZone())) {
register.setZone(config.getZone());
} else {
Expand All @@ -134,7 +130,6 @@ public Object assembly() {
} else {
register.setAppName(config.getAppName());
}
register.setIp(registration.getIp());
register.setDataId(registration.getDataId());
register.setGroup(registration.getGroup());
register.setRegistId(REGIST_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,7 @@ public PublisherRegister assembly() {
PublisherRegister register;
try {
register = new PublisherRegister();
if (StringUtils.isNotEmpty(registration.getInstanceId())) {
register.setInstanceId(registration.getInstanceId());
} else {
register.setInstanceId(config.getInstanceId());
}
register.setInstanceId(config.getInstanceId());
if (StringUtils.isNotEmpty(config.getZone())) {
register.setZone(config.getZone());
} else {
Expand All @@ -121,7 +117,6 @@ public PublisherRegister assembly() {
} else {
register.setAppName(config.getAppName());
}
register.setIp(registration.getIp());
register.setDataId(registration.getDataId());
register.setGroup(registration.getGroup());
register.setRegistId(REGIST_ID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,11 +176,7 @@ public SubscriberRegister assembly() {
}

register = new SubscriberRegister();
if (StringUtils.isNotEmpty(registration.getInstanceId())) {
register.setInstanceId(registration.getInstanceId());
} else {
register.setInstanceId(config.getInstanceId());
}
register.setInstanceId(config.getInstanceId());
if (StringUtils.isNotEmpty(config.getZone())) {
register.setZone(config.getZone());
} else {
Expand All @@ -191,7 +187,6 @@ public SubscriberRegister assembly() {
} else {
register.setAppName(config.getAppName());
}
register.setIp(registration.getIp());
register.setDataId(registration.getDataId());
register.setGroup(registration.getGroup());
register.setRegistId(REGIST_ID);
Expand Down
2 changes: 1 addition & 1 deletion client/log/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-client-parent</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-parent</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-parent</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,4 @@ public class AttributeKeyConstants {
public static final String ATTRIBUTE_SIGNATURE = "!Signature";
/** Timestamp Key */
public static final String ATTRIBUTE_TIMESTAMP = "!Timestamp";

public static final String ATTRIBUTE_CLIENT_IP = "!ClientIp";

public static final String ATTRIBUTE_BLOCKED_REQUEST = "!Blocked";
}
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-parent</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<packaging>pom</packaging>

<name>${project.groupId}:${project.artifactId}</name>
Expand Down
2 changes: 1 addition & 1 deletion server/common/model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-common</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ public static Publisher clonePublisher(Publisher publisher) {
newPub.setAttributes(publisher.getAttributes());
newPub.setClientVersion(publisher.getClientVersion());

newPub.setIp(publisher.getIp());
newPub.setDataList(publisher.getDataList());
newPub.setPublishType(publisher.getPublishType());
newPub.setPublishSource(publisher.getPublishSource());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,4 +168,6 @@ public class ValueConstants {
public static final String CLIENT_OPEN = "clientOpen";

public static final String REDUCE = "reduce";

public static final String BLOCKED_REQUEST_KEY = "!Blocked";
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,6 @@ public abstract class BaseInfo implements Serializable, StoreData<String> {

private volatile Map<String, String> attributes;

private String ip;

/** ClientVersion Enum */
public enum ClientVersion {
/** */
Expand Down Expand Up @@ -329,14 +327,6 @@ public void setInstanceId(String instanceId) {
this.instanceId = WordCache.getWordCache(instanceId);
}

public String getIp() {
return ip;
}

public void setIp(String ip) {
this.ip = WordCache.getWordCache(ip);
}

/**
* Getter method for property <tt>group</tt>.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ public static Publisher internPublisher(Publisher publisher) {
publisher.setGroup(publisher.getGroup());
publisher.setDataId(publisher.getDataId());
publisher.setClientId(publisher.getClientId());
publisher.setIp(publisher.getIp());
publisher.setCell(publisher.getCell());
publisher.setProcessId(publisher.getProcessId());
publisher.setAppName(publisher.getAppName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ public static Subscriber internSubscriber(Subscriber subscriber) {
subscriber.setGroup(subscriber.getGroup());
subscriber.setDataId(subscriber.getDataId());
subscriber.setCell(subscriber.getCell());
subscriber.setIp(subscriber.getIp());
subscriber.setProcessId(subscriber.getProcessId());
subscriber.setAppName(subscriber.getAppName());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public static Watcher internWatcher(Watcher watcher) {
watcher.setGroup(watcher.getGroup());
watcher.setDataId(watcher.getDataId());
watcher.setClientId(watcher.getClientId());
watcher.setIp(watcher.getIp());
watcher.setCell(watcher.getCell());
watcher.setProcessId(watcher.getProcessId());
watcher.setAppName(watcher.getAppName());
Expand Down
2 changes: 1 addition & 1 deletion server/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-server-parent</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion server/common/util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-common</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
1 change: 0 additions & 1 deletion server/distribution/all/distribution-all.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
<destName>log4j2.xml</destName>
</file>
</files>

<moduleSets>
<moduleSet>
<useAllReactorProjects>true</useAllReactorProjects>
Expand Down
2 changes: 1 addition & 1 deletion server/distribution/all/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-distribution</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion server/distribution/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-server-parent</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
2 changes: 1 addition & 1 deletion server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-parent</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion server/remoting/api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-remoting</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,4 @@ public interface Channel {
WebTarget getWebTarget();

void close();

void setClientIP(String clientIP);

String getClientIP();
}
2 changes: 1 addition & 1 deletion server/remoting/bolt/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-remoting</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
*/
public class BoltChannel implements Channel {

private static final String ATTR_CLIENT_IP = "attr.client.ip";

private final Connection connection;

private AsyncContext asyncContext;
Expand Down Expand Up @@ -154,16 +152,4 @@ public String toString() {
getLocalAddress(),
markProtobuf);
}

public void setClientIP(String clientIP) {
connection.setAttribute(ATTR_CLIENT_IP, clientIP);
}

public String getClientIP() {
Object obj = connection.getAttribute(ATTR_CLIENT_IP);
if (obj == null) {
return connection.getRemoteIP();
}
return (String) obj;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import com.alipay.sofa.registry.remoting.Channel;
import java.net.InetSocketAddress;
import javax.ws.rs.client.WebTarget;
import org.apache.commons.lang.StringUtils;

/**
* @author xuanbei
Expand Down Expand Up @@ -64,12 +63,4 @@ public WebTarget getWebTarget() {

@Override
public void close() {}

@Override
public void setClientIP(String clientIP) {}

@Override
public String getClientIP() {
return StringUtils.EMPTY;
}
}
2 changes: 1 addition & 1 deletion server/remoting/http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.alipay.sofa</groupId>
<artifactId>registry-remoting</artifactId>
<version>6.1.4-ats-SNAPSHOT</version>
<version>6.1.4-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.net.URI;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.WebTarget;
import org.apache.commons.lang.StringUtils;

/**
* @author shangyu.wh
Expand Down Expand Up @@ -88,12 +87,4 @@ public WebTarget getWebTarget() {
public void close() {
client.close();
}

@Override
public void setClientIP(String clientIP) {}

@Override
public String getClientIP() {
return StringUtils.EMPTY;
}
}
Loading

0 comments on commit 4138898

Please sign in to comment.