diff options
author | Harald Musum <musum@verizonmedia.com> | 2020-07-29 10:45:08 +0200 |
---|---|---|
committer | Harald Musum <musum@verizonmedia.com> | 2020-07-29 10:45:08 +0200 |
commit | c38e1725c1eecb8589438b13c66d460fd2e85fe6 (patch) | |
tree | 61dd0302a47c8c1539f6707646212cf5135f95dc | |
parent | 5d1171de674bf0bc3cc5a6171feeda87a2379fd0 (diff) |
Remove unnecesssary logging
5 files changed, 8 insertions, 24 deletions
diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ZooKeeperClient.java b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ZooKeeperClient.java index 7e83d7013e0..c634d82010e 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ZooKeeperClient.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/deploy/ZooKeeperClient.java @@ -36,16 +36,14 @@ public class ZooKeeperClient { private final ConfigCurator configCurator; private final DeployLogger logger; - private final boolean logFine; /* This is the generation that will be used for reading and writing application data. (1 more than last deployed application) */ private final Path rootPath; private static final ApplicationFile.PathFilter xmlFilter = path -> path.getName().endsWith(".xml"); - public ZooKeeperClient(ConfigCurator configCurator, DeployLogger logger, boolean logFine, Path rootPath) { + public ZooKeeperClient(ConfigCurator configCurator, DeployLogger logger, Path rootPath) { this.configCurator = configCurator; this.logger = logger; - this.logFine = logFine; this.rootPath = rootPath; } @@ -62,7 +60,6 @@ public class ZooKeeperClient { try { while (retries > 0) { try { - logFine("Setting up ZooKeeper nodes for this application"); createZooKeeperNodes(); break; } catch (RuntimeException e) { @@ -105,16 +102,11 @@ public class ZooKeeperClient { * @param app the application package to feed to zookeeper */ void write(ApplicationPackage app) { - logFine("Feeding application config into ZooKeeper"); try { - logFine("Feeding user def files into ZooKeeper"); writeUserDefs(app); - logFine("Feeding application package into ZooKeeper"); writeSomeOf(app); writeSearchDefinitions(app); writeUserIncludeDirs(app, app.getUserIncludeDirs()); - logFine("Feeding sd from docproc bundle into ZooKeeper"); - logFine("Write application metadata into ZooKeeper"); write(app.getMetaData()); } catch (Exception e) { throw new IllegalStateException("Unable to write vespa model to config server(s) " + System.getProperty("configsources") + "\n" + @@ -269,7 +261,6 @@ public class ZooKeeperClient { } private void write(Version vespaVersion, FileRegistry fileRegistry) { - logFine("Feeding file registry data into ZooKeeper"); String exportedRegistry = PreGeneratedFileRegistry.exportRegistry(fileRegistry); configCurator.putData(getZooKeeperAppPath(null).append(ZKApplicationPackage.fileRegistryNode).getAbsolute(), @@ -288,7 +279,6 @@ public class ZooKeeperClient { } void cleanupZooKeeper() { - logFine("Exception occurred. Cleaning up ZooKeeper"); try { for (String subPath : Arrays.asList( ConfigCurator.DEFCONFIGS_ZK_SUBPATH, @@ -317,12 +307,6 @@ public class ZooKeeperClient { } } - private void logFine(String msg) { - if (logFine) { - logger.log(Level.FINE, msg); - } - } - public void write(AllocatedHosts hosts) throws IOException { configCurator.putData(rootPath.append(ZKApplicationPackage.allocatedHostsNode).getAbsolute(), AllocatedHostsSerializer.toJson(hosts)); diff --git a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClient.java b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClient.java index 906490ad8ba..1b9527f4376 100644 --- a/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClient.java +++ b/configserver/src/main/java/com/yahoo/vespa/config/server/session/SessionZooKeeperClient.java @@ -214,7 +214,7 @@ public class SessionZooKeeperClient { } public ZooKeeperDeployer createDeployer(DeployLogger logger) { - ZooKeeperClient zkClient = new ZooKeeperClient(configCurator, logger, true, sessionPath); + ZooKeeperClient zkClient = new ZooKeeperClient(configCurator, logger, sessionPath); return new ZooKeeperDeployer(zkClient); } diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/ZooKeeperClientTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/ZooKeeperClientTest.java index 8394611737e..a4fce5e37ba 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/ZooKeeperClientTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/ZooKeeperClientTest.java @@ -53,7 +53,7 @@ public class ZooKeeperClientTest { @Before public void setupZK() throws IOException { zk = ConfigCurator.create(new MockCurator()); - ZooKeeperClient zkc = new ZooKeeperClient(zk, new BaseDeployLogger(), true, Path.fromString(appPath)); + ZooKeeperClient zkc = new ZooKeeperClient(zk, new BaseDeployLogger(), Path.fromString(appPath)); ApplicationPackage app = FilesApplicationPackage.fromFileWithDeployData(new File("src/test/apps/zkfeed"), new DeployData("foo", "/bar/baz", @@ -85,7 +85,7 @@ public class ZooKeeperClientTest { ConfigCurator zk = ConfigCurator.create(new MockCurator()); BaseDeployLogger logger = new BaseDeployLogger(); long generation = 1L; - ZooKeeperClient zooKeeperClient = new ZooKeeperClient(zk, logger, true, Path.fromString("/1")); + ZooKeeperClient zooKeeperClient = new ZooKeeperClient(zk, logger, Path.fromString("/1")); zooKeeperClient.setupZooKeeper(); String appPath = "/"; assertThat(zk.getChildren(appPath).size(), is(1)); @@ -120,7 +120,7 @@ public class ZooKeeperClientTest { ConfigCurator zk = ConfigCurator.create(new MockCurator()); BaseDeployLogger logger = new BaseDeployLogger(); Path app = Path.fromString("/1"); - ZooKeeperClient zooKeeperClient = new ZooKeeperClient(zk, logger, true, app); + ZooKeeperClient zooKeeperClient = new ZooKeeperClient(zk, logger, app); zooKeeperClient.setupZooKeeper(); String currentAppPath = app.getAbsolute(); @@ -191,7 +191,7 @@ public class ZooKeeperClientTest { ConfigCurator zk = ConfigCurator.create(new MockCurator()); BaseDeployLogger logger = new BaseDeployLogger(); Path app = Path.fromString("/1"); - ZooKeeperClient zooKeeperClient = new ZooKeeperClient(zk, logger, true, app); + ZooKeeperClient zooKeeperClient = new ZooKeeperClient(zk, logger, app); zooKeeperClient.setupZooKeeper(); HostSpec host1 = new HostSpec("host1.yahoo.com", Collections.emptyList(), Optional.empty()); HostSpec host2 = new HostSpec("host2.yahoo.com", Collections.emptyList(), Optional.empty()); diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/ZooKeeperDeployerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/ZooKeeperDeployerTest.java index 4825ccc1328..641fbe5bf41 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/ZooKeeperDeployerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/deploy/ZooKeeperDeployerTest.java @@ -48,7 +48,7 @@ public class ZooKeeperDeployerTest { public void deploy(ApplicationPackage applicationPackage, ConfigCurator configCurator, Path appPath) throws IOException { MockDeployLogger logger = new MockDeployLogger(); - ZooKeeperClient client = new ZooKeeperClient(configCurator, logger, true, appPath); + ZooKeeperClient client = new ZooKeeperClient(configCurator, logger, appPath); ZooKeeperDeployer deployer = new ZooKeeperDeployer(client); deployer.deploy(applicationPackage, Collections.singletonMap(new Version(1, 0, 0), new MockFileRegistry()), AllocatedHosts.withHosts(Collections.emptySet())); diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/session/LocalSessionTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/session/LocalSessionTest.java index 496ded249fa..a2ef6aeb578 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/session/LocalSessionTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/session/LocalSessionTest.java @@ -119,7 +119,7 @@ public class LocalSessionTest { Optional<AllocatedHosts> allocatedHosts) throws Exception { SessionZooKeeperClient zkc = new MockSessionZKClient(curator, tenant, sessionId, allocatedHosts); zkc.createWriteStatusTransaction(Session.Status.NEW).commit(); - ZooKeeperClient zkClient = new ZooKeeperClient(configCurator, new BaseDeployLogger(), false, + ZooKeeperClient zkClient = new ZooKeeperClient(configCurator, new BaseDeployLogger(), TenantRepository.getSessionsPath(tenant).append(String.valueOf(sessionId))); if (allocatedHosts.isPresent()) { zkClient.write(allocatedHosts.get()); |