Package org.apache.lucene.util
Class ThrottledIndexOutput
- java.lang.Object
-
- org.apache.lucene.store.DataOutput
-
- org.apache.lucene.store.IndexOutput
-
- org.apache.lucene.util.ThrottledIndexOutput
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ThrottledIndexOutput extends org.apache.lucene.store.IndexOutputIntentionally slow IndexOutput for testing.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MIN_WRITTEN_BYTES
-
Constructor Summary
Constructors Constructor Description ThrottledIndexOutput(int bytesPerSecond, long delays, int minBytesWritten, org.apache.lucene.store.IndexOutput delegate)ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, org.apache.lucene.store.IndexOutput delegate)ThrottledIndexOutput(int bytesPerSecond, long delayInMillis, org.apache.lucene.store.IndexOutput delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()voidcopyBytes(org.apache.lucene.store.DataInput input, long numBytes)voidflush()protected longgetDelay(boolean closing)longgetFilePointer()longlength()static intmBitsToBytes(int mbits)ThrottledIndexOutputnewFromDelegate(org.apache.lucene.store.IndexOutput output)voidseek(long pos)voidsetLength(long length)voidwriteByte(byte b)voidwriteBytes(byte[] b, int offset, int length)
-
-
-
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:
flushin classorg.apache.lucene.store.IndexOutput- Throws:
IOException
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classorg.apache.lucene.store.IndexOutput- Throws:
IOException
-
getFilePointer
public long getFilePointer()
- Specified by:
getFilePointerin classorg.apache.lucene.store.IndexOutput
-
seek
public void seek(long pos) throws IOException- Specified by:
seekin classorg.apache.lucene.store.IndexOutput- Throws:
IOException
-
length
public long length() throws IOException- Specified by:
lengthin classorg.apache.lucene.store.IndexOutput- Throws:
IOException
-
writeByte
public void writeByte(byte b) throws IOException- Specified by:
writeBytein classorg.apache.lucene.store.DataOutput- Throws:
IOException
-
writeBytes
public void writeBytes(byte[] b, int offset, int length) throws IOException- Specified by:
writeBytesin classorg.apache.lucene.store.DataOutput- Throws:
IOException
-
getDelay
protected long getDelay(boolean closing)
-
setLength
public void setLength(long length) throws IOException- Overrides:
setLengthin classorg.apache.lucene.store.IndexOutput- Throws:
IOException
-
copyBytes
public void copyBytes(org.apache.lucene.store.DataInput input, long numBytes) throws IOException- Overrides:
copyBytesin classorg.apache.lucene.store.DataOutput- Throws:
IOException
-
-