@Test public void testParseExportDir() { List<ImportedTableInfo.DirectoryMapping> out; out = ImportTable.parseExportDir(null); assertEquals(0, out.size()); out = ImportTable.parseExportDir(Set.of("")); assertEquals(0, out.size()); out = ImportTable.parseExportDir(Set.of("hdfs: assertEquals(1, out.size()); assertEquals("hdfs: assertNull(out.get(0).importDir); out = ImportTable .parseExportDir(Set.of("hdfs: assertEquals(2, out.size()); out = out.stream().filter(i -> i.importDir == null).collect(Collectors.toList()); assertEquals(2, out.size()); out = out.stream().filter(i -> !i.exportDir.equals("hdfs: .filter(i -> !i.exportDir.equals("hdfs: .collect(Collectors.toList()); assertEquals(0, out.size()); }
static List<ImportedTableInfo.DirectoryMapping> parseExportDir(Set<String> exportDirs) { if (exportDirs == null || exportDirs.isEmpty()) { return Collections.emptyList(); } return exportDirs.stream().filter(not(String::isEmpty)) .map(ImportedTableInfo.DirectoryMapping::new).collect(Collectors.toList()); }
ImportTable extends MasterRepo { static List<ImportedTableInfo.DirectoryMapping> parseExportDir(Set<String> exportDirs) { if (exportDirs == null || exportDirs.isEmpty()) { return Collections.emptyList(); } return exportDirs.stream().filter(not(String::isEmpty)) .map(ImportedTableInfo.DirectoryMapping::new).collect(Collectors.toList()); } }
ImportTable extends MasterRepo { static List<ImportedTableInfo.DirectoryMapping> parseExportDir(Set<String> exportDirs) { if (exportDirs == null || exportDirs.isEmpty()) { return Collections.emptyList(); } return exportDirs.stream().filter(not(String::isEmpty)) .map(ImportedTableInfo.DirectoryMapping::new).collect(Collectors.toList()); } ImportTable(String user, String tableName, Set<String> exportDirs,
      NamespaceId namespaceId); }
ImportTable extends MasterRepo { static List<ImportedTableInfo.DirectoryMapping> parseExportDir(Set<String> exportDirs) { if (exportDirs == null || exportDirs.isEmpty()) { return Collections.emptyList(); } return exportDirs.stream().filter(not(String::isEmpty)) .map(ImportedTableInfo.DirectoryMapping::new).collect(Collectors.toList()); } ImportTable(String user, String tableName, Set<String> exportDirs,
      NamespaceId namespaceId); @Override long isReady(long tid, Master environment); @Override Repo<Master> call(long tid, Master env); @SuppressFBWarnings(value = "OS_OPEN_STREAM", justification = "closing intermediate readers would close the ZipInputStream") void checkVersions(Master env); @Override void undo(long tid, Master env); }
ImportTable extends MasterRepo { static List<ImportedTableInfo.DirectoryMapping> parseExportDir(Set<String> exportDirs) { if (exportDirs == null || exportDirs.isEmpty()) { return Collections.emptyList(); } return exportDirs.stream().filter(not(String::isEmpty)) .map(ImportedTableInfo.DirectoryMapping::new).collect(Collectors.toList()); } ImportTable(String user, String tableName, Set<String> exportDirs,
      NamespaceId namespaceId); @Override long isReady(long tid, Master environment); @Override Repo<Master> call(long tid, Master env); @SuppressFBWarnings(value = "OS_OPEN_STREAM", justification = "closing intermediate readers would close the ZipInputStream") void checkVersions(Master env); @Override void undo(long tid, Master env);  }