Apache Solr open-source search software
Review org.apache.solr.client.solrj.io.stream and responding to some warnings. (#2530)
Eric Pughcdb7af363afb
diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/CloudAuthStreamTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/CloudAuthStreamTest.javaindex cc860697c42..799330fbd0e 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/CloudAuthStreamTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/CloudAuthStreamTest.java@@ -50,7 +50,7 @@ import org.slf4j.LoggerFactory;/*** tests various streaming expressions (via the SolrJ {@link SolrStream} API) against a SolrCloud- * cluster using both Authenticationand Role based Authorization+ * cluster using both Authentication and Role based Authorization*/public class CloudAuthStreamTest extends SolrCloudTestCase {@@ -67,8 +67,8 @@ public class CloudAuthStreamTest extends SolrCloudTestCase {private static String solrUrl = null;/**- * Helper that returns the original {@link SolrRequest} <em>with it's original type</em> so it can- * be chained. This menthod knows that for the purpose of this test, every user name is it's own+ * Helper that returns the original {@link SolrRequest} <em>with its original type</em> so it can+ * be chained. This method knows that for the purpose of this test, every username is its own* password** @see SolrRequest#setBasicAuthCredentials@@ -253,7 +253,7 @@ public class CloudAuthStreamTest extends SolrCloudTestCase {assertEquals("hello world", tuples.get(0).get("echo"));}- public void testEchoStreamNoCredentials() throws Exception {+ public void testEchoStreamNoCredentials() {final SolrStream solrStream =new SolrStream(solrUrl + "/" + COLLECTION_X,@@ -270,7 +270,7 @@ public class CloudAuthStreamTest extends SolrCloudTestCase {});}- public void testEchoStreamInvalidCredentials() throws Exception {+ public void testEchoStreamInvalidCredentials() {final SolrStream solrStream =new SolrStream(solrUrl + "/" + COLLECTION_X,@@ -489,7 +489,7 @@ public class CloudAuthStreamTest extends SolrCloudTestCase {params("qt", "/stream", "_trace", "executor_via_" + trace, "expr", expr));solrStream.setCredentials(user, user);- // NOTE: Becaue of the backgroun threads, no failures will to be returned to client...+ // NOTE: Because of the background threads, no failures will to be returned to client...final List<Tuple> tuples = getTuples(solrStream);assertEquals(0, tuples.size());@@ -511,7 +511,7 @@ public class CloudAuthStreamTest extends SolrCloudTestCase {{// NOTE: in spite of what is implied by 'terminate=true', this daemon will NEVER terminate on- // it's own as long as the updates are successful (apparently that requires usage of a topic()+ // its own as long as the updates are successful (apparently that requires usage of a topic()// stream to set a "sleepMillis"?!)final String expr ="daemon(id=daemonId,runInterval=1000,terminate=true,update("@@ -936,7 +936,7 @@ public class CloudAuthStreamTest extends SolrCloudTestCase {/** Slurps a stream into a List */protected static List<Tuple> getTuples(final TupleStream tupleStream) throws IOException {- List<Tuple> tuples = new ArrayList<Tuple>();+ List<Tuple> tuples = new ArrayList<>();try {log.trace("TupleStream: {}", tupleStream);tupleStream.open();@@ -952,8 +952,8 @@ public class CloudAuthStreamTest extends SolrCloudTestCase {return tuples;}- /** Sigh. DaemonStream requires polling the same core where the stream was exectured. */- protected static String getRandomCoreUrl(final String collection) throws Exception {+ /** Sigh. DaemonStream requires polling the same core where the stream was executed. */+ protected static String getRandomCoreUrl(final String collection) {final List<String> replicaUrls =cluster.getZkStateReader()diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/JDBCStreamTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/JDBCStreamTest.javaindex 635376be1df..3a2e028130d 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/JDBCStreamTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/JDBCStreamTest.java@@ -25,7 +25,6 @@ import java.sql.SQLException;import java.sql.Statement;import java.util.ArrayList;import java.util.List;-import java.util.Locale;import java.util.Map;import org.apache.lucene.tests.util.LuceneTestCase;import org.apache.solr.SolrTestCaseJ4.SuppressPointFields;@@ -94,7 +93,7 @@ public class JDBCStreamTest extends SolrCloudTestCase {public static void setupDatabase() throws Exception {// Initialize Database- // Ok, so.....hsqldb is doing something totally weird so I thought I'd take a moment to explain+ // Ok, so.....hsqldb is doing something totally weird, so I thought I'd take a moment to explain// it.// According to http://www.hsqldb.org/doc/1.8/guide/guide.html#N101EF, section "Components of// SQL Expressions", clause "name", "When an SQL statement is issued, any lowercase characters@@ -279,7 +278,7 @@ public class JDBCStreamTest extends SolrCloudTestCase {// Load Solrnew UpdateRequest()- .add(id, "0", "code_s", "GB", "name_s", "Great Britian")+ .add(id, "0", "code_s", "GB", "name_s", "Great Britain").add(id, "1", "code_s", "CA", "name_s", "Canada").commit(cluster.getSolrClient(), COLLECTIONORALIAS);@@ -323,7 +322,7 @@ public class JDBCStreamTest extends SolrCloudTestCase {"name_s","Algeria","Canada",- "Great Britian",+ "Great Britain","Netherlands","Norway","Nepal",@@ -773,7 +772,7 @@ public class JDBCStreamTest extends SolrCloudTestCase {return tuples;}- protected boolean assertOrderOf(List<Tuple> tuples, String fieldName, int... values)+ protected void assertOrderOf(List<Tuple> tuples, String fieldName, int... values)throws Exception {int i = 0;for (int val : values) {@@ -784,11 +783,9 @@ public class JDBCStreamTest extends SolrCloudTestCase {}++i;}- return true;}- protected boolean assertOrderOf(List<Tuple> tuples, String fieldName, double... values)- throws Exception {+ protected void assertOrderOf(List<Tuple> tuples, String fieldName, double... values) {int i = 0;for (double val : values) {Tuple t = tuples.get(i);@@ -796,10 +793,9 @@ public class JDBCStreamTest extends SolrCloudTestCase {assertEquals("Found value:" + tip + " expecting:" + val, val, tip, 0.00001);++i;}- return true;}- protected boolean assertOrderOf(List<Tuple> tuples, String fieldName, String... values)+ protected void assertOrderOf(List<Tuple> tuples, String fieldName, String... values)throws Exception {int i = 0;for (String val : values) {@@ -807,7 +803,7 @@ public class JDBCStreamTest extends SolrCloudTestCase {if (null == val) {if (null != t.get(fieldName)) {- throw new Exception("Found value:" + (String) t.get(fieldName) + " expecting:null");+ throw new Exception("Found value:" + t.get(fieldName) + " expecting:null");}} else {String tip = (String) t.get(fieldName);@@ -817,29 +813,6 @@ public class JDBCStreamTest extends SolrCloudTestCase {}++i;}- return true;- }-- protected boolean assertFields(List<Tuple> tuples, String... fields) throws Exception {- for (Tuple tuple : tuples) {- for (String field : fields) {- if (!tuple.getFields().containsKey(field)) {- throw new Exception(String.format(Locale.ROOT, "Expected field '%s' not found", field));- }- }- }- return true;- }-- protected boolean assertNotFields(List<Tuple> tuples, String... fields) throws Exception {- for (Tuple tuple : tuples) {- for (String field : fields) {- if (tuple.getFields().containsKey(field)) {- throw new Exception(String.format(Locale.ROOT, "Unexpected field '%s' found", field));- }- }- }- return true;}public boolean assertLong(Tuple tuple, String fieldName, long l) throws Exception {@@ -862,9 +835,7 @@ public class JDBCStreamTest extends SolrCloudTestCase {public boolean assertString(Tuple tuple, String fieldName, String expected) throws Exception {String actual = (String) tuple.get(fieldName);- if ((null == expected && null != actual)- || (null != expected && null == actual)- || (null != expected && !expected.equals(actual))) {+ if ((null == expected && null != actual) || (null != expected && !expected.equals(actual))) {throw new Exception("Longs not equal:" + expected + " : " + actual);}diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/ParallelFacetStreamOverAliasTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/ParallelFacetStreamOverAliasTest.javaindex d7e90a09c42..347894bae42 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/ParallelFacetStreamOverAliasTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/ParallelFacetStreamOverAliasTest.java@@ -100,7 +100,7 @@ public class ParallelFacetStreamOverAliasTest extends SolrCloudTestCase {solrClientCache = new SolrClientCache();}- /** setup the testbed with necessary collections, documents, and alias */+ /** set up the testbed with necessary collections, documents, and alias */public static void setupCollectionsAndAlias() throws Exception {final NormalDistribution[] dists = new NormalDistribution[CARDINALITY];@@ -299,7 +299,7 @@ public class ParallelFacetStreamOverAliasTest extends SolrCloudTestCase {assertNull(statsStream.parallelizedStream);}- // execute the provided expression with tiered=true and compare to results of tiered=false+ // execute the provided expression with tiered=true and compare to result of tiered=falseprivate void compareTieredStreamWithNonTiered(String facetExprTmpl, int dims) throws IOException {String facetExpr = String.format(Locale.US, facetExprTmpl, ALIAS_NAME, "true");diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/SelectWithEvaluatorsTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/SelectWithEvaluatorsTest.javaindex c2639919cb0..ac4a4102e55 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/SelectWithEvaluatorsTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/SelectWithEvaluatorsTest.java@@ -20,7 +20,6 @@ import java.io.IOException;import java.util.ArrayList;import java.util.List;import java.util.Locale;-import java.util.Map;import org.apache.lucene.tests.util.LuceneTestCase;import org.apache.solr.client.solrj.io.SolrClientCache;import org.apache.solr.client.solrj.io.Tuple;@@ -47,8 +46,6 @@ public class SelectWithEvaluatorsTest extends SolrCloudTestCase {private static final int TIMEOUT = DEFAULT_TIMEOUT;private static final String id = "id";- private static boolean useAlias;-@BeforeClasspublic static void setupCluster() throws Exception {configureCluster(4)@@ -71,7 +68,7 @@ public class SelectWithEvaluatorsTest extends SolrCloudTestCase {.configure();String collection;- useAlias = random().nextBoolean();+ boolean useAlias = random().nextBoolean();if (useAlias) {collection = COLLECTIONORALIAS + "_collection";} else {@@ -145,39 +142,7 @@ public class SelectWithEvaluatorsTest extends SolrCloudTestCase {return tuples;}- protected boolean assertOrder(List<Tuple> tuples, int... ids) throws Exception {- return assertOrderOf(tuples, "id", ids);- }-- protected boolean assertOrderOf(List<Tuple> tuples, String fieldName, int... ids)- throws Exception {- int i = 0;- for (int val : ids) {- Tuple t = tuples.get(i);- String tip = t.getString(fieldName);- if (!tip.equals(Integer.toString(val))) {- throw new Exception("Found value:" + tip + " expecting:" + val);- }- ++i;- }- return true;- }-- protected boolean assertMapOrder(List<Tuple> tuples, int... ids) throws Exception {- int i = 0;- for (int val : ids) {- Tuple t = tuples.get(i);- List<Map<?, ?>> tip = t.getMaps("group");- int id = (int) tip.get(0).get("id");- if (id != val) {- throw new Exception("Found value:" + id + " expecting:" + val);- }- ++i;- }- return true;- }-- protected boolean assertFields(List<Tuple> tuples, String... fields) throws Exception {+ protected void assertFields(List<Tuple> tuples, String... fields) throws Exception {for (Tuple tuple : tuples) {for (String field : fields) {if (!tuple.getFields().containsKey(field)) {@@ -185,10 +150,9 @@ public class SelectWithEvaluatorsTest extends SolrCloudTestCase {}}}- return true;}- protected boolean assertNotFields(List<Tuple> tuples, String... fields) throws Exception {+ protected void assertNotFields(List<Tuple> tuples, String... fields) throws Exception {for (Tuple tuple : tuples) {for (String field : fields) {if (tuple.getFields().containsKey(field)) {@@ -196,21 +160,6 @@ public class SelectWithEvaluatorsTest extends SolrCloudTestCase {}}}- return true;- }-- protected boolean assertGroupOrder(Tuple tuple, int... ids) throws Exception {- List<?> group = (List<?>) tuple.get("tuples");- int i = 0;- for (int val : ids) {- Map<?, ?> t = (Map<?, ?>) group.get(i);- Long tip = (Long) t.get("id");- if (tip.intValue() != val) {- throw new Exception("Found value:" + tip.intValue() + " expecting:" + val);- }- ++i;- }- return true;}public boolean assertLong(Tuple tuple, String fieldName, long l) throws Exception {@@ -235,12 +184,9 @@ public class SelectWithEvaluatorsTest extends SolrCloudTestCase {public boolean assertString(Tuple tuple, String fieldName, String expected) throws Exception {String actual = (String) tuple.get(fieldName);- if ((null == expected && null != actual)- || (null != expected && null == actual)- || (null != expected && !expected.equals(actual))) {- throw new Exception("Longs not equal:" + expected + " : " + actual);+ if ((null != expected || null == actual) && (null == expected || expected.equals(actual))) {+ return true;}-- return true;+ throw new Exception("Longs not equal:" + expected + " : " + actual);}}diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamDecoratorTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamDecoratorTest.javaindex 453528d8338..2b19742ae6f 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamDecoratorTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamDecoratorTest.java@@ -5152,12 +5152,11 @@ public class StreamDecoratorTest extends SolrCloudTestCase {return tuples;}- protected boolean assertOrder(List<Tuple> tuples, int... ids) throws Exception {- return assertOrderOf(tuples, "id", ids);+ protected void assertOrder(List<Tuple> tuples, int... ids) throws Exception {+ assertOrderOf(tuples, "id", ids);}- protected boolean assertOrderOf(List<Tuple> tuples, String fieldName, int... ids)- throws Exception {+ protected void assertOrderOf(List<Tuple> tuples, String fieldName, int... ids) throws Exception {int i = 0;for (int val : ids) {Tuple t = tuples.get(i);@@ -5167,10 +5166,9 @@ public class StreamDecoratorTest extends SolrCloudTestCase {}++i;}- return true;}- protected boolean assertFields(List<Tuple> tuples, String... fields) throws Exception {+ protected void assertFields(List<Tuple> tuples, String... fields) throws Exception {for (Tuple tuple : tuples) {for (String field : fields) {if (!tuple.getFields().containsKey(field)) {@@ -5178,10 +5176,9 @@ public class StreamDecoratorTest extends SolrCloudTestCase {}}}- return true;}- protected boolean assertNotFields(List<Tuple> tuples, String... fields) throws Exception {+ protected void assertNotFields(List<Tuple> tuples, String... fields) throws Exception {for (Tuple tuple : tuples) {for (String field : fields) {if (tuple.getFields().containsKey(field)) {@@ -5189,7 +5186,6 @@ public class StreamDecoratorTest extends SolrCloudTestCase {}}}- return true;}protected boolean assertGroupOrder(Tuple tuple, int... ids) throws Exception {diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExecutorHelperTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExecutorHelperTest.javaindex ae80cea1060..287aa851734 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExecutorHelperTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExecutorHelperTest.java@@ -36,7 +36,7 @@ public class StreamExecutorHelperTest extends SolrTestCase {List<Long> results = new ArrayList<>();results.addAll(StreamExecutorHelper.submitAllAndAwaitAggregatingExceptions(tasks, "test"));Collections.sort(results);- List<Long> expected = List.of(0l, 1l, 2l, 3l, 4l);+ List<Long> expected = List.of(0L, 1L, 2L, 3L, 4L);assertEquals(expected, results);}diff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.javaindex 050b5726ff2..1541312d02e 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionTest.java@@ -73,7 +73,6 @@ public class StreamExpressionTest extends SolrCloudTestCase {private static final String COLLECTIONORALIAS = "collection1";private static final String FILESTREAM_COLLECTION = "filestream_collection";- private static final int TIMEOUT = DEFAULT_TIMEOUT;private static final String id = "id";private static boolean useAlias;@@ -256,7 +255,7 @@ public class StreamExpressionTest extends SolrCloudTestCase {assertOrder(tuples, 0, 2, 1, 3, 4);assertLong(tuples.get(0), "a_i", 0);- // Execersise the /stream hander+ // Exercise the /stream handler// Add the shards http parameter for the myCollectionStringBuilder buf = new StringBuilder();@@ -1040,7 +1039,7 @@ public class StreamExpressionTest extends SolrCloudTestCase {assertEquals(6.0D, perf, 0.0);assertEquals(10, count, 0.0);- // Execersise the /stream hander+ // Exercise the /stream handler// Add the shards http parameter for the myCollectionStringBuilder buf = new StringBuilder();@@ -1112,8 +1111,7 @@ public class StreamExpressionTest extends SolrCloudTestCase {.add(id, "9", "diseases_s", "diabetes", "symptoms_s", "thirsty", "cases_i", "20").add(id, "10", "diseases_s", "diabetes", "symptoms_s", "thirsty", "cases_i", "20").commit(cluster.getSolrClient(), COLLECTIONORALIAS);- StreamExpression expression;- TupleStream stream;+List<Tuple> tuples;ModifiableSolrParams paramsLoc = new ModifiableSolrParams();@@ -3667,15 +3665,6 @@ public class StreamExpressionTest extends SolrCloudTestCase {assertEquals("l b c d color`s e", tuple2.get("test_t"));}- private Map<String, Double> getIdToLabel(TupleStream stream, String outField) throws IOException {- Map<String, Double> idToLabel = new HashMap<>();- List<Tuple> tuples = getTuples(stream);- for (Tuple tuple : tuples) {- idToLabel.put(tuple.getString("id"), tuple.getDouble(outField));- }- return idToLabel;- }-@Testpublic void testBasicTextLogitStream() throws Exception {Assume.assumeTrue(!useAlias);@@ -4047,7 +4036,7 @@ public class StreamExpressionTest extends SolrCloudTestCase {assertEquals(5600, tuples.get(1).getLong("background").longValue());assertEquals(5000, tuples.get(1).getLong("foreground").longValue());- // Execersise the /stream hander+ // Exercise the /stream handler// Add the shards http parameter for the myCollectionStringBuilder buf = new StringBuilder();@@ -4108,7 +4097,7 @@ public class StreamExpressionTest extends SolrCloudTestCase {StreamContext streamContext = new StreamContext();streamContext.setSolrClientCache(cache);// use filter() to allow being parsed as 'terms in set' query instead of a (weighted/scored)- // BooleanQuery so we don't trip too many boolean clauses+ // BooleanQuery, so we don't trip too many boolean clausesString longQuery ="\"filter(id:("+ IntStream.range(0, 4000).mapToObj(i -> "a").collect(Collectors.joining(" ", "", ""))@@ -4374,7 +4363,7 @@ public class StreamExpressionTest extends SolrCloudTestCase {/*** Creates a tree of files underneath a provided data-directory.*- * <p>The filetree created looks like:+ * <p>The file tree created looks like:** <pre>* dataDirdiff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpressionTest.javasimilarity index 98%rename from solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.javarename to solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpressionTest.javaindex 2c941f142d7..37429f7a939 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpessionTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamExpressionToExpressionTest.java@@ -30,11 +30,11 @@ import org.apache.solr.client.solrj.io.stream.metrics.SumMetric;import org.junit.Test;/** */-public class StreamExpressionToExpessionTest extends SolrTestCase {+public class StreamExpressionToExpressionTest extends SolrTestCase {- private StreamFactory factory;+ private final StreamFactory factory;- public StreamExpressionToExpessionTest() {+ public StreamExpressionToExpressionTest() {super();factory =@@ -77,7 +77,6 @@ public class StreamExpressionToExpessionTest extends SolrTestCase {"search(collection1, q=*:*, fl=\"id,a_s,a_i,a_f\", sort=\"a_f asc, a_i asc\", fq=\"a_s:one\", fq=\"a_s:two\")"),factory)) {expressionString = stream.toExpression(factory).toString();- System.out.println("ExpressionString: " + expressionString.toString());assertTrue(expressionString.contains("search(collection1,"));assertTrue(expressionString.contains("q=\"*:*\""));assertTrue(expressionString.contains("fl=\"id,a_s,a_i,a_f\""));@@ -550,7 +549,7 @@ public class StreamExpressionToExpessionTest extends SolrTestCase {// The purpose of this test is to ensure that a parameter with a contained " character is// properly escaped when it is turned back into an expression. This is important when an- // expression is passedto a worker (parallel stream) or even for other reasons when an+ // expression is passed to a worker (parallel stream) or even for other reasons when an// expression is string-ified.// Basic testdiff --git a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.javaindex d8770711876..42252add70c 100644--- a/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java+++ b/solr/solrj-streaming/src/test/org/apache/solr/client/solrj/io/stream/StreamingTest.java@@ -89,13 +89,12 @@ public class StreamingTest extends SolrCloudTestCase {private static String zkHost;- private static int numShards;private static int numWorkers;private static boolean useAlias;@BeforeClasspublic static void configureCluster() throws Exception {- numShards = random().nextInt(2) + 1; // 1 - 3+ int numShards = random().nextInt(2) + 1; // 1 - 3numWorkers = numShards > 2 ? random().nextInt(numShards - 1) + 1 : numShards;configureCluster(numShards).addConfig(