[ 
https://issues.apache.org/jira/browse/DERBY-3907?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kristian Waagan updated DERBY-3907:
-----------------------------------

    Attachment: derby-3907-2b-header_write_preparation.stat
                derby-3907-2b-header_write_preparation.diff

'derby-3907-2b-header_write_preparation.diff' is a preparation patch to lay the 
foundation for writing the new stream header format. Essentially, the behavior 
should be the same before and after the patch.

The patch adds a new method to the interface StringDataValue, since the header 
format will only apply for string data types. The method generateStreamHdr 
creates the stream header based on the version of the dictionary and the 
character length information, and also determines if the stream have to be 
ended with a Derby-specific end-of-stream marker.
The current implementation simply returns unknown length and instructs to 
terminate the value with a Derby EOF marker. This is because Derby pre 10.5 
expects a byte count, not a char count. At this level, the byte count is 
generally unknown. The method generateStreamHdr will be overridden in SQLClob, 
and the new header format will be used there, unless we are running in 
soft-upgrade mode where the old format will be used.
The goal is that the knowledge about the exact format of the headers is 
contained in the DVD(s).

In ReaderToUTF8Stream I removed the instance variable maximumLength, because it 
is only needed in the constructor. Further, I added setHeader to allow the 
header to be overridden after the reader is instantiated. If the header isn't 
overridden, the reader should behave as before.

Note that things *may* have to be changed a bit if support for updating the 
header only is added (i.e. the lenghtless scenario).

Patch 2b ready for review.

FYI, patch 2a is almost identical, except that it doesn't use a utility/holder 
class for the header. I think using the utility class is cleaner, but it does 
of course introduce yet another class.

> Save useful length information for Clobs in store
> -------------------------------------------------
>
>                 Key: DERBY-3907
>                 URL: https://issues.apache.org/jira/browse/DERBY-3907
>             Project: Derby
>          Issue Type: Improvement
>          Components: JDBC, Store
>    Affects Versions: 10.5.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>         Attachments: derby-3907-1a-alternative_approach.diff, 
> derby-3907-2b-header_write_preparation.diff, 
> derby-3907-2b-header_write_preparation.stat
>
>
> The store should save useful length information for Clobs. This allows the 
> length to be found without decoding the whole data stream.
> The following thread raised the issue on what information to store, and also 
> contains some background information: 
> http://www.nabble.com/Storing-length-information-for-CLOB-on-disk-tp19197535p19197535.html
> The information to store, and the exact format of it, is still to be 
> discussed/determined.
> Currently two bytes are set aside for length information, which is inadequate.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to