Search in sources :

Example 1 with CreateVolume

use of com.zimbra.cs.redolog.op.CreateVolume in project zm-mailbox by Zimbra.

the class VolumeManager method create.

public Volume create(Volume volume, boolean noRedo) throws ServiceException {
    CreateVolume redoRecorder = null;
    if (!noRedo) {
        redoRecorder = new CreateVolume(volume);
        redoRecorder.start(System.currentTimeMillis());
    }
    boolean success = false;
    DbConnection conn = DbPool.getConnection();
    try {
        volume = DbVolume.create(conn, volume);
        success = true;
        if (!noRedo) {
            redoRecorder.setId(volume.getId());
            redoRecorder.log();
        }
        return volume;
    } finally {
        endTransaction(success, conn, redoRecorder);
        if (success) {
            synchronized (this) {
                id2volume.put(volume.getId(), volume);
                updateSweptDirectories();
            }
        }
    }
}
Also used : CreateVolume(com.zimbra.cs.redolog.op.CreateVolume) DbConnection(com.zimbra.cs.db.DbPool.DbConnection)

Aggregations

DbConnection (com.zimbra.cs.db.DbPool.DbConnection)1 CreateVolume (com.zimbra.cs.redolog.op.CreateVolume)1