Skip to content

Commit 4272626

Browse files
tkalkirillsk0x50
authored andcommitted
IGNITE-15877 Fix the code style javadocs issues for the modules (step #2). Fixes #438
Signed-off-by: Slava Koptilin <[email protected]>
1 parent e3c2d46 commit 4272626

File tree

163 files changed

+861
-1842
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+861
-1842
lines changed

modules/affinity/src/main/java/org/apache/ignite/internal/affinity/RendezvousAffinityFunction.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ public static List<ClusterNode> assignPartition(
183183
}
184184

185185
/**
186-
* Creates assignment for REPLICATED table
186+
* Creates assignment for REPLICATED table.
187187
*
188188
* @param nodes Topology.
189189
* @param sortedNodes Sorted for specified partitions nodes.
@@ -302,7 +302,7 @@ public static Map<String, Collection<ClusterNode>> neighbors(Collection<ClusterN
302302
}
303303

304304
/**
305-
*
305+
* Hash comparator.
306306
*/
307307
private static class HashComparator implements Comparator<IgniteBiTuple<Long, ClusterNode>>, Serializable {
308308
/** Serial version uid. */
@@ -317,16 +317,18 @@ public int compare(IgniteBiTuple<Long, ClusterNode> o1, IgniteBiTuple<Long, Clus
317317
}
318318

319319
/**
320-
* Sorts the initial array with linear sort algorithm array
320+
* Sorts the initial array with linear sort algorithm array.
321321
*/
322322
private static class LazyLinearSortedContainer implements Iterable<ClusterNode> {
323323
/** Initial node-hash array. */
324324
private final IgniteBiTuple<Long, ClusterNode>[] arr;
325325

326-
/** Count of the sorted elements */
326+
/** Count of the sorted elements. */
327327
private int sorted;
328328

329329
/**
330+
* Constructor.
331+
*
330332
* @param arr Node / partition hash list.
331333
* @param needFirstSortedCnt Estimate count of elements to return by iterator.
332334
*/
@@ -347,7 +349,7 @@ public Iterator<ClusterNode> iterator() {
347349
}
348350

349351
/**
350-
*
352+
* Sorting iterator.
351353
*/
352354
private class SortIterator implements Iterator<ClusterNode> {
353355
/** Index of the first unsorted element. */

modules/affinity/src/test/java/org/apache/ignite/internal/affinity/AffinityServiceTest.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@
3232
* just checks {@link AffinityUtils} logic.
3333
*/
3434
public class AffinityServiceTest {
35-
/**
36-
*
37-
*/
3835
@Test
3936
public void testCalculatedAssignmentHappyPath() {
4037
List<List<ClusterNode>> assignments = AffinityUtils.calculateAssignments(
@@ -59,9 +56,6 @@ public void testCalculatedAssignmentHappyPath() {
5956
}
6057
}
6158

62-
/**
63-
*
64-
*/
6559
@Test
6660
public void testEmptyBaselineAssignmentsCalculation() {
6761
List<List<ClusterNode>> assignments = AffinityUtils.calculateAssignments(

modules/cli/src/integrationTest/java/org/apache/ignite/cli/ItConfigCommandTest.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ public class ItConfigCommandTest extends AbstractCliTest {
5656
/** stdout. */
5757
private ByteArrayOutputStream out;
5858

59-
/** Port for REST communication */
59+
/** Port for REST communication. */
6060
private int restPort;
6161

62-
/** Port for thin client communication */
62+
/** Port for thin client communication. */
6363
private int clientPort;
6464

6565
/** Network port. */
@@ -68,9 +68,6 @@ public class ItConfigCommandTest extends AbstractCliTest {
6868
/** Node. */
6969
private Ignite node;
7070

71-
/**
72-
*
73-
*/
7471
@BeforeEach
7572
void setup(@TempDir Path workDir, TestInfo testInfo) throws IOException {
7673
// TODO: IGNITE-15131 Must be replaced by receiving the actual port configs from the started node.
@@ -95,9 +92,6 @@ void setup(@TempDir Path workDir, TestInfo testInfo) throws IOException {
9592
out = new ByteArrayOutputStream();
9693
}
9794

98-
/**
99-
*
100-
*/
10195
@AfterEach
10296
void tearDown(TestInfo testInfo) {
10397
IgnitionManager.stop(testNodeName(testInfo, networkPort));
@@ -163,6 +157,8 @@ public void partialGet() {
163157
}
164158

165159
/**
160+
* Returns any available prt.
161+
*
166162
* @return Any available port.
167163
* @throws IOException if can't allocate port to open socket.
168164
*/
@@ -174,6 +170,8 @@ private int getAvailablePort() throws IOException {
174170
}
175171

176172
/**
173+
* Creates a new command line interpreter.
174+
*
177175
* @param applicationCtx DI context.
178176
* @return New command line instance.
179177
*/

modules/cli/src/main/java/org/apache/ignite/cli/CliPathsConfigLoader.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.apache.ignite.cli.builtins.SystemPathResolver;
2929

3030
/**
31-
* Due to the nature of Ignite CLI tool it can be runned in the environment without ignitecfg file at all. This class created to simplify
31+
* Due to the nature of Ignite CLI tool it can be run in the environment without configuration file at all. This class created to simplify
3232
* the managing of the different cases:
3333
* <ul>
3434
* <li>When user download binary and run it to manage any existence remote cluster</li>
@@ -93,6 +93,8 @@ public IgnitePaths loadIgnitePathsOrThrowError() {
9393
}
9494

9595
/**
96+
* Returns path to Ignite CLI configuration file.
97+
*
9698
* @return Path to Ignite CLI config file.
9799
*/
98100
public Path configFilePath() {

modules/cli/src/main/java/org/apache/ignite/cli/IgniteCliApp.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@
3030
* Entry point of Ignite CLI.
3131
*/
3232
public class IgniteCliApp {
33+
/**
34+
* Entry point of Ignite CLI.
35+
*
36+
* @param args Command line arguments.
37+
*/
3338
public static void main(String... args) {
3439
initJavaLoggerProps();
3540

modules/cli/src/main/java/org/apache/ignite/cli/IgniteCliException.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,18 @@ public class IgniteCliException extends RuntimeException {
2525
private static final long serialVersionUID = 0L;
2626

2727
/**
28-
* @param msg Message.
28+
* Creates a new instance of {@code IgniteCliException} with the given {@code msg}.
29+
*
30+
* @param msg Detailed message.
2931
*/
3032
public IgniteCliException(String msg) {
3133
super(msg);
3234
}
3335

3436
/**
35-
* @param msg Message.
37+
* Creates a new instance of {@code IgniteCliException} with the given {@code msg} and {@code cause}.
38+
*
39+
* @param msg Detailed message.
3640
* @param cause Cause.
3741
*/
3842
public IgniteCliException(String msg, Throwable cause) {

modules/cli/src/main/java/org/apache/ignite/cli/IgnitePaths.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class IgnitePaths {
6363
/** Directory for storing server node configs. */
6464
public final Path cfgDir;
6565

66-
/** Directory for server nodes logs */
66+
/** Directory for server nodes logs. */
6767
public final Path logDir;
6868

6969
/**
@@ -89,48 +89,62 @@ public IgnitePaths(Path binDir, Path workDir, Path cfgDir, Path logDir, String v
8989
}
9090

9191
/**
92+
* Returns a path where CLI module artifacts will be placed.
93+
*
9294
* @return Path where CLI module artifacts will be placed.
9395
*/
9496
public Path cliLibsDir() {
9597
return binDir.resolve(ver).resolve("cli");
9698
}
9799

98100
/**
101+
* Returns a path where Ignite server module artifacts will be placed..
102+
*
99103
* @return Path where Ignite server module artifacts will be placed.
100104
*/
101105
public Path libsDir() {
102106
return binDir.resolve(ver).resolve("libs");
103107
}
104108

105109
/**
110+
* Returns a path where Ignite node pid files will be created.
111+
*
106112
* @return Path where Ignite node pid files will be created.
107113
*/
108114
public Path cliPidsDir() {
109115
return workDir.resolve("cli").resolve("pids");
110116
}
111117

112118
/**
113-
* @return Path to file with registry data for {@link org.apache.ignite.cli.builtins.module.ModuleRegistry}
119+
* Returns a path to file with registry data for {@link org.apache.ignite.cli.builtins.module.ModuleRegistry}.
120+
*
121+
* @return Path to file with registry data for {@link org.apache.ignite.cli.builtins.module.ModuleRegistry}.
114122
*/
115123
public Path installedModulesFile() {
116124
return workDir.resolve("modules.json");
117125
}
118126

119127
/**
128+
* Returns a path to directory with Ignite nodes configs.
129+
*
120130
* @return Path to directory with Ignite nodes configs.
121131
*/
122132
public Path serverConfigDir() {
123133
return workDir.resolve("config");
124134
}
125135

126136
/**
137+
* Returns a path to default Ignite node config.
138+
*
127139
* @return Path to default Ignite node config.
128140
*/
129141
public Path serverDefaultConfigFile() {
130142
return cfgDir.resolve("default-config.xml");
131143
}
132144

133145
/**
146+
* Returns a path to default Ignite node config.
147+
*
134148
* @return Path to default Ignite node config.
135149
*/
136150
public Path serverJavaUtilLoggingPros() {

modules/cli/src/main/java/org/apache/ignite/cli/InteractiveWrapper.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,16 @@ public class InteractiveWrapper {
4444
private final Terminal terminal;
4545

4646
/**
47+
* Creates a new instance of {@code InteractiveWrapper} for the given {@code terminal}.
48+
*
4749
* @param terminal Terminal.
4850
*/
4951
public InteractiveWrapper(Terminal terminal) {
5052
this.terminal = terminal;
5153
}
5254

5355
/**
54-
* Start interactive shell.
56+
* Starts interactive shell.
5557
*
5658
* @param cmd Prepared CommandLine instance to use for interactive mode.
5759
*/
@@ -103,7 +105,10 @@ public Object invoke(CommandSession ses, String cmd, Object... args) throws Exce
103105
}
104106

105107
/**
108+
* Returns a path to the user directory.
109+
* This is the directory where JVM was run from.
106110
*
111+
* @return Path to the user directory.
107112
*/
108113
private static Path workDir() {
109114
return Paths.get(System.getProperty("user.dir"));

modules/cli/src/main/java/org/apache/ignite/cli/Table.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public class Table {
3333
/** Color scheme for table output. */
3434
private final ColorScheme cs;
3535

36-
/** Table data */
36+
/** Table data. */
3737
private final Collection<Row> data = new ArrayList<>();
3838

3939
/** Columns lengths. */
@@ -116,9 +116,6 @@ public String toString() {
116116
return sb.toString().stripTrailing();
117117
}
118118

119-
/**
120-
*
121-
*/
122119
private void appendLine(StringBuilder sb) {
123120
sb.append(" ".repeat(indent));
124121

@@ -130,7 +127,10 @@ private void appendLine(StringBuilder sb) {
130127
}
131128

132129
/**
130+
* Appends the given {@code row} to the specified string builder {@code sb}.
133131
*
132+
* @param sb String builder that accumulates a result.
133+
* @param row Row to be appended to the string builder.
134134
*/
135135
private void appendRow(StringBuilder sb, Row row) {
136136
sb.append(" ".repeat(indent))
@@ -148,13 +148,13 @@ private interface Row {
148148
* Row with actual data.
149149
*/
150150
private class DataRow implements Row {
151-
/**
152-
*
153-
*/
151+
/** Text. */
154152
private final Text[] row;
155153

156154
/**
155+
* Creates a new {@code DataRow} with the specified data.
157156
*
157+
* @param row Text to be rendered.
158158
*/
159159
DataRow(Text[] row) {
160160
this.row = row;
@@ -185,13 +185,11 @@ public String render() {
185185
* Row with table title.
186186
*/
187187
private class SectionTitle implements Row {
188-
/**
189-
*
190-
*/
188+
/** Title. */
191189
private final Text title;
192190

193191
/**
194-
*
192+
* Creates a new {@code SectionTitle} with the given {@code title}.
195193
*/
196194
SectionTitle(Text title) {
197195
this.title = title;

modules/cli/src/main/java/org/apache/ignite/cli/builtins/SystemPathResolver.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,21 @@
3030
*/
3131
public interface SystemPathResolver {
3232
/**
33+
* Returns system specific user home directory..
34+
*
3335
* @return System specific user home directory.
3436
*/
3537
Path osHomeDirectoryPath();
3638

3739
/**
40+
* Returns directory where CLI tool binary placed.
41+
*
3842
* @return Directory where CLI tool binary placed.
3943
*/
4044
Path toolHomeDirectoryPath();
4145

4246
/**
43-
*
47+
* Default path resolver.
4448
*/
4549
@Singleton
4650
@Introspected

0 commit comments

Comments
 (0)