Class LoggedChangeData<T>
- java.lang.Object
-
- org.openrefine.runners.local.logging.LoggedChangeData<T>
-
- All Implemented Interfaces:
ChangeData<T>,CloseableIterable<IndexedData<T>>
public class LoggedChangeData<T> extends Object implements ChangeData<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.openrefine.util.CloseableIterable
CloseableIterable.Wrapper<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected ChangeData<T>changeDataprotected LoggedRunnerrunner
-
Constructor Summary
Constructors Constructor Description LoggedChangeData(LoggedRunner runner, ChangeData<T> changeData)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IndexedData<T>get(long rowId)Returns the change data at a given row.RunnergetRunner()The runner which was used to create this change data.booleanisComplete()Whether the entire change data is available to be iterated on statically, without performing any new computation or fetching.CloseableIterator<IndexedData<T>>iterator()voidsaveToFile(File file, ChangeDataSerializer<T> serializer)Saves the change data to a specified directory, following OpenRefine's format for change data.ProgressingFuture<Void>saveToFileAsync(File file, ChangeDataSerializer<T> serializer)Saves the change data to a specified directory, following OpenRefine's format for change data, in an asynchronous way.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openrefine.util.CloseableIterable
drop, filter, map, take
-
-
-
-
Field Detail
-
changeData
protected final ChangeData<T> changeData
-
runner
protected final LoggedRunner runner
-
-
Constructor Detail
-
LoggedChangeData
public LoggedChangeData(LoggedRunner runner, ChangeData<T> changeData)
-
-
Method Detail
-
get
public IndexedData<T> get(long rowId)
Description copied from interface:ChangeDataReturns the change data at a given row. The data encapsulated in thisIndexedDatamay be null, but not the return value of this function itself.- Specified by:
getin interfaceChangeData<T>- Parameters:
rowId- the 0-based row index
-
getRunner
public Runner getRunner()
Description copied from interface:ChangeDataThe runner which was used to create this change data.- Specified by:
getRunnerin interfaceChangeData<T>
-
saveToFile
public void saveToFile(File file, ChangeDataSerializer<T> serializer) throws IOException, InterruptedException
Description copied from interface:ChangeDataSaves the change data to a specified directory, following OpenRefine's format for change data.- Specified by:
saveToFilein interfaceChangeData<T>- Parameters:
file- the directory where to save the gridserializer- the serializer used to convert the items to strings- Throws:
IOExceptionInterruptedException
-
saveToFileAsync
public ProgressingFuture<Void> saveToFileAsync(File file, ChangeDataSerializer<T> serializer)
Description copied from interface:ChangeDataSaves the change data to a specified directory, following OpenRefine's format for change data, in an asynchronous way.- Specified by:
saveToFileAsyncin interfaceChangeData<T>- Parameters:
file- the directory where to save the gridserializer- the serializer used to convert the items to strings- Returns:
- a future which completes once the save is complete
-
isComplete
public boolean isComplete()
Description copied from interface:ChangeDataWhether the entire change data is available to be iterated on statically, without performing any new computation or fetching. This happens when this ChangeData object is loaded back from disk and a suitable completion marker was found.- Specified by:
isCompletein interfaceChangeData<T>
-
iterator
public CloseableIterator<IndexedData<T>> iterator()
- Specified by:
iteratorin interfaceCloseableIterable<T>
-
-