Use pure-java Air-Compressor instead of JNI based libraries (#5390)

* Use pure-java Air-Compressor instead of JNI based libraries

* Fixed license files

* Fixed non-needed exclusion

* Added compat tests with JNI implementations

* Ensure direct buffer is used in the test

* Ensure direct bytebuf for both compression and decompression test

Co-authored-by: penghui <penghui@apache.org>
diff --git a/distribution/server/licenses/LICENSE-zstd-jni.txt b/distribution/server/licenses/LICENSE-zstd-jni.txt
deleted file mode 100644
index 7bdccb6..0000000
--- a/distribution/server/licenses/LICENSE-zstd-jni.txt
+++ /dev/null
@@ -1,26 +0,0 @@
-Zstd-jni: JNI bindings to Zstd Library
-
-Copyright (c) 2015-present, Luben Karavelov/ All rights reserved.
-
-BSD License
-
-Redistribution and use in source and binary forms, with or without modification,
-are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this
-  list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright notice, this
-  list of conditions and the following disclaimer in the documentation and/or
-  other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
-LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
-ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
-SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/distribution/server/src/assemble/LICENSE.bin.txt b/distribution/server/src/assemble/LICENSE.bin.txt
index 999ef8c..7d3fc14 100644
--- a/distribution/server/src/assemble/LICENSE.bin.txt
+++ b/distribution/server/src/assemble/LICENSE.bin.txt
@@ -408,7 +408,8 @@
     - org.apache.distributedlog-distributedlog-core-4.10.0.jar
     - org.apache.distributedlog-distributedlog-protocol-4.10.0.jar
     - org.apache.bookkeeper.stats-codahale-metrics-provider-4.10.0.jar
- * LZ4 -- org.lz4-lz4-java-1.5.0.jar
+ * AirCompressor
+    - io.airlift-aircompressor-0.16.jar
  * AsyncHttpClient
     - org.asynchttpclient-async-http-client-2.12.1.jar
     - org.asynchttpclient-async-http-client-netty-utils-2.12.1.jar
@@ -467,8 +468,6 @@
     - org.apache.yetus-audience-annotations-0.5.0.jar
   * @FreeBuilder
     - org.inferred-freebuilder-1.14.9.jar
-  * Snappy Java
-    - org.xerial.snappy-snappy-java-1.1.1.3.jar
   * Squareup
     - com.squareup.okhttp-logging-interceptor-2.7.5.jar
     - com.squareup.okhttp-okhttp-ws-2.7.5.jar
@@ -509,7 +508,6 @@
 
 BSD 2-Clause License
  * HdrHistogram -- org.hdrhistogram-HdrHistogram-2.1.9.jar -- licenses/LICENSE-HdrHistogram.txt
- * Zstandard JNI -- com.github.luben-zstd-jni-1.3.7-3.jar -- licenses/LICENSE-zstd-jni.txt
 
 MIT License
  * Java SemVer -- com.github.zafarkhaja-java-semver-0.9.0.jar -- licenses/LICENSE-SemVer.txt
diff --git a/distribution/server/src/assemble/NOTICE.bin.txt b/distribution/server/src/assemble/NOTICE.bin.txt
index c592cb3..f33454c 100644
--- a/distribution/server/src/assemble/NOTICE.bin.txt
+++ b/distribution/server/src/assemble/NOTICE.bin.txt
@@ -185,10 +185,6 @@
 granted provided that the copyright notice appears in all copies.
 
 ------------------------------------------------------------------------------------
-- org.xerial.snappy-snappy-java-1.1.1.3.jar
-
-This product includes software developed by Google
- Snappy: http://code.google.com/p/snappy/ (New BSD License)
 
 This product includes software developed by Apache
  PureJavaCrc32C from apache-hadoop-common http://hadoop.apache.org/