Package org.apache.lucene.tests.util
Class ThrottledIndexOutput
- java.lang.Object
-
- org.apache.lucene.store.DataOutput
-
- org.apache.lucene.store.IndexOutput
-
- org.apache.lucene.store.FilterIndexOutput
-
- org.apache.lucene.tests.util.ThrottledIndexOutput
-
- All Implemented Interfaces:
Closeable,AutoCloseable
public class ThrottledIndexOutput extends FilterIndexOutput
Intentionally slow IndexOutput for testing.
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_MIN_WRITTEN_BYTES-
Fields inherited from class org.apache.lucene.store.FilterIndexOutput
out
-
-
Constructor Summary
Constructors Constructor Description ThrottledIndexOutput(int bytesPerSecond, long delays, int minBytesWritten, IndexOutput out)ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput out)ThrottledIndexOutput(int bytesPerSecond, long delayInMillis, IndexOutput out)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()protected longgetDelay(boolean closing)static intmBitsToBytes(int mbits)ThrottledIndexOutputnewFromDelegate(IndexOutput out)voidwriteByte(byte b)voidwriteBytes(byte[] b, int offset, int length)-
Methods inherited from class org.apache.lucene.store.FilterIndexOutput
getChecksum, getDelegate, getFilePointer, unwrap
-
Methods inherited from class org.apache.lucene.store.IndexOutput
alignFilePointer, alignOffset, getName, toString
-
Methods inherited from class org.apache.lucene.store.DataOutput
copyBytes, writeBytes, writeGroupVInts, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLong
-
-
-
-
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, IndexOutput out)
-
ThrottledIndexOutput
public ThrottledIndexOutput(int bytesPerSecond, long delays, int minBytesWritten, IndexOutput out)
-
ThrottledIndexOutput
public ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput out)
-
-
Method Detail
-
newFromDelegate
public ThrottledIndexOutput newFromDelegate(IndexOutput out)
-
mBitsToBytes
public static final int mBitsToBytes(int mbits)
-
close
public void close() throws IOException- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterIndexOutput- Throws:
IOException
-
writeByte
public void writeByte(byte b) throws IOException- Overrides:
writeBytein classFilterIndexOutput- Throws:
IOException
-
writeBytes
public void writeBytes(byte[] b, int offset, int length) throws IOException- Overrides:
writeBytesin classFilterIndexOutput- Throws:
IOException
-
getDelay
protected long getDelay(boolean closing)
-
-