Skip to content

Commit

Permalink
cells: remove legacy format of LM entries in zookeeper
Browse files Browse the repository at this point in the history
Motivation:
Historically, the zookeeper entry in LM was just a nodes in /dcache/lm/cores
with hostname/IP as the content. Later on the URI based support was added to
handle TLS enabled transport, but legacy mode was kept for backward compatibility.
Now it's time to move forward.

Modification:
emove legacy format of LM entries in zookeeper

Result:
remove historic code.

Acked-by: Paul Millar
Acked-by: Lea Morschel
Acked-by: Marina Sahakyan
Target: master
Require-book: no
Require-notes: yes
  • Loading branch information
kofemann committed Mar 17, 2021
1 parent 0348759 commit 299122f
Showing 1 changed file with 1 addition and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* dCache - http://www.dcache.org/
*
* Copyright (C) 2016 - 2019 Deutsches Elektronen-Synchrotron
* Copyright (C) 2016 - 2021 Deutsches Elektronen-Synchrotron
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
Expand Down Expand Up @@ -49,7 +49,6 @@
import java.net.InetAddress;
import java.net.URI;
import java.net.UnknownHostException;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -91,9 +90,6 @@ public class LocationManager extends CellAdapter
private static final Logger LOGGER =
LoggerFactory.getLogger(LocationManager.class);

// legacy support. remove in 7.0
private static final String ZK_CORES_PLAIN = "/dcache/lm/cores";

private static final String ZK_CORES_URI = "/dcache/lm/cores-uri";
private static final String ZK_CORE_CONFIG = "/dcache/lm/core-config";

Expand Down Expand Up @@ -333,7 +329,6 @@ private abstract static class CoreDomains implements Closeable


/* Only created if the local domain is a core. */
private LmPersistentNode<HostAndPort> localLegacy; // remove with 7.0
private LmPersistentNode<CoreDomainInfo> localUri;

protected CoreDomains(String domainName, CuratorFramework client, PathChildrenCache cores)
Expand Down Expand Up @@ -366,9 +361,6 @@ void start() throws Exception
public void close() throws IOException
{
CloseableUtils.closeQuietly(cores);
if (localLegacy != null) {
CloseableUtils.closeQuietly(localLegacy);
}
if (localUri != null) {
CloseableUtils.closeQuietly(localUri);
}
Expand All @@ -391,18 +383,6 @@ private void setCoreDomainInfoUri(CoreDomainInfo coreDomainInfo) throws Persiste
coreDomainInfo,
CoreDomainInfo::toBytes,
localUri);

// produce legacy file for backward compatibility. Remove with 7.0
Optional<HostAndPort> plainConnection = coreDomainInfo.getEndpointForSchema("tcp");
if (plainConnection.isPresent()) {
localLegacy = LmPersistentNode.createOrUpdate(client,
pathOf(ZK_CORES_PLAIN, domainName),
plainConnection.get(),
address -> address.toString()
.getBytes(StandardCharsets.US_ASCII),
localLegacy);
}

}
}

Expand Down

0 comments on commit 299122f

Please sign in to comment.