public class LongIndexToKey extends Object implements IndexToKey
IndexToKey that assumes (strictly requires) keys that are
LongWritable values, where all values are both unique and contiguous (0 to numRecords()-1)| Constructor and Description |
|---|
LongIndexToKey() |
| Modifier and Type | Method and Description |
|---|---|
org.apache.hadoop.io.LongWritable |
getKeyForIndex(long index)
Get the key for the given index
|
long |
getNumRecords()
Getter infer the number of records in the given map file(s)
|
List<org.nd4j.linalg.primitives.Pair<Long,Long>> |
initialize(org.apache.hadoop.io.MapFile.Reader[] readers,
Class<? extends org.apache.hadoop.io.Writable> valueClass)
Initialise the instance, and return the first and last record indexes (inclusive) for each reader
|
public List<org.nd4j.linalg.primitives.Pair<Long,Long>> initialize(org.apache.hadoop.io.MapFile.Reader[] readers, Class<? extends org.apache.hadoop.io.Writable> valueClass) throws IOException
IndexToKeyinitialize in interface IndexToKeyreaders - The underlying map file readersIOExceptionpublic org.apache.hadoop.io.LongWritable getKeyForIndex(long index)
IndexToKeygetKeyForIndex in interface IndexToKeyindex - 0 to getNumRecords(reader)public long getNumRecords()
throws IOException
IndexToKeygetNumRecords in interface IndexToKeyIOExceptionCopyright © 2017. All rights reserved.