Class MemoryDataset
java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.foundations.core.FoundationObject
com.northconcepts.datapipeline.foundations.pipeline.dataset.Dataset
com.northconcepts.datapipeline.foundations.pipeline.dataset.MemoryDataset
- All Implemented Interfaces:
DataExceptionContributor,JsonSerializable,RecordSerializable,XmlSerializable,Closeable,Serializable,AutoCloseable,Iterable<Record>
Caches the dataset's records in RAM.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.northconcepts.datapipeline.foundations.pipeline.dataset.Dataset
Dataset.ColumnsDataReader -
Field Summary
Fields inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
internalId, internalName, log, TIMESTAMP_FORMATFields inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
SERIALIZED_CLASS_NAME, TYPEFields inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
XML_SERIALIZED_CLASS_NAME -
Constructor Summary
ConstructorsConstructorDescriptionMemoryDataset(AbstractPipeline pipeline) Creates a dataset that keeps the given pipeline's records in memory onceDataset.load()is called. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalled at the end of the data loading process after all the records and column stats have been loaded.protected voidCalled at the start of the data loading process, but before any records or column stats have been loaded.voidclose()protected DataWriterWrites records to this dataset's cache after clearing it.getColumn(int index) Returns the column with the given name or null if there is none.longprotected ColumngetOrCreateColumn(String name, int index) Returns the named column, creating it with the given 0-based field index if needed; called while collecting column stats.getRecord(long index) Returns the loaded record at the given 0-based index.longReturns the number of records loaded into this dataset so far.setPipeline(AbstractPipeline pipeline) Methods inherited from class com.northconcepts.datapipeline.foundations.pipeline.dataset.Dataset
addField, afterColumnStatsLoaded, afterRecordsLoaded, cancelLoad, createColumnsDataReader, createDataReader, createDataReader, finalize, forEach, fromRecord, getColumnStatsException, getColumnStatsReaderThreads, getDataLoadException, getJob, getJobExecutor, getMaxColumnStatsRecords, getMaxColumnsToAnalyze, getMaxRecordsToLoad, getPipeline, getRecordList, isCollectUniqueValues, isColumnStatsLoaded, isDataLoaded, isDataLoading, isDetectBigNumberValues, isDetectBooleanValues, isDetectNumericValues, isDetectTemporalValues, isDetectUuidValues, isInferStringTypes, isRecordsLoaded, iterator, load, load, load, setCollectUniqueValues, setColumnStatsLoaded, setColumnStatsReaderThreads, setDetectBigNumberValues, setDetectBooleanValues, setDetectNumericValues, setDetectTemporalValues, setDetectUuidValues, setInferStringTypes, setJobExecutor, setMaxColumnStatsRecords, setMaxColumnsToAnalyze, setRecordsLoaded, stream, toRecord, updateColumns, waitForColumnStatsToLoad, waitForColumnStatsToLoad, waitForRecordsToLoad, waitForRecordsToLoad, waitUntilJobFinishedMethods inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
addExceptionProperties, assertValid, assertValid, clone, exception, exception, exception, getInternalId, getInternalName, resetInternalIdMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.northconcepts.datapipeline.core.DataExceptionContributor
addExceptionPropertiesMethods inherited from interface java.lang.Iterable
spliteratorMethods inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
fromJson, fromJson, toJson, toJson, toJsonMethods inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
fromXml, fromXml, fromXmlElement, toXml, toXml, toXml, toXml, toXml, toXmlElement
-
Constructor Details
-
MemoryDataset
Creates a dataset that keeps the given pipeline's records in memory onceDataset.load()is called.
-
-
Method Details
-
setPipeline
- Overrides:
setPipelinein classDataset
-
close
public void close() -
getRecordCount
public long getRecordCount()Description copied from class:DatasetReturns the number of records loaded into this dataset so far.- Specified by:
getRecordCountin classDataset
-
getRecord
Description copied from class:DatasetReturns the loaded record at the given 0-based index. -
getColumnCount
public long getColumnCount()- Specified by:
getColumnCountin classDataset
-
getColumnNames
- Specified by:
getColumnNamesin classDataset
-
getColumn
-
getColumn
Description copied from class:DatasetReturns the column with the given name or null if there is none. -
getOrCreateColumn
Description copied from class:DatasetReturns the named column, creating it with the given 0-based field index if needed; called while collecting column stats.- Specified by:
getOrCreateColumnin classDataset
-
getColumns
- Specified by:
getColumnsin classDataset
-
beforeLoad
protected void beforeLoad()Description copied from class:DatasetCalled at the start of the data loading process, but before any records or column stats have been loaded.- Specified by:
beforeLoadin classDataset
-
afterLoad
protected void afterLoad()Description copied from class:DatasetCalled at the end of the data loading process after all the records and column stats have been loaded. -
createDataWriter
Description copied from class:DatasetWrites records to this dataset's cache after clearing it.- Specified by:
createDataWriterin classDataset
-