From 6cffdef49aece80276649289359a4726d908f621 Mon Sep 17 00:00:00 2001 From: Nikolay Date: Mon, 11 Dec 2023 15:31:04 +0300 Subject: [PATCH] IGNITE-14823 Argument abbrevation (#11085) --- .../query/calcite/exec/exp/ConverterUtils.java | 14 +++++++------- .../query/calcite/exec/exp/RexImpTable.java | 6 +++--- .../checkstyle/src/main/resources/abbrevations.csv | 3 ++- .../argument/parser/CLIArgumentParser.java | 4 ++-- .../processors/task/GridTaskProcessor.java | 6 +++--- .../MaintenancePersistenceTaskTest.java | 8 ++++---- 6 files changed, 21 insertions(+), 20 deletions(-) diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/ConverterUtils.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/ConverterUtils.java index 6ddf9855a852c..4f18bd6f5e2e1 100644 --- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/ConverterUtils.java +++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/ConverterUtils.java @@ -436,19 +436,19 @@ private static boolean representAsInternalType(Type type) { * Integer directly). * * @param targetTypes Formal operand types declared for the function arguments - * @param arguments Input expressions to the function + * @param args Input expressions to the function * @return Input expressions with probable type conversion */ static List convertAssignableTypes(Class[] targetTypes, - List arguments) { + List args) { final List list = new ArrayList<>(); - if (targetTypes.length == arguments.size()) { - for (int i = 0; i < arguments.size(); i++) - list.add(convertAssignableType(arguments.get(i), targetTypes[i])); + if (targetTypes.length == args.size()) { + for (int i = 0; i < args.size(); i++) + list.add(convertAssignableType(args.get(i), targetTypes[i])); } else { int j = 0; - for (Expression argument: arguments) { + for (Expression arg: args) { Class type; if (!targetTypes[j].isArray()) { type = targetTypes[j]; @@ -457,7 +457,7 @@ static List convertAssignableTypes(Class[] targetTypes, else type = targetTypes[j].getComponentType(); - list.add(convertAssignableType(argument, type)); + list.add(convertAssignableType(arg, type)); } } return list; diff --git a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java index cd139b1cbbf54..f90c6c344257d 100644 --- a/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java +++ b/modules/calcite/src/main/java/org/apache/ignite/internal/processors/query/calcite/exec/exp/RexImpTable.java @@ -2481,9 +2481,9 @@ public static CallImplementor createImplementor( return (translator, call, nullAs) -> { final RexImpTable.RexCallImplementor rexCallImplementor = createRexCallImplementor(implementor, nullPolicy, harmonize); - final List arguments = translator.getCallOperandResult(call); - assert arguments != null; - final RexToLixTranslator.Result result = rexCallImplementor.implement(translator, call, arguments); + final List args = translator.getCallOperandResult(call); + assert args != null; + final RexToLixTranslator.Result result = rexCallImplementor.implement(translator, call, args); return nullAs.handle(result.valueVariable); }; } diff --git a/modules/checkstyle/src/main/resources/abbrevations.csv b/modules/checkstyle/src/main/resources/abbrevations.csv index 8d62828d91231..2e21e16a960ea 100644 --- a/modules/checkstyle/src/main/resources/abbrevations.csv +++ b/modules/checkstyle/src/main/resources/abbrevations.csv @@ -2,7 +2,8 @@ address,addr addresses,addrs affinity,aff -#argument,arg +argument,arg +arguments,args array,arr #attribute,attr #attributes,attrs diff --git a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/argument/parser/CLIArgumentParser.java b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/argument/parser/CLIArgumentParser.java index bf58ed927defa..0f6b1546e4875 100644 --- a/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/argument/parser/CLIArgumentParser.java +++ b/modules/control-utility/src/main/java/org/apache/ignite/internal/commandline/argument/parser/CLIArgumentParser.java @@ -61,8 +61,8 @@ public CLIArgumentParser( ) { this.positionalArgCfg = positionalArgConfig; - for (CLIArgument cliArgument : argConfiguration) - this.argConfiguration.put(cliArgument.name(), cliArgument); + for (CLIArgument cliArg : argConfiguration) + this.argConfiguration.put(cliArg.name(), cliArg); } /** diff --git a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java index 9e51179cc22f7..d40938a3e88cb 100644 --- a/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java +++ b/modules/core/src/main/java/org/apache/ignite/internal/processors/task/GridTaskProcessor.java @@ -714,12 +714,12 @@ else if (task != null) { assert taskWorker0 == null : "Session ID is not unique: " + sesId; if (ctx.event().isRecordable(EVT_MANAGEMENT_TASK_STARTED) && dep.visorManagementTask(task, taskCls)) { - VisorTaskArgument visorTaskArgument = (VisorTaskArgument)arg; + VisorTaskArgument visorTaskArg = (VisorTaskArgument)arg; Event evt = new TaskEvent( ctx.discovery().localNode(), - visorTaskArgument != null && visorTaskArgument.getArgument() != null - ? visorTaskArgument.getArgument().toString() : "[]", + visorTaskArg != null && visorTaskArg.getArgument() != null + ? visorTaskArg.getArgument().toString() : "[]", EVT_MANAGEMENT_TASK_STARTED, ses.getId(), taskCls == null ? null : taskCls.getSimpleName(), diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/MaintenancePersistenceTaskTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/MaintenancePersistenceTaskTest.java index 23fa918dd55c5..e724e34b28880 100644 --- a/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/MaintenancePersistenceTaskTest.java +++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/cache/persistence/MaintenancePersistenceTaskTest.java @@ -147,13 +147,13 @@ public void testInfoAfterClean() throws Exception { * @return Execution's result. */ private PersistenceTaskResult executeInfo(IgniteEx node) { - VisorTaskArgument infoArgument = new VisorTaskArgument<>( + VisorTaskArgument infoArg = new VisorTaskArgument<>( node.localNode().id(), new PersistenceCommand.PersistenceInfoTaskArg(), false ); - return node.compute().execute(new PersistenceTask(), infoArgument); + return node.compute().execute(new PersistenceTask(), infoArg); } /** @@ -167,12 +167,12 @@ private PersistenceTaskResult executeClean(IgniteEx node) { arg.caches(new String[]{CACHE_NAME}); - VisorTaskArgument cleanArgument = new VisorTaskArgument<>( + VisorTaskArgument cleanArg = new VisorTaskArgument<>( node.localNode().id(), arg, false ); - return node.compute().execute(new PersistenceTask(), cleanArgument); + return node.compute().execute(new PersistenceTask(), cleanArg); } }