Skip to content

Commit

Permalink
HDDS-10342. Reduce code duplication in MiniOzoneCluster builders (apa…
Browse files Browse the repository at this point in the history
  • Loading branch information
adoroszlai authored Feb 20, 2024
1 parent c672453 commit 932a0ac
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 188 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -313,8 +313,7 @@ public MiniOzoneChaosCluster build() throws IOException {
throw new IOException("Unable to build MiniOzoneCluster. ", ex);
}

final List<HddsDatanodeService> hddsDatanodes = createHddsDatanodes(
scmService.getActiveServices(), null);
final List<HddsDatanodeService> hddsDatanodes = createHddsDatanodes();

MiniOzoneChaosCluster cluster =
new MiniOzoneChaosCluster(conf, omService, scmService, hddsDatanodes,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ static Builder newHABuilder(OzoneConfiguration conf) {
void waitForClusterToBeReady() throws TimeoutException, InterruptedException;

/**
* Waits for atleast one RATIS pipeline of given factor to be reported in open
* Waits for at least one RATIS pipeline of given factor to be reported in open
* state.
*
* @param factor replication factor
Expand Down Expand Up @@ -121,21 +121,6 @@ void waitForPipelineTobeReady(HddsProtos.ReplicationFactor factor,
*/
void waitTobeOutOfSafeMode() throws TimeoutException, InterruptedException;

/**
* Returns OzoneManager Service ID.
*
* @return Service ID String
*/
String getOMServiceId();


/**
* Returns StorageContainerManager Service ID.
*
* @return Service ID String
*/
String getSCMServiceId();

/**
* Returns {@link StorageContainerManager} associated with this
* {@link MiniOzoneCluster} instance.
Expand Down Expand Up @@ -180,29 +165,19 @@ void waitForPipelineTobeReady(HddsProtos.ReplicationFactor factor,
/**
* Returns StorageContainerLocationClient to communicate with
* {@link StorageContainerManager} associated with the MiniOzoneCluster.
*
* @return StorageContainerLocation Client
* @throws IOException
*/
StorageContainerLocationProtocolClientSideTranslatorPB
getStorageContainerLocationClient() throws IOException;

/**
* Restarts StorageContainerManager instance.
*
* @param waitForDatanode
* @throws IOException
* @throws TimeoutException
* @throws InterruptedException
*/
void restartStorageContainerManager(boolean waitForDatanode)
throws InterruptedException, TimeoutException, IOException,
AuthenticationException;

/**
* Restarts OzoneManager instance.
*
* @throws IOException
*/
void restartOzoneManager() throws IOException;

Expand Down Expand Up @@ -266,11 +241,6 @@ default void close() {
*/
void stop();

/**
* Start Scm.
*/
void startScm() throws IOException;

/**
* Start DataNodes.
*/
Expand Down Expand Up @@ -373,13 +343,6 @@ public Builder setStartDataNodes(boolean nodes) {
return this;
}

/**
* Sets the certificate client.
*
* @param client
*
* @return MiniOzoneCluster.Builder
*/
public Builder setCertificateClient(CertificateClient client) {
this.certClient = client;
return this;
Expand Down Expand Up @@ -477,8 +440,6 @@ public Builder setDnLayoutVersion(int layoutVersion) {
* Constructs and returns MiniOzoneCluster.
*
* @return {@link MiniOzoneCluster}
*
* @throws IOException
*/
public abstract MiniOzoneCluster build() throws IOException;
}
Expand Down
Loading

0 comments on commit 932a0ac

Please sign in to comment.