HBASE-1338 lost use of compaction.dir; we were compacting into live store subdirectory

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@767704 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-04-22 22:55:58 +00:00
parent 997ca2a89a
commit 9a5f753e95
3 changed files with 15 additions and 5 deletions

View File

@ -81,6 +81,8 @@ Release 0.20.0 - Unreleased
HBASE-1332 regionserver carrying .META. starts sucking all cpu, drives load
up - infinite loop? (Ryan Rawson via Stack)
HBASE-1334 .META. region running into hfile errors (Ryan Rawson via Stack)
HBASE-1338 lost use of compaction.dir; we were compacting into live store
subdirectory
IMPROVEMENTS
HBASE-1089 Add count of regions on filesystem to master UI; add percentage

View File

@ -39,7 +39,6 @@ import org.apache.hadoop.hbase.HServerInfo;
import org.apache.hadoop.hbase.RemoteExceptionHandler;
import org.apache.hadoop.hbase.UnknownScannerException;
import org.apache.hadoop.hbase.io.BatchUpdate;
import org.apache.hadoop.hbase.io.Cell;
import org.apache.hadoop.hbase.io.RowResult;
import org.apache.hadoop.hbase.ipc.HRegionInterface;
import org.apache.hadoop.hbase.regionserver.HLog;

View File

@ -511,7 +511,16 @@ public class Store implements HConstants {
* @throws IOException
*/
HFile.Writer getWriter() throws IOException {
return StoreFile.getWriter(this.fs, this.homedir, this.blocksize,
return getWriter(this.homedir);
}
/*
* @return Writer for this store.
* @param basedir Directory to put writer in.
* @throws IOException
*/
private HFile.Writer getWriter(final Path basedir) throws IOException {
return StoreFile.getWriter(this.fs, basedir, this.blocksize,
this.compression, this.comparator.getRawComparator(), this.bloomfilter);
}
@ -617,8 +626,8 @@ public class Store implements HConstants {
(forceSplit || (filesToCompact.size() < compactionThreshold))) {
return checkSplit(forceSplit);
}
if (!fs.exists(compactionDir) && !fs.mkdirs(compactionDir)) {
LOG.warn("Mkdir on " + compactionDir.toString() + " failed");
if (!fs.exists(this.compactionDir) && !fs.mkdirs(this.compactionDir)) {
LOG.warn("Mkdir on " + this.compactionDir.toString() + " failed");
return checkSplit(forceSplit);
}
@ -671,7 +680,7 @@ public class Store implements HConstants {
}
// Step through them, writing to the brand-new file
HFile.Writer writer = getWriter();
HFile.Writer writer = getWriter(this.compactionDir);
if (LOG.isDebugEnabled()) {
LOG.debug("Started compaction of " + filesToCompact.size() + " file(s)" +
(references? ", hasReferences=true,": " ") + " into " +