github.com/NVIDIA/aistore@v1.3.23-0.20240517131212-7df6609be51d/ext/dsort/err.go (about)

     1  // Package dsort provides distributed massively parallel resharding for very large datasets.
     2  /*
     3   * Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.
     4   */
     5  package dsort
     6  
     7  import (
     8  	"fmt"
     9  
    10  	"github.com/NVIDIA/aistore/api/apc"
    11  	"github.com/NVIDIA/aistore/cmn"
    12  	"github.com/pkg/errors"
    13  )
    14  
    15  const (
    16  	fmtErrInvalidAlg     = "invalid sorting algorithm (expecting one of: %+v)" // <--- supportedAlgorithms
    17  	fmtErrInvalidMaxSize = "invalid max shard size (%d) for usage with external key map"
    18  	fmtErrNegOutputSize  = "output shard size must be >= 0 (got %d)"
    19  	fmtErrOrderURL       = "failed to parse order file ('order_file') URL %q: %v"
    20  	fmtErrSeed           = "invalid seed %q (expecting integer value)"
    21  )
    22  
    23  var (
    24  	errAlgExt            = errors.New("algorithm: invalid extension")
    25  	errNegConcLimit      = errors.New("negative concurrency limit")
    26  	errMissingOutputSize = errors.New("output shard size must be set (cannot be 0 and cannot be omitted)")
    27  	errMissingSrcBucket  = errors.New("missing source bucket")
    28  )
    29  
    30  func (m *Manager) newErrAborted() error {
    31  	err := m.xctn.AbortErr()
    32  	return cmn.NewErrAborted(fmt.Sprintf("%s[%s]", apc.ActDsort, m.ManagerUUID), "", err)
    33  }
    34  
    35  // Returns if the error is not abort error - in other cases we need to report
    36  // the error to the user.
    37  func isReportableError(err error) bool {
    38  	return !cmn.IsErrAborted(err)
    39  }