當前位置: 首頁>>代碼示例>>Java>>正文


Java Snapshot類代碼示例

本文整理匯總了Java中org.voltdb.sysprocs.SnapshotRegistry.Snapshot的典型用法代碼示例。如果您正苦於以下問題:Java Snapshot類的具體用法?Java Snapshot怎麽用?Java Snapshot使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Snapshot類屬於org.voltdb.sysprocs.SnapshotRegistry包,在下文中一共展示了Snapshot類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: updateStatsRow

import org.voltdb.sysprocs.SnapshotRegistry.Snapshot; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
protected void updateStatsRow(Object rowKey, Object[] rowValues) {
    Pair<Snapshot, Table> p = (Pair<Snapshot, Table>) rowKey;
    Snapshot s = p.getFirst();
    Table t = p.getSecond();
    double duration = 0;
    double throughput = 0;
    if (s.timeFinished != 0) {
        duration = (s.timeFinished - s.timeStarted) / 1000.0;
        throughput = (s.bytesWritten / (1024.0 * 1024.0)) / duration;
    }

    rowValues[columnNameToIndex.get("TABLE")] = t.name;
    rowValues[columnNameToIndex.get("PATH")] = s.path;
    rowValues[columnNameToIndex.get("FILENAME")] = t.filename;
    rowValues[columnNameToIndex.get("NONCE")] = s.nonce;
    rowValues[columnNameToIndex.get("START_TIME")] = s.timeStarted;
    rowValues[columnNameToIndex.get("END_TIME")] = s.timeFinished;
    rowValues[columnNameToIndex.get("SIZE")] = t.size;
    rowValues[columnNameToIndex.get("DURATION")] = duration;
    rowValues[columnNameToIndex.get("THROUGHPUT")] = throughput;
    rowValues[columnNameToIndex.get("RESULT")] = t.error == null ? "SUCCESS" : "FAILURE";
    super.updateStatsRow(rowKey, rowValues);
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:26,代碼來源:SnapshotStatus.java

示例2: StatusIterator

import org.voltdb.sysprocs.SnapshotRegistry.Snapshot; //導入依賴的package包/類
private StatusIterator(Iterator<Snapshot> i) {
    m_snapshots = new LinkedList<Pair<Snapshot, Table>>();

    while (i.hasNext()) {
        final Snapshot s = i.next();
        s.iterateTables(new Snapshot.TableIterator() {
            @Override
            public void next(Table t) {
                m_snapshots.add(Pair.of(s, t));
            }
        });
    }

    m_iter = m_snapshots.iterator();
}
 
開發者ID:s-store,項目名稱:sstore-soft,代碼行數:16,代碼來源:SnapshotStatus.java

示例3: updateStatsRow

import org.voltdb.sysprocs.SnapshotRegistry.Snapshot; //導入依賴的package包/類
@SuppressWarnings("unchecked")
@Override
protected void updateStatsRow(Object rowKey, Object[] rowValues) {
    Pair<Snapshot, Table> p = (Pair<Snapshot, Table>) rowKey;
    Snapshot s = p.getFirst();
    Table t = p.getSecond();
    double duration = 0;
    double throughput = 0;
    long timeStarted = s.timeStarted;
    if (s.timeFinished != 0) {
        duration =
            (s.timeFinished - timeStarted) / 1000.0;
        throughput = (s.bytesWritten / (1024.0 * 1024.0)) / duration;
    }

    rowValues[columnNameToIndex.get("TABLE")] = t.name;
    rowValues[columnNameToIndex.get("PATH")] = s.path;
    rowValues[columnNameToIndex.get("FILENAME")] = t.filename;
    rowValues[columnNameToIndex.get("NONCE")] = s.nonce;
    rowValues[columnNameToIndex.get("TXNID")] = s.txnId;
    rowValues[columnNameToIndex.get("START_TIME")] = timeStarted;
    rowValues[columnNameToIndex.get("END_TIME")] = s.timeFinished;
    rowValues[columnNameToIndex.get("SIZE")] = t.size;
    rowValues[columnNameToIndex.get("DURATION")] = duration;
    rowValues[columnNameToIndex.get("THROUGHPUT")] = throughput;
    rowValues[columnNameToIndex.get("RESULT")] = t.error == null ? "SUCCESS" : "FAILURE";
    super.updateStatsRow(rowKey, rowValues);
}
 
開發者ID:anhnv-3991,項目名稱:VoltDB,代碼行數:29,代碼來源:SnapshotStatus.java


注:本文中的org.voltdb.sysprocs.SnapshotRegistry.Snapshot類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。