我有以下代码,我试图在文件轮换完成后将文件移动到其他位置。 MOVEFILEACTION没有发生(也没有错误)。不知道我在这里遗失了什么。
SyncPolicy syncPolicy = new CountSyncPolicy(100);
// Rotate data files when they reach five MB
FileRotationPolicy rotationPolicy = new FileSizeRotationPolicy(0.05f, Units.MB);
MoveFileAction moveFileAction = new MoveFileAction().toDestination(rootPath + "/test");
FileNameFormat fileNameFormat = new DefaultFileNameFormat()
.withPath(rootPath + "/staging")
.withPrefix(prefix);
// Instantiate the HdfsBolt
HdfsBolt hdfsBolt = new HdfsBolt()
.withFsUrl(fsUrl)
.withFileNameFormat(fileNameFormat)
.withRecordFormat(format)
.withRotationPolicy(rotationPolicy)
.withSyncPolicy(syncPolicy)
.addRotationAction(moveFileAction);