forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hybrid Java buffer release: Support both manual and auto release at t…
…he same time (apache#34) * Revert "Add AutoBufferLedger (apache#31)" This reverts commit e48da37. * Commit 1 * Commit 2 * Fix config builder visibility in Scala * Commit 2 Fixup * Commit 3 * Commit 3 Fixup
- Loading branch information
1 parent
a11e628
commit 609f033
Showing
42 changed files
with
2,228 additions
and
1,673 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
java/dataset/src/main/java/org/apache/arrow/dataset/jni/NativeUnderlyingMemory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.arrow.dataset.jni; | ||
|
||
import org.apache.arrow.memory.*; | ||
|
||
/** | ||
* MemoryChunkManager implementation for native allocated memory. | ||
*/ | ||
public class NativeUnderlyingMemory implements MemoryChunk { | ||
|
||
private final int size; | ||
private final long nativeInstanceId; | ||
private final long address; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param size Size of underlying memory (in bytes) | ||
* @param nativeInstanceId ID of the native instance | ||
* @param address Address of underlying memory | ||
*/ | ||
NativeUnderlyingMemory(int size, long nativeInstanceId, long address) { | ||
this.size = size; | ||
this.nativeInstanceId = nativeInstanceId; | ||
this.address = address; | ||
} | ||
|
||
@Override | ||
public long size() { | ||
return size; | ||
} | ||
|
||
@Override | ||
public long memoryAddress() { | ||
return address; | ||
} | ||
|
||
@Override | ||
public void destroy() { | ||
JniWrapper.get().releaseBuffer(nativeInstanceId); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 0 additions & 81 deletions
81
java/dataset/src/main/java/org/apache/arrow/memory/NativeUnderlyingMemory.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.