jruby/docs BETA
Navigation
org.apache.lucene.store 54
C AlreadyClosedException
C BaseDirectory
C BufferedChecksum
C BufferedChecksumIndexInput
C BufferedIndexInput
C ByteArrayDataInput
C ByteArrayDataOutput
C ByteBuffersDataInput
C ByteBuffersDataOutput
C ByteBuffersDirectory
C ByteBuffersIndexInput
C ByteBuffersIndexOutput
C ChecksumIndexInput
E DataAccessHint
C DataInput
C DataOutput
C Directory
C FSDirectory
C FSLockFactory
E FileDataHint
C FileSwitchDirectory
E FileTypeHint
C FilterDirectory
C FilterIndexInput
C FilterIndexOutput
I IOContext
C IndexInput
C IndexOutput
C InputStreamDataInput
C Lock
C LockFactory
C LockObtainFailedException
C LockReleaseFailedException
C LockStressTest
C LockValidatingDirectoryWrapper
C LockVerifyServer
C MMapDirectory
C NIOFSDirectory
C NRTCachingDirectory
C NativeFSLockFactory
C NoLockFactory
C OutputStreamDataOutput
C OutputStreamIndexOutput
E PreloadHint
I RandomAccessInput
C RateLimitedIndexOutput
C RateLimiter
E ReadAdvice
E ReadOnceHint
C SimpleFSLockFactory
C SingleInstanceLockFactory
C SleepingLockWrapper
C TrackingDirectoryWrapper
C VerifyingLockFactory
ChecksumIndexInput — members 2+
M checksum() long
C seek(pos)
from DataInput
M read_byte() byte
C read_bytes(b, offset, len)
C read_bytes(b, offset, len, use_buffer)
C read_floats(floats, offset, len)
C read_group_v_int(dst, offset)
M read_int() int
C read_ints(dst, offset, length)
M read_long() long
C read_longs(dst, offset, length)
M read_map_of_strings() Map<String,String>
M read_set_of_strings() Set<String>
M read_short() short
M read_string() String
M read_v_int() int
M read_v_long() long
M read_z_int() int
M read_z_long() long
from IndexInput
M clone() IndexInput
C close()
M file_pointer() long
M length() long
M loaded?() Optional<Boolean>
C prefetch(offset, length)
M random_access_slice(offset, length) RandomAccessInput
C skip_bytes(num_bytes)
M slice(slice_description, offset, length) IndexInput
M slice(slice_description, offset, length, context) IndexInput
M to_string() String
C update_io_context(context)

org.apache.lucene.store.ChecksumIndexInput

class abstract extends IndexInput 2 members

Extension of IndexInput, computing checksum as it goes. Callers can retrieve the checksum via #getChecksum().

Instance Methods

checksum

long checksum ( )
Java: getChecksum() · also: get_checksum

Returns the current checksum value

seek

seek ( long pos )
Java: seek(long pos)

ChecksumIndexInput can only seek forward and seeks are expensive since they imply to read bytes in-between the current position and the target position in order to update the checksum.

Inherited

from DataInput

read_byte

byte read_byte ( )
Java: readByte()

Reads and returns a single byte.

read_bytes

read_bytes ( byte[] b, int offset, int len )
Java: readBytes(byte[] b, int offset, int len)

Reads a specified number of bytes into an array at the specified offset.

nametypedescription
bbyte[]the array to read bytes into
offsetintthe offset in the array to start storing bytes
lenintthe number of bytes to read

read_bytes

read_bytes ( byte[] b, int offset, int len, boolean use_buffer )
Java: readBytes(byte[] b, int offset, int len, boolean useBuffer)

Reads a specified number of bytes into an array at the specified offset with control over whether the read should be buffered (callers who have their own buffer should pass in "false" for useBuffer). Currently only BufferedIndexInput respects this parameter.

nametypedescription
bbyte[]the array to read bytes into
offsetintthe offset in the array to start storing bytes
lenintthe number of bytes to read
use_bufferbooleanset to false if the caller will handle buffering.

read_floats

read_floats ( float[] floats, int offset, int len )
Java: readFloats(float[] floats, int offset, int len)

Reads a specified number of floats into an array at the specified offset.

nametypedescription
floatsfloat[]the array to read bytes into
offsetintthe offset in the array to start storing floats
lenintthe number of floats to read

read_group_v_int

read_group_v_int ( int[] dst, int offset )
Java: readGroupVInt(int[] dst, int offset)
Deprecated. This method is no longer called by Lucene. It is only kept for backwards compatibility. Code calling this method should migrate to GroupVIntUtil#readGroupVInts(DataInput, int[], int) to decode a full group including tails instead.

Legacy: This method allowed to implement GroupVInt encoding in a more efficient way when this implementation supports random access. It is no longer called by Lucene's code.

If you have implemented this method, simply remove it!

read_int

int read_int ( )
Java: readInt()

Reads four bytes and returns an int (LE byte order).

read_ints

read_ints ( int[] dst, int offset, int length )
Java: readInts(int[] dst, int offset, int length)

Reads a specified number of ints into an array at the specified offset.

nametypedescription
dstint[]the array to read bytes into
offsetintthe offset in the array to start storing ints
lengthintthe number of ints to read

read_long

long read_long ( )
Java: readLong()

Reads eight bytes and returns a long (LE byte order).

read_longs

read_longs ( long[] dst, int offset, int length )
Java: readLongs(long[] dst, int offset, int length)

Read a specified number of longs.

read_map_of_strings

Map<String,String> read_map_of_strings ( )
Java: readMapOfStrings()

Reads a Map<String,String> previously written with DataOutput#writeMapOfStrings(Map).

Returns: An immutable map containing the written contents.

read_set_of_strings

Set<String> read_set_of_strings ( )
Java: readSetOfStrings()

Reads a Set<String> previously written with DataOutput#writeSetOfStrings(Set).

Returns: An immutable set containing the written contents.

read_short

short read_short ( )
Java: readShort()

Reads two bytes and returns a short (LE byte order).

read_string

String read_string ( )
Java: readString()

Reads a string.

read_v_int

int read_v_int ( )
Java: readVInt()

Reads an int stored in variable-length format. Reads between one and five bytes. Smaller values take fewer bytes. Negative numbers are supported, but should be avoided.

The format is described further in DataOutput#writeVInt(int).

read_v_long

long read_v_long ( )
Java: readVLong()

Reads a long stored in variable-length format. Reads between one and nine bytes. Smaller values take fewer bytes. Negative numbers are not supported.

The format is described further in DataOutput#writeVInt(int).

read_z_int

int read_z_int ( )
Java: readZInt()

Read a zig-zag-encoded variable-length integer.

read_z_long

long read_z_long ( )
Java: readZLong()

Read a zig-zag-encoded variable-length integer. Reads between one and ten bytes.

from IndexInput

clone

IndexInput clone ( )
Java: clone()

Warning: Lucene never closes cloned IndexInputs, it will only call #close() on the original object.

If you access the cloned IndexInput after closing the original object, any readXXX methods will throw AlreadyClosedException.

This method is NOT thread safe, so if the current IndexInput is being used by one thread while clone is called by another, disaster could strike.

close

close ( )
Java: close()

Closes the stream to further operations.

file_pointer

long file_pointer ( )
Java: getFilePointer() · also: get_file_pointer

Returns the current position in this file, where the next read will occur.

length

long length ( )
Java: length()

The number of bytes in the file.

loaded?

Optional<Boolean> loaded? ( )
Java: isLoaded() · also: is_loaded

Returns a hint whether all the contents of this input are resident in physical memory. It's a hint because the operating system may have paged out some of the data by the time this method returns. If the optional is true, then it's likely that the contents of this input are resident in physical memory. A value of false does not imply that the contents are not resident in physical memory. An empty optional is returned if it is not possible to determine.

This runs in linear time with the #length() of this input / page size.

The default implementation returns an empty optional.

prefetch

prefetch ( long offset, long length )
Java: prefetch(long offset, long length)

Optional method: Give a hint to this input that some bytes will be read in the near future. IndexInput implementations may take advantage of this hint to start fetching pages of data immediately from storage.

The default implementation is a no-op.

nametypedescription
offsetlongstart offset
lengthlongthe number of bytes to prefetch

random_access_slice

RandomAccessInput random_access_slice ( long offset, long length )
Java: randomAccessSlice(long offset, long length)

Creates a random-access slice of this index input, with the given offset and length.

The default implementation calls #slice, and it doesn't support random access, it implements absolute reads as seek+read.

skip_bytes

skip_bytes ( long num_bytes )
Java: skipBytes(long numBytes)

Behavior is functionally equivalent to seeking to getFilePointer() + numBytes.

slice

IndexInput slice ( String slice_description, long offset, long length )
Java: slice(String sliceDescription, long offset, long length)

Creates a slice of this index input, with the given description, offset, and length. The slice is sought to the beginning.

slice

IndexInput slice ( String slice_description, long offset, long length, IOContext context )
Java: slice(String sliceDescription, long offset, long length, org.apache.lucene.store.IOContext context)

Create a slice with a new IOContext. This is typically used by CompoundFormat implementations to modify the IOContext for specific files within the compound file.

NOTE: only certain IOContext may be usable here, depending on how this instance was opened.

The default implementation delegates to #slice(String, long, long) and ignores the IOContext.

to_string

String to_string ( )
Java: toString()

update_io_context

update_io_context ( IOContext context )
Java: updateIOContext(org.apache.lucene.store.IOContext context)

Optional method: Updates the IOContext to specify a new read access pattern. IndexInput implementations may take advantage of this hint to optimize reads from storage.

The default implementation is a no-op.

this work for additional information regarding copyright ownership.