RollUpPurgeSteps.java 文件源码

java
阅读 21 收藏 0 点赞 0 评论 0

项目:pugtsdb 作者:
@Then("^the rolled up point on \"([^\"]*)\" (\\d+) \"([^\"]*)\" wont be purged$")
public void theRolledUpPointOnWontBePurged(String timestampState,
                                           long timestampDiff,
                                           String timestampUnit) throws Throwable {
    String sql = ""
            + " SELECT * FROM point_" + rollUp.getTargetGranularity()
            + " WHERE \"metric_id\" = ?   "
            + " AND   \"timestamp\" = ?   "
            + " AND   \"aggregation\" = ? ";

    Timestamp timestamp = resolveTimestamp(timestampState, timestampDiff, timestampUnit);

    try (Connection connection = pugTSDB.getDataSource().getConnection();
         PreparedStatement statement = connection.prepareStatement(sql)) {
        statement.setInt(1, metric.getId());
        statement.setTimestamp(2, timestamp);
        statement.setString(3, aggregation.getName());
        ResultSet resultSet = statement.executeQuery();

        assertTrue(resultSet.next());
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号