Git Product home page Git Product logo

Comments (7)

chandresh-pancholi avatar chandresh-pancholi commented on August 21, 2024

is it solved?
for me this is the final result
+------------------+
| Record | baz |
+------------------+
| 1 | [10, 9] |
| 2 | [10, 9] |
+------------------+

from concourse.

jtnelson avatar jtnelson commented on August 21, 2024

@chandresh-pancholi can you create a unit test to either repro the bug or confirm it doesn't exist

from concourse.

chandresh-pancholi avatar chandresh-pancholi commented on August 21, 2024

Actually its not even putting them in descending order.It puts them in random order.
For ex.
add "baz", 10, 1
add "baz", 9, 1
add "baz", 7, 1
add "baz", 8, 1
add "baz", 9, 2
add "baz", 7, 2
add "baz", 10, 2

select([1L, 2L])
+------------------------+
| Record | baz |
+------------------------+
| 1 | [9, 8, 10, 7] |
| 2 | [9, 10, 7] |
+------------------------+
' in 0.038 sec

from concourse.

jtnelson avatar jtnelson commented on August 21, 2024

I see, I think in ConcourseServer we need to use a LinkedHashMap instead of a regular HashMap for the select methods 

Sent from my iPhone

On Thu, Jun 16, 2016 at 9:01 AM -0400, "Chandresh Pancholi" [email protected] wrote:

Actually its not even putting them in descending order.It puts them in random order.

For ex.

add "baz", 10, 1

add "baz", 9, 1

add "baz", 7, 1

add "baz", 8, 1

add "baz", 9, 2

add "baz", 7, 2

add "baz", 10, 2

select([1L, 2L])

+------------------------+

| Record | baz |

+------------------------+

| 1 | [9, 8, 10, 7] |

| 2 | [9, 10, 7] |

+------------------------+

' in 0.038 sec


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from concourse.

chandresh-pancholi avatar chandresh-pancholi commented on August 21, 2024

We are using LinkedHashMap.

@Override
    @Atomic
    @Batch
    @ThrowsThriftExceptions
    public Map<Long, Map<String, Set<TObject>>> selectRecords(
            List<Long> records, AccessToken creds,
            TransactionToken transaction, String environment) throws TException {
        checkAccess(creds, transaction);
        AtomicSupport store = getStore(transaction, environment);
        Map<Long, Map<String, Set<TObject>>> result = Maps.newLinkedHashMap();
        AtomicOperation atomic = null;
        System.out.println("------------");
        while (atomic == null || !atomic.commit()) {
            atomic = store.startAtomicOperation();
            try {
                for (long record : records) {
                    result.put(record, atomic.select(record));
                }
            }
            catch (AtomicStateException e) {
                atomic = null;
            }
        }
        return result;
    }

from concourse.

jtnelson avatar jtnelson commented on August 21, 2024

My bad. Check in the classes that extend Store and make sure the select(record) methods are using a LinkedHashSet instead of a HashSet

Sent from my iPhone

On Thu, Jun 16, 2016 at 9:08 AM -0400, "Chandresh Pancholi" [email protected] wrote:

We are using LinkedHashMap.

@OverRide

@Atomic

@Batch

@ThrowsThriftExceptions

public Map<Long, Map<String, Set<TObject>>> selectRecords(

        List<Long> records, AccessToken creds,

        TransactionToken transaction, String environment) throws TException {

    checkAccess(creds, transaction);

    AtomicSupport store = getStore(transaction, environment);

    Map<Long, Map<String, Set<TObject>>> result = Maps.newLinkedHashMap();

    AtomicOperation atomic = null;

    System.out.println("------------");

    while (atomic == null || !atomic.commit()) {

        atomic = store.startAtomicOperation();

        try {

            for (long record : records) {

                result.put(record, atomic.select(record));

            }

        }

        catch (AtomicStateException e) {

            atomic = null;

        }

    }

    return result;

}


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

from concourse.

chandresh-pancholi avatar chandresh-pancholi commented on August 21, 2024

Will changes in concourse.thrift loads when concourse server runs?

from concourse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.