/** * @return a set of entities (program and data it accesses) associated with a program run. */ @Override public Set<NamespacedEntityId> getEntitiesForRun(final ProgramRunId run) { return execute(input -> input.getEntitiesForRun(run)); }
/** * Fetch program-stream access information for a dataset for a given period. * * @param stream stream for which to fetch access information * @param start start time period * @param end end time period * @param filter filter to be applied on result set * @return program-stream access information */ @Override public Set<Relation> getRelations(final StreamId stream, final long start, final long end, final Predicate<Relation> filter) { return execute(input -> input.getRelations(stream, start, end, filter)); }
private byte[] getDatasetScanEndKey(DatasetId datasetInstance, long start) { // time is inverted, hence we need to have start time in end key. // Since start time is inclusive, subtract 1 to make it exclusive. return getDatasetScanKey(datasetInstance, start - 1); }
@Override public void apply() throws Exception { lineageDataset.addAccess(run, datasetInstance, AccessType.READ, accessTimeMillis); } });
/** * Gets an instance of {@link LineageDataset}. The dataset instance will be created if it is not yet exist. * * @param datasetContext the {@link DatasetContext} for getting the dataset instance. * @param datasetFramework the {@link DatasetFramework} for creating the dataset instance if missing * @return an instance of {@link LineageDataset} */ public static LineageDataset getLineageDataset(DatasetContext datasetContext, DatasetFramework datasetFramework) { return getLineageDataset(datasetContext, datasetFramework, LINEAGE_DATASET_ID); }
@Override public LineageDataset getDataset(DatasetContext datasetContext, DatasetSpecification spec, Map<String, String> arguments, ClassLoader classLoader) throws IOException { Table table = getDataset(datasetContext, ACCESS_REGISTRY_TABLE, spec, arguments, classLoader); return new LineageDataset(spec.getName(), table); } }
private byte[] getProgramScanEndKey(ProgramId program, long start) { // time is inverted, hence we need to have start time in end key. // Since start time is inclusive, subtract 1 to make it exclusive. return getProgramScanKey(program, start - 1); }
private byte[] getStreamScanStartKey(StreamId stream, long end) { // time is inverted, hence we need to have end time in start key. // Since end time is exclusive, add 1 to make it inclusive. return getStreamScanKey(stream, end + 1); }
/** * Fetch program-dataset access information for a dataset for a given period. * * @param datasetInstance dataset for which to fetch access information * @param start start time period * @param end end time period * @param filter filter to be applied on result set * @return program-dataset access information */ @Override public Set<Relation> getRelations(final DatasetId datasetInstance, final long start, final long end, final Predicate<Relation> filter) { return execute(input -> input.getRelations(datasetInstance, start, end, filter)); }
/** * @return a set of entities (program and data it accesses) associated with a program run. */ @Override public Set<NamespacedEntityId> getEntitiesForRun(final ProgramRunId run) { return execute(input -> input.getEntitiesForRun(run)); }
/** * Gets an instance of {@link LineageDataset}. The dataset instance will be created if it is not yet exist. * * @param datasetContext the {@link DatasetContext} for getting the dataset instance. * @param datasetFramework the {@link DatasetFramework} for creating the dataset instance if missing * @return an instance of {@link LineageDataset} */ public static LineageDataset getLineageDataset(DatasetContext datasetContext, DatasetFramework datasetFramework) { return getLineageDataset(datasetContext, datasetFramework, LINEAGE_DATASET_ID); }
private byte[] getProgramScanStartKey(ProgramId program, long end) { // time is inverted, hence we need to have end time in start key. // Since end time is exclusive, add 1 to make it inclusive (except when end is max long, which will overflow if +1) return getProgramScanKey(program, end == Long.MAX_VALUE ? end : end + 1); }
private byte[] getDatasetScanStartKey(DatasetId datasetInstance, long end) { // time is inverted, hence we need to have end time in start key. // Since end time is exclusive, add 1 to make it inclusive. return getDatasetScanKey(datasetInstance, end + 1); }
private byte[] getStreamScanEndKey(StreamId stream, long start) { // time is inverted, hence we need to have start time in end key. // Since start time is inclusive, subtract 1 to make it exclusive. return getStreamScanKey(stream, start - 1); }
/** * Fetch program-dataset access information for a dataset for a given period. * * @param datasetInstance dataset for which to fetch access information * @param start start time period * @param end end time period * @param filter filter to be applied on result set * @return program-dataset access information */ @Override public Set<Relation> getRelations(final DatasetId datasetInstance, final long start, final long end, final Predicate<Relation> filter) { return execute(input -> input.getRelations(datasetInstance, start, end, filter)); }
private byte[] getProgramScanEndKey(ProgramId program, long start) { // time is inverted, hence we need to have start time in end key. // Since start time is inclusive, subtract 1 to make it exclusive. return getProgramScanKey(program, start - 1); }
private byte[] getDatasetScanStartKey(DatasetId datasetInstance, long end) { // time is inverted, hence we need to have end time in start key. // Since end time is exclusive, add 1 to make it inclusive. return getDatasetScanKey(datasetInstance, end + 1); }
/** * Fetch program-dataset access information for a program for a given period. * * @param program program for which to fetch access information * @param start start time period * @param end end time period * @param filter filter to be applied on result set * @return program-dataset access information */ @Override public Set<Relation> getRelations(final ProgramId program, final long start, final long end, final Predicate<Relation> filter) { return execute(input -> input.getRelations(program, start, end, filter)); }
private byte[] getProgramScanStartKey(ProgramId program, long end) { // time is inverted, hence we need to have end time in start key. // Since end time is exclusive, add 1 to make it inclusive (except when end is max long, which will overflow if +1) return getProgramScanKey(program, end == Long.MAX_VALUE ? end : end + 1); }
/** * Fetch program-dataset access information for a program for a given period. * * @param program program for which to fetch access information * @param start start time period * @param end end time period * @param filter filter to be applied on result set * @return program-dataset access information */ @Override public Set<Relation> getRelations(final ProgramId program, final long start, final long end, final Predicate<Relation> filter) { return execute(input -> input.getRelations(program, start, end, filter)); }