|
@@ -3184,7 +3184,10 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
assert hasWriteLock();
|
|
|
|
|
|
FileUnderConstructionFeature uc = pendingFile.getFileUnderConstructionFeature();
|
|
|
- Preconditions.checkArgument(uc != null);
|
|
|
+ if (uc == null) {
|
|
|
+ throw new IOException("Cannot finalize file " + src
|
|
|
+ + " because it is not under construction");
|
|
|
+ }
|
|
|
leaseManager.removeLease(uc.getClientName(), pendingFile);
|
|
|
|
|
|
pendingFile.recordModification(latestSnapshot);
|