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
This commit is contained in:
Michael Stack 2011-04-25 19:21:17 +00:00
parent 1f0d347474
commit fd470dbf23
9 changed files with 88 additions and 87 deletions

View File

@ -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

View File

@ -30,153 +30,153 @@ import java.io.IOException;
public class BaseMasterObserver implements MasterObserver {
@Override
public void preCreateTable(ObserverContext<MasterCoprocessorEnvironment> env,
public void preCreateTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
HTableDescriptor desc, byte[][] splitKeys) throws IOException {
}
@Override
public void postCreateTable(ObserverContext<MasterCoprocessorEnvironment> env,
public void postCreateTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
HRegionInfo[] regions, boolean sync) throws IOException {
}
@Override
public void preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> env,
public void preDeleteTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName) throws IOException {
}
@Override
public void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> env,
public void postDeleteTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName) throws IOException {
}
@Override
public void preModifyTable(ObserverContext<MasterCoprocessorEnvironment> env,
public void preModifyTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName, HTableDescriptor htd) throws IOException {
}
@Override
public void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> env,
public void postModifyTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName, HTableDescriptor htd) throws IOException {
}
@Override
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> env,
public void preAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName, HColumnDescriptor column) throws IOException {
}
@Override
public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> env,
public void postAddColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName, HColumnDescriptor column) throws IOException {
}
@Override
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> env,
public void preModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName, HColumnDescriptor descriptor) throws IOException {
}
@Override
public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> env,
public void postModifyColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName, HColumnDescriptor descriptor) throws IOException {
}
@Override
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> env,
public void preDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName, byte[] c) throws IOException {
}
@Override
public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> env,
public void postDeleteColumn(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName, byte[] c) throws IOException {
}
@Override
public void preEnableTable(ObserverContext<MasterCoprocessorEnvironment> env,
public void preEnableTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName) throws IOException {
}
@Override
public void postEnableTable(ObserverContext<MasterCoprocessorEnvironment> env,
public void postEnableTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName) throws IOException {
}
@Override
public void preDisableTable(ObserverContext<MasterCoprocessorEnvironment> env,
public void preDisableTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName) throws IOException {
}
@Override
public void postDisableTable(ObserverContext<MasterCoprocessorEnvironment> env,
public void postDisableTable(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] tableName) throws IOException {
}
@Override
public void preMove(ObserverContext<MasterCoprocessorEnvironment> env,
public void preMove(ObserverContext<MasterCoprocessorEnvironment> ctx,
HRegionInfo region, HServerInfo srcServer, HServerInfo destServer)
throws UnknownRegionException {
}
@Override
public void postMove(ObserverContext<MasterCoprocessorEnvironment> env,
public void postMove(ObserverContext<MasterCoprocessorEnvironment> ctx,
HRegionInfo region, HServerInfo srcServer, HServerInfo destServer)
throws UnknownRegionException {
}
@Override
public void preAssign(ObserverContext<MasterCoprocessorEnvironment> env,
public void preAssign(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] regionName, boolean force) throws IOException {
}
@Override
public void postAssign(ObserverContext<MasterCoprocessorEnvironment> env,
public void postAssign(ObserverContext<MasterCoprocessorEnvironment> ctx,
HRegionInfo regionInfo) throws IOException {
}
@Override
public void preUnassign(ObserverContext<MasterCoprocessorEnvironment> env,
public void preUnassign(ObserverContext<MasterCoprocessorEnvironment> ctx,
byte[] regionName, boolean force) throws IOException {
}
@Override
public void postUnassign(ObserverContext<MasterCoprocessorEnvironment> env,
public void postUnassign(ObserverContext<MasterCoprocessorEnvironment> ctx,
HRegionInfo regionInfo, boolean force) throws IOException {
}
@Override
public void preBalance(ObserverContext<MasterCoprocessorEnvironment> env)
public void preBalance(ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException {
}
@Override
public void postBalance(ObserverContext<MasterCoprocessorEnvironment> env)
public void postBalance(ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException {
}
@Override
public boolean preBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> env,
public boolean preBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> ctx,
boolean b) throws IOException {
return b;
}
@Override
public void postBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> env,
public void postBalanceSwitch(ObserverContext<MasterCoprocessorEnvironment> ctx,
boolean oldValue, boolean newValue) throws IOException {
}
@Override
public void preShutdown(ObserverContext<MasterCoprocessorEnvironment> env)
public void preShutdown(ObserverContext<MasterCoprocessorEnvironment> ctx)
throws IOException {
}
@Override
public void preStopMaster(ObserverContext<MasterCoprocessorEnvironment> env)
public void preStopMaster(ObserverContext<MasterCoprocessorEnvironment> 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 {
}
}

View File

@ -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) { }

View File

@ -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<RegionCoprocessorEnvironment> c);
void preOpen(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c);
void postOpen(final ObserverContext<RegionCoprocessorEnvironment> c);
/**
* Called before the memstore is flushed to disk.
* @param c the environment provided by the region server
*/
public void preFlush(final ObserverContext<RegionCoprocessorEnvironment> c);
void preFlush(final ObserverContext<RegionCoprocessorEnvironment> c);
/**
* Called after the memstore is flushed to disk.
* @param c the environment provided by the region server
*/
public void postFlush(final ObserverContext<RegionCoprocessorEnvironment> c);
void postFlush(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
void preCompact(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
void postCompact(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c);
void preSplit(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c, final HRegion l,
void postSplit(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
void preClose(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
void postClose(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
void preGetClosestRowBefore(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
void postGetClosestRowBefore(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c, final Get get,
void preGet(final ObserverContext<RegionCoprocessorEnvironment> c, final Get get,
final List<KeyValue> 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<RegionCoprocessorEnvironment> c, final Get get,
void postGet(final ObserverContext<RegionCoprocessorEnvironment> c, final Get get,
final List<KeyValue> 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<RegionCoprocessorEnvironment> c, final Get get,
boolean preExists(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c, final Get get,
boolean postExists(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c, final Map<byte[],
void prePut(final ObserverContext<RegionCoprocessorEnvironment> c, final Map<byte[],
List<KeyValue>> 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<RegionCoprocessorEnvironment> c, final Map<byte[],
void postPut(final ObserverContext<RegionCoprocessorEnvironment> c, final Map<byte[],
List<KeyValue>> 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<RegionCoprocessorEnvironment> c, final Map<byte[],
void preDelete(final ObserverContext<RegionCoprocessorEnvironment> c, final Map<byte[],
List<KeyValue>> 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<RegionCoprocessorEnvironment> c,
void postDelete(final ObserverContext<RegionCoprocessorEnvironment> c,
final Map<byte[], List<KeyValue>> 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<RegionCoprocessorEnvironment> c,
boolean preCheckAndPut(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
boolean postCheckAndPut(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
boolean preCheckAndDelete(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
boolean postCheckAndDelete(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
long preIncrementColumnValue(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
long postIncrementColumnValue(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
void preIncrement(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
void postIncrement(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
InternalScanner preScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
InternalScanner postScannerOpen(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
boolean preScannerNext(final ObserverContext<RegionCoprocessorEnvironment> c,
final InternalScanner s, final List<Result> 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<RegionCoprocessorEnvironment> c,
boolean postScannerNext(final ObserverContext<RegionCoprocessorEnvironment> c,
final InternalScanner s, final List<Result> 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<RegionCoprocessorEnvironment> c,
void preScannerClose(final ObserverContext<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> c,
void postScannerClose(final ObserverContext<RegionCoprocessorEnvironment> c,
final InternalScanner s)
throws IOException;

View File

@ -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);

View File

@ -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;

View File

@ -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;

View File

@ -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<RegionCoprocessorEnvironment> 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<RegionCoprocessorEnvironment> 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

View File

@ -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));
}