HBASE-3089 REST tests are broken locally and up in hudson
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1005660 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
58423039df
commit
8570a6af09
|
@ -566,10 +566,13 @@ Release 0.21.0 - Unreleased
|
||||||
(Bruno Dumon via Stack)
|
(Bruno Dumon via Stack)
|
||||||
HBASE-2753 Remove sorted() methods from Result now that Gets are Scans
|
HBASE-2753 Remove sorted() methods from Result now that Gets are Scans
|
||||||
HBASE-3059 TestReadWriteConsistencyControl occasionally hangs (Hairong
|
HBASE-3059 TestReadWriteConsistencyControl occasionally hangs (Hairong
|
||||||
via Ryan)
|
via Ryan)
|
||||||
HBASE-2906 [rest/stargate] URI decoding in RowResource
|
HBASE-2906 [rest/stargate] URI decoding in RowResource
|
||||||
HBASE-3008 Memstore.updateColumnValue passes wrong flag to heapSizeChange
|
HBASE-3008 Memstore.updateColumnValue passes wrong flag to heapSizeChange
|
||||||
(Causes memstore size to go negative)
|
(Causes memstore size to go negative)
|
||||||
|
HBASE-3089 REST tests are broken locally and up in hudson
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
IMPROVEMENTS
|
IMPROVEMENTS
|
||||||
HBASE-1760 Cleanup TODOs in HTable
|
HBASE-1760 Cleanup TODOs in HTable
|
||||||
|
|
|
@ -24,7 +24,6 @@ import java.io.IOException;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
|
||||||
|
|
||||||
import org.apache.hadoop.conf.Configuration;
|
import org.apache.hadoop.conf.Configuration;
|
||||||
import org.apache.hadoop.hbase.HBaseConfiguration;
|
import org.apache.hadoop.hbase.HBaseConfiguration;
|
||||||
|
@ -37,25 +36,22 @@ import org.apache.hadoop.hbase.rest.metrics.RESTMetrics;
|
||||||
* Singleton class encapsulating global REST servlet state and functions.
|
* Singleton class encapsulating global REST servlet state and functions.
|
||||||
*/
|
*/
|
||||||
public class RESTServlet implements Constants {
|
public class RESTServlet implements Constants {
|
||||||
|
private static RESTServlet INSTANCE;
|
||||||
private static RESTServlet instance;
|
private final Configuration conf;
|
||||||
|
private final HTablePool pool;
|
||||||
Configuration conf;
|
private final Map<String,Integer> maxAgeMap =
|
||||||
HTablePool pool;
|
|
||||||
AtomicBoolean stopping = new AtomicBoolean(false);
|
|
||||||
Map<String,Integer> maxAgeMap =
|
|
||||||
Collections.synchronizedMap(new HashMap<String,Integer>());
|
Collections.synchronizedMap(new HashMap<String,Integer>());
|
||||||
RESTMetrics metrics = new RESTMetrics();
|
private final RESTMetrics metrics = new RESTMetrics();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the RESTServlet singleton instance
|
* @return the RESTServlet singleton instance
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public synchronized static RESTServlet getInstance() throws IOException {
|
public synchronized static RESTServlet getInstance() throws IOException {
|
||||||
if (instance == null) {
|
if (INSTANCE == null) {
|
||||||
instance = new RESTServlet();
|
INSTANCE = new RESTServlet();
|
||||||
}
|
}
|
||||||
return instance;
|
return INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -65,17 +61,21 @@ public class RESTServlet implements Constants {
|
||||||
*/
|
*/
|
||||||
public synchronized static RESTServlet getInstance(Configuration conf)
|
public synchronized static RESTServlet getInstance(Configuration conf)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
if (instance == null) {
|
if (INSTANCE == null) {
|
||||||
instance = new RESTServlet(conf);
|
INSTANCE = new RESTServlet(conf);
|
||||||
}
|
}
|
||||||
return instance;
|
return INSTANCE;
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized static void stop() {
|
||||||
|
if (INSTANCE != null) INSTANCE = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
*/
|
*/
|
||||||
public RESTServlet() throws IOException {
|
RESTServlet() throws IOException {
|
||||||
this(HBaseConfiguration.create());
|
this(HBaseConfiguration.create());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -84,7 +84,7 @@ public class RESTServlet implements Constants {
|
||||||
* @param conf existing configuration
|
* @param conf existing configuration
|
||||||
* @throws IOException.
|
* @throws IOException.
|
||||||
*/
|
*/
|
||||||
public RESTServlet(Configuration conf) throws IOException {
|
RESTServlet(Configuration conf) throws IOException {
|
||||||
this.conf = conf;
|
this.conf = conf;
|
||||||
this.pool = new HTablePool(conf, 10);
|
this.pool = new HTablePool(conf, 10);
|
||||||
}
|
}
|
||||||
|
@ -140,4 +140,4 @@ public class RESTServlet implements Constants {
|
||||||
public void invalidateMaxAge(String tableName) {
|
public void invalidateMaxAge(String tableName) {
|
||||||
maxAgeMap.remove(tableName);
|
maxAgeMap.remove(tableName);
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -88,6 +88,7 @@ public class HBaseRESTClusterTestBase extends HBaseClusterTestCase
|
||||||
if (server != null) try {
|
if (server != null) try {
|
||||||
server.stop();
|
server.stop();
|
||||||
server = null;
|
server = null;
|
||||||
|
RESTServlet.stop();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.warn(StringUtils.stringifyException(e));
|
LOG.warn(StringUtils.stringifyException(e));
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,8 @@ import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.apache.commons.logging.Log;
|
||||||
|
import org.apache.commons.logging.LogFactory;
|
||||||
import org.apache.hadoop.hbase.HColumnDescriptor;
|
import org.apache.hadoop.hbase.HColumnDescriptor;
|
||||||
import org.apache.hadoop.hbase.HTableDescriptor;
|
import org.apache.hadoop.hbase.HTableDescriptor;
|
||||||
import org.apache.hadoop.hbase.KeyValue;
|
import org.apache.hadoop.hbase.KeyValue;
|
||||||
|
@ -42,7 +44,7 @@ import org.apache.hadoop.hbase.rest.client.RemoteHTable;
|
||||||
import org.apache.hadoop.hbase.util.Bytes;
|
import org.apache.hadoop.hbase.util.Bytes;
|
||||||
|
|
||||||
public class TestRemoteTable extends HBaseRESTClusterTestBase {
|
public class TestRemoteTable extends HBaseRESTClusterTestBase {
|
||||||
|
private static final Log LOG = LogFactory.getLog(HBaseRESTClusterTestBase.class);
|
||||||
static final String TABLE = "TestRemoteTable";
|
static final String TABLE = "TestRemoteTable";
|
||||||
static final byte[] ROW_1 = Bytes.toBytes("testrow1");
|
static final byte[] ROW_1 = Bytes.toBytes("testrow1");
|
||||||
static final byte[] ROW_2 = Bytes.toBytes("testrow2");
|
static final byte[] ROW_2 = Bytes.toBytes("testrow2");
|
||||||
|
@ -71,6 +73,7 @@ public class TestRemoteTable extends HBaseRESTClusterTestBase {
|
||||||
super.setUp();
|
super.setUp();
|
||||||
|
|
||||||
admin = new HBaseAdmin(conf);
|
admin = new HBaseAdmin(conf);
|
||||||
|
LOG.info("Admin Connection=" + admin.getConnection() + ", " + admin.getConnection().getZooKeeperWatcher());
|
||||||
if (!admin.tableExists(TABLE)) {
|
if (!admin.tableExists(TABLE)) {
|
||||||
HTableDescriptor htd = new HTableDescriptor(TABLE);
|
HTableDescriptor htd = new HTableDescriptor(TABLE);
|
||||||
htd.addFamily(new HColumnDescriptor(COLUMN_1));
|
htd.addFamily(new HColumnDescriptor(COLUMN_1));
|
||||||
|
@ -78,6 +81,7 @@ public class TestRemoteTable extends HBaseRESTClusterTestBase {
|
||||||
htd.addFamily(new HColumnDescriptor(COLUMN_3));
|
htd.addFamily(new HColumnDescriptor(COLUMN_3));
|
||||||
admin.createTable(htd);
|
admin.createTable(htd);
|
||||||
HTable table = new HTable(conf, TABLE);
|
HTable table = new HTable(conf, TABLE);
|
||||||
|
LOG.info("Table connection=" + table.getConnection() + ", " + admin.getConnection().getZooKeeperWatcher());
|
||||||
Put put = new Put(ROW_1);
|
Put put = new Put(ROW_1);
|
||||||
put.add(COLUMN_1, QUALIFIER_1, TS_2, VALUE_1);
|
put.add(COLUMN_1, QUALIFIER_1, TS_2, VALUE_1);
|
||||||
table.put(put);
|
table.put(put);
|
||||||
|
|
Loading…
Reference in New Issue