use of org.apache.asterix.app.nc.task.RemoteRecoveryTask in project asterixdb by apache.
the class MetadataNodeFaultToleranceStrategy method getMetadataPartitionRecoveryPlan.
private RemoteRecoveryTask getMetadataPartitionRecoveryPlan() {
if (hotStandbyMetadataReplica.isEmpty()) {
throw new IllegalStateException("No metadata replicas to recover from");
}
// Construct recovery plan: Node => Set of partitions to recover from it
Map<String, Set<Integer>> recoveryPlan = new HashMap<>();
// Recover metadata partition from any metadata hot standby replica
ICcApplicationContext appCtx = (ICcApplicationContext) serviceCtx.getApplicationContext();
int metadataPartitionId = appCtx.getMetadataProperties().getMetadataPartition().getPartitionId();
Set<Integer> metadataPartition = new HashSet<>(Arrays.asList(metadataPartitionId));
recoveryPlan.put(hotStandbyMetadataReplica.iterator().next(), metadataPartition);
return new RemoteRecoveryTask(recoveryPlan);
}
Aggregations