Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@
import org.apache.hadoop.hbase.backup.HFileArchiver;
import org.apache.hadoop.hbase.client.Admin;
import org.apache.hadoop.hbase.client.ColumnFamilyDescriptor;
import org.apache.hadoop.hbase.client.Connection;
import org.apache.hadoop.hbase.client.ConnectionFactory;
import org.apache.hadoop.hbase.client.TableDescriptor;
import org.apache.hadoop.hbase.io.hfile.CacheConfig;
import org.apache.hadoop.hbase.master.HMaster;
Expand Down Expand Up @@ -94,10 +92,6 @@ private void checkObsoleteConfigurations() {
}
}

public MobFileCleanerChore() {
Comment thread
bbeaudreault marked this conversation as resolved.
this.master = null;
}

@Override
protected void chore() {
TableDescriptors htds = master.getTableDescriptors();
Expand Down Expand Up @@ -148,8 +142,7 @@ public void cleanupObsoleteMobFiles(Configuration conf, TableName table) throws
// So, if MOB file creation time is greater than this maxTimeToArchive,
// this will be skipped and won't be archived.
long maxCreationTimeToArchive = EnvironmentEdgeManager.currentTime() - minAgeToArchive;
try (final Connection conn = ConnectionFactory.createConnection(conf);
final Admin admin = conn.getAdmin();) {
try (final Admin admin = master.getConnection().getAdmin()) {
TableDescriptor htd = admin.getDescriptor(table);
List<ColumnFamilyDescriptor> list = MobUtils.getMobColumnFamilies(htd);
if (list.size() == 0) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public void setUp() throws Exception {

HTU.startMiniCluster();
admin = HTU.getAdmin();
chore = new MobFileCleanerChore();
chore = new MobFileCleanerChore(HTU.getMiniHBaseCluster().getMaster());
familyDescriptor = ColumnFamilyDescriptorBuilder.newBuilder(fam).setMobEnabled(true)
.setMobThreshold(mobLen).setMaxVersions(1).build();
tableDescriptor = HTU.createModifyableTableDescriptor("testMobCompactTable")
Expand Down