[
https://issues.apache.org/jira/browse/HBASE-19607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16323816#comment-16323816
]
Yung-An He commented on HBASE-19607:
------------------------------------
I found the add() method in MemStore interface defined without throws any
exception.
If we want to throw the exception when memstore is incompetent to do the deep
clone, we can't add exception to signature.
Should we refactor the MemStore interface to add exception to signature?
Or reference the method AbstractMultiFileWriter.java, log the error via
LoggerFactory.getLogger?
{code:title=AbstractMultiFileWriter.java}
public List<Path> abortWriters() {
List<Path> paths = new ArrayList<>();
for (StoreFileWriter writer : writers()) {
try {
if (writer != null) {
paths.add(writer.getPath());
writer.close();
}
} catch (Exception ex) {
LOG.error("Failed to close the writer after an unfinished compaction.",
ex);
}
}
return paths;
}
{code}
> throw the exception if memstore is incompetent to do the deep clone for cell
> ----------------------------------------------------------------------------
>
> Key: HBASE-19607
> URL: https://issues.apache.org/jira/browse/HBASE-19607
> Project: HBase
> Issue Type: Bug
> Reporter: Chia-Ping Tsai
> Assignee: Yung-An He
> Priority: Trivial
>
> We must to clone the cell since the cell is backed by the reusable byte
> array. Also, we assume all cells passed to AbstractMemStore is of
> ExtendedCell. Not only is the type check unnecessary, but it also confuses
> the readers.
> {code:title=AbstractMemStore.java}
> private static Cell deepCopyIfNeeded(Cell cell) {
> if (cell instanceof ExtendedCell) {
> return ((ExtendedCell) cell).deepClone();
> }
> return cell;
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)