HBASE-5670 Have Mutation implement the Row interface.
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1306959 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
67ded34626
commit
ea77247c82
|
@ -45,8 +45,7 @@ import org.apache.hadoop.io.Writable;
|
|||
*/
|
||||
@InterfaceAudience.Public
|
||||
@InterfaceStability.Stable
|
||||
public class Append extends Mutation implements Row {
|
||||
// TODO: refactor to derive from Put?
|
||||
public class Append extends Mutation {
|
||||
private static final String RETURN_RESULTS = "_rr_";
|
||||
private static final byte APPEND_VERSION = (byte)1;
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ import java.util.Map;
|
|||
@InterfaceAudience.Public
|
||||
@InterfaceStability.Stable
|
||||
public class Delete extends Mutation
|
||||
implements Writable, Row, Comparable<Row> {
|
||||
implements Writable, Comparable<Row> {
|
||||
private static final byte DELETE_VERSION = (byte)3;
|
||||
|
||||
/** Constructor for Writable. DO NOT USE */
|
||||
|
|
|
@ -700,7 +700,7 @@ public class HTable implements HTableInterface {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public synchronized void batch(final List<Row> actions, final Object[] results)
|
||||
public synchronized void batch(final List<?extends Row> actions, final Object[] results)
|
||||
throws InterruptedException, IOException {
|
||||
connection.processBatch(actions, tableName, pool, results);
|
||||
}
|
||||
|
@ -709,7 +709,7 @@ public class HTable implements HTableInterface {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public synchronized Object[] batch(final List<Row> actions) throws InterruptedException, IOException {
|
||||
public synchronized Object[] batch(final List<? extends Row> actions) throws InterruptedException, IOException {
|
||||
Object[] results = new Object[actions.size()];
|
||||
connection.processBatch(actions, tableName, pool, results);
|
||||
return results;
|
||||
|
|
|
@ -92,7 +92,7 @@ public interface HTableInterface extends Closeable {
|
|||
* @throws IOException
|
||||
* @since 0.90.0
|
||||
*/
|
||||
void batch(final List<Row> actions, final Object[] results) throws IOException, InterruptedException;
|
||||
void batch(final List<?extends Row> actions, final Object[] results) throws IOException, InterruptedException;
|
||||
|
||||
/**
|
||||
* Same as {@link #batch(List, Object[])}, but returns an array of
|
||||
|
@ -104,7 +104,7 @@ public interface HTableInterface extends Closeable {
|
|||
* @throws IOException
|
||||
* @since 0.90.0
|
||||
*/
|
||||
Object[] batch(final List<Row> actions) throws IOException, InterruptedException;
|
||||
Object[] batch(final List<? extends Row> actions) throws IOException, InterruptedException;
|
||||
|
||||
/**
|
||||
* Extracts certain cells from a given row.
|
||||
|
|
|
@ -354,13 +354,13 @@ public class HTablePool implements Closeable {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void batch(List<Row> actions, Object[] results) throws IOException,
|
||||
public void batch(List<? extends Row> actions, Object[] results) throws IOException,
|
||||
InterruptedException {
|
||||
table.batch(actions, results);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] batch(List<Row> actions) throws IOException,
|
||||
public Object[] batch(List<? extends Row> actions) throws IOException,
|
||||
InterruptedException {
|
||||
return table.batch(actions);
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ import org.apache.hadoop.hbase.util.Bytes;
|
|||
|
||||
@InterfaceAudience.Public
|
||||
@InterfaceStability.Evolving
|
||||
public abstract class Mutation extends OperationWithAttributes {
|
||||
public abstract class Mutation extends OperationWithAttributes implements Row {
|
||||
// Attribute used in Mutations to indicate the originating cluster.
|
||||
private static final String CLUSTER_ID_ATTR = "_c.id_";
|
||||
|
||||
|
@ -152,6 +152,7 @@ public abstract class Mutation extends OperationWithAttributes {
|
|||
* Method for retrieving the delete's row
|
||||
* @return row
|
||||
*/
|
||||
@Override
|
||||
public byte [] getRow() {
|
||||
return this.row;
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ import java.util.TreeMap;
|
|||
@InterfaceAudience.Public
|
||||
@InterfaceStability.Stable
|
||||
public class Put extends Mutation
|
||||
implements HeapSize, Writable, Row, Comparable<Row> {
|
||||
implements HeapSize, Writable, Comparable<Row> {
|
||||
private static final byte PUT_VERSION = (byte)2;
|
||||
|
||||
private static final long OVERHEAD = ClassSize.align(
|
||||
|
|
|
@ -470,13 +470,13 @@ public abstract class CoprocessorHost<E extends CoprocessorEnvironment> {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void batch(List<Row> actions, Object[] results)
|
||||
public void batch(List<? extends Row> actions, Object[] results)
|
||||
throws IOException, InterruptedException {
|
||||
table.batch(actions, results);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] batch(List<Row> actions)
|
||||
public Object[] batch(List<? extends Row> actions)
|
||||
throws IOException, InterruptedException {
|
||||
return table.batch(actions);
|
||||
}
|
||||
|
|
|
@ -616,12 +616,12 @@ public class RemoteHTable implements HTableInterface {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void batch(List<Row> actions, Object[] results) throws IOException {
|
||||
public void batch(List<? extends Row> actions, Object[] results) throws IOException {
|
||||
throw new IOException("batch not supported");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] batch(List<Row> actions) throws IOException {
|
||||
public Object[] batch(List<? extends Row> actions) throws IOException {
|
||||
throw new IOException("batch not supported");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue