You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Sean Busbey (JIRA)" <ji...@apache.org> on 2016/10/27 21:47:58 UTC
[jira] [Commented] (HBASE-16957) Remove directory layout/
filesystem references from Cleaners and a few other modules in master
[ https://issues.apache.org/jira/browse/HBASE-16957?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15613334#comment-15613334 ]
Sean Busbey commented on HBASE-16957:
-------------------------------------
{code}
+ @Override
+ public Iterable<ScheduledChore> getChores(Stoppable stopper, Map<String, Object> params) {
+ ArrayList<ScheduledChore> chores = (ArrayList<ScheduledChore>) super.getChores(stopper, params);
+
+ int cleanerInterval = getConfiguration().getInt("hbase.master.cleaner.interval", 60 * 1000);
+ // add log cleaner chore
+ chores.add(new LogCleaner(cleanerInterval, stopper, getConfiguration(), getFileSystem(),
+ LegacyLayout.getOldLogDir(getRootContainer().path)));
+ // add hfile archive cleaner chore
+ chores.add(new HFileCleaner(cleanerInterval, stopper, getConfiguration(), getFileSystem(),
+ LegacyLayout.getArchiveDir(getRootContainer().path), params));
+
+ return chores;
+ }
+
+ @Override
+ public void enableSnapshots() {
+ super.enableSnapshots();
+ if (!isSnapshotsEnabled()) {
+ // Extract cleaners from conf
+ Set<String> hfileCleaners = new HashSet<>();
+ String[] cleaners = getConfiguration().getStrings(HFileCleaner.MASTER_HFILE_CLEANER_PLUGINS);
+ if (cleaners != null) Collections.addAll(hfileCleaners, cleaners);
+
+ // add snapshot related cleaners
+ hfileCleaners.add(SnapshotHFileCleaner.class.getName());
+ hfileCleaners.add(HFileLinkCleaner.class.getName());
+
+ // Set cleaners conf
+ getConfiguration().setStrings(HFileCleaner.MASTER_HFILE_CLEANER_PLUGINS,
+ hfileCleaners.toArray(new String[hfileCleaners.size()]));
+ }
+ }
{code}
Looks like the interface for MasterStorage should specify that {{enableSnapshots()}} will be called before {{getChores}}, just to make sure we keep doing this correctly in the future.
> Remove directory layout/ filesystem references from Cleaners and a few other modules in master
> ----------------------------------------------------------------------------------------------
>
> Key: HBASE-16957
> URL: https://issues.apache.org/jira/browse/HBASE-16957
> Project: HBase
> Issue Type: Sub-task
> Components: Filesystem Integration, master
> Reporter: Umesh Agashe
> Assignee: Umesh Agashe
> Attachments: HBASE-16957-hbase-14439.v1.patch
>
>
> Remove directory layout/ filesystem references from Cleaners and a few other modules in master
> {code}
> hbase-server/src/main/java/org/apache/hadoop/hbase/master/AssignmentManager.java
> hbase-server/src/main/java/org/apache/hadoop/hbase/master/MasterStatusServlet.java
> hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/CleanerChore.java
> hbase-server/src/main/java/org/apache/hadoop/hbase/master/cleaner/HFileLinkCleaner.java
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)