Skip to content

Commit

Permalink
Retagging first 0.90.3 RC, RC0
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.apache.org/repos/asf/hbase/tags/0.90.3RC0@1100612 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
saintstack committed May 7, 2011
2 parents a2c7e4d + 396b9a1 commit 5b6c45c
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ Release 0.90.3 - Unreleased
HBASE-3821 "NOT flushing memstore for region" keep on printing for half
an hour (zhoushuaifeng)
HBASE-3848 request is always zero in WebUI for region server (gaojinchao)
HBASE-3861 MiniZooKeeperCluster should refer to maxClientCnxns (Eugene
Koontz via Andrew Purtell)

IMPROVEMENT
HBASE-3717 deprecate HTable isTableEnabled() methods in favor of HBaseAdmin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileUtil;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.zookeeper.server.NIOServerCnxn;
import org.apache.zookeeper.server.ZooKeeperServer;
import org.apache.zookeeper.server.persistence.FileTxnLog;
Expand All @@ -53,9 +55,17 @@ public class MiniZooKeeperCluster {
private NIOServerCnxn.Factory standaloneServerFactory;
private int tickTime = 0;

private Configuration configuration;

/** Create mini ZooKeeper cluster. */
public MiniZooKeeperCluster() {
this(HBaseConfiguration.create());
}

/** Create mini ZooKeeper cluster with configuration (usually from test environment) */
public MiniZooKeeperCluster(Configuration configuration) {
this.started = false;
this.configuration = configuration;
}

public void setClientPort(int clientPort) {
Expand Down Expand Up @@ -105,8 +115,9 @@ public int startup(File baseDir) throws IOException,
ZooKeeperServer server = new ZooKeeperServer(dir, dir, tickTimeToUse);
while (true) {
try {
int numberOfConnections = this.configuration.getInt("hbase.zookeeper.property.maxClientCnxns",5000);
standaloneServerFactory =
new NIOServerCnxn.Factory(new InetSocketAddress(clientPort));
new NIOServerCnxn.Factory(new InetSocketAddress(clientPort), numberOfConnections);
} catch (BindException e) {
LOG.info("Failed binding ZK Server to client port: " + clientPort);
//this port is already in use. try to use another
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ private MiniZooKeeperCluster startMiniZKCluster(final File dir)
if (this.zkCluster != null) {
throw new IOException("Cluster already running at " + dir);
}
this.zkCluster = new MiniZooKeeperCluster();
this.zkCluster = new MiniZooKeeperCluster(this.getConfiguration());
int clientPort = this.zkCluster.startup(dir);
this.conf.set("hbase.zookeeper.property.clientPort",
Integer.toString(clientPort));
Expand Down
20 changes: 17 additions & 3 deletions src/test/java/org/apache/hadoop/hbase/client/TestAdmin.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@
import org.apache.hadoop.hbase.TableNotDisabledException;
import org.apache.hadoop.hbase.TableNotFoundException;
import org.apache.hadoop.hbase.executor.EventHandler;
import org.apache.hadoop.hbase.executor.EventHandler.EventType;
import org.apache.hadoop.hbase.executor.ExecutorService;
import org.apache.hadoop.hbase.executor.EventHandler.EventType;
import org.apache.hadoop.hbase.master.AssignmentManager;
import org.apache.hadoop.hbase.master.MasterServices;
import org.apache.hadoop.hbase.util.Bytes;
import org.junit.AfterClass;
Expand Down Expand Up @@ -301,8 +302,21 @@ public void beforeProcess(EventHandler event) {
}

protected void verifyRoundRobinDistribution(HTable ht, int expectedRegions) throws IOException {
int numRS = ht.getCurrentNrHRS();
MasterServices services = TEST_UTIL.getMiniHBaseCluster().getMaster();
AssignmentManager am = services.getAssignmentManager();
Map<HRegionInfo,HServerAddress> regions = ht.getRegionsInfo();
for (HRegionInfo regionInfo : regions.keySet()) {
try {
am.waitForAssignment(regionInfo);
} catch (InterruptedException e) {
LOG.info("Interrupted waiting for region to be assigned during " +
"create table call", e);
Thread.currentThread().interrupt();
return;
}
}
int numRS = ht.getCurrentNrHRS();
regions = ht.getRegionsInfo();
Map<HServerAddress, List<HRegionInfo>> server2Regions = new HashMap<HServerAddress, List<HRegionInfo>>();
for (Map.Entry<HRegionInfo,HServerAddress> entry : regions.entrySet()) {
HServerAddress server = entry.getValue();
Expand Down Expand Up @@ -815,4 +829,4 @@ public void testHundredsOfTable() throws IOException{
this.admin.deleteTable(tableName);
}
}
}
}
8 changes: 5 additions & 3 deletions src/test/java/org/apache/hadoop/hbase/client/TestHCM.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,10 @@ public static void setUpBeforeClass() throws Exception {
* @throws SecurityException
* @see https://issues.apache.org/jira/browse/HBASE-2925
*/
@Test public void testManyNewConnectionsDoesnotOOME()
// Disabling. Of course this test will OOME using new Configuration each time
// St.Ack 20110428
// @Test
public void testManyNewConnectionsDoesnotOOME()
throws SecurityException, IllegalArgumentException,
ZooKeeperConnectionException, NoSuchFieldException, IllegalAccessException,
InterruptedException {
Expand All @@ -89,8 +92,7 @@ public static void createNewConfigurations() throws SecurityException,
Configuration configuration = HBaseConfiguration.create();
configuration.set("somekey", String.valueOf(_randy.nextInt()));
System.out.println("Hash Code: " + configuration.hashCode());
HConnection connection =
HConnectionManager.getConnection(configuration);
HConnection connection = HConnectionManager.getConnection(configuration);
if (last != null) {
if (last == connection) {
System.out.println("!! Got same connection for once !!");
Expand Down
10 changes: 10 additions & 0 deletions src/test/resources/hbase-site.xml
Original file line number Diff line number Diff line change
Expand Up @@ -133,4 +133,14 @@
The port at which the clients will connect.
</description>
</property>
<property>
<name>hbase.zookeeper.property.maxClientCnxns</name>
<value>5000</value>
<description>Property from ZooKeeper's config zoo.cfg.
Limit on number of concurrent connections (at the socket level) that a
single client, identified by IP address, may make to a single member of
the ZooKeeper ensemble. Set high to avoid zk connection issues running
standalone and pseudo-distributed.
</description>
</property>
</configuration>

0 comments on commit 5b6c45c

Please sign in to comment.