gus-asf commented on code in PR #2447: URL: https://github.com/apache/solr/pull/2447#discussion_r1598434860
########## solr/core/src/test/org/apache/solr/core/BlobRepositoryCloudTest.java: ########## @@ -1,127 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.solr.core; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.nio.file.Path; -import org.apache.solr.client.solrj.SolrQuery; -import org.apache.solr.client.solrj.SolrServerException; -import org.apache.solr.client.solrj.impl.CloudSolrClient; -import org.apache.solr.client.solrj.request.CollectionAdminRequest; -import org.apache.solr.client.solrj.response.QueryResponse; -import org.apache.solr.cloud.SolrCloudTestCase; -import org.apache.solr.common.SolrDocumentList; -import org.apache.solr.common.SolrInputDocument; -import org.apache.solr.common.cloud.ZkStateReader; -import org.apache.solr.common.params.CollectionAdminParams; -import org.apache.solr.handler.TestBlobHandler; -import org.junit.BeforeClass; -import org.junit.Test; - -public class BlobRepositoryCloudTest extends SolrCloudTestCase { - - public static final Path TEST_PATH = getFile("solr/configsets").toPath(); - - @BeforeClass - public static void setupCluster() throws Exception { - configureCluster(1) // only sharing *within* a node - .addConfig("configname", TEST_PATH.resolve("resource-sharing")) - .configure(); - // Thread.sleep(2000); - CollectionAdminRequest.createCollection(CollectionAdminParams.SYSTEM_COLL, null, 1, 1) - .process(cluster.getSolrClient()); - // test component will fail if it can't find a blob with this data by this name - TestBlobHandler.postData( - cluster.getSolrClient(), - findLiveNodeURI(), - "testResource", - ByteBuffer.wrap("foo,bar\nbaz,bam".getBytes(StandardCharsets.UTF_8))); - // Thread.sleep(2000); - // if these don't load we probably failed to post the blob above - CollectionAdminRequest.createCollection("col1", "configname", 1, 1) - .process(cluster.getSolrClient()); - CollectionAdminRequest.createCollection("col2", "configname", 1, 1) - .process(cluster.getSolrClient()); - - SolrInputDocument document = new SolrInputDocument(); - document.addField("id", "1"); - document.addField("text", "col1"); - CloudSolrClient solrClient = cluster.getSolrClient(); - solrClient.add("col1", document); - solrClient.commit("col1"); - document = new SolrInputDocument(); - document.addField("id", "1"); - document.addField("text", "col2"); - solrClient.add("col2", document); - solrClient.commit("col2"); - Thread.sleep(2000); - } - - @Test - public void test() throws Exception { Review Comment: This test demonstrates that the object shared remains visible across cores. We need to not loose this. It's really about the memory sharing more than the blobstore. ########## solr/core/src/test/org/apache/solr/handler/component/ResourceSharingTestComponent.java: ########## @@ -1,142 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.solr.handler.component; - -import static org.junit.Assert.assertEquals; - -import java.io.BufferedReader; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.lang.invoke.MethodHandles; -import java.nio.charset.StandardCharsets; -import java.util.HashMap; -import java.util.Map; -import java.util.stream.Stream; -import org.apache.solr.common.params.ModifiableSolrParams; -import org.apache.solr.common.params.SolrParams; -import org.apache.solr.core.BlobRepository; -import org.apache.solr.core.SolrCore; -import org.apache.solr.util.plugin.SolrCoreAware; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class ResourceSharingTestComponent extends SearchComponent implements SolrCoreAware { Review Comment: This file should not be going away. It should be using whatever the appropriate file store is (and probably should have been less closely tied to blob store at the start, but back then I was just happy to have a committer working with me on it). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org