@Test public void testGetKeyspaceFilterWithDefault() { MockConfig config = new MockConfig(null); Set<String> filter = Schema.getKeyspaceFilter(config); Assert.assertFalse("Default fileter should not be empty", filter.isEmpty()); }
@VisibleForTesting public static Set<String> getKeyspaceFilter(JobConfiguration configuration) { List<String> disallowedKeyspaces = configuration.disallowedKeyspaces(); if (null == disallowedKeyspaces) { return DEFAULT_FILTER; } else { return Sets.union(DEFAULT_FILTER, ImmutableSet.copyOf(disallowedKeyspaces)); } }
Schema { @VisibleForTesting public static Set<String> getKeyspaceFilter(JobConfiguration configuration) { List<String> disallowedKeyspaces = configuration.disallowedKeyspaces(); if (null == disallowedKeyspaces) { return DEFAULT_FILTER; } else { return Sets.union(DEFAULT_FILTER, ImmutableSet.copyOf(disallowedKeyspaces)); } } }
Schema { @VisibleForTesting public static Set<String> getKeyspaceFilter(JobConfiguration configuration) { List<String> disallowedKeyspaces = configuration.disallowedKeyspaces(); if (null == disallowedKeyspaces) { return DEFAULT_FILTER; } else { return Sets.union(DEFAULT_FILTER, ImmutableSet.copyOf(disallowedKeyspaces)); } } Schema(Metadata metadata, JobConfiguration configuration);  Schema(Set<KeyspaceTablePair> qualifiedTables); }
Schema { @VisibleForTesting public static Set<String> getKeyspaceFilter(JobConfiguration configuration) { List<String> disallowedKeyspaces = configuration.disallowedKeyspaces(); if (null == disallowedKeyspaces) { return DEFAULT_FILTER; } else { return Sets.union(DEFAULT_FILTER, ImmutableSet.copyOf(disallowedKeyspaces)); } } Schema(Metadata metadata, JobConfiguration configuration);  Schema(Set<KeyspaceTablePair> qualifiedTables); Schema intersect(Schema other); List<KeyspaceTablePair> toQualifiedTableList(); int size(); @VisibleForTesting static Set<String> getKeyspaceFilter(JobConfiguration configuration); static Pair<Set<KeyspaceTablePair>, Set<KeyspaceTablePair>> difference(Schema first, Schema second); }
Schema { @VisibleForTesting public static Set<String> getKeyspaceFilter(JobConfiguration configuration) { List<String> disallowedKeyspaces = configuration.disallowedKeyspaces(); if (null == disallowedKeyspaces) { return DEFAULT_FILTER; } else { return Sets.union(DEFAULT_FILTER, ImmutableSet.copyOf(disallowedKeyspaces)); } } Schema(Metadata metadata, JobConfiguration configuration);  Schema(Set<KeyspaceTablePair> qualifiedTables); Schema intersect(Schema other); List<KeyspaceTablePair> toQualifiedTableList(); int size(); @VisibleForTesting static Set<String> getKeyspaceFilter(JobConfiguration configuration); static Pair<Set<KeyspaceTablePair>, Set<KeyspaceTablePair>> difference(Schema first, Schema second);  }