mirror of https://github.com/apache/lucene.git
LUCENE-8467: RAMDirectory, RAMFile, RAMInputStream, RAMOutputStream are deprecated.
This commit is contained in:
parent
04a50b6a2e
commit
a452dd9ce3
|
@ -147,6 +147,9 @@ Optimizations
|
|||
|
||||
API Changes:
|
||||
|
||||
* LUCENE-8467: RAMDirectory, RAMFile, RAMInputStream, RAMOutputStream are deprecated
|
||||
(Dawid Weiss)
|
||||
|
||||
* LUCENE-8356: StandardFilter is deprecated (Alan Woodward)
|
||||
|
||||
* LUCENE-8373: ENGLISH_STOP_WORD_SET on StandardAnalyzer is deprecated. Instead
|
||||
|
|
|
@ -99,3 +99,10 @@ IndexSearcher's search and searchAfter methods were changed to only count hits
|
|||
accurately up to 1,000, and Topdocs.totalHits was changed from a long to an
|
||||
object that says whether the hit count is accurate or a lower bound of the
|
||||
actual hit count.
|
||||
|
||||
## RAMDirectory, RAMFile, RAMInputStream, RAMOutputStream are deprecated ##
|
||||
|
||||
This RAM-based directory implementation is an old piece of code that uses inefficient
|
||||
thread synchronization primitives and can be confused as "faster" than the NIO-based
|
||||
MMapDirectory. It is deprecated and scheduled for removal in future versions of
|
||||
Lucene. (LUCENE-8467, LUCENE-8438)
|
||||
|
|
|
@ -49,7 +49,12 @@ import org.apache.lucene.util.Accountables;
|
|||
* {@link MMapDirectory}, which is a high-performance directory
|
||||
* implementation working directly on the file system cache of the
|
||||
* operating system, so copying data to Java heap space is not useful.
|
||||
*
|
||||
* @deprecated This class uses inefficient synchronization and is discouraged
|
||||
* in favor of {@link MMapDirectory}. It will be removed in future versions
|
||||
* of Lucene.
|
||||
*/
|
||||
@Deprecated
|
||||
public class RAMDirectory extends BaseDirectory implements Accountable {
|
||||
protected final Map<String,RAMFile> fileMap = new ConcurrentHashMap<>();
|
||||
protected final AtomicLong sizeInBytes = new AtomicLong();
|
||||
|
|
|
@ -24,7 +24,13 @@ import org.apache.lucene.util.Accountable;
|
|||
|
||||
/**
|
||||
* Represents a file in RAM as a list of byte[] buffers.
|
||||
* @lucene.internal */
|
||||
*
|
||||
* @lucene.internal
|
||||
* @deprecated This class uses inefficient synchronization and is discouraged
|
||||
* in favor of {@link MMapDirectory}. It will be removed in future versions
|
||||
* of Lucene.
|
||||
*/
|
||||
@Deprecated
|
||||
public class RAMFile implements Accountable {
|
||||
protected final ArrayList<byte[]> buffers = new ArrayList<>();
|
||||
long length;
|
||||
|
|
|
@ -22,9 +22,15 @@ import java.io.IOException;
|
|||
|
||||
import static org.apache.lucene.store.RAMOutputStream.BUFFER_SIZE;
|
||||
|
||||
/** A memory-resident {@link IndexInput} implementation.
|
||||
*
|
||||
* @lucene.internal */
|
||||
/**
|
||||
* A memory-resident {@link IndexInput} implementation.
|
||||
*
|
||||
* @lucene.internal
|
||||
* @deprecated This class uses inefficient synchronization and is discouraged
|
||||
* in favor of {@link MMapDirectory}. It will be removed in future versions
|
||||
* of Lucene.
|
||||
*/
|
||||
@Deprecated
|
||||
public class RAMInputStream extends IndexInput implements Cloneable {
|
||||
|
||||
private final RAMFile file;
|
||||
|
|
|
@ -30,7 +30,11 @@ import org.apache.lucene.util.Accountables;
|
|||
* A memory-resident {@link IndexOutput} implementation.
|
||||
*
|
||||
* @lucene.internal
|
||||
* @deprecated This class uses inefficient synchronization and is discouraged
|
||||
* in favor of {@link MMapDirectory}. It will be removed in future versions
|
||||
* of Lucene.
|
||||
*/
|
||||
@Deprecated
|
||||
public class RAMOutputStream extends IndexOutput implements Accountable {
|
||||
static final int BUFFER_SIZE = 1024;
|
||||
|
||||
|
|
Loading…
Reference in New Issue