private Data getBackupOperationData(BackupAwareOperation backupAwareOp) { Operation backupOp = backupAwareOp.getBackupOperation(); if (backupOp == null) { throw new IllegalArgumentException("Backup operation should not be null! " + backupAwareOp); } Operation op = (Operation) backupAwareOp; // set service name of backup operation. // if getServiceName() method is overridden to return the same name // then this will have no effect. backupOp.setServiceName(op.getServiceName()); return nodeEngine.getSerializationService().toData(backupOp); }
public Operation getBackupOperation() { List<Operation> backupOpList = new ArrayList<Operation>(); for (Operation operation : opList) { if (operation instanceof BackupAwareOperation) { BackupAwareOperation backupAwareOperation = (BackupAwareOperation) operation; if (backupAwareOperation.shouldBackup()) { backupOpList.add(backupAwareOperation.getBackupOperation()); } } } return new TxnCommitBackupOperation(name, dataKey, backupOpList, getCallerUuid(), threadId); }