Skip to content

Commit

Permalink
Revert "dark cluster schema and serializer changes"
Browse files Browse the repository at this point in the history
This reverts commit 4b96323.

RB=1920382
R=ybi,dhoa
A=ybi
  • Loading branch information
evanw555 committed Dec 19, 2019
1 parent ddc11be commit 2fb4679
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 351 deletions.
6 changes: 3 additions & 3 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
28.1.4
------

28.1.3
------
(RB=1920382)
Revert "dark cluster schema and serializer changes"

(RB=1919524)
Use PDL in examples and restli-example-api

Expand Down
9 changes: 0 additions & 9 deletions d2-schemas/src/main/pegasus/com/linkedin/d2/D2Cluster.pdsc
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,6 @@
},
"default": [],
"doc": "List of validation strings. SSL session validator use this information to verify the host it connects to. The name is generically defined because it can be used by any type SSLSessionValidator in open source world."
},
{
"name": "darkClusters",
"type": {
"type": "map",
"values": "DarkClusterConfig"
},
"default": {},
"doc": "Holds the configuration for this cluster's dark canary clusters, if any. The map is keyed by the dark canary name."
}
]
}
26 changes: 0 additions & 26 deletions d2-schemas/src/main/pegasus/com/linkedin/d2/DarkClusterConfig.pdsc

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

package com.linkedin.d2.balancer.properties;

import com.linkedin.d2.DarkClusterConfigMap;
import java.net.URI;
import java.util.Collections;
import java.util.HashSet;
Expand All @@ -26,10 +25,6 @@

public class ClusterProperties
{
public static final float DARK_CLUSTER_DEFAULT_MULTIPLIER = 0.0f;
public static final int DARK_CLUSTER_DEFAULT_TARGET_RATE = 0;
public static final int DARK_CLUSTER_DEFAULT_MAX_RATE = 2147483647;

private final String _clusterName;
private final Map<String, String> _properties;
private final PartitionProperties _partitionProperties;
Expand All @@ -38,7 +33,6 @@ public class ClusterProperties
private final Set<URI> _bannedUris;
@Deprecated
private final List<String> _prioritizedSchemes;
private final DarkClusterConfigMap _darkClusters;

public ClusterProperties(String clusterName)
{
Expand Down Expand Up @@ -80,18 +74,6 @@ public ClusterProperties(String clusterName,
Set<URI> bannedUris,
PartitionProperties partitionProperties,
List<String> sslSessionValidationStrings)
{
this(clusterName, prioritizedSchemes, properties, bannedUris, partitionProperties, sslSessionValidationStrings,
null);
}

public ClusterProperties(String clusterName,
List<String> prioritizedSchemes,
Map<String, String> properties,
Set<URI> bannedUris,
PartitionProperties partitionProperties,
List<String> sslSessionValidationStrings,
DarkClusterConfigMap darkClusters)

{
_clusterName = clusterName;
Expand All @@ -103,7 +85,6 @@ public ClusterProperties(String clusterName,
_partitionProperties = partitionProperties;
_sslSessionValidationStrings = sslSessionValidationStrings == null ? Collections.emptyList() : Collections.unmodifiableList(
sslSessionValidationStrings);
_darkClusters = darkClusters == null ? new DarkClusterConfigMap() : darkClusters;
}

public boolean isBanned(URI uri)
Expand Down Expand Up @@ -141,18 +122,13 @@ public List<String> getSslSessionValidationStrings()
return _sslSessionValidationStrings;
}

public DarkClusterConfigMap getDarkClusters()
{
return _darkClusters;
}

@Override
public String toString()
{
return "ClusterProperties [_clusterName=" + _clusterName + ", _prioritizedSchemes="
+ _prioritizedSchemes + ", _properties=" + _properties + ", _bannedUris=" + _bannedUris
+ ", _partitionProperties=" + _partitionProperties + ", _sslSessionValidationStrings=" + _sslSessionValidationStrings
+ ", _darkClusterConfigMap=" + _darkClusters + "]";
+ "]";
}

@Override
Expand All @@ -168,7 +144,6 @@ public int hashCode()
result = prime * result + ((_properties == null) ? 0 : _properties.hashCode());
result = prime * result + ((_partitionProperties == null) ? 0 : _partitionProperties.hashCode());
result = prime * result + ((_sslSessionValidationStrings == null) ? 0 : _sslSessionValidationStrings.hashCode());
result = prime * result + ((_darkClusters == null) ? 0 : _darkClusters.hashCode());
return result;
}

Expand Down Expand Up @@ -208,10 +183,6 @@ public boolean equals(Object obj)
{
return false;
}
if (!_darkClusters.equals(other._darkClusters))
{
return false;
}
return _sslSessionValidationStrings.equals(other._sslSessionValidationStrings);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,11 @@
package com.linkedin.d2.balancer.properties;


import com.linkedin.d2.DarkClusterConfigMap;
import com.linkedin.d2.balancer.config.DarkClustersConverter;
import com.linkedin.d2.balancer.properties.util.PropertyUtil;
import com.linkedin.d2.balancer.util.JacksonUtil;
import com.linkedin.d2.discovery.PropertyBuilder;
import com.linkedin.d2.discovery.PropertySerializationException;
import com.linkedin.d2.discovery.PropertySerializer;
import java.util.ArrayList;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -154,11 +151,6 @@ public ClusterProperties fromMap(Map<String, Object> map)
partitionProperties = NullPartitionProperties.getInstance();
}

@SuppressWarnings("unchecked")
Map<String, Object> darkClusterProperty = (Map<String, Object>) map.get(PropertyKeys.DARK_CLUSTER_MAP);
DarkClusterConfigMap darkClusterConfigMap = DarkClustersConverter.toConfig(darkClusterProperty);

return new ClusterProperties(clusterName, prioritizedSchemes, properties, banned, partitionProperties, validationList,
darkClusterConfigMap);
return new ClusterProperties(clusterName, prioritizedSchemes, properties, banned, partitionProperties, validationList);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ public class PropertyKeys
public static final String FULL_CLUSTER_LIST = "fullClusterList";
public static final String CLUSTER_PROPERTIES = "properties";
public static final String SSL_VALIDATION_STRINGS = "sslSessionValidationStrings";
public static final String DARK_CLUSTER_MAP = "darkClusters";

//used by transport client creation
public static final String HTTP_POOL_WAITER_SIZE = HttpClientFactory.HTTP_POOL_WAITER_SIZE;
Expand Down

This file was deleted.

Loading

0 comments on commit 2fb4679

Please sign in to comment.