public class HoodieHFileReader<R extends org.apache.avro.generic.IndexedRecord> extends Object implements HoodieFileReader<R>
HoodieFileReader implementation allowing to read from HFile.
| Modifier and Type | Field and Description |
|---|---|
static String |
KEY_BLOOM_FILTER_META_BLOCK |
static String |
KEY_BLOOM_FILTER_TYPE_CODE |
static String |
KEY_FIELD_NAME |
static String |
KEY_MAX_RECORD |
static String |
KEY_MIN_RECORD |
static String |
SCHEMA_KEY |
| Constructor and Description |
|---|
HoodieHFileReader(org.apache.hadoop.conf.Configuration hadoopConf,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConfig) |
HoodieHFileReader(org.apache.hadoop.conf.Configuration hadoopConf,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConfig,
org.apache.hadoop.fs.FileSystem fs) |
HoodieHFileReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path dummyPath,
byte[] content,
Option<org.apache.avro.Schema> schemaOpt) |
HoodieHFileReader(org.apache.hadoop.fs.Path path,
org.apache.hadoop.hbase.io.hfile.HFile.Reader reader,
Option<org.apache.avro.Schema> schemaOpt) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
Set<String> |
filterRowKeys(Set<String> candidateRowKeys)
Filter keys by availability.
|
Option<R> |
getRecordByKey(String key,
org.apache.avro.Schema readerSchema) |
ClosableIterator<R> |
getRecordIterator(org.apache.avro.Schema readerSchema) |
ClosableIterator<R> |
getRecordsByKeyPrefixIterator(List<String> keyPrefixes,
org.apache.avro.Schema readerSchema) |
ClosableIterator<R> |
getRecordsByKeysIterator(List<String> keys,
org.apache.avro.Schema readerSchema) |
org.apache.avro.Schema |
getSchema() |
long |
getTotalRecords() |
static <R extends org.apache.avro.generic.IndexedRecord> |
readAllRecords(HoodieHFileReader<R> reader)
NOTE: THIS SHOULD ONLY BE USED FOR TESTING, RECORDS ARE MATERIALIZED EAGERLY
|
BloomFilter |
readBloomFilter() |
String[] |
readMinMaxRecordKeys() |
static <R extends org.apache.avro.generic.IndexedRecord> |
readRecords(HoodieHFileReader<R> reader,
List<String> keys)
NOTE: THIS SHOULD ONLY BE USED FOR TESTING, RECORDS ARE MATERIALIZED EAGERLY
|
static <R extends org.apache.avro.generic.IndexedRecord> |
readRecords(HoodieHFileReader<R> reader,
List<String> keys,
org.apache.avro.Schema schema)
NOTE: THIS SHOULD ONLY BE USED FOR TESTING, RECORDS ARE MATERIALIZED EAGERLY
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetRecordByKey, getRecordIterator, getRecordsByKeyPrefixIterator, getRecordsByKeysIteratorpublic static final String SCHEMA_KEY
public static final String KEY_BLOOM_FILTER_META_BLOCK
public static final String KEY_BLOOM_FILTER_TYPE_CODE
public static final String KEY_FIELD_NAME
public static final String KEY_MIN_RECORD
public static final String KEY_MAX_RECORD
public HoodieHFileReader(org.apache.hadoop.conf.Configuration hadoopConf,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConfig)
throws IOException
IOExceptionpublic HoodieHFileReader(org.apache.hadoop.conf.Configuration hadoopConf,
org.apache.hadoop.fs.Path path,
org.apache.hadoop.hbase.io.hfile.CacheConfig cacheConfig,
org.apache.hadoop.fs.FileSystem fs)
throws IOException
IOExceptionpublic HoodieHFileReader(org.apache.hadoop.fs.FileSystem fs,
org.apache.hadoop.fs.Path dummyPath,
byte[] content,
Option<org.apache.avro.Schema> schemaOpt)
throws IOException
IOExceptionpublic HoodieHFileReader(org.apache.hadoop.fs.Path path,
org.apache.hadoop.hbase.io.hfile.HFile.Reader reader,
Option<org.apache.avro.Schema> schemaOpt)
throws IOException
IOExceptionpublic String[] readMinMaxRecordKeys()
readMinMaxRecordKeys in interface HoodieFileReader<R extends org.apache.avro.generic.IndexedRecord>public BloomFilter readBloomFilter()
readBloomFilter in interface HoodieFileReader<R extends org.apache.avro.generic.IndexedRecord>public org.apache.avro.Schema getSchema()
getSchema in interface HoodieFileReader<R extends org.apache.avro.generic.IndexedRecord>public Set<String> filterRowKeys(Set<String> candidateRowKeys)
Note: This method is performant when the caller passes in a sorted candidate keys.
filterRowKeys in interface HoodieFileReader<R extends org.apache.avro.generic.IndexedRecord>candidateRowKeys - - Keys to check for the availabilitypublic Option<R> getRecordByKey(String key, org.apache.avro.Schema readerSchema) throws IOException
getRecordByKey in interface HoodieFileReader<R extends org.apache.avro.generic.IndexedRecord>IOExceptionpublic ClosableIterator<R> getRecordIterator(org.apache.avro.Schema readerSchema) throws IOException
getRecordIterator in interface HoodieFileReader<R extends org.apache.avro.generic.IndexedRecord>IOExceptionpublic ClosableIterator<R> getRecordsByKeysIterator(List<String> keys, org.apache.avro.Schema readerSchema) throws IOException
getRecordsByKeysIterator in interface HoodieFileReader<R extends org.apache.avro.generic.IndexedRecord>IOExceptionpublic ClosableIterator<R> getRecordsByKeyPrefixIterator(List<String> keyPrefixes, org.apache.avro.Schema readerSchema) throws IOException
getRecordsByKeyPrefixIterator in interface HoodieFileReader<R extends org.apache.avro.generic.IndexedRecord>IOExceptionpublic long getTotalRecords()
getTotalRecords in interface HoodieFileReader<R extends org.apache.avro.generic.IndexedRecord>public void close()
close in interface AutoCloseableclose in interface HoodieFileReader<R extends org.apache.avro.generic.IndexedRecord>public static <R extends org.apache.avro.generic.IndexedRecord> List<R> readAllRecords(HoodieHFileReader<R> reader) throws IOException
Reads all the records with given schema
IOExceptionpublic static <R extends org.apache.avro.generic.IndexedRecord> List<R> readRecords(HoodieHFileReader<R> reader, List<String> keys) throws IOException
Reads all the records with given schema and filtering keys.
IOExceptionpublic static <R extends org.apache.avro.generic.IndexedRecord> List<R> readRecords(HoodieHFileReader<R> reader, List<String> keys, org.apache.avro.Schema schema) throws IOException
Reads all the records with given schema and filtering keys.
IOExceptionCopyright © 2022 The Apache Software Foundation. All rights reserved.