本文整理匯總了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);
}
示例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();
}
示例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);
}