Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions hadoop-hdds/common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,6 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
<version>${io.grpc.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.uuid</groupId>
<artifactId>java-uuid-generator</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@

package org.apache.hadoop.util;

import com.fasterxml.uuid.Generators;

import java.security.SecureRandom;
import java.util.UUID;

/**
* Helper methods to deal with random UUIDs.
Expand All @@ -35,8 +32,15 @@ private UUIDUtil() {
private static final ThreadLocal<SecureRandom> GENERATOR =
ThreadLocal.withInitial(SecureRandom::new);

public static UUID randomUUID() {
return Generators.randomBasedGenerator(GENERATOR.get()).generate();
public static byte[] randomUUIDBytes() {
final byte[] bytes = new byte[16];
GENERATOR.get().nextBytes(bytes);
// See RFC 4122 section 4.4
bytes[6] &= 0x0f;
bytes[6] |= 0x40;
bytes[8] &= 0x3f;
bytes[8] |= 0x80;
return bytes;
}

}
1 change: 0 additions & 1 deletion hadoop-ozone/dist/src/main/license/bin/LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,6 @@ Apache License 2.0
org.yaml:snakeyaml
software.amazon.ion:ion-java
org.awaitility:awaitility
com.fasterxml.uuid:java-uuid-generator

MIT
=====================
Expand Down
3 changes: 1 addition & 2 deletions hadoop-ozone/dist/src/main/license/jar-report.txt
Original file line number Diff line number Diff line change
Expand Up @@ -273,5 +273,4 @@ share/ozone/lib/weld-servlet-shaded.Final.jar
share/ozone/lib/woodstox-core.jar
share/ozone/lib/zookeeper.jar
share/ozone/lib/zookeeper-jute.jar
share/ozone/lib/zstd-jni.jar
share/ozone/lib/java-uuid-generator.jar
share/ozone/lib/zstd-jni.jar
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicInteger;

/**
Expand Down Expand Up @@ -98,11 +96,7 @@ public void submitRequest(OMRequest request,
}

private static byte[] getClientId() {
UUID uuid = UUIDUtil.randomUUID();
ByteBuffer buf = ByteBuffer.wrap(new byte[16]);
buf.putLong(uuid.getMostSignificantBits());
buf.putLong(uuid.getLeastSignificantBits());
return buf.array();
return UUIDUtil.randomUUIDBytes();
}

}
6 changes: 0 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<jgrapht.version>1.0.1</jgrapht.version>

<vault.driver.version>5.1.0</vault.driver.version>
<java.uuid.generator.version>4.3.0</java.uuid.generator.version>
<native.lib.tmp.dir></native.lib.tmp.dir>
</properties>

Expand Down Expand Up @@ -1580,11 +1579,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xs
<version>${mockito2.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.uuid</groupId>
<artifactId>java-uuid-generator</artifactId>
<version>${java.uuid.generator.version}</version>
</dependency>
</dependencies>
</dependencyManagement>

Expand Down