Package org.voltdb.types

Examples of org.voltdb.types.TimestampType


                    LOG.debug("# of Results: " + siteResults.size() + "\n" +
                              StringUtil.join("\n************\n", siteResults));
               
                // Make sure that everyone is the same value
                VoltTable vt = new VoltTable(aggregateResultsColumns);
                TimestampType timestamp = new TimestampType();
                Set<String> values = new HashSet<String>();
                for (int i = 0; i < confNames.length; i++) {
                    if (i > 0) values.clear();
                    for (VoltTable site_vt : siteResults) {
                        if (i > 0) site_vt.resetRowPosition();
View Full Code Here


            // Loop through the flights and generate reservations
            for (long flight_id = 0, cnt = profile.num_flights; flight_id < cnt; flight_id++) {
                FlightInfo flightInfo = SEATSLoader.this.flight_infos.remove(flight_id);
                String depart_airport = flightInfo.depart_airport;
                String arrive_airport = flightInfo.arrive_airport;
                TimestampType depart_time = flightInfo.depart_time;
                TimestampType arrive_time = flightInfo.arrive_time;
                flight_customer_ids.clear();
               
                // For each flight figure out which customers are returning
                this.getReturningCustomers(returning_customers, flightInfo);
                int booked_seats = SEATSConstants.FLIGHTS_NUM_SEATS - Math.max(SEATSConstants.FLIGHTS_RESERVED_SEATS,
View Full Code Here

         * location on this particular flight.
         * @param flight_id
         * @return
         */
        private void getReturningCustomers(Collection<ReturnFlight> returning_customers, FlightInfo flightInfo) {
            TimestampType flight_date = flightInfo.depart_time;
            returning_customers.clear();
            Set<ReturnFlight> returns = this.airport_returns.get(flightInfo.depart_airport);
            if (!returns.isEmpty()) {
                for (ReturnFlight return_flight : returns) {
                    if (return_flight.getReturnDate().compareTo(flight_date) > 0) break;
View Full Code Here

        }
        private TimestampType getRandomCommentDate(TimestampType startDate, TimestampType endDate) {
            int start = Math.round(startDate.getTime() / 1000000);
            int end = Math.round(endDate.getTime() / 1000000);
            long offset = profile.rng.number(start, end);
            return new TimestampType(offset * 1000000l);
        }
View Full Code Here

                    result[0].addRow(
                        this.executor.getSiteId(),
                        this.partitionId,
                        (f != null ? f.getAbsolutePath() : null),
                        (is_global ? 1 : 0),
                        new TimestampType()
                    );
                }
            }
            return new DependencySet(new int[] { (int)SysProcFragmentId.PF_recomputeMarkovsDistribute }, result);
           
View Full Code Here

            dayInc += 2;
        }
       
        double dailyClose = rnd.doubleIncrRange(dailyMarketCloseMin, dailyMarketCloseMax, 0.01);
       
        tuple[0] = new TimestampType(EGenDate.getDateFromDayNo(startDayNo + dayInc)); // dm_date
        tuple[1] = currentSymbol; // dm_s_symb
        tuple[2] = dailyClose; // dm_close
        tuple[3] = dailyClose * dailyMarketHighRelativeToClose; // dm_high
        tuple[4] = dailyClose * dailyMarketLowRelativeToClose; // dm_low
        tuple[5] = rnd.intRange(dailyMarketVolumeMin, dailyMarketVolumeMax); // dm_vol
View Full Code Here

    private Object[] generateTradeRow() {
        Object[] tuple = new Object[getColumnNum(TPCEConstants.TABLENAME_TRADE)];
        currTable = TPCEConstants.TABLENAME_TRADE;
       
        tuple[0] = newTrade.tradeId; // t_id
        tuple[1] = new TimestampType(getCurrentTradeCompletionTime()); // t_dts
        tuple[2] = statusTypeFile.getTupleByIndex(newTrade.tradeStatus.ordinal())[0]; // t_st_id
        tuple[3] = tradeTypeFile.getTupleByIndex(newTrade.tradeType.ordinal())[0]; // t_tt_id
       
        // is it a cash trade?
        addTrade.isCash = true;
View Full Code Here

        Object[] tuple = new Object[getColumnNum(TPCEConstants.TABLENAME_SETTLEMENT)];
        currTable = TPCEConstants.TABLENAME_SETTLEMENT;
       
        tuple[0] = newTrade.tradeId; // se_t_id
        tuple[1] = addTrade.isCash ? "Cash Account" : "Margin"; // se_cash_type
        tuple[2] = new TimestampType(EGenDate.addDaysMsecs(getCurrentTradeCompletionTime(), 2, 0, false)); // se_cash_due_date; 2 days after
        tuple[3] = addTrade.settlement.getDollars(); // se_amt
       
        return tuple;       
    }
View Full Code Here

    private Object[] generateCashRow() {
        Object[] tuple = new Object[getColumnNum(TPCEConstants.TABLENAME_CASH_TRANSACTION)];
        currTable = TPCEConstants.TABLENAME_CASH_TRANSACTION;
       
        tuple[0] = newTrade.tradeId; // ct_t_id
        tuple[1] = new TimestampType(getCurrentTradeCompletionTime()); // ct_dts
        tuple[2] = addTrade.settlement.getDollars(); // ct_amt
        tuple[3] = tradeTypeFile.getTupleByIndex(newTrade.tradeType.ordinal())[1] + " " +
                Integer.toString(newTrade.tradeQty) + " shares of " + secGenerator.createName(newTrade.secFileIndex); // ct_name
       
        return tuple;       
View Full Code Here

               
                tuple[0] = newTrade.tradeId; // th_t_id
               
                switch (i) {
                    case 0:
                        tuple[1] = new TimestampType(getCurrentTradePendingTime()); // th_dts
                        tuple[2] = statusTypeFile.getTupleByIndex(StatusTypeId.E_PENDING.ordinal())[0]; // th_st_id
                        break;
                       
                    case 1:
                        tuple[1] = new TimestampType(getCurrentTradeSubmissionTime()); // th_dts
                        tuple[2] = statusTypeFile.getTupleByIndex(StatusTypeId.E_SUBMITTED.ordinal())[0]; // th_st_id
                        break;
                       
                    case 2:
                        tuple[1] = new TimestampType(getCurrentTradeCompletionTime()); // th_dts
                        tuple[2] = statusTypeFile.getTupleByIndex(StatusTypeId.E_COMPLETED.ordinal())[0]; // th_st_id
                        break;
                       
                    default:
                        assert false;
                }
               
                tradeHistory.add(tuple);
            }
        }
        else {
            for (int i = 0; i < 2; i++) {
                Object[] tuple = new Object[columnsNum];
               
                tuple[0] = newTrade.tradeId; // th_t_id
               
                switch (i) {
                    case 0:
                        tuple[1] = new TimestampType(getCurrentTradeSubmissionTime()); // th_dts
                        tuple[2] = statusTypeFile.getTupleByIndex(StatusTypeId.E_SUBMITTED.ordinal())[0]; // th_st_id
                        break;
                       
                    case 1:
                        tuple[1] = new TimestampType(getCurrentTradeCompletionTime()); // th_dts
                        tuple[2] = statusTypeFile.getTupleByIndex(StatusTypeId.E_COMPLETED.ordinal())[0]; // th_st_id
                        break;
                       
                    default:
                        assert false;
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.