Skip to content

Commit

Permalink
add getUsedMemorySize method for IPointReader
Browse files Browse the repository at this point in the history
  • Loading branch information
Beyyes committed Apr 2, 2024
1 parent 54eabc5 commit 792759c
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,12 @@ public TimeValuePair currentTimeValuePair() {
return new TimeValuePair(currentTime(), currentTsPrimitiveType());
}

@Override
public long getUsedMemorySize() {
// not used
return 0;
}

@Override
public void close() {
// do nothing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,11 @@ public TimeValuePair currentTimeValuePair() {
timeColumn.getLong(rowIndex), valueColumns[columnIndex].getTsPrimitiveType(rowIndex));
}

@Override
public long getUsedMemorySize() {
return getRetainedSizeInBytes();
}

@Override
public void close() {
// do nothing
Expand Down Expand Up @@ -440,6 +445,11 @@ public TimeValuePair currentTimeValuePair() {
timeColumn.getLong(rowIndex), new TsPrimitiveType.TsVector(currentValue()));
}

@Override
public long getUsedMemorySize() {
return getRetainedSizeInBytes();
}

@Override
public void close() {
// do nothing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,7 @@ public interface IPointReader {

TimeValuePair currentTimeValuePair() throws IOException;

long getUsedMemorySize();

void close() throws IOException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@
*/
public class LazyLoadAlignedPagePointReader implements IPointReader {

private TimePageReader timeReader;
private List<ValuePageReader> valueReaders;
private final TimePageReader timeReader;
private final List<ValuePageReader> valueReaders;

private boolean hasNextRow = false;

Expand Down Expand Up @@ -93,5 +93,13 @@ public TimeValuePair currentTimeValuePair() throws IOException {
}

@Override
public void close() throws IOException {}
public long getUsedMemorySize() {
// not used
return 0;
}

@Override
public void close() throws IOException {
// do nothing
}
}

0 comments on commit 792759c

Please sign in to comment.