All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bazaarvoice.emodb.sor.db.astyanax.DefaultDataCopyDAO Maven / Gradle / Ivy

There is a newer version: 6.5.190
Show newest version
package com.bazaarvoice.emodb.sor.db.astyanax;

import com.bazaarvoice.emodb.table.db.astyanax.AstyanaxStorage;
import com.bazaarvoice.emodb.table.db.astyanax.DataCopyDAO;
import com.google.inject.Inject;

import static java.util.Objects.requireNonNull;

public class DefaultDataCopyDAO implements DataCopyDAO {

    private final DataCopyWriterDAO _dataCopyWriterDAO;
    private final DataCopyReaderDAO _dataCopyReaderDAO;

    @Inject
    public DefaultDataCopyDAO(DataCopyWriterDAO dataCopyWriterDAO, DataCopyReaderDAO dataCopyReaderDAO) {
        _dataCopyWriterDAO = requireNonNull(dataCopyWriterDAO);
        _dataCopyReaderDAO = requireNonNull(dataCopyReaderDAO);
    }

    @Override
    public void copy(AstyanaxStorage source, AstyanaxStorage dest, Runnable progress) {
        requireNonNull(source, "source");
        requireNonNull(dest, "dest");

        _dataCopyWriterDAO.copyDeltasToDestination(_dataCopyReaderDAO.getDeltasForStorage(source), dest, progress);
        _dataCopyWriterDAO.copyHistoriesToDestination(_dataCopyReaderDAO.getHistoriesForStorage(source), dest, progress);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy