public class NoCacheMetadataIndexView extends Object implements IMetadataIndex
Constructor and Description |
---|
NoCacheMetadataIndexView(AbstractScaleOutFederation fed,
String name,
long timestamp,
MetadataIndex.MetadataIndexMetadata mdmd) |
Modifier and Type | Method and Description |
---|---|
PartitionLocator |
find(byte[] key)
Find and return the partition spanning the given key.
|
PartitionLocator |
get(byte[] key)
The partition with that separator key or
null (exact match
on the separator key). |
MetadataIndex.MetadataIndexMetadata |
getIndexMetadata()
The metadata for the metadata index itself.
|
protected IMetadataService |
getMetadataService() |
IndexMetadata |
getScaleOutIndexMetadata()
The metadata template for the scale-out index managed by this metadata
index.
|
long |
rangeCount()
Return the #of tuples in the index.
|
long |
rangeCount(byte[] fromKey,
byte[] toKey)
Return the #of tuples in a half-open key range.
|
long |
rangeCountExact(byte[] fromKey,
byte[] toKey)
Return the exact #of tuples in a half-open key range.
|
long |
rangeCountExactWithDeleted(byte[] fromKey,
byte[] toKey)
Return the exact #of tuples in a half-open key range, including any
deleted tuples.
|
ITupleIterator |
rangeIterator()
Visits all tuples in key order.
|
ITupleIterator |
rangeIterator(byte[] fromKey,
byte[] toKey)
Return an iterator that visits the entries in a half-open key range.
|
ITupleIterator |
rangeIterator(byte[] fromKey,
byte[] toKey,
int capacity,
int flags,
IFilter filter)
Note: Since this view is read-only this method forces the use of
ITx.READ_COMMITTED IFF the timestamp for the view is
ITx.UNISOLATED . |
void |
staleLocator(PartitionLocator locator)
NOP since nothing is cached.
|
public NoCacheMetadataIndexView(AbstractScaleOutFederation fed, String name, long timestamp, MetadataIndex.MetadataIndexMetadata mdmd)
name
- The name of the scale-out index.timestamp
- public MetadataIndex.MetadataIndexMetadata getIndexMetadata()
IMetadataIndex
MetadataIndex.MetadataIndexMetadata.getManagedIndexMetadata()
returns the
template IndexMetadata
for the scale-out index partitions.getIndexMetadata
in interface IMetadataIndex
IMetadataIndex.getScaleOutIndexMetadata()
protected IMetadataService getMetadataService()
public IndexMetadata getScaleOutIndexMetadata()
IMetadataIndex
getScaleOutIndexMetadata
in interface IMetadataIndex
public PartitionLocator get(byte[] key)
IMetadataIndex
null
(exact match
on the separator key).get
in interface IMetadataIndex
key
- The separator key (the first key that would go into that
partition).null
.public PartitionLocator find(byte[] key)
IMetadataIndex
find
in interface IMetadataIndex
key
- A key (optional). When null
the locator for the
last index partition will be returned.null
if
there are no partitions defined.public long rangeCount()
IRangeQuery
Note: If the index supports deletion markers then the range count will be an upper bound and may double count tuples which have been overwritten, including the special case where the overwrite is a delete.
rangeCount
in interface IRangeQuery
ISimpleIndexAccess.rangeCount()
public long rangeCount(byte[] fromKey, byte[] toKey)
IRangeQuery
Note: If the index supports deletion markers then the range count will be an upper bound and may double count tuples which have been overwritten, including the special case where the overwrite is a delete.
rangeCount
in interface IRangeQuery
fromKey
- The lowest key that will be counted (inclusive). When
null
there is no lower bound.toKey
- The first key that will not be counted (exclusive). When
null
there is no upper bound.public long rangeCountExact(byte[] fromKey, byte[] toKey)
IRangeQuery
Note: If the index supports deletion markers then this operation will require a key-range scan.
rangeCountExact
in interface IRangeQuery
fromKey
- The lowest key that will be counted (inclusive). When
null
there is no lower bound.toKey
- The first key that will not be counted (exclusive). When
null
there is no upper bound.public long rangeCountExactWithDeleted(byte[] fromKey, byte[] toKey)
IRangeQuery
When the view is just an AbstractBTree
the result is the same as
for IRangeQuery.rangeCount(byte[], byte[])
, which already
reports all tuples regardless of whether or not they are deleted.
When the index is a view with multiple sources, this operation requires a key-range scan where both deleted and undeleted tuples are visited.
rangeCountExactWithDeleted
in interface IRangeQuery
fromKey
- The lowest key that will be counted (inclusive). When
null
there is no lower bound.toKey
- The first key that will not be counted (exclusive). When
null
there is no upper bound.IRangeQuery.rangeCountExact(byte[], byte[])
public ITupleIterator rangeIterator()
IRangeQuery
rangeIterator(null, null)
rangeIterator
in interface IRangeQuery
public ITupleIterator rangeIterator(byte[] fromKey, byte[] toKey)
IRangeQuery
rangeIterator
in interface IRangeQuery
fromKey
- The first key that will be visited (inclusive lower bound).
When null
there is no lower bound.toKey
- The first key that will NOT be visited (exclusive upper
bound). When null
there is no upper bound.SuccessorUtil, which may be used to compute the successor of a value
before encoding it as a component of a key.
,
BytesUtil#successor(byte[]), which may be used to compute the
successor of an encoded key.
,
EntryFilter, which may be used to filter the entries visited by the
iterator.
public ITupleIterator rangeIterator(byte[] fromKey, byte[] toKey, int capacity, int flags, IFilter filter)
ITx.READ_COMMITTED
IFF the timestamp for the view is
ITx.UNISOLATED
. This produces the same results on read and
reduces contention for the WriteExecutorService
. This is
already done automatically for anything that gets run as an index
procedure, so we only have to do this explicitly for the range
iterator method.rangeIterator
in interface IRangeQuery
fromKey
- The first key that will be visited (inclusive lower bound).
When null
there is no lower bound.toKey
- The first key that will NOT be visited (exclusive upper
bound). When null
there is no upper bound.capacity
- The #of entries to buffer at a time. This is a hint and MAY be
zero (0) to use an implementation specific default
capacity. A non-zero value may be used if you know that you
want at most N results or if you want to override the default
#of results to be buffered before sending them across a
network interface. (Note that you can control the default
value using
IBigdataClient.Options#DEFAULT_CLIENT_RANGE_QUERY_CAPACITY
).flags
- A bitwise OR of IRangeQuery.KEYS
, IRangeQuery.VALS
, etc.filter
- An optional object used to construct a stacked iterator. When
IRangeQuery.CURSOR
is specified in flags, the base
iterator will implement ITupleCursor
and the first
filter in the stack can safely cast the source iterator to an
ITupleCursor
. If the outermost filter in the stack
does not implement ITupleIterator
, then it will be
wrapped an ITupleIterator
.SuccessorUtil, which may be used to compute the successor of a value
before encoding it as a component of a key.
,
BytesUtil#successor(byte[]), which may be used to compute the
successor of an encoded key.
,
IFilterConstructor, which may be used to construct an iterator stack
performing filtering or other operations.
public void staleLocator(PartitionLocator locator)
staleLocator
in interface IMetadataIndex
locator
- The locator.Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.