You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CitizenDAO citizenDao =newCitizenDAO(configuration); // alternatively, you can pass HBase client's Connection to your constructor
202
+
203
+
// Create new record:
204
+
String rowKey = citizenDao.persist(newCitizen("IND", 1, /* more params */)); // Here, output of 'persist' is a String, because Citizen class implements HBRecord<String>
199
205
200
206
// Fetch a row from "citizens" HBase table with row key "IND#1":
201
207
Citizen pe = citizenDao.get("IND#1");
@@ -229,6 +235,8 @@ counterDAO.getOnGets(get1);
229
235
Get get2 = citizenDao.getGet("IND#2").setTimeRange(1, 5).setMaxVersions(2); // Advanced HBase row fetch
230
236
counterDAO.getOnGets(get2);
231
237
238
+
citizenDao.increment("IND#2", "counter", 3L); // Increment value of counter by 3
239
+
232
240
citizenDao.getHBaseTable() // returns HTable instance (in case you want to directly play around)
233
241
234
242
```
@@ -251,7 +259,7 @@ Add below entry within the `dependencies` section of your `pom.xml`:
251
259
<dependency>
252
260
<groupId>com.flipkart</groupId>
253
261
<artifactId>hbase-object-mapper</artifactId>
254
-
<version>1.10</version>
262
+
<version>1.11</version>
255
263
</dependency>
256
264
```
257
265
See artifact details: [com.flipkart:hbase-object-mapper on **Maven Central**](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.flipkart%22%20AND%20a%3A%22hbase-object-mapper%22) or
@@ -260,7 +268,7 @@ See artifact details: [com.flipkart:hbase-object-mapper on **Maven Central**](ht
260
268
To build this project, follow below simple steps:
261
269
262
270
1. Do a `git clone` of this repository
263
-
2. Checkout latest stable version `git checkout v1.10`
271
+
2. Checkout latest stable version `git checkout v1.11`
* Constructs a data access object using a custom codec. Classes extending this class <strong>must</strong> call this constructor using <code>super</code>.
48
-
* <p>
49
-
* <b>Note: </b>If you want to use the default codec, just use the constructor {@link #AbstractHBDAO(Configuration)}
50
-
*
51
-
* @param configuration Hadoop configuration
52
-
* @param codec Your custom codec. If <code>null</code>, default codec is used.
53
-
* @throws IOException Exceptions thrown by HBase
54
-
* @throws IllegalStateException Annotation(s) on base entity may be incorrect
* Constructs a data access object using your custom {@link HBObjectMapper}. Classes extending this class <strong>must</strong> call this constructor using <code>super</code>.
44
+
* Constructs a data access object using your custom {@link HBObjectMapper}
63
45
* <p>
64
46
* <br>
65
47
* <b>Note: </b>If you want to use the default {@link HBObjectMapper}, just use the constructor {@link #AbstractHBDAO(Configuration)}
66
48
*
67
-
* @param configuration Hadoop configuration
49
+
* @param connection HBase Connection
68
50
* @param hbObjectMapper Your custom {@link HBObjectMapper}
69
51
* @throws IOException Exceptions thrown by HBase
70
52
* @throws IllegalStateException Annotation(s) on base entity may be incorrect
thrownewIllegalStateException(String.format("Unable to resolve HBase record/rowkey type (record class is resolving to %s and rowkey class is resolving to %s)", hbRecordClass, rowKeyClass));
0 commit comments