Skip to content

Commit

Permalink
HDDS-11866. Remove code paths for non-Ratis OM (#7778)
Browse files Browse the repository at this point in the history
  • Loading branch information
adoroszlai authored Feb 6, 2025
1 parent d6bfea0 commit 334ad8c
Show file tree
Hide file tree
Showing 17 changed files with 136 additions and 391 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ public final class OmUtils {
public static final long EPOCH_ID_SHIFT = 62; // 64 - 2
public static final long REVERSE_EPOCH_ID_SHIFT = 2; // 64 - EPOCH_ID_SHIFT
public static final long MAX_TRXN_ID = (1L << 54) - 2;
public static final int EPOCH_WHEN_RATIS_NOT_ENABLED = 1;
public static final int EPOCH_WHEN_RATIS_ENABLED = 2;

private OmUtils() {
Expand Down Expand Up @@ -601,9 +600,8 @@ public static long getOMClientRpcTimeOut(ConfigurationSource configuration) {
return configuration.getObject(OMClientConfig.class).getRpcTimeOut();
}

public static int getOMEpoch(boolean isRatisEnabled) {
return isRatisEnabled ? EPOCH_WHEN_RATIS_ENABLED :
EPOCH_WHEN_RATIS_NOT_ENABLED;
public static int getOMEpoch() {
return EPOCH_WHEN_RATIS_ENABLED;
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,7 @@ public void testUnknownRequestHandling()

OzoneManagerProtocolServerSideTranslatorPB serverSideTranslatorPB =
new OzoneManagerProtocolServerSideTranslatorPB(ozoneManager,
ratisServer, protocolMessageMetrics, true,
100L);
ratisServer, protocolMessageMetrics);

OzoneManagerProtocolProtos.OMResponse actualResponse =
serverSideTranslatorPB.processRequest(omRequest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,6 @@ public class OmMetadataManagerImpl implements OMMetadataManager,
private Table snapshotRenamedTable;
private Table compactionLogTable;

private boolean isRatisEnabled;
private boolean ignorePipelineinKey;
private Table deletedDirTable;

Expand Down Expand Up @@ -351,8 +350,7 @@ public OmMetadataManagerImpl(OzoneConfiguration conf,
this.ozoneManager = ozoneManager;
this.perfMetrics = perfMetrics;
this.lock = new OzoneManagerLock(conf);
isRatisEnabled = true;
this.omEpoch = OmUtils.getOMEpoch(isRatisEnabled);
this.omEpoch = OmUtils.getOMEpoch();
// For test purpose only
ignorePipelineinKey = conf.getBoolean(
"ozone.om.ignore.pipeline", Boolean.TRUE);
Expand Down Expand Up @@ -567,11 +565,6 @@ public void start(OzoneConfiguration configuration) throws IOException {
// enabled, ratis log provides us this guaranty. This check is needed
// until HA code path becomes default in OM.

// When ratis is not enabled override and set the sync.
if (!isRatisEnabled) {
rocksDBConfiguration.setSyncOption(true);
}

int maxOpenFiles = configuration.getInt(OZONE_OM_DB_MAX_OPEN_FILES,
OZONE_OM_DB_MAX_OPEN_FILES_DEFAULT);

Expand Down
Loading

0 comments on commit 334ad8c

Please sign in to comment.