[ 
https://issues.apache.org/jira/browse/IGNITE-9532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16618631#comment-16618631
 ] 

Uday Kale edited comment on IGNITE-9532 at 9/18/18 8:02 AM:
------------------------------------------------------------

[~avinogradov]

The code in my PR at GridCacheQueueProxy:484 is changing the operating context 
for the queue objects already initialised in the thread. It can be confirmed 
since the unit test below works but the unit test in the comments above does 
not:
{code:java}
    public void testContains() throws Exception {
        IgniteQueue<SameHashItem> queue = grid(0).queue("q1", 0, config(false));

        queue.add(new SameHashItem(Integer.toString(14)));

        assertTrue(queue.contains(new SameHashItem(Integer.toString(14)))); // 
Succeeds

        IgniteQueue<BinaryObject> queueBin = grid(0).queue("q1", 0, 
config(false)).withKeepBinary();

        queueBin.add(sameHashBinObj(grid(0), 14));

        assertTrue(queueBin.contains(sameHashBinObj(grid(0), 14))); // Succeeds
    }

    private static BinaryObject sameHashBinObj(Ignite ignite, int i) {
        return ignite.binary().toBinary(new SameHashItem(Integer.toString(i)));
    }
{code}
 

Is this acceptable?

 


was (Author: uday):
[~avinogradov]

The code in my PR at GridCacheQueueProxy:484 is changing the operating context 
for the queue objects already initialised in the thread. It can be confirmed 
since the unit test below works but the unit test in the comments above does 
not:
{code:java}
public void testContains() throws Exception
{ IgniteQueue<SameHashItem> queue = grid(0).queue("q1", 0, config(false)); 
queue.add(new SameHashItem(Integer.toString(14))); 
assertTrue(queue.contains(new SameHashItem(Integer.toString(14)))); // Fails 
IgniteQueue<BinaryObject> queueBin = grid(0).queue("q1", 0, 
config(false)).withKeepBinary(); queueBin.add(sameHashBinObj(grid(0), 14)); 
assertTrue(queueBin.contains(sameHashBinObj(grid(0), 14))); // Succeeds }
private static BinaryObject sameHashBinObj(Ignite ignite, int i)
{ return ignite.binary().toBinary(new SameHashItem(Integer.toString(i))); }
{code}
 

Is this acceptable?

 

> Binary mode for Ignite Queue
> ----------------------------
>
>                 Key: IGNITE-9532
>                 URL: https://issues.apache.org/jira/browse/IGNITE-9532
>             Project: Ignite
>          Issue Type: New Feature
>          Components: binary, data structures
>            Reporter: Uday Kale
>            Assignee: Uday Kale
>            Priority: Major
>             Fix For: 2.8
>
>
> Add binary mode (withKeepBinary) to Data Structures Queue.
> This will allow retrieving values in binary format when needed or when class 
> is not available, and will allow implementing the structures in other 
> platforms (.NET, C++).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to