Skip to content

Commit 8a72483

Browse files
authored
allow setting table.file.ec.policy to '' (#5945)
1 parent b5237ac commit 8a72483

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

server/base/src/main/java/org/apache/accumulo/server/util/PropUtil.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ protected static void validateProperties(final ServerContext context,
7878
}
7979
}
8080

81-
if (prop.getKey().equals(Property.TABLE_ERASURE_CODE_POLICY.getKey())) {
81+
if (prop.getKey().equals(Property.TABLE_ERASURE_CODE_POLICY.getKey())
82+
&& !prop.getValue().isEmpty()) {
8283
var volumes = context.getVolumeManager().getVolumes();
8384
for (var volume : volumes) {
8485
if (volume.getFileSystem() instanceof DistributedFileSystem) {

test/src/main/java/org/apache/accumulo/test/compaction/ErasureCodeIT.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,11 @@ public void test() throws Exception {
277277
c.tableOperations().setProperty(table1, Property.TABLE_ERASURE_CODE_POLICY.getKey(), policy2);
278278
assertEquals(policy2, c.tableOperations().getConfiguration(table1)
279279
.get(Property.TABLE_ERASURE_CODE_POLICY.getKey()));
280+
// should be able to set it to the default value
281+
c.tableOperations().setProperty(table1, Property.TABLE_ERASURE_CODE_POLICY.getKey(),
282+
Property.TABLE_ERASURE_CODE_POLICY.getDefaultValue());
283+
assertEquals(Property.TABLE_ERASURE_CODE_POLICY.getDefaultValue(), c.tableOperations()
284+
.getConfiguration(table1).get(Property.TABLE_ERASURE_CODE_POLICY.getKey()));
280285
}
281286
}
282287
}

0 commit comments

Comments
 (0)