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>
changeData
protected LoggedRunner
runner
-
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.Runner
getRunner()
The runner which was used to create this change data.boolean
isComplete()
Whether the entire change data is available to be iterated on statically, without performing any new computation or fetching.CloseableIterator<IndexedData<T>>
iterator()
void
saveToFile(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:ChangeData
Returns the change data at a given row. The data encapsulated in thisIndexedData
may be null, but not the return value of this function itself.- Specified by:
get
in interfaceChangeData<T>
- Parameters:
rowId
- the 0-based row index
-
getRunner
public Runner getRunner()
Description copied from interface:ChangeData
The runner which was used to create this change data.- Specified by:
getRunner
in interfaceChangeData<T>
-
saveToFile
public void saveToFile(File file, ChangeDataSerializer<T> serializer) throws IOException, InterruptedException
Description copied from interface:ChangeData
Saves the change data to a specified directory, following OpenRefine's format for change data.- Specified by:
saveToFile
in interfaceChangeData<T>
- Parameters:
file
- the directory where to save the gridserializer
- the serializer used to convert the items to strings- Throws:
IOException
InterruptedException
-
saveToFileAsync
public ProgressingFuture<Void> saveToFileAsync(File file, ChangeDataSerializer<T> serializer)
Description copied from interface:ChangeData
Saves the change data to a specified directory, following OpenRefine's format for change data, in an asynchronous way.- Specified by:
saveToFileAsync
in 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:ChangeData
Whether 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:
isComplete
in interfaceChangeData<T>
-
iterator
public CloseableIterator<IndexedData<T>> iterator()
- Specified by:
iterator
in interfaceCloseableIterable<T>
-
-