Skip to content

Commit 929db4d

Browse files
committed
remove deprecation support code
1 parent 558cfbd commit 929db4d

File tree

2 files changed

+0
-107
lines changed

2 files changed

+0
-107
lines changed

src/main/java/com/zendesk/maxwell/filtering/Filter.java

Lines changed: 0 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -145,67 +145,4 @@ public static boolean couldIncludeFromColumnFilters(Filter filter, String databa
145145
return filter.couldIncludeFromColumnFilters(database, table, columnNames);
146146
}
147147
}
148-
149-
public static Filter fromOldFormat(
150-
String maxwellDB,
151-
String includeDatabases,
152-
String excludeDatabases,
153-
String includeTables,
154-
String excludeTables,
155-
String blacklistDatabases,
156-
String blacklistTables,
157-
String includeValues
158-
) throws InvalidFilterException {
159-
ArrayList<String> filterRules = new ArrayList<>();
160-
161-
if ( blacklistDatabases != null ) {
162-
for ( String s : blacklistDatabases.split(",") )
163-
filterRules.add("blacklist: " + s + ".*");
164-
}
165-
166-
if ( blacklistTables != null ) {
167-
for (String s : blacklistTables.split(","))
168-
filterRules.add("blacklist: *." + s);
169-
}
170-
171-
/* any include in old-filters is actually exclude *.* */
172-
if ( includeDatabases != null || includeTables != null ) {
173-
filterRules.add("exclude: *.*");
174-
}
175-
176-
if ( includeDatabases != null ) {
177-
for ( String s : includeDatabases.split(",") )
178-
filterRules.add("include: " + s + ".*");
179-
180-
}
181-
182-
if ( excludeDatabases != null ) {
183-
for (String s : excludeDatabases.split(","))
184-
filterRules.add("exclude: " + s + ".*");
185-
}
186-
187-
if ( includeTables != null ) {
188-
for ( String s : includeTables.split(",") )
189-
filterRules.add("include: *." + s);
190-
}
191-
192-
if ( excludeTables != null ) {
193-
for ( String s : excludeTables.split(",") )
194-
filterRules.add("exclude: *." + s);
195-
}
196-
197-
if (includeValues != null && !"".equals(includeValues)) {
198-
for (String s : includeValues.split(",")) {
199-
String[] columnAndValue = s.split("=");
200-
filterRules.add("exclude: *.*." + columnAndValue[0] + "=*");
201-
filterRules.add("include: *.*." + columnAndValue[0] + "=" + columnAndValue[1]);
202-
}
203-
}
204-
205-
String filterRulesAsString = String.join(", ", filterRules);
206-
LOGGER.warn("using exclude/include/includeColumns is deprecated. Please update your configuration to use: ");
207-
LOGGER.warn("filter = \"" + filterRulesAsString + "\"");
208-
209-
return new Filter(maxwellDB, filterRulesAsString);
210-
}
211148
}

src/test/java/com/zendesk/maxwell/filtering/FilterTest.java

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -159,49 +159,5 @@ public void TestEmptyToString() throws Exception {
159159
Filter f = new Filter("");
160160
assertEquals(f.toString(), "");
161161
}
162-
163-
@Test
164-
public void TestOldFiltersExcludeDB() throws Exception {
165-
Filter f = Filter.fromOldFormat("maxwell", null, "foo, /bar/", null, null, null, null, null);
166-
List<FilterPattern> rules = f.getRules();
167-
assertEquals(2, rules.size());
168-
assertEquals("exclude: foo.*", rules.get(0).toString());
169-
assertEquals("exclude: /bar/.*", rules.get(1).toString());
170-
}
171-
172-
@Test
173-
public void TestOldFiltersIncludeDB() throws Exception {
174-
Filter f = Filter.fromOldFormat("maxwell", "foo", null, null, null, null, null, null);
175-
List<FilterPattern> rules = f.getRules();
176-
assertEquals(2, rules.size());
177-
assertEquals("exclude: *.*", rules.get(0).toString());
178-
assertEquals("include: foo.*", rules.get(1).toString());
179-
}
180-
181-
@Test
182-
public void TestOldFiltersExcludeTable() throws Exception {
183-
Filter f = Filter.fromOldFormat("maxwell", null, null, null, "tbl", null, null, null);
184-
List<FilterPattern> rules = f.getRules();
185-
assertEquals(1, rules.size());
186-
assertEquals("exclude: *.tbl", rules.get(0).toString());
187-
}
188-
189-
@Test
190-
public void TestOldFiltersIncludeTable() throws Exception {
191-
Filter f = Filter.fromOldFormat("maxwell", null, null, "/foo.*bar/", null, null, null, null);
192-
List<FilterPattern> rules = f.getRules();
193-
assertEquals(2, rules.size());
194-
assertEquals("exclude: *.*", rules.get(0).toString());
195-
assertEquals("include: *./foo.*bar/", rules.get(1).toString());
196-
}
197-
198-
@Test
199-
public void TestOldFiltersIncludeColumnValues() throws Exception {
200-
Filter f = Filter.fromOldFormat("maxwell", null, null, null, null, null, null, "foo=bar");
201-
List<FilterPattern> rules = f.getRules();
202-
assertEquals(2, rules.size());
203-
assertEquals("exclude: *.*.foo=*", rules.get(0).toString());
204-
assertEquals("include: *.*.foo=bar", rules.get(1).toString());
205-
}
206162
}
207163

0 commit comments

Comments
 (0)