HBASE-1112 we will lose data if the table name happens to be the logs' dir name

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@770006 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2009-04-29 23:44:47 +00:00
parent b6ccf3081a
commit f241c6cc28
3 changed files with 7 additions and 4 deletions

View File

@ -180,6 +180,8 @@ Release 0.20.0 - Unreleased
regions in a table (Vimal Mathew via Stack)
HBASE-1271 Allow multiple tests to run on one machine
(Evgeny Ryabitskiy via Stack)
HBASE-1112 we will lose data if the table name happens to be the logs' dir
name (Samuel Guo via Stack)
Release 0.19.0 - 01/21/2009
INCOMPATIBLE CHANGES

View File

@ -117,8 +117,9 @@ public interface HConstants {
/** Parameter name for HBase instance root directory */
static final String HBASE_DIR = "hbase.rootdir";
/** Used to construct the name of the log directory for a region server */
static final String HREGION_LOGDIR_NAME = "log";
/** Used to construct the name of the log directory for a region server
* Use '@' as a special character to seperate the log files from table data */
static final String HREGION_LOGDIR_NAME = "@LOGS@";
/** Name of old log file for reconstruction */
static final String HREGION_OLDLOGFILE_NAME = "oldlogfile.log";
@ -284,4 +285,4 @@ public interface HConstants {
public static final int MODIFY_TABLE_FLUSH = MODIFY_CLOSE_REGION + 1;
public static final int MODIFY_TABLE_MAJOR_COMPACT = MODIFY_TABLE_FLUSH + 1;
}
}

View File

@ -870,7 +870,7 @@ public class HLog implements HConstants, Syncable {
*/
public static String getHLogDirectoryName(String serverName) {
StringBuilder dirName = new StringBuilder(HConstants.HREGION_LOGDIR_NAME);
dirName.append("_");
dirName.append("/");
dirName.append(serverName);
return dirName.toString();
}