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 () + ")" ;
@@ -1614,127 +1596,4 @@ private static IndexWriterConfig newIndexWriterConfig() {
1614
1596
// we also don't specify a codec here and merges should use the engines for this index
1615
1597
.setMergePolicy (NoMergePolicy .INSTANCE );
1616
1598
}
1617
-
1618
- /**
1619
- * see {@link #FORCE_RAM_TERM_DICT} for details
1620
- */
1621
- private static final class DeoptimizingIndexInput extends IndexInput {
1622
-
1623
- private final IndexInput in ;
1624
-
1625
- private DeoptimizingIndexInput (String resourceDescription , IndexInput in ) {
1626
- super (resourceDescription );
1627
- this .in = in ;
1628
- }
1629
-
1630
- @ Override
1631
- public IndexInput clone () {
1632
- return new DeoptimizingIndexInput (toString (), in .clone ());
1633
- }
1634
-
1635
- @ Override
1636
- public void close () throws IOException {
1637
- in .close ();
1638
- }
1639
-
1640
- @ Override
1641
- public long getFilePointer () {
1642
- return in .getFilePointer ();
1643
- }
1644
-
1645
- @ Override
1646
- public void seek (long pos ) throws IOException {
1647
- in .seek (pos );
1648
- }
1649
-
1650
- @ Override
1651
- public long length () {
1652
- return in .length ();
1653
- }
1654
-
1655
- @ Override
1656
- public String toString () {
1657
- return in .toString ();
1658
- }
1659
-
1660
- @ Override
1661
- public IndexInput slice (String sliceDescription , long offset , long length ) throws IOException {
1662
- return new DeoptimizingIndexInput (sliceDescription , in .slice (sliceDescription , offset , length ));
1663
- }
1664
-
1665
- @ Override
1666
- public RandomAccessInput randomAccessSlice (long offset , long length ) throws IOException {
1667
- return in .randomAccessSlice (offset , length );
1668
- }
1669
-
1670
- @ Override
1671
- public byte readByte () throws IOException {
1672
- return in .readByte ();
1673
- }
1674
-
1675
- @ Override
1676
- public void readBytes (byte [] b , int offset , int len ) throws IOException {
1677
- in .readBytes (b , offset , len );
1678
- }
1679
-
1680
- @ Override
1681
- public void readBytes (byte [] b , int offset , int len , boolean useBuffer ) throws IOException {
1682
- in .readBytes (b , offset , len , useBuffer );
1683
- }
1684
-
1685
- @ Override
1686
- public short readShort () throws IOException {
1687
- return in .readShort ();
1688
- }
1689
-
1690
- @ Override
1691
- public int readInt () throws IOException {
1692
- return in .readInt ();
1693
- }
1694
-
1695
- @ Override
1696
- public int readVInt () throws IOException {
1697
- return in .readVInt ();
1698
- }
1699
-
1700
- @ Override
1701
- public int readZInt () throws IOException {
1702
- return in .readZInt ();
1703
- }
1704
-
1705
- @ Override
1706
- public long readLong () throws IOException {
1707
- return in .readLong ();
1708
- }
1709
-
1710
- @ Override
1711
- public long readVLong () throws IOException {
1712
- return in .readVLong ();
1713
- }
1714
-
1715
- @ Override
1716
- public long readZLong () throws IOException {
1717
- return in .readZLong ();
1718
- }
1719
-
1720
- @ Override
1721
- public String readString () throws IOException {
1722
- return in .readString ();
1723
- }
1724
-
1725
- @ Override
1726
- public Map <String , String > readMapOfStrings () throws IOException {
1727
- return in .readMapOfStrings ();
1728
- }
1729
-
1730
- @ Override
1731
- public Set <String > readSetOfStrings () throws IOException {
1732
- return in .readSetOfStrings ();
1733
- }
1734
-
1735
- @ Override
1736
- public void skipBytes (long numBytes ) throws IOException {
1737
- in .skipBytes (numBytes );
1738
- }
1739
- }
1740
1599
}
0 commit comments