@Test public void testConstraintsGetReadyTimestampNotYetSignaled() throws IOException { SignalManager manager = new SignalManager(fileSystem, testDirectory); Constraints constraints = new Constraints(DatasetTestUtilities.USER_SCHEMA). with("email", "testConstraintsGetReadyTimestampNotYetSignaled@domain.com"); Assert.assertEquals("A constraint that is not signaled should show -1", -1, manager.getReadyTimestamp(constraints)); }
public long getReadyTimestamp(Constraints viewConstraints) { String normalizedConstraints = getNormalizedConstraints(viewConstraints); Path signalPath = new Path(signalDirectory, normalizedConstraints); try { try { FileStatus signalStatus = rootFileSystem.getFileStatus(signalPath); return signalStatus.getModificationTime(); } catch (final FileNotFoundException ex) { } return -1; } catch (IOException e) { throw new DatasetIOException("Could not access signal path: " + signalPath, e); } }
SignalManager { public long getReadyTimestamp(Constraints viewConstraints) { String normalizedConstraints = getNormalizedConstraints(viewConstraints); Path signalPath = new Path(signalDirectory, normalizedConstraints); try { try { FileStatus signalStatus = rootFileSystem.getFileStatus(signalPath); return signalStatus.getModificationTime(); } catch (final FileNotFoundException ex) { } return -1; } catch (IOException e) { throw new DatasetIOException("Could not access signal path: " + signalPath, e); } } }
SignalManager { public long getReadyTimestamp(Constraints viewConstraints) { String normalizedConstraints = getNormalizedConstraints(viewConstraints); Path signalPath = new Path(signalDirectory, normalizedConstraints); try { try { FileStatus signalStatus = rootFileSystem.getFileStatus(signalPath); return signalStatus.getModificationTime(); } catch (final FileNotFoundException ex) { } return -1; } catch (IOException e) { throw new DatasetIOException("Could not access signal path: " + signalPath, e); } } SignalManager(FileSystem fileSystem, Path signalDirectory); }
SignalManager { public long getReadyTimestamp(Constraints viewConstraints) { String normalizedConstraints = getNormalizedConstraints(viewConstraints); Path signalPath = new Path(signalDirectory, normalizedConstraints); try { try { FileStatus signalStatus = rootFileSystem.getFileStatus(signalPath); return signalStatus.getModificationTime(); } catch (final FileNotFoundException ex) { } return -1; } catch (IOException e) { throw new DatasetIOException("Could not access signal path: " + signalPath, e); } } SignalManager(FileSystem fileSystem, Path signalDirectory); void signalReady(Constraints viewConstraints); long getReadyTimestamp(Constraints viewConstraints); static String getNormalizedConstraints(Constraints constraints); }
SignalManager { public long getReadyTimestamp(Constraints viewConstraints) { String normalizedConstraints = getNormalizedConstraints(viewConstraints); Path signalPath = new Path(signalDirectory, normalizedConstraints); try { try { FileStatus signalStatus = rootFileSystem.getFileStatus(signalPath); return signalStatus.getModificationTime(); } catch (final FileNotFoundException ex) { } return -1; } catch (IOException e) { throw new DatasetIOException("Could not access signal path: " + signalPath, e); } } SignalManager(FileSystem fileSystem, Path signalDirectory); void signalReady(Constraints viewConstraints); long getReadyTimestamp(Constraints viewConstraints); static String getNormalizedConstraints(Constraints constraints);  }