Class ThrottledIndexOutput

  • All Implemented Interfaces:
    Closeable, AutoCloseable

    public class ThrottledIndexOutput
    extends org.apache.lucene.store.IndexOutput
    Intentionally slow IndexOutput for testing.
    • Field Detail

      • DEFAULT_MIN_WRITTEN_BYTES

        public static final int DEFAULT_MIN_WRITTEN_BYTES
        See Also:
        Constant Field Values
    • Constructor Detail

      • ThrottledIndexOutput

        public ThrottledIndexOutput​(int bytesPerSecond,
                                    long delayInMillis,
                                    org.apache.lucene.store.IndexOutput delegate)
      • ThrottledIndexOutput

        public ThrottledIndexOutput​(int bytesPerSecond,
                                    long delays,
                                    int minBytesWritten,
                                    org.apache.lucene.store.IndexOutput delegate)
      • ThrottledIndexOutput

        public ThrottledIndexOutput​(int bytesPerSecond,
                                    long flushDelayMillis,
                                    long closeDelayMillis,
                                    long seekDelayMillis,
                                    long minBytesWritten,
                                    org.apache.lucene.store.IndexOutput delegate)
    • Method Detail

      • newFromDelegate

        public ThrottledIndexOutput newFromDelegate​(org.apache.lucene.store.IndexOutput output)
      • mBitsToBytes

        public static final int mBitsToBytes​(int mbits)
      • flush

        public void flush()
                   throws IOException
        Specified by:
        flush in class org.apache.lucene.store.IndexOutput
        Throws:
        IOException
      • getFilePointer

        public long getFilePointer()
        Specified by:
        getFilePointer in class org.apache.lucene.store.IndexOutput
      • seek

        public void seek​(long pos)
                  throws IOException
        Specified by:
        seek in class org.apache.lucene.store.IndexOutput
        Throws:
        IOException
      • length

        public long length()
                    throws IOException
        Specified by:
        length in class org.apache.lucene.store.IndexOutput
        Throws:
        IOException
      • writeByte

        public void writeByte​(byte b)
                       throws IOException
        Specified by:
        writeByte in class org.apache.lucene.store.DataOutput
        Throws:
        IOException
      • writeBytes

        public void writeBytes​(byte[] b,
                               int offset,
                               int length)
                        throws IOException
        Specified by:
        writeBytes in class org.apache.lucene.store.DataOutput
        Throws:
        IOException
      • getDelay

        protected long getDelay​(boolean closing)
      • setLength

        public void setLength​(long length)
                       throws IOException
        Overrides:
        setLength in class org.apache.lucene.store.IndexOutput
        Throws:
        IOException
      • copyBytes

        public void copyBytes​(org.apache.lucene.store.DataInput input,
                              long numBytes)
                       throws IOException
        Overrides:
        copyBytes in class org.apache.lucene.store.DataOutput
        Throws:
        IOException