apache / apache/pinot

Rephrase the description of PinotFS lastModified OR even deprecate it

Open
#11,491 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
6.1k
Forks
1.5k
Avg merge
2d 55m
Merged PRs (30d)
182

Description

```
/**
* Returns the age of the file
* @param uri location of file or directory
* @return A long value representing the time the file was last modified, measured in milliseconds since epoch
* (00:00:00 GMT, January 1, 1970) or 0L if the file does not exist or if an I/O error occurs
* @throws IOException if uri is not valid or not present
*/
long lastModified(URI uri)
throws IOException;
```

Return 0L is very error prone since user might forgot to check the result. The narrative "return 0L if the file does not exist or if an I/O error occurs" and "throws IOException if uri is not valid or not present" are irreconcilable paradoxes.

Given that some teams might already implement this interface with 0L check. Can we deprecate lastModified(URI uir) and create a new method, e.g., `modifyTime(URI uri)`

cc: @ankitsultana

Contributor guide

Open the contributing guide

Research direction

Start by locating the PinotFS interface and reviewing its lastModified(URI) contract, implementations, and callers. Determine whether the API should be reworded or replaced and deprecated, then ensure the chosen behavior and compatibility path are consistent across the interface and its users.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.