Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
ffe57e5
KAFKA-14595 Move case classes from PartitionReassignmentState to java
nizhikov Feb 14, 2023
e875075
KAFKA-14595 Move ReassignPartitionsCommandOptions to java
nizhikov Feb 15, 2023
ca8dc2a
KAFKA-14595 Move ReassignPartitionsCommandOptions to java
nizhikov Feb 15, 2023
634d185
KAFKA-14595 Move ReassignPartitionsCommandOptions to java
nizhikov Feb 15, 2023
28ae6bb
KAFKA-14595 Compilation fix
nizhikov Feb 15, 2023
857e499
Merge branch 'trunk' into KAFKA-14595
nizhikov Feb 28, 2023
cd4095d
KAFKA-14595 Move new classes to tools
nizhikov Feb 28, 2023
4ae392c
Merge branch 'trunk' into KAFKA-14595
nizhikov Jul 9, 2023
30be4ee
KAFKA-14595 Move new classes to tools
nizhikov Jul 9, 2023
d2bd8ac
KAFKA-14595 Move new classes to tools
nizhikov Jul 9, 2023
de2e660
KAFKA-14595 Move new classes to tools
nizhikov Jul 9, 2023
25bd213
Merge branch 'trunk' into KAFKA-14595
nizhikov Jul 22, 2023
fa4b0b0
KAFKA-14595 Code review fixes
nizhikov Jul 22, 2023
0ea3552
KAFKA-14595 Stubs for all methods in scala version of command
nizhikov Jul 24, 2023
4924947
KAFKA-14595 WIP
nizhikov Jul 24, 2023
86ec361
KAFKA-14595 WIP
nizhikov Jul 25, 2023
780d906
KAFKA-14595 checkstyle fixed
nizhikov Jul 25, 2023
22a1382
KAFKA-14595 scala BrokerMetadata removed
nizhikov Jul 25, 2023
804d08e
KAFKA-14595 scala BrokerMetadata removed
nizhikov Jul 25, 2023
948958f
KAFKA-14595 scala AdminUtils removed
nizhikov Jul 25, 2023
737aa69
KAFKA-14595 tests fix
nizhikov Jul 25, 2023
13f8125
KAFKA-14595 typo
nizhikov Jul 26, 2023
724c0d3
Merge branch 'trunk' into KAFKA-14595
nizhikov Jul 26, 2023
6be819c
Merge branch 'KAFKA-14595_AdminUtils_rewrite' into KAFKA-14595
nizhikov Jul 26, 2023
7c056c9
Merge branch 'trunk' into KAFKA-14595
nizhikov Jul 28, 2023
5c7dc12
KAFKA-14595 ReassignPartitionsCommandArgsTest, ReassignPartitionsUnit…
nizhikov Jul 30, 2023
fe06e63
KAFKA-14595 ReassignPartitionsCommandArgsTest, ReassignPartitionsUnit…
nizhikov Jul 31, 2023
93ca02a
Merge branch 'trunk' into KAFKA-14595
nizhikov Jul 31, 2023
a7ad316
KAFKA-14595 ReassignPartitionsCommandArgsTest, ReassignPartitionsUnit…
nizhikov Jul 31, 2023
26c76fc
KAFKA-14595 ReassignPartitionsIntegrationTest rewritten in java
nizhikov Aug 1, 2023
741e578
KAFKA-14595 ReassignPartitionsIntegrationTest rewritten in java
nizhikov Aug 1, 2023
568f662
KAFKA-14595 ReassignPartitionsIntegrationTest rewritten in java
nizhikov Aug 1, 2023
794b57c
KAFKA-14595 ReassignPartitionsIntegrationTest rewritten in java
nizhikov Aug 1, 2023
e567030
KAFKA-14595 ReassignPartitionsIntegrationTest rewritten in java
nizhikov Aug 1, 2023
ac1705a
KAFKA-14595 ReassignPartitionsIntegrationTest rewritten in java
nizhikov Aug 3, 2023
21cca4f
Merge branch 'trunk' into KAFKA-14595
nizhikov Aug 3, 2023
20bc620
Merge branch 'trunk' into KAFKA-14595
nizhikov Aug 9, 2023
30aa8d8
Merge branch 'trunk' into KAFKA-14595
nizhikov Aug 11, 2023
d80dc69
KAFKA-14595 Remove TerseReassignmentFailureException exception
nizhikov Aug 11, 2023
145dd4c
KAFKA-14595 Compilation fix
nizhikov Aug 11, 2023
4053c8a
Merge branch 'trunk' into KAFKA-14595
nizhikov Aug 15, 2023
996e30b
KAFKA-14595 Separate test move
nizhikov Aug 15, 2023
cf43956
Merge branch 'trunk' into KAFKA-14595
nizhikov Sep 7, 2023
dcb8b2b
KAFKA-14595 Merge trunk
nizhikov Sep 7, 2023
2d76eca
KAFKA-14595 Merge trunk
nizhikov Sep 7, 2023
62205b4
Merge branch 'trunk' into KAFKA-14595_tests
nizhikov Sep 7, 2023
3b6d212
KAFKA-14595 Improving test
nizhikov Sep 7, 2023
97fb3f4
KAFKA-14595 Improving test
nizhikov Sep 7, 2023
1372fcb
KAFKA-14595 Improving test
nizhikov Sep 7, 2023
928ba42
KAFKA-14595 Improving test
nizhikov Sep 7, 2023
1bbd0c3
KAFKA-14595 Improving test
nizhikov Sep 8, 2023
b3c20a8
KAFKA-14595 Improving test
nizhikov Sep 8, 2023
07e1204
KAFKA-14595 Improving test
nizhikov Sep 8, 2023
290133d
KAFKA-14595 Improving test
nizhikov Sep 8, 2023
97319a3
KAFKA-14595 Improving test
nizhikov Sep 8, 2023
c6d1275
KAFKA-14595 Improving test
nizhikov Sep 8, 2023
9877ef7
KAFKA-14595 Improving test
nizhikov Sep 8, 2023
cffd681
KAFKA-14595 Improving test
nizhikov Sep 8, 2023
79c4f6f
KAFKA-14595 Improving test
nizhikov Sep 8, 2023
840fa62
KAFKA-14595 Improving test
nizhikov Sep 8, 2023
fcfb95e
KAFKA-14595 Improving test
nizhikov Sep 9, 2023
d5a33fb
KAFKA-14595 Fix scala 2.12 errors
nizhikov Sep 9, 2023
6929eeb
Merge branch 'trunk' into KAFKA-14595
nizhikov Sep 11, 2023
7ce33f7
Merge branch 'trunk' into KAFKA-14595_tests
nizhikov Sep 18, 2023
420af78
KAFKA-14595 Code review fixes.
nizhikov Sep 18, 2023
7d22f15
KAFKA-14595 Code review fixes.
nizhikov Sep 18, 2023
bbd2f4c
KAFKA-14595 Code review fixes.
nizhikov Sep 18, 2023
b8e4c29
Merge branch 'trunk' into KAFKA-14595
nizhikov Sep 19, 2023
25eae9a
KAFKA-14595 Code review fixes.
nizhikov Sep 19, 2023
11dd1ae
Merge branch 'trunk' into KAFKA-14595
nizhikov Sep 19, 2023
17726a5
Merge branch 'trunk' into KAFKA-14595_tests
nizhikov Sep 22, 2023
8700c05
KAFKA-14595 Code review fixes.
nizhikov Sep 22, 2023
08e8795
Merge branch 'trunk' into KAFKA-14595
nizhikov Sep 22, 2023
5a40d88
Merge branch 'trunk' into KAFKA-14595_tests
nizhikov Sep 22, 2023
dfde62a
Merge branch 'KAFKA-14595_tests' into KAFKA-14595
nizhikov Sep 22, 2023
2dd787e
Merge branch 'KAFKA-14595_tests' into KAFKA-14595
nizhikov Sep 22, 2023
95e69a2
KAFKA-14595 Code review fixes.
nizhikov Sep 22, 2023
6d5e2ba
Merge branch 'trunk' into KAFKA-14595
nizhikov Sep 23, 2023
cfc8597
Merge branch 'trunk' into KAFKA-14595
nizhikov Sep 25, 2023
aa149f2
KAFKA-14595 Fix integration test
nizhikov Sep 26, 2023
208ac6a
Merge branch 'trunk' into KAFKA-14595
nizhikov Sep 26, 2023
68a0301
KAFKA-14595 Revert Integration test to QuorumTestHarness
nizhikov Sep 29, 2023
11fc0bb
Merge branch 'trunk' into KAFKA-14595
nizhikov Oct 2, 2023
7cf703c
KAFKA-14595 Fixes after trunk merge
nizhikov Oct 2, 2023
23d3d00
KAFKA-14595 Fixes after trunk merge
nizhikov Oct 2, 2023
d8e50ab
KAFKA-14595 Fixes after trunk merge
nizhikov Oct 2, 2023
7175901
KAFKA-14595 Fixes after trunk merge
nizhikov Oct 2, 2023
d9ca29f
Merge branch 'trunk' into KAFKA-14595
nizhikov Oct 3, 2023
be82fbc
KAFKA-14595 Code review fix
nizhikov Oct 4, 2023
c2e2356
KAFKA-14595 Code formatting.
nizhikov Oct 4, 2023
d4b30c1
KAFKA-14595 Code review fixes.
nizhikov Oct 4, 2023
70ddeeb
KAFKA-14595 Code review fixes.
nizhikov Oct 4, 2023
c90a6da
KAFKA-14595 Code review fixes.
nizhikov Oct 4, 2023
5282f60
KAFKA-14595 Code review fixes.
nizhikov Oct 4, 2023
6fe1aa0
KAFKA-14595 Code review fixes.
nizhikov Oct 5, 2023
f66fb6f
KAFKA-14595 Code review fixes.
nizhikov Oct 5, 2023
85c441d
KAFKA-14595 Code review fixes.
nizhikov Oct 5, 2023
f40b5a5
KAFKA-14595 Code review fixes.
nizhikov Oct 5, 2023
ceaf2bf
KAFKA-14595 set method removed.
nizhikov Oct 9, 2023
48363ef
Merge branch 'trunk' into KAFKA-14595
nizhikov Oct 17, 2023
b604480
KAFKA-14595 revert unnecessary change
nizhikov Oct 17, 2023
369e888
KAFKA-14595 Code review fixes.
nizhikov Oct 18, 2023
89eb550
KAFKA-14595 static import of asList
nizhikov Oct 18, 2023
f26a02e
KAFKA-15645 Remove set method
nizhikov Oct 19, 2023
24a69fb
Merge branch 'trunk' into KAFKA-14595
nizhikov Oct 20, 2023
53e767a
KAFKA-14595 Use Option.none instead of None$.empty
nizhikov Oct 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.kafka.tools.reassign;

import java.util.Objects;

/**
* A replica log directory move state where the move is in progress.
*/
public final class ActiveMoveState implements LogDirMoveState {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These classes are extremely verbose. I wonder if we could make the final fields public and get rid of all the setters.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

private final String currentLogDir;

private final String targetLogDir;

private final String futureLogDir;

/**
* @param currentLogDir The current log directory.
* @param futureLogDir The log directory that the replica is moving to.
* @param targetLogDir The log directory that we wanted the replica to move to.
*/
public ActiveMoveState(String currentLogDir, String targetLogDir, String futureLogDir) {
this.currentLogDir = currentLogDir;
this.targetLogDir = targetLogDir;
this.futureLogDir = futureLogDir;
}

public String currentLogDir() {
return currentLogDir;
}

public String targetLogDir() {
return targetLogDir;
}

public String futureLogDir() {
return futureLogDir;
}

@Override
public boolean done() {
return false;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ActiveMoveState that = (ActiveMoveState) o;
return Objects.equals(currentLogDir, that.currentLogDir) && Objects.equals(targetLogDir, that.targetLogDir) && Objects.equals(futureLogDir, that.futureLogDir);
}

@Override
public int hashCode() {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to override hashCode() and toString() for these classes?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scala case classes generated equals, hashCode, toString automatically.
So these methods exists in scala version.

Anyway, I removed them. We can implement them when we want.

return Objects.hash(currentLogDir, targetLogDir, futureLogDir);
}

@Override
public String toString() {
return "ActiveMoveState{" +
"currentLogDir='" + currentLogDir + '\'' +
", targetLogDir='" + targetLogDir + '\'' +
", futureLogDir='" + futureLogDir + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.kafka.tools.reassign;

import java.util.Objects;

/**
* A replica log directory move state where there is no move in progress, but we did not
* reach the target log directory.
*/
public final class CancelledMoveState implements LogDirMoveState {
private final String currentLogDir;

private final String targetLogDir;

/**
* @param currentLogDir The current log directory.
* @param targetLogDir The log directory that we wanted the replica to move to.
*/
public CancelledMoveState(String currentLogDir, String targetLogDir) {
this.currentLogDir = currentLogDir;
this.targetLogDir = targetLogDir;
}

public String currentLogDir() {
return currentLogDir;
}

public String targetLogDir() {
return targetLogDir;
}

@Override
public boolean done() {
return true;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CancelledMoveState that = (CancelledMoveState) o;
return Objects.equals(currentLogDir, that.currentLogDir) && Objects.equals(targetLogDir, that.targetLogDir);
}

@Override
public int hashCode() {
return Objects.hash(currentLogDir, targetLogDir);
}

@Override
public String toString() {
return "CancelledMoveState{" +
"currentLogDir='" + currentLogDir + '\'' +
", targetLogDir='" + targetLogDir + '\'' +
'}';
}
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're missing a new line here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.kafka.tools.reassign;

import java.util.Objects;

/**
* The completed replica log directory move state.
*/
public final class CompletedMoveState implements LogDirMoveState {
private final String targetLogDir;

/**
* @param targetLogDir The log directory that we wanted the replica to move to.
*/
public CompletedMoveState(String targetLogDir) {
this.targetLogDir = targetLogDir;
}

public String targetLogDir() {
return targetLogDir;
}

@Override
public boolean done() {
return true;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
CompletedMoveState that = (CompletedMoveState) o;
return Objects.equals(targetLogDir, that.targetLogDir);
}

@Override
public int hashCode() {
return Objects.hash(targetLogDir);
}

@Override
public String toString() {
return "CompletedMoveState{" +
"targetLogDir='" + targetLogDir + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.kafka.tools.reassign;

/**
* The state of a replica log directory movement.
*/
public interface LogDirMoveState {
/**
* True if the move is done without errors.
*/
boolean done();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.kafka.tools.reassign;

import java.util.Objects;

/**
* A replica log directory move state where the source replica is missing.
*/
public final class MissingLogDirMoveState implements LogDirMoveState {
private final String targetLogDir;

/**
* @param targetLogDir The log directory that we wanted the replica to move to.
*/
public MissingLogDirMoveState(String targetLogDir) {
this.targetLogDir = targetLogDir;
}

public String targetLogDir() {
return targetLogDir;
}

@Override
public boolean done() {
return false;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MissingLogDirMoveState that = (MissingLogDirMoveState) o;
return Objects.equals(targetLogDir, that.targetLogDir);
}

@Override
public int hashCode() {
return Objects.hash(targetLogDir);
}

@Override
public String toString() {
return "MissingLogDirMoveState{" +
"targetLogDir='" + targetLogDir + '\'' +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.apache.kafka.tools.reassign;

import java.util.Objects;

/**
* A replica log directory move state where the source log directory is missing.
*/
public final class MissingReplicaMoveState implements LogDirMoveState {
private final String targetLogDir;

/**
* @param targetLogDir The log directory that we wanted the replica to move to.
*/
public MissingReplicaMoveState(String targetLogDir) {
this.targetLogDir = targetLogDir;
}

public String targetLogDir() {
return targetLogDir;
}

@Override
public boolean done() {
return false;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MissingReplicaMoveState that = (MissingReplicaMoveState) o;
return Objects.equals(targetLogDir, that.targetLogDir);
}

@Override
public int hashCode() {
return Objects.hash(targetLogDir);
}

@Override
public String toString() {
return "MissingReplicaMoveState{" +
"targetLogDir='" + targetLogDir + '\'' +
'}';
}
}
Loading