This is an automated email from the ASF dual-hosted git repository.

jgus pushed a commit to branch 2.0
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/2.0 by this push:
     new 52c459a  MINOR: Move FileConfigProvider to provider subpackage (#5194)
52c459a is described below

commit 52c459abb1a4a40e179d743b71578fbc363b38af
Author: Robert Yokota <rayok...@gmail.com>
AuthorDate: Tue Jun 12 12:52:51 2018 -0700

    MINOR: Move FileConfigProvider to provider subpackage (#5194)
    
    This moves FileConfigProvider to the org.apache.common.config.provider 
package to more easily isolate provider implementations going forward.
    
    Reviewers: Konstantine Karantasis <konstant...@confluent.io>, Randall Hauch 
<rha...@gmail.com>, Ismael Juma <ism...@juma.me.uk>, Jason Gustafson 
<ja...@confluent.io>
---
 build.gradle                                                   |  1 +
 .../org/apache/kafka/common/config/ConfigChangeCallback.java   |  2 ++
 .../main/java/org/apache/kafka/common/config/ConfigData.java   |  2 ++
 .../java/org/apache/kafka/common/config/ConfigTransformer.java |  3 +++
 .../apache/kafka/common/config/ConfigTransformerResult.java    |  2 ++
 .../kafka/common/config/{ => provider}/ConfigProvider.java     |  4 +++-
 .../kafka/common/config/{ => provider}/FileConfigProvider.java |  5 ++++-
 ... => org.apache.kafka.common.config.provider.ConfigProvider} |  2 +-
 .../org/apache/kafka/common/config/ConfigTransformerTest.java  |  1 +
 .../common/config/{ => provider}/FileConfigProviderTest.java   |  3 ++-
 .../src/main/java/org/apache/kafka/connect/runtime/Worker.java |  2 +-
 .../apache/kafka/connect/runtime/WorkerConfigTransformer.java  |  2 +-
 .../kafka/connect/runtime/distributed/ClusterConfigState.java  |  5 +++--
 .../kafka/connect/runtime/isolation/DelegatingClassLoader.java |  2 +-
 .../kafka/connect/runtime/isolation/PluginScanResult.java      |  2 +-
 .../org/apache/kafka/connect/runtime/isolation/PluginType.java |  2 +-
 .../apache/kafka/connect/runtime/isolation/PluginUtils.java    |  6 ++++--
 .../org/apache/kafka/connect/runtime/isolation/Plugins.java    |  2 +-
 .../kafka/connect/runtime/WorkerConfigTransformerTest.java     |  2 +-
 .../connect/runtime/isolation/DelegatingClassLoaderTest.java   |  2 +-
 .../kafka/connect/runtime/isolation/PluginUtilsTest.java       | 10 ++++++++--
 21 files changed, 44 insertions(+), 18 deletions(-)

diff --git a/build.gradle b/build.gradle
index 9e03be3..5bd3892 100644
--- a/build.gradle
+++ b/build.gradle
@@ -868,6 +868,7 @@ project(':clients') {
     include "**/org/apache/kafka/common/resource/*"
     include "**/org/apache/kafka/common/serialization/*"
     include "**/org/apache/kafka/common/config/*"
+    include "**/org/apache/kafka/common/config/provider/*"
     include "**/org/apache/kafka/common/security/auth/*"
     include "**/org/apache/kafka/server/policy/*"
     include "**/org/apache/kafka/common/security/token/delegation/*"
diff --git 
a/clients/src/main/java/org/apache/kafka/common/config/ConfigChangeCallback.java
 
b/clients/src/main/java/org/apache/kafka/common/config/ConfigChangeCallback.java
index d4c9948..faa7d3d 100644
--- 
a/clients/src/main/java/org/apache/kafka/common/config/ConfigChangeCallback.java
+++ 
b/clients/src/main/java/org/apache/kafka/common/config/ConfigChangeCallback.java
@@ -16,6 +16,8 @@
  */
 package org.apache.kafka.common.config;
 
+import org.apache.kafka.common.config.provider.ConfigProvider;
+
 /**
  * A callback passed to {@link ConfigProvider} for subscribing to changes.
  */
diff --git 
a/clients/src/main/java/org/apache/kafka/common/config/ConfigData.java 
b/clients/src/main/java/org/apache/kafka/common/config/ConfigData.java
index 2bd0ff6..8661ee1 100644
--- a/clients/src/main/java/org/apache/kafka/common/config/ConfigData.java
+++ b/clients/src/main/java/org/apache/kafka/common/config/ConfigData.java
@@ -16,6 +16,8 @@
  */
 package org.apache.kafka.common.config;
 
+import org.apache.kafka.common.config.provider.ConfigProvider;
+
 import java.util.Map;
 
 /**
diff --git 
a/clients/src/main/java/org/apache/kafka/common/config/ConfigTransformer.java 
b/clients/src/main/java/org/apache/kafka/common/config/ConfigTransformer.java
index 7c3c516..7e21a32 100644
--- 
a/clients/src/main/java/org/apache/kafka/common/config/ConfigTransformer.java
+++ 
b/clients/src/main/java/org/apache/kafka/common/config/ConfigTransformer.java
@@ -16,6 +16,9 @@
  */
 package org.apache.kafka.common.config;
 
+import org.apache.kafka.common.config.provider.ConfigProvider;
+import org.apache.kafka.common.config.provider.FileConfigProvider;
+
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.HashSet;
diff --git 
a/clients/src/main/java/org/apache/kafka/common/config/ConfigTransformerResult.java
 
b/clients/src/main/java/org/apache/kafka/common/config/ConfigTransformerResult.java
index df7bea6..a05669c 100644
--- 
a/clients/src/main/java/org/apache/kafka/common/config/ConfigTransformerResult.java
+++ 
b/clients/src/main/java/org/apache/kafka/common/config/ConfigTransformerResult.java
@@ -16,6 +16,8 @@
  */
 package org.apache.kafka.common.config;
 
+import org.apache.kafka.common.config.provider.ConfigProvider;
+
 import java.util.Map;
 
 /**
diff --git 
a/clients/src/main/java/org/apache/kafka/common/config/ConfigProvider.java 
b/clients/src/main/java/org/apache/kafka/common/config/provider/ConfigProvider.java
similarity index 94%
rename from 
clients/src/main/java/org/apache/kafka/common/config/ConfigProvider.java
rename to 
clients/src/main/java/org/apache/kafka/common/config/provider/ConfigProvider.java
index 7133baa..8561511 100644
--- a/clients/src/main/java/org/apache/kafka/common/config/ConfigProvider.java
+++ 
b/clients/src/main/java/org/apache/kafka/common/config/provider/ConfigProvider.java
@@ -14,9 +14,11 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.kafka.common.config;
+package org.apache.kafka.common.config.provider;
 
 import org.apache.kafka.common.Configurable;
+import org.apache.kafka.common.config.ConfigChangeCallback;
+import org.apache.kafka.common.config.ConfigData;
 
 import java.io.Closeable;
 import java.util.Set;
diff --git 
a/clients/src/main/java/org/apache/kafka/common/config/FileConfigProvider.java 
b/clients/src/main/java/org/apache/kafka/common/config/provider/FileConfigProvider.java
similarity index 95%
rename from 
clients/src/main/java/org/apache/kafka/common/config/FileConfigProvider.java
rename to 
clients/src/main/java/org/apache/kafka/common/config/provider/FileConfigProvider.java
index ff6bc5e..d25183a 100644
--- 
a/clients/src/main/java/org/apache/kafka/common/config/FileConfigProvider.java
+++ 
b/clients/src/main/java/org/apache/kafka/common/config/provider/FileConfigProvider.java
@@ -14,7 +14,10 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.kafka.common.config;
+package org.apache.kafka.common.config.provider;
+
+import org.apache.kafka.common.config.ConfigData;
+import org.apache.kafka.common.config.ConfigException;
 
 import java.io.BufferedReader;
 import java.io.FileInputStream;
diff --git 
a/clients/src/main/resources/META-INF/services/org.apache.kafka.common.config.ConfigProvider
 
b/clients/src/main/resources/META-INF/services/org.apache.kafka.common.config.provider.ConfigProvider
similarity index 93%
rename from 
clients/src/main/resources/META-INF/services/org.apache.kafka.common.config.ConfigProvider
rename to 
clients/src/main/resources/META-INF/services/org.apache.kafka.common.config.provider.ConfigProvider
index bcad016..146de7a 100644
--- 
a/clients/src/main/resources/META-INF/services/org.apache.kafka.common.config.ConfigProvider
+++ 
b/clients/src/main/resources/META-INF/services/org.apache.kafka.common.config.provider.ConfigProvider
@@ -13,4 +13,4 @@
  # See the License for the specific language governing permissions and
  # limitations under the License.
 
-org.apache.kafka.common.config.FileConfigProvider
+org.apache.kafka.common.config.provider.FileConfigProvider
diff --git 
a/clients/src/test/java/org/apache/kafka/common/config/ConfigTransformerTest.java
 
b/clients/src/test/java/org/apache/kafka/common/config/ConfigTransformerTest.java
index 7bc74f3..d6bd3dc 100644
--- 
a/clients/src/test/java/org/apache/kafka/common/config/ConfigTransformerTest.java
+++ 
b/clients/src/test/java/org/apache/kafka/common/config/ConfigTransformerTest.java
@@ -16,6 +16,7 @@
  */
 package org.apache.kafka.common.config;
 
+import org.apache.kafka.common.config.provider.ConfigProvider;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git 
a/clients/src/test/java/org/apache/kafka/common/config/FileConfigProviderTest.java
 
b/clients/src/test/java/org/apache/kafka/common/config/provider/FileConfigProviderTest.java
similarity index 97%
rename from 
clients/src/test/java/org/apache/kafka/common/config/FileConfigProviderTest.java
rename to 
clients/src/test/java/org/apache/kafka/common/config/provider/FileConfigProviderTest.java
index 9157e38..b2c791a 100644
--- 
a/clients/src/test/java/org/apache/kafka/common/config/FileConfigProviderTest.java
+++ 
b/clients/src/test/java/org/apache/kafka/common/config/provider/FileConfigProviderTest.java
@@ -14,8 +14,9 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.kafka.common.config;
+package org.apache.kafka.common.config.provider;
 
+import org.apache.kafka.common.config.ConfigData;
 import org.junit.Before;
 import org.junit.Test;
 
diff --git 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java
index c794eb8..7291d4f 100644
--- a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java
+++ b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/Worker.java
@@ -19,7 +19,7 @@ package org.apache.kafka.connect.runtime;
 import org.apache.kafka.clients.producer.KafkaProducer;
 import org.apache.kafka.clients.producer.ProducerConfig;
 import org.apache.kafka.common.MetricName;
-import org.apache.kafka.common.config.ConfigProvider;
+import org.apache.kafka.common.config.provider.ConfigProvider;
 import org.apache.kafka.common.metrics.Sensor;
 import org.apache.kafka.common.metrics.stats.Frequencies;
 import org.apache.kafka.common.metrics.stats.Total;
diff --git 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConfigTransformer.java
 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConfigTransformer.java
index d91411c..b8465c0 100644
--- 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConfigTransformer.java
+++ 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/WorkerConfigTransformer.java
@@ -16,7 +16,7 @@
  */
 package org.apache.kafka.connect.runtime;
 
-import org.apache.kafka.common.config.ConfigProvider;
+import org.apache.kafka.common.config.provider.ConfigProvider;
 import org.apache.kafka.common.config.ConfigTransformer;
 import org.apache.kafka.common.config.ConfigTransformerResult;
 
diff --git 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/ClusterConfigState.java
 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/ClusterConfigState.java
index 9507706..11693b5 100644
--- 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/ClusterConfigState.java
+++ 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/distributed/ClusterConfigState.java
@@ -16,6 +16,7 @@
  */
 package org.apache.kafka.connect.runtime.distributed;
 
+import org.apache.kafka.common.config.provider.ConfigProvider;
 import org.apache.kafka.connect.runtime.WorkerConfigTransformer;
 import org.apache.kafka.connect.runtime.TargetState;
 import org.apache.kafka.connect.util.ConnectorTaskId;
@@ -110,7 +111,7 @@ public class ClusterConfigState {
      * Get the configuration for a connector.  The configuration will have 
been transformed by
      * {@link org.apache.kafka.common.config.ConfigTransformer} by having all 
variable
      * references replaced with the current values from external instances of
-     * {@link org.apache.kafka.common.config.ConfigProvider}, and may include 
secrets.
+     * {@link ConfigProvider}, and may include secrets.
      * @param connector name of the connector
      * @return a map containing configuration parameters
      */
@@ -135,7 +136,7 @@ public class ClusterConfigState {
      * Get the configuration for a task.  The configuration will have been 
transformed by
      * {@link org.apache.kafka.common.config.ConfigTransformer} by having all 
variable
      * references replaced with the current values from external instances of
-     * {@link org.apache.kafka.common.config.ConfigProvider}, and may include 
secrets.
+     * {@link ConfigProvider}, and may include secrets.
      * @param task id of the task
      * @return a map containing configuration parameters
      */
diff --git 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/DelegatingClassLoader.java
 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/DelegatingClassLoader.java
index 8e31220..e7a1712 100644
--- 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/DelegatingClassLoader.java
+++ 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/DelegatingClassLoader.java
@@ -16,7 +16,7 @@
  */
 package org.apache.kafka.connect.runtime.isolation;
 
-import org.apache.kafka.common.config.ConfigProvider;
+import org.apache.kafka.common.config.provider.ConfigProvider;
 import org.apache.kafka.connect.components.Versioned;
 import org.apache.kafka.connect.connector.Connector;
 import org.apache.kafka.connect.rest.ConnectRestExtension;
diff --git 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginScanResult.java
 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginScanResult.java
index 87b0b70..ef077b3 100644
--- 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginScanResult.java
+++ 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginScanResult.java
@@ -16,7 +16,7 @@
  */
 package org.apache.kafka.connect.runtime.isolation;
 
-import org.apache.kafka.common.config.ConfigProvider;
+import org.apache.kafka.common.config.provider.ConfigProvider;
 import org.apache.kafka.connect.connector.Connector;
 import org.apache.kafka.connect.rest.ConnectRestExtension;
 import org.apache.kafka.connect.storage.Converter;
diff --git 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginType.java
 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginType.java
index 906b85f..2833b4c 100644
--- 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginType.java
+++ 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginType.java
@@ -16,7 +16,7 @@
  */
 package org.apache.kafka.connect.runtime.isolation;
 
-import org.apache.kafka.common.config.ConfigProvider;
+import org.apache.kafka.common.config.provider.ConfigProvider;
 import org.apache.kafka.connect.connector.Connector;
 import org.apache.kafka.connect.rest.ConnectRestExtension;
 import org.apache.kafka.connect.sink.SinkConnector;
diff --git 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginUtils.java
 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginUtils.java
index b4aee47..9c4151b 100644
--- 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginUtils.java
+++ 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/PluginUtils.java
@@ -122,14 +122,16 @@ public class PluginUtils {
             + "|org\\.slf4j"
             + ")\\..*$";
 
-    private static final String WHITELIST = 
"^org\\.apache\\.kafka\\.(?:common.config..*ConfigProvider|connect\\.(?:"
+    private static final String WHITELIST = 
"^org\\.apache\\.kafka\\.(?:connect\\.(?:"
             + "transforms\\.(?!Transformation$).*"
             + "|json\\..*"
             + "|file\\..*"
             + "|converters\\..*"
             + "|storage\\.StringConverter"
             + 
"|rest\\.basic\\.auth\\.extension\\.BasicAuthSecurityRestExtension"
-            + "))$";
+            + ")"
+            + "|common\\.config\\.provider\\.(?!ConfigProvider$).*"
+            + ")$";
 
     private static final DirectoryStream.Filter<Path> PLUGIN_PATH_FILTER = new 
DirectoryStream
             .Filter<Path>() {
diff --git 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/Plugins.java
 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/Plugins.java
index c89accd..e766cbd 100644
--- 
a/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/Plugins.java
+++ 
b/connect/runtime/src/main/java/org/apache/kafka/connect/runtime/isolation/Plugins.java
@@ -19,7 +19,7 @@ package org.apache.kafka.connect.runtime.isolation;
 import org.apache.kafka.common.Configurable;
 import org.apache.kafka.common.KafkaException;
 import org.apache.kafka.common.config.AbstractConfig;
-import org.apache.kafka.common.config.ConfigProvider;
+import org.apache.kafka.common.config.provider.ConfigProvider;
 import org.apache.kafka.common.utils.Utils;
 import org.apache.kafka.connect.components.Versioned;
 import org.apache.kafka.connect.connector.ConnectRecord;
diff --git 
a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerConfigTransformerTest.java
 
b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerConfigTransformerTest.java
index 89bba09..edd4a6c 100644
--- 
a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerConfigTransformerTest.java
+++ 
b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/WorkerConfigTransformerTest.java
@@ -18,7 +18,7 @@ package org.apache.kafka.connect.runtime;
 
 import org.apache.kafka.common.config.ConfigChangeCallback;
 import org.apache.kafka.common.config.ConfigData;
-import org.apache.kafka.common.config.ConfigProvider;
+import org.apache.kafka.common.config.provider.ConfigProvider;
 import org.easymock.EasyMock;
 import org.junit.Before;
 import org.junit.Test;
diff --git 
a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/DelegatingClassLoaderTest.java
 
b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/DelegatingClassLoaderTest.java
index 83ff040..5c06eaa 100644
--- 
a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/DelegatingClassLoaderTest.java
+++ 
b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/DelegatingClassLoaderTest.java
@@ -29,7 +29,7 @@ public class DelegatingClassLoaderTest {
         assertTrue(
             
DelegatingClassLoader.serviceLoaderManifestForPlugin("META-INF/services/org.apache.kafka.connect.rest.ConnectRestExtension"));
         assertTrue(
-            
DelegatingClassLoader.serviceLoaderManifestForPlugin("META-INF/services/org.apache.kafka.common.config.ConfigProvider"));
+            
DelegatingClassLoader.serviceLoaderManifestForPlugin("META-INF/services/org.apache.kafka.common.config.provider.ConfigProvider"));
     }
 
     @Test
diff --git 
a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/PluginUtilsTest.java
 
b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/PluginUtilsTest.java
index 9698153..71c9363 100644
--- 
a/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/PluginUtilsTest.java
+++ 
b/connect/runtime/src/test/java/org/apache/kafka/connect/runtime/isolation/PluginUtilsTest.java
@@ -114,6 +114,9 @@ public class PluginUtilsTest {
         assertFalse(PluginUtils.shouldLoadInIsolation(
                 "org.apache.kafka.clients.admin.KafkaAdminClient")
         );
+        assertFalse(PluginUtils.shouldLoadInIsolation(
+                "org.apache.kafka.connect.rest.ConnectRestExtension")
+        );
     }
 
     @Test
@@ -153,11 +156,14 @@ public class PluginUtilsTest {
 
     @Test
     public void testClientConfigProvider() throws Exception {
+        assertFalse(PluginUtils.shouldLoadInIsolation(
+                "org.apache.kafka.common.config.provider.ConfigProvider")
+        );
         assertTrue(PluginUtils.shouldLoadInIsolation(
-                "org.apache.kafka.common.config.FileConfigProvider")
+                "org.apache.kafka.common.config.provider.FileConfigProvider")
         );
         assertTrue(PluginUtils.shouldLoadInIsolation(
-                "org.apache.kafka.common.config.FutureConfigProvider")
+                "org.apache.kafka.common.config.provider.FutureConfigProvider")
         );
     }
 

-- 
To stop receiving notification emails like this one, please contact
j...@apache.org.

Reply via email to