You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by "Ayush Saxena (Jira)" <ji...@apache.org> on 2019/12/07 20:09:00 UTC

[jira] [Created] (HDDS-2692) Seek to file end throws EOF Exception

Ayush Saxena created HDDS-2692:
----------------------------------

             Summary: Seek to file end throws EOF Exception
                 Key: HDDS-2692
                 URL: https://issues.apache.org/jira/browse/HDDS-2692
             Project: Hadoop Distributed Data Store
          Issue Type: Bug
            Reporter: Ayush Saxena
            Assignee: Ayush Saxena


Seek to File Length position throws EOF.
Seeks by default should throw EOF past FileLength, not at file length position.

Even in DFSInputStream it throws EOF above FileLength :

{code:java}
  public synchronized void seek(long targetPos) throws IOException {
    if (targetPos > getFileLength()) {
      throw new EOFException("Cannot seek after EOF");
    }
{code}

Due to this behaviour EOF is shown as part of tail command too.

{noformat}
ayush@ayushpc:~/ozone/hadoop-ozone/hadoop-ozone/dist/target/ozone-0.5.0-SNAPSHOT/bin$ ./ozone fs -tail -f /file
2019-12-08 01:21:34,088 [main] INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
2019-12-08 01:21:34,137 [main] INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 10 second(s).
2019-12-08 01:21:34,137 [main] INFO impl.MetricsSystemImpl: XceiverClientMetrics metrics system started
Test
tail: EOF encountered at pos: 5 for key: file

{noformat}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org