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 "Michael Dürig (JIRA)" <ji...@apache.org> on 2012/11/08 15:21:12 UTC

[jira] [Created] (OAK-433) MicroKernel.write() returns empty string for empty stream

Michael Dürig created OAK-433:
---------------------------------

             Summary: MicroKernel.write() returns empty string for empty stream
                 Key: OAK-433
                 URL: https://issues.apache.org/jira/browse/OAK-433
             Project: Jackrabbit Oak
          Issue Type: Improvement
          Components: mk
            Reporter: Michael Dürig
            Priority: Minor


Calling {{MicroKernel.write}} with an empty stream as argument, will return an empty string as blobId. While this is not strictly a bug and retrieving the blob by that identifier works, I think it is confusing and should be reconsidered. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OAK-433) MicroKernel.write() returns empty string for empty stream

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495263#comment-13495263 ] 

Thomas Mueller commented on OAK-433:
------------------------------------

I'm not strictly against changing the current behavior, but I would like to better understand how 'bad' the situation is. As far as I see, the only place where it is stored is within a blob id, which is stored as ":blobId:". That seems fine to me. Empty strings are also encoded as empty strings, so I think it's OK if empty blobs are encoded like this. But maybe there are more places where it might cause confusion?
                
> MicroKernel.write() returns empty string for empty stream
> ---------------------------------------------------------
>
>                 Key: OAK-433
>                 URL: https://issues.apache.org/jira/browse/OAK-433
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: mk
>            Reporter: Michael Dürig
>            Priority: Minor
>
> Calling {{MicroKernel.write}} with an empty stream as argument, will return an empty string as blobId. While this is not strictly a bug and retrieving the blob by that identifier works, I think it is confusing and should be reconsidered. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OAK-433) MicroKernel.write() returns empty string for empty stream

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495610#comment-13495610 ] 

Jukka Zitting commented on OAK-433:
-----------------------------------

+1 to Thomas. Levels above the MicroKernel shouldn't try to interpret the blobId string in any way, so any valid string (including empty one) is fine as long as it resolves back to the original binary.
                
> MicroKernel.write() returns empty string for empty stream
> ---------------------------------------------------------
>
>                 Key: OAK-433
>                 URL: https://issues.apache.org/jira/browse/OAK-433
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: mk
>            Reporter: Michael Dürig
>            Priority: Minor
>
> Calling {{MicroKernel.write}} with an empty stream as argument, will return an empty string as blobId. While this is not strictly a bug and retrieving the blob by that identifier works, I think it is confusing and should be reconsidered. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OAK-433) MicroKernel.write() returns empty string for empty stream

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496054#comment-13496054 ] 

Thomas Mueller commented on OAK-433:
------------------------------------

I agree using an empty string is a bit strange conceptually. If it is problematic or leads to bugs elsewhere then we should reopen this bug and change the behavior.
                
> MicroKernel.write() returns empty string for empty stream
> ---------------------------------------------------------
>
>                 Key: OAK-433
>                 URL: https://issues.apache.org/jira/browse/OAK-433
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: mk
>            Reporter: Michael Dürig
>            Priority: Minor
>
> Calling {{MicroKernel.write}} with an empty stream as argument, will return an empty string as blobId. While this is not strictly a bug and retrieving the blob by that identifier works, I think it is confusing and should be reconsidered. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OAK-433) MicroKernel.write() returns empty string for empty stream

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13496052#comment-13496052 ] 

Michael Dürig commented on OAK-433:
-----------------------------------

Ok let's leave it as is then. If nobody objects, I'll resolve this as won't fix.
                
> MicroKernel.write() returns empty string for empty stream
> ---------------------------------------------------------
>
>                 Key: OAK-433
>                 URL: https://issues.apache.org/jira/browse/OAK-433
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: mk
>            Reporter: Michael Dürig
>            Priority: Minor
>
> Calling {{MicroKernel.write}} with an empty stream as argument, will return an empty string as blobId. While this is not strictly a bug and retrieving the blob by that identifier works, I think it is confusing and should be reconsidered. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OAK-433) MicroKernel.write() returns empty string for empty stream

Posted by "Mete Atamel (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495274#comment-13495274 ] 

Mete Atamel commented on OAK-433:
---------------------------------

As far as I'm concerned, the situation is not bad but just inconsistent. All blobs with length > 0 have a set blob id with a set length, right? So, what's special about the blob with length = 0 (empty) to warrant an empty blob id?
                
> MicroKernel.write() returns empty string for empty stream
> ---------------------------------------------------------
>
>                 Key: OAK-433
>                 URL: https://issues.apache.org/jira/browse/OAK-433
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: mk
>            Reporter: Michael Dürig
>            Priority: Minor
>
> Calling {{MicroKernel.write}} with an empty stream as argument, will return an empty string as blobId. While this is not strictly a bug and retrieving the blob by that identifier works, I think it is confusing and should be reconsidered. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (OAK-433) MicroKernel.write() returns empty string for empty stream

Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/OAK-433?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13495312#comment-13495312 ] 

Thomas Mueller commented on OAK-433:
------------------------------------

For me, it's actually quite consistent... Binaries are split into chunks. There are two kinds of chunks: for very small chunks the data is inlined in the chunk id, larger chunks are stored and the chunk id is the hash. The chunk ids are then concatenated to form the blob id. When storing a blob, for each chunk a chunk id is appended to the blob id (no chunk means no chunk id). When reading, an EOF on the blob id means EOF for the data. It's actually quite consistent.

Of course we could special-case empty blobs in the AbstractBlobStore if people feel that's better. It would add a little complexity to the AbstractBlobStore, I guess not too bad.

But what I like to understand is what problem we want to solve here.
                
> MicroKernel.write() returns empty string for empty stream
> ---------------------------------------------------------
>
>                 Key: OAK-433
>                 URL: https://issues.apache.org/jira/browse/OAK-433
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: mk
>            Reporter: Michael Dürig
>            Priority: Minor
>
> Calling {{MicroKernel.write}} with an empty stream as argument, will return an empty string as blobId. While this is not strictly a bug and retrieving the blob by that identifier works, I think it is confusing and should be reconsidered. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (OAK-433) MicroKernel.write() returns empty string for empty stream

Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/OAK-433?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael Dürig resolved OAK-433.
-------------------------------

       Resolution: Won't Fix
    Fix Version/s: 0.6
         Assignee: Michael Dürig

Won't fix for now as discussed.
                
> MicroKernel.write() returns empty string for empty stream
> ---------------------------------------------------------
>
>                 Key: OAK-433
>                 URL: https://issues.apache.org/jira/browse/OAK-433
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: mk
>            Reporter: Michael Dürig
>            Assignee: Michael Dürig
>            Priority: Minor
>             Fix For: 0.6
>
>
> Calling {{MicroKernel.write}} with an empty stream as argument, will return an empty string as blobId. While this is not strictly a bug and retrieving the blob by that identifier works, I think it is confusing and should be reconsidered. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira