public class ThreadLocalSparkeyReader extends Object implements SparkeyReader
SparkeyReader.Entry, SparkeyReader.Type
Constructor and Description |
---|
ThreadLocalSparkeyReader(File indexFile) |
ThreadLocalSparkeyReader(SparkeyReader reader) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
SparkeyReader |
duplicate()
Create a duplicate of the reader.
|
byte[] |
getAsByteArray(byte[] key) |
SparkeyReader.Entry |
getAsEntry(byte[] key)
This is mostly useful for retrieving large values that don't fit in a byte array.
|
String |
getAsString(String key) |
IndexHeader |
getIndexHeader() |
LogHeader |
getLogHeader() |
Iterator<SparkeyReader.Entry> |
iterator()
Get an iterator over all the live entries.
|
public ThreadLocalSparkeyReader(File indexFile) throws IOException
IOException
public ThreadLocalSparkeyReader(SparkeyReader reader)
public String getAsString(String key) throws IOException
getAsString
in interface SparkeyReader
key
- the key to search for, interpreted as an UTF-8 string.IOException
public byte[] getAsByteArray(byte[] key) throws IOException
getAsByteArray
in interface SparkeyReader
key
- the key to search forIOException
public SparkeyReader.Entry getAsEntry(byte[] key) throws IOException
SparkeyReader
getAsEntry
in interface SparkeyReader
key
- the key to search forIOException
public void close() throws IOException
close
in interface SparkeyReader
IOException
public IndexHeader getIndexHeader()
getIndexHeader
in interface SparkeyReader
public LogHeader getLogHeader()
getLogHeader
in interface SparkeyReader
public SparkeyReader duplicate()
SparkeyReader
duplicate
in interface SparkeyReader
public Iterator<SparkeyReader.Entry> iterator()
SparkeyReader
iterator
in interface SparkeyReader
iterator
in interface Iterable<SparkeyReader.Entry>
Copyright © 2013. All rights reserved.