You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Julian Sedding (JIRA)" <ji...@apache.org> on 2016/12/09 12:16:58 UTC
[jira] [Comment Edited] (OAK-5253) Optimize AbstractBlob#equal to
not do content equals when possible
[ https://issues.apache.org/jira/browse/OAK-5253?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15735027#comment-15735027 ]
Julian Sedding edited comment on OAK-5253 at 12/9/16 12:16 PM:
---------------------------------------------------------------
Thanks [~amitjain]. I am wondering if we could compare {{Blob#getReference()}}, but the contract is not very clear regarding its equality semantics. Basically I believe that we need to use something that is delegated to the {{BlobStore}} implementation.
A change in {{SegmentBlob}} would suffer from the same problem as a change in {{AbstractBlob}}. It is backed by an arbitrary {{BlobStore}} implementation, thus we cannot rely on the semantics of {{Blob#getContentIdentity()}}, as it may change depending on the backing {{BlobStore}}.
I have [posted on the mailing list|http://jackrabbit.markmail.org/thread/mzwgde4v7r2xq6yu] to see if someone can clarify whether {{Blob#getReference()}} is suited.
was (Author: jsedding):
Thanks [~amitjain]. I am wondering if we could compare {{Blob#getReference()}}, but the contract is not very clear regarding its equality semantics. Basically I believe that we need to use something that is delegated to the {{BlobStore}} implementation.
A change in {{SegmentBlob}} would suffer from the same problem as a change in {{AbstractBlob}}. It is backed by an arbitrary {{BlobStore}} implementation, thus we cannot rely on the semantics of {{Blob#getContentIdentity()}}, as it may change depending on the backing {{BlobStore}}.
I have posted on the mailing list to see if someone can clarify whether {{Blob#getReference()}} is suited.
> Optimize AbstractBlob#equal to not do content equals when possible
> ------------------------------------------------------------------
>
> Key: OAK-5253
> URL: https://issues.apache.org/jira/browse/OAK-5253
> Project: Jackrabbit Oak
> Issue Type: Improvement
> Components: blob
> Reporter: Amit Jain
> Assignee: Amit Jain
> Fix For: 1.6, 1.5.16, 1.4.11
>
> Attachments: OAK-5253.1.patch
>
>
> AbstractBlob#equals tries to match content when length is equal and content identities is not null and different. Matching content triggers an expensive download of binaries for S3DataStore.
> Since, right now the content identity is the content hash the check can be short -circuited when the content identities is not null and not equal to return false.
> This can be revisited if we change the identity to something different.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)