matlab.io.datastore.Subsettable Class
Namespace: matlab.io.datastore
Description
matlab.io.datastore.Subsettable is an abstract mixin class that adds
subset and fine-grained parallelization support to your custom datastore for use with
Parallel Computing Toolbox™ and MATLAB®
Parallel Server™. matlab.io.datastore.Subsettable creates fine-grained subsets
with the subset method, coarse-grained partitions with the
partition method, and dataset randomization with the
shuffle method.
Use matlab.io.datastore.Subsettable only if you can access every data
read independently for increased granularity. If not, such as in
TabularTextDatastore workflows, then
matlab.io.datastore.Partitionable is more appropriate.
To use this mixin class, inherit from the
matlab.io.datastore.Subsettable class, in addition to inheriting from the
matlab.io.Datastore
base class. Type this syntax as the first line of your class definition
file:
classdef MyDatastore < matlab.io.Datastore & ...
matlab.io.datastore.Subsettable
...
endTo add support for parallel processing to your custom datastore, you must:
Inherit from the class
matlab.io.datastore.Subsettablein addition tomatlab.io.Datastore.Define the method
maxpartitions.Define the method
subsetByReadIndices.Subsettableuses thesubsetmethod to call the implementation ofsubsetByReadIndices.
For more details and steps to create your custom datastore with parallel processing support, see Develop Custom Datastore.
Methods
Examples
Tips
For your custom datastore implementation, a best practice is not to implement the
numpartitionsmethod.
Version History
Introduced in R2022b
See Also
datastore | matlab.io.Datastore | isSubsettable | subsetByReadIndices | maxpartitions
Topics
- Develop Custom Datastore
- Tall Arrays for Out-of-Memory Data
- Partition a Datastore in Parallel (Parallel Computing Toolbox)