You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by st...@apache.org on 2007/07/15 00:25:33 UTC
svn commit: r556348 - in /lucene/hadoop/trunk/src/contrib/hbase: CHANGES.txt
src/java/org/apache/hadoop/hbase/HRegionInfo.java src/test/hbase-site.xml
src/test/org/apache/hadoop/hbase/TestTable.java
src/test/org/apache/hadoop/hbase/TestToString.java
Author: stack
Date: Sat Jul 14 15:25:32 2007
New Revision: 556348
URL: http://svn.apache.org/viewvc?view=rev&rev=556348
Log:
HADOOP-1581 HBASE: Un-openable tablename bug
Change format of region names from TABLENAME_STARTROW_ENDROW-RANDOMID
to TABLENAME,STARTROW,ENDROW-RANDOMID. Makes it so lone table name will
sort before any region of said table.
M src/contrib/hbase/src/test/hbase-site.xml
(hbase.client.retries.number): Removed. Wasdefault value for this property.
(hbase.master.meta.thread.rescanfrequency, hbase.server.thread.wakefrequency,
hbase.regionserver.handler.count): Add values that are less than
default so unit tests are even more responsive (and finished quicker).
M src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestToString.java
Change test so it expects region info name that has ',' delimiters
rather than '_' delimiters.
M src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestTable.java
Rename testTable as testCreateTable.
(testTableNameClash): Test for this issue.
M src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionInfo.java
Change format of region names so delimiter is ',' rather than '_'.
Modified:
lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt
lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionInfo.java
lucene/hadoop/trunk/src/contrib/hbase/src/test/hbase-site.xml
lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestTable.java
lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestToString.java
Modified: lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt?view=diff&rev=556348&r1=556347&r2=556348
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/CHANGES.txt Sat Jul 14 15:25:32 2007
@@ -60,3 +60,4 @@
36. HADOOP-1600 Update license in HBase code
37. HADOOP-1589 Exception handling in HBase is broken over client server
38. HADOOP-1574 Concurrent creates of a table named 'X' all succeed
+ 39. HADOOP-1581 Un-openable tablename bug
Modified: lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionInfo.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionInfo.java?view=diff&rev=556348&r1=556347&r2=556348
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionInfo.java (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/java/org/apache/hadoop/hbase/HRegionInfo.java Sat Jul 14 15:25:32 2007
@@ -40,7 +40,7 @@
Text endKey;
boolean offLine;
HTableDescriptor tableDesc;
- public static final char DELIMITER = '_';
+ public static final char DELIMITER = ',';
/** Default constructor - creates empty object */
public HRegionInfo() {
@@ -66,10 +66,10 @@
/**
* Construct HRegionInfo with explicit parameters
*
- * @param regionId - the regionid
- * @param tableDesc - the table descriptor
- * @param startKey - first key in region
- * @param endKey - end of key range
+ * @param regionId the region id
+ * @param tableDesc the table descriptor
+ * @param startKey first key in region
+ * @param endKey end of key range
* @throws IllegalArgumentException
*/
public HRegionInfo(long regionId, HTableDescriptor tableDesc, Text startKey,
@@ -204,9 +204,9 @@
return tableDesc;
}
- //////////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////////
// Comparable
- //////////////////////////////////////////////////////////////////////////////
+ /////////////////////////////////////////////////////////////////////////////
public int compareTo(Object o) {
HRegionInfo other = (HRegionInfo) o;
Modified: lucene/hadoop/trunk/src/contrib/hbase/src/test/hbase-site.xml
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/test/hbase-site.xml?view=diff&rev=556348&r1=556347&r2=556348
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/test/hbase-site.xml (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/test/hbase-site.xml Sat Jul 14 15:25:32 2007
@@ -37,12 +37,25 @@
before running a retry of a failed get, region lookup, etc.</description>
</property>
<property>
- <name>hbase.client.retries.number</name>
- <value>5</value>
- <description>Maximum retries. Used as maximum for all retryable
- operations such as fetching of the root region from root region
- server, getting a cell's value, starting a row update, etc.
- Default: 5.
+ <name>hbase.master.meta.thread.rescanfrequency</name>
+ <value>10000</value>
+ <description>How long the HMaster sleeps (in milliseconds) between scans of
+ the root and meta tables.
+ </description>
+ </property>
+ <property>
+ <name>hbase.server.thread.wakefrequency</name>
+ <value>1000</value>
+ <description>Time to sleep in between searches for work (in milliseconds).
+ Used as sleep interval by service threads such as META scanner and log roller.
+ </description>
+ </property>
+ <property>
+ <name>hbase.regionserver.handler.count</name>
+ <value>3</value>
+ <description>Count of RPC Server instances spun up on RegionServers
+ Same property is used by the HMaster for count of master handlers.
+ Default is 10.
</description>
</property>
</configuration>
Modified: lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestTable.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestTable.java?view=diff&rev=556348&r1=556347&r2=556348
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestTable.java (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestTable.java Sat Jul 14 15:25:32 2007
@@ -18,6 +18,7 @@
* limitations under the License.
*/
package org.apache.hadoop.hbase;
+import org.apache.hadoop.io.Text;
import java.io.IOException;
import java.util.concurrent.atomic.AtomicInteger;
@@ -28,7 +29,7 @@
super(true);
}
- public void testTable() throws IOException {
+ public void testCreateTable() throws IOException {
final HClient client = new HClient(conf);
String msg = null;
try {
@@ -103,5 +104,17 @@
// how many failed w/ appropriate exception.
assertTrue(successes.get() == 1);
assertTrue(failures.get() == (count - 1));
+ }
+
+ /**
+ * Test for hadoop-1581 'HBASE: Unopenable tablename bug'.
+ * @throws Exception
+ */
+ public void testTableNameClash() throws Exception {
+ HClient client = new HClient(conf);
+ client.createTable(new HTableDescriptor(getName() + "SOMEUPPERCASE"));
+ client.createTable(new HTableDescriptor(getName()));
+ // Before fix, below would fail throwing a NoServerForRegionException.
+ client.openTable(new Text(getName()));
}
}
Modified: lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestToString.java
URL: http://svn.apache.org/viewvc/lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestToString.java?view=diff&rev=556348&r1=556347&r2=556348
==============================================================================
--- lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestToString.java (original)
+++ lucene/hadoop/trunk/src/contrib/hbase/src/test/org/apache/hadoop/hbase/TestToString.java Sat Jul 14 15:25:32 2007
@@ -46,7 +46,7 @@
HRegionInfo hri = new HRegionInfo(-1, htd, new Text(), new Text("10"));
System.out.println(hri.toString());
assertEquals("HRegionInfo",
- "regionname: hank__-1, startKey: <>, tableDesc: {" + "name: hank, "
+ "regionname: hank,,-1, startKey: <>, tableDesc: {" + "name: hank, "
+ "families: {hankfamily:=(hankfamily:, max versions: 3, "
+ "compression: none, in memory: false, max value length: 2147483647, "
+ "bloom filter: none), hankotherfamily:=(hankotherfamily:, "