Skip to content

Instantly share code, notes, and snippets.

@shrijeet
Created July 25, 2012 18:42
Show Gist options
  • Save shrijeet/3177808 to your computer and use it in GitHub Desktop.
Save shrijeet/3177808 to your computer and use it in GitHub Desktop.
Program to reproduce bug in asynchbase client when delete followed by put is performed on set of tables
import org.hbase.async.DeleteRequest;
import org.hbase.async.HBaseClient;
import org.hbase.async.PutRequest;
public class PutDeleteBug {
public static void main(String args[]) throws Exception {
final HBaseClient client = new HBaseClient("pww-30");
for (int i = 0; i < 2; i++) {
PutRequest put;
if (i % 2 == 0) {
put = new PutRequest("t1", String.valueOf(i), "f", "q", "v");
} else {
put = new PutRequest("t0", String.valueOf(i), "f", "q", "v");
}
final DeleteRequest delete = new DeleteRequest(put.table(), put.key());
client.delete(delete);
client.put(put);
}
client.shutdown().joinUninterruptibly();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment