Interface ChangeData<T>

  • Type Parameters:
    T - the type of data to store for each row. It should be serializable with Jackson.
    All Superinterfaces:
    CloseableIterable<IndexedData<T>>
    All Known Implementing Classes:
    LocalChangeData, LoggedChangeData, TestingChangeData

    public interface ChangeData<T>
    extends CloseableIterable<IndexedData<T>>
    Some external data, obtained by communicating with an external service or performing an expensive computation whose result should be persisted in the project data.

    This data is indexed by row ids from the original grid it was computed from, making it easy to join both to obtain the final state of the grid after this expensive computation.

    • Method Detail

      • get

        IndexedData<T> get​(long rowId)
        Returns the change data at a given row. The data encapsulated in this IndexedData may be null, but not the return value of this function itself.
        Parameters:
        rowId - the 0-based row index
      • getRunner

        Runner getRunner()
        The runner which was used to create this change data.
      • saveToFileAsync

        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.
        Parameters:
        file - the directory where to save the grid
        serializer - the serializer used to convert the items to strings
        Returns:
        a future which completes once the save is complete
      • isComplete

        boolean isComplete()
        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.