use of org.apache.hyracks.api.replication.IReplicationJob.ReplicationExecutionType in project asterixdb by apache.
the class AbstractLSMIndex method scheduleReplication.
@Override
public void scheduleReplication(ILSMIndexOperationContext ctx, List<ILSMDiskComponent> lsmComponents, boolean bulkload, ReplicationOperation operation, LSMOperationType opType) throws HyracksDataException {
//get set of files to be replicated for this component
Set<String> componentFiles = new HashSet<>();
//get set of files to be replicated for each component
for (ILSMComponent lsmComponent : lsmComponents) {
componentFiles.addAll(getLSMComponentPhysicalFiles(lsmComponent));
}
ReplicationExecutionType executionType;
if (bulkload) {
executionType = ReplicationExecutionType.SYNC;
} else {
executionType = ReplicationExecutionType.ASYNC;
}
//create replication job and submit it
LSMIndexReplicationJob job = new LSMIndexReplicationJob(this, ctx, componentFiles, operation, executionType, opType);
try {
diskBufferCache.getIOReplicationManager().submitJob(job);
} catch (IOException e) {
throw HyracksDataException.create(e);
}
}
Aggregations