@Override protected <T> AbstractRefinableView<T> project(Schema schema, Class<T> type) { return new FileSystemView<T>(this, schema, type); }
@Override protected FileSystemView<E> filter(Constraints c) { return new FileSystemView<E>(this, c); }
@Before public void setUp() throws IOException { this.conf = new Configuration(); this.fileSystem = FileSystem.get(conf); this.testDirectory = new Path(Files.createTempDir().getAbsolutePath()); this.repo = new FileSystemDatasetRepository(conf, testDirectory); PartitionStrategy partitionStrategy = new PartitionStrategy.Builder() .hash("username", 2).build(); FileSystemDataset<Object> users = (FileSystemDataset<Object>) repo.create( "ns", "users", new DatasetDescriptor.Builder() .schema(USER_SCHEMA) .partitionStrategy(partitionStrategy) .build()); writer = PartitionedDatasetWriter.newWriter( new FileSystemView<Object>(users, null, null, Object.class)); }
@Before public void setUp() throws IOException { this.conf = new Configuration(); this.fileSystem = FileSystem.get(conf); this.testDirectory = new Path(Files.createTempDir().getAbsolutePath()); this.repo = new FileSystemDatasetRepository(conf, testDirectory, new EnusrePartitionPathDoesNotExistMetadataProvider(conf, testDirectory)); partitionStrategy = new PartitionStrategy.Builder() .hash("username", 2).build(); FileSystemDataset<Object> users = (FileSystemDataset<Object>) repo.create( "ns", "users", new DatasetDescriptor.Builder() .schema(USER_SCHEMA) .partitionStrategy(partitionStrategy) .build()); view = new FileSystemView<Object>(users, null, null, Object.class); }
@Test public void testNullSignalManager() { FileSystemDataset<StandardEvent> ds = (FileSystemDataset<StandardEvent>) unbounded.getDataset(); FileSystemView<StandardEvent> view = new FileSystemView<StandardEvent>(ds, null, null, StandardEvent.class); // getlast modified Assert.assertTrue("Last modified does not require access to signal manager", view.getLastModified() >= -1); view.signalReady(); Assert.assertFalse("View should not be signaled without manager", view.isReady()); }