@Test public void testConstraintsGetReadyTimestamp() throws IOException { SignalManager manager = new SignalManager(fileSystem, testDirectory); Constraints constraints = new Constraints(DatasetTestUtilities.USER_SCHEMA). with("email", "testConstraintsReady@domain.com"); Path signalFilePath = new Path(this.testDirectory, "email=testConstraintsReady%40domain.com"); FSDataOutputStream stream = this.fileSystem.create(signalFilePath, true); stream.writeUTF(String.valueOf(System.currentTimeMillis())); stream.close(); Assert.assertTrue(manager.getReadyTimestamp(constraints) != -1); }
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);  }