Skip to content

Commit d0d4792

Browse files
committed
Move everything except JdbcSourceConnector and the util pkg to under a 'source' subpkg
In anticipation of another 'sink' subpkg
1 parent 1e7929b commit d0d4792

22 files changed

+52
-24
lines changed

src/main/java/io/confluent/connect/jdbc/JdbcSourceConnector.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@
3636
import java.util.Map;
3737
import java.util.Set;
3838

39+
import io.confluent.connect.jdbc.source.JdbcSourceConnectorConfig;
40+
import io.confluent.connect.jdbc.source.JdbcSourceTask;
41+
import io.confluent.connect.jdbc.source.JdbcSourceTaskConfig;
42+
import io.confluent.connect.jdbc.source.TableMonitorThread;
3943
import io.confluent.connect.jdbc.util.StringUtils;
4044
import io.confluent.connect.jdbc.util.Version;
4145

@@ -154,6 +158,6 @@ public void stop() throws ConnectException {
154158

155159
@Override
156160
public ConfigDef config() {
157-
return JdbcSourceConnectorConfig.config;
161+
return JdbcSourceConnectorConfig.CONFIG_DEF;
158162
}
159163
}

src/main/java/io/confluent/connect/jdbc/BulkTableQuerier.java renamed to src/main/java/io/confluent/connect/jdbc/source/BulkTableQuerier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.connect.data.Struct;
2020
import org.apache.kafka.connect.errors.ConnectException;

src/main/java/io/confluent/connect/jdbc/DataConverter.java renamed to src/main/java/io/confluent/connect/jdbc/source/DataConverter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.connect.data.Date;
2020
import org.apache.kafka.connect.data.Decimal;

src/main/java/io/confluent/connect/jdbc/JdbcSourceConnectorConfig.java renamed to src/main/java/io/confluent/connect/jdbc/source/JdbcSourceConnectorConfig.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.common.config.AbstractConfig;
2020
import org.apache.kafka.common.config.ConfigDef;
@@ -190,10 +190,11 @@ public static ConfigDef baseConfigDef() {
190190
.define(TOPIC_PREFIX_CONFIG, Type.STRING, Importance.HIGH, TOPIC_PREFIX_DOC, CONNECTOR_GROUP, 4, Width.MEDIUM, TOPIC_PREFIX_DISPLAY)
191191
.define(TIMESTAMP_DELAY_INTERVAL_MS_CONFIG, Type.LONG, TIMESTAMP_DELAY_INTERVAL_MS_DEFAULT, Importance.HIGH, TIMESTAMP_DELAY_INTERVAL_MS_DOC, CONNECTOR_GROUP, 5, Width.MEDIUM, TIMESTAMP_DELAY_INTERVAL_MS_DISPLAY);
192192
}
193-
static ConfigDef config = baseConfigDef();
193+
194+
public static final ConfigDef CONFIG_DEF = baseConfigDef();
194195

195196
public JdbcSourceConnectorConfig(Map<String, String> props) {
196-
super(config, props);
197+
super(CONFIG_DEF, props);
197198
String mode = getString(JdbcSourceConnectorConfig.MODE_CONFIG);
198199
if (mode.equals(JdbcSourceConnectorConfig.MODE_UNSPECIFIED))
199200
throw new ConfigException("Query mode must be specified");
@@ -254,6 +255,6 @@ protected JdbcSourceConnectorConfig(ConfigDef subclassConfigDef, Map<String, Str
254255
}
255256

256257
public static void main(String[] args) {
257-
System.out.println(config.toRst());
258+
System.out.println(CONFIG_DEF.toRst());
258259
}
259260
}

src/main/java/io/confluent/connect/jdbc/JdbcSourceConnectorConstants.java renamed to src/main/java/io/confluent/connect/jdbc/source/JdbcSourceConnectorConstants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
**/
16-
package io.confluent.connect.jdbc;
16+
package io.confluent.connect.jdbc.source;
1717

1818
public class JdbcSourceConnectorConstants {
1919
public static final String TABLE_NAME_KEY = "table";

src/main/java/io/confluent/connect/jdbc/JdbcSourceTask.java renamed to src/main/java/io/confluent/connect/jdbc/source/JdbcSourceTask.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.common.config.ConfigException;
2020
import org.apache.kafka.common.utils.SystemTime;

src/main/java/io/confluent/connect/jdbc/JdbcSourceTaskConfig.java renamed to src/main/java/io/confluent/connect/jdbc/source/JdbcSourceTaskConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.common.config.ConfigDef;
2020
import org.apache.kafka.common.config.ConfigDef.Importance;

src/main/java/io/confluent/connect/jdbc/JdbcUtils.java renamed to src/main/java/io/confluent/connect/jdbc/source/JdbcUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.connect.errors.ConnectException;
2020
import org.slf4j.Logger;

src/main/java/io/confluent/connect/jdbc/TableMonitorThread.java renamed to src/main/java/io/confluent/connect/jdbc/source/TableMonitorThread.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.connect.connector.ConnectorContext;
2020
import org.apache.kafka.connect.errors.ConnectException;

src/main/java/io/confluent/connect/jdbc/TableQuerier.java renamed to src/main/java/io/confluent/connect/jdbc/source/TableQuerier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.connect.data.Schema;
2020
import org.apache.kafka.connect.source.SourceRecord;

src/main/java/io/confluent/connect/jdbc/TimestampIncrementingOffset.java renamed to src/main/java/io/confluent/connect/jdbc/source/TimestampIncrementingOffset.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import java.sql.Timestamp;
2020
import java.util.HashMap;

src/main/java/io/confluent/connect/jdbc/TimestampIncrementingTableQuerier.java renamed to src/main/java/io/confluent/connect/jdbc/source/TimestampIncrementingTableQuerier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.connect.data.Struct;
2020
import org.apache.kafka.connect.errors.ConnectException;

src/test/java/io/confluent/connect/jdbc/JdbcSourceConnectorTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@
3535
import java.util.List;
3636
import java.util.Map;
3737

38+
import io.confluent.connect.jdbc.source.EmbeddedDerby;
39+
import io.confluent.connect.jdbc.source.JdbcSourceConnectorConfig;
40+
import io.confluent.connect.jdbc.source.JdbcSourceTask;
41+
import io.confluent.connect.jdbc.source.JdbcSourceTaskConfig;
42+
3843
import static org.junit.Assert.assertEquals;
3944
import static org.junit.Assert.assertNull;
4045

src/test/java/io/confluent/connect/jdbc/EmbeddedDerby.java renamed to src/test/java/io/confluent/connect/jdbc/source/EmbeddedDerby.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.commons.io.FileUtils;
2020
import org.apache.derby.jdbc.EmbeddedDriver;

src/test/java/io/confluent/connect/jdbc/JdbcSourceTaskConversionTest.java renamed to src/test/java/io/confluent/connect/jdbc/source/JdbcSourceTaskConversionTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.connect.data.Date;
2020
import org.apache.kafka.connect.data.Decimal;

src/test/java/io/confluent/connect/jdbc/JdbcSourceTaskLifecycleTest.java renamed to src/test/java/io/confluent/connect/jdbc/source/JdbcSourceTaskLifecycleTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.connect.errors.ConnectException;
2020
import org.apache.kafka.connect.source.SourceRecord;

src/test/java/io/confluent/connect/jdbc/JdbcSourceTaskTestBase.java renamed to src/test/java/io/confluent/connect/jdbc/source/JdbcSourceTaskTestBase.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.common.utils.Time;
2020
import org.apache.kafka.connect.source.SourceTaskContext;

src/test/java/io/confluent/connect/jdbc/JdbcSourceTaskUpdateTest.java renamed to src/test/java/io/confluent/connect/jdbc/source/JdbcSourceTaskUpdateTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.connect.data.Struct;
2020
import org.apache.kafka.connect.errors.ConnectException;

src/test/java/io/confluent/connect/jdbc/JdbcUtilsTest.java renamed to src/test/java/io/confluent/connect/jdbc/source/JdbcUtilsTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.junit.After;
2020
import org.junit.Before;

src/test/java/io/confluent/connect/jdbc/MockTime.java renamed to src/test/java/io/confluent/connect/jdbc/source/MockTime.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,20 @@
1-
package io.confluent.connect.jdbc;
1+
/*
2+
* Copyright 2016 Confluent Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package io.confluent.connect.jdbc.source;
218

319
import org.apache.kafka.common.utils.Time;
420

src/test/java/io/confluent/connect/jdbc/TableMonitorThreadTest.java renamed to src/test/java/io/confluent/connect/jdbc/source/TableMonitorThreadTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.apache.kafka.connect.connector.ConnectorContext;
2020
import org.easymock.EasyMock;

src/test/java/io/confluent/connect/jdbc/TimestampIncrementingOffsetTest.java renamed to src/test/java/io/confluent/connect/jdbc/source/TimestampIncrementingOffsetTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
* limitations under the License.
1515
**/
1616

17-
package io.confluent.connect.jdbc;
17+
package io.confluent.connect.jdbc.source;
1818

1919
import org.junit.Before;
2020
import org.junit.Test;
2121

2222
import java.sql.Timestamp;
2323

24+
import io.confluent.connect.jdbc.source.TimestampIncrementingOffset;
25+
2426
import static org.junit.Assert.assertEquals;
2527
import static org.junit.Assert.assertNotNull;
2628

0 commit comments

Comments
 (0)