The following Java classes are examples of the Accumulo client API:
RowOperations.java demonstrates how to read, write and delete rows using the BatchWriter and Scanner:
$ ./bin/runex client.RowOperations [examples.client.RowOperations] INFO : This is only row2 [examples.client.RowOperations] INFO : Key: row2 col:1 [] 1523301597006 false Value: v1 [examples.client.RowOperations] INFO : Key: row2 col:2 [] 1523301597006 false Value: v2 [examples.client.RowOperations] INFO : Key: row2 col:3 [] 1523301597006 false Value: v3 [examples.client.RowOperations] INFO : This is everything [examples.client.RowOperations] INFO : Key: row1 col:1 [] 1523301597006 false Value: v1 [examples.client.RowOperations] INFO : Key: row1 col:2 [] 1523301597006 false Value: v2 [examples.client.RowOperations] INFO : Key: row1 col:3 [] 1523301597006 false Value: v3 [examples.client.RowOperations] INFO : Key: row2 col:1 [] 1523301597006 false Value: v1 [examples.client.RowOperations] INFO : Key: row2 col:2 [] 1523301597006 false Value: v2 [examples.client.RowOperations] INFO : Key: row2 col:3 [] 1523301597006 false Value: v3 [examples.client.RowOperations] INFO : Key: row3 col:1 [] 1523301597006 false Value: v1 [examples.client.RowOperations] INFO : Key: row3 col:2 [] 1523301597006 false Value: v2 [examples.client.RowOperations] INFO : Key: row3 col:3 [] 1523301597006 false Value: v3 [examples.client.RowOperations] INFO : This is row1 and row3 [examples.client.RowOperations] INFO : Key: row1 col:1 [] 1523301597006 false Value: v1 [examples.client.RowOperations] INFO : Key: row1 col:2 [] 1523301597006 false Value: v2 [examples.client.RowOperations] INFO : Key: row1 col:3 [] 1523301597006 false Value: v3 [examples.client.RowOperations] INFO : Key: row3 col:1 [] 1523301597006 false Value: v1 [examples.client.RowOperations] INFO : Key: row3 col:2 [] 1523301597006 false Value: v2 [examples.client.RowOperations] INFO : Key: row3 col:3 [] 1523301597006 false Value: v3 [examples.client.RowOperations] INFO : This is just row3 [examples.client.RowOperations] INFO : Key: row3 col:1 [] 1523301597006 false Value: v1 [examples.client.RowOperations] INFO : Key: row3 col:2 [] 1523301597006 false Value: v2 [examples.client.RowOperations] INFO : Key: row3 col:3 [] 1523301597006 false Value: v3
To create a table, write to it and read from it:
$ ./bin/runex client.ReadWriteExample [examples.client.ReadWriteExample] INFO : hello0 cf:cq [] 1523306675130 false -> world0 [examples.client.ReadWriteExample] INFO : hello1 cf:cq [] 1523306675130 false -> world1 [examples.client.ReadWriteExample] INFO : hello2 cf:cq [] 1523306675130 false -> world2 [examples.client.ReadWriteExample] INFO : hello3 cf:cq [] 1523306675130 false -> world3 [examples.client.ReadWriteExample] INFO : hello4 cf:cq [] 1523306675130 false -> world4 [examples.client.ReadWriteExample] INFO : hello5 cf:cq [] 1523306675130 false -> world5 [examples.client.ReadWriteExample] INFO : hello6 cf:cq [] 1523306675130 false -> world6 [examples.client.ReadWriteExample] INFO : hello7 cf:cq [] 1523306675130 false -> world7 [examples.client.ReadWriteExample] INFO : hello8 cf:cq [] 1523306675130 false -> world8 [examples.client.ReadWriteExample] INFO : hello9 cf:cq [] 1523306675130 false -> world9