[
http://issues.apache.org/jira/browse/DERBY-1473?page=comments#action_12428053 ]
Knut Anders Hatlen commented on DERBY-1473:
-------------------------------------------
I have started reviewing the patch. I haven't finished the review yet,
but I'll post the comments I have so far.
- CharAlphabet.java contains some UTF-8 encoded characters, and I had
to change my locale to be able to compile it. These characters
should probably be escaped.
- RawToBinaryFormatStream(InputStream, int) first checks whether
length is less than zero, and throws an exception if it is. After
that check, there's a new one "if (length >= 0) {...} else {...}",
but at that time length is guaranteed to be greater than or equal to
zero.
- RawToBinaryFormatStream and ReaderToUTF8Stream sometimes throw
IllegalArgumentException. I not sure whether I think this is a good
or a bad approach. I think it is good because internal errors in
Derby will be exposed and can be fixed. I also think it not so good
because the conditions that are checked are not critical, and it
would make sense to carry on in insane mode (for instance, typeName
== null won't be a problem until an error message using the type
name is constructed, and maximumLength < 0 will be treated more or
less as 0). I think either it should be rewritten using
SanityManager.ASSERT, or it should have a comment saying why
IllegalArgumentException is used and that it won't be exposed to the
users unless there's a programming error in Derby.
- In RawToBinaryFormatStream.checkSufficientData(), the body of the
"if (c != -1)" clause has become very large. I think it would be
clearer if it had braces around it (although the diff would be three
lines longer).
Thanks.
> Add cut-off and truncation logic to streaming classes in the embedded driver
> ----------------------------------------------------------------------------
>
> Key: DERBY-1473
> URL: http://issues.apache.org/jira/browse/DERBY-1473
> Project: Derby
> Issue Type: Improvement
> Components: JDBC
> Affects Versions: 10.2.0.0
> Reporter: Kristian Waagan
> Assigned To: Kristian Waagan
> Fix For: 10.2.0.0
>
> Attachments: derby-1473-1a-streaming.diff,
> derby-1473-1a-streaming.stat, derby-1473-2a-streamingtests.diff,
> derby-1473-2a-streamingtests.stat
>
>
> When streaming data to Derby, the application stream will be wrapped in a
> Derby-specific stream to convert the data to the correct representation. At a
> minimum, this consists of getting the data to the on-disk format used by
> Derby.
> The wrapping stream can be extended to provide the following features at an
> earlier stage:
> a) Data cut-off when the maximum allowed size is exceeded
> b) Truncation of trailing blanks where allowed
> Both features can reduce the amount of data needed to be kept in memory on
> insertion.
> Implementing this will require additional column/data type information in the
> streaming class(es). The implementation must be able to handle streams for
> which the length is specified and also streams with unknown/unspecified
> length.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira