-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3c18611
commit fd00915
Showing
65 changed files
with
2,155 additions
and
244 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
...a/de/umr/raft/raftlogreplicationdemo/models/clustermanagement/DetachPartitionRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package de.umr.raft.raftlogreplicationdemo.models.clustermanagement; | ||
|
||
import lombok.Getter; | ||
import lombok.NonNull; | ||
import lombok.RequiredArgsConstructor; | ||
import org.apache.ratis.statemachine.impl.BaseStateMachine; | ||
|
||
@RequiredArgsConstructor | ||
public class DetachPartitionRequest { | ||
@Getter @NonNull final String stateMachineClassName; | ||
@Getter @NonNull final String partitionName; | ||
|
||
public Class<? extends BaseStateMachine> getStateMachineClass() throws ClassNotFoundException { | ||
return Class.forName(stateMachineClassName).asSubclass(BaseStateMachine.class); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
...va/de/umr/raft/raftlogreplicationdemo/models/clustermanagement/PartitionInfoResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package de.umr.raft.raftlogreplicationdemo.models.clustermanagement; | ||
|
||
import de.umr.raft.raftlogreplicationdemo.replication.api.PartitionInfo; | ||
import lombok.Getter; | ||
import lombok.NonNull; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
|
||
@RequiredArgsConstructor | ||
public class PartitionInfoResponse { | ||
@Getter @NonNull final String partitionName; | ||
@Getter @NonNull final String raftGroupId; | ||
@Getter @NonNull final List<RaftPeerResponse> peers; | ||
@Getter @NonNull final String stateMachineClassname; | ||
@Getter @NonNull final PartitionInfo.PartitionState partitionState; | ||
|
||
public static PartitionInfoResponse of(PartitionInfo partitionInfo) { | ||
return new PartitionInfoResponse( | ||
partitionInfo.getPartitionName().getName(), | ||
partitionInfo.getRaftGroup().getGroupId().toString(), | ||
partitionInfo.getRaftGroup().getPeers().stream().map(raftPeer -> new RaftPeerResponse(raftPeer.getId().toString(), raftPeer.getAddress())).collect(Collectors.toList()), | ||
partitionInfo.getStateMachineClassname(), | ||
partitionInfo.getPartitionState()); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...in/java/de/umr/raft/raftlogreplicationdemo/models/clustermanagement/RaftPeerResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package de.umr.raft.raftlogreplicationdemo.models.clustermanagement; | ||
|
||
import lombok.Getter; | ||
import lombok.NonNull; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RequiredArgsConstructor | ||
public class RaftPeerResponse { | ||
@Getter @NonNull final String id; | ||
@Getter @NonNull final String address; | ||
} |
Oops, something went wrong.