414 Move client classes into client package

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@627918 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bryan Duxbury 2008-02-15 00:29:04 +00:00
parent 21932c5981
commit 51a7b53e5b
58 changed files with 217 additions and 140 deletions

View File

@ -51,7 +51,8 @@ Hbase Change Log
HBASE-407 Keep HRegionLocation information in LRU structure HBASE-407 Keep HRegionLocation information in LRU structure
HBASE-444 hbase is very slow at determining table is not present HBASE-444 hbase is very slow at determining table is not present
HBASE-438 XMLOutputter state should be initialized. HBASE-438 XMLOutputter state should be initialized.
HBASE-414 Move client classes into client package
Branch 0.1 Branch 0.1
INCOMPATIBLE CHANGES INCOMPATIBLE CHANGES

View File

@ -277,4 +277,4 @@ public abstract class HAbstractScanner implements HInternalScannerInterface {
throw new UnsupportedOperationException("Unimplemented serverside. " + throw new UnsupportedOperationException("Unimplemented serverside. " +
"next(HStoreKey, StortedMap(...) is more efficient"); "next(HStoreKey, StortedMap(...) is more efficient");
} }
} }

View File

@ -34,7 +34,9 @@ import org.apache.hadoop.hbase.util.Writables;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.io.BatchUpdate; import org.apache.hadoop.hbase.io.BatchUpdate;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.HConnection;
import org.apache.hadoop.hbase.client.HConnectionManager;
/** /**
* A non-instantiable class that has a static method capable of compacting * A non-instantiable class that has a static method capable of compacting
* a table by merging adjacent regions that have grown too small. * a table by merging adjacent regions that have grown too small.

View File

@ -67,6 +67,7 @@ import org.apache.hadoop.ipc.Server;
import org.apache.hadoop.net.DNS; import org.apache.hadoop.net.DNS;
import org.apache.hadoop.util.StringUtils; import org.apache.hadoop.util.StringUtils;
import org.apache.hadoop.hbase.master.HMasterRegionInterface; import org.apache.hadoop.hbase.master.HMasterRegionInterface;
import org.apache.hadoop.hbase.client.HTable;
/** /**
* HRegionServer makes a set of HRegions available to clients. It checks in with * HRegionServer makes a set of HRegions available to clients. It checks in with

View File

@ -30,6 +30,7 @@ import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.util.ReflectionUtils; import org.apache.hadoop.util.ReflectionUtils;
import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.HMaster;
import org.apache.hadoop.hbase.client.HBaseAdmin;
/** /**
* This class creates a single process HBase cluster. One thread is created for * This class creates a single process HBase cluster. One thread is created for
@ -308,4 +309,4 @@ public class LocalHBaseCluster implements HConstants {
admin.createTable(new HTableDescriptor(cluster.getClass().getName())); admin.createTable(new HTableDescriptor(cluster.getClass().getName()));
cluster.shutdown(); cluster.shutdown();
} }
} }

View File

@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.hadoop.hbase; package org.apache.hadoop.hbase.client;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
@ -32,6 +32,19 @@ import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.Writable;
import org.apache.hadoop.ipc.RemoteException; import org.apache.hadoop.ipc.RemoteException;
import org.apache.hadoop.hbase.master.HMasterInterface; import org.apache.hadoop.hbase.master.HMasterInterface;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.MasterNotRunningException;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HRegionLocation;
import org.apache.hadoop.hbase.TableNotFoundException;
import org.apache.hadoop.hbase.TableExistsException;
import org.apache.hadoop.hbase.RemoteExceptionHandler;
import org.apache.hadoop.hbase.HRegionInterface;
import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.HRegionLocation;
import org.apache.hadoop.hbase.HStoreKey;
/** /**
* Provides administrative functions for HBase * Provides administrative functions for HBase
@ -544,4 +557,4 @@ public class HBaseAdmin implements HConstants {
Text tableKey = new Text(tableName.toString() + ",,99999999999999"); Text tableKey = new Text(tableName.toString() + ",,99999999999999");
return connection.locateRegion(META_TABLE_NAME, tableKey); return connection.locateRegion(META_TABLE_NAME, tableKey);
} }
} }

View File

@ -17,14 +17,18 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.hadoop.hbase; package org.apache.hadoop.hbase.client;
import java.io.IOException; import java.io.IOException;
import java.util.SortedMap; import java.util.SortedMap;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.master.HMasterInterface; import org.apache.hadoop.hbase.master.HMasterInterface;
import org.apache.hadoop.hbase.MasterNotRunningException;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.HRegionLocation;
import org.apache.hadoop.hbase.HServerAddress;
import org.apache.hadoop.hbase.HRegionInterface;
/** /**
* *
*/ */

View File

@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.hadoop.hbase; package org.apache.hadoop.hbase.client;
import java.io.IOException; import java.io.IOException;
import java.util.Collections; import java.util.Collections;
@ -39,6 +39,22 @@ import org.apache.hadoop.io.Writable;
import org.apache.hadoop.ipc.RemoteException; import org.apache.hadoop.ipc.RemoteException;
import org.apache.hadoop.hbase.master.HMasterInterface; import org.apache.hadoop.hbase.master.HMasterInterface;
import org.apache.hadoop.hbase.util.SoftSortedMap; import org.apache.hadoop.hbase.util.SoftSortedMap;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HRegionInterface;
import org.apache.hadoop.hbase.MasterNotRunningException;
import org.apache.hadoop.hbase.HRegionLocation;
import org.apache.hadoop.hbase.HServerAddress;
import org.apache.hadoop.hbase.LocalHBaseCluster;
import org.apache.hadoop.hbase.HStoreKey;
import org.apache.hadoop.hbase.HRegionInterface;
import org.apache.hadoop.hbase.HRegionLocation;
import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.HStoreKey;
import org.apache.hadoop.hbase.NoServerForRegionException;
import org.apache.hadoop.hbase.TableNotFoundException;
import org.apache.hadoop.hbase.RemoteExceptionHandler;
/** /**
* A non-instantiable class that manages connections to multiple tables in * A non-instantiable class that manages connections to multiple tables in

View File

@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.hadoop.hbase; package org.apache.hadoop.hbase.client;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
@ -43,6 +43,18 @@ import org.apache.hadoop.hbase.util.Writables;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.Writable;
import org.apache.hadoop.ipc.RemoteException; import org.apache.hadoop.ipc.RemoteException;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HRegionLocation;
import org.apache.hadoop.hbase.HScannerInterface;
import org.apache.hadoop.hbase.HRegionInterface;
import org.apache.hadoop.hbase.HStoreKey;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.RemoteExceptionHandler;
import org.apache.hadoop.hbase.NotServingRegionException;
import org.apache.hadoop.hbase.HRegionInterface;
import org.apache.hadoop.hbase.HStoreKey;
/** /**
* Used to communicate with a single HBase table * Used to communicate with a single HBase table
@ -83,7 +95,7 @@ public class HTable implements HConstants {
* @param row Row to find. * @param row Row to find.
* @return Location of row. * @return Location of row.
*/ */
HRegionLocation getRegionLocation(Text row) throws IOException { public HRegionLocation getRegionLocation(Text row) throws IOException {
return this.connection.locateRegion(this.tableName, row); return this.connection.locateRegion(this.tableName, row);
} }

View File

@ -9,10 +9,9 @@ import org.apache.hadoop.util.VersionInfo;
import org.apache.hadoop.hbase.master.HMaster; import org.apache.hadoop.hbase.master.HMaster;
import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.master.MetaRegion; import org.apache.hadoop.hbase.master.MetaRegion;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HServerInfo; import org.apache.hadoop.hbase.HServerInfo;
import org.apache.hadoop.hbase.HServerAddress; import org.apache.hadoop.hbase.HServerAddress;
import org.apache.hadoop.hbase.HRegionInfo;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.hql.ShowCommand; import org.apache.hadoop.hbase.hql.ShowCommand;
import org.apache.hadoop.hbase.hql.TableFormatter; import org.apache.hadoop.hbase.hql.TableFormatter;

View File

@ -25,12 +25,12 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
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.HConnection; import org.apache.hadoop.hbase.client.HConnection;
import org.apache.hadoop.hbase.HConnectionManager; import org.apache.hadoop.hbase.client.HConnectionManager;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.BloomFilterDescriptor; import org.apache.hadoop.hbase.BloomFilterDescriptor;

View File

@ -24,4 +24,4 @@ package org.apache.hadoop.hbase.hql;
*/ */
public interface CommandFactory { public interface CommandFactory {
Command getCommand(); Command getCommand();
} }

View File

@ -24,11 +24,11 @@ import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HConnection; import org.apache.hadoop.hbase.client.HConnection;
import org.apache.hadoop.hbase.HConnectionManager; import org.apache.hadoop.hbase.client.HConnectionManager;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
@ -45,12 +45,11 @@ public class CreateCommand extends SchemaModificationCommand {
public ReturnMsg execute(HBaseConfiguration conf) { public ReturnMsg execute(HBaseConfiguration conf) {
try { try {
HConnection conn = HConnectionManager.getConnection(conf); HBaseAdmin admin = new HBaseAdmin(conf);
if (conn.tableExists(tableName)) { if (admin.tableExists(tableName)) {
return new ReturnMsg(0, "'" + tableName + "' table already exist."); return new ReturnMsg(0, "'" + tableName + "' table already exist.");
} }
HBaseAdmin admin = new HBaseAdmin(conf);
HTableDescriptor tableDesc = new HTableDescriptor(tableName.toString()); HTableDescriptor tableDesc = new HTableDescriptor(tableName.toString());
HColumnDescriptor columnDesc = null; HColumnDescriptor columnDesc = null;
Set<String> columns = columnSpecMap.keySet(); Set<String> columns = columnSpecMap.keySet();

View File

@ -24,12 +24,10 @@ import java.io.Writer;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConnection;
import org.apache.hadoop.hbase.HConnectionManager;
import org.apache.hadoop.hbase.HTable;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.client.HTable;
/** /**
* Deletes values from tables. * Deletes values from tables.
@ -48,12 +46,12 @@ public class DeleteCommand extends BasicCommand {
throw new IllegalArgumentException("Column list is null"); throw new IllegalArgumentException("Column list is null");
} }
try { try {
HConnection conn = HConnectionManager.getConnection(conf); HBaseAdmin admin = new HBaseAdmin(conf);
if (!conn.tableExists(tableName)) {
if (!admin.tableExists(tableName)) {
return new ReturnMsg(0, "'" + tableName + "'" + TABLE_NOT_FOUND); return new ReturnMsg(0, "'" + tableName + "'" + TABLE_NOT_FOUND);
} }
HBaseAdmin admin = new HBaseAdmin(conf);
HTable hTable = new HTable(conf, tableName); HTable hTable = new HTable(conf, tableName);
if (rowKey != null) { if (rowKey != null) {

View File

@ -24,8 +24,7 @@ import java.io.Writer;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HConnection; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HConnectionManager;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
@ -52,11 +51,11 @@ public class DescCommand extends BasicCommand {
if (tableName == null) if (tableName == null)
return new ReturnMsg(0, "Syntax error : Please check 'Describe' syntax."); return new ReturnMsg(0, "Syntax error : Please check 'Describe' syntax.");
try { try {
HConnection conn = HConnectionManager.getConnection(conf); HBaseAdmin admin = new HBaseAdmin(conf);
if (!conn.tableExists(tableName)) { if (!admin.tableExists(tableName)) {
return new ReturnMsg(0, "Table not found."); return new ReturnMsg(0, "Table not found.");
} }
HTableDescriptor[] tables = conn.listTables(); HTableDescriptor[] tables = admin.listTables();
HColumnDescriptor[] columns = null; HColumnDescriptor[] columns = null;
for (int i = 0; i < tables.length; i++) { for (int i = 0; i < tables.length; i++) {
if (tables[i].getName().equals(tableName)) { if (tables[i].getName().equals(tableName)) {

View File

@ -22,10 +22,8 @@ package org.apache.hadoop.hbase.hql;
import java.io.IOException; import java.io.IOException;
import java.io.Writer; import java.io.Writer;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConnection;
import org.apache.hadoop.hbase.HConnectionManager;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
/** /**
@ -42,12 +40,12 @@ public class DisableCommand extends BasicCommand {
assert tableName != null; assert tableName != null;
try { try {
HConnection conn = HConnectionManager.getConnection(conf); HBaseAdmin admin = new HBaseAdmin(conf);
if (!conn.tableExists(new Text(tableName))) {
if (!admin.tableExists(new Text(tableName))) {
return new ReturnMsg(0, "'" + tableName + "'" + TABLE_NOT_FOUND); return new ReturnMsg(0, "'" + tableName + "'" + TABLE_NOT_FOUND);
} }
HBaseAdmin admin = new HBaseAdmin(conf);
admin.disableTable(new Text(tableName)); admin.disableTable(new Text(tableName));
return new ReturnMsg(1, "Table disabled successfully."); return new ReturnMsg(1, "Table disabled successfully.");

View File

@ -23,10 +23,8 @@ import java.io.IOException;
import java.io.Writer; import java.io.Writer;
import java.util.List; import java.util.List;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConnection;
import org.apache.hadoop.hbase.HConnectionManager;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
/** /**
@ -46,11 +44,10 @@ public class DropCommand extends BasicCommand {
try { try {
HBaseAdmin admin = new HBaseAdmin(conf); HBaseAdmin admin = new HBaseAdmin(conf);
HConnection conn = HConnectionManager.getConnection(conf);
int count = 0; int count = 0;
for (String table : tableList) { for (String table : tableList) {
if (!conn.tableExists(new Text(table))) { if (!admin.tableExists(new Text(table))) {
println("'" + table + "' table not found."); println("'" + table + "' table not found.");
} else { } else {
println("Dropping " + table + "... Please wait."); println("Dropping " + table + "... Please wait.");

View File

@ -22,10 +22,8 @@ package org.apache.hadoop.hbase.hql;
import java.io.IOException; import java.io.IOException;
import java.io.Writer; import java.io.Writer;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConnection;
import org.apache.hadoop.hbase.HConnectionManager;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
/** /**
@ -41,12 +39,10 @@ public class EnableCommand extends BasicCommand {
public ReturnMsg execute(HBaseConfiguration conf) { public ReturnMsg execute(HBaseConfiguration conf) {
assert tableName != null; assert tableName != null;
try { try {
HConnection conn = HConnectionManager.getConnection(conf); HBaseAdmin admin = new HBaseAdmin(conf);
if (!conn.tableExists(new Text(tableName))) { if (!admin.tableExists(new Text(tableName))) {
return new ReturnMsg(0, "'" + tableName + "'" + TABLE_NOT_FOUND); return new ReturnMsg(0, "'" + tableName + "'" + TABLE_NOT_FOUND);
} }
HBaseAdmin admin = new HBaseAdmin(conf);
admin.enableTable(new Text(tableName)); admin.enableTable(new Text(tableName));
return new ReturnMsg(1, "Table enabled successfully."); return new ReturnMsg(1, "Table enabled successfully.");
} catch (IOException e) { } catch (IOException e) {

View File

@ -24,10 +24,10 @@ import java.io.Writer;
import java.util.List; import java.util.List;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConnection; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HConnectionManager; import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.HTable;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.MasterNotRunningException;
/** /**
* Inserts values into tables. * Inserts values into tables.
@ -46,38 +46,42 @@ public class InsertCommand extends BasicCommand {
public ReturnMsg execute(HBaseConfiguration conf) { public ReturnMsg execute(HBaseConfiguration conf) {
if (tableName == null || values == null || rowKey == null) if (tableName == null || values == null || rowKey == null)
return new ReturnMsg(0, "Syntax error : Please check 'Insert' syntax."); return new ReturnMsg(0, "Syntax error : Please check 'Insert' syntax.");
HConnection conn = HConnectionManager.getConnection(conf);
if (!conn.tableExists(tableName)) {
return new ReturnMsg(0, "'" + tableName + "'" + TABLE_NOT_FOUND);
}
if (columnfamilies.size() != values.size())
return new ReturnMsg(0,
"Mismatch between values list and columnfamilies list.");
try { try {
HTable table = new HTable(conf, tableName); HBaseAdmin admin = new HBaseAdmin(conf);
long lockId = table.startUpdate(getRow()); if (!admin.tableExists(tableName)) {
return new ReturnMsg(0, "'" + tableName + "'" + TABLE_NOT_FOUND);
for (int i = 0; i < values.size(); i++) {
Text column = null;
if (getColumn(i).toString().contains(":"))
column = getColumn(i);
else
column = new Text(getColumn(i) + ":");
table.put(lockId, column, getValue(i));
} }
if(timestamp != null) if (columnfamilies.size() != values.size())
table.commit(lockId, Long.parseLong(timestamp)); return new ReturnMsg(0,
else "Mismatch between values list and columnfamilies list.");
table.commit(lockId);
return new ReturnMsg(1, "1 row inserted successfully."); try {
} catch (IOException e) { HTable table = new HTable(conf, tableName);
String[] msg = e.getMessage().split("[\n]"); long lockId = table.startUpdate(getRow());
return new ReturnMsg(0, msg[0]);
for (int i = 0; i < values.size(); i++) {
Text column = null;
if (getColumn(i).toString().contains(":"))
column = getColumn(i);
else
column = new Text(getColumn(i) + ":");
table.put(lockId, column, getValue(i));
}
if(timestamp != null)
table.commit(lockId, Long.parseLong(timestamp));
else
table.commit(lockId);
return new ReturnMsg(1, "1 row inserted successfully.");
} catch (IOException e) {
String[] msg = e.getMessage().split("[\n]");
return new ReturnMsg(0, msg[0]);
}
} catch (MasterNotRunningException e) {
return new ReturnMsg(0, "Master is not running!");
} }
} }

View File

@ -28,14 +28,10 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
import org.apache.hadoop.hbase.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConnection;
import org.apache.hadoop.hbase.HConnectionManager;
import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HScannerInterface; import org.apache.hadoop.hbase.HScannerInterface;
import org.apache.hadoop.hbase.HStoreKey; import org.apache.hadoop.hbase.HStoreKey;
import org.apache.hadoop.hbase.HTable;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.Shell; import org.apache.hadoop.hbase.Shell;
import org.apache.hadoop.hbase.filter.RowFilterInterface; import org.apache.hadoop.hbase.filter.RowFilterInterface;
@ -44,6 +40,8 @@ import org.apache.hadoop.hbase.filter.WhileMatchRowFilter;
import org.apache.hadoop.hbase.hql.generated.HQLParser; import org.apache.hadoop.hbase.hql.generated.HQLParser;
import org.apache.hadoop.hbase.util.Writables; import org.apache.hadoop.hbase.util.Writables;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.HBaseAdmin;
/** /**
* Selects values from tables. * Selects values from tables.
@ -82,13 +80,12 @@ public class SelectCommand extends BasicCommand {
return new ReturnMsg(0, "Syntax error : Please check 'Select' syntax."); return new ReturnMsg(0, "Syntax error : Please check 'Select' syntax.");
} }
try { try {
HConnection conn = HConnectionManager.getConnection(conf); HBaseAdmin admin = new HBaseAdmin(conf);
if (!conn.tableExists(tableName) && !isMetaTable()) { if (!admin.tableExists(tableName) && !isMetaTable()) {
return new ReturnMsg(0, "'" + tableName + "'" + TABLE_NOT_FOUND); return new ReturnMsg(0, "'" + tableName + "'" + TABLE_NOT_FOUND);
} }
HTable table = new HTable(conf, tableName); HTable table = new HTable(conf, tableName);
HBaseAdmin admin = new HBaseAdmin(conf);
int count = 0; int count = 0;
if (whereClause) { if (whereClause) {
if (countFunction) { if (countFunction) {

View File

@ -22,7 +22,7 @@ package org.apache.hadoop.hbase.hql;
import java.io.IOException; import java.io.IOException;
import java.io.Writer; import java.io.Writer;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;

View File

@ -22,11 +22,9 @@ package org.apache.hadoop.hbase.hql;
import java.io.IOException; import java.io.IOException;
import java.io.Writer; import java.io.Writer;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HConnection;
import org.apache.hadoop.hbase.HConnectionManager;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
@ -45,14 +43,12 @@ public class TruncateCommand extends BasicCommand {
return new ReturnMsg(0, "Syntax error : Please check 'Truncate' syntax."); return new ReturnMsg(0, "Syntax error : Please check 'Truncate' syntax.");
try { try {
HConnection conn = HConnectionManager.getConnection(conf);
HBaseAdmin admin = new HBaseAdmin(conf); HBaseAdmin admin = new HBaseAdmin(conf);
if (!admin.tableExists(tableName)) {
if (!conn.tableExists(tableName)) {
return new ReturnMsg(0, "Table not found."); return new ReturnMsg(0, "Table not found.");
} }
HTableDescriptor[] tables = conn.listTables(); HTableDescriptor[] tables = admin.listTables();
HColumnDescriptor[] columns = null; HColumnDescriptor[] columns = null;
for (int i = 0; i < tables.length; i++) { for (int i = 0; i < tables.length; i++) {
if (tables[i].getName().equals(tableName)) { if (tables[i].getName().equals(tableName)) {

View File

@ -165,4 +165,4 @@ public class AsciiTableFormatter implements TableFormatter {
public void setNoFormatting(boolean noFormatting) { public void setNoFormatting(boolean noFormatting) {
this.noFormatting = noFormatting; this.noFormatting = noFormatting;
} }
} }

View File

@ -48,4 +48,4 @@ class LuceneDocumentWrapper implements Writable {
public void write(DataOutput out) throws IOException { public void write(DataOutput out) throws IOException {
// intentionally left blank // intentionally left blank
} }
} }

View File

@ -37,10 +37,10 @@ import org.apache.hadoop.mapred.RecordReader;
import org.apache.hadoop.mapred.Reporter; import org.apache.hadoop.mapred.Reporter;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HTable;
import org.apache.hadoop.hbase.HScannerInterface; import org.apache.hadoop.hbase.HScannerInterface;
import org.apache.hadoop.hbase.HStoreKey; import org.apache.hadoop.hbase.HStoreKey;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
@ -207,4 +207,4 @@ implements InputFormat<HStoreKey, MapWritable>, JobConfigurable {
throw new IOException("expecting at least one column"); throw new IOException("expecting at least one column");
} }
} }
} }

View File

@ -35,8 +35,8 @@ import org.apache.hadoop.mapred.Reporter;
import org.apache.hadoop.util.Progressable; import org.apache.hadoop.util.Progressable;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HTable;
import org.apache.hadoop.hbase.io.ImmutableBytesWritable; import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;

View File

@ -62,8 +62,8 @@ import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.Leases; import org.apache.hadoop.hbase.Leases;
import org.apache.hadoop.hbase.HServerAddress; import org.apache.hadoop.hbase.HServerAddress;
import org.apache.hadoop.hbase.HConnection; import org.apache.hadoop.hbase.client.HConnection;
import org.apache.hadoop.hbase.HConnectionManager; import org.apache.hadoop.hbase.client.HConnectionManager;
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.HRegionInterface; import org.apache.hadoop.hbase.HRegionInterface;
@ -72,7 +72,7 @@ import org.apache.hadoop.hbase.HServerLoad;
import org.apache.hadoop.hbase.HRegion; import org.apache.hadoop.hbase.HRegion;
import org.apache.hadoop.hbase.RemoteExceptionHandler; import org.apache.hadoop.hbase.RemoteExceptionHandler;
import org.apache.hadoop.hbase.HMsg; import org.apache.hadoop.hbase.HMsg;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.LocalHBaseCluster; import org.apache.hadoop.hbase.LocalHBaseCluster;
import org.apache.hadoop.hbase.HStoreKey; import org.apache.hadoop.hbase.HStoreKey;
import org.apache.hadoop.hbase.HServerInfo; import org.apache.hadoop.hbase.HServerInfo;

View File

@ -28,7 +28,7 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.util.InfoServer; import org.apache.hadoop.hbase.util.InfoServer;
import org.apache.hadoop.mapred.StatusHttpServer; import org.apache.hadoop.mapred.StatusHttpServer;

View File

@ -29,16 +29,15 @@ import javax.servlet.http.HttpServletResponse;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HTable;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.mortbay.servlet.MultiPartResponse; import org.mortbay.servlet.MultiPartResponse;
import org.znerd.xmlenc.LineBreak; import org.znerd.xmlenc.LineBreak;
import org.znerd.xmlenc.XMLOutputter; import org.znerd.xmlenc.XMLOutputter;
import org.apache.hadoop.hbase.client.HTable;
/** /**
* GenericHandler contains some basic common stuff that all the individual * GenericHandler contains some basic common stuff that all the individual
* REST handler types take advantage of. * REST handler types take advantage of.
@ -259,4 +258,4 @@ public abstract class GenericHandler {
protected HTable getTable(final String tableName) throws IOException { protected HTable getTable(final String tableName) throws IOException {
return new HTable(this.conf, new Text(tableName)); return new HTable(this.conf, new Text(tableName));
} }
} }

View File

@ -26,7 +26,7 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
import org.znerd.xmlenc.XMLOutputter; import org.znerd.xmlenc.XMLOutputter;
@ -104,4 +104,4 @@ public class MetaHandler extends GenericHandler {
doNotAcceptable(response); doNotAcceptable(response);
} }
} }
} }

View File

@ -30,8 +30,8 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HTable; import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HScannerInterface; import org.apache.hadoop.hbase.HScannerInterface;
@ -326,4 +326,4 @@ public class ScannerHandler extends GenericHandler {
response.getOutputStream().close(); response.getOutputStream().close();
} }
} }
} }

View File

@ -33,13 +33,14 @@ import javax.servlet.http.HttpServletResponse;
import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.DocumentBuilderFactory;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.HTable;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.client.HTable;
import org.mortbay.servlet.MultiPartResponse; import org.mortbay.servlet.MultiPartResponse;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Element; import org.w3c.dom.Element;
@ -488,4 +489,4 @@ public class TableHandler extends GenericHandler {
response.setStatus(202); response.setStatus(202);
} }
} }
} }

View File

@ -30,13 +30,12 @@ import java.util.Map.Entry;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HScannerInterface; import org.apache.hadoop.hbase.HScannerInterface;
import org.apache.hadoop.hbase.HStoreKey; import org.apache.hadoop.hbase.HStoreKey;
import org.apache.hadoop.hbase.HTable;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.MasterNotRunningException; import org.apache.hadoop.hbase.MasterNotRunningException;
import org.apache.hadoop.hbase.thrift.generated.AlreadyExists; import org.apache.hadoop.hbase.thrift.generated.AlreadyExists;
@ -49,6 +48,7 @@ import org.apache.hadoop.hbase.thrift.generated.NotFound;
import org.apache.hadoop.hbase.thrift.generated.RegionDescriptor; import org.apache.hadoop.hbase.thrift.generated.RegionDescriptor;
import org.apache.hadoop.hbase.thrift.generated.ScanEntry; import org.apache.hadoop.hbase.thrift.generated.ScanEntry;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.client.HTable;
import com.facebook.thrift.TException; import com.facebook.thrift.TException;
import com.facebook.thrift.protocol.TBinaryProtocol; import com.facebook.thrift.protocol.TBinaryProtocol;

View File

@ -51,7 +51,7 @@ import org.apache.hadoop.util.GenericOptionsParser;
import org.apache.hadoop.util.Tool; import org.apache.hadoop.util.Tool;
import org.apache.hadoop.util.ToolRunner; import org.apache.hadoop.util.ToolRunner;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseConfiguration; import org.apache.hadoop.hbase.HBaseConfiguration;
import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HLog; import org.apache.hadoop.hbase.HLog;

View File

@ -21,6 +21,7 @@ package org.apache.hadoop.hbase;
import junit.framework.TestSuite; import junit.framework.TestSuite;
import junit.textui.TestRunner; import junit.textui.TestRunner;
import org.apache.hadoop.hbase.client.HBaseAdmin;
/** /**
* Test ability of HBase to handle DFS failure * Test ability of HBase to handle DFS failure
@ -70,4 +71,4 @@ public class DFSAbort extends HBaseClusterTestCase {
public static void main(@SuppressWarnings("unused") String[] args) { public static void main(@SuppressWarnings("unused") String[] args) {
TestRunner.run(new TestSuite(DFSAbort.class)); TestRunner.run(new TestSuite(DFSAbort.class));
} }
} }

View File

@ -43,6 +43,8 @@ import org.apache.hadoop.hbase.io.ImmutableBytesWritable;
import org.apache.hadoop.hbase.util.Writables; import org.apache.hadoop.hbase.util.Writables;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.io.Writable; import org.apache.hadoop.io.Writable;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.HBaseAdmin;
/** /**
* Additional scanner tests. * Additional scanner tests.

View File

@ -24,6 +24,7 @@ import java.io.PrintWriter;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.util.ReflectionUtils; import org.apache.hadoop.util.ReflectionUtils;
import org.apache.hadoop.hbase.client.HConnectionManager;
/** /**
* Abstract base class for HBase cluster junit tests. Spins up an hbase * Abstract base class for HBase cluster junit tests. Spins up an hbase

View File

@ -32,6 +32,7 @@ import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HColumnDescriptor.CompressionType; import org.apache.hadoop.hbase.HColumnDescriptor.CompressionType;
import org.apache.hadoop.hbase.io.BatchUpdate; import org.apache.hadoop.hbase.io.BatchUpdate;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.client.HTable;
/** /**
* Abstract base class for test cases. Performs all static initialization * Abstract base class for test cases. Performs all static initialization

View File

@ -31,6 +31,7 @@ import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.util.Writables; import org.apache.hadoop.hbase.util.Writables;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.client.HTable;
/** /**
* Utility class to build a table of multiple regions. * Utility class to build a table of multiple regions.

View File

@ -46,6 +46,8 @@ import org.apache.hadoop.mapred.Reporter;
import org.apache.hadoop.mapred.TextInputFormat; import org.apache.hadoop.mapred.TextInputFormat;
import org.apache.hadoop.mapred.TextOutputFormat; import org.apache.hadoop.mapred.TextOutputFormat;
import org.apache.log4j.Logger; import org.apache.log4j.Logger;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.HBaseAdmin;
/** /**
* Script used evaluating HBase performance and scalability. Runs a HBase * Script used evaluating HBase performance and scalability. Runs a HBase

View File

@ -23,6 +23,8 @@ import java.io.IOException;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.HBaseAdmin;
/** Tests per-column bloom filters */ /** Tests per-column bloom filters */
public class TestBloomFilters extends HBaseClusterTestCase { public class TestBloomFilters extends HBaseClusterTestCase {

View File

@ -25,6 +25,8 @@ import java.util.Set;
import java.util.TreeMap; import java.util.TreeMap;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTable;
/** /**
* Test HBase Master and Region servers, client API * Test HBase Master and Region servers, client API

View File

@ -26,6 +26,7 @@ import java.net.URL;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.client.HBaseAdmin;
/** /**
* Testing, info servers are disabled. This test enables then and checks that * Testing, info servers are disabled. This test enables then and checks that

View File

@ -26,6 +26,8 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.dfs.MiniDFSCluster; import org.apache.hadoop.dfs.MiniDFSCluster;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.HBaseAdmin;
/** /**
* Test log deletion as logs are rolled. * Test log deletion as logs are rolled.

View File

@ -22,6 +22,8 @@ package org.apache.hadoop.hbase;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTable;
/** tests administrative functions */ /** tests administrative functions */
public class TestMasterAdmin extends HBaseClusterTestCase { public class TestMasterAdmin extends HBaseClusterTestCase {
@ -85,4 +87,4 @@ public class TestMasterAdmin extends HBaseClusterTestCase {
admin.deleteColumn(testDesc.getName(), new Text("col2:")); admin.deleteColumn(testDesc.getName(), new Text("col2:"));
admin.deleteTable(testDesc.getName()); admin.deleteTable(testDesc.getName());
} }
} }

View File

@ -29,6 +29,8 @@ import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.io.BatchUpdate; import org.apache.hadoop.hbase.io.BatchUpdate;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.HBaseAdmin;
/** /**
* Tests region server failover when a region server exits both cleanly and * Tests region server failover when a region server exits both cleanly and

View File

@ -28,6 +28,8 @@ import java.util.SortedMap;
import java.util.TreeMap; import java.util.TreeMap;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTable;
/** test the scanner API at all levels */ /** test the scanner API at all levels */
public class TestScannerAPI extends HBaseClusterTestCase { public class TestScannerAPI extends HBaseClusterTestCase {

View File

@ -22,6 +22,8 @@ import org.apache.hadoop.io.Text;
import java.io.IOException; import java.io.IOException;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;
import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.client.HTable;
/** Tests table creation restrictions*/ /** Tests table creation restrictions*/
public class TestTable extends HBaseClusterTestCase { public class TestTable extends HBaseClusterTestCase {

View File

@ -26,6 +26,8 @@ import org.apache.hadoop.dfs.MiniDFSCluster;
import org.apache.hadoop.hbase.HColumnDescriptor.CompressionType; import org.apache.hadoop.hbase.HColumnDescriptor.CompressionType;
import org.apache.hadoop.hbase.util.Writables; import org.apache.hadoop.hbase.util.Writables;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.client.HBaseAdmin;
/** /**
* Tests user specifiable time stamps putting, getting and scanning. Also * Tests user specifiable time stamps putting, getting and scanning. Also

View File

@ -17,13 +17,19 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.hadoop.hbase; package org.apache.hadoop.hbase.client;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.util.Map; import java.util.Map;
import java.util.TreeMap; import java.util.TreeMap;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.HBaseClusterTestCase;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HScannerInterface;
import org.apache.hadoop.hbase.HStoreKey;
import org.apache.hadoop.hbase.HColumnDescriptor;
/** /**
* Test batch updates * Test batch updates

View File

@ -17,7 +17,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.hadoop.hbase; package org.apache.hadoop.hbase.client;
import java.io.IOException; import java.io.IOException;
import java.util.Map; import java.util.Map;
@ -27,7 +27,13 @@ import org.apache.hadoop.io.Text;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.HBaseClusterTestCase;
import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.TableNotFoundException;
import org.apache.hadoop.hbase.HScannerInterface;
import org.apache.hadoop.hbase.HStoreKey;
/** /**
* Tests HTable * Tests HTable

View File

@ -17,11 +17,15 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.hadoop.hbase; package org.apache.hadoop.hbase.client;
import java.io.IOException; import java.io.IOException;
import java.util.Arrays; import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import org.apache.hadoop.hbase.HBaseClusterTestCase;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HConstants;
/** /**
* Tests the listTables client API * Tests the listTables client API

View File

@ -17,9 +17,12 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
package org.apache.hadoop.hbase; package org.apache.hadoop.hbase.client;
import org.apache.hadoop.io.Text; import org.apache.hadoop.io.Text;
import org.apache.hadoop.hbase.HBaseClusterTestCase;
import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.HColumnDescriptor;
/** /**
* Tests that HClient protects against multiple updates * Tests that HClient protects against multiple updates

View File

@ -28,7 +28,7 @@ import java.io.Writer;
import org.apache.commons.logging.Log; import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HBaseClusterTestCase; import org.apache.hadoop.hbase.HBaseClusterTestCase;
import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
@ -173,4 +173,4 @@ public class TestHQL extends HBaseClusterTestCase {
new String(this.baos.toByteArray(), HConstants.UTF8_ENCODING)); new String(this.baos.toByteArray(), HConstants.UTF8_ENCODING));
this.baos.reset(); this.baos.reset();
} }
} }

View File

@ -34,13 +34,13 @@ import org.apache.hadoop.dfs.MiniDFSCluster;
import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HRegion; import org.apache.hadoop.hbase.HRegion;
import org.apache.hadoop.hbase.HScannerInterface; import org.apache.hadoop.hbase.HScannerInterface;
import org.apache.hadoop.hbase.HStoreKey; import org.apache.hadoop.hbase.HStoreKey;
import org.apache.hadoop.hbase.HTable; import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.MiniHBaseCluster;
import org.apache.hadoop.hbase.MultiRegionTable; import org.apache.hadoop.hbase.MultiRegionTable;
@ -326,4 +326,4 @@ public class TestTableIndex extends MultiRegionTable {
public static void main(@SuppressWarnings("unused") String[] args) { public static void main(@SuppressWarnings("unused") String[] args) {
TestRunner.run(new TestSuite(TestTableIndex.class)); TestRunner.run(new TestSuite(TestTableIndex.class));
} }
} }

View File

@ -28,12 +28,12 @@ import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory; import org.apache.commons.logging.LogFactory;
import org.apache.hadoop.dfs.MiniDFSCluster; import org.apache.hadoop.dfs.MiniDFSCluster;
import org.apache.hadoop.fs.Path; import org.apache.hadoop.fs.Path;
import org.apache.hadoop.hbase.HBaseAdmin; import org.apache.hadoop.hbase.client.HBaseAdmin;
import org.apache.hadoop.hbase.HColumnDescriptor; import org.apache.hadoop.hbase.HColumnDescriptor;
import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.HConstants;
import org.apache.hadoop.hbase.HScannerInterface; import org.apache.hadoop.hbase.HScannerInterface;
import org.apache.hadoop.hbase.HStoreKey; import org.apache.hadoop.hbase.HStoreKey;
import org.apache.hadoop.hbase.HTable; import org.apache.hadoop.hbase.client.HTable;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.MiniHBaseCluster; import org.apache.hadoop.hbase.MiniHBaseCluster;
import org.apache.hadoop.hbase.MultiRegionTable; import org.apache.hadoop.hbase.MultiRegionTable;
@ -429,4 +429,4 @@ public class TestTableMapReduce extends MultiRegionTable {
scanner.close(); scanner.close();
} }
} }
} }

View File

@ -61,4 +61,4 @@ public class OOMEHMaster extends HMaster {
public static void main(String[] args) { public static void main(String[] args) {
doMain(args, OOMEHMaster.class); doMain(args, OOMEHMaster.class);
} }
} }

View File

@ -5,7 +5,7 @@
import="org.apache.hadoop.hbase.master.HMaster" import="org.apache.hadoop.hbase.master.HMaster"
import="org.apache.hadoop.hbase.HConstants" import="org.apache.hadoop.hbase.HConstants"
import="org.apache.hadoop.hbase.master.MetaRegion" import="org.apache.hadoop.hbase.master.MetaRegion"
import="org.apache.hadoop.hbase.HBaseAdmin" import="org.apache.hadoop.hbase.client.HBaseAdmin"
import="org.apache.hadoop.hbase.HServerInfo" import="org.apache.hadoop.hbase.HServerInfo"
import="org.apache.hadoop.hbase.HServerAddress" import="org.apache.hadoop.hbase.HServerAddress"
import="org.apache.hadoop.hbase.HBaseConfiguration" import="org.apache.hadoop.hbase.HBaseConfiguration"