@Test public void testGetHiveSpecs() throws IOException { State state = new State(); state.appendToListProp(HiveRegistrationPolicyBase.HIVE_DATABASE_NAME, "db1"); state.appendToListProp(ADDITIONAL_HIVE_DATABASE_NAMES, "db2"); state.appendToListProp(HiveRegistrationPolicyBase.HIVE_TABLE_NAME, "tbl1"); state.appendToListProp(HiveRegistrationPolicyBase.ADDITIONAL_HIVE_TABLE_NAMES, "tbl2,tbl3"); this.path = new Path(getClass().getResource("/test-hive-table").toString()); Collection<HiveSpec> specs = new HiveRegistrationPolicyBase(state).getHiveSpecs(this.path); Assert.assertEquals(specs.size(), 6); Iterator<HiveSpec> iterator = specs.iterator(); HiveSpec spec = iterator.next(); examine(spec, "db1", "tbl1"); spec = iterator.next(); examine(spec, "db1", "tbl2"); spec = iterator.next(); examine(spec, "db1", "tbl3"); spec = iterator.next(); examine(spec, "db2", "tbl1"); spec = iterator.next(); examine(spec, "db2", "tbl2"); spec = iterator.next(); examine(spec, "db2", "tbl3"); }
@Override public Collection<HiveSpec> getHiveSpecs(Path path) throws IOException { List<HiveSpec> specs = Lists.newArrayList(); for (HiveTable table : getTables(path)) { specs.add(new SimpleHiveSpec.Builder<>(path).withTable(table).withPartition(getPartition(path, table)).build()); } return specs; }
HiveRegistrationPolicyBase implements HiveRegistrationPolicy { @Override public Collection<HiveSpec> getHiveSpecs(Path path) throws IOException { List<HiveSpec> specs = Lists.newArrayList(); for (HiveTable table : getTables(path)) { specs.add(new SimpleHiveSpec.Builder<>(path).withTable(table).withPartition(getPartition(path, table)).build()); } return specs; } }
HiveRegistrationPolicyBase implements HiveRegistrationPolicy { @Override public Collection<HiveSpec> getHiveSpecs(Path path) throws IOException { List<HiveSpec> specs = Lists.newArrayList(); for (HiveTable table : getTables(path)) { specs.add(new SimpleHiveSpec.Builder<>(path).withTable(table).withPartition(getPartition(path, table)).build()); } return specs; } HiveRegistrationPolicyBase(State props); }
HiveRegistrationPolicyBase implements HiveRegistrationPolicy { @Override public Collection<HiveSpec> getHiveSpecs(Path path) throws IOException { List<HiveSpec> specs = Lists.newArrayList(); for (HiveTable table : getTables(path)) { specs.add(new SimpleHiveSpec.Builder<>(path).withTable(table).withPartition(getPartition(path, table)).build()); } return specs; } HiveRegistrationPolicyBase(State props); @Override Collection<HiveSpec> getHiveSpecs(Path path); static HiveRegistrationPolicy getPolicy(State props); }
HiveRegistrationPolicyBase implements HiveRegistrationPolicy { @Override public Collection<HiveSpec> getHiveSpecs(Path path) throws IOException { List<HiveSpec> specs = Lists.newArrayList(); for (HiveTable table : getTables(path)) { specs.add(new SimpleHiveSpec.Builder<>(path).withTable(table).withPartition(getPartition(path, table)).build()); } return specs; } HiveRegistrationPolicyBase(State props); @Override Collection<HiveSpec> getHiveSpecs(Path path); static HiveRegistrationPolicy getPolicy(State props); static final String HIVE_DATABASE_NAME; static final String ADDITIONAL_HIVE_DATABASE_NAMES; static final String HIVE_DATABASE_REGEX; static final String HIVE_DATABASE_NAME_PREFIX; static final String HIVE_DATABASE_NAME_SUFFIX; static final String HIVE_TABLE_NAME; static final String ADDITIONAL_HIVE_TABLE_NAMES; static final String HIVE_TABLE_REGEX; static final String HIVE_TABLE_NAME_PREFIX; static final String HIVE_TABLE_NAME_SUFFIX; static final String HIVE_SANITIZE_INVALID_NAMES; static final String HIVE_FS_URI; static final String PRIMARY_TABLE_TOKEN; static final String CONFIG_FOR_TOPIC_TIMER; }