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
Intentionally slow IndexOutput for testing.
-
Field Summary
FieldsFields inherited from class org.apache.lucene.store.FilterIndexOutput
out -
Constructor Summary
ConstructorsConstructorDescriptionThrottledIndexOutput(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
Modifier and TypeMethodDescriptionvoidclose()protected longgetDelay(boolean closing) static final intmBitsToBytes(int mbits) voidwriteByte(byte b) voidwriteBytes(byte[] b, int offset, int length) Methods inherited from class org.apache.lucene.store.FilterIndexOutput
getChecksum, getDelegate, getFilePointer, unwrapMethods inherited from class org.apache.lucene.store.IndexOutput
alignFilePointer, alignOffset, getName, toStringMethods inherited from class org.apache.lucene.store.DataOutput
copyBytes, writeBytes, writeGroupVInts, writeGroupVInts, writeInt, writeLong, writeMapOfStrings, writeSetOfStrings, writeShort, writeString, writeVInt, writeVLong, writeZInt, writeZLong
-
Field Details
-
DEFAULT_MIN_WRITTEN_BYTES
public static final int DEFAULT_MIN_WRITTEN_BYTES- See Also:
-
-
Constructor Details
-
ThrottledIndexOutput
-
ThrottledIndexOutput
-
ThrottledIndexOutput
public ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput out)
-
-
Method Details
-
newFromDelegate
-
mBitsToBytes
public static final int mBitsToBytes(int mbits) -
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterIndexOutput- Throws:
IOException
-
writeByte
- Overrides:
writeBytein classFilterIndexOutput- Throws:
IOException
-
writeBytes
- Overrides:
writeBytesin classFilterIndexOutput- Throws:
IOException
-
getDelay
protected long getDelay(boolean closing)
-