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 @@ -1432,7 +1432,7 @@ public OzoneDataStreamOutput createStreamKey(
if (checkKeyNameEnabled) {
HddsClientUtils.verifyKeyName(keyName);
}
HddsClientUtils.checkNotNull(keyName, replicationConfig);
HddsClientUtils.checkNotNull(keyName);

OmKeyArgs.Builder builder = new OmKeyArgs.Builder()
.setVolumeName(volumeName)
Expand Down Expand Up @@ -1819,7 +1819,7 @@ public OmMultipartInfo initiateMultipartUpload(String volumeName,
HddsClientUtils.checkNotNull(keyName);
if (omVersion
.compareTo(OzoneManagerVersion.ERASURE_CODED_STORAGE_SUPPORT) < 0) {
if (replicationConfig.getReplicationType()
if (replicationConfig != null && replicationConfig.getReplicationType()
== HddsProtos.ReplicationType.EC) {
throw new IOException("Can not set the replication of the file to"
+ " Erasure Coded replication, as OzoneManager does not support"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -772,7 +772,8 @@ public Response initializeMultipartUpload(
private ReplicationConfig getReplicationConfig(OzoneBucket ozoneBucket,
String storageType) throws OS3Exception {
if (StringUtils.isEmpty(storageType)) {
storageType = S3StorageType.getDefault(ozoneConfiguration).toString();
S3StorageType defaultStorageType = S3StorageType.getDefault(ozoneConfiguration);
storageType = (defaultStorageType != null ? defaultStorageType.toString() : null);
}

ReplicationConfig clientConfiguredReplicationConfig = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ public ReplicationType getType() {
public static S3StorageType getDefault(ConfigurationSource config) {
String replicationString = config.get(OzoneConfigKeys.OZONE_REPLICATION);
ReplicationFactor configFactor;
if (replicationString == null) {
// if no config is set then let server take decision
return null;
}
try {
configFactor = ReplicationFactor.valueOf(
Integer.parseInt(replicationString));
Expand Down