View Javadoc

1   /**
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *     http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing, software
13   * distributed under the License is distributed on an "AS IS" BASIS,
14   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15   * See the License for the specific language governing permissions and
16   * limitations under the License.
17   */
18  package org.apache.hadoop.hbase.coprocessor;
19  
20  import java.io.IOException;
21  import java.util.List;
22  
23  import org.apache.hadoop.hbase.client.Mutation;
24  import org.apache.hadoop.hbase.ipc.CoprocessorProtocol;
25  import org.apache.hadoop.hbase.regionserver.HRegion;
26  
27  /**
28   * Defines a protocol to perform multi row transactions.
29   * See {@link MultiRowMutationEndpoint} for the implementation.
30   * </br>
31   * See
32   * {@link HRegion#mutateRowsWithLocks(java.util.Collection, java.util.Collection)}
33   * for details and limitations.
34   * </br>
35   * Example:
36   * <code><pre>
37   * List<Mutation> mutations = ...;
38   * Put p1 = new Put(row1);
39   * Put p2 = new Put(row2);
40   * ...
41   * mutations.add(p1);
42   * mutations.add(p2);
43   * MultiRowMutationProtocol mrOp = t.coprocessorProxy(
44   *   MultiRowMutationProtocol.class, row1);
45   * mrOp.mutateRows(mutations);
46   * </pre></code>
47   */
48  public interface MultiRowMutationProtocol extends CoprocessorProtocol {
49    public void mutateRows(List<Mutation> mutations) throws IOException;
50  }