Interface SortedStorageReader<PK extends io.datarouter.model.key.primary.PrimaryKey<PK>,D extends io.datarouter.model.databean.Databean<PK,D>>
- All Superinterfaces:
NodeOps<PK,D>
- All Known Subinterfaces:
IndexedSortedMapStorage<PK,D>,IndexedSortedMapStorage.IndexedSortedMapStorageNode<PK,D,F>,IndexedSortedMapStorage.PhysicalIndexedSortedMapStorageNode<PK,D,F>,IndexedSortedMapStorageReader<PK,D>,IndexedSortedMapStorageReader.IndexedSortedMapStorageReaderNode<PK,D,F>,IndexedSortedMapStorageReader.PhysicalIndexedSortedMapStorageReaderNode<PK,D,F>,IndexingSortedStorageMixin<PK,D,F,N>,IndexReader<PK,D,IK,IE>,ManagedUniqueIndexNode<PK,D,IK,IE,IF>,MultiIndexNode<PK,D,IK,IE>,MultiIndexReader<PK,D,IK,IE>,PhysicalSortedStorageAvailabilityAdapterMixin<PK,D,F,N>,PhysicalSubEntitySortedMapStorageNode<EK,PK,D,F>,SortedMapStorage<PK,D>,SortedMapStorage.PhysicalSortedMapStorageNode<PK,D,F>,SortedMapStorage.SortedMapStorageNode<PK,D,F>,SortedMapStorageReader<PK,D>,SortedMapStorageReader.PhysicalSortedMapStorageReaderNode<PK,D,F>,SortedMapStorageReader.SortedMapStorageReaderNode<PK,D,F>,SortedStorage<PK,D>,SortedStorage.PhysicalSortedStorageNode<PK,D,F>,SortedStorage.SortedStorageNode<PK,D,F>,SortedStorageCounterAdapterMixin<PK,D,F,N>,SortedStorageReader.PhysicalSortedStorageReaderNode<PK,D,F>,SortedStorageReader.SortedStorageReaderNode<PK,D,F>,SortedStorageReaderCallsiteAdapterMixin<PK,D,F,N>,SortedStorageSanitizationAdapterMixin<PK,D,F,N>,SortedStorageTraceAdapterMixin<PK,D,F,N>,SubEntitySortedMapStorageNode<EK,PK,D,F>,SubEntitySortedMapStorageReaderNode<EK,PK,D,F>,UniqueIndexNode<PK,D,IK,IE>,UniqueIndexReader<PK,D,IK,IE>
- All Known Implementing Classes:
IndexedSortedMapStorageCallsiteAdapter,IndexedSortedMapStorageCounterAdapter,IndexingSortedMapStorageNode,ManualMultiIndexNode,ManualUniqueIndexNode,NoOpGroupQueueNode,NoOpIndexReader,NoOpNode,NoOpQueueNode,NoOpUniqueIndexNode,NoTxnManagedUniqueIndexNode,PhysicalIndexedSortedMapStorageAvailabilityAdapterFactory.PhysicalIndexedSortedMapStorageAvailabilityAdapter,PhysicalIndexedSortedMapStorageCallsiteAdapter,PhysicalIndexedSortedMapStorageCounterAdapter,PhysicalIndexedSortedMapStorageSanitizationAdapter,PhysicalIndexedSortedMapStorageSanitizationAdapter,PhysicalIndexedSortedMapStorageTraceAdapter,PhysicalSortedMapStorageAvailabilityAdapterFactory.PhysicalSortedMapStorageAvailabilityAdapter,PhysicalSortedMapStorageCallsiteAdapter,PhysicalSortedMapStorageCounterAdapter,PhysicalSortedMapStorageSanitizationAdapter,PhysicalSortedMapStorageTraceAdapter,PhysicalSubEntitySortedMapStorageAvailabilityAdapterFactory.PhysicalSubEntitySortedMapStorageAvailabilityAdapter,PhysicalSubEntitySortedMapStorageCallsiteAdapter,PhysicalSubEntitySortedMapStorageCounterAdapter,PhysicalSubEntitySortedMapStorageSanitizationAdapter,PhysicalSubEntitySortedMapStorageTraceAdapter,SortedMapStorageCallsiteAdapter,SortedMapStorageCounterAdapter,TxnManagedUniqueIndexNode
public interface SortedStorageReader<PK extends io.datarouter.model.key.primary.PrimaryKey<PK>,D extends io.datarouter.model.databean.Databean<PK,D>> extends NodeOps<PK,D>
Methods for reading from storage mechanisms that keep databeans sorted by PrimaryKey. Similar to java's TreeMap.
Possible implementations include TreeMap, RDBMS, HBase, LevelDB, Google Cloud Datastore, Google Cloud BigTable, etc
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceSortedStorageReader.PhysicalSortedStorageReaderNode<PK extends io.datarouter.model.key.primary.PrimaryKey<PK>,D extends io.datarouter.model.databean.Databean<PK,D>,F extends io.datarouter.model.serialize.fielder.DatabeanFielder<PK,D>>static interfaceSortedStorageReader.SortedStorageReaderNode<PK extends io.datarouter.model.key.primary.PrimaryKey<PK>,D extends io.datarouter.model.databean.Databean<PK,D>,F extends io.datarouter.model.serialize.fielder.DatabeanFielder<PK,D>> -
Field Summary
Fields Modifier and Type Field Description static java.lang.StringOP_getKeysInRangestatic java.lang.StringOP_getPrefixedRangestatic java.lang.StringOP_getRangestatic java.lang.StringOP_scanstatic java.lang.StringOP_scanKeysstatic java.lang.StringOP_scanRangesstatic java.lang.StringOP_scanRangesKeys -
Method Summary
Modifier and Type Method Description default longcount(io.datarouter.util.tuple.Range<PK> range)static <PK extends io.datarouter.model.key.primary.PrimaryKey<PK>>
java.util.List<io.datarouter.util.tuple.Range<PK>>getRangesFromPrefixes(java.util.Collection<PK> prefixes)default io.datarouter.scanner.Scanner<D>scan()default io.datarouter.scanner.Scanner<D>scan(Config config)default io.datarouter.scanner.Scanner<D>scan(io.datarouter.util.tuple.Range<PK> range)default io.datarouter.scanner.Scanner<D>scan(io.datarouter.util.tuple.Range<PK> range, Config config)The scan method accepts a Range<PK> which identifies the startKey and endKey, and returns all contiguous rows between them, not skipping or filtering any.default io.datarouter.scanner.Scanner<PK>scanKeys()default io.datarouter.scanner.Scanner<PK>scanKeys(Config config)default io.datarouter.scanner.Scanner<PK>scanKeys(io.datarouter.util.tuple.Range<PK> range)default io.datarouter.scanner.Scanner<PK>scanKeys(io.datarouter.util.tuple.Range<PK> range, Config config)default io.datarouter.scanner.Scanner<PK>scanKeysWithPrefix(PK prefix)default io.datarouter.scanner.Scanner<PK>scanKeysWithPrefix(PK prefix, Config config)default io.datarouter.scanner.Scanner<PK>scanKeysWithPrefixes(java.util.Collection<PK> prefixes)default io.datarouter.scanner.Scanner<PK>scanKeysWithPrefixes(java.util.Collection<PK> prefixes, Config config)default io.datarouter.scanner.Scanner<D>scanRanges(java.util.Collection<io.datarouter.util.tuple.Range<PK>> ranges)io.datarouter.scanner.Scanner<D>scanRanges(java.util.Collection<io.datarouter.util.tuple.Range<PK>> ranges, Config config)default io.datarouter.scanner.Scanner<PK>scanRangesKeys(java.util.Collection<io.datarouter.util.tuple.Range<PK>> ranges)io.datarouter.scanner.Scanner<PK>scanRangesKeys(java.util.Collection<io.datarouter.util.tuple.Range<PK>> ranges, Config config)default io.datarouter.scanner.Scanner<D>scanWithPrefix(PK prefix)default io.datarouter.scanner.Scanner<D>scanWithPrefix(PK prefix, Config config)default io.datarouter.scanner.Scanner<D>scanWithPrefixes(java.util.Collection<PK> prefixes)default io.datarouter.scanner.Scanner<D>scanWithPrefixes(java.util.Collection<PK> prefixes, Config config)
-
Field Details
-
OP_getKeysInRange
static final java.lang.String OP_getKeysInRange- See Also:
- Constant Field Values
-
OP_getRange
static final java.lang.String OP_getRange- See Also:
- Constant Field Values
-
OP_getPrefixedRange
static final java.lang.String OP_getPrefixedRange- See Also:
- Constant Field Values
-
OP_scanKeys
static final java.lang.String OP_scanKeys- See Also:
- Constant Field Values
-
OP_scanRangesKeys
static final java.lang.String OP_scanRangesKeys- See Also:
- Constant Field Values
-
OP_scan
static final java.lang.String OP_scan- See Also:
- Constant Field Values
-
OP_scanRanges
static final java.lang.String OP_scanRanges- See Also:
- Constant Field Values
-
-
Method Details
-
scanRanges
-
scanRanges
-
scan
default io.datarouter.scanner.Scanner<D> scan(io.datarouter.util.tuple.Range<PK> range, Config config)The scan method accepts a Range<PK> which identifies the startKey and endKey, and returns all contiguous rows between them, not skipping or filtering any. Implementations will generally query the database in batches to avoid long transactions and huge result sets.
When providing startKey and endKey, implementations will ignore fields after the first null. For example, when scanning a phone book with startKey:
* (null, null) is valid and will start at the beginning of the book
* (Corgan, null) is valid and will start at the first Corgan
* (Corgan, Matt) is valid and will start at Corgan, Matt
* (null, Matt) is invalid. The Matt is ignored, so it is equivalent to (null, null)
Note that (null, Matt) will NOT do any filtering for rows with firstName=Matt. To avoid tablescans we are returning all rows in the range to the client where the client can then filter. A predicate push-down feature may be added, but it will likely use a separate interface method. -
scan
-
scan
-
scan
-
scanRangesKeys
-
scanRangesKeys
-
scanKeys
-
scanKeys
-
scanKeys
-
scanKeys
-
scanWithPrefix
-
scanWithPrefix
-
scanKeysWithPrefix
-
scanKeysWithPrefix
-
scanWithPrefixes
-
scanWithPrefixes
-
scanKeysWithPrefixes
-
scanKeysWithPrefixes
-
count
-
getRangesFromPrefixes
static <PK extends io.datarouter.model.key.primary.PrimaryKey<PK>> java.util.List<io.datarouter.util.tuple.Range<PK>> getRangesFromPrefixes(java.util.Collection<PK> prefixes)
-