HBASE-23861. Reconcile Hadoop version. (#1179)
[hbase.git] / hbase-native-client / src / async / hbase_mutations.cc
blob2456dc0074cbce9ac1a14b3f8b9d9f2532af95d3
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #include "async/hbase_mutations.h"
22 #include <stdlib.h>
24 #include "core/hbase_types.h"
25 #include "core/mutation.h"
26 #include "core/put.h"
27 #include "core/delete.h"
29 #include "async/hbase_result.h"
31 extern "C" {
32 int32_t hb_put_create(hb_put_t* put_ptr) {
33 (*put_ptr) = reinterpret_cast<hb_put_t>(new Put());
34 return 0;
37 int32_t hb_delete_create(hb_delete_t * delete_ptr) {
38 (*delete_ptr) = reinterpret_cast<hb_delete_t>(new Delete());
39 return 0;
42 int32_t hb_increment_create(hb_increment_t * increment_ptr) {
43 return 0;
46 int32_t hb_append_create(hb_append_t * append_ptr) {
47 return 0;
50 int32_t hb_mutation_destroy(hb_mutation_t mutation) {
51 return 0;
54 HBASE_API int32_t hb_mutation_set_namespace(hb_mutation_t mutation,
55 char * name_space, size_t name_space_length) {
56 Mutation * m = reinterpret_cast<Mutation *>(mutation);
57 m->set_namespace(name_space, name_space_length);
58 return 0;
61 HBASE_API int32_t hb_mutation_set_table(hb_mutation_t mutation,
62 char * table, size_t table_length) {
63 Mutation * m = reinterpret_cast<Mutation *>(mutation);
64 m->set_namespace(table, table_length);
65 return 0;
68 int32_t hb_mutation_set_row(hb_mutation_t mutation,
69 unsigned char * rk, size_t row_length) {
70 Mutation * m = reinterpret_cast<Mutation *>(mutation);
71 m->set_row(rk, row_length);
72 return 0;
75 int32_t hb_mutation_set_durability(hb_mutation_t mutation,
76 hb_durability_type durability) {
77 Mutation * m = reinterpret_cast<Mutation *>(mutation);
78 m->set_durability(durability);
79 return 0;
82 int32_t hb_put_add_cell(hb_put_t put, hb_cell_t * cell) {
83 return 0;
86 int32_t hb_delete_add_col(hb_increment_t incr,
87 unsigned char * family, size_t family_length,
88 unsigned char * qual, size_t qual_length) {
89 return 0;
92 int32_t hb_increment_add_value(hb_increment_t incr,
93 unsigned char * family, size_t family_length,
94 unsigned char * qual, size_t qual_length,
95 int64_t ammount) {
96 return 0;
99 int32_t hb_append_add_cell(hb_append_t put, hb_cell_t * cell) {
100 return 0;
103 int32_t hb_mutation_send(hb_client_t client,
104 hb_mutation_t mutation, hb_mutation_cb cb,
105 void * extra) {
106 if (cb) {
107 cb(0, client, mutation, NULL, extra);
109 return 0;
111 } // extern "C"