use of org.voltdb.DefaultSnapshotDataTarget in project voltdb by VoltDB.
the class NativeSnapshotWritePlan method createDataTargetForTable.
private SnapshotDataTarget createDataTargetForTable(String file_path, String file_nonce, Table table, long txnId, int hostId, String clusterName, String databaseName, int partitionCount, boolean isActiveActiveDRed, SiteTracker tracker, long timestamp, AtomicInteger numTables, SnapshotRegistry.Snapshot snapshotRecord) throws IOException {
SnapshotDataTarget sdt;
File saveFilePath = SnapshotUtil.constructFileForTable(table, file_path, file_nonce, SnapshotFormat.NATIVE, hostId);
if (isActiveActiveDRed && table.getIsdred()) {
sdt = new DefaultSnapshotDataTarget(saveFilePath, hostId, clusterName, databaseName, table.getTypeName(), partitionCount, table.getIsreplicated(), tracker.getPartitionsForHost(hostId), CatalogUtil.getVoltTable(table, CatalogUtil.DR_HIDDEN_COLUMN_INFO), txnId, timestamp);
} else {
sdt = new DefaultSnapshotDataTarget(saveFilePath, hostId, clusterName, databaseName, table.getTypeName(), partitionCount, table.getIsreplicated(), tracker.getPartitionsForHost(hostId), CatalogUtil.getVoltTable(table), txnId, timestamp);
}
m_targets.add(sdt);
final Runnable onClose = new TargetStatsClosure(sdt, table.getTypeName(), numTables, snapshotRecord);
sdt.setOnCloseHandler(onClose);
return sdt;
}
Aggregations