You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Mamta A. Satoor (JIRA)" <ji...@apache.org> on 2007/04/17 19:52:15 UTC

[jira] Created: (DERBY-2557) Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.

Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: DERBY-2557
                 URL: https://issues.apache.org/jira/browse/DERBY-2557
             Project: Derby
          Issue Type: New Feature
          Components: SQL
    Affects Versions: 10.3.0.0
            Reporter: Mamta A. Satoor
         Assigned To: Mamta A. Satoor


Provide a new interface, called getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF. Store will call this interface to create empty DVD objects and then load these DVD objects using readExternal. For performance efficiency, when Store needs more of the same base DVD, then on subsequent needs, it will call DVD.getNewNull rather than calling DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for DERBY-2537.

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


[jira] Commented: (DERBY-2557) Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489608 ] 

Mamta A. Satoor commented on DERBY-2557:
----------------------------------------

Dan had following comment earlier
"I assume this new method is only for returning DVD's, is that correct? If so could it be declared to return DataValueDescriptor, since it's a method on DataValueFactory. "

I am not sure what is the right thing to do here. The new method on DVF at this point is capable of returning more than just a DVD(that is why the return type is Object) depending on the passed format id. Although Store code is always going to call this method for format ids associated with DVDs, there is no check done in the new method to make sure that if a format id passed does not correspond to DVD, then it should throw an error. The other goal for this method on DVF was to remove the similar code from BaseMonitor(newInstanceFromIdentifier) which handles all different kinds of format ids. If we decide to make the new method on DVF to only deal with DVDs, then we will need to have code to handle other format ids either in BaseMonitor or somewhere else. I will like community's feedback on this.

> Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2557
>                 URL: https://issues.apache.org/jira/browse/DERBY-2557
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY2535_Return_Collator_api_On_DVD_v1_diff.txt, DERBY2535_Return_Collator_api_On_DVD_v1_stat.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt
>
>
> Provide a new interface, called getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF. Store will call this interface to create empty DVD objects and then load these DVD objects using readExternal. For performance efficiency, when Store needs more of the same base DVD, then on subsequent needs, it will call DVD.getNewNull rather than calling DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for DERBY-2537.

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


[jira] Commented: (DERBY-2557) Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489749 ] 

Daniel John Debrunner commented on DERBY-2557:
----------------------------------------------

DataValueFactory's role is as a factory for returning DataValueDescriptors not as a general format identifier to object factory, that's the Monitor's role so I think the interface should be limited to DVDs.

However I didn't understand the comment able needing to have code to handle other formats in BaseMonitor. That code already exists and the patch doesn't remove any of that code.

The advantage of only handling DVDs could be a much much simpler & clearer implementation of the new method on DataValueFactory, basically just  moving existing code. (Roughly move the switch statement from the instance getter implementation into a static method in DataValueFactoryImpl, use that method in the new api method and have the instance getter call the static method).

> Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2557
>                 URL: https://issues.apache.org/jira/browse/DERBY-2557
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY2535_Return_Collator_api_On_DVD_v1_diff.txt, DERBY2535_Return_Collator_api_On_DVD_v1_stat.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt
>
>
> Provide a new interface, called getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF. Store will call this interface to create empty DVD objects and then load these DVD objects using readExternal. For performance efficiency, when Store needs more of the same base DVD, then on subsequent needs, it will call DVD.getNewNull rather than calling DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for DERBY-2537.

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


[jira] Updated: (DERBY-2557) Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor updated DERBY-2557:
-----------------------------------

    Attachment: DERBY2535_Return_Collator_api_On_DVD_v1_stat.txt
                DERBY2535_Return_Collator_api_On_DVD_v1_diff.txt

The previous patch for DERBY-2557 (DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt)  (committed using revision 529697) had a bug in it. After getting a collation sensitive DVD, the new method on DVF (getInstanceUsingFormatIdAndCollationType) was still returning the DVD with UCS_BASIC collation. Patch(DERBY2535_Return_Collator_api_On_DVD_v1_diff.txt) (committed using revision 529866) fixes that problem. 

> Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2557
>                 URL: https://issues.apache.org/jira/browse/DERBY-2557
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY2535_Return_Collator_api_On_DVD_v1_diff.txt, DERBY2535_Return_Collator_api_On_DVD_v1_stat.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt
>
>
> Provide a new interface, called getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF. Store will call this interface to create empty DVD objects and then load these DVD objects using readExternal. For performance efficiency, when Store needs more of the same base DVD, then on subsequent needs, it will call DVD.getNewNull rather than calling DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for DERBY-2537.

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


[jira] Updated: (DERBY-2557) Provide a new interface on DataValueFactory(DVF) called getNull(formatId, collationType) which returns a DVD with proper collation association.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor updated DERBY-2557:
-----------------------------------

    Summary: Provide a new interface on DataValueFactory(DVF) called getNull(formatId, collationType) which returns a DVD with proper collation association.   (was: Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.)

> Provide a new interface on DataValueFactory(DVF) called getNull(formatId, collationType) which returns a DVD with proper collation association. 
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2557
>                 URL: https://issues.apache.org/jira/browse/DERBY-2557
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY2535_Return_Collator_api_On_DVD_v1_diff.txt, DERBY2535_Return_Collator_api_On_DVD_v1_stat.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt
>
>
> Provide a new interface, called getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF. Store will call this interface to create empty DVD objects and then load these DVD objects using readExternal. For performance efficiency, when Store needs more of the same base DVD, then on subsequent needs, it will call DVD.getNewNull rather than calling DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for DERBY-2537.

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


[jira] Resolved: (DERBY-2557) Provide a new interface on DataValueFactory(DVF) called getNull(formatId, collationType) which returns a DVD with proper collation association.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor resolved DERBY-2557.
------------------------------------

    Resolution: Fixed

> Provide a new interface on DataValueFactory(DVF) called getNull(formatId, collationType) which returns a DVD with proper collation association. 
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2557
>                 URL: https://issues.apache.org/jira/browse/DERBY-2557
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY2535_Return_Collator_api_On_DVD_v1_diff.txt, DERBY2535_Return_Collator_api_On_DVD_v1_stat.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v2_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v2_stat.txt
>
>
> Provide a new interface, called getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF. Store will call this interface to create empty DVD objects and then load these DVD objects using readExternal. For performance efficiency, when Store needs more of the same base DVD, then on subsequent needs, it will call DVD.getNewNull rather than calling DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for DERBY-2537.

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


[jira] Updated: (DERBY-2557) Provide a new interface on DataValueFactory(DVF) called getNull(formatId, collationType) which returns a DVD with proper collation association.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor updated DERBY-2557:
-----------------------------------

    Attachment: DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v2_stat.txt
                DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v2_diff.txt

Based on feedback from Dan, changing the implementation of the new interface DVF.getNull so that it bypasses the InstanceGetter. This implementation is much simpler than the old one because there is no InstanceGetter involved. The patch is attached as DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v2_diff.txt I am running the tests and will commit the patch after successful runs of the tests.

The changes made in the patch are as follows
1)DataValueFactory
Changed the name of the new interface from getInstanceUsingFormatIdAndCollationType to getNull. This interface now returns a DVD rather than an Object. The functionality of the interface remains the same but the implementation has changed.
2)DataValueFactoryImpl
a)Removed the class level array and the code associated with InstanceGetter.
b)Added a new static method called getNullDVDWithUCS_BASICcollation(int formatId). This static method handles all the format ids associated with DVDs with the exception of Decimals. The class to be returned for Decimals depends on what VM is being used. This dependency on the VM is handled by getNullDecimal defined on DVF. But since getNullDecimal is not a static method, it can't be called by static method getNullDVDWithUCS_BASICcollation. I could go the path of defining getNullDecimal as static but that will require changes in NumericTypeCompiler.nullMethodName method. Also, all the other getNullXXX on DVF are non-static So, the code for returning the right DVD for Decimal is not in getNullDVDWithUCS_BASICcollation. Rather it is in the calling method, getNull. For other format ids associated with DVDs, getNull will check if the DVD is of type StringDataValue and the collation type is territory based and if so, then it will return ((StringDataValue)returnDVD).getValue(getCharacterCollator(collationType));
3)DTSClassInfo
This class now calls the static method in DVF to get the DVDs. But if the format id is not for a DVD, then it checks if it needs to return TypeId.

I will go ahead and commit it after the tests run successfully. Does anyone have any comments on the patch? 

> Provide a new interface on DataValueFactory(DVF) called getNull(formatId, collationType) which returns a DVD with proper collation association. 
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2557
>                 URL: https://issues.apache.org/jira/browse/DERBY-2557
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY2535_Return_Collator_api_On_DVD_v1_diff.txt, DERBY2535_Return_Collator_api_On_DVD_v1_stat.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v2_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v2_stat.txt
>
>
> Provide a new interface, called getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF. Store will call this interface to create empty DVD objects and then load these DVD objects using readExternal. For performance efficiency, when Store needs more of the same base DVD, then on subsequent needs, it will call DVD.getNewNull rather than calling DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for DERBY-2537.

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


[jira] Commented: (DERBY-2557) Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.

Posted by "A B (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489574 ] 

A B commented on DERBY-2557:
----------------------------

The following code appears twice in the patch:

+    //If we are dealing with territory based collation and 
+    //the object is of type StringDataValue, then we need to 
+    //create a StringDataValue with territory based collation.
+    if (returnObject instanceof StringDataValue) 
+        ((StringDataValue)returnObject).getValue(getCharacterCollator(collationType));
+    return returnObject;

The call to "getValue(...)" on returnObject creates a new StringDataValue with territory-based collation.  But then the code appears to ignore the result of "getValue(...)" and simply returns returnObject, which (I think?) has default collation.  Is that intentional? The comments do not explicitly say that we're supposed to *return* the new StringDataValue, just that we're supposed to *create* one--so I guess the code matches the comments.  But that seems a tad odd to me...

I took a look at SQLChar.getValue(RuleBasedCollator) and there do not appear to be any side effects of that method on the SQLChar, so I don't understand what we get from calling "getValue(...)" in the above code?  If we are not going to store the result or return it, then why do we need to call getValue(...) in the first place? (sorry if I'm missing something obvious).

> Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2557
>                 URL: https://issues.apache.org/jira/browse/DERBY-2557
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt
>
>
> Provide a new interface, called getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF. Store will call this interface to create empty DVD objects and then load these DVD objects using readExternal. For performance efficiency, when Store needs more of the same base DVD, then on subsequent needs, it will call DVD.getNewNull rather than calling DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for DERBY-2537.

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


[jira] Closed: (DERBY-2557) Provide a new interface on DataValueFactory(DVF) called getNull(formatId, collationType) which returns a DVD with proper collation association.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor closed DERBY-2557.
----------------------------------


> Provide a new interface on DataValueFactory(DVF) called getNull(formatId, collationType) which returns a DVD with proper collation association. 
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2557
>                 URL: https://issues.apache.org/jira/browse/DERBY-2557
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY2535_Return_Collator_api_On_DVD_v1_diff.txt, DERBY2535_Return_Collator_api_On_DVD_v1_stat.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v2_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v2_stat.txt
>
>
> Provide a new interface, called getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF. Store will call this interface to create empty DVD objects and then load these DVD objects using readExternal. For performance efficiency, when Store needs more of the same base DVD, then on subsequent needs, it will call DVD.getNewNull rather than calling DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for DERBY-2537.

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


[jira] Commented: (DERBY-2557) Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489535 ] 

Daniel John Debrunner commented on DERBY-2557:
----------------------------------------------

I assume this new method is only for returning DVD's, is that correct?
If so could it be declared to return DataValueDescriptor, since it's a method on DataValueFactory.

> Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2557
>                 URL: https://issues.apache.org/jira/browse/DERBY-2557
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt
>
>
> Provide a new interface, called getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF. Store will call this interface to create empty DVD objects and then load these DVD objects using readExternal. For performance efficiency, when Store needs more of the same base DVD, then on subsequent needs, it will call DVD.getNewNull rather than calling DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for DERBY-2537.

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


[jira] Updated: (DERBY-2557) Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mamta A. Satoor updated DERBY-2557:
-----------------------------------

    Attachment: DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt
                DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt

Committed the patch DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt using revision 529697.

This change provides a new interface on DataValueFactory(DVF) which will be used by Store. Store has format ids and collation types and needs to have Objects created based on that information. This object creation will be supported by the new interface on DVF and it is called getInstanceUsingFormatIdAndCollationType.
DVF will keep an array of InstanceGetters for all the format ids supported by Derby. Initially, this array won't have anything. Every time this new interface is called on a new format id, the InstnaceGetter obtained will be saved in that array so next time around, we don't need to create a new InstanceGetter for the same format id. The next time around, the new interface will find the InstanceGetter in the array and will use that to create an object based on format id. If the collation type passed to the interface is UCS_BASIC, then the new interface will simply return that object. If the collation type is territory based and the object returned for the format id is of type StringDataValue, then the new interface will create a new DVD which is based on the territory based collation by calling DVD.getValue(TerritoryBasedCollator).


> Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2557
>                 URL: https://issues.apache.org/jira/browse/DERBY-2557
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt
>
>
> Provide a new interface, called getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF. Store will call this interface to create empty DVD objects and then load these DVD objects using readExternal. For performance efficiency, when Store needs more of the same base DVD, then on subsequent needs, it will call DVD.getNewNull rather than calling DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for DERBY-2537.

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


[jira] Commented: (DERBY-2557) Provide a new interface on DataValueFactory(DVF) called getNull(formatId, collationType) which returns a DVD with proper collation association.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12490177 ] 

Mamta A. Satoor commented on DERBY-2557:
----------------------------------------

Commited the patch DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v2_diff.txt using revision 530546

> Provide a new interface on DataValueFactory(DVF) called getNull(formatId, collationType) which returns a DVD with proper collation association. 
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2557
>                 URL: https://issues.apache.org/jira/browse/DERBY-2557
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY2535_Return_Collator_api_On_DVD_v1_diff.txt, DERBY2535_Return_Collator_api_On_DVD_v1_stat.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v2_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v2_stat.txt
>
>
> Provide a new interface, called getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF. Store will call this interface to create empty DVD objects and then load these DVD objects using readExternal. For performance efficiency, when Store needs more of the same base DVD, then on subsequent needs, it will call DVD.getNewNull rather than calling DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for DERBY-2537.

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


[jira] Commented: (DERBY-2557) Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.

Posted by "Mamta A. Satoor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2557?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12489605 ] 

Mamta A. Satoor commented on DERBY-2557:
----------------------------------------

Army, thanks for the code review.

You are ofcourse right about "But that seems a tad odd to me... ". I meant to return the new StringDataValue obtained through "getValue(...)". I will fix that very soon. Thanks for catching it.

As for SQLChar.getValue(RuleBasedCollator), if the passed RuleBasedCollator is null then that means that we have the right StringDataValue object ie we want to keep using this DVD which has UCS_BASIC collation associated with it. But if SQLChar.getValue(RuleBasedCollator) gets called with non-null RuleBasedCollator, then we want to return CollatorSQLChar because CollatorSQLChar uses the passed RuleBasedCollator for collation rather than using UCS_BASIC. Please let me know if the comments on StringDataValue#getValue(RuleBasedCollator) are any help in understanding this or you think more comments should go somewhere.

> Provide a new interface on DataValueFactory(DVF) called getInstanceUsingFormatIdAndCollationType(formatId, collationType). This api will replace similar code in Monitor.
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2557
>                 URL: https://issues.apache.org/jira/browse/DERBY-2557
>             Project: Derby
>          Issue Type: New Feature
>          Components: SQL
>    Affects Versions: 10.3.0.0
>            Reporter: Mamta A. Satoor
>         Assigned To: Mamta A. Satoor
>         Attachments: DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_diff.txt, DERBY2557_getObject_Using_CollationType_FormatID_interface_on_DVF_v1_stat.txt
>
>
> Provide a new interface, called getInstanceUsingFormatIdAndCollationType(formatId, collationType) on DVF. Store will call this interface to create empty DVD objects and then load these DVD objects using readExternal. For performance efficiency, when Store needs more of the same base DVD, then on subsequent needs, it will call DVD.getNewNull rather than calling DVF.getInstanceUsingFormatIdAndCollationType again. This work is required for DERBY-2537.

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