@Override public DatasetRepository getFromOptions(Map<String, String> match) { final Path root; String path = match.get("path"); if (match.containsKey("absolute") && Boolean.valueOf(match.get("absolute"))) { root = (path == null || path.isEmpty()) ? new Path("/") : new Path("/", path); } else { root = (path == null || path.isEmpty()) ? new Path(".") : new Path(path); } Configuration conf = DefaultConfiguration.get(); FileSystem fs; try { fs = FileSystem.get(fileSystemURI(match), conf); } catch (IOException e) { // "Incomplete HDFS URI, no host" => add a helpful suggestion if (e.getMessage().startsWith("Incomplete")) { throw new DatasetIOException("Could not get a FileSystem: " + "make sure the default " + match.get(URIPattern.SCHEME) + " URI is configured.", e); } throw new DatasetIOException("Could not get a FileSystem", e); } return new FileSystemDatasetRepository.Builder() .configuration(new Configuration(conf)) // make a modifiable copy .rootDirectory(fs.makeQualified(root)) .build(); } }
@Override public DatasetRepository getFromOptions(Map<String, String> match) { String path = match.get("path"); final Path root = (path == null || path.isEmpty()) ? new Path("/") : new Path("/", path); Configuration conf = DefaultConfiguration.get(); FileSystem fs; try { fs = FileSystem.get(fileSystemURI(match), conf); } catch (IOException e) { // "Incomplete HDFS URI, no host" => add a helpful suggestion if (e.getMessage().startsWith("Incomplete")) { throw new DatasetIOException("Could not get a FileSystem: " + "make sure the credentials for " + match.get(URIPattern.SCHEME) + " URIs are configured.", e); } throw new DatasetIOException("Could not get a FileSystem", e); } return new FileSystemDatasetRepository.Builder() .configuration(new Configuration(conf)) // make a modifiable copy .rootDirectory(fs.makeQualified(root)) .build(); } }
@Override public DatasetRepository getFromOptions(Map<String, String> match) { String path = match.get("path"); final Path root = (path == null || path.isEmpty()) ? new Path("/") : new Path("/", path); Configuration conf = DefaultConfiguration.get(); FileSystem fs; try { fs = FileSystem.get(fileSystemURI(match), conf); } catch (IOException e) { // "Incomplete HDFS URI, no host" => add a helpful suggestion if (e.getMessage().startsWith("Incomplete")) { throw new DatasetIOException("Could not get a FileSystem: " + "make sure the credentials for " + match.get(URIPattern.SCHEME) + " URIs are configured.", e); } throw new DatasetIOException("Could not get a FileSystem", e); } return new FileSystemDatasetRepository.Builder() .configuration(new Configuration(conf)) // make a modifiable copy .rootDirectory(fs.makeQualified(root)) .build(); } }
@Override public void afterPropertiesSet() throws Exception { Assert.notNull(conf, "The configuration property is required"); Assert.notNull(namespace, "The namespace property is required"); this.repo = new FileSystemDatasetRepository.Builder() .rootDirectory(new URI(basePath)).configuration(conf).build(); }
@Override public DatasetRepository newRepo() { return new FileSystemDatasetRepository.Builder() .configuration(conf) .rootDirectory(URI.create("target/data")) .build(); }
@Override public DatasetRepository newRepo() { return new FileSystemDatasetRepository.Builder() .configuration(conf) .rootDirectory(URI.create("target/data")) .build(); }
public DatasetRepository newRepo() { return new FileSystemDatasetRepository.Builder() .configuration(conf) .rootDirectory(URI.create("target/data")) .build(); }
@Before public void setUp() throws Exception { Configuration conf = new Configuration(); FileSystem fileSystem = FileSystem.get(conf); Path testDirectory = fileSystem.makeQualified( new Path(Files.createTempDir().getAbsolutePath())); this.repo = new FileSystemDatasetRepository.Builder() .configuration(conf) .rootDirectory(testDirectory) .build(); }