Exemplo n.º 1
0
Status BalancerConfiguration::refreshAndCheck(OperationContext* opCtx) {
    // Balancer configuration
    Status balancerSettingsStatus = _refreshBalancerSettings(opCtx);
    if (!balancerSettingsStatus.isOK()) {
        return {balancerSettingsStatus.code(),
                str::stream() << "Failed to refresh the balancer settings due to "
                              << balancerSettingsStatus.toString()};
    }

    // Chunk size settings
    Status chunkSizeStatus = _refreshChunkSizeSettings(opCtx);
    if (!chunkSizeStatus.isOK()) {
        return {chunkSizeStatus.code(),
                str::stream() << "Failed to refresh the chunk sizes settings due to "
                              << chunkSizeStatus.toString()};
    }

    // AutoSplit settings
    Status autoSplitStatus = _refreshAutoSplitSettings(opCtx);
    if (!autoSplitStatus.isOK()) {
        return {autoSplitStatus.code(),
                str::stream() << "Failed to refresh the autoSplit settings due to "
                              << autoSplitStatus.toString()};
    }

    return Status::OK();
}
Exemplo n.º 2
0
Status BalancerConfiguration::refreshAndCheck(OperationContext* opCtx) {
    // Balancer configuration
    Status balancerSettingsStatus = _refreshBalancerSettings(opCtx);
    if (!balancerSettingsStatus.isOK()) {
        return balancerSettingsStatus.withContext("Failed to refresh the balancer settings");
    }

    // Chunk size settings
    Status chunkSizeStatus = _refreshChunkSizeSettings(opCtx);
    if (!chunkSizeStatus.isOK()) {
        return chunkSizeStatus.withContext("Failed to refresh the chunk sizes settings");
    }

    // AutoSplit settings
    Status autoSplitStatus = _refreshAutoSplitSettings(opCtx);
    if (!autoSplitStatus.isOK()) {
        return autoSplitStatus.withContext("Failed to refresh the autoSplit settings");
    }

    return Status::OK();
}