You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by dc...@apache.org on 2021/06/17 16:24:33 UTC

[datasketches-memory] branch support-newer-java-versions updated: Remove slf4j dependency

This is an automated email from the ASF dual-hosted git repository.

dcromberge pushed a commit to branch support-newer-java-versions
in repository https://gitbox.apache.org/repos/asf/datasketches-memory.git


The following commit(s) were added to refs/heads/support-newer-java-versions by this push:
     new facb373  Remove slf4j dependency
facb373 is described below

commit facb373da0e4869f3df12e127e557fd319424c58
Author: David Cromberge <dc...@apache.org>
AuthorDate: Thu Jun 17 17:24:20 2021 +0100

    Remove slf4j dependency
---
 README.md                                                  |  5 +----
 .../datasketches/memory/internal/AllocateDirect.java       |  7 +++----
 .../datasketches/memory/internal/AllocateDirectMap.java    |  8 +++-----
 pom.xml                                                    | 14 --------------
 4 files changed, 7 insertions(+), 27 deletions(-)

diff --git a/README.md b/README.md
index d8a0b54..63472b0 100644
--- a/README.md
+++ b/README.md
@@ -120,10 +120,7 @@ For example, to run normal unit tests:
 
 ### Dependencies
 
-#### Run-time
-There is one run-time dependency: 
-
-* org.slf4j:slf4j-api
+There are no run-time dependencies.
 
 #### Testing
 See the pom.xml file for test dependencies.
diff --git a/datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/AllocateDirect.java b/datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/AllocateDirect.java
index d076b05..ad40d0d 100644
--- a/datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/AllocateDirect.java
+++ b/datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/AllocateDirect.java
@@ -21,8 +21,7 @@ package org.apache.datasketches.memory.internal;
 
 import static org.apache.datasketches.memory.internal.UnsafeUtil.unsafe;
 
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.logging.Logger;
 
 import sun.misc.Cleaner; //JDK9+ moved to jdk.internal.ref.Cleaner;
 
@@ -34,7 +33,7 @@ import sun.misc.Cleaner; //JDK9+ moved to jdk.internal.ref.Cleaner;
  */
 @SuppressWarnings({"restriction","synthetic-access"})
 final class AllocateDirect {
-  private static final Logger LOG = LoggerFactory.getLogger(AllocateDirect.class);
+  private static final Logger LOG = Logger.getLogger(AllocateDirect.class.getCanonicalName());
 
   private final Deallocator deallocator;
   private final long nativeBaseOffset;
@@ -123,7 +122,7 @@ final class AllocateDirect {
       if (valid.change()) {
         if (calledFromCleaner) {
           // Warn about non-deterministic resource cleanup.
-          LOG.warn("A WritableHandle was not closed manually");
+          LOG.warning("A WritableHandle was not closed manually");
         }
         unsafe.freeMemory(nativeAddress);
         NioBits.unreserveMemory(allocationSize, capacity);
diff --git a/datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/AllocateDirectMap.java b/datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/AllocateDirectMap.java
index cce5a90..cc69672 100644
--- a/datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/AllocateDirectMap.java
+++ b/datasketches-memory-java8/src/main/java/org/apache/datasketches/memory/internal/AllocateDirectMap.java
@@ -29,13 +29,11 @@ import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 import java.nio.MappedByteBuffer;
 import java.nio.channels.FileChannel;
+import java.util.logging.Logger;
 
 import org.apache.datasketches.memory.Map;
 import org.apache.datasketches.memory.MemoryCloseException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
-import sun.misc.Cleaner; //JDK9+ moved to jdk.internal.ref.Cleaner;
 import sun.nio.ch.FileChannelImpl;
 
 /**
@@ -56,7 +54,7 @@ import sun.nio.ch.FileChannelImpl;
  */
 @SuppressWarnings({"restriction","synthetic-access"})
 class AllocateDirectMap implements Map {
-  private static final Logger LOG = LoggerFactory.getLogger(AllocateDirectMap.class);
+  private static final Logger LOG = Logger.getLogger(AllocateDirectMap.class.getCanonicalName());
 
   private static final int MAP_RO = 0;
   private static final int MAP_RW = 1;
@@ -287,7 +285,7 @@ class AllocateDirectMap implements Map {
       if (valid.change()) {
         if (calledFromCleaner) {
           // Warn about non-deterministic resource cleanup.
-          LOG.warn("A WritableMapHandleImpl was not closed manually");
+          LOG.warning("A WritableMapHandleImpl was not closed manually");
         }
         try {
           unmap();
diff --git a/pom.xml b/pom.xml
index 6eca961..885803a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -84,8 +84,6 @@ under the License.
 
   <properties>
     <!-- UNIQUE FOR THIS JAVA COMPONENT -->
-    <slf4j-api.version>1.7.30</slf4j-api.version>
-    <slf4j-simple.version>1.7.30</slf4j-simple.version>
     <protobuf-java.version>3.6.0</protobuf-java.version>
     <!-- Used for UTF8 testing -->
     <zero-allocation-hashing.version>0.8</zero-allocation-hashing.version>
@@ -165,20 +163,8 @@ under the License.
   </repositories>
 
   <dependencies>
-    <!-- UNIQUE FOR THIS JAVA COMPONENT -->
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-api</artifactId>
-      <version>${slf4j-api.version}</version>
-    </dependency>
     <!-- Test Scope -->
     <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-simple</artifactId>
-      <version>${slf4j-simple.version}</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
       <!-- Used for UTF8 testing -->
       <groupId>com.google.protobuf</groupId>
       <artifactId>protobuf-java</artifactId>

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