Skip to content

Commit

Permalink
etl: remove 'etl-meta' query (deprecated)
Browse files Browse the repository at this point in the history
* part two, prev. commit: 4b43418
* NOTE:
  - patch release: bump v3.27 (cli v1.16)

Signed-off-by: Alex Aizman <[email protected]>
  • Loading branch information
alex-aizman committed Feb 14, 2025
1 parent b639c0d commit 93cc9a5
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 37 deletions.
3 changes: 0 additions & 3 deletions ais/dpq.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ type dpq struct {
}
etl struct {
name, targs string // QparamETLName, QparamETLTransformArgs
meta string // QparamETLMeta (DEPRECATED - Replace with QparamETLTransformArgs soon)
}

ptime string // req timestamp at calling/redirecting proxy (QparamUnixTime)
Expand Down Expand Up @@ -152,8 +151,6 @@ func (dpq *dpq) parse(rawQuery string) (err error) {
dpq.etl.name = value
case apc.QparamETLTransformArgs:
dpq.etl.targs = value
case apc.QparamETLMeta: // DEPRECATED - Replace with QparamETLTransformArgs soon.
dpq.etl.meta = value
case apc.QparamSilent:
dpq.silent = cos.IsParseBool(value)
case apc.QparamLatestVer:
Expand Down
2 changes: 1 addition & 1 deletion ais/test/etl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ func testETLObject(t *testing.T, etlName string, args any, inPath, outPath strin
defer fho.Close()

tlog.Logf("GET %s via etl[%s], args=%v\n", bck.Cname(objName), etlName, args)
oah, err := api.ETLObject(baseParams, &api.ETLObjArgs{ETLName: etlName, Metadata: args}, bck, objName, fho)
oah, err := api.ETLObject(baseParams, &api.ETLObjArgs{ETLName: etlName, TransformArgs: args}, bck, objName, fho)
tassert.CheckFatal(t, err)

stat, _ := fho.Stat()
Expand Down
3 changes: 1 addition & 2 deletions ais/tgtetl.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,6 @@ func (t *target) getFromETL(w http.ResponseWriter, r *http.Request, dpq *dpq, lo
var (
name = dpq.etl.name // apc.QparamETLName
targs = dpq.etl.targs // apc.QparamETLTransformArgs
meta = dpq.etl.meta // apc.QparamETLMeta, DEPRECATED - Replace with QparamETLTransformArgs soon
)
comm, err := etl.GetCommunicator(name)
if err != nil {
Expand All @@ -169,7 +168,7 @@ func (t *target) getFromETL(w http.ResponseWriter, r *http.Request, dpq *dpq, lo
return
}

if err := comm.InlineTransform(w, r, lom, targs, meta); err != nil {
if err := comm.InlineTransform(w, r, lom, targs); err != nil {
errV := cmn.NewErrETL(&cmn.ETLErrCtx{ETLName: name, ETLTransformArgs: targs, PodName: comm.PodName(), SvcName: comm.SvcName()},
err.Error())
xetl := comm.Xact()
Expand Down
1 change: 0 additions & 1 deletion api/apc/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const (

// etl
QparamETLName = "etl_name"
QparamETLMeta = "etl_meta" // TODO: DEPRECATED - Replace with QparamETLTransformArgs soon.
QparamETLTransformArgs = "etl_args"

QparamRegex = "regex" // dsort: list regex
Expand Down
11 changes: 0 additions & 11 deletions api/etl.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ type ETLObjArgs struct {
// TransformArgs holds the arguments to be used in ETL inline transform,
// which will be sent as `apc.QparamETLArgs` query parameter in the request.
TransformArgs any

// DEPRECATED - Replace with TransformArgs soon.
Metadata any
}

// Initiate custom ETL workload by executing one of the documented `etl.InitMsg`
Expand Down Expand Up @@ -167,14 +164,6 @@ func ETLObject(bp BaseParams, args *ETLObjArgs, bck cmn.Bck, objName string, w i
query.Add(apc.QparamETLTransformArgs, targs)
}

if args.Metadata != nil {
meta, err := cos.ConvertToString(args.Metadata)
if err != nil {
return oah, err
}
query.Add(apc.QparamETLMeta, meta)
}

return GetObject(bp, bck, objName, &GetArgs{Writer: w, Query: query})
}

Expand Down
4 changes: 2 additions & 2 deletions cmn/ver_const.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const GitHubHome = "https://github.com/NVIDIA/aistore"
// `jsp` formats its *signature* and other implementation details.

const (
VersionAIStore = "3.26"
VersionCLI = "1.15"
VersionAIStore = "3.27"
VersionCLI = "1.16"
VersionLoader = "1.12"
VersionAuthN = "1.2"
)
Expand Down
2 changes: 1 addition & 1 deletion ext/etl/comm_internal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ var _ = Describe("CommunicatorTest", func() {
}))
targetServer = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
receivedEtlTransformArgs := r.URL.Query().Get(apc.QparamETLTransformArgs)
err := comm.InlineTransform(w, r, lom, receivedEtlTransformArgs, "")
err := comm.InlineTransform(w, r, lom, receivedEtlTransformArgs)
Expect(err).NotTo(HaveOccurred())
}))
proxyServer = httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
Expand Down
26 changes: 10 additions & 16 deletions ext/etl/communicator.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type (
// InlineTransform uses one of the two ETL container endpoints:
// - Method "PUT", Path "/"
// - Method "GET", Path "/bucket/object"
InlineTransform(w http.ResponseWriter, r *http.Request, lom *core.LOM, targs, meta string) error
InlineTransform(w http.ResponseWriter, r *http.Request, lom *core.LOM, targs string) error

// OfflineTransform is driven by `OfflineDP` to provide offline transformation, as it were
// Implementations include:
Expand Down Expand Up @@ -195,14 +195,14 @@ func (c *baseComm) getWithTimeout(url string, timeout time.Duration) (r cos.Read
// pushComm: implements (Hpush | HpushStdin)
//////////////

func (pc *pushComm) doRequest(lom *core.LOM, timeout time.Duration, targs, meta string) (r cos.ReadCloseSizer, err error) {
func (pc *pushComm) doRequest(lom *core.LOM, timeout time.Duration, targs string) (r cos.ReadCloseSizer, err error) {
if err := lom.InitBck(lom.Bucket()); err != nil {
return nil, err
}

var ecode int
lom.Lock(false)
r, ecode, err = pc.do(lom, timeout, targs, meta)
r, ecode, err = pc.do(lom, timeout, targs)
lom.Unlock(false)

if err != nil && cos.IsNotExist(err, ecode) && lom.Bucket().IsRemote() {
Expand All @@ -211,13 +211,13 @@ func (pc *pushComm) doRequest(lom *core.LOM, timeout time.Duration, targs, meta
return nil, err
}
lom.Lock(false)
r, _, err = pc.do(lom, timeout, targs, meta)
r, _, err = pc.do(lom, timeout, targs)
lom.Unlock(false)
}
return
}

func (pc *pushComm) do(lom *core.LOM, timeout time.Duration, targs, meta string) (_ cos.ReadCloseSizer, ecode int, err error) {
func (pc *pushComm) do(lom *core.LOM, timeout time.Duration, targs string) (_ cos.ReadCloseSizer, ecode int, err error) {
var (
body io.ReadCloser
cancel func()
Expand Down Expand Up @@ -257,9 +257,6 @@ func (pc *pushComm) do(lom *core.LOM, timeout time.Duration, targs, meta string)
if targs != "" {
query.Add(apc.QparamETLTransformArgs, targs)
}
if meta != "" {
query.Add(apc.QparamETLMeta, meta)
}

if timeout != 0 {
var ctx context.Context
Expand Down Expand Up @@ -309,8 +306,8 @@ finish:
return cos.NewReaderWithArgs(rargs), 0, nil
}

func (pc *pushComm) InlineTransform(w http.ResponseWriter, _ *http.Request, lom *core.LOM, targs, meta string) error {
r, err := pc.doRequest(lom, 0 /*timeout*/, targs, meta)
func (pc *pushComm) InlineTransform(w http.ResponseWriter, _ *http.Request, lom *core.LOM, targs string) error {
r, err := pc.doRequest(lom, 0 /*timeout*/, targs)
if err != nil {
return err
}
Expand All @@ -332,7 +329,7 @@ func (pc *pushComm) InlineTransform(w http.ResponseWriter, _ *http.Request, lom

func (pc *pushComm) OfflineTransform(lom *core.LOM, timeout time.Duration) (r cos.ReadCloseSizer, err error) {
clone := *lom
r, err = pc.doRequest(&clone, timeout, "", "")
r, err = pc.doRequest(&clone, timeout, "")
if err == nil && cmn.Rom.FastV(5, cos.SmoduleETL) {
nlog.Infoln(Hpush, clone.Cname(), err)
}
Expand All @@ -343,7 +340,7 @@ func (pc *pushComm) OfflineTransform(lom *core.LOM, timeout time.Duration) (r co
// redirectComm: implements Hpull
//////////////////

func (rc *redirectComm) InlineTransform(w http.ResponseWriter, r *http.Request, lom *core.LOM, targs, meta string) error {
func (rc *redirectComm) InlineTransform(w http.ResponseWriter, r *http.Request, lom *core.LOM, targs string) error {
if err := rc.boot.xctn.AbortErr(); err != nil {
return err
}
Expand All @@ -356,9 +353,6 @@ func (rc *redirectComm) InlineTransform(w http.ResponseWriter, r *http.Request,
if targs != "" {
query.Add(apc.QparamETLTransformArgs, targs)
}
if meta != "" {
query.Add(apc.QparamETLMeta, meta)
}

http.Redirect(w, r, cos.JoinQuery(rc.redirectURL(lom), query), http.StatusTemporaryRedirect)

Expand Down Expand Up @@ -399,7 +393,7 @@ func (rc *redirectComm) OfflineTransform(lom *core.LOM, timeout time.Duration) (
// revProxyComm: implements Hrev
//////////////////

func (rp *revProxyComm) InlineTransform(w http.ResponseWriter, r *http.Request, lom *core.LOM, _, _ string) error {
func (rp *revProxyComm) InlineTransform(w http.ResponseWriter, r *http.Request, lom *core.LOM, _ string) error {
err := lomLoad(lom)
if err != nil {
return err
Expand Down

0 comments on commit 93cc9a5

Please sign in to comment.