org.apache.hadoop.hbase.coprocessor.ObserverContext



API Populatity

3 Client projects

Project: org.apache

Project forcedotcom/phoenix in file ...ce.phoenix.coprocessor.MetaDataRegionObserver.java (2013-10-04)
@@ -27,7 +27,9 @@
  ******************************************************************************/
 package com.salesforce.phoenix.coprocessor;
 
-import org.apache.hadoop.hbase.coprocessor.*;
+import org.apache.hadoop.hbase.coprocessor.BaseRegionObserver;
+import org.apache.hadoop.hbase.coprocessor.ObserverContext;
+import org.apache.hadoop.hbase.coprocessor.RegionCoprocessorEnvironment;
 
 import com.salesforce.phoenix.cache.GlobalCache;
 
@@ -41,6 +43,6 @@ public class MetaDataRegionObserver extends BaseRegionObserver {
     @Override
     public void preClose(final ObserverContext<RegionCoprocessorEnvironment> c,
             boolean abortRequested) {
-        GlobalCache.getInstance(c.getEnvironment().getConfiguration()).getMetaDataCache().clear();
+        GlobalCache.getInstance(c.getEnvironment()).getMetaDataCache().clear();
     }
 }
Project apache/hbase in file ...ava.org.apache.hadoop.hbase.client.HBaseAdmin.java (2011-10-13)
@@ -54,7 +54,6 @@ import org.apache.hadoop.hbase.ZooKeeperConnectionException;
 import org.apache.hadoop.hbase.catalog.CatalogTracker;
 import org.apache.hadoop.hbase.catalog.MetaReader;
 import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitor;
-import org.apache.hadoop.hbase.coprocessor.ObserverContext;
 import org.apache.hadoop.hbase.ipc.HMasterInterface;
 import org.apache.hadoop.hbase.ipc.HRegionInterface;
 import org.apache.hadoop.hbase.regionserver.wal.FailedLogCloseException;
@@ -138,7 +137,6 @@ public class HBaseAdmin implements Abortable, Closeable {
     CatalogTracker ct = null;
     try {
       ct = new CatalogTracker(this.conf);
-
       ct.start();
     } catch (InterruptedException e) {
       // Let it out as an IOE for now until we redo all so tolerate IEs
@@ -1597,19 +1595,19 @@ public class HBaseAdmin implements Abortable, Closeable {
    * get the regions of a given table.
    *
    * @param tableName the name of the table
-   * @return Ordered list of {@link HRegionInfo}.   * 
+   * @return Ordered list of {@link HRegionInfo}.
    * @throws IOException
    */  
   public List<HRegionInfo> getTableRegions(final byte[] tableName)
   throws IOException {
     CatalogTracker ct = getCatalogTracker();
-    List<HRegionInfo> Regions;
+    List<HRegionInfo> Regions = null;
     try {
       Regions = MetaReader.getTableRegions(ct, tableName, true);
     } finally {
       cleanupCatalogTracker(ct);
     }
-    return Regions;	  
+    return Regions;
   }
   
   public void close() throws IOException {
Project apache/hbase in file ...ava.org.apache.hadoop.hbase.client.HBaseAdmin.java (2011-09-16)
@@ -54,6 +54,7 @@ import org.apache.hadoop.hbase.ZooKeeperConnectionException;
 import org.apache.hadoop.hbase.catalog.CatalogTracker;
 import org.apache.hadoop.hbase.catalog.MetaReader;
 import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitor;
+import org.apache.hadoop.hbase.coprocessor.ObserverContext;
 import org.apache.hadoop.hbase.ipc.HMasterInterface;
 import org.apache.hadoop.hbase.ipc.HRegionInterface;
 import org.apache.hadoop.hbase.regionserver.wal.FailedLogCloseException;
@@ -1303,16 +1304,32 @@ public class HBaseAdmin implements Abortable, Closeable {
   }
 
   /**
-   * @param regionName Region name to assign.
-   * @param force True to force assign.
+   * @param regionName
+   *          Region name to assign.
+   * @param force
+   *          True to force assign.
    * @throws MasterNotRunningException
    * @throws ZooKeeperConnectionException
    * @throws IOException
+   * @deprecated The <code>force</code> is unused.Use {@link #assign(byte[])}
    */
-  public void assign(final byte [] regionName, final boolean force)
-  throws MasterNotRunningException, ZooKeeperConnectionException, IOException {
+  public void assign(final byte[] regionName, final boolean force)
+      throws MasterNotRunningException, ZooKeeperConnectionException,
+      IOException {
     getMaster().assign(regionName, force);
   }
+  
+  /**
+   * @param regionName
+   *          Region name to assign.
+   * @throws MasterNotRunningException
+   * @throws ZooKeeperConnectionException
+   * @throws IOException
+   */
+  public void assign(final byte[] regionName) throws MasterNotRunningException,
+      ZooKeeperConnectionException, IOException {
+    getMaster().assign(regionName);
+  }
 
   /**
    * Unassign a region from current hosting regionserver.  Region will then be