Skip to content

Commit 1e2c6ef

Browse files
authored
Add temp dir property for native library (#4533)
* feat: add temp dir property for native library * refactor: create new submodule native-library-common to merge NativeUtils * fix: remove guava from native-library-common
1 parent 0748423 commit 1e2c6ef

File tree

18 files changed

+151
-204
lines changed

18 files changed

+151
-204
lines changed

circe-checksum/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
</properties>
4040

4141
<dependencies>
42+
<dependency>
43+
<groupId>org.apache.bookkeeper</groupId>
44+
<artifactId>native-library-common</artifactId>
45+
<version>${project.parent.version}</version>
46+
</dependency>
4247

4348
<dependency>
4449
<groupId>com.google.guava</groupId>

circe-checksum/src/main/java/com/scurrilous/circe/crc/Sse42Crc32C.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
******************************************************************************/
1616
package com.scurrilous.circe.crc;
1717

18-
import static com.scurrilous.circe.utils.NativeUtils.loadLibraryFromJar;
19-
import static com.scurrilous.circe.utils.NativeUtils.libType;
18+
import static org.apache.bookkeeper.common.util.nativelib.NativeUtils.libType;
19+
import static org.apache.bookkeeper.common.util.nativelib.NativeUtils.loadLibraryFromJar;
2020

2121
import java.nio.ByteBuffer;
2222
import com.scurrilous.circe.IncrementalIntHash;

cpu-affinity/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@
3333
</properties>
3434

3535
<dependencies>
36+
<dependency>
37+
<groupId>org.apache.bookkeeper</groupId>
38+
<artifactId>native-library-common</artifactId>
39+
<version>${project.parent.version}</version>
40+
</dependency>
3641
<dependency>
3742
<groupId>com.google.guava</groupId>
3843
<artifactId>guava</artifactId>

cpu-affinity/src/main/java/org/apache/bookkeeper/common/util/affinity/impl/CpuAffinityImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
import java.util.TreeSet;
3535
import lombok.experimental.UtilityClass;
3636
import lombok.extern.slf4j.Slf4j;
37+
import org.apache.bookkeeper.common.util.nativelib.NativeUtils;
3738

3839
/**
3940
* Implementation of CPU Affinity functionality.

cpu-affinity/src/main/java/org/apache/bookkeeper/common/util/affinity/impl/NativeUtils.java

Lines changed: 0 additions & 90 deletions
This file was deleted.

native-io/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,11 @@
3434
</properties>
3535

3636
<dependencies>
37+
<dependency>
38+
<groupId>org.apache.bookkeeper</groupId>
39+
<artifactId>native-library-common</artifactId>
40+
<version>${project.parent.version}</version>
41+
</dependency>
3742
<dependency>
3843
<groupId>org.apache.commons</groupId>
3944
<artifactId>commons-lang3</artifactId>

native-io/src/main/java/org/apache/bookkeeper/common/util/nativeio/NativeIOJni.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
*/
2121
package org.apache.bookkeeper.common.util.nativeio;
2222

23+
import org.apache.bookkeeper.common.util.nativelib.NativeUtils;
2324
import org.apache.commons.lang3.SystemUtils;
2425

2526
class NativeIOJni {

native-io/src/main/java/org/apache/bookkeeper/common/util/nativeio/NativeUtils.java

Lines changed: 0 additions & 85 deletions
This file was deleted.

native-io/src/main/java/org/apache/bookkeeper/common/util/nativeio/package-info.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@
1717
*/
1818

1919
/**
20-
* Utiltiies to access I/O using JNI.
20+
* Utilities to access I/O using JNI.
2121
*/
2222
package org.apache.bookkeeper.common.util.nativeio;

native-library-common/pom.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<!--
2+
Licensed to the Apache Software Foundation (ASF) under one or more
3+
contributor license agreements. See the NOTICE file distributed with
4+
this work for additional information regarding copyright ownership.
5+
The ASF licenses this file to You under the Apache License, Version 2.0
6+
(the "License"); you may not use this file except in compliance with
7+
the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
18+
<modelVersion>4.0.0</modelVersion>
19+
<parent>
20+
<groupId>org.apache.bookkeeper</groupId>
21+
<artifactId>bookkeeper</artifactId>
22+
<version>4.18.0-SNAPSHOT</version>
23+
<relativePath>..</relativePath>
24+
</parent>
25+
26+
<artifactId>native-library-common</artifactId>
27+
<name>Apache BookKeeper :: Common for Native Libraries</name>
28+
<description>Common for Native Libraries</description>
29+
30+
<build>
31+
<plugins>
32+
<plugin>
33+
<groupId>com.github.spotbugs</groupId>
34+
<artifactId>spotbugs-maven-plugin</artifactId>
35+
</plugin>
36+
<plugin>
37+
<groupId>org.apache.maven.plugins</groupId>
38+
<artifactId>maven-compiler-plugin</artifactId>
39+
</plugin>
40+
<plugin>
41+
<groupId>org.apache.maven.plugins</groupId>
42+
<artifactId>maven-surefire-plugin</artifactId>
43+
</plugin>
44+
</plugins>
45+
</build>
46+
</project>

0 commit comments

Comments
 (0)