@Test public void testRangeWithEmptyDirectory() throws Exception { long start = new DateTime(2013, 9, 1, 0, 0, DateTimeZone.UTC).getMillis(); long end = new DateTime(2013, 11, 14, 0, 0, DateTimeZone.UTC).getMillis(); final RefinableView<StandardEvent> range = unbounded .from("timestamp", start).toBefore("timestamp", end); DatasetWriter<StandardEvent> writer = null; try { writer = range.newWriter(); writer.write(sepEvent); writer.write(novEvent); } finally { Closeables.close(writer, false); } final Path root = new Path("target/data/ns/test"); final Path y2013 = new Path("target/data/ns/test/year=2013"); final Path sep = new Path("target/data/ns/test/year=2013/month=09"); final Path sep12 = new Path("target/data/ns/test/year=2013/month=09/day=12"); final Path nov = new Path("target/data/ns/test/year=2013/month=11"); final Path nov11 = new Path("target/data/ns/test/year=2013/month=11/day=11"); assertDirectoriesExist(fs, root, y2013, sep, sep12, nov, nov11); final Path oct = new Path("target/data/ns/test/year=2013/month=10"); final Path oct12 = new Path("target/data/ns/test/year=2013/month=10/day=12"); assertTrue("mkdir should return true to indicate FS changed.", fs.mkdirs(oct12)); assertDirectoriesExist(fs, oct, oct12); assertContentEquals(Sets.newHashSet(sepEvent, novEvent), range); }
@Override public DatasetWriter<E> newWriter() { checkSchemaForWrite(); AbstractDatasetWriter<E> writer; if (dataset.getDescriptor().isPartitioned()) { writer = PartitionedDatasetWriter.newWriter(this); } else { writer = FileSystemWriter.newWriter( fs, root, -1, -1 , dataset.getDescriptor(), this.getAccessor().getWriteSchema()); } writer.initialize(); return writer; }
FileSystemView extends AbstractRefinableView<E> implements InputFormatAccessor<E>,
    LastModifiedAccessor, SizeAccessor, Signalable<E> { @Override public DatasetWriter<E> newWriter() { checkSchemaForWrite(); AbstractDatasetWriter<E> writer; if (dataset.getDescriptor().isPartitioned()) { writer = PartitionedDatasetWriter.newWriter(this); } else { writer = FileSystemWriter.newWriter( fs, root, -1, -1 , dataset.getDescriptor(), this.getAccessor().getWriteSchema()); } writer.initialize(); return writer; } }
FileSystemView extends AbstractRefinableView<E> implements InputFormatAccessor<E>,
    LastModifiedAccessor, SizeAccessor, Signalable<E> { @Override public DatasetWriter<E> newWriter() { checkSchemaForWrite(); AbstractDatasetWriter<E> writer; if (dataset.getDescriptor().isPartitioned()) { writer = PartitionedDatasetWriter.newWriter(this); } else { writer = FileSystemWriter.newWriter( fs, root, -1, -1 , dataset.getDescriptor(), this.getAccessor().getWriteSchema()); } writer.initialize(); return writer; } FileSystemView(FileSystemDataset<E> dataset, @Nullable PartitionListener listener, @Nullable SignalManager signalManager, Class<E> type);   FileSystemView(FileSystemView<E> view, Constraints c); private  FileSystemView(FileSystemView<?> view, Schema schema, Class<E> type); }
FileSystemView extends AbstractRefinableView<E> implements InputFormatAccessor<E>,
    LastModifiedAccessor, SizeAccessor, Signalable<E> { @Override public DatasetWriter<E> newWriter() { checkSchemaForWrite(); AbstractDatasetWriter<E> writer; if (dataset.getDescriptor().isPartitioned()) { writer = PartitionedDatasetWriter.newWriter(this); } else { writer = FileSystemWriter.newWriter( fs, root, -1, -1 , dataset.getDescriptor(), this.getAccessor().getWriteSchema()); } writer.initialize(); return writer; } FileSystemView(FileSystemDataset<E> dataset, @Nullable PartitionListener listener, @Nullable SignalManager signalManager, Class<E> type);   FileSystemView(FileSystemView<E> view, Constraints c); private  FileSystemView(FileSystemView<?> view, Schema schema, Class<E> type); @Override DatasetReader<E> newReader(); @Override DatasetWriter<E> newWriter(); @Override Iterable<PartitionView<E>> getCoveringPartitions(); @Override boolean deleteAll(); @Override boolean moveToTrash(); @Override InputFormat<E, Void> getInputFormat(Configuration conf); @Override long getSize(); @Override long getLastModified(); @Override void signalReady(); @Override boolean isReady(); }
FileSystemView extends AbstractRefinableView<E> implements InputFormatAccessor<E>,
    LastModifiedAccessor, SizeAccessor, Signalable<E> { @Override public DatasetWriter<E> newWriter() { checkSchemaForWrite(); AbstractDatasetWriter<E> writer; if (dataset.getDescriptor().isPartitioned()) { writer = PartitionedDatasetWriter.newWriter(this); } else { writer = FileSystemWriter.newWriter( fs, root, -1, -1 , dataset.getDescriptor(), this.getAccessor().getWriteSchema()); } writer.initialize(); return writer; } FileSystemView(FileSystemDataset<E> dataset, @Nullable PartitionListener listener, @Nullable SignalManager signalManager, Class<E> type);   FileSystemView(FileSystemView<E> view, Constraints c); private  FileSystemView(FileSystemView<?> view, Schema schema, Class<E> type); @Override DatasetReader<E> newReader(); @Override DatasetWriter<E> newWriter(); @Override Iterable<PartitionView<E>> getCoveringPartitions(); @Override boolean deleteAll(); @Override boolean moveToTrash(); @Override InputFormat<E, Void> getInputFormat(Configuration conf); @Override long getSize(); @Override long getLastModified(); @Override void signalReady(); @Override boolean isReady();  }