Reputation: 3213
I am updating HBase code of 0.98.10
to 1.1.5
, but the complier shows that myWalObserver doesn't implement the original interface WALObserver
anymore.
The compiler outputs:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-
plugin:3.1:compile (default-compile) on project observer: Compilation failure
[ERROR] /Users/zhangsong.zs/git/HBaseObserver/src/main/java/com/gavin/observer/
DataSyncWALObserver.java:[39,8] com.gavin.observer.DataSyncWALObserver
is not abstractand does not override abstract method
postWALWrite(org.apache.hadoop.hbase.coprocessor.ObserverContext<? extends org.apache.hadoop.hbase.coprocessor.WALCoprocessorEnvironment>,
org.apache.hadoop.hbase.HRegionInfo,org.apache.hadoop.hbase.wal.WALKey,
org.apache.hadoop.hbase.regionserver.wal.WALEdit) in
org.apache.hadoop.hbase.coprocessor.WALObserver
So some new APIs have been added in the same interface of 1.1.5
version, and the old APIs are deprecated. The old code does not work any more, which is bad for developers.
So I want to ask: must I still implement the old interface methods which are already deprecated or not?
Upvotes: 0
Views: 1907
Reputation: 984
It is code maintenance technique.
Here is some background:
Upvotes: 0
Reputation: 6419
Yes, you must. Deprecated means it's not suggested to use. Any implementation must still implement it.
Upvotes: 1
Reputation: 223123
Yes, you must implement deprecated interface methods. However, you are allowed to make them throw UnsupportedOperationException
to signal to callers that they're not actually implemented.
Upvotes: 5