Search in sources :

Example 1 with DefaultSnapshotDataTarget

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;
}
Also used : DefaultSnapshotDataTarget(org.voltdb.DefaultSnapshotDataTarget) SnapshotDataTarget(org.voltdb.SnapshotDataTarget) DefaultSnapshotDataTarget(org.voltdb.DefaultSnapshotDataTarget) File(java.io.File)

Aggregations

File (java.io.File)1 DefaultSnapshotDataTarget (org.voltdb.DefaultSnapshotDataTarget)1 SnapshotDataTarget (org.voltdb.SnapshotDataTarget)1