Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -84,4 +84,11 @@ public interface SCMMXBean extends ServiceRuntimeInfo {
String getRatisLogDirectory();

String getRocksDbDirectory();

/**
* Gets the SCM hostname.
*
* @return the SCM hostname for the datanode.
*/
String getHostname();
}
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ public final class StorageContainerManager extends ServiceRuntimeInfoImpl
private Clock systemClock;
private DNSToSwitchMapping dnsToSwitchMapping;

private String scmHostName;

/**
* Creates a new StorageContainerManager. Configuration will be
* updated with information on the actual listening addresses used
Expand Down Expand Up @@ -456,6 +458,7 @@ private StorageContainerManager(OzoneConfiguration conf,

// Emit initial safe mode status, as now handlers are registered.
scmSafeModeManager.emitSafeModeStatus();
scmHostName = HddsUtils.getHostName(conf);

registerMXBean();
registerMetricsSource(this);
Expand Down Expand Up @@ -2222,6 +2225,11 @@ public String getRocksDbDirectory() {
return String.valueOf(ServerUtils.getScmDbDir(configuration));
}

@Override
public String getHostname() {
return scmHostName;
}

public Collection<String> getScmAdminUsernames() {
return scmAdmins.getAdminUsernames();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ public interface OMMXBean extends ServiceRuntimeInfo {

String getRocksDbDirectory();

/**
* Gets the OM hostname.
*
* @return the OM hostname for the datanode.
*/
String getHostname();
}
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,8 @@ public final class OzoneManager extends ServiceRuntimeInfoImpl

private boolean fsSnapshotEnabled;

private String omHostName;

/**
* OM Startup mode.
*/
Expand Down Expand Up @@ -733,6 +735,7 @@ private OzoneManager(OzoneConfiguration conf, StartupOption startupOption)
}

bucketUtilizationMetrics = BucketUtilizationMetrics.create(metadataManager);
omHostName = HddsUtils.getHostName(conf);
}

public boolean isStopped() {
Expand Down Expand Up @@ -3136,6 +3139,11 @@ public String getRocksDbDirectory() {
return String.valueOf(OMStorage.getOmDbDir(configuration));
}

@Override
public String getHostname() {
return omHostName;
}

@VisibleForTesting
public OzoneManagerHttpServer getHttpServer() {
return httpServer;
Expand Down