-
Notifications
You must be signed in to change notification settings - Fork 4k
ARROW-5434: [Memory][Java] Introduce wrappers for backward compatibility. #4406
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,7 +77,7 @@ public final class ArrowBuf implements AutoCloseable { | |
| private int readerIndex; | ||
| private int writerIndex; | ||
| private final HistoricalLog historicalLog = BaseAllocator.DEBUG ? | ||
| new HistoricalLog(BaseAllocator.DEBUG_LOG_LENGTH, "ArrowBuf[%d]", id) : null; | ||
| new HistoricalLog(BaseAllocator.DEBUG_LOG_LENGTH, "ArrowBuf[%d]", id) : null; | ||
| private volatile int length; | ||
|
|
||
| /** | ||
|
|
@@ -1204,4 +1204,51 @@ public ArrowBuf reallocIfNeeded(final int size) { | |
| "Realloc is only available in the context of operator's UDFs"); | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Following are wrapper methods to keep this backward compatible. | ||
| */ | ||
| @Deprecated | ||
| public void release() { | ||
| referenceManager.release(); | ||
| } | ||
|
|
||
| @Deprecated | ||
| public void release(int decrement) { | ||
| referenceManager.release(decrement); | ||
| } | ||
|
|
||
| @Deprecated | ||
| public void retain() { | ||
| referenceManager.retain(); | ||
| } | ||
|
|
||
| @Deprecated | ||
| public void retain(int increment) { | ||
| referenceManager.retain(increment); | ||
| } | ||
|
|
||
| @Deprecated | ||
| public ArrowBuf clear() { | ||
| this.readerIndex = this.writerIndex = 0; | ||
|
||
| return this; | ||
| } | ||
|
|
||
| /** | ||
| * Initialize the reader and writer index. | ||
| * @param readerIndex index to read from | ||
| * @param writerIndex index to write to | ||
| * @return this | ||
| */ | ||
| @Deprecated | ||
| public ArrowBuf setIndex(int readerIndex, int writerIndex) { | ||
| if (readerIndex >= 0 && readerIndex <= writerIndex && writerIndex <= this.capacity()) { | ||
| this.readerIndex = readerIndex; | ||
| this.writerIndex = writerIndex; | ||
| return this; | ||
| } else { | ||
| throw new IndexOutOfBoundsException(String.format("readerIndex: %d, writerIndex: %d " + | ||
| "(expected:0 <= readerIndex <= writerIndex <= capacity(%d))", readerIndex, writerIndex, this.capacity())); | ||
| } | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we mark these as "@deprecated", so clients know they should moving off of them?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why deprecate ? It's a useful convenience fn, so also retain.