mirror of
https://github.com/apache/nifi.git
synced 2025-03-03 16:09:19 +00:00
NIFI-9436 - In AbstractPutHDFSRecord make sure the record writers use the FileSystem object the processor already has.
Signed-off-by: Matthew Burgess <mattyb149@apache.org> This closes #5565
This commit is contained in:
parent
2b415de912
commit
ff864266f5
@ -279,8 +279,18 @@ public abstract class AbstractPutHDFSRecord extends AbstractHadoopProcessor {
|
|||||||
createDirectory(fileSystem, directoryPath, remoteOwner, remoteGroup);
|
createDirectory(fileSystem, directoryPath, remoteOwner, remoteGroup);
|
||||||
|
|
||||||
// write to tempFile first and on success rename to destFile
|
// write to tempFile first and on success rename to destFile
|
||||||
final Path tempFile = new Path(directoryPath, "." + filenameValue);
|
final Path tempFile = new Path(directoryPath, "." + filenameValue) {
|
||||||
final Path destFile = new Path(directoryPath, filenameValue);
|
@Override
|
||||||
|
public FileSystem getFileSystem(Configuration conf) throws IOException {
|
||||||
|
return fileSystem;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
final Path destFile = new Path(directoryPath, filenameValue) {
|
||||||
|
@Override
|
||||||
|
public FileSystem getFileSystem(Configuration conf) throws IOException {
|
||||||
|
return fileSystem;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
final boolean destinationOrTempExists = fileSystem.exists(destFile) || fileSystem.exists(tempFile);
|
final boolean destinationOrTempExists = fileSystem.exists(destFile) || fileSystem.exists(tempFile);
|
||||||
final boolean shouldOverwrite = context.getProperty(OVERWRITE).asBoolean();
|
final boolean shouldOverwrite = context.getProperty(OVERWRITE).asBoolean();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user