org.apache.lucene.util
Class ThrottledIndexOutput

java.lang.Object
  extended by org.apache.lucene.store.DataOutput
      extended by org.apache.lucene.store.IndexOutput
          extended by org.apache.lucene.util.ThrottledIndexOutput
All Implemented Interfaces:
Closeable

public class ThrottledIndexOutput
extends IndexOutput

Intentionally slow IndexOutput for testing.


Field Summary
static int DEFAULT_MIN_WRITTEN_BYTES
           
 
Constructor Summary
ThrottledIndexOutput(int bytesPerSecond, long delayInMillis, IndexOutput delegate)
           
ThrottledIndexOutput(int bytesPerSecond, long delays, int minBytesWritten, IndexOutput delegate)
           
ThrottledIndexOutput(int bytesPerSecond, long flushDelayMillis, long closeDelayMillis, long seekDelayMillis, long minBytesWritten, IndexOutput delegate)
           
 
Method Summary
 void close()
           
 void copyBytes(DataInput input, long numBytes)
           
 void flush()
           
protected  long getDelay(boolean closing)
           
 long getFilePointer()
           
 long length()
           
static int mBitsToBytes(int mbits)
           
 ThrottledIndexOutput newFromDelegate(IndexOutput output)
           
 void seek(long pos)
           
 void setLength(long length)
           
 void writeByte(byte b)
           
 void writeBytes(byte[] b, int offset, int length)
           
 
Methods inherited from class org.apache.lucene.store.DataOutput
writeBytes, writeInt, writeLong, writeShort, writeString, writeStringSet, writeStringStringMap, writeVInt, writeVLong
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 delegate)

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 Detail

newFromDelegate

public ThrottledIndexOutput newFromDelegate(IndexOutput output)

mBitsToBytes

public static final int mBitsToBytes(int mbits)

flush

public void flush()
           throws IOException
Specified by:
flush in class IndexOutput
Throws:
IOException

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Specified by:
close in class IndexOutput
Throws:
IOException

getFilePointer

public long getFilePointer()
Specified by:
getFilePointer in class IndexOutput

seek

public void seek(long pos)
          throws IOException
Specified by:
seek in class IndexOutput
Throws:
IOException

length

public long length()
            throws IOException
Specified by:
length in class IndexOutput
Throws:
IOException

writeByte

public void writeByte(byte b)
               throws IOException
Specified by:
writeByte in class DataOutput
Throws:
IOException

writeBytes

public void writeBytes(byte[] b,
                       int offset,
                       int length)
                throws IOException
Specified by:
writeBytes in class DataOutput
Throws:
IOException

getDelay

protected long getDelay(boolean closing)

setLength

public void setLength(long length)
               throws IOException
Overrides:
setLength in class IndexOutput
Throws:
IOException

copyBytes

public void copyBytes(DataInput input,
                      long numBytes)
               throws IOException
Overrides:
copyBytes in class DataOutput
Throws:
IOException


Copyright © 2000-2013 Apache Software Foundation. All Rights Reserved.