Package org.apache.lucene.tests.util
Class ThrottledIndexOutput
java.lang.Object
org.apache.lucene.store.DataOutput
org.apache.lucene.store.IndexOutput
org.apache.lucene.tests.util.ThrottledIndexOutput
- All Implemented Interfaces:
Closeable
,AutoCloseable
Intentionally slow IndexOutput for testing.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionThrottledIndexOutput
(int bytesPerSecond, long delays, int minBytesWritten, IndexOutput delegate) ThrottledIndexOutput
(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput delegate) ThrottledIndexOutput
(int bytesPerSecond, long delayInMillis, IndexOutput delegate) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
long
protected long
getDelay
(boolean closing) long
static final int
mBitsToBytes
(int mbits) newFromDelegate
(IndexOutput output) void
writeByte
(byte b) void
writeBytes
(byte[] b, int offset, int length) Methods inherited from class org.apache.lucene.store.IndexOutput
alignFilePointer, alignOffset, getName, toString
Methods inherited from class org.apache.lucene.store.DataOutput
writeBytes, 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
public ThrottledIndexOutput(int bytesPerSecond, long delays, int minBytesWritten, IndexOutput delegate) -
ThrottledIndexOutput
public ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput delegate)
-
-
Method Details
-
newFromDelegate
-
mBitsToBytes
public static final int mBitsToBytes(int mbits) -
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classIndexOutput
- Throws:
IOException
-
getFilePointer
public long getFilePointer()- Specified by:
getFilePointer
in classIndexOutput
-
writeByte
- Specified by:
writeByte
in classDataOutput
- Throws:
IOException
-
writeBytes
- Specified by:
writeBytes
in classDataOutput
- Throws:
IOException
-
getDelay
protected long getDelay(boolean closing) -
copyBytes
- Overrides:
copyBytes
in classDataOutput
- Throws:
IOException
-
getChecksum
- Specified by:
getChecksum
in classIndexOutput
- Throws:
IOException
-