当前位置: 首页>>代码示例>>Java>>正文


Java TimestampType.getTime方法代码示例

本文整理汇总了Java中org.voltdb.types.TimestampType.getTime方法的典型用法代码示例。如果您正苦于以下问题:Java TimestampType.getTime方法的具体用法?Java TimestampType.getTime怎么用?Java TimestampType.getTime使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.voltdb.types.TimestampType的用法示例。


在下文中一共展示了TimestampType.getTime方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getScaledTimestamp

import org.voltdb.types.TimestampType; //导入方法依赖的package包/类
/**
     * 
     * @param benchmarkStart
     * @param clientStart
     * @param current
     * @return
     */
    public static TimestampType getScaledTimestamp(TimestampType benchmarkStart, TimestampType clientStart, TimestampType current) {
//        if (benchmarkStart == null || clientStart == null || current == null) return (null);
        
        // First get the offset between the benchmarkStart and the clientStart
        // We then subtract that value from the current time. This gives us the total elapsed 
        // time from the current time to the time that the benchmark start (with the gap 
        // from when the benchmark was loading data cut out) 
        long base = benchmarkStart.getTime();
        long offset = current.getTime() - (clientStart.getTime() - base);
        long elapsed = (offset - base) * AuctionMarkConstants.TIME_SCALE_FACTOR;
        return (new TimestampType(base + elapsed));
    }
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:20,代码来源:AuctionMarkProfile.java

示例2: getFindFlightsParams

import org.voltdb.types.TimestampType; //导入方法依赖的package包/类
/**
 * Execute one of the FindFlight transactions
 * @param txn
 * @throws IOException
 */
protected Pair<Object[], ProcedureCallback> getFindFlightsParams() {
    // Select two random airport ids
    // 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)];
    }
    
    Object params[] = new Object[] {
        depart_airport_id,
        arrive_airport_id,
        start_date,
        stop_date,
        distance
    };
    if (trace.val) LOG.trace("Calling " + Transaction.FIND_FLIGHTS.getExecName());
    return new Pair<Object[], ProcedureCallback>(params, new FindFlightsCallback());
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:32,代码来源:SEATSClient.java

示例3: getRandomStartTimestamp

import org.voltdb.types.TimestampType; //导入方法依赖的package包/类
private TimestampType getRandomStartTimestamp(TimestampType endDate) {
    long duration = ((long)profile.randomDuration.nextInt()) * AuctionMarkConstants.MICROSECONDS_IN_A_DAY;
    long lStartTimestamp = endDate.getTime() - duration;
    TimestampType startTimestamp = new TimestampType(lStartTimestamp);
    return startTimestamp;
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:7,代码来源:AuctionMarkLoader.java

示例4: getRandomPurchaseTimestamp

import org.voltdb.types.TimestampType; //导入方法依赖的package包/类
private TimestampType getRandomPurchaseTimestamp(TimestampType endDate) {
    long duration = profile.randomPurchaseDuration.nextInt();
    return new TimestampType(endDate.getTime() + duration * AuctionMarkConstants.MICROSECONDS_IN_A_DAY);
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:5,代码来源:AuctionMarkLoader.java

示例5: getRandomUpcomingDate

import org.voltdb.types.TimestampType; //导入方法依赖的package包/类
/**
 * 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)));
}
 
开发者ID:s-store,项目名称:sstore-soft,代码行数:10,代码来源:SEATSProfile.java


注:本文中的org.voltdb.types.TimestampType.getTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。