[
https://issues.apache.org/jira/browse/HDFS-9607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15080571#comment-15080571
]
Dinesh S. Atreya commented on HDFS-9607:
----------------------------------------
Please choose which of the following API signatures are preferable by the HDFS
team. Note that “write” similar to POSIX is not supported. Only limited
write-in-place is supported. A detailed design document can be prepared after
the APIs are agreed upon,
First alternative is given hereunder:
{code:title= FSWriteInPlaceStream.java|borderStyle=solid}
long getPos()
// Get the current position in the input stream.
void seek(long desiredWritePos)
// Seek to the given offset.
int writeInPlace(long position, int readLength, byte[] writeBuffer)
// Write/Update bytes from writeBuffer up to previously read length
// at given position in file
int writeInPlace(int readLength, byte[] writeBuffer)
// Write/Update bytes from writeBuffer up to previously read length
// after seek in file
boolean checkWriteInPlace(long position, int readLength, byte[] writeBuffer)
// Check whether Write/Update of bytes from writeBuffer up to
// previously read length at given position is possible inside file
boolean checkWriteInPlace(int readLength, byte[] writeBuffer)
// Check whether Write/Update of bytes from writeBuffer up to
// previously read length after seek is possible inside file
{code}
Second alternative is given below:
{code:title= FSWriteInPlaceStream.java|borderStyle=solid}
long getPos()
// Get the current position in the input stream.
void seek(long desiredWritePos)
// Seek to the given offset.
int updtInPlace(long position, int readLength, byte[] writeBuffer)
// Write/Update bytes from writeBuffer up to previously read length
// at given position in file
int updtInPlace(int readLength, byte[] writeBuffer)
// Write/Update bytes from writeBuffer up to previously read length
// after seek in file
boolean checkUpdtInPlace(long position, int readLength, byte[] writeBuffer)
// Check whether Write/Update of bytes from writeBuffer up to
// previously read length at given position is possible inside file
boolean checkUpdtInPlace(int readLength, byte[] writeBuffer)
// Check whether Write/Update of bytes from writeBuffer up to
// previously read length after seek is possible inside file
{code}
Please indicate the preferred class name as well. One alternative is
FSWriteInPlaceStream (which extends FSDataOutputStream) that explicitly
specifies that only writes/updates in-place are supported.
> Advance Hadoop Architecture (AHA) - HDFS
> ----------------------------------------
>
> Key: HDFS-9607
> URL: https://issues.apache.org/jira/browse/HDFS-9607
> Project: Hadoop HDFS
> Issue Type: New Feature
> Reporter: Dinesh S. Atreya
>
> Link to Umbrella JIRA
> https://issues.apache.org/jira/browse/HADOOP-12620
> Provide capability to carry out in-place writes/updates. Only writes in-place
> are supported where the existing length does not change.
> For example, "Hello World" can be replaced by "Hello HDFS!"
> See
> https://issues.apache.org/jira/browse/HADOOP-12620?focusedCommentId=15046300&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-15046300
> for more details.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)