You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Fengdong Yu (JIRA)" <ji...@apache.org> on 2013/06/26 09:06:20 UTC
[jira] [Resolved] (HDFS-4939) Retain old edits log, don't retain
all minimum required logs
[ https://issues.apache.org/jira/browse/HDFS-4939?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Fengdong Yu resolved HDFS-4939.
-------------------------------
Resolution: Won't Fix
> Retain old edits log, don't retain all minimum required logs
> ------------------------------------------------------------
>
> Key: HDFS-4939
> URL: https://issues.apache.org/jira/browse/HDFS-4939
> Project: Hadoop HDFS
> Issue Type: Bug
> Components: ha, namenode
> Reporter: Fengdong Yu
> Assignee: Fengdong Yu
> Priority: Minor
>
> JNStorage.java
> {code}
> private static void purgeMatching(File dir, List<Pattern> patterns,
> long minTxIdToKeep) throws IOException {
> for (File f : FileUtil.listFiles(dir)) {
> if (!f.isFile()) continue;
> for (Pattern p : patterns) {
> Matcher matcher = p.matcher(f.getName());
> if (matcher.matches()) {
> // This parsing will always succeed since the group(1) is
> // /\d+/ in the regex itself.
> long txid = Long.valueOf(matcher.group(1));
> if (txid < minTxIdToKeep) {
> LOG.info("Purging no-longer needed file " + txid);
> if (!f.delete()) {
> LOG.warn("Unable to delete no-longer-needed data " +
> f);
> }
> break;
> }
> }
> }
> }
> }
> {code}
> Why break the for loop here? if so, only delete one file for each retain, am I right?
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira