38
38
import org .apache .lucene .store .AlreadyClosedException ;
39
39
import org .apache .lucene .store .BufferedChecksum ;
40
40
import org .apache .lucene .store .ByteArrayDataInput ;
41
- import org .apache .lucene .store .ByteBufferIndexInput ;
42
41
import org .apache .lucene .store .ChecksumIndexInput ;
43
42
import org .apache .lucene .store .Directory ;
44
43
import org .apache .lucene .store .FilterDirectory ;
45
44
import org .apache .lucene .store .IOContext ;
46
45
import org .apache .lucene .store .IndexInput ;
47
46
import org .apache .lucene .store .IndexOutput ;
48
47
import org .apache .lucene .store .Lock ;
49
- import org .apache .lucene .store .RandomAccessInput ;
50
48
import org .apache .lucene .store .SimpleFSDirectory ;
51
49
import org .apache .lucene .util .ArrayUtil ;
52
50
import org .apache .lucene .util .BytesRef ;
98
96
import java .util .Iterator ;
99
97
import java .util .List ;
100
98
import java .util .Map ;
101
- import java .util .Set ;
102
99
import java .util .concurrent .TimeUnit ;
103
100
import java .util .concurrent .atomic .AtomicBoolean ;
104
101
import java .util .concurrent .locks .ReentrantReadWriteLock ;
@@ -137,7 +134,7 @@ public class Store extends AbstractIndexShardComponent implements Closeable, Ref
137
134
* this by exploiting lucene internals and wrapping the IndexInput in a simple delegate.
138
135
*/
139
136
public static final Setting <Boolean > FORCE_RAM_TERM_DICT = Setting .boolSetting ("index.force_memory_term_dictionary" , false ,
140
- Property .IndexScope );
137
+ Property .IndexScope , Property . Deprecated );
141
138
static final String CODEC = "store" ;
142
139
static final int VERSION_WRITE_THROWABLE = 2 ; // we write throwable since 2.0
143
140
static final int VERSION_STACK_TRACE = 1 ; // we write the stack trace too since 1.4.0
@@ -172,8 +169,7 @@ public Store(ShardId shardId, IndexSettings indexSettings, Directory directory,
172
169
final TimeValue refreshInterval = indexSettings .getValue (INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING );
173
170
logger .debug ("store stats are refreshed with refresh_interval [{}]" , refreshInterval );
174
171
ByteSizeCachingDirectory sizeCachingDir = new ByteSizeCachingDirectory (directory , refreshInterval );
175
- this .directory = new StoreDirectory (sizeCachingDir , Loggers .getLogger ("index.store.deletes" , shardId ),
176
- indexSettings .getValue (FORCE_RAM_TERM_DICT ));
172
+ this .directory = new StoreDirectory (sizeCachingDir , Loggers .getLogger ("index.store.deletes" , shardId ));
177
173
this .shardLock = shardLock ;
178
174
this .onClose = onClose ;
179
175
@@ -712,12 +708,10 @@ public int refCount() {
712
708
static final class StoreDirectory extends FilterDirectory {
713
709
714
710
private final Logger deletesLogger ;
715
- private final boolean forceRamTermDict ;
716
711
717
- StoreDirectory (ByteSizeCachingDirectory delegateDirectory , Logger deletesLogger , boolean forceRamTermDict ) {
712
+ StoreDirectory (ByteSizeCachingDirectory delegateDirectory , Logger deletesLogger ) {
718
713
super (delegateDirectory );
719
714
this .deletesLogger = deletesLogger ;
720
- this .forceRamTermDict = forceRamTermDict ;
721
715
}
722
716
723
717
/** Estimate the cumulative size of all files in this directory in bytes. */
@@ -744,18 +738,6 @@ private void innerClose() throws IOException {
744
738
super .close ();
745
739
}
746
740
747
- @ Override
748
- public IndexInput openInput (String name , IOContext context ) throws IOException {
749
- IndexInput input = super .openInput (name , context );
750
- if (name .endsWith (".tip" ) || name .endsWith (".cfs" )) {
751
- // only do this if we are reading cfs or tip file - all other files don't need this.
752
- if (forceRamTermDict && input instanceof ByteBufferIndexInput ) {
753
- return new DeoptimizingIndexInput (input .toString (), input );
754
- }
755
- }
756
- return input ;
757
- }
758
-
759
741
@ Override
760
742
public String toString () {
761
743
return "store(" + in .toString () + ")" ;
@@ -1636,127 +1618,4 @@ private static IndexWriterConfig newIndexWriterConfig() {
1636
1618
// we also don't specify a codec here and merges should use the engines for this index
1637
1619
.setMergePolicy (NoMergePolicy .INSTANCE );
1638
1620
}
1639
-
1640
- /**
1641
- * see {@link #FORCE_RAM_TERM_DICT} for details
1642
- */
1643
- private static final class DeoptimizingIndexInput extends IndexInput {
1644
-
1645
- private final IndexInput in ;
1646
-
1647
- private DeoptimizingIndexInput (String resourceDescription , IndexInput in ) {
1648
- super (resourceDescription );
1649
- this .in = in ;
1650
- }
1651
-
1652
- @ Override
1653
- public IndexInput clone () {
1654
- return new DeoptimizingIndexInput (toString (), in .clone ());
1655
- }
1656
-
1657
- @ Override
1658
- public void close () throws IOException {
1659
- in .close ();
1660
- }
1661
-
1662
- @ Override
1663
- public long getFilePointer () {
1664
- return in .getFilePointer ();
1665
- }
1666
-
1667
- @ Override
1668
- public void seek (long pos ) throws IOException {
1669
- in .seek (pos );
1670
- }
1671
-
1672
- @ Override
1673
- public long length () {
1674
- return in .length ();
1675
- }
1676
-
1677
- @ Override
1678
- public String toString () {
1679
- return in .toString ();
1680
- }
1681
-
1682
- @ Override
1683
- public IndexInput slice (String sliceDescription , long offset , long length ) throws IOException {
1684
- return new DeoptimizingIndexInput (sliceDescription , in .slice (sliceDescription , offset , length ));
1685
- }
1686
-
1687
- @ Override
1688
- public RandomAccessInput randomAccessSlice (long offset , long length ) throws IOException {
1689
- return in .randomAccessSlice (offset , length );
1690
- }
1691
-
1692
- @ Override
1693
- public byte readByte () throws IOException {
1694
- return in .readByte ();
1695
- }
1696
-
1697
- @ Override
1698
- public void readBytes (byte [] b , int offset , int len ) throws IOException {
1699
- in .readBytes (b , offset , len );
1700
- }
1701
-
1702
- @ Override
1703
- public void readBytes (byte [] b , int offset , int len , boolean useBuffer ) throws IOException {
1704
- in .readBytes (b , offset , len , useBuffer );
1705
- }
1706
-
1707
- @ Override
1708
- public short readShort () throws IOException {
1709
- return in .readShort ();
1710
- }
1711
-
1712
- @ Override
1713
- public int readInt () throws IOException {
1714
- return in .readInt ();
1715
- }
1716
-
1717
- @ Override
1718
- public int readVInt () throws IOException {
1719
- return in .readVInt ();
1720
- }
1721
-
1722
- @ Override
1723
- public int readZInt () throws IOException {
1724
- return in .readZInt ();
1725
- }
1726
-
1727
- @ Override
1728
- public long readLong () throws IOException {
1729
- return in .readLong ();
1730
- }
1731
-
1732
- @ Override
1733
- public long readVLong () throws IOException {
1734
- return in .readVLong ();
1735
- }
1736
-
1737
- @ Override
1738
- public long readZLong () throws IOException {
1739
- return in .readZLong ();
1740
- }
1741
-
1742
- @ Override
1743
- public String readString () throws IOException {
1744
- return in .readString ();
1745
- }
1746
-
1747
- @ Override
1748
- public Map <String , String > readMapOfStrings () throws IOException {
1749
- return in .readMapOfStrings ();
1750
- }
1751
-
1752
- @ Override
1753
- public Set <String > readSetOfStrings () throws IOException {
1754
- return in .readSetOfStrings ();
1755
- }
1756
-
1757
- @ Override
1758
- public void skipBytes (long numBytes ) throws IOException {
1759
- in .skipBytes (numBytes );
1760
- }
1761
- }
1762
1621
}
0 commit comments