You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/01/25 13:03:09 UTC
[GitHub] [ozone] fapifta commented on a change in pull request #3008: HDDS-6131: EC: Replication config from bucket should be refreshed in o3fs
fapifta commented on a change in pull request #3008:
URL: https://github.com/apache/ozone/pull/3008#discussion_r791688640
##########
File path: hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java
##########
@@ -211,29 +239,20 @@ public OzoneFSOutputStream createFile(String key, short replication,
boolean overWrite, boolean recursive) throws IOException {
incrementCounter(Statistic.OBJECTS_CREATED, 1);
try {
- OzoneOutputStream ozoneOutputStream = null;
- ReplicationConfig replConfig = this.replicationConfig;
- // Since the bucket has the right default replication, we are using it.
- if (bucket.getReplicationConfig() != null) {
- replConfig = bucket.getReplicationConfig();
- }
- if (replication == ReplicationFactor.ONE.getValue()
- || replication == ReplicationFactor.THREE.getValue()) {
-
- ReplicationConfig customReplicationConfig =
- ReplicationConfig.adjustReplication(
- replConfig, replication, config);
- ozoneOutputStream =
- bucket.createFile(key, 0, customReplicationConfig, overWrite,
- recursive);
- } else {
- ozoneOutputStream =
- bucket.createFile(key, 0, replConfig, overWrite, recursive);
- }
+ ReplicationConfig clientConfiguredReplConfig =
+ this.clientConfiguredReplicationConfig;
+ ReplicationConfig bucketReplConfig =
+ getReplicationConfigWithRefreshCheck();
+
+ OzoneOutputStream ozoneOutputStream = bucket.createFile(key, 0,
+ OzoneClientUtils.resolveClientSideReplicationConfig(replication,
+ clientConfiguredReplConfig, bucketReplConfig, config), overWrite,
+ recursive);
+
return new OzoneFSOutputStream(ozoneOutputStream.getOutputStream());
} catch (OMException ex) {
- if (ex.getResult() == OMException.ResultCodes.FILE_ALREADY_EXISTS
- || ex.getResult() == OMException.ResultCodes.NOT_A_FILE) {
+ if (ex.getResult() == OMException.ResultCodes.FILE_ALREADY_EXISTS || ex
Review comment:
This seems to be an accidental reformat, can we revert this please?
##########
File path: hadoop-ozone/ozonefs-common/src/main/java/org/apache/hadoop/fs/ozone/BasicOzoneClientAdapterImpl.java
##########
@@ -407,6 +437,11 @@ public String getCanonicalServiceName() {
return objectStore.getCanonicalServiceName();
}
+ @VisibleForTesting
+ public void setClock(Clock monotonicClock) {
Review comment:
I think we can reduce the visibility to default, as tests that should tinker with the clock can be - and for now they are - in the same package. What do you think?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org