public interface TableReader extends Closeable
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
Close.
|
double |
getAllIndexPageFillingRate()
Get all index page filling rate, use iterator pattern to avoid OutOfMemory.
|
double |
getIndexPageFillingRate(int pageNumber)
Get single index page filling rate.
|
long |
getNumOfPages()
Return total page count.
|
Iterator<AbstractPage> |
getPageIterator()
Get page iterator.
|
Iterator<GenericRecord> |
getQueryAllIterator()
Return an iterator to query all records of a tablespace.
|
Iterator<GenericRecord> |
getQueryAllIterator(boolean ascOrder)
Return an iterator to query all records of a tablespace.
|
Iterator<GenericRecord> |
getQueryAllIterator(List<String> projection)
Return an iterator to query all records of a tablespace.
|
Iterator<GenericRecord> |
getQueryAllIterator(List<String> projection,
boolean ascOrder)
Return an iterator to query all records of a tablespace.
|
Iterator<GenericRecord> |
getRangeQueryIterator(List<Object> lower,
ComparisonOperator lowerOperator,
List<Object> upper,
ComparisonOperator upperOperator)
Return an iterator to do range query records by primary key in a tablespace.
|
Iterator<GenericRecord> |
getRangeQueryIterator(List<Object> lower,
ComparisonOperator lowerOperator,
List<Object> upper,
ComparisonOperator upperOperator,
boolean ascOrder)
Return an iterator to do range query records by primary key in a tablespace.
|
Iterator<GenericRecord> |
getRangeQueryIterator(List<Object> lower,
ComparisonOperator lowerOperator,
List<Object> upper,
ComparisonOperator upperOperator,
List<String> projection)
Return an iterator to do range query records by primary key in a tablespace.
|
Iterator<GenericRecord> |
getRangeQueryIterator(List<Object> lower,
ComparisonOperator lowerOperator,
List<Object> upper,
ComparisonOperator upperOperator,
List<String> projection,
boolean ascOrder)
Return an iterator to do range query records by primary key in a tablespace.
|
Iterator<GenericRecord> |
getRecordIteratorBySk(String skName,
List<Object> lower,
ComparisonOperator lowerOperator,
List<Object> upper,
ComparisonOperator upperOperator)
Return record iterator by secondary key (SK) in a tablespace.
|
Iterator<GenericRecord> |
getRecordIteratorBySk(String skName,
List<Object> lower,
ComparisonOperator lowerOperator,
List<Object> upper,
ComparisonOperator upperOperator,
boolean ascOrder)
Return record iterator by secondary key (SK) in a tablespace.
|
Iterator<GenericRecord> |
getRecordIteratorBySk(String skName,
List<Object> lower,
ComparisonOperator lowerOperator,
List<Object> upper,
ComparisonOperator upperOperator,
List<String> projection)
Return record iterator by secondary key (SK) in a tablespace.
|
Iterator<GenericRecord> |
getRecordIteratorBySk(String skName,
List<Object> lower,
ComparisonOperator lowerOperator,
List<Object> upper,
ComparisonOperator upperOperator,
List<String> projection,
boolean ascOrder)
Return record iterator by secondary key (SK) in a tablespace.
|
TableDef |
getTableDef()
Return table definition.
|
void |
open()
Open table.
|
List<GenericRecord> |
queryAll()
Query all records in a tablespace.
|
List<GenericRecord> |
queryAll(List<String> projection)
Query all records in a tablespace with a filter and projection.
|
List<GenericRecord> |
queryAll(java.util.function.Predicate<GenericRecord> recordPredicate)
Query all records in a tablespace with a filter.
|
List<GenericRecord> |
queryAll(java.util.function.Predicate<GenericRecord> recordPredicate,
List<String> projection)
Query all records in a tablespace with a filter and projection.
|
List<GenericRecord> |
queryByPageNumber(int pageNumber)
Query all records by single index page.
|
List<GenericRecord> |
queryByPageNumber(long pageNumber)
Query all records by single index page.
|
GenericRecord |
queryByPrimaryKey(List<Object> key)
Query record by primary key in a tablespace.
|
GenericRecord |
queryByPrimaryKey(List<Object> key,
List<String> projection)
Query record by primary key in a tablespace with projection.
|
List<GenericRecord> |
rangeQueryByPrimaryKey(List<Object> lower,
ComparisonOperator lowerOperator,
List<Object> upper,
ComparisonOperator upperOperator)
Range query records by primary key in a tablespace.
|
List<GenericRecord> |
rangeQueryByPrimaryKey(List<Object> lower,
ComparisonOperator lowerOperator,
List<Object> upper,
ComparisonOperator upperOperator,
List<String> projection)
Range query records by primary key in a tablespace with a filter.
|
List<GenericRecord> |
rangeQueryByPrimaryKey(List<Object> lower,
ComparisonOperator lowerOperator,
List<Object> upper,
ComparisonOperator upperOperator,
java.util.function.Predicate<GenericRecord> recordPredicate)
Range query records by primary key in a tablespace with a filter.
|
List<GenericRecord> |
rangeQueryByPrimaryKey(List<Object> lower,
ComparisonOperator lowerOperator,
List<Object> upper,
ComparisonOperator upperOperator,
java.util.function.Predicate<GenericRecord> recordPredicate,
List<String> projection)
Range query records by primary key in a tablespace with a filter.
|
List<FilHeader> |
readAllPageHeaders()
Read all page headers into memory.
|
List<AbstractPage> |
readAllPages()
Read all pages into memory which may cause OutOfMemory when tablespace file size is too big.
|
AbstractPage |
readPage(long pageNumber)
Read one page as
AbstractPage. |
void open()
long getNumOfPages()
List<AbstractPage> readAllPages()
getPageIterator() if file size is too big.Iterator<AbstractPage> getPageIterator()
List<FilHeader> readAllPageHeaders()
AbstractPage readPage(long pageNumber)
AbstractPage.pageNumber - page numberdouble getAllIndexPageFillingRate()
double getIndexPageFillingRate(int pageNumber)
pageNumber - page numberList<GenericRecord> queryByPageNumber(int pageNumber)
pageNumber - page number (int type), can be leaf or non-leaf pageList<GenericRecord> queryByPageNumber(long pageNumber)
pageNumber - page number (long type), can be leaf or non-leaf pageGenericRecord queryByPrimaryKey(List<Object> key)
For single key the list size should be one, for composite key the size will be more than one.
key - primary key, single key or a composite keyGenericRecord queryByPrimaryKey(List<Object> key, List<String> projection)
For single key the list size should be one, for composite key the size will be more than one.
key - primary key, single key or a composite keyprojection - projection of selected column namesList<GenericRecord> queryAll()
Note this will cause out-of-memory if the table size is too big.
List<GenericRecord> queryAll(java.util.function.Predicate<GenericRecord> recordPredicate)
Note this will cause out-of-memory if the table size is too big.
recordPredicate - optional filtering, if predicate returns true upon
record, then it will be added to result setList<GenericRecord> queryAll(List<String> projection)
Note this will cause out-of-memory if the table size is too big.
projection - projection of selected column namesList<GenericRecord> queryAll(java.util.function.Predicate<GenericRecord> recordPredicate, List<String> projection)
Note this will cause out-of-memory if the table size is too big. Make sure fields are included in projection for predicate to use.
recordPredicate - optional filtering, if predicate returns true upon
record, then it will be added to result setprojection - projection of selected column namesList<GenericRecord> rangeQueryByPrimaryKey(List<Object> lower, ComparisonOperator lowerOperator, List<Object> upper, ComparisonOperator upperOperator)
lower - if rangeQuery is true, then this is the lower boundlowerOperator - if rangeQuery is true, then this is the comparison operator for lowerupper - if rangeQuery is true, then this is the upper boundupperOperator - if rangeQuery is true, then this is the comparison operator for upperList<GenericRecord> rangeQueryByPrimaryKey(List<Object> lower, ComparisonOperator lowerOperator, List<Object> upper, ComparisonOperator upperOperator, java.util.function.Predicate<GenericRecord> recordPredicate)
lower - if rangeQuery is true, then this is the lower boundlowerOperator - if rangeQuery is true, then this is the comparison operator for lowerupper - if rangeQuery is true, then this is the upper boundupperOperator - if rangeQuery is true, then this is the comparison operator for upperrecordPredicate - optional filtering, if predicate returns true upon
record, then it will be added to result setList<GenericRecord> rangeQueryByPrimaryKey(List<Object> lower, ComparisonOperator lowerOperator, List<Object> upper, ComparisonOperator upperOperator, List<String> projection)
lower - if rangeQuery is true, then this is the lower boundlowerOperator - if rangeQuery is true, then this is the comparison operator for lowerupper - if rangeQuery is true, then this is the upper boundupperOperator - if rangeQuery is true, then this is the comparison operator for upperprojection - projection of selected column namesList<GenericRecord> rangeQueryByPrimaryKey(List<Object> lower, ComparisonOperator lowerOperator, List<Object> upper, ComparisonOperator upperOperator, java.util.function.Predicate<GenericRecord> recordPredicate, List<String> projection)
lower - if rangeQuery is true, then this is the lower boundlowerOperator - if rangeQuery is true, then this is the comparison operator for lowerupper - if rangeQuery is true, then this is the upper boundupperOperator - if rangeQuery is true, then this is the comparison operator for upperrecordPredicate - optional filtering, if predicate returns true upon
record, then it will be added to result setprojection - projection of selected column namesIterator<GenericRecord> getQueryAllIterator()
This is friendly to memory since only one page is loaded per batch.
Iterator<GenericRecord> getQueryAllIterator(List<String> projection)
This is friendly to memory since only one page is loaded per batch.
projection - projection of selected column namesIterator<GenericRecord> getQueryAllIterator(boolean ascOrder)
This is friendly to memory since only one page is loaded per batch.
ascOrder - if set result records in ascending orderIterator<GenericRecord> getQueryAllIterator(List<String> projection, boolean ascOrder)
This is friendly to memory since only one page is loaded per batch.
projection - projection of selected column namesascOrder - if set result records in ascending orderIterator<GenericRecord> getRangeQueryIterator(List<Object> lower, ComparisonOperator lowerOperator, List<Object> upper, ComparisonOperator upperOperator)
This is friendly to memory since only one page is loaded per batch.
For single key the list size should be one, for composite key the size will be more than one.
lower - if rangeQuery is true, then this is the lower boundlowerOperator - if rangeQuery is true, then this is the comparison operator for lowerupper - if rangeQuery is true, then this is the upper boundupperOperator - if rangeQuery is true, then this is the comparison operator for upperIterator<GenericRecord> getRangeQueryIterator(List<Object> lower, ComparisonOperator lowerOperator, List<Object> upper, ComparisonOperator upperOperator, List<String> projection)
This is friendly to memory since only one page is loaded per batch.
For single key the list size should be one, for composite key the size will be more than one.
lower - if rangeQuery is true, then this is the lower boundlowerOperator - if rangeQuery is true, then this is the comparison operator for lowerupper - if rangeQuery is true, then this is the upper boundupperOperator - if rangeQuery is true, then this is the comparison operator for upperprojection - projection of selected column namesIterator<GenericRecord> getRangeQueryIterator(List<Object> lower, ComparisonOperator lowerOperator, List<Object> upper, ComparisonOperator upperOperator, boolean ascOrder)
This is friendly to memory since only one page is loaded per batch.
For single key the list size should be one, for composite key the size will be more than one.
lower - if rangeQuery is true, then this is the lower boundlowerOperator - if rangeQuery is true, then this is the comparison operator for lowerupper - if rangeQuery is true, then this is the upper boundupperOperator - if rangeQuery is true, then this is the comparison operator for upperascOrder - if set result records in ascending orderIterator<GenericRecord> getRangeQueryIterator(List<Object> lower, ComparisonOperator lowerOperator, List<Object> upper, ComparisonOperator upperOperator, List<String> projection, boolean ascOrder)
This is friendly to memory since only one page is loaded per batch.
For single key the list size should be one, for composite key the size will be more than one.
lower - if rangeQuery is true, then this is the lower boundlowerOperator - if rangeQuery is true, then this is the comparison operator for lowerupper - if rangeQuery is true, then this is the upper boundupperOperator - if rangeQuery is true, then this is the comparison operator for upperprojection - projection of selected column namesascOrder - if set result records in ascending orderIterator<GenericRecord> getRecordIteratorBySk(String skName, List<Object> lower, ComparisonOperator lowerOperator, List<Object> upper, ComparisonOperator upperOperator)
This is friendly to memory since only one page is loaded per batch.
For single key the lower or upper list size should be one, for composite key the size will be more than one.
skName - secondary key name in SHOW CREATE TABLE commandlower - lower boundlowerOperator - comparison operator for lowerupper - upper boundupperOperator - comparison operator for upperIterator<GenericRecord> getRecordIteratorBySk(String skName, List<Object> lower, ComparisonOperator lowerOperator, List<Object> upper, ComparisonOperator upperOperator, List<String> projection)
This is friendly to memory since only one page is loaded per batch.
For single key the lower or upper list size should be one, for composite key the size will be more than one.
skName - secondary key name in SHOW CREATE TABLE commandlower - lower boundlowerOperator - comparison operator for lowerupper - upper boundupperOperator - comparison operator for upperprojection - projection of selected column namesIterator<GenericRecord> getRecordIteratorBySk(String skName, List<Object> lower, ComparisonOperator lowerOperator, List<Object> upper, ComparisonOperator upperOperator, boolean ascOrder)
This is friendly to memory since only one page is loaded per batch.
For single key the lower or upper list size should be one, for composite key the size will be more than one.
skName - secondary key name in SHOW CREATE TABLE commandlower - lower boundlowerOperator - comparison operator for lowerupper - upper boundupperOperator - comparison operator for upperascOrder - if set result records in ascending orderIterator<GenericRecord> getRecordIteratorBySk(String skName, List<Object> lower, ComparisonOperator lowerOperator, List<Object> upper, ComparisonOperator upperOperator, List<String> projection, boolean ascOrder)
This is friendly to memory since only one page is loaded per batch.
For single key the lower or upper list size should be one, for composite key the size will be more than one.
skName - secondary key name in SHOW CREATE TABLE commandlower - lower boundlowerOperator - comparison operator for lowerupper - upper boundupperOperator - comparison operator for upperprojection - projection of selected column namesascOrder - if set result records in ascending orderTableDef getTableDef()
void close()
close 在接口中 AutoCloseableclose 在接口中 CloseableCopyright © 2019–2020 Alibaba Group Holding Limited. All rights reserved.