Package org.openrefine.model.changes
Class RowInRecordChangeDataProducer<T>
- java.lang.Object
-
- org.openrefine.model.changes.RowInRecordChangeDataProducer<T>
-
- All Implemented Interfaces:
Serializable
,RecordChangeDataProducer<List<T>>
,RowChangeDataProducer<T>
- Direct Known Subclasses:
ColumnAdditionByFetchingURLsOperation.URLFetchingChangeProducer
,ReconOperation.ReconChangeDataProducer
public abstract class RowInRecordChangeDataProducer<T> extends Object implements RecordChangeDataProducer<List<T>>, RowChangeDataProducer<T>
LikeRowChangeDataProducer
except that the enclosingRecord
is also available. This defines aRecordChangeDataProducer
which maps each row accordingly. When used as aRowChangeDataProducer
, the record argument is set to null. This class is useful when performing a row-wise operation in records mode, as the enclosing record must be available in the expression language.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RowInRecordChangeDataProducer()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description T
call(long rowId, Row row)
Compute the change data on a given row.List<T>
call(Record record)
Compute the change data on a given record.abstract T
call(Record record, long rowId, Row row)
Maps a row, in the context of a record.int
getBatchSize()
The size of batches this producer would like to be called on.int
getMaxConcurrency()
The maximum number of concurrent calls to this change data producer.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.openrefine.model.changes.RecordChangeDataProducer
callRecordBatch
-
Methods inherited from interface org.openrefine.model.changes.RowChangeDataProducer
callRowBatch
-
-
-
-
Method Detail
-
call
public abstract T call(Record record, long rowId, Row row)
Maps a row, in the context of a record.- Parameters:
record
- the record enclosing the row to maprowId
- the global index of the row in the entire gridrow
- the row itself
-
call
public T call(long rowId, Row row)
Description copied from interface:RowChangeDataProducer
Compute the change data on a given row.- Specified by:
call
in interfaceRowChangeDataProducer<T>
-
call
public List<T> call(Record record)
Description copied from interface:RecordChangeDataProducer
Compute the change data on a given record.- Specified by:
call
in interfaceRecordChangeDataProducer<T>
-
getBatchSize
public int getBatchSize()
The size of batches this producer would like to be called on. Smaller batches can be submitted (for instance at the end of a partition). Defaults to 1.- Specified by:
getBatchSize
in interfaceRecordChangeDataProducer<T>
- Specified by:
getBatchSize
in interfaceRowChangeDataProducer<T>
-
getMaxConcurrency
public int getMaxConcurrency()
Description copied from interface:RecordChangeDataProducer
The maximum number of concurrent calls to this change data producer. If 0, there is no limit to the concurrency.- Specified by:
getMaxConcurrency
in interfaceRecordChangeDataProducer<T>
- Specified by:
getMaxConcurrency
in interfaceRowChangeDataProducer<T>
-
-