in src/main/java/com/netflix/bdp/s3mper/listing/ConsistentListingAspect.java [479:505]
public Object metastoreRename(final ProceedingJoinPoint pjp) throws Throwable {
if(disabled) {
return pjp.proceed();
}
Configuration conf = ((FileSystem) pjp.getTarget()).getConf();
updateConfig(conf);
FileSystem fs = (FileSystem) pjp.getTarget();
Path srcPath = (Path) pjp.getArgs()[0];
Path dstPath = (Path) pjp.getArgs()[1];
Preconditions.checkNotNull(srcPath);
Preconditions.checkNotNull(dstPath);
RenameInfo renameInfo = new RenameInfo(fs, srcPath, dstPath);
metadataRename(conf, fs, renameInfo);
Object obj = pjp.proceed();
if ((Boolean) obj) {
// Everything went fine delete the old metadata.
// If not then we'll keep the metadata to prevent incomplete listings.
// Manual cleanup will be required in the case of failure.
metadataCleanup(conf, fs, renameInfo);
}
return obj;
}