Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add getUsedMemorySize method for IPointReader #60

Merged
merged 1 commit into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
}