@Test public void testDatasetNotPartitioned() { Datasets.delete("dataset:file:/tmp/datasets/ns/test"); final Dataset<GenericRecord> ds = Datasets.create( "dataset:file:/tmp/datasets/ns/test", new DatasetDescriptor.Builder() .schema(schema) .build()); Assert.assertEquals("Should work for empty relative directory", ds, FileSystemDatasets.viewForUri(ds, "file:/tmp/datasets/ns/test")); TestHelpers.assertThrows("Should reject paths in a non-partitioned dataset", IllegalArgumentException.class, new Runnable() { @Override public void run() { FileSystemDatasets.viewForUri(ds, "y=2014/m=03/d=14"); } }); }
public static <E> View<E> viewForUri(Dataset<E> dataset, URI uri) { if (dataset instanceof FileSystemDataset) { return ((FileSystemDataset<E>) dataset).viewForUri(uri); } throw new IllegalArgumentException("Not a file system dataset: " + dataset); }
FileSystemDatasets { public static <E> View<E> viewForUri(Dataset<E> dataset, URI uri) { if (dataset instanceof FileSystemDataset) { return ((FileSystemDataset<E>) dataset).viewForUri(uri); } throw new IllegalArgumentException("Not a file system dataset: " + dataset); } }
FileSystemDatasets { public static <E> View<E> viewForUri(Dataset<E> dataset, URI uri) { if (dataset instanceof FileSystemDataset) { return ((FileSystemDataset<E>) dataset).viewForUri(uri); } throw new IllegalArgumentException("Not a file system dataset: " + dataset); }  }
FileSystemDatasets { public static <E> View<E> viewForUri(Dataset<E> dataset, URI uri) { if (dataset instanceof FileSystemDataset) { return ((FileSystemDataset<E>) dataset).viewForUri(uri); } throw new IllegalArgumentException("Not a file system dataset: " + dataset); }  static View<E> viewForUri(Dataset<E> dataset, URI uri); static View<E> viewForUri(Dataset<E> dataset, String uri); static View<E> viewForPath(Dataset<E> dataset, Path path); }
FileSystemDatasets { public static <E> View<E> viewForUri(Dataset<E> dataset, URI uri) { if (dataset instanceof FileSystemDataset) { return ((FileSystemDataset<E>) dataset).viewForUri(uri); } throw new IllegalArgumentException("Not a file system dataset: " + dataset); }  static View<E> viewForUri(Dataset<E> dataset, URI uri); static View<E> viewForUri(Dataset<E> dataset, String uri); static View<E> viewForPath(Dataset<E> dataset, Path path);  }