Package org.voltdb.types

Examples of org.voltdb.types.TimestampType


        HoldingInfo holding = customerHoldings[currAccountForHolding][currSecurityForHolding].get(holdingIterator);
       
        tuple[0] = holding.tradeId; // h_t_id
        tuple[1] = currAccountForHolding + startFromAccount; // h_ca_id
        tuple[2] = secHandler.createSymbol(holding.symbolIndex, 15); // h_s_symb; CHAR(15)
        tuple[3] = new TimestampType(holding.buyDTS); // h_dts
        tuple[4] = holding.tradePrice.getDollars(); // h_price
        tuple[5] = holding.tradeQty; // h_qty
       
        holdingIterator++;
        hasNextHolding = findNextHolding();
View Full Code Here


                            buffer.append("NULL, ");
                        else
                            buffer.append(dval + ", ");
                        break;
                    case TIMESTAMP:
                        TimestampType tstamp = r.getTimestampAsTimestamp(i);
                        if (r.wasNull()) {
                            buffer.append("NULL, ");
                            assert (tstamp == null);
                        } else {
                            buffer.append(tstamp + ", ");
View Full Code Here

        "   SET user_touched = ? " +
        " WHERE user_id =  ? "
    );

    public VoltTable[] run(int userId, int nameSpace, long pageId) {
        final TimestampType timestamp = new TimestampType();
        if (userId > 0) {
            voltQueueSQL(removeWatchList, userId, nameSpace, pageId);
           
            if (nameSpace == 0) {
                // if regular page, also remove a line of
View Full Code Here

         * @param vt
         * @return
         */
        public ItemId processItemRecord(VoltTable vt) {
            ItemId itemId = new ItemId(vt.getLong("i_id"));
            TimestampType endDate = vt.getTimestampAsTimestamp("i_end_date");
            short numBids = (short)vt.getLong("i_num_bids");
            double currentPrice = vt.getDouble("i_current_price");
            ItemInfo itemInfo = new ItemInfo(itemId, currentPrice, endDate, numBids);
            if (vt.hasColumn("ip_id")) itemInfo.status = ItemStatus.CLOSED;
            if (vt.hasColumn("i_status")) itemInfo.status = ItemStatus.get(vt.getLong("i_status"));
View Full Code Here

     *
     * @param user_revision_ctr
     * @return
     */
    public VoltTable run(int user_revision_ctr[], int num_pages, int page_last_rev_id[], int page_last_rev_length[]) {
        final TimestampType timestamp = new TimestampType();
        final int batch_size = voltRemainingQueue();
        int ctr = 0;
        for (int i = 0; i < user_revision_ctr.length; i++) {
            voltQueueSQL(updateUser, user_revision_ctr[i],
                    timestamp,
View Full Code Here

    // -----------------------------------------------------------------
    // RUN
    // -----------------------------------------------------------------

    public VoltTable[] run(int userId, int nameSpace, long pageId) throws VoltAbortException {
        final TimestampType timestamp = new TimestampType();
       
        if (userId > 0) {
            // TODO: find a way to by pass Unique constraints in SQL server
            // (Replace, Merge ..?)
            // Here I am simply catching the right excpetion and move on.
View Full Code Here

                  int userId, String userIp, String userText,
                  int revisionId, String revComment, int revMinorEdit) {

      boolean adv;
      VoltTable rs[] = null;
      final TimestampType timestamp = new TimestampType();
     
      // Get the next id from the PAGE
      voltQueueSQL(selectLastPageRevision, pageId);
      rs = voltExecuteSQL();
      int nextId = (int)rs[0].asScalarLong() + 1;
     
      // INSERT NEW TEXT
    voltQueueSQL(insertText, nextId, pageId, pageText, "utf-8");
    rs = voltExecuteSQL();
    adv = rs[0].advanceRow();
    assert(adv) : "Problem inserting new tuples in table text";
        int nextTextId = (int)rs[0].getLong(0);
       
    // INSERT NEW REVISION
    voltQueueSQL(insertRevision, nextId,
                                 pageId,
                                 nextTextId,
                                 revComment,
                                 revMinorEdit,
                                 userId,
                                 userText,
                                 timestamp,
                                 0,
                                 pageText.length(),
                                 revisionId);   
    rs = voltExecuteSQL();
    adv = rs[0].advanceRow();

    // I'm removing AND page_latest = "+a.revisionId+" from the query, since
    // it creates sometimes problem with the data, and page_id is a PK
    // anyway
    voltQueueSQL(updatePage, timestamp, pageText.length(), pageId);
    voltQueueSQL(insertRecentChanges, nextId,
                                      timestamp,
                                      new TimestampType(),
                                      pageNamespace,
                                      pageId,
                                      0,
                                      0,
                                      pageId,
View Full Code Here

    /**
     * Return a random date in the future (after the start of upcoming flights)
     * @return
     */
    public TimestampType getRandomUpcomingDate() {
        TimestampType upcoming_start_date = this.flight_upcoming_date;
        int offset = rng.nextInt((int)this.flight_future_days);
        return (new TimestampType(upcoming_start_date.getTime() + (offset * SEATSConstants.MICROSECONDS_PER_DAY)));
    }
View Full Code Here

        // Does it matter whether the one airport actually flies to the other one?
        long depart_airport_id = this.profile.getRandomAirportId();
        long arrive_airport_id = this.profile.getRandomOtherAirport(depart_airport_id);
       
        // Select a random date from our upcoming dates
        TimestampType start_date = this.profile.getRandomUpcomingDate();
        TimestampType stop_date = new TimestampType(start_date.getTime() + (SEATSConstants.MICROSECONDS_PER_DAY * 2));
       
        // If distance is greater than zero, then we will also get flights from nearby airports
        long distance = -1;
        if (rng.nextInt(100) < SEATSConstants.PROB_FIND_FLIGHTS_NEARBY_AIRPORT) {
            distance = SEATSConstants.DISTANCES[rng.nextInt(SEATSConstants.DISTANCES.length)];
View Full Code Here

            reservation.customer_id,
            reservation.flight_id,
            reservation.seatnum,
            price,
            attributes,
            new TimestampType()
        };
        if (trace.val) LOG.trace("Calling " + Transaction.NEW_RESERVATION.getExecName());
        return new Pair<Object[], ProcedureCallback>(params, new NewReservationCallback(reservation));
    }
View Full Code Here

TOP

Related Classes of org.voltdb.types.TimestampType

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.