hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r1091655 [2/2] - in /hbase/trunk: ./ src/main/java/org/apache/hadoop/hbase/coprocessor/ src/main/java/org/apache/hadoop/hbase/master/ src/main/java/org/apache/hadoop/hbase/regionserver/ src/main/java/org/apache/hadoop/hbase/regionserver/wal...
Date Wed, 13 Apr 2011 05:41:26 GMT
Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java?rev=1091655&r1=1091654&r2=1091655&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java Wed Apr 13 05:41:25 2011
@@ -173,10 +173,12 @@ public class RegionCoprocessorHost
    */
   public void preOpen() {
     loadTableCoprocessors();
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).preOpen(env);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).preOpen(ctx);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -187,10 +189,12 @@ public class RegionCoprocessorHost
    * Invoked after a region open
    */
   public void postOpen() {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).postOpen(env);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).postOpen(ctx);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -202,9 +206,11 @@ public class RegionCoprocessorHost
    * @param abortRequested true if the server is aborting
    */
   public void preClose(boolean abortRequested) {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).preClose(env, abortRequested);
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).preClose(ctx, abortRequested);
       }
     }
   }
@@ -214,9 +220,11 @@ public class RegionCoprocessorHost
    * @param abortRequested true if the server is aborting
    */
   public void postClose(boolean abortRequested) {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).postClose(env, abortRequested);
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).postClose(ctx, abortRequested);
       }
       shutdown(env);
     }
@@ -227,10 +235,12 @@ public class RegionCoprocessorHost
    * @param willSplit true if the compaction is about to trigger a split
    */
   public void preCompact(boolean willSplit) {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).preCompact(env, willSplit);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).preCompact(ctx, willSplit);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -242,10 +252,12 @@ public class RegionCoprocessorHost
    * @param willSplit true if the compaction is about to trigger a split
    */
   public void postCompact(boolean willSplit) {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).postCompact(env, willSplit);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).postCompact(ctx, willSplit);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -256,10 +268,12 @@ public class RegionCoprocessorHost
    * Invoked before a memstore flush
    */
   public void preFlush() {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).preFlush(env);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).preFlush(ctx);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -270,10 +284,12 @@ public class RegionCoprocessorHost
    * Invoked after a memstore flush
    */
   public void postFlush() {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).postFlush(env);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).postFlush(ctx);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -284,10 +300,12 @@ public class RegionCoprocessorHost
    * Invoked just before a split
    */
   public void preSplit() {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).preSplit(env);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).preSplit(ctx);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -300,10 +318,12 @@ public class RegionCoprocessorHost
    * @param r the new right-hand daughter region
    */
   public void postSplit(HRegion l, HRegion r) {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).postSplit(env, l, r);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).postSplit(ctx, l, r);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -322,12 +342,14 @@ public class RegionCoprocessorHost
   public boolean preGetClosestRowBefore(final byte[] row, final byte[] family,
       final Result result) throws IOException {
     boolean bypass = false;
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).preGetClosestRowBefore(env, row, family,
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).preGetClosestRowBefore(ctx, row, family,
           result);
-        bypass |= env.shouldBypass();
-        if (env.shouldComplete()) {
+        bypass |= ctx.shouldBypass();
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -343,11 +365,13 @@ public class RegionCoprocessorHost
    */
   public void postGetClosestRowBefore(final byte[] row, final byte[] family,
       final Result result) throws IOException {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).postGetClosestRowBefore(env, row, family,
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).postGetClosestRowBefore(ctx, row, family,
           result);
-        if (env.shouldComplete()) {
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -362,11 +386,13 @@ public class RegionCoprocessorHost
   public boolean preGet(final Get get, final List<KeyValue> results)
       throws IOException {
     boolean bypass = false;
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).preGet(env, get, results);
-        bypass |= env.shouldBypass();
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).preGet(ctx, get, results);
+        bypass |= ctx.shouldBypass();
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -382,10 +408,12 @@ public class RegionCoprocessorHost
    */
   public void postGet(final Get get, final List<KeyValue> results)
   throws IOException {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).postGet(env, get, results);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).postGet(ctx, get, results);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -401,11 +429,13 @@ public class RegionCoprocessorHost
   public Boolean preExists(final Get get) throws IOException {
     boolean bypass = false;
     boolean exists = false;
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        exists = ((RegionObserver)env.getInstance()).preExists(env, get, exists);
-        bypass |= env.shouldBypass();
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        exists = ((RegionObserver)env.getInstance()).preExists(ctx, get, exists);
+        bypass |= ctx.shouldBypass();
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -421,10 +451,12 @@ public class RegionCoprocessorHost
    */
   public boolean postExists(final Get get, boolean exists)
       throws IOException {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        exists = ((RegionObserver)env.getInstance()).postExists(env, get, exists);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        exists = ((RegionObserver)env.getInstance()).postExists(ctx, get, exists);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -441,11 +473,13 @@ public class RegionCoprocessorHost
   public boolean prePut(final Map<byte[], List<KeyValue>> familyMap,
       final boolean writeToWAL) throws IOException {
     boolean bypass = false;
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).prePut(env, familyMap, writeToWAL);
-        bypass |= env.shouldBypass();
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).prePut(ctx, familyMap, writeToWAL);
+        bypass |= ctx.shouldBypass();
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -460,10 +494,12 @@ public class RegionCoprocessorHost
    */
   public void postPut(final Map<byte[], List<KeyValue>> familyMap,
       final boolean writeToWAL) throws IOException {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).postPut(env, familyMap, writeToWAL);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).postPut(ctx, familyMap, writeToWAL);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -479,11 +515,13 @@ public class RegionCoprocessorHost
   public boolean preDelete(final Map<byte[], List<KeyValue>> familyMap,
       final boolean writeToWAL) throws IOException {
     boolean bypass = false;
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).preDelete(env, familyMap, writeToWAL);
-        bypass |= env.shouldBypass();
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).preDelete(ctx, familyMap, writeToWAL);
+        bypass |= ctx.shouldBypass();
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -498,10 +536,12 @@ public class RegionCoprocessorHost
    */
   public void postDelete(final Map<byte[], List<KeyValue>> familyMap,
       final boolean writeToWAL) throws IOException {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).postDelete(env, familyMap, writeToWAL);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).postDelete(ctx, familyMap, writeToWAL);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -525,12 +565,14 @@ public class RegionCoprocessorHost
     throws IOException {
     boolean bypass = false;
     boolean result = false;
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        result = ((RegionObserver)env.getInstance()).preCheckAndPut(env, row, family,
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        result = ((RegionObserver)env.getInstance()).preCheckAndPut(ctx, row, family,
           qualifier, compareOp, comparator, put, result);
-        bypass |= env.shouldBypass();
-        if (env.shouldComplete()) {
+        bypass |= ctx.shouldBypass();
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -552,11 +594,13 @@ public class RegionCoprocessorHost
       final WritableByteArrayComparable comparator, final Put put,
       boolean result)
     throws IOException {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        result = ((RegionObserver)env.getInstance()).postCheckAndPut(env, row,
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        result = ((RegionObserver)env.getInstance()).postCheckAndPut(ctx, row,
           family, qualifier, compareOp, comparator, put, result);
-        if (env.shouldComplete()) {
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -581,12 +625,14 @@ public class RegionCoprocessorHost
       throws IOException {
     boolean bypass = false;
     boolean result = false;
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        result = ((RegionObserver)env.getInstance()).preCheckAndDelete(env, row,
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        result = ((RegionObserver)env.getInstance()).preCheckAndDelete(ctx, row,
           family, qualifier, compareOp, comparator, delete, result);
-        bypass |= env.shouldBypass();
-        if (env.shouldComplete()) {
+        bypass |= ctx.shouldBypass();
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -608,12 +654,14 @@ public class RegionCoprocessorHost
       final WritableByteArrayComparable comparator, final Delete delete,
       boolean result)
     throws IOException {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
         result = ((RegionObserver)env.getInstance())
-          .postCheckAndDelete(env, row, family, qualifier, compareOp,
+          .postCheckAndDelete(ctx, row, family, qualifier, compareOp,
             comparator, delete, result);
-        if (env.shouldComplete()) {
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -635,12 +683,14 @@ public class RegionCoprocessorHost
       final byte [] qualifier, long amount, final boolean writeToWAL)
       throws IOException {
     boolean bypass = false;
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        amount = ((RegionObserver)env.getInstance()).preIncrementColumnValue(env,
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        amount = ((RegionObserver)env.getInstance()).preIncrementColumnValue(ctx,
             row, family, qualifier, amount, writeToWAL);
-        bypass |= env.shouldBypass();
-        if (env.shouldComplete()) {
+        bypass |= ctx.shouldBypass();
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -661,11 +711,13 @@ public class RegionCoprocessorHost
   public long postIncrementColumnValue(final byte [] row, final byte [] family,
       final byte [] qualifier, final long amount, final boolean writeToWAL,
       long result) throws IOException {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        result = ((RegionObserver)env.getInstance()).postIncrementColumnValue(env,
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        result = ((RegionObserver)env.getInstance()).postIncrementColumnValue(ctx,
             row, family, qualifier, amount, writeToWAL, result);
-        if (env.shouldComplete()) {
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -683,11 +735,13 @@ public class RegionCoprocessorHost
       throws IOException {
     boolean bypass = false;
     Result result = new Result();
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).preIncrement(env, increment, result);
-        bypass |= env.shouldBypass();
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).preIncrement(ctx, increment, result);
+        bypass |= ctx.shouldBypass();
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -702,10 +756,12 @@ public class RegionCoprocessorHost
    */
   public void postIncrement(final Increment increment, Result result)
       throws IOException {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).postIncrement(env, increment, result);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).postIncrement(ctx, increment, result);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -721,11 +777,13 @@ public class RegionCoprocessorHost
   public InternalScanner preScannerOpen(Scan scan) throws IOException {
     boolean bypass = false;
     InternalScanner s = null;
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        s = ((RegionObserver)env.getInstance()).preScannerOpen(env, scan, s);
-        bypass |= env.shouldBypass();
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        s = ((RegionObserver)env.getInstance()).preScannerOpen(ctx, scan, s);
+        bypass |= ctx.shouldBypass();
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -741,10 +799,12 @@ public class RegionCoprocessorHost
    */
   public InternalScanner postScannerOpen(final Scan scan, InternalScanner s)
       throws IOException {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        s = ((RegionObserver)env.getInstance()).postScannerOpen(env, scan, s);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        s = ((RegionObserver)env.getInstance()).postScannerOpen(ctx, scan, s);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -764,12 +824,14 @@ public class RegionCoprocessorHost
       final List<Result> results, int limit) throws IOException {
     boolean bypass = false;
     boolean hasNext = false;
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        hasNext = ((RegionObserver)env.getInstance()).preScannerNext(env, s, results,
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        hasNext = ((RegionObserver)env.getInstance()).preScannerNext(ctx, s, results,
           limit, hasNext);
-        bypass |= env.shouldBypass();
-        if (env.shouldComplete()) {
+        bypass |= ctx.shouldBypass();
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -788,11 +850,13 @@ public class RegionCoprocessorHost
   public boolean postScannerNext(final InternalScanner s,
       final List<Result> results, final int limit, boolean hasMore)
       throws IOException {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        hasMore = ((RegionObserver)env.getInstance()).postScannerNext(env, s,
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        hasMore = ((RegionObserver)env.getInstance()).postScannerNext(ctx, s,
           results, limit, hasMore);
-        if (env.shouldComplete()) {
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -808,11 +872,13 @@ public class RegionCoprocessorHost
   public boolean preScannerClose(final InternalScanner s)
       throws IOException {
     boolean bypass = false;
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).preScannerClose(env, s);
-        bypass |= env.shouldBypass();
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).preScannerClose(ctx, s);
+        bypass |= ctx.shouldBypass();
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -826,10 +892,12 @@ public class RegionCoprocessorHost
    */
   public void postScannerClose(final InternalScanner s)
       throws IOException {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).postScannerClose(env, s);
-        if (env.shouldComplete()) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).postScannerClose(ctx, s);
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -846,13 +914,15 @@ public class RegionCoprocessorHost
   public boolean preWALRestore(HRegionInfo info, HLogKey logKey,
       WALEdit logEdit) throws IOException {
     boolean bypass = false;
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).preWALRestore(env, info, logKey,
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).preWALRestore(ctx, info, logKey,
             logEdit);
       }
-      bypass |= env.shouldBypass();
-      if (env.shouldComplete()) {
+      bypass |= ctx.shouldBypass();
+      if (ctx.shouldComplete()) {
         break;
       }
     }
@@ -867,12 +937,14 @@ public class RegionCoprocessorHost
    */
   public void postWALRestore(HRegionInfo info, HLogKey logKey,
       WALEdit logEdit) throws IOException {
+    ObserverContext<RegionCoprocessorEnvironment> ctx = null;
     for (RegionEnvironment env: coprocessors) {
       if (env.getInstance() instanceof RegionObserver) {
-        ((RegionObserver)env.getInstance()).postWALRestore(env, info,
+        ctx = ObserverContext.createAndPrepare(env, ctx);
+        ((RegionObserver)env.getInstance()).postWALRestore(ctx, info,
             logKey, logEdit);
       }
-      if (env.shouldComplete()) {
+      if (ctx.shouldComplete()) {
         break;
       }
     }

Modified: hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALCoprocessorHost.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALCoprocessorHost.java?rev=1091655&r1=1091654&r2=1091655&view=diff
==============================================================================
--- hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALCoprocessorHost.java (original)
+++ hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/wal/WALCoprocessorHost.java Wed Apr 13 05:41:25 2011
@@ -65,8 +65,7 @@ public class WALCoprocessorHost
   HLog wal;
   /**
    * Constructor
-   * @param region the region
-   * @param rsServices interface to available region server functionality
+   * @param log the write ahead log
    * @param conf the configuration
    */
   public WALCoprocessorHost(final HLog log, final Configuration conf) {
@@ -92,13 +91,15 @@ public class WALCoprocessorHost
   public boolean preWALWrite(HRegionInfo info, HLogKey logKey, WALEdit logEdit)
       throws IOException {
     boolean bypass = false;
+    ObserverContext<WALCoprocessorEnvironment> ctx = null;
     for (WALEnvironment env: coprocessors) {
       if (env.getInstance() instanceof
           org.apache.hadoop.hbase.coprocessor.WALObserver) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
         ((org.apache.hadoop.hbase.coprocessor.WALObserver)env.getInstance()).
-            preWALWrite(env, info, logKey, logEdit);
-        bypass |= env.shouldBypass();
-        if (env.shouldComplete()) {
+            preWALWrite(ctx, info, logKey, logEdit);
+        bypass |= ctx.shouldBypass();
+        if (ctx.shouldComplete()) {
           break;
         }
       }
@@ -114,12 +115,14 @@ public class WALCoprocessorHost
    */
   public void postWALWrite(HRegionInfo info, HLogKey logKey, WALEdit logEdit)
       throws IOException {
+    ObserverContext<WALCoprocessorEnvironment> ctx = null;
     for (WALEnvironment env: coprocessors) {
       if (env.getInstance() instanceof
           org.apache.hadoop.hbase.coprocessor.WALObserver) {
+        ctx = ObserverContext.createAndPrepare(env, ctx);
         ((org.apache.hadoop.hbase.coprocessor.WALObserver)env.getInstance()).
-            postWALWrite(env, info, logKey, logEdit);
-        if (env.shouldComplete()) {
+            postWALWrite(ctx, info, logKey, logEdit);
+        if (ctx.shouldComplete()) {
           break;
         }
       }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/SampleRegionWALObserver.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/SampleRegionWALObserver.java?rev=1091655&r1=1091654&r2=1091655&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/SampleRegionWALObserver.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/SampleRegionWALObserver.java Wed Apr 13 05:41:25 2011
@@ -78,14 +78,14 @@ implements WALObserver {
 
 
   @Override
-  public void postWALWrite(CoprocessorEnvironment env, HRegionInfo info,
-      HLogKey logKey, WALEdit logEdit) throws IOException {
+  public void postWALWrite(ObserverContext<WALCoprocessorEnvironment> env,
+      HRegionInfo info, HLogKey logKey, WALEdit logEdit) throws IOException {
     postWALWriteCalled = true;
   }
 
   @Override
-  public boolean preWALWrite(CoprocessorEnvironment env, HRegionInfo info,
-      HLogKey logKey, WALEdit logEdit) throws IOException {
+  public boolean preWALWrite(ObserverContext<WALCoprocessorEnvironment> env,
+      HRegionInfo info, HLogKey logKey, WALEdit logEdit) throws IOException {
     boolean bypass = false;
     // check table name matches or not.
     if (!Arrays.equals(HRegionInfo.getTableName(info.getRegionName()), this.tableName)) {
@@ -125,8 +125,8 @@ implements WALObserver {
    * Restoreed.
    */
   @Override
-  public void preWALRestore(RegionCoprocessorEnvironment env, HRegionInfo info,
-      HLogKey logKey, WALEdit logEdit) throws IOException {
+  public void preWALRestore(ObserverContext<RegionCoprocessorEnvironment> env,
+      HRegionInfo info, HLogKey logKey, WALEdit logEdit) throws IOException {
     preWALRestoreCalled = true;
   }
 
@@ -135,7 +135,7 @@ implements WALObserver {
    * Restoreed.
    */
   @Override
-  public void postWALRestore(RegionCoprocessorEnvironment env,
+  public void postWALRestore(ObserverContext<RegionCoprocessorEnvironment> env,
       HRegionInfo info, HLogKey logKey, WALEdit logEdit) throws IOException {
     postWALRestoreCalled = true;
   }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java?rev=1091655&r1=1091654&r2=1091655&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java Wed Apr 13 05:41:25 2011
@@ -75,12 +75,12 @@ public class SimpleRegionObserver extend
   boolean hadPostScannerClose = false;
 
   @Override
-  public void preOpen(RegionCoprocessorEnvironment e) {
+  public void preOpen(ObserverContext<RegionCoprocessorEnvironment> c) {
     hadPreOpen = true;
   }
 
   @Override
-  public void postOpen(RegionCoprocessorEnvironment e) {
+  public void postOpen(ObserverContext<RegionCoprocessorEnvironment> c) {
     hadPostOpen = true;
   }
 
@@ -89,12 +89,12 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void preClose(RegionCoprocessorEnvironment e, boolean abortRequested) {
+  public void preClose(ObserverContext<RegionCoprocessorEnvironment> c, boolean abortRequested) {
     hadPreClose = true;
   }
 
   @Override
-  public void postClose(RegionCoprocessorEnvironment e, boolean abortRequested) {
+  public void postClose(ObserverContext<RegionCoprocessorEnvironment> c, boolean abortRequested) {
     hadPostClose = true;
   }
 
@@ -103,12 +103,12 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void preFlush(RegionCoprocessorEnvironment e) {
+  public void preFlush(ObserverContext<RegionCoprocessorEnvironment> c) {
     hadPreFlush = true;
   }
 
   @Override
-  public void postFlush(RegionCoprocessorEnvironment e) {
+  public void postFlush(ObserverContext<RegionCoprocessorEnvironment> c) {
     hadPostFlush = true;
   }
 
@@ -117,12 +117,12 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void preSplit(RegionCoprocessorEnvironment e) {
+  public void preSplit(ObserverContext<RegionCoprocessorEnvironment> c) {
     hadPreSplit = true;
   }
 
   @Override
-  public void postSplit(RegionCoprocessorEnvironment e, HRegion l, HRegion r) {
+  public void postSplit(ObserverContext<RegionCoprocessorEnvironment> c, HRegion l, HRegion r) {
     hadPostSplit = true;
   }
 
@@ -131,18 +131,18 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void preCompact(RegionCoprocessorEnvironment e, boolean willSplit) {
+  public void preCompact(ObserverContext<RegionCoprocessorEnvironment> c, boolean willSplit) {
     hadPreCompact = true;
   }
 
   @Override
-  public void postCompact(RegionCoprocessorEnvironment e, boolean willSplit) {
+  public void postCompact(ObserverContext<RegionCoprocessorEnvironment> c, boolean willSplit) {
     hadPostCompact = true;
   }
 
 
   @Override
-  public boolean preScannerNext(final RegionCoprocessorEnvironment e,
+  public boolean preScannerNext(final ObserverContext<RegionCoprocessorEnvironment> c,
       final InternalScanner s, final List<Result> results,
       final int limit, final boolean hasMore) throws IOException {
     hadPreScannerNext = true;
@@ -150,7 +150,7 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public boolean postScannerNext(final RegionCoprocessorEnvironment e,
+  public boolean postScannerNext(final ObserverContext<RegionCoprocessorEnvironment> c,
       final InternalScanner s, final List<Result> results, final int limit,
       final boolean hasMore) throws IOException {
     hadPostScannerNext = true;
@@ -158,13 +158,13 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void preScannerClose(final RegionCoprocessorEnvironment e,
+  public void preScannerClose(final ObserverContext<RegionCoprocessorEnvironment> c,
       final InternalScanner s) throws IOException {
     hadPreScannerClose = true;
   }
 
   @Override
-  public void postScannerClose(final RegionCoprocessorEnvironment e,
+  public void postScannerClose(final ObserverContext<RegionCoprocessorEnvironment> c,
       final InternalScanner s) throws IOException {
     hadPostScannerClose = true;
   }
@@ -174,8 +174,9 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void preGet(final RegionCoprocessorEnvironment e, final Get get,
+  public void preGet(final ObserverContext<RegionCoprocessorEnvironment> c, final Get get,
       final List<KeyValue> results) throws IOException {
+    RegionCoprocessorEnvironment e = c.getEnvironment();
     assertNotNull(e);
     assertNotNull(e.getRegion());
     assertNotNull(get);
@@ -184,8 +185,9 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void postGet(final RegionCoprocessorEnvironment e, final Get get,
+  public void postGet(final ObserverContext<RegionCoprocessorEnvironment> c, final Get get,
       final List<KeyValue> results) {
+    RegionCoprocessorEnvironment e = c.getEnvironment();
     assertNotNull(e);
     assertNotNull(e.getRegion());
     assertNotNull(get);
@@ -214,8 +216,9 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void prePut(final RegionCoprocessorEnvironment e, final Map<byte[],
+  public void prePut(final ObserverContext<RegionCoprocessorEnvironment> c, final Map<byte[],
       List<KeyValue>> familyMap, final boolean writeToWAL) throws IOException {
+    RegionCoprocessorEnvironment e = c.getEnvironment();
     assertNotNull(e);
     assertNotNull(e.getRegion());
     assertNotNull(familyMap);
@@ -241,8 +244,9 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void postPut(final RegionCoprocessorEnvironment e, final Map<byte[],
+  public void postPut(final ObserverContext<RegionCoprocessorEnvironment> c, final Map<byte[],
       List<KeyValue>> familyMap, final boolean writeToWAL) throws IOException {
+    RegionCoprocessorEnvironment e = c.getEnvironment();
     assertNotNull(e);
     assertNotNull(e.getRegion());
     assertNotNull(familyMap);
@@ -268,8 +272,9 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void preDelete(final RegionCoprocessorEnvironment e, final Map<byte[],
+  public void preDelete(final ObserverContext<RegionCoprocessorEnvironment> c, final Map<byte[],
       List<KeyValue>> familyMap, final boolean writeToWAL) throws IOException {
+    RegionCoprocessorEnvironment e = c.getEnvironment();
     assertNotNull(e);
     assertNotNull(e.getRegion());
     assertNotNull(familyMap);
@@ -279,8 +284,9 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void postDelete(final RegionCoprocessorEnvironment e, final Map<byte[],
+  public void postDelete(final ObserverContext<RegionCoprocessorEnvironment> c, final Map<byte[],
       List<KeyValue>> familyMap, final boolean writeToWAL) throws IOException {
+    RegionCoprocessorEnvironment e = c.getEnvironment();
     assertNotNull(e);
     assertNotNull(e.getRegion());
     assertNotNull(familyMap);
@@ -289,9 +295,10 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void preGetClosestRowBefore(final RegionCoprocessorEnvironment e,
+  public void preGetClosestRowBefore(final ObserverContext<RegionCoprocessorEnvironment> c,
       final byte[] row, final byte[] family, final Result result)
       throws IOException {
+    RegionCoprocessorEnvironment e = c.getEnvironment();
     assertNotNull(e);
     assertNotNull(e.getRegion());
     assertNotNull(row);
@@ -302,9 +309,10 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void postGetClosestRowBefore(final RegionCoprocessorEnvironment e,
+  public void postGetClosestRowBefore(final ObserverContext<RegionCoprocessorEnvironment> c,
       final byte[] row, final byte[] family, final Result result)
       throws IOException {
+    RegionCoprocessorEnvironment e = c.getEnvironment();
     assertNotNull(e);
     assertNotNull(e.getRegion());
     assertNotNull(row);
@@ -313,13 +321,13 @@ public class SimpleRegionObserver extend
   }
 
   @Override
-  public void preIncrement(final RegionCoprocessorEnvironment e,
+  public void preIncrement(final ObserverContext<RegionCoprocessorEnvironment> c,
       final Increment increment, final Result result) throws IOException {
     hadPreIncrement = true;
   }
 
   @Override
-  public void postIncrement(final RegionCoprocessorEnvironment e,
+  public void postIncrement(final ObserverContext<RegionCoprocessorEnvironment> c,
       final Increment increment, final Result result) throws IOException {
     hadPostIncrement = true;
   }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java?rev=1091655&r1=1091654&r2=1091655&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java Wed Apr 13 05:41:25 2011
@@ -73,43 +73,43 @@ public class TestCoprocessorInterface ex
     }
 
     @Override
-    public void preOpen(RegionCoprocessorEnvironment e) {
+    public void preOpen(ObserverContext<RegionCoprocessorEnvironment> e) {
       preOpenCalled = true;
     }
     @Override
-    public void postOpen(RegionCoprocessorEnvironment e) {
+    public void postOpen(ObserverContext<RegionCoprocessorEnvironment> e) {
       postOpenCalled = true;
     }
     @Override
-    public void preClose(RegionCoprocessorEnvironment e, boolean abortRequested) {
+    public void preClose(ObserverContext<RegionCoprocessorEnvironment> e, boolean abortRequested) {
       preCloseCalled = true;
     }
     @Override
-    public void postClose(RegionCoprocessorEnvironment e, boolean abortRequested) {
+    public void postClose(ObserverContext<RegionCoprocessorEnvironment> e, boolean abortRequested) {
       postCloseCalled = true;
     }
     @Override
-    public void preCompact(RegionCoprocessorEnvironment e, boolean willSplit) {
+    public void preCompact(ObserverContext<RegionCoprocessorEnvironment> e, boolean willSplit) {
       preCompactCalled = true;
     }
     @Override
-    public void postCompact(RegionCoprocessorEnvironment e, boolean willSplit) {
+    public void postCompact(ObserverContext<RegionCoprocessorEnvironment> e, boolean willSplit) {
       postCompactCalled = true;
     }
     @Override
-    public void preFlush(RegionCoprocessorEnvironment e) {
+    public void preFlush(ObserverContext<RegionCoprocessorEnvironment> e) {
       preFlushCalled = true;
     }
     @Override
-    public void postFlush(RegionCoprocessorEnvironment e) {
+    public void postFlush(ObserverContext<RegionCoprocessorEnvironment> e) {
       postFlushCalled = true;
     }
     @Override
-    public void preSplit(RegionCoprocessorEnvironment e) {
+    public void preSplit(ObserverContext<RegionCoprocessorEnvironment> e) {
       preSplitCalled = true;
     }
     @Override
-    public void postSplit(RegionCoprocessorEnvironment e, HRegion l, HRegion r) {
+    public void postSplit(ObserverContext<RegionCoprocessorEnvironment> e, HRegion l, HRegion r) {
       postSplitCalled = true;
     }
 

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java?rev=1091655&r1=1091654&r2=1091655&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestMasterObserver.java Wed Apr 13 05:41:25 2011
@@ -88,13 +88,13 @@ public class TestMasterObserver {
     private boolean stopCalled;
 
     @Override
-    public void preCreateTable(MasterCoprocessorEnvironment env,
+    public void preCreateTable(ObserverContext<MasterCoprocessorEnvironment> env,
         HTableDescriptor desc, byte[][] splitKeys) throws IOException {
       preCreateTableCalled = true;
     }
 
     @Override
-    public void postCreateTable(MasterCoprocessorEnvironment env,
+    public void postCreateTable(ObserverContext<MasterCoprocessorEnvironment> env,
         HRegionInfo[] regions, boolean sync) throws IOException {
       postCreateTableCalled = true;
     }
@@ -104,13 +104,13 @@ public class TestMasterObserver {
     }
 
     @Override
-    public void preDeleteTable(MasterCoprocessorEnvironment env,
+    public void preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName) throws IOException {
       preDeleteTableCalled = true;
     }
 
     @Override
-    public void postDeleteTable(MasterCoprocessorEnvironment env,
+    public void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName) throws IOException {
       postDeleteTableCalled = true;
     }
@@ -120,13 +120,13 @@ public class TestMasterObserver {
     }
 
     @Override
-    public void preModifyTable(MasterCoprocessorEnvironment env,
+    public void preModifyTable(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName, HTableDescriptor htd) throws IOException {
       preModifyTableCalled = true;
     }
 
     @Override
-    public void postModifyTable(MasterCoprocessorEnvironment env,
+    public void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName, HTableDescriptor htd) throws IOException {
       postModifyTableCalled = true;
     }
@@ -136,13 +136,13 @@ public class TestMasterObserver {
     }
 
     @Override
-    public void preAddColumn(MasterCoprocessorEnvironment env,
+    public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName, HColumnDescriptor column) throws IOException {
       preAddColumnCalled = true;
     }
 
     @Override
-    public void postAddColumn(MasterCoprocessorEnvironment env,
+    public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName, HColumnDescriptor column) throws IOException {
       postAddColumnCalled = true;
     }
@@ -152,13 +152,13 @@ public class TestMasterObserver {
     }
 
     @Override
-    public void preModifyColumn(MasterCoprocessorEnvironment env,
+    public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName, HColumnDescriptor descriptor) throws IOException {
       preModifyColumnCalled = true;
     }
 
     @Override
-    public void postModifyColumn(MasterCoprocessorEnvironment env,
+    public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName, HColumnDescriptor descriptor) throws IOException {
       postModifyColumnCalled = true;
     }
@@ -168,13 +168,13 @@ public class TestMasterObserver {
     }
 
     @Override
-    public void preDeleteColumn(MasterCoprocessorEnvironment env,
+    public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName, byte[] c) throws IOException {
       preDeleteColumnCalled = true;
     }
 
     @Override
-    public void postDeleteColumn(MasterCoprocessorEnvironment env,
+    public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName, byte[] c) throws IOException {
       postDeleteColumnCalled = true;
     }
@@ -184,13 +184,13 @@ public class TestMasterObserver {
     }
 
     @Override
-    public void preEnableTable(MasterCoprocessorEnvironment env,
+    public void preEnableTable(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName) throws IOException {
       preEnableTableCalled = true;
     }
 
     @Override
-    public void postEnableTable(MasterCoprocessorEnvironment env,
+    public void postEnableTable(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName) throws IOException {
       postEnableTableCalled = true;
     }
@@ -200,13 +200,13 @@ public class TestMasterObserver {
     }
 
     @Override
-    public void preDisableTable(MasterCoprocessorEnvironment env,
+    public void preDisableTable(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName) throws IOException {
       preDisableTableCalled = true;
     }
 
     @Override
-    public void postDisableTable(MasterCoprocessorEnvironment env,
+    public void postDisableTable(ObserverContext<MasterCoprocessorEnvironment> env,
         byte[] tableName) throws IOException {
       postDisableTableCalled = true;
     }
@@ -216,14 +216,14 @@ public class TestMasterObserver {
     }
 
     @Override
-    public void preMove(MasterCoprocessorEnvironment env,
+    public void preMove(ObserverContext<MasterCoprocessorEnvironment> env,
         HRegionInfo region, HServerInfo srcServer, HServerInfo destServer)
     throws UnknownRegionException {
       preMoveCalled = true;
     }
 
     @Override
-    public void postMove(MasterCoprocessorEnvironment env, HRegionInfo region,
+    public void postMove(ObserverContext<MasterCoprocessorEnvironment> env, HRegionInfo region,
         HServerInfo srcServer, HServerInfo destServer)
     throws UnknownRegionException {
       postMoveCalled = true;
@@ -234,13 +234,13 @@ public class TestMasterObserver {
     }
 
     @Override
-    public void preAssign(MasterCoprocessorEnvironment env,
+    public void preAssign(ObserverContext<MasterCoprocessorEnvironment> env,
         final byte [] regionName, final boolean force) throws IOException {
       preAssignCalled = true;
     }
 
     @Override
-    public void postAssign(MasterCoprocessorEnvironment env,
+    public void postAssign(ObserverContext<MasterCoprocessorEnvironment> env,
         final HRegionInfo regionInfo) throws IOException {
       postAssignCalled = true;
     }
@@ -250,13 +250,13 @@ public class TestMasterObserver {
     }
 
     @Override
-    public void preUnassign(MasterCoprocessorEnvironment env,
+    public void preUnassign(ObserverContext<MasterCoprocessorEnvironment> env,
         final byte [] regionName, final boolean force) throws IOException {
       preUnassignCalled = true;
     }
 
     @Override
-    public void postUnassign(MasterCoprocessorEnvironment env,
+    public void postUnassign(ObserverContext<MasterCoprocessorEnvironment> env,
         final HRegionInfo regionInfo, final boolean force) throws IOException {
       postUnassignCalled = true;
     }
@@ -266,13 +266,13 @@ public class TestMasterObserver {
     }
 
     @Override
-    public void preBalance(MasterCoprocessorEnvironment env)
+    public void preBalance(ObserverContext<MasterCoprocessorEnvironment> env)
         throws IOException {
       preBalanceCalled = true;
     }
 
     @Override
-    public void postBalance(MasterCoprocessorEnvironment env)
+    public void postBalance(ObserverContext<MasterCoprocessorEnvironment> env)
         throws IOException {
       postBalanceCalled = true;
     }
@@ -282,14 +282,14 @@ public class TestMasterObserver {
     }
 
     @Override
-    public boolean preBalanceSwitch(MasterCoprocessorEnvironment env, boolean b)
+    public boolean preBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> env, boolean b)
         throws IOException {
       preBalanceSwitchCalled = true;
       return b;
     }
 
     @Override
-    public void postBalanceSwitch(MasterCoprocessorEnvironment env,
+    public void postBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> env,
         boolean oldValue, boolean newValue) throws IOException {
       postBalanceSwitchCalled = true;
     }
@@ -299,13 +299,13 @@ public class TestMasterObserver {
     }
 
     @Override
-    public void preShutdown(MasterCoprocessorEnvironment env)
+    public void preShutdown(ObserverContext<MasterCoprocessorEnvironment> env)
         throws IOException {
       preShutdownCalled = true;
     }
 
     @Override
-    public void preStopMaster(MasterCoprocessorEnvironment env)
+    public void preStopMaster(ObserverContext<MasterCoprocessorEnvironment> env)
         throws IOException {
       preStopMasterCalled = true;
     }

Modified: hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverStacking.java
URL: http://svn.apache.org/viewvc/hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverStacking.java?rev=1091655&r1=1091654&r2=1091655&view=diff
==============================================================================
--- hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverStacking.java (original)
+++ hbase/trunk/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverStacking.java Wed Apr 13 05:41:25 2011
@@ -45,8 +45,8 @@ public class TestRegionObserverStacking 
   public static class ObserverA extends BaseRegionObserverCoprocessor {
     long id;
     @Override
-    public void postPut(final RegionCoprocessorEnvironment e, final Map<byte[],
-        List<KeyValue>> familyMap, final boolean writeToWAL)
+    public void postPut(final ObserverContext<RegionCoprocessorEnvironment> c,
+        final Map<byte[], List<KeyValue>> familyMap, final boolean writeToWAL)
         throws IOException {
       id = System.currentTimeMillis();
       try {
@@ -59,8 +59,8 @@ public class TestRegionObserverStacking 
   public static class ObserverB extends BaseRegionObserverCoprocessor {
     long id;
     @Override
-    public void postPut(final RegionCoprocessorEnvironment e, final Map<byte[],
-        List<KeyValue>> familyMap, final boolean writeToWAL)
+    public void postPut(final ObserverContext<RegionCoprocessorEnvironment> c,
+        final Map<byte[], List<KeyValue>> familyMap, final boolean writeToWAL)
         throws IOException {
       id = System.currentTimeMillis();
       try {
@@ -74,8 +74,8 @@ public class TestRegionObserverStacking 
     long id;
 
     @Override
-    public void postPut(final RegionCoprocessorEnvironment e, final Map<byte[],
-        List<KeyValue>> familyMap, final boolean writeToWAL)
+    public void postPut(final ObserverContext<RegionCoprocessorEnvironment> c,
+        final Map<byte[], List<KeyValue>> familyMap, final boolean writeToWAL)
         throws IOException {
       id = System.currentTimeMillis();
       try {



Mime
View raw message