Search in sources :

Example 1 with ReplicationExecutionType

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);
    }
}
Also used : ReplicationExecutionType(org.apache.hyracks.api.replication.IReplicationJob.ReplicationExecutionType) ILSMComponent(org.apache.hyracks.storage.am.lsm.common.api.ILSMComponent) IOException(java.io.IOException) HashSet(java.util.HashSet)

Aggregations

IOException (java.io.IOException)1 HashSet (java.util.HashSet)1 ReplicationExecutionType (org.apache.hyracks.api.replication.IReplicationJob.ReplicationExecutionType)1 ILSMComponent (org.apache.hyracks.storage.am.lsm.common.api.ILSMComponent)1