You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by le...@apache.org on 2022/06/04 22:05:21 UTC
[datasketches-memory17] branch main updated: Removed 16 classes
This is an automated email from the ASF dual-hosted git repository.
leerho pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datasketches-memory17.git
The following commit(s) were added to refs/heads/main by this push:
new 5beb725 Removed 16 classes
5beb725 is described below
commit 5beb72596a640302c4eedfae82b5097132407da7
Author: Lee Rhodes <le...@users.noreply.github.com>
AuthorDate: Sat Jun 4 15:05:16 2022 -0700
Removed 16 classes
---
.../internal/BBNonNativeWritableBufferImpl.java | 40 -----------------
.../internal/BBNonNativeWritableMemoryImpl.java | 40 -----------------
.../memory/internal/BBWritableBufferImpl.java | 40 -----------------
.../memory/internal/BBWritableMemoryImpl.java | 40 -----------------
.../memory/internal/BaseWritableBufferImpl.java | 52 +++++++++++-----------
.../memory/internal/BaseWritableMemoryImpl.java | 48 ++++++++++----------
.../DirectNonNativeWritableBufferImpl.java | 43 ------------------
.../DirectNonNativeWritableMemoryImpl.java | 43 ------------------
.../memory/internal/DirectWritableBufferImpl.java | 43 ------------------
.../memory/internal/DirectWritableMemoryImpl.java | 43 ------------------
.../internal/HeapNonNativeWritableBufferImpl.java | 43 ------------------
.../internal/HeapNonNativeWritableMemoryImpl.java | 43 ------------------
.../memory/internal/HeapWritableBufferImpl.java | 43 ------------------
.../memory/internal/HeapWritableMemoryImpl.java | 43 ------------------
.../internal/MapNonNativeWritableBufferImpl.java | 40 -----------------
.../internal/MapNonNativeWritableMemoryImpl.java | 40 -----------------
.../memory/internal/MapWritableBufferImpl.java | 40 -----------------
.../memory/internal/MapWritableMemoryImpl.java | 40 -----------------
.../memory/internal/NativeWritableBufferImpl.java | 19 +++++++-
.../memory/internal/NativeWritableMemoryImpl.java | 18 +++++++-
.../internal/NonNativeWritableBufferImpl.java | 18 +++++++-
.../internal/NonNativeWritableMemoryImpl.java | 18 +++++++-
22 files changed, 119 insertions(+), 718 deletions(-)
diff --git a/src/main/java/org/apache/datasketches/memory/internal/BBNonNativeWritableBufferImpl.java b/src/main/java/org/apache/datasketches/memory/internal/BBNonNativeWritableBufferImpl.java
deleted file mode 100644
index 222168b..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/BBNonNativeWritableBufferImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.WritableBuffer;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableBuffer} for ByteBuffer, non-native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class BBNonNativeWritableBufferImpl extends NonNativeWritableBufferImpl {
-
- BBNonNativeWritableBufferImpl(
- final MemorySegment seg,
- final int typeId) {
- super(seg, typeId);
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/BBNonNativeWritableMemoryImpl.java b/src/main/java/org/apache/datasketches/memory/internal/BBNonNativeWritableMemoryImpl.java
deleted file mode 100644
index a796553..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/BBNonNativeWritableMemoryImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.WritableMemory;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableMemory} for ByteBuffer, non-native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class BBNonNativeWritableMemoryImpl extends NonNativeWritableMemoryImpl {
-
- BBNonNativeWritableMemoryImpl(
- final MemorySegment seg,
- final int typeId) {
- super(seg, typeId);
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/BBWritableBufferImpl.java b/src/main/java/org/apache/datasketches/memory/internal/BBWritableBufferImpl.java
deleted file mode 100644
index bf83a41..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/BBWritableBufferImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.WritableBuffer;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableBuffer} for ByteBuffer, native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class BBWritableBufferImpl extends NativeWritableBufferImpl {
-
- BBWritableBufferImpl(
- final MemorySegment seg,
- final int typeId) {
- super(seg, typeId);
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/BBWritableMemoryImpl.java b/src/main/java/org/apache/datasketches/memory/internal/BBWritableMemoryImpl.java
deleted file mode 100644
index 95e9a49..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/BBWritableMemoryImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.WritableMemory;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableMemory} for ByteBuffer, native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class BBWritableMemoryImpl extends NativeWritableMemoryImpl {
-
- BBWritableMemoryImpl(
- final MemorySegment seg,
- final int typeId) {
- super(seg, typeId);
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/BaseWritableBufferImpl.java b/src/main/java/org/apache/datasketches/memory/internal/BaseWritableBufferImpl.java
index 352bd85..254255e 100644
--- a/src/main/java/org/apache/datasketches/memory/internal/BaseWritableBufferImpl.java
+++ b/src/main/java/org/apache/datasketches/memory/internal/BaseWritableBufferImpl.java
@@ -76,12 +76,12 @@ public abstract class BaseWritableBufferImpl extends BaseBufferImpl implements W
| (seg.isMapped() ? MAP : 0);
if (byteOrder == ByteOrder.nativeOrder()) {
type |= NATIVE;
- final WritableBuffer wbuf = new BBWritableBufferImpl(seg, type);
+ final WritableBuffer wbuf = NativeWritableBufferImpl.notMemoryExtendable(seg, type);
wbuf.setStartPositionEnd(0, byteBuffer.position(), byteBuffer.limit());
return wbuf;
}
type |= NONNATIVE;
- final WritableBuffer wbuf = new BBNonNativeWritableBufferImpl(seg, type);
+ final WritableBuffer wbuf = NonNativeWritableBufferImpl.notMemoryExtendable(seg, type);
wbuf.setStartPositionEnd(0, byteBuffer.position(), byteBuffer.limit());
return wbuf;
}
@@ -128,20 +128,20 @@ public abstract class BaseWritableBufferImpl extends BaseBufferImpl implements W
| (nativeBOType ? NATIVE : NONNATIVE)
| (byteBufferType ? BYTEBUF : 0);
if (byteBufferType) {
- if (nativeBOType) { return new BBWritableBufferImpl(slice, type); }
- return new BBNonNativeWritableBufferImpl(slice, type);
+ if (nativeBOType) { return NativeWritableBufferImpl.notMemoryExtendable(slice, type); }
+ return NonNativeWritableBufferImpl.notMemoryExtendable(slice, type);
}
if (mapType) {
- if (nativeBOType) { return new MapWritableBufferImpl(slice, type); }
- return new MapNonNativeWritableBufferImpl(slice, type);
+ if (nativeBOType) { return NativeWritableBufferImpl.notMemoryExtendable(slice, type); }
+ return NonNativeWritableBufferImpl.notMemoryExtendable(slice, type);
}
if (directType) {
- if (nativeBOType) { return new DirectWritableBufferImpl(slice, type, memReqSvr); }
- return new DirectNonNativeWritableBufferImpl(slice, type, memReqSvr);
+ if (nativeBOType) { return NativeWritableBufferImpl.memoryExtendable(slice, type, memReqSvr); }
+ return NonNativeWritableBufferImpl.memoryExtendable(slice, type, memReqSvr);
}
//else heap type
- if (nativeBOType) { return new HeapWritableBufferImpl(slice, type, memReqSvr); }
- return new HeapNonNativeWritableBufferImpl(slice, type, memReqSvr);
+ if (nativeBOType) { return NativeWritableBufferImpl.memoryExtendable(slice, type, memReqSvr); }
+ return NonNativeWritableBufferImpl.memoryExtendable(slice, type, memReqSvr);
}
//DUPLICATES
@@ -192,20 +192,20 @@ public abstract class BaseWritableBufferImpl extends BaseBufferImpl implements W
WritableBuffer wbuf;
if (byteBufferType) {
- if (nativeBOType) { wbuf = new BBWritableBufferImpl(seg2, type); }
- else { wbuf = new BBNonNativeWritableBufferImpl(seg2, type); }
+ if (nativeBOType) { wbuf = NativeWritableBufferImpl.notMemoryExtendable(seg2, type); }
+ else { wbuf = NonNativeWritableBufferImpl.notMemoryExtendable(seg2, type); }
}
if (mapType) {
- if (nativeBOType) { wbuf = new MapWritableBufferImpl(seg2, type); }
- else { wbuf = new MapNonNativeWritableBufferImpl(seg2, type); }
+ if (nativeBOType) { wbuf = NativeWritableBufferImpl.notMemoryExtendable(seg2, type); }
+ else { wbuf = NonNativeWritableBufferImpl.notMemoryExtendable(seg2, type); }
}
if (directType) {
- if (nativeBOType) { wbuf = new DirectWritableBufferImpl(seg2, type, memReqSvr); }
- else { wbuf = new DirectNonNativeWritableBufferImpl(seg2, type, memReqSvr); }
+ if (nativeBOType) { wbuf = NativeWritableBufferImpl.memoryExtendable(seg2, type, memReqSvr); }
+ else { wbuf = NonNativeWritableBufferImpl.memoryExtendable(seg2, type, memReqSvr); }
}
//else heap type
- if (nativeBOType) { wbuf = new HeapWritableBufferImpl(seg2, type, memReqSvr); }
- else { wbuf = new HeapNonNativeWritableBufferImpl(seg2, type, memReqSvr); }
+ if (nativeBOType) { wbuf = NativeWritableBufferImpl.memoryExtendable(seg2, type, memReqSvr); }
+ else { wbuf = NonNativeWritableBufferImpl.memoryExtendable(seg2, type, memReqSvr); }
wbuf.setStartPositionEnd(getStart(), getPosition(), getEnd());
return wbuf;
}
@@ -247,20 +247,20 @@ public abstract class BaseWritableBufferImpl extends BaseBufferImpl implements W
| (byteBufferType ? BYTEBUF : 0);
WritableMemory wmem;
if (byteBufferType) {
- if (nativeBOType) { wmem = new BBWritableMemoryImpl(seg2, type); }
- else { wmem = new BBNonNativeWritableMemoryImpl(seg2, type); }
+ if (nativeBOType) { wmem = NativeWritableMemoryImpl.notMemoryExtendable(seg2, type); }
+ else { wmem = NonNativeWritableMemoryImpl.notMemoryExtendable(seg2, type); }
}
if (mapType) {
- if (nativeBOType) { wmem = new MapWritableMemoryImpl(seg2, type); }
- else { wmem = new MapNonNativeWritableMemoryImpl(seg2, type); }
+ if (nativeBOType) { wmem = NativeWritableMemoryImpl.notMemoryExtendable(seg2, type); }
+ else { wmem = NonNativeWritableMemoryImpl.notMemoryExtendable(seg2, type); }
}
if (directType) {
- if (nativeBOType) { wmem = new DirectWritableMemoryImpl(seg2, type, memReqSvr); }
- else { wmem = new DirectNonNativeWritableMemoryImpl(seg2, type, memReqSvr); }
+ if (nativeBOType) { wmem = NativeWritableMemoryImpl.memoryExtendable(seg2, type, memReqSvr); }
+ else { wmem = NonNativeWritableMemoryImpl.memoryExtendable(seg2, type, memReqSvr); }
}
//else heap type
- if (nativeBOType) { wmem = new HeapWritableMemoryImpl(seg2, type, memReqSvr); }
- else { wmem = new HeapNonNativeWritableMemoryImpl(seg2, type, memReqSvr); }
+ if (nativeBOType) { wmem = NativeWritableMemoryImpl.memoryExtendable(seg2, type, memReqSvr); }
+ else { wmem = NonNativeWritableMemoryImpl.memoryExtendable(seg2, type, memReqSvr); }
return wmem;
}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/BaseWritableMemoryImpl.java b/src/main/java/org/apache/datasketches/memory/internal/BaseWritableMemoryImpl.java
index 74894f9..ed8c2a8 100644
--- a/src/main/java/org/apache/datasketches/memory/internal/BaseWritableMemoryImpl.java
+++ b/src/main/java/org/apache/datasketches/memory/internal/BaseWritableMemoryImpl.java
@@ -76,10 +76,10 @@ public abstract class BaseWritableMemoryImpl extends BaseStateImpl implements Wr
| (seg.isReadOnly() ? READONLY : 0);
if (byteOrder == ByteOrder.nativeOrder()) {
type |= NATIVE;
- return new HeapWritableMemoryImpl(seg, type, memReqSvr);
+ return NativeWritableMemoryImpl.memoryExtendable(seg, type, memReqSvr);
}
type |= NONNATIVE;
- return new HeapNonNativeWritableMemoryImpl(seg, type, memReqSvr);
+ return NonNativeWritableMemoryImpl.memoryExtendable(seg, type, memReqSvr);
}
//BYTE BUFFER RESOURCE
@@ -97,10 +97,10 @@ public abstract class BaseWritableMemoryImpl extends BaseStateImpl implements Wr
| (seg.isMapped() ? MAP : 0);
if (byteOrder == ByteOrder.nativeOrder()) {
type |= NATIVE;
- return new BBWritableMemoryImpl(seg, type);
+ return NativeWritableMemoryImpl.notMemoryExtendable(seg, type);
}
type |= NONNATIVE;
- return new BBNonNativeWritableMemoryImpl(seg, type);
+ return NonNativeWritableMemoryImpl.notMemoryExtendable(seg, type);
}
//MAP RESOURCE
@@ -141,8 +141,8 @@ public abstract class BaseWritableMemoryImpl extends BaseStateImpl implements Wr
| (localReadOnly ? READONLY : 0)
| (nativeBOType ? NATIVE : NONNATIVE);
return nativeBOType
- ? new MapWritableMemoryImpl(seg, type)
- : new MapNonNativeWritableMemoryImpl(seg, type);
+ ? NativeWritableMemoryImpl.notMemoryExtendable(seg, type)
+ : NonNativeWritableMemoryImpl.notMemoryExtendable(seg, type);
}
//DIRECT RESOURCE
@@ -173,8 +173,8 @@ public abstract class BaseWritableMemoryImpl extends BaseStateImpl implements Wr
final int type = MEMORY | DIRECT
| (nativeBOType ? NATIVE : NONNATIVE);
return nativeBOType
- ? new DirectWritableMemoryImpl(seg, type, memReqSvr)
- : new DirectNonNativeWritableMemoryImpl(seg, type, memReqSvr);
+ ? NativeWritableMemoryImpl.memoryExtendable(seg, type, memReqSvr)
+ : NonNativeWritableMemoryImpl.memoryExtendable(seg, type, memReqSvr);
}
//REGION DERIVED
@@ -216,20 +216,20 @@ public abstract class BaseWritableMemoryImpl extends BaseStateImpl implements Wr
| (nativeBOType ? NATIVE : NONNATIVE)
| (byteBufferType ? BYTEBUF : 0);
if (byteBufferType) {
- if (nativeBOType) { return new BBWritableMemoryImpl(slice, type); }
- return new BBNonNativeWritableMemoryImpl(slice, type);
+ if (nativeBOType) { return NativeWritableMemoryImpl.notMemoryExtendable(slice, type); }
+ return NonNativeWritableMemoryImpl.notMemoryExtendable(slice, type);
}
if (mapType) {
- if (nativeBOType) { return new MapWritableMemoryImpl(slice, type); }
- return new MapNonNativeWritableMemoryImpl(slice, type);
+ if (nativeBOType) { return NativeWritableMemoryImpl.notMemoryExtendable(slice, type); }
+ return NonNativeWritableMemoryImpl.notMemoryExtendable(slice, type);
}
if (directType) {
- if (nativeBOType) { return new DirectWritableMemoryImpl(slice, type, memReqSvr); }
- return new DirectNonNativeWritableMemoryImpl(slice, type, memReqSvr);
+ if (nativeBOType) { return NativeWritableMemoryImpl.memoryExtendable(slice, type, memReqSvr); }
+ return NonNativeWritableMemoryImpl.memoryExtendable(slice, type, memReqSvr);
}
//else heap type
- if (nativeBOType) { return new HeapWritableMemoryImpl(slice, type, memReqSvr); }
- return new HeapNonNativeWritableMemoryImpl(slice, type, memReqSvr);
+ if (nativeBOType) { return NativeWritableMemoryImpl.memoryExtendable(slice, type, memReqSvr); }
+ return NonNativeWritableMemoryImpl.memoryExtendable(slice, type, memReqSvr);
}
//AS BUFFER DERIVED
@@ -269,20 +269,20 @@ public abstract class BaseWritableMemoryImpl extends BaseStateImpl implements Wr
| (byteBufferType ? BYTEBUF : 0);
WritableBuffer wbuf;
if (byteBufferType) {
- if (nativeBOType) { wbuf = new BBWritableBufferImpl(seg2, type); }
- else { wbuf = new BBNonNativeWritableBufferImpl(seg2, type); }
+ if (nativeBOType) { wbuf = NativeWritableBufferImpl.notMemoryExtendable(seg2, type); }
+ else { wbuf = NonNativeWritableBufferImpl.notMemoryExtendable(seg2, type); }
}
if (mapType) {
- if (nativeBOType) { wbuf = new MapWritableBufferImpl(seg2, type); }
- else { wbuf = new MapNonNativeWritableBufferImpl(seg2, type); }
+ if (nativeBOType) { wbuf = NativeWritableBufferImpl.notMemoryExtendable(seg2, type); }
+ else { wbuf = NonNativeWritableBufferImpl.notMemoryExtendable(seg2, type); }
}
if (directType) {
- if (nativeBOType) { wbuf = new DirectWritableBufferImpl(seg2, type, memReqSvr); }
- else { wbuf = new DirectNonNativeWritableBufferImpl(seg2, type, memReqSvr); }
+ if (nativeBOType) { wbuf = NativeWritableBufferImpl.memoryExtendable(seg2, type, memReqSvr); }
+ else { wbuf = NonNativeWritableBufferImpl.memoryExtendable(seg2, type, memReqSvr); }
}
//else heap type
- if (nativeBOType) { wbuf = new HeapWritableBufferImpl(seg2, type, memReqSvr); }
- else { wbuf = new HeapNonNativeWritableBufferImpl(seg2, type, memReqSvr); }
+ if (nativeBOType) { wbuf = NativeWritableBufferImpl.memoryExtendable(seg2, type, memReqSvr); }
+ else { wbuf = NonNativeWritableBufferImpl.memoryExtendable(seg2, type, memReqSvr); }
wbuf.setStartPositionEnd(0, 0, getCapacity());
return wbuf;
}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/DirectNonNativeWritableBufferImpl.java b/src/main/java/org/apache/datasketches/memory/internal/DirectNonNativeWritableBufferImpl.java
deleted file mode 100644
index ea2c5db..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/DirectNonNativeWritableBufferImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.MemoryRequestServer;
-import org.apache.datasketches.memory.WritableBuffer;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableBuffer} for direct memory, non-native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class DirectNonNativeWritableBufferImpl extends NonNativeWritableBufferImpl {
-
- DirectNonNativeWritableBufferImpl(
- final MemorySegment seg,
- final int typeId,
- final MemoryRequestServer memReqSvr) {
- super(seg, typeId);
- if (memReqSvr != null) { setMemoryRequestServer(memReqSvr); }
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/DirectNonNativeWritableMemoryImpl.java b/src/main/java/org/apache/datasketches/memory/internal/DirectNonNativeWritableMemoryImpl.java
deleted file mode 100644
index 470bc8f..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/DirectNonNativeWritableMemoryImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.MemoryRequestServer;
-import org.apache.datasketches.memory.WritableMemory;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableMemory} for direct memory, non-native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class DirectNonNativeWritableMemoryImpl extends NonNativeWritableMemoryImpl {
-
- DirectNonNativeWritableMemoryImpl(
- final MemorySegment seg,
- final int typeId,
- final MemoryRequestServer memReqSvr) {
- super(seg, typeId);
- if (memReqSvr != null) { setMemoryRequestServer(memReqSvr); }
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/DirectWritableBufferImpl.java b/src/main/java/org/apache/datasketches/memory/internal/DirectWritableBufferImpl.java
deleted file mode 100644
index 3b03b6c..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/DirectWritableBufferImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.MemoryRequestServer;
-import org.apache.datasketches.memory.WritableBuffer;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableBuffer} for direct memory, native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class DirectWritableBufferImpl extends NativeWritableBufferImpl {
-
- DirectWritableBufferImpl(
- final MemorySegment seg,
- final int typeId,
- final MemoryRequestServer memReqSvr) {
- super(seg, typeId);
- if (memReqSvr != null) { setMemoryRequestServer(memReqSvr); }
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/DirectWritableMemoryImpl.java b/src/main/java/org/apache/datasketches/memory/internal/DirectWritableMemoryImpl.java
deleted file mode 100644
index 0795c51..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/DirectWritableMemoryImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.MemoryRequestServer;
-import org.apache.datasketches.memory.WritableMemory;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableMemory} for direct memory, native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class DirectWritableMemoryImpl extends NativeWritableMemoryImpl {
-
- DirectWritableMemoryImpl(
- final MemorySegment seg,
- final int typeId,
- final MemoryRequestServer memReqSvr) {
- super(seg, typeId);
- if (memReqSvr != null) { setMemoryRequestServer(memReqSvr); }
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/HeapNonNativeWritableBufferImpl.java b/src/main/java/org/apache/datasketches/memory/internal/HeapNonNativeWritableBufferImpl.java
deleted file mode 100644
index be661c7..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/HeapNonNativeWritableBufferImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.MemoryRequestServer;
-import org.apache.datasketches.memory.WritableBuffer;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableBuffer} for heap-based, non-native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class HeapNonNativeWritableBufferImpl extends NonNativeWritableBufferImpl {
-
- HeapNonNativeWritableBufferImpl(
- final MemorySegment seg,
- final int typeId,
- final MemoryRequestServer memReqSvr) {
- super(seg, typeId);
- if (memReqSvr != null) { setMemoryRequestServer(memReqSvr); }
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/HeapNonNativeWritableMemoryImpl.java b/src/main/java/org/apache/datasketches/memory/internal/HeapNonNativeWritableMemoryImpl.java
deleted file mode 100644
index 4dc0766..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/HeapNonNativeWritableMemoryImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.MemoryRequestServer;
-import org.apache.datasketches.memory.WritableMemory;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableMemory} for heap-based, non-native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class HeapNonNativeWritableMemoryImpl extends NonNativeWritableMemoryImpl {
-
- HeapNonNativeWritableMemoryImpl(
- final MemorySegment seg,
- final int typeId,
- final MemoryRequestServer memReqSvr) {
- super(seg, typeId);
- if (memReqSvr != null) { setMemoryRequestServer(memReqSvr); }
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/HeapWritableBufferImpl.java b/src/main/java/org/apache/datasketches/memory/internal/HeapWritableBufferImpl.java
deleted file mode 100644
index e389389..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/HeapWritableBufferImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.MemoryRequestServer;
-import org.apache.datasketches.memory.WritableBuffer;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableBuffer} for heap-based, native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class HeapWritableBufferImpl extends NativeWritableBufferImpl {
-
- HeapWritableBufferImpl(
- final MemorySegment seg,
- final int typeId,
- final MemoryRequestServer memReqSvr) {
- super(seg, typeId);
- if (memReqSvr != null) { setMemoryRequestServer(memReqSvr); }
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/HeapWritableMemoryImpl.java b/src/main/java/org/apache/datasketches/memory/internal/HeapWritableMemoryImpl.java
deleted file mode 100644
index 1d75612..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/HeapWritableMemoryImpl.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.MemoryRequestServer;
-import org.apache.datasketches.memory.WritableMemory;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableMemory} for heap-based, native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class HeapWritableMemoryImpl extends NativeWritableMemoryImpl {
-
- HeapWritableMemoryImpl(
- final MemorySegment seg,
- final int typeId,
- final MemoryRequestServer memReqSvr) {
- super(seg, typeId);
- if (memReqSvr != null) { setMemoryRequestServer(memReqSvr); }
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/MapNonNativeWritableBufferImpl.java b/src/main/java/org/apache/datasketches/memory/internal/MapNonNativeWritableBufferImpl.java
deleted file mode 100644
index 94a8d1c..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/MapNonNativeWritableBufferImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.WritableBuffer;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableBuffer} for map memory, non-native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class MapNonNativeWritableBufferImpl extends NonNativeWritableBufferImpl {
-
- MapNonNativeWritableBufferImpl(
- final MemorySegment seg,
- final int typeId) {
- super(seg, typeId);
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/MapNonNativeWritableMemoryImpl.java b/src/main/java/org/apache/datasketches/memory/internal/MapNonNativeWritableMemoryImpl.java
deleted file mode 100644
index cab44fe..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/MapNonNativeWritableMemoryImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.WritableMemory;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableMemory} for map memory, non-native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class MapNonNativeWritableMemoryImpl extends NonNativeWritableMemoryImpl {
-
- MapNonNativeWritableMemoryImpl(
- final MemorySegment seg,
- final int typeId) {
- super(seg, typeId);
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/MapWritableBufferImpl.java b/src/main/java/org/apache/datasketches/memory/internal/MapWritableBufferImpl.java
deleted file mode 100644
index 376a29c..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/MapWritableBufferImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.WritableBuffer;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableBuffer} for map memory, native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class MapWritableBufferImpl extends NativeWritableBufferImpl {
-
- MapWritableBufferImpl(
- final MemorySegment seg,
- final int typeId) {
- super(seg, typeId);
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/MapWritableMemoryImpl.java b/src/main/java/org/apache/datasketches/memory/internal/MapWritableMemoryImpl.java
deleted file mode 100644
index fdd5baf..0000000
--- a/src/main/java/org/apache/datasketches/memory/internal/MapWritableMemoryImpl.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.datasketches.memory.internal;
-
-import org.apache.datasketches.memory.WritableMemory;
-
-import jdk.incubator.foreign.MemorySegment;
-
-/**
- * Implementation of {@link WritableMemory} for map memory, native byte order.
- *
- * @author Roman Leventov
- * @author Lee Rhodes
- */
-final class MapWritableMemoryImpl extends NativeWritableMemoryImpl {
-
- MapWritableMemoryImpl(
- final MemorySegment seg,
- final int typeId) {
- super(seg, typeId);
- }
-
-}
diff --git a/src/main/java/org/apache/datasketches/memory/internal/NativeWritableBufferImpl.java b/src/main/java/org/apache/datasketches/memory/internal/NativeWritableBufferImpl.java
index 8c0ab07..aed07c7 100644
--- a/src/main/java/org/apache/datasketches/memory/internal/NativeWritableBufferImpl.java
+++ b/src/main/java/org/apache/datasketches/memory/internal/NativeWritableBufferImpl.java
@@ -19,6 +19,7 @@
package org.apache.datasketches.memory.internal;
+import org.apache.datasketches.memory.MemoryRequestServer;
import org.apache.datasketches.memory.WritableBuffer;
import jdk.incubator.foreign.MemoryAccess;
@@ -43,7 +44,7 @@ import jdk.incubator.foreign.MemorySegment;
* @author Lee Rhodes
*/
@SuppressWarnings("restriction")
-abstract class NativeWritableBufferImpl extends BaseWritableBufferImpl {
+final class NativeWritableBufferImpl extends BaseWritableBufferImpl {
//Pass-through ctor
NativeWritableBufferImpl(
@@ -52,6 +53,22 @@ abstract class NativeWritableBufferImpl extends BaseWritableBufferImpl {
super(seg, typeId);
}
+ static NativeWritableBufferImpl memoryExtendable(
+ final MemorySegment seg,
+ final int typeId,
+ final MemoryRequestServer memReqSvr) {
+ final NativeWritableBufferImpl impl = new NativeWritableBufferImpl(seg, typeId);
+ if (memReqSvr != null) { impl.setMemoryRequestServer(memReqSvr); }
+ return impl;
+ }
+
+ static NativeWritableBufferImpl notMemoryExtendable(
+ final MemorySegment seg,
+ final int typeId) {
+ return new NativeWritableBufferImpl(seg, typeId);
+ }
+
+
//PRIMITIVE getX() and getXArray()
@Override
public char getChar() {
diff --git a/src/main/java/org/apache/datasketches/memory/internal/NativeWritableMemoryImpl.java b/src/main/java/org/apache/datasketches/memory/internal/NativeWritableMemoryImpl.java
index 9b25510..5f279a7 100644
--- a/src/main/java/org/apache/datasketches/memory/internal/NativeWritableMemoryImpl.java
+++ b/src/main/java/org/apache/datasketches/memory/internal/NativeWritableMemoryImpl.java
@@ -19,6 +19,7 @@
package org.apache.datasketches.memory.internal;
+import org.apache.datasketches.memory.MemoryRequestServer;
import org.apache.datasketches.memory.WritableMemory;
import jdk.incubator.foreign.MemoryAccess;
@@ -42,7 +43,7 @@ import jdk.incubator.foreign.MemorySegment;
* @author Lee Rhodes
*/
@SuppressWarnings("restriction")
-abstract class NativeWritableMemoryImpl extends BaseWritableMemoryImpl {
+final class NativeWritableMemoryImpl extends BaseWritableMemoryImpl {
//Pass-through ctor
NativeWritableMemoryImpl(
@@ -51,6 +52,21 @@ abstract class NativeWritableMemoryImpl extends BaseWritableMemoryImpl {
super(seg, typeId);
}
+ static NativeWritableMemoryImpl memoryExtendable(
+ final MemorySegment seg,
+ final int typeId,
+ final MemoryRequestServer memReqSvr) {
+ final NativeWritableMemoryImpl impl = new NativeWritableMemoryImpl(seg, typeId);
+ if (memReqSvr != null) { impl.setMemoryRequestServer(memReqSvr); }
+ return impl;
+ }
+
+ static NativeWritableMemoryImpl notMemoryExtendable(
+ final MemorySegment seg,
+ final int typeId) {
+ return new NativeWritableMemoryImpl(seg, typeId);
+ }
+
///PRIMITIVE getX() and getXArray()
@Override
public char getChar(final long offsetBytes) {
diff --git a/src/main/java/org/apache/datasketches/memory/internal/NonNativeWritableBufferImpl.java b/src/main/java/org/apache/datasketches/memory/internal/NonNativeWritableBufferImpl.java
index 39f9fb9..63b7862 100644
--- a/src/main/java/org/apache/datasketches/memory/internal/NonNativeWritableBufferImpl.java
+++ b/src/main/java/org/apache/datasketches/memory/internal/NonNativeWritableBufferImpl.java
@@ -19,6 +19,7 @@
package org.apache.datasketches.memory.internal;
+import org.apache.datasketches.memory.MemoryRequestServer;
import org.apache.datasketches.memory.WritableBuffer;
import jdk.incubator.foreign.MemoryAccess;
@@ -43,7 +44,7 @@ import jdk.incubator.foreign.MemorySegment;
* @author Lee Rhodes
*/
@SuppressWarnings("restriction")
-abstract class NonNativeWritableBufferImpl extends BaseWritableBufferImpl {
+final class NonNativeWritableBufferImpl extends BaseWritableBufferImpl {
//Pass-through ctor
NonNativeWritableBufferImpl(
@@ -52,6 +53,21 @@ abstract class NonNativeWritableBufferImpl extends BaseWritableBufferImpl {
super(seg, typeId);
}
+ static NonNativeWritableBufferImpl memoryExtendable(
+ final MemorySegment seg,
+ final int typeId,
+ final MemoryRequestServer memReqSvr) {
+ final NonNativeWritableBufferImpl impl = new NonNativeWritableBufferImpl(seg, typeId);
+ if (memReqSvr != null) { impl.setMemoryRequestServer(memReqSvr); }
+ return impl;
+ }
+
+ static NonNativeWritableBufferImpl notMemoryExtendable(
+ final MemorySegment seg,
+ final int typeId) {
+ return new NonNativeWritableBufferImpl(seg, typeId);
+ }
+
//PRIMITIVE getX() and getXArray()
@Override
public char getChar() {
diff --git a/src/main/java/org/apache/datasketches/memory/internal/NonNativeWritableMemoryImpl.java b/src/main/java/org/apache/datasketches/memory/internal/NonNativeWritableMemoryImpl.java
index 711903c..87393d1 100644
--- a/src/main/java/org/apache/datasketches/memory/internal/NonNativeWritableMemoryImpl.java
+++ b/src/main/java/org/apache/datasketches/memory/internal/NonNativeWritableMemoryImpl.java
@@ -19,6 +19,7 @@
package org.apache.datasketches.memory.internal;
+import org.apache.datasketches.memory.MemoryRequestServer;
import org.apache.datasketches.memory.WritableMemory;
import jdk.incubator.foreign.MemoryAccess;
@@ -42,7 +43,7 @@ import jdk.incubator.foreign.MemorySegment;
* @author Lee Rhodes
*/
@SuppressWarnings("restriction")
-abstract class NonNativeWritableMemoryImpl extends BaseWritableMemoryImpl {
+final class NonNativeWritableMemoryImpl extends BaseWritableMemoryImpl {
//Pass-through ctor
NonNativeWritableMemoryImpl(
@@ -51,6 +52,21 @@ abstract class NonNativeWritableMemoryImpl extends BaseWritableMemoryImpl {
super(seg, typeId);
}
+ static NonNativeWritableMemoryImpl memoryExtendable(
+ final MemorySegment seg,
+ final int typeId,
+ final MemoryRequestServer memReqSvr) {
+ final NonNativeWritableMemoryImpl impl = new NonNativeWritableMemoryImpl(seg, typeId);
+ if (memReqSvr != null) { impl.setMemoryRequestServer(memReqSvr); }
+ return impl;
+ }
+
+ static NonNativeWritableMemoryImpl notMemoryExtendable(
+ final MemorySegment seg,
+ final int typeId) {
+ return new NonNativeWritableMemoryImpl(seg, typeId);
+ }
+
///PRIMITIVE getX() and getXArray()
@Override
public char getChar(final long offsetBytes) {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org