Package edu.brown.benchmark.seats.util

Examples of edu.brown.benchmark.seats.util.Reservation


        results[0].addRow(new Long(1));
        ClientResponseImpl cresponse = new ClientResponseImpl(TXN_ID, CLIENT_HANDLE,
                                                              0, Status.OK,
                                                              results, "");
       
        Reservation r = new Reservation(RESERVATION_ID, this.flight_id, customer_id, seatnum);
        assertNotNull(r);
        NewReservationCallback callback = this.client.new NewReservationCallback(r);
        callback.clientCallback(cresponse);
       
        // Check to make sure that our seat is now reserved
View Full Code Here


                    flight_customer_ids.add(customer_id);
                   
                    if (trace.val)
                        LOG.trace(String.format("New reservation ready. Adding to queue! [queueSize=%d]",
                                  this.queue.size()));
                    Reservation r = new Reservation(1001, flight_id, customer_id, seatnum); // id doesn't matter
                    this.queue.put(r);
                } // FOR (seats)
               
            } // FOR (flights)
            if (debug.val) LOG.debug("Reservation data generation thread is finished");
View Full Code Here

   
    protected Pair<Object[], ProcedureCallback> getDeleteReservationParams() {
        // Pull off the first cached reservation and drop it on the cluster...
        Buffer<Reservation> cache = CACHE_RESERVATIONS.get(CacheType.PENDING_DELETES);
        assert(cache != null) : "Unexpected " + CacheType.PENDING_DELETES;
        Reservation r = null;
        synchronized (cache) {
            if (cache.isEmpty() == false) r = cache.remove();
        } // SYNCH
        if (r == null) {
            return (null);
View Full Code Here

            }
        }
    }
   
    protected Pair<Object[], ProcedureCallback> getNewReservationParams() {
        Reservation reservation = null;
        BitSet seats = null;
        Buffer<Reservation> cache = CACHE_RESERVATIONS.get(CacheType.PENDING_INSERTS);
        assert(cache != null) : "Unexpected " + CacheType.PENDING_INSERTS;
       
        if (debug.val)
            LOG.debug(String.format("Attempting to get a new pending insert Reservation [totalPendingInserts=%d]",
                      cache.size()));
        while (reservation == null) {
            Reservation r = null;
            synchronized (cache) {
                if (cache.isEmpty() == false) r = cache.remove();
            } // SYNCH
            if (r == null) {
                if (debug.val)
View Full Code Here

            LOG.trace("Let's look for a Reservation that we can update");
       
        // Pull off the first pending seat change and throw that ma at the server
        Buffer<Reservation> cache = CACHE_RESERVATIONS.get(CacheType.PENDING_UPDATES);
        assert(cache != null) : "Unexpected " + CacheType.PENDING_UPDATES;
        Reservation r = null;
        synchronized (cache) {
            if (cache.isEmpty() == false) r = cache.remove();
        } // SYNCH
        if (r == null) return (null);
       
View Full Code Here

             
                // Just get a random customer to through on this flight
                if (trace.val)
                    LOG.trace("Looking for a random customer to fly on " + flight_id);
                long customer_id = profile.getRandomCustomerId();
                Reservation r = new Reservation(profile.getNextReservationId(clientId),
                                                flight_id, customer_id, seatnum);
                tmp_reservations.add(r);
                seats.set(seatnum);
                if (trace.val)
                    LOG.trace(String.format("QUEUED INSERT: %s -> %s", flight_id, customer_id));
View Full Code Here

TOP

Related Classes of edu.brown.benchmark.seats.util.Reservation

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.