[
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-4a-add_getStreamWithDescriptor.diff
derby-3907-4a-add_getStreamWithDescriptor.stat
Patch 'derby-3907-4a-add_getStreamWithDescriptor.diff' adds the method
getStringWithDescriptor to StringDataValue.
It it intended to be used when getting a stream from a StringDataValue to be
used with a Clob object, or with streaming of string data values in general.
The DVD is responsible for returning a correct descriptor for the raw stream.
The descriptor is in turn used by other classes to correctly configure
themselves with respect to data offsets, buffering, repositioning and so on.
This patch was part of a bigger patch, but I decided to split it into two to
make it easier to review.
Patch description:
o CharacterStreamDescriptor
Added a toString method and more verbose assert-messages.
o StringDataValue
Added method 'CharacterStreamDescriptor getStreamWithDescriptor()'.
o SQLChar
Made setStream non-final so it can be overridden in SQLClob.
Added default implementation of getStreamWithDescriptor that always returns
null. This means that all non-Clob string data types will be handled as strings
instead of streams in situations where a stream is requested through
getStreamWithDescriptor. I'll look into the performance implications of this a
little later, when more of the final code is in place.
Made throwStreamingIOException protected to access it from SQLClob.
o SQLClob
Implemented getStreamWithDescriptor, handling the old 2-byte format only.
Overrid setStream to discard the stream descriptor when a new stream is set
for the DVD.
Patch ready for review.
I will commit this shortly, but since the code isn't used yet it should be
harmless. That shouldn't stop any reviewers though!
I'll also post the next patch shortly.
> 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
> Fix For: 10.5.0.0
>
> Attachments: derby-3907-1a-alternative_approach.diff,
> derby-3907-2b-header_write_preparation.diff,
> derby-3907-2b-header_write_preparation.diff,
> derby-3907-2b-header_write_preparation.stat,
> derby-3907-2c-header_write_preparation-PREVIEW.diff,
> derby-3907-2c-header_write_preparation-PREVIEW.stat,
> derby-3907-2c-header_write_preparation.diff,
> derby-3907-2c-header_write_preparation.diff,
> derby-3907-2c-header_write_preparation.stat,
> derby-3907-3a-readertoutf8stream_cleanup.diff,
> derby-3907-3a-readertoutf8stream_cleanup.diff,
> derby-3907-3a-readertoutf8stream_cleanup.stat,
> derby-3907-3b-readertoutf8stream_cleanup.diff,
> derby-3907-4a-add_getStreamWithDescriptor.diff,
> derby-3907-4a-add_getStreamWithDescriptor.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.