[
https://issues.apache.org/jira/browse/PHOENIX-5123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16760361#comment-16760361
]
Andrew Purtell edited comment on PHOENIX-5123 at 2/5/19 12:52 AM:
------------------------------------------------------------------
RAF just uses a file descriptor, there's no memory mapping, unless you ask for
it. You set a position and then read or write.
{quote}Instances of this class support both reading and writing to a random
access file. A random access file behaves like a large array of bytes stored in
the file system. There is a kind of cursor, or index into the implied array,
called the _file pointer_; input operations read bytes starting at the file
pointer and advance the file pointer past the bytes read. If the random access
file is created in read/write mode, then output operations are also available;
output operations write bytes starting at the file pointer and advance the file
pointer past the bytes written. Output operations that write past the current
end of the implied array cause the array to be extended. The file pointer can
be read by the {{getFilePointer}} method and set by the {{seek}} method.
{quote}
Presumably Phoenix is tracking position so can move or advance the pointer to
known locations, and from there you use DataInput or DataOutput methods to
write or extract records.
was (Author: apurtell):
RAF just uses a file descriptor, there's no mapping, unless you ask for it. You
set a position and then read or write.
{quote}
Instances of this class support both reading and writing to a random access
file. A random access file behaves like a large array of bytes stored in the
file system. There is a kind of cursor, or index into the implied array, called
the _file pointer_; input operations read bytes starting at the file pointer
and advance the file pointer past the bytes read. If the random access file is
created in read/write mode, then output operations are also available; output
operations write bytes starting at the file pointer and advance the file
pointer past the bytes written. Output operations that write past the current
end of the implied array cause the array to be extended. The file pointer can
be read by the {{getFilePointer}} method and set by the {{seek}} method.
{quote}
Presumably Phoenix is tracking position so can move or advance the pointer to
known locations, and from there you use DataInput or DataOutput methods to
write or extract records.
> Avoid using MappedByteBuffers for server side GROUP BY
> ------------------------------------------------------
>
> Key: PHOENIX-5123
> URL: https://issues.apache.org/jira/browse/PHOENIX-5123
> Project: Phoenix
> Issue Type: Bug
> Reporter: Lars Hofhansl
> Priority: Major
>
> Like PHOENIX-5120 but for GROUP BY.
> Solution is a bit more tricky, since outline for sorting the access here is
> truly random.
> [~apurtell] suggests to perhaps just use a RandomAccessFile for this.
> (I'm not sure that uses under the hood, though)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)