HBASE-5693 When creating a region, the master initializes it and creates a memstore within the master server

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1308535 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2012-04-02 20:30:27 +00:00
parent 6135aa2d5a
commit fe2f84dbb1
2 changed files with 15 additions and 3 deletions

View File

@ -150,7 +150,7 @@ public class CreateTableHandler extends EventHandler {
// 1. Create HRegion // 1. Create HRegion
HRegion region = HRegion.createHRegion(newRegion, HRegion region = HRegion.createHRegion(newRegion,
this.fileSystemManager.getRootDir(), this.conf, this.fileSystemManager.getRootDir(), this.conf,
this.hTableDescriptor, hlog); this.hTableDescriptor, hlog, false);
if (hlog == null) { if (hlog == null) {
hlog = region.getLog(); hlog = region.getLog();
} }

View File

@ -3596,6 +3596,7 @@ public class HRegion implements HeapSize { // , Writable{
* @param conf * @param conf
* @param hTableDescriptor * @param hTableDescriptor
* @param hlog shared HLog * @param hlog shared HLog
* @param boolean initialize - true to initialize the region
* @return new HRegion * @return new HRegion
* *
* @throws IOException * @throws IOException
@ -3603,7 +3604,8 @@ public class HRegion implements HeapSize { // , Writable{
public static HRegion createHRegion(final HRegionInfo info, final Path rootDir, public static HRegion createHRegion(final HRegionInfo info, final Path rootDir,
final Configuration conf, final Configuration conf,
final HTableDescriptor hTableDescriptor, final HTableDescriptor hTableDescriptor,
final HLog hlog) final HLog hlog,
final boolean initialize)
throws IOException { throws IOException {
LOG.info("creating HRegion " + info.getTableNameAsString() LOG.info("creating HRegion " + info.getTableNameAsString()
+ " HTD == " + hTableDescriptor + " RootDir = " + rootDir + + " HTD == " + hTableDescriptor + " RootDir = " + rootDir +
@ -3621,10 +3623,20 @@ public class HRegion implements HeapSize { // , Writable{
} }
HRegion region = HRegion.newHRegion(tableDir, HRegion region = HRegion.newHRegion(tableDir,
effectiveHLog, fs, conf, info, hTableDescriptor, null); effectiveHLog, fs, conf, info, hTableDescriptor, null);
region.initialize(); if (initialize) {
region.initialize();
}
return region; return region;
} }
public static HRegion createHRegion(final HRegionInfo info, final Path rootDir,
final Configuration conf,
final HTableDescriptor hTableDescriptor,
final HLog hlog)
throws IOException {
return createHRegion(info, rootDir, conf, hTableDescriptor, hlog, true);
}
/** /**
* Open a Region. * Open a Region.
* @param info Info for region to be opened. * @param info Info for region to be opened.