-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add log info in case of no file found by path_prefix #53
base: master
Are you sure you want to change the base?
Add log info in case of no file found by path_prefix #53
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks basically good, but one style comment.
But please allow me to release it later as I'm out of office until Dec 17.
@@ -23,6 +25,7 @@ public class GcsFileInputPlugin | |||
.addDefaultModules().build(); | |||
public static final ConfigMapper CONFIG_MAPPER = CONFIG_MAPPER_FACTORY.createConfigMapper(); | |||
public static final TaskMapper TASK_MAPPER = CONFIG_MAPPER_FACTORY.createTaskMapper(); | |||
private static final Logger LOG = LoggerFactory.getLogger(GcsFileInputPlugin.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please use logger
instead of LOG
?
@dmikurube Do we have any other improvement to get the PR approval? Please let us know if you have anything. |
@@ -23,6 +25,7 @@ public class GcsFileInputPlugin | |||
.addDefaultModules().build(); | |||
public static final ConfigMapper CONFIG_MAPPER = CONFIG_MAPPER_FACTORY.createConfigMapper(); | |||
public static final TaskMapper TASK_MAPPER = CONFIG_MAPPER_FACTORY.createTaskMapper(); | |||
private Logger logger = LoggerFactory.getLogger(GcsFileInputPlugin.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We usually have the logger instance as a class variable.
private Logger logger = LoggerFactory.getLogger(GcsFileInputPlugin.class); | |
private static final Logger logger = LoggerFactory.getLogger(GcsFileInputPlugin.class); |
@@ -62,6 +65,9 @@ else if (AuthUtils.AuthMethod.private_key.equals(task.getAuthMethod())) { | |||
// list files recursively if path_prefix is specified | |||
if (task.getPathPrefix().isPresent()) { | |||
task.setFiles(GcsFileInput.listFiles(task)); | |||
if (task.getFiles().getTaskCount() == 0) { | |||
logger.info("No file is found. Confirm path_prefix option is correct"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIUC, this can happen even if path_prefix
is "correct". Just "No file is found there" should be sufficient as a log message.
logger.info("No file is found. Confirm path_prefix option is correct"); | |
logger.info("No file is found in the path(s) identified by path_prefix"); |
Show info in case no file is found by path_prefix