Skip to content

Commit 0a367aa

Browse files
authored
KAFKA-20297 Move OperatingSystem, Java, Exit... into internal (#22093)
We have exposed several classes in org.apache.kafka.common.utils as public APIs, which can be misleading since not all classes in this package are intended for external use. So move following class into internal module - OperatingSystem - Java - Exit - Shell - LoggingSignalHandler Reviewers: cychiu <cychiu8@gmail.com>, Chia-Ping Tsai <chia7712@gmail.com>
1 parent 4766b29 commit 0a367aa

132 files changed

Lines changed: 144 additions & 141 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

clients/src/main/java/org/apache/kafka/common/internals/FatalExitError.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
package org.apache.kafka.common.internals;
1818

19-
import org.apache.kafka.common.utils.Exit;
19+
import org.apache.kafka.common.utils.internals.Exit;
2020

2121
/**
2222
* An error that indicates the need to exit the JVM process. This should only be used by the server or command-line

clients/src/main/java/org/apache/kafka/common/security/kerberos/KerberosError.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import org.apache.kafka.common.KafkaException;
2020
import org.apache.kafka.common.security.authenticator.SaslClientAuthenticator;
21-
import org.apache.kafka.common.utils.Java;
21+
import org.apache.kafka.common.utils.internals.Java;
2222

2323
import org.ietf.jgss.GSSException;
2424
import org.slf4j.Logger;

clients/src/main/java/org/apache/kafka/common/security/kerberos/KerberosLogin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@
2121
import org.apache.kafka.common.security.JaasUtils;
2222
import org.apache.kafka.common.security.auth.AuthenticateCallbackHandler;
2323
import org.apache.kafka.common.security.authenticator.AbstractLogin;
24-
import org.apache.kafka.common.utils.Shell;
2524
import org.apache.kafka.common.utils.Time;
2625
import org.apache.kafka.common.utils.internals.KafkaThread;
26+
import org.apache.kafka.common.utils.internals.Shell;
2727

2828
import org.slf4j.Logger;
2929
import org.slf4j.LoggerFactory;

clients/src/main/java/org/apache/kafka/common/utils/Utils.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import org.apache.kafka.common.config.ConfigDef;
2121
import org.apache.kafka.common.config.ConfigException;
2222
import org.apache.kafka.common.network.TransferableChannel;
23+
import org.apache.kafka.common.utils.internals.OperatingSystem;
2324

2425
import org.slf4j.Logger;
2526
import org.slf4j.LoggerFactory;

clients/src/main/java/org/apache/kafka/common/utils/Exit.java renamed to clients/src/main/java/org/apache/kafka/common/utils/internals/Exit.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.kafka.common.utils;
18-
19-
import org.apache.kafka.common.utils.internals.KafkaThread;
17+
package org.apache.kafka.common.utils.internals;
2018

2119
/**
2220
* Internal class that should be used instead of `System.exit()` and `Runtime.getRuntime().halt()` so that tests can

clients/src/main/java/org/apache/kafka/common/utils/Java.java renamed to clients/src/main/java/org/apache/kafka/common/utils/internals/Java.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.kafka.common.utils;
17+
package org.apache.kafka.common.utils.internals;
1818

1919
public final class Java {
2020

clients/src/main/java/org/apache/kafka/common/utils/LoggingSignalHandler.java renamed to clients/src/main/java/org/apache/kafka/common/utils/internals/LoggingSignalHandler.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.kafka.common.utils;
17+
package org.apache.kafka.common.utils.internals;
18+
19+
import org.apache.kafka.common.utils.Utils;
1820

1921
import org.slf4j.Logger;
2022
import org.slf4j.LoggerFactory;

clients/src/main/java/org/apache/kafka/common/utils/OperatingSystem.java renamed to clients/src/main/java/org/apache/kafka/common/utils/internals/OperatingSystem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.kafka.common.utils;
17+
package org.apache.kafka.common.utils.internals;
1818

1919
import java.util.Locale;
2020

clients/src/main/java/org/apache/kafka/common/utils/Shell.java renamed to clients/src/main/java/org/apache/kafka/common/utils/internals/Shell.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414
* See the License for the specific language governing permissions and
1515
* limitations under the License.
1616
*/
17-
package org.apache.kafka.common.utils;
18-
19-
import org.apache.kafka.common.utils.internals.KafkaThread;
17+
package org.apache.kafka.common.utils.internals;
2018

2119
import org.slf4j.Logger;
2220
import org.slf4j.LoggerFactory;

clients/src/test/java/org/apache/kafka/common/utils/ByteBufferUnmapperTest.java renamed to clients/src/test/java/org/apache/kafka/common/utils/internals/ByteBufferUnmapperTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@
1515
* limitations under the License.
1616
*/
1717

18-
package org.apache.kafka.common.utils;
18+
package org.apache.kafka.common.utils.internals;
1919

20-
import org.apache.kafka.common.utils.internals.ByteBufferUnmapper;
2120
import org.apache.kafka.test.TestUtils;
2221

2322
import org.junit.jupiter.api.Test;

0 commit comments

Comments
 (0)