You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by "leerho (via GitHub)" <gi...@apache.org> on 2024/12/06 23:47:33 UTC

[PR] Frank grimes java 21 ffm [datasketches-memory]

leerho opened a new pull request, #242:
URL: https://github.com/apache/datasketches-memory/pull/242

   Upgrade much of the API that was based on Java 17 to use new Java 21 FFM API, which is in "preview" mode.
   
   Also was able to remove some duplicated code.
   
   Updated POM, as well as the GH Actions workflows.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


Re: [PR] Frank grimes java 21 ffm [datasketches-memory]

Posted by "leerho (via GitHub)" <gi...@apache.org>.
leerho commented on code in PR #242:
URL: https://github.com/apache/datasketches-memory/pull/242#discussion_r1876780722


##########
README.md:
##########
@@ -66,10 +66,12 @@ Note: *primitive* := *{byte, short, int, long, float, double}*
     * *Memory.map(File)*  (read only)
     * *WritableMemory.writableMap(File)*
 
-## Release 4.0.0 (inclusive) to 5.0.0 (exclusive)
-Starting with release *datasketches-memory-4.0.0*, this Memory component supports only Java 17 when compiling from source and should work with later Java versions at runtime.
+## Release 5.0.0 (inclusive) to 6.0.0 (exclusive)
+Starting with release *datasketches-memory-5.0.0*, this Memory component supports only Java 21 when compiling from source and should work with later Java versions at runtime.
 
-### *NOTE: The DataSketches Java Memory Component is not thread-safe.*
+### *NOTES:* 
+* The DataSketches Java Memory Component is not thread-safe.
+* I recommend Eclipse Adoptium/Temurin 21.0.5+11 or later as earlier releases of 21 have bugs that affect this product.

Review Comment:
   Fixed.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


Re: [PR] Frank grimes java 21 ffm [datasketches-memory]

Posted by "AlexanderSaydakov (via GitHub)" <gi...@apache.org>.
AlexanderSaydakov commented on code in PR #242:
URL: https://github.com/apache/datasketches-memory/pull/242#discussion_r1876493792


##########
README.md:
##########
@@ -66,10 +66,12 @@ Note: *primitive* := *{byte, short, int, long, float, double}*
     * *Memory.map(File)*  (read only)
     * *WritableMemory.writableMap(File)*
 
-## Release 4.0.0 (inclusive) to 5.0.0 (exclusive)
-Starting with release *datasketches-memory-4.0.0*, this Memory component supports only Java 17 when compiling from source and should work with later Java versions at runtime.
+## Release 5.0.0 (inclusive) to 6.0.0 (exclusive)
+Starting with release *datasketches-memory-5.0.0*, this Memory component supports only Java 21 when compiling from source and should work with later Java versions at runtime.
 
-### *NOTE: The DataSketches Java Memory Component is not thread-safe.*
+### *NOTES:* 
+* The DataSketches Java Memory Component is not thread-safe.
+* I recommend Eclipse Adoptium/Temurin 21.0.5+11 or later as earlier releases of 21 have bugs that affect this product.

Review Comment:
   first person recommendation looks strange



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


Re: [PR] Frank grimes java 21 ffm [datasketches-memory]

Posted by "AlexanderSaydakov (via GitHub)" <gi...@apache.org>.
AlexanderSaydakov commented on code in PR #242:
URL: https://github.com/apache/datasketches-memory/pull/242#discussion_r1876516316


##########
src/test/java/org/apache/datasketches/memory/internal/BufferTest.java:
##########
@@ -60,56 +59,56 @@ public void checkDirectRoundTrip() throws Exception {
   public void checkAutoHeapRoundTrip() {
     int n = 1024; //longs
     WritableBuffer wbuf = WritableMemory.allocate(n * 8).asWritableBuffer();
-    for (int i = 0; i < n; i++) {
-      wbuf.putLong(i);
-    }
-    wbuf.resetPosition();
-    for (int i = 0; i < n; i++) {
-      long v = wbuf.getLong();
-      assertEquals(v, i);
+      for (int i = 0; i < n; i++) {
+        wbuf.putLong(i);
+      }
+      wbuf.resetPosition();
+      for (int i = 0; i < n; i++) {
+        long v = wbuf.getLong();
+        assertEquals(v, i);
+      }
     }
-  }
 
   @Test
   public void checkArrayWrap() {
     int n = 1024; //longs
     byte[] arr = new byte[n * 8];
     WritableBuffer wbuf = WritableMemory.writableWrap(arr).asWritableBuffer();
-    for (int i = 0; i < n; i++) {
-      wbuf.putLong(i);
-    }
-    wbuf.resetPosition();
-    for (int i = 0; i < n; i++) {
-      long v = wbuf.getLong();
-      assertEquals(v, i);
-    }
+      for (int i = 0; i < n; i++) {

Review Comment:
   what happened to alignment here and below? tabs used?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


Re: [PR] Frank grimes java 21 ffm [datasketches-memory]

Posted by "leerho (via GitHub)" <gi...@apache.org>.
leerho commented on code in PR #242:
URL: https://github.com/apache/datasketches-memory/pull/242#discussion_r1876822405


##########
src/test/java/org/apache/datasketches/memory/internal/BufferTest.java:
##########
@@ -234,14 +233,14 @@ public void checkPutGetArraysHeap() {
     for (int i = 0; i < n; i++) { arr[i] = i; }
 
     WritableBuffer wbuf = WritableMemory.allocate(n * 8).asWritableBuffer();
-    wbuf.putLongArray(arr, 0, n);
-    long[] arr2 = new long[n];
-    wbuf.resetPosition();
-    wbuf.getLongArray(arr2, 0, n);
-    for (int i = 0; i < n; i++) {
-      assertEquals(arr2[i], i);
+      wbuf.putLongArray(arr, 0, n);

Review Comment:
   This occurred in a bunch of files.  I went through all of them and I think it is OK now.   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


Re: [PR] Frank grimes java 21 ffm [datasketches-memory]

Posted by "leerho (via GitHub)" <gi...@apache.org>.
leerho commented on code in PR #242:
URL: https://github.com/apache/datasketches-memory/pull/242#discussion_r1876783669


##########
src/test/java/org/apache/datasketches/memory/internal/BufferTest.java:
##########
@@ -60,56 +59,56 @@ public void checkDirectRoundTrip() throws Exception {
   public void checkAutoHeapRoundTrip() {
     int n = 1024; //longs
     WritableBuffer wbuf = WritableMemory.allocate(n * 8).asWritableBuffer();
-    for (int i = 0; i < n; i++) {
-      wbuf.putLong(i);
-    }
-    wbuf.resetPosition();
-    for (int i = 0; i < n; i++) {
-      long v = wbuf.getLong();
-      assertEquals(v, i);
+      for (int i = 0; i < n; i++) {
+        wbuf.putLong(i);
+      }
+      wbuf.resetPosition();
+      for (int i = 0; i < n; i++) {
+        long v = wbuf.getLong();
+        assertEquals(v, i);
+      }
     }
-  }
 
   @Test
   public void checkArrayWrap() {
     int n = 1024; //longs
     byte[] arr = new byte[n * 8];
     WritableBuffer wbuf = WritableMemory.writableWrap(arr).asWritableBuffer();
-    for (int i = 0; i < n; i++) {
-      wbuf.putLong(i);
-    }
-    wbuf.resetPosition();
-    for (int i = 0; i < n; i++) {
-      long v = wbuf.getLong();
-      assertEquals(v, i);
-    }
+      for (int i = 0; i < n; i++) {

Review Comment:
   Wow! this is weird. No tabs used.  Not sure how this happened.  We have had two folks editing these files recently, perhaps they used a different indention scheme.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


Re: [PR] Frank grimes java 21 ffm [datasketches-memory]

Posted by "AlexanderSaydakov (via GitHub)" <gi...@apache.org>.
AlexanderSaydakov commented on code in PR #242:
URL: https://github.com/apache/datasketches-memory/pull/242#discussion_r1876519356


##########
src/test/java/org/apache/datasketches/memory/internal/BufferTest.java:
##########
@@ -234,14 +233,14 @@ public void checkPutGetArraysHeap() {
     for (int i = 0; i < n; i++) { arr[i] = i; }
 
     WritableBuffer wbuf = WritableMemory.allocate(n * 8).asWritableBuffer();
-    wbuf.putLongArray(arr, 0, n);
-    long[] arr2 = new long[n];
-    wbuf.resetPosition();
-    wbuf.getLongArray(arr2, 0, n);
-    for (int i = 0; i < n; i++) {
-      assertEquals(arr2[i], i);
+      wbuf.putLongArray(arr, 0, n);

Review Comment:
   seems like some problem with alignment all over the place



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


Re: [PR] Frank grimes java 21 ffm [datasketches-memory]

Posted by "leerho (via GitHub)" <gi...@apache.org>.
leerho merged PR #242:
URL: https://github.com/apache/datasketches-memory/pull/242


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org