Class CharValueTracker
java.lang.Object
io.deephaven.clientsupport.plotdownsampling.ValueTracker
io.deephaven.clientsupport.plotdownsampling.CharValueTracker
See ReplicateDownsamplingValueTrackers for notes on changing this file.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
append
(int offset, long rowKey, Chunk<? extends Values> valuesChunk, int indexInChunk, @Nullable WritableRowSet nulls) Indicates that a new value is being added to the original table being downsampled, and its value should be considered as possibly interesting.protected void
ensureCapacity
(int bucketCount) toString
(int offset) Create a String representation of the tracked values and metadata at the given offset for logging/debugging purposes.void
update
(int offset, long rowKey, Chunk<? extends Values> valuesChunk, int indexInChunk, @Nullable WritableRowSet nulls) Indicates that a value has changed in the original table that is being downsampled, and we should consider if the old value or the new value was interesting.void
validate
(int offset, long rowKey, Chunk<? extends Values> valuesChunk, int indexInChunk, @Nullable RowSet nulls) Scan the given chunk and confirm that whichever values are currently selected as max and min are correct, and that the current data is now valid.Methods inherited from class io.deephaven.clientsupport.plotdownsampling.ValueTracker
maxIndex, maxValuePosition, maxValueValid, maxValueValid, minIndex, minValuePosition, minValueValid, minValueValid, of, remove, setMaxIndex, setMinIndex, shiftMaxIndex, shiftMinIndex
-
Constructor Details
-
CharValueTracker
public CharValueTracker()
-
-
Method Details
-
ensureCapacity
protected void ensureCapacity(int bucketCount) - Overrides:
ensureCapacity
in classValueTracker
-
append
public void append(int offset, long rowKey, Chunk<? extends Values> valuesChunk, int indexInChunk, @Nullable @Nullable WritableRowSet nulls) Description copied from class:ValueTracker
Indicates that a new value is being added to the original table being downsampled, and its value should be considered as possibly interesting. Implementations should read the value from the chunk and specialize based on that type of data. If it is the only value in the bucket (specified by the offset), include this value as both the max and the min. If there are other values, check to see if the new value is either the new max or the new min. In any case where this becomes the new max or the new min, mark that position as being valid, indicating that we are confident that we have the largest or smallest value at that offset. Implementations must take care to check if the value is null. If so, ifnulls
is present, the current row key should be added to it. If the- Specified by:
append
in classValueTracker
- Parameters:
offset
- the offset of the bucket state to use - use this with minValuePosition/maxValuePosition to compute the actual position in the underlying array sourcesrowKey
- the row key in the original table of the specified value. If the current given value is interesting in some way, record this using setMinIndex/setMaxIndex so we can construct the full downsampled table row set latervaluesChunk
- the chunk that we're currently examiningindexInChunk
- the index in the chunk that we're currently examining
-
update
public void update(int offset, long rowKey, Chunk<? extends Values> valuesChunk, int indexInChunk, @Nullable @Nullable WritableRowSet nulls) Description copied from class:ValueTracker
Indicates that a value has changed in the original table that is being downsampled, and we should consider if the old value or the new value was interesting. Implementations should read the value from the chunk and specialize based on that type of data. There are three cases to consider for each min and max, so six cases in total. Here is the summary for the three "max" cases, the opposite must be likewise done for the min cases: If the updated row was the old max, then we cover two of the cases: o if the new value is greater than the old value, record the new value, but we are still the max and still valid. o if the new value is less than the old value, invalidate this row but keep the old max, we may need to rescan later Otherwise, if the new value is greater than the old max, then the current row is now the new max, and are now valid.- Specified by:
update
in classValueTracker
- Parameters:
offset
- the offset of the bucket state to use - use this with minValuePosition/maxValuePosition to compute the actual position in the underlying array sourcesrowKey
- the row key in the original table of the specified value. If the current given value is interesting in some way, record this using setMinIndex/setMaxIndex so we can construct the full downsampled table row set latervaluesChunk
- the chunk that we're currently examiningindexInChunk
- the index in the chunk that we're currently examining
-
validate
public void validate(int offset, long rowKey, Chunk<? extends Values> valuesChunk, int indexInChunk, @Nullable @Nullable RowSet nulls) Description copied from class:ValueTracker
Scan the given chunk and confirm that whichever values are currently selected as max and min are correct, and that the current data is now valid.- Specified by:
validate
in classValueTracker
-
toString
Description copied from class:ValueTracker
Create a String representation of the tracked values and metadata at the given offset for logging/debugging purposes.- Specified by:
toString
in classValueTracker
-