This is an automated email from the ASF dual-hosted git repository.
roryqi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git
The following commit(s) were added to refs/heads/master by this push:
new 6a9bb588 Remove unused class of RssShuffleUtils (#345)
6a9bb588 is described below
commit 6a9bb5884ff97d5ab6e334c7b56753aa176ecfb5
Author: Junfan Zhang <[email protected]>
AuthorDate: Mon Nov 21 10:43:43 2022 +0800
Remove unused class of RssShuffleUtils (#345)
### What changes were proposed in this pull request?
Remove unused class of RssShuffleUtils
### Why are the changes needed?
Remove unused class of RssShuffleUtils
### Does this PR introduce _any_ user-facing change?
No
### How was this patch tested?
Dont need
---
.../org/apache/uniffle/common/RssShuffleUtils.java | 51 ----------------------
1 file changed, 51 deletions(-)
diff --git
a/common/src/main/java/org/apache/uniffle/common/RssShuffleUtils.java
b/common/src/main/java/org/apache/uniffle/common/RssShuffleUtils.java
deleted file mode 100644
index 42788aa8..00000000
--- a/common/src/main/java/org/apache/uniffle/common/RssShuffleUtils.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.uniffle.common;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.nio.ByteBuffer;
-
-import com.google.common.base.Preconditions;
-
-public class RssShuffleUtils {
- /**
- * DirectByteBuffers are garbage collected by using a phantom reference and a
- * reference queue. Every once a while, the JVM checks the reference queue
and
- * cleans the DirectByteBuffers. However, as this doesn't happen
- * immediately after discarding all references to a DirectByteBuffer, it's
- * easy to OutOfMemoryError yourself using DirectByteBuffers. This function
- * explicitly calls the Cleaner method of a DirectByteBuffer.
- *
- * @param toBeDestroyed
- * The DirectByteBuffer that will be "cleaned". Utilizes reflection.
- *
- */
- public static void destroyDirectByteBuffer(ByteBuffer toBeDestroyed)
- throws IllegalArgumentException, IllegalAccessException,
- InvocationTargetException, SecurityException, NoSuchMethodException {
- Preconditions.checkArgument(toBeDestroyed.isDirect(),
- "toBeDestroyed isn't direct!");
- Method cleanerMethod = toBeDestroyed.getClass().getMethod("cleaner");
- cleanerMethod.setAccessible(true);
- Object cleaner = cleanerMethod.invoke(toBeDestroyed);
- Method cleanMethod = cleaner.getClass().getMethod("clean");
- cleanMethod.setAccessible(true);
- cleanMethod.invoke(cleaner);
- }
-}