summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorHarald Musum <musum@verizonmedia.com>2019-07-22 15:51:37 +0200
committerHarald Musum <musum@verizonmedia.com>2019-07-22 15:51:37 +0200
commit42a7786597f97a25aae1eaa7ea83a21de91b2a38 (patch)
treea071d2edbce6009370b2f8e3f8ddaacaf728c263 /config
parent5d705fcb5eba5a6c394a86bd55165fb909ae98c2 (diff)
Remove unused code
Diffstat (limited to 'config')
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/ConfigHelper.java51
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/GenericConfig.java9
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/JRTConnection.java6
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/TimingValues.java2
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/benchmark/StressTester.java1
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/buildergen/ConfigDefinitionClass.java8
-rw-r--r--config/src/main/java/com/yahoo/vespa/config/protocol/Utf8SerializedString.java87
-rw-r--r--config/src/test/java/com/yahoo/vespa/config/ConfigHelperTest.java31
-rw-r--r--config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java2
9 files changed, 12 insertions, 185 deletions
diff --git a/config/src/main/java/com/yahoo/vespa/config/ConfigHelper.java b/config/src/main/java/com/yahoo/vespa/config/ConfigHelper.java
deleted file mode 100644
index 0f3b4b76aa8..00000000000
--- a/config/src/main/java/com/yahoo/vespa/config/ConfigHelper.java
+++ /dev/null
@@ -1,51 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.config;
-
-import com.yahoo.config.subscription.ConfigSourceSet;
-
-/**
- * Helper class for config applications (currently ConfigManager and ConfigProxy).
- *
- * @author <a href="gv@yahoo-inc.com">G. Voldengen</a>
- */
-public class ConfigHelper {
- private final JRTConnectionPool jrtConnectionPool;
- private final TimingValues timingValues;
-
- /**
- * @param configSourceSet The set of config sources for this helper.
- */
- public ConfigHelper(ConfigSourceSet configSourceSet) {
- this(configSourceSet, new TimingValues());
- }
-
- /**
- * @param configSourceSet The set of config sources for this helper.
- * @param timingValues values for timeouts and delays, see {@link TimingValues}
- */
- public ConfigHelper(ConfigSourceSet configSourceSet, TimingValues timingValues) {
- jrtConnectionPool = new JRTConnectionPool(configSourceSet);
- this.timingValues = timingValues;
- }
-
- /**
- * @return the config sources (remote servers and/or proxies) in this helper's connection pool.
- */
- public ConfigSourceSet getConfigSourceSet() {
- return jrtConnectionPool.getSourceSet();
- }
-
- /**
- * @return the connection pool for this config helper.
- */
- public JRTConnectionPool getConnectionPool() {
- return jrtConnectionPool;
- }
-
- /**
- * @return the timing values for this config helper.
- */
- public TimingValues getTimingValues() {
- return timingValues;
- }
-}
diff --git a/config/src/main/java/com/yahoo/vespa/config/GenericConfig.java b/config/src/main/java/com/yahoo/vespa/config/GenericConfig.java
index 8e8c767e393..2fbbda2aa38 100644
--- a/config/src/main/java/com/yahoo/vespa/config/GenericConfig.java
+++ b/config/src/main/java/com/yahoo/vespa/config/GenericConfig.java
@@ -11,19 +11,21 @@ import com.yahoo.config.ConfigInstance;
* when we don't have the schema.
*
* @author Ulf Lilleengen
- * @since 5.1
*/
public class GenericConfig {
public static class GenericConfigBuilder implements ConfigInstance.Builder {
+
private final ConfigPayloadBuilder payloadBuilder;
private final ConfigDefinitionKey defKey;
+
public GenericConfigBuilder(ConfigDefinitionKey defKey, ConfigPayloadBuilder payloadBuilder) {
this.defKey = defKey;
this.payloadBuilder = payloadBuilder;
}
+
+ @SuppressWarnings("unused") // Called by reflection
private ConfigBuilder override(GenericConfigBuilder superior) {
- ConfigPayloadBuilder superiorPayload = superior.payloadBuilder;
- payloadBuilder.override(superiorPayload);
+ payloadBuilder.override(superior.payloadBuilder);
return this;
}
@@ -49,4 +51,5 @@ public class GenericConfig {
return "";
}
}
+
}
diff --git a/config/src/main/java/com/yahoo/vespa/config/JRTConnection.java b/config/src/main/java/com/yahoo/vespa/config/JRTConnection.java
index 01da823b87b..cde46eb9de0 100644
--- a/config/src/main/java/com/yahoo/vespa/config/JRTConnection.java
+++ b/config/src/main/java/com/yahoo/vespa/config/JRTConnection.java
@@ -10,7 +10,7 @@ import java.util.logging.Logger;
/**
* A JRT connection to a config server or config proxy.
*
- * @author <a href="mailto:gunnarga@yahoo-inc.com">Gunnar Gauslaa Bergem</a>
+ * @author Gunnar Gauslaa Bergem
*/
public class JRTConnection implements Connection {
public final static Logger logger = Logger.getLogger(JRTConnection.class.getPackage().getName());
@@ -78,10 +78,6 @@ public class JRTConnection implements Connection {
lastSuccess = System.currentTimeMillis();
}
- public void setLastSuccess() {
- lastSuccess = System.currentTimeMillis();
- }
-
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("Address: ");
diff --git a/config/src/main/java/com/yahoo/vespa/config/TimingValues.java b/config/src/main/java/com/yahoo/vespa/config/TimingValues.java
index 6a814f99ee3..113d561bf87 100644
--- a/config/src/main/java/com/yahoo/vespa/config/TimingValues.java
+++ b/config/src/main/java/com/yahoo/vespa/config/TimingValues.java
@@ -6,7 +6,7 @@ import java.util.Random;
/**
* Timeouts, delays and retries used in RPC config protocol.
*
- * @author <a href="mailto:gunnarga@yahoo-inc.com">Gunnar Gauslaa Bergem</a>
+ * @author Gunnar Gauslaa Bergem
*/
public class TimingValues {
public static final long defaultNextConfigTimeout = 1000;
diff --git a/config/src/main/java/com/yahoo/vespa/config/benchmark/StressTester.java b/config/src/main/java/com/yahoo/vespa/config/benchmark/StressTester.java
index 4234a6deff1..0152c0bc3ff 100644
--- a/config/src/main/java/com/yahoo/vespa/config/benchmark/StressTester.java
+++ b/config/src/main/java/com/yahoo/vespa/config/benchmark/StressTester.java
@@ -14,7 +14,6 @@ import java.util.*;
* with test classes that implement the {@link Tester} interface.
*
* @author hmusum
- * @since 5.1.5
*/
public class StressTester {
private static boolean debug = false;
diff --git a/config/src/main/java/com/yahoo/vespa/config/buildergen/ConfigDefinitionClass.java b/config/src/main/java/com/yahoo/vespa/config/buildergen/ConfigDefinitionClass.java
index 6c3f3f90f40..8f222de3b55 100644
--- a/config/src/main/java/com/yahoo/vespa/config/buildergen/ConfigDefinitionClass.java
+++ b/config/src/main/java/com/yahoo/vespa/config/buildergen/ConfigDefinitionClass.java
@@ -4,7 +4,8 @@ package com.yahoo.vespa.config.buildergen;
/**
* @author Ulf Lilleengen
*/
-public class ConfigDefinitionClass {
+class ConfigDefinitionClass {
+
private final String name;
private final String pkg;
private final String definition;
@@ -19,11 +20,8 @@ public class ConfigDefinitionClass {
return definition;
}
- String getSimpleName() {
- return name;
- }
-
String getName() {
return pkg + "." + name;
}
+
}
diff --git a/config/src/main/java/com/yahoo/vespa/config/protocol/Utf8SerializedString.java b/config/src/main/java/com/yahoo/vespa/config/protocol/Utf8SerializedString.java
deleted file mode 100644
index 43c0f7f41e7..00000000000
--- a/config/src/main/java/com/yahoo/vespa/config/protocol/Utf8SerializedString.java
+++ /dev/null
@@ -1,87 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.config.protocol;
-
-import com.fasterxml.jackson.core.SerializableString;
-import com.yahoo.text.Utf8Array;
-
-import java.io.IOException;
-import java.io.OutputStream;
-import java.nio.ByteBuffer;
-
-/**
- * Wraps utf8array as a {@link com.fasterxml.jackson.core.SerializableString} to avoid extra copy.
- *
- * @author Ulf Lilleengen
- * @since 5.17
- */
-public class Utf8SerializedString implements SerializableString {
- private final Utf8Array value;
- public Utf8SerializedString(Utf8Array value) {
- this.value = value;
- }
-
- @Override
- public String getValue() {
- return value.toString();
- }
-
- @Override
- public int charLength() {
- return value.getByteLength();
- }
-
- @Override
- public char[] asQuotedChars() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public byte[] asUnquotedUTF8() {
- return value.getBytes();
- }
-
- @Override
- public byte[] asQuotedUTF8() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public int appendQuotedUTF8(byte[] buffer, int offset) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public int appendQuoted(char[] buffer, int offset) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public int appendUnquotedUTF8(byte[] buffer, int offset) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public int appendUnquoted(char[] buffer, int offset) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public int writeQuotedUTF8(OutputStream out) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public int writeUnquotedUTF8(OutputStream out) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public int putQuotedUTF8(ByteBuffer buffer) throws IOException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public int putUnquotedUTF8(ByteBuffer out) throws IOException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/config/src/test/java/com/yahoo/vespa/config/ConfigHelperTest.java b/config/src/test/java/com/yahoo/vespa/config/ConfigHelperTest.java
deleted file mode 100644
index 040cb06d05f..00000000000
--- a/config/src/test/java/com/yahoo/vespa/config/ConfigHelperTest.java
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
-package com.yahoo.vespa.config;
-
-import com.yahoo.config.subscription.ConfigSourceSet;
-import org.junit.Test;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.junit.Assert.assertThat;
-
-/**
- * @author hmusum
- * @since 5.1.9
- */
-public class ConfigHelperTest {
-
- @Test
- public void basic() {
- ConfigSourceSet configSourceSet = new ConfigSourceSet("host.com");
- ConfigHelper helper = new ConfigHelper(configSourceSet);
- assertThat(helper.getConfigSourceSet(), is(configSourceSet));
- assertThat(helper.getConnectionPool().getAllSourceAddresses(), is("host.com"));
- assertThat(helper.getTimingValues().getSubscribeTimeout(), is(new TimingValues().getSubscribeTimeout()));
-
- // Specify timing values
- TimingValues tv = new TimingValues();
- tv.setSubscribeTimeout(11L);
- helper = new ConfigHelper(configSourceSet, tv);
- assertThat(helper.getTimingValues().getSubscribeTimeout(), is(tv.getSubscribeTimeout()));
- }
-
-}
diff --git a/config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java b/config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java
index faeedff2762..8a403b45003 100644
--- a/config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java
+++ b/config/src/test/java/com/yahoo/vespa/config/JRTConnectionPoolTest.java
@@ -13,7 +13,7 @@ import static org.junit.Assert.*;
/**
* Tests for the JRTConnectionPool class.
*
- * @author <a href="mailto:gunnarga@yahoo-inc.com">Gunnar Gauslaa Bergem</a>
+ * @author Gunnar Gauslaa Bergem
* @author hmusum
*/
public class JRTConnectionPoolTest {