From fd470dbf23867dcbd978353453007a89e29173f5 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Mon, 25 Apr 2011 19:21:17 +0000 Subject: [PATCH] HBASE-3812 Tidy up naming consistency and documentation in coprocessor framework git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1096568 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES.txt | 2 + .../hbase/coprocessor/BaseMasterObserver.java | 60 ++++++++-------- ...processor.java => BaseRegionObserver.java} | 10 +-- .../hbase/coprocessor/RegionObserver.java | 68 +++++++++---------- .../coprocessor/SampleRegionWALObserver.java | 11 ++- .../coprocessor/SimpleRegionObserver.java | 2 +- .../coprocessor/TestCoprocessorInterface.java | 2 +- .../TestRegionObserverStacking.java | 6 +- ...Coprocessors.java => TestWALObserver.java} | 14 ++-- 9 files changed, 88 insertions(+), 87 deletions(-) rename src/main/java/org/apache/hadoop/hbase/coprocessor/{BaseRegionObserverCoprocessor.java => BaseRegionObserver.java} (96%) rename src/test/java/org/apache/hadoop/hbase/coprocessor/{TestWALCoprocessors.java => TestWALObserver.java} (96%) diff --git a/CHANGES.txt b/CHANGES.txt index 1b06c53586c..50ae9659db3 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -183,6 +183,8 @@ Release 0.91.0 - Unreleased HBASE-3609 Improve the selection of regions to balance; part 2 (Ted Yu) HBASE-2939 Allow Client-Side Connection Pooling (Karthik Sankarachary) HBASE-3798 [REST] Allow representation to elide row key and column key + HBASE-3812 Tidy up naming consistency and documentation in coprocessor + framework (Mingjie Lai) TASKS HBASE-3559 Move report of split to master OFF the heartbeat channel diff --git a/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java b/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java index 8df6aa4b171..4097c6f3929 100644 --- a/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java +++ b/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseMasterObserver.java @@ -30,153 +30,153 @@ import java.io.IOException; public class BaseMasterObserver implements MasterObserver { @Override - public void preCreateTable(ObserverContext env, + public void preCreateTable(ObserverContext ctx, HTableDescriptor desc, byte[][] splitKeys) throws IOException { } @Override - public void postCreateTable(ObserverContext env, + public void postCreateTable(ObserverContext ctx, HRegionInfo[] regions, boolean sync) throws IOException { } @Override - public void preDeleteTable(ObserverContext env, + public void preDeleteTable(ObserverContext ctx, byte[] tableName) throws IOException { } @Override - public void postDeleteTable(ObserverContext env, + public void postDeleteTable(ObserverContext ctx, byte[] tableName) throws IOException { } @Override - public void preModifyTable(ObserverContext env, + public void preModifyTable(ObserverContext ctx, byte[] tableName, HTableDescriptor htd) throws IOException { } @Override - public void postModifyTable(ObserverContext env, + public void postModifyTable(ObserverContext ctx, byte[] tableName, HTableDescriptor htd) throws IOException { } @Override - public void preAddColumn(ObserverContext env, + public void preAddColumn(ObserverContext ctx, byte[] tableName, HColumnDescriptor column) throws IOException { } @Override - public void postAddColumn(ObserverContext env, + public void postAddColumn(ObserverContext ctx, byte[] tableName, HColumnDescriptor column) throws IOException { } @Override - public void preModifyColumn(ObserverContext env, + public void preModifyColumn(ObserverContext ctx, byte[] tableName, HColumnDescriptor descriptor) throws IOException { } @Override - public void postModifyColumn(ObserverContext env, + public void postModifyColumn(ObserverContext ctx, byte[] tableName, HColumnDescriptor descriptor) throws IOException { } @Override - public void preDeleteColumn(ObserverContext env, + public void preDeleteColumn(ObserverContext ctx, byte[] tableName, byte[] c) throws IOException { } @Override - public void postDeleteColumn(ObserverContext env, + public void postDeleteColumn(ObserverContext ctx, byte[] tableName, byte[] c) throws IOException { } @Override - public void preEnableTable(ObserverContext env, + public void preEnableTable(ObserverContext ctx, byte[] tableName) throws IOException { } @Override - public void postEnableTable(ObserverContext env, + public void postEnableTable(ObserverContext ctx, byte[] tableName) throws IOException { } @Override - public void preDisableTable(ObserverContext env, + public void preDisableTable(ObserverContext ctx, byte[] tableName) throws IOException { } @Override - public void postDisableTable(ObserverContext env, + public void postDisableTable(ObserverContext ctx, byte[] tableName) throws IOException { } @Override - public void preMove(ObserverContext env, + public void preMove(ObserverContext ctx, HRegionInfo region, HServerInfo srcServer, HServerInfo destServer) throws UnknownRegionException { } @Override - public void postMove(ObserverContext env, + public void postMove(ObserverContext ctx, HRegionInfo region, HServerInfo srcServer, HServerInfo destServer) throws UnknownRegionException { } @Override - public void preAssign(ObserverContext env, + public void preAssign(ObserverContext ctx, byte[] regionName, boolean force) throws IOException { } @Override - public void postAssign(ObserverContext env, + public void postAssign(ObserverContext ctx, HRegionInfo regionInfo) throws IOException { } @Override - public void preUnassign(ObserverContext env, + public void preUnassign(ObserverContext ctx, byte[] regionName, boolean force) throws IOException { } @Override - public void postUnassign(ObserverContext env, + public void postUnassign(ObserverContext ctx, HRegionInfo regionInfo, boolean force) throws IOException { } @Override - public void preBalance(ObserverContext env) + public void preBalance(ObserverContext ctx) throws IOException { } @Override - public void postBalance(ObserverContext env) + public void postBalance(ObserverContext ctx) throws IOException { } @Override - public boolean preBalanceSwitch(ObserverContext env, + public boolean preBalanceSwitch(ObserverContext ctx, boolean b) throws IOException { return b; } @Override - public void postBalanceSwitch(ObserverContext env, + public void postBalanceSwitch(ObserverContext ctx, boolean oldValue, boolean newValue) throws IOException { } @Override - public void preShutdown(ObserverContext env) + public void preShutdown(ObserverContext ctx) throws IOException { } @Override - public void preStopMaster(ObserverContext env) + public void preStopMaster(ObserverContext ctx) throws IOException { } @Override - public void start(CoprocessorEnvironment env) throws IOException { + public void start(CoprocessorEnvironment ctx) throws IOException { } @Override - public void stop(CoprocessorEnvironment env) throws IOException { + public void stop(CoprocessorEnvironment ctx) throws IOException { } } diff --git a/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserverCoprocessor.java b/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserver.java similarity index 96% rename from src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserverCoprocessor.java rename to src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserver.java index a8c7cb2368e..ec88a015130 100644 --- a/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserverCoprocessor.java +++ b/src/main/java/org/apache/hadoop/hbase/coprocessor/BaseRegionObserver.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 The Apache Software Foundation + * Copyright 2011 The Apache Software Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,11 +37,11 @@ import org.apache.hadoop.hbase.regionserver.wal.WALEdit; import java.io.IOException; /** - * An abstract class that implements Coprocessor and RegionObserver. - * By extending it, you can create you own region observer without - * overriding all abstract methods of Coprocessor and RegionObserver. + * An abstract class that implements RegionObserver. + * By extending it, you can create your own region observer without + * overriding all abstract methods of RegionObserver. */ -public abstract class BaseRegionObserverCoprocessor implements RegionObserver { +public abstract class BaseRegionObserver implements RegionObserver { @Override public void start(CoprocessorEnvironment e) { } diff --git a/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java b/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java index 5c5d18dec5d..cfbb29d9c10 100644 --- a/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java +++ b/src/main/java/org/apache/hadoop/hbase/coprocessor/RegionObserver.java @@ -46,25 +46,25 @@ public interface RegionObserver extends Coprocessor { * Called before the region is reported as open to the master. * @param c the environment provided by the region server */ - public void preOpen(final ObserverContext c); + void preOpen(final ObserverContext c); /** * Called after the region is reported as open to the master. * @param c the environment provided by the region server */ - public void postOpen(final ObserverContext c); + void postOpen(final ObserverContext c); /** * Called before the memstore is flushed to disk. * @param c the environment provided by the region server */ - public void preFlush(final ObserverContext c); + void preFlush(final ObserverContext c); /** * Called after the memstore is flushed to disk. * @param c the environment provided by the region server */ - public void postFlush(final ObserverContext c); + void postFlush(final ObserverContext c); /** * Called before compaction. @@ -72,7 +72,7 @@ public interface RegionObserver extends Coprocessor { * @param willSplit true if compaction will result in a split, false * otherwise */ - public void preCompact(final ObserverContext c, + void preCompact(final ObserverContext c, final boolean willSplit); /** @@ -81,7 +81,7 @@ public interface RegionObserver extends Coprocessor { * @param willSplit true if compaction will result in a split, false * otherwise */ - public void postCompact(final ObserverContext c, + void postCompact(final ObserverContext c, final boolean willSplit); /** @@ -89,7 +89,7 @@ public interface RegionObserver extends Coprocessor { * @param c the environment provided by the region server * (e.getRegion() returns the parent region) */ - public void preSplit(final ObserverContext c); + void preSplit(final ObserverContext c); /** * Called after the region is split. @@ -98,7 +98,7 @@ public interface RegionObserver extends Coprocessor { * @param l the left daughter region * @param r the right daughter region */ - public void postSplit(final ObserverContext c, final HRegion l, + void postSplit(final ObserverContext c, final HRegion l, final HRegion r); /** @@ -106,7 +106,7 @@ public interface RegionObserver extends Coprocessor { * @param c the environment provided by the region server * @param abortRequested true if the region server is aborting */ - public void preClose(final ObserverContext c, + void preClose(final ObserverContext c, boolean abortRequested); /** @@ -114,7 +114,7 @@ public interface RegionObserver extends Coprocessor { * @param c the environment provided by the region server * @param abortRequested true if the region server is aborting */ - public void postClose(final ObserverContext c, + void postClose(final ObserverContext c, boolean abortRequested); /** @@ -132,7 +132,7 @@ public interface RegionObserver extends Coprocessor { * is not bypassed. * @throws IOException if an error occurred on the coprocessor */ - public void preGetClosestRowBefore(final ObserverContext c, + void preGetClosestRowBefore(final ObserverContext c, final byte [] row, final byte [] family, final Result result) throws IOException; @@ -147,7 +147,7 @@ public interface RegionObserver extends Coprocessor { * @param result the result to return to the client, modify as necessary * @throws IOException if an error occurred on the coprocessor */ - public void postGetClosestRowBefore(final ObserverContext c, + void postGetClosestRowBefore(final ObserverContext c, final byte [] row, final byte [] family, final Result result) throws IOException; @@ -165,7 +165,7 @@ public interface RegionObserver extends Coprocessor { * is not bypassed. * @throws IOException if an error occurred on the coprocessor */ - public void preGet(final ObserverContext c, final Get get, + void preGet(final ObserverContext c, final Get get, final List result) throws IOException; @@ -179,7 +179,7 @@ public interface RegionObserver extends Coprocessor { * @param result the result to return to the client, modify as necessary * @throws IOException if an error occurred on the coprocessor */ - public void postGet(final ObserverContext c, final Get get, + void postGet(final ObserverContext c, final Get get, final List result) throws IOException; @@ -196,7 +196,7 @@ public interface RegionObserver extends Coprocessor { * @return the value to return to the client if bypassing default processing * @throws IOException if an error occurred on the coprocessor */ - public boolean preExists(final ObserverContext c, final Get get, + boolean preExists(final ObserverContext c, final Get get, final boolean exists) throws IOException; @@ -211,7 +211,7 @@ public interface RegionObserver extends Coprocessor { * @return the result to return to the client * @throws IOException if an error occurred on the coprocessor */ - public boolean postExists(final ObserverContext c, final Get get, + boolean postExists(final ObserverContext c, final Get get, final boolean exists) throws IOException; @@ -227,7 +227,7 @@ public interface RegionObserver extends Coprocessor { * @param writeToWAL true if the change should be written to the WAL * @throws IOException if an error occurred on the coprocessor */ - public void prePut(final ObserverContext c, final Map c, final Map> familyMap, final boolean writeToWAL) throws IOException; @@ -241,7 +241,7 @@ public interface RegionObserver extends Coprocessor { * @param writeToWAL true if the change should be written to the WAL * @throws IOException if an error occurred on the coprocessor */ - public void postPut(final ObserverContext c, final Map c, final Map> familyMap, final boolean writeToWAL) throws IOException; @@ -257,7 +257,7 @@ public interface RegionObserver extends Coprocessor { * @param writeToWAL true if the change should be written to the WAL * @throws IOException if an error occurred on the coprocessor */ - public void preDelete(final ObserverContext c, final Map c, final Map> familyMap, final boolean writeToWAL) throws IOException; @@ -271,7 +271,7 @@ public interface RegionObserver extends Coprocessor { * @param writeToWAL true if the change should be written to the WAL * @throws IOException if an error occurred on the coprocessor */ - public void postDelete(final ObserverContext c, + void postDelete(final ObserverContext c, final Map> familyMap, final boolean writeToWAL) throws IOException; @@ -294,7 +294,7 @@ public interface RegionObserver extends Coprocessor { * processing * @throws IOException if an error occurred on the coprocessor */ - public boolean preCheckAndPut(final ObserverContext c, + boolean preCheckAndPut(final ObserverContext c, final byte [] row, final byte [] family, final byte [] qualifier, final CompareOp compareOp, final WritableByteArrayComparable comparator, final Put put, final boolean result) @@ -316,7 +316,7 @@ public interface RegionObserver extends Coprocessor { * @return the possibly transformed return value to return to client * @throws IOException if an error occurred on the coprocessor */ - public boolean postCheckAndPut(final ObserverContext c, + boolean postCheckAndPut(final ObserverContext c, final byte [] row, final byte [] family, final byte [] qualifier, final CompareOp compareOp, final WritableByteArrayComparable comparator, final Put put, final boolean result) @@ -340,7 +340,7 @@ public interface RegionObserver extends Coprocessor { * @return the value to return to client if bypassing default processing * @throws IOException if an error occurred on the coprocessor */ - public boolean preCheckAndDelete(final ObserverContext c, + boolean preCheckAndDelete(final ObserverContext c, final byte [] row, final byte [] family, final byte [] qualifier, final CompareOp compareOp, final WritableByteArrayComparable comparator, final Delete delete, final boolean result) @@ -362,7 +362,7 @@ public interface RegionObserver extends Coprocessor { * @return the possibly transformed returned value to return to client * @throws IOException if an error occurred on the coprocessor */ - public boolean postCheckAndDelete(final ObserverContext c, + boolean postCheckAndDelete(final ObserverContext c, final byte [] row, final byte [] family, final byte [] qualifier, final CompareOp compareOp, final WritableByteArrayComparable comparator, final Delete delete, final boolean result) @@ -384,7 +384,7 @@ public interface RegionObserver extends Coprocessor { * @return value to return to the client if bypassing default processing * @throws IOException if an error occurred on the coprocessor */ - public long preIncrementColumnValue(final ObserverContext c, + long preIncrementColumnValue(final ObserverContext c, final byte [] row, final byte [] family, final byte [] qualifier, final long amount, final boolean writeToWAL) throws IOException; @@ -404,7 +404,7 @@ public interface RegionObserver extends Coprocessor { * @return the result to return to the client * @throws IOException if an error occurred on the coprocessor */ - public long postIncrementColumnValue(final ObserverContext c, + long postIncrementColumnValue(final ObserverContext c, final byte [] row, final byte [] family, final byte [] qualifier, final long amount, final boolean writeToWAL, final long result) throws IOException; @@ -423,7 +423,7 @@ public interface RegionObserver extends Coprocessor { * is not bypassed. * @throws IOException if an error occurred on the coprocessor */ - public void preIncrement(final ObserverContext c, + void preIncrement(final ObserverContext c, final Increment increment, final Result result) throws IOException; @@ -437,7 +437,7 @@ public interface RegionObserver extends Coprocessor { * @param result the result returned by increment, can be modified * @throws IOException if an error occurred on the coprocessor */ - public void postIncrement(final ObserverContext c, + void postIncrement(final ObserverContext c, final Increment increment, final Result result) throws IOException; @@ -455,7 +455,7 @@ public interface RegionObserver extends Coprocessor { * overriding default behavior, null otherwise * @throws IOException if an error occurred on the coprocessor */ - public InternalScanner preScannerOpen(final ObserverContext c, + InternalScanner preScannerOpen(final ObserverContext c, final Scan scan, final InternalScanner s) throws IOException; @@ -470,7 +470,7 @@ public interface RegionObserver extends Coprocessor { * @return the scanner instance to use * @throws IOException if an error occurred on the coprocessor */ - public InternalScanner postScannerOpen(final ObserverContext c, + InternalScanner postScannerOpen(final ObserverContext c, final Scan scan, final InternalScanner s) throws IOException; @@ -491,7 +491,7 @@ public interface RegionObserver extends Coprocessor { * @return 'has more' indication that should be sent to client * @throws IOException if an error occurred on the coprocessor */ - public boolean preScannerNext(final ObserverContext c, + boolean preScannerNext(final ObserverContext c, final InternalScanner s, final List result, final int limit, final boolean hasNext) throws IOException; @@ -509,7 +509,7 @@ public interface RegionObserver extends Coprocessor { * @return 'has more' indication that should be sent to client * @throws IOException if an error occurred on the coprocessor */ - public boolean postScannerNext(final ObserverContext c, + boolean postScannerNext(final ObserverContext c, final InternalScanner s, final List result, final int limit, final boolean hasNext) throws IOException; @@ -525,7 +525,7 @@ public interface RegionObserver extends Coprocessor { * @param s the scanner * @throws IOException if an error occurred on the coprocessor */ - public void preScannerClose(final ObserverContext c, + void preScannerClose(final ObserverContext c, final InternalScanner s) throws IOException; @@ -538,7 +538,7 @@ public interface RegionObserver extends Coprocessor { * @param s the scanner * @throws IOException if an error occurred on the coprocessor */ - public void postScannerClose(final ObserverContext c, + void postScannerClose(final ObserverContext c, final InternalScanner s) throws IOException; diff --git a/src/test/java/org/apache/hadoop/hbase/coprocessor/SampleRegionWALObserver.java b/src/test/java/org/apache/hadoop/hbase/coprocessor/SampleRegionWALObserver.java index c1fe58da0f0..ff9c502f2be 100644 --- a/src/test/java/org/apache/hadoop/hbase/coprocessor/SampleRegionWALObserver.java +++ b/src/test/java/org/apache/hadoop/hbase/coprocessor/SampleRegionWALObserver.java @@ -33,15 +33,14 @@ import org.apache.hadoop.hbase.regionserver.wal.HLogKey; import org.apache.hadoop.hbase.regionserver.wal.WALEdit; /** - * Class for testing WAL coprocessor extension. WAL write monitor is defined - * in LogObserver while WAL Restore is in RegionObserver. + * Class for testing WALObserver coprocessor. * - * It will monitor a WAL writing and Restore, modify passed-in WALEdit, i.e, - * ignore specified columns when writing, and add a KeyValue. On the other - * hand, it checks whether the ignored column is still in WAL when Restoreed + * It will monitor WAL writing and restoring, and modify passed-in WALEdit, i.e, + * ignore specified columns when writing, or add a KeyValue. On the other + * side, it checks whether the ignored column is still in WAL when Restoreed * at region reconstruct. */ -public class SampleRegionWALObserver extends BaseRegionObserverCoprocessor +public class SampleRegionWALObserver extends BaseRegionObserver implements WALObserver { private static final Log LOG = LogFactory.getLog(SampleRegionWALObserver.class); diff --git a/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java b/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java index e201b3f4f7b..c5e81e701c3 100644 --- a/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java +++ b/src/test/java/org/apache/hadoop/hbase/coprocessor/SimpleRegionObserver.java @@ -43,7 +43,7 @@ import org.apache.hadoop.hbase.util.Bytes; * A sample region observer that tests the RegionObserver interface. * It works with TestRegionObserverInterface to provide the test case. */ -public class SimpleRegionObserver extends BaseRegionObserverCoprocessor { +public class SimpleRegionObserver extends BaseRegionObserver { static final Log LOG = LogFactory.getLog(TestRegionObserverInterface.class); boolean beforeDelete = true; diff --git a/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java b/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java index 0a07e03f616..0f1c6b52d5a 100644 --- a/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java +++ b/src/test/java/org/apache/hadoop/hbase/coprocessor/TestCoprocessorInterface.java @@ -47,7 +47,7 @@ public class TestCoprocessorInterface extends HBaseTestCase { private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); - public static class CoprocessorImpl extends BaseRegionObserverCoprocessor { + public static class CoprocessorImpl extends BaseRegionObserver { private boolean startCalled; private boolean stopCalled; diff --git a/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverStacking.java b/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverStacking.java index 20a8d7db928..18380c6fe5e 100644 --- a/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverStacking.java +++ b/src/test/java/org/apache/hadoop/hbase/coprocessor/TestRegionObserverStacking.java @@ -42,7 +42,7 @@ import junit.framework.TestCase; public class TestRegionObserverStacking extends TestCase { static final String DIR = "test/build/data/TestRegionObserverStacking/"; - public static class ObserverA extends BaseRegionObserverCoprocessor { + public static class ObserverA extends BaseRegionObserver { long id; @Override public void postPut(final ObserverContext c, @@ -56,7 +56,7 @@ public class TestRegionObserverStacking extends TestCase { } } - public static class ObserverB extends BaseRegionObserverCoprocessor { + public static class ObserverB extends BaseRegionObserver { long id; @Override public void postPut(final ObserverContext c, @@ -70,7 +70,7 @@ public class TestRegionObserverStacking extends TestCase { } } - public static class ObserverC extends BaseRegionObserverCoprocessor { + public static class ObserverC extends BaseRegionObserver { long id; @Override diff --git a/src/test/java/org/apache/hadoop/hbase/coprocessor/TestWALCoprocessors.java b/src/test/java/org/apache/hadoop/hbase/coprocessor/TestWALObserver.java similarity index 96% rename from src/test/java/org/apache/hadoop/hbase/coprocessor/TestWALCoprocessors.java rename to src/test/java/org/apache/hadoop/hbase/coprocessor/TestWALObserver.java index 27c38f9e7c6..da9d0b1db9a 100644 --- a/src/test/java/org/apache/hadoop/hbase/coprocessor/TestWALCoprocessors.java +++ b/src/test/java/org/apache/hadoop/hbase/coprocessor/TestWALObserver.java @@ -1,5 +1,5 @@ /* - * Copyright 2010 The Apache Software Foundation + * Copyright 2011 The Apache Software Foundation * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file @@ -61,8 +61,8 @@ import static org.junit.Assert.*; * Tests invocation of the {@link org.apache.hadoop.hbase.coprocessor.MasterObserver} * interface hooks at all appropriate times during normal HMaster operations. */ -public class TestWALCoprocessors { - private static final Log LOG = LogFactory.getLog(TestWALCoprocessors.class); +public class TestWALObserver { + private static final Log LOG = LogFactory.getLog(TestWALObserver.class); private final static HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility(); private static byte[] TEST_TABLE = Bytes.toBytes("observedTable"); @@ -118,7 +118,7 @@ public class TestWALCoprocessors { //this.cluster = TEST_UTIL.getDFSCluster(); this.fs = TEST_UTIL.getDFSCluster().getFileSystem(); this.hbaseRootDir = new Path(conf.get(HConstants.HBASE_DIR)); - this.dir = new Path(this.hbaseRootDir, TestWALCoprocessors.class.getName()); + this.dir = new Path(this.hbaseRootDir, TestWALObserver.class.getName()); this.oldLogDir = new Path(this.hbaseRootDir, HConstants.HREGION_OLDLOGDIR_NAME); this.logDir = new Path(this.hbaseRootDir, HConstants.HREGION_LOGDIR_NAME); @@ -138,7 +138,7 @@ public class TestWALCoprocessors { * WALEdit. */ @Test - public void testWWALCoprocessorWriteToWAL() throws Exception { + public void testWALObserverWriteToWAL() throws Exception { HRegionInfo hri = createBasic3FamilyHRegionInfo(Bytes.toString(TEST_TABLE)); Path basedir = new Path(this.hbaseRootDir, Bytes.toString(TEST_TABLE)); deleteDir(basedir); @@ -222,7 +222,7 @@ public class TestWALCoprocessors { * Test WAL replay behavior with WALObserver. */ @Test - public void testWALCoprocessorReplay() throws Exception { + public void testWALObserverReplay() throws Exception { // WAL replay is handled at HRegion::replayRecoveredEdits(), which is // ultimately called by HRegion::initialize() byte[] tableName = Bytes.toBytes("testWALCoprocessorReplay"); @@ -279,7 +279,7 @@ public class TestWALCoprocessors { * CP will impact existing HLog tests or not. */ @Test - public void testWALCoprocessorLoaded() throws Exception { + public void testWALObserverLoaded() throws Exception { HLog log = new HLog(fs, dir, oldLogDir, conf); assertNotNull(getCoprocessor(log)); }