Skip to content

Commit

Permalink
fix setrep bug
Browse files Browse the repository at this point in the history
  • Loading branch information
xiezhineng committed Dec 6, 2022
1 parent 761aaa3 commit f640886
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -411,9 +411,8 @@ public boolean setReplication(String src, short replication)
RemoteMethod method = new RemoteMethod("setReplication",
new Class<?>[] {String.class, short.class}, new RemoteParam(),
replication);
if (rpcServer.isInvokeConcurrent(src)) {
return !rpcClient.invokeConcurrent(locations, method, Boolean.class)
.containsValue(false);
if (rpcServer.isPathAll(src)) {
return rpcClient.invokeAll(locations, method);
} else {
return rpcClient.invokeSequential(locations, method, Boolean.class,
Boolean.TRUE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,11 @@ private void testAll(final String path) throws Exception {
assertEquals("Truncate file fails", 10,
routerFs.getFileStatus(testTruncateFilePath).getLen());

// Test setReplication
assertTrue(routerFs.setReplication(testTruncateFilePath,(short) 2));
assertEquals("SetReplication file fails", 2,
routerFs.getFileStatus(testTruncateFilePath).getReplication());

// Removing a directory should remove it from every subcluster
routerFs.delete(new Path(path + "/dir2/dir22/dir220"), true);
assertDirsEverywhere(path, 8);
Expand Down

0 comments on commit f640886

Please sign in to comment.