You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2020/07/11 00:25:31 UTC
[lucene-solr] branch reference_impl updated: #59 Remove cruft,
boost test.
This is an automated email from the ASF dual-hosted git repository.
markrmiller pushed a commit to branch reference_impl
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/reference_impl by this push:
new 1a3bf69 #59 Remove cruft, boost test.
1a3bf69 is described below
commit 1a3bf692a7f77cb2e3e9e048d1141f1053fc9673
Author: markrmiller@gmail.com <ma...@gmail.com>
AuthorDate: Fri Jul 10 19:25:17 2020 -0500
#59 Remove cruft, boost test.
---
.../org/apache/solr/util/ResourceLoaderAware.java | 34 ----------------------
.../solr/store/blockcache/BlockDirectoryTest.java | 8 ++---
2 files changed, 4 insertions(+), 38 deletions(-)
diff --git a/solr/core/src/java/org/apache/solr/util/ResourceLoaderAware.java b/solr/core/src/java/org/apache/solr/util/ResourceLoaderAware.java
deleted file mode 100644
index a61ee46..0000000
--- a/solr/core/src/java/org/apache/solr/util/ResourceLoaderAware.java
+++ /dev/null
@@ -1,34 +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.common.util;
-
-import java.io.IOException;
-
-/**
- * Interface for a component that needs to be initialized by
- * an implementation of {@link ResourceLoader}.
- *
- * @see ResourceLoader
- */
-public interface ResourceLoaderAware {
-
- /**
- * Initializes this component with the provided ResourceLoader
- * (used for loading classes, files, etc).
- */
- void inform(ResourceLoader loader) throws IOException;
-}
diff --git a/solr/core/src/test/org/apache/solr/store/blockcache/BlockDirectoryTest.java b/solr/core/src/test/org/apache/solr/store/blockcache/BlockDirectoryTest.java
index 28b1f21f..843a2ee 100644
--- a/solr/core/src/test/org/apache/solr/store/blockcache/BlockDirectoryTest.java
+++ b/solr/core/src/test/org/apache/solr/store/blockcache/BlockDirectoryTest.java
@@ -168,7 +168,7 @@ public class BlockDirectoryTest extends SolrTestCaseJ4 {
int i = 0;
try {
- for (; i < 10; i++) {
+ for (; i < (TEST_NIGHTLY ? 10 : 2); i++) {
Directory fsDir = FSDirectory.open(new File(file, "normal").toPath());
String name = getName();
createFile(name, fsDir, directory);
@@ -185,14 +185,14 @@ public class BlockDirectoryTest extends SolrTestCaseJ4 {
@Test
public void testRandomAccessWritesLargeCache() throws IOException {
mapperCache.map = Caffeine.newBuilder()
- .maximumSize(10_000)
+ .maximumSize(TEST_NIGHTLY ? 10_000 : 100)
.<String, byte[]>build()
.asMap();
testRandomAccessWrites();
}
private void assertInputsEquals(String name, Directory fsDir, Directory hdfs) throws IOException {
- int reads = random.nextInt(MAX_NUMBER_OF_READS);
+ int reads = random.nextInt(TEST_NIGHTLY ? MAX_NUMBER_OF_READS : 500);
IndexInput fsInput = fsDir.openInput(name, new IOContext());
IndexInput hdfsInput = hdfs.openInput(name, new IOContext());
assertEquals(fsInput.length(), hdfsInput.length());
@@ -232,7 +232,7 @@ public class BlockDirectoryTest extends SolrTestCaseJ4 {
}
private void createFile(String name, Directory fsDir, Directory hdfs) throws IOException {
- int writes = random.nextInt(MAX_NUMBER_OF_WRITES);
+ int writes = random.nextInt(TEST_NIGHTLY ? MAX_NUMBER_OF_WRITES : 100);
int fileLength = random.nextInt(MAX_FILE_SIZE - MIN_FILE_SIZE) + MIN_FILE_SIZE;
IndexOutput fsOutput = fsDir.createOutput(name, IOContext.DEFAULT);
IndexOutput hdfsOutput = hdfs.createOutput(name, IOContext.DEFAULT);