MCPcopy Index your code
hub / github.com/brianfrankcooper/YCSB / run

Method run

hbase098/src/main/java/site/ycsb/db/HBaseClient.java:421–460  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

419 for (int i = 0; i < threadcount; i++) {
420 Thread t = new Thread() {
421 public void run() {
422 try {
423 Random random = new Random();
424
425 HBaseClient cli = new HBaseClient();
426
427 Properties props = new Properties();
428 props.setProperty("columnfamily", columnfamily);
429 props.setProperty("debug", "true");
430 cli.setProperties(props);
431
432 cli.init();
433
434 long accum = 0;
435
436 for (int i = 0; i < opcount; i++) {
437 int keynum = random.nextInt(keyspace);
438 String key = "user" + keynum;
439 long st = System.currentTimeMillis();
440 Status result;
441 Vector<HashMap<String, ByteIterator>> scanResults = new Vector<>();
442 Set<String> scanFields = new HashSet<String>();
443 result = cli.scan("table1", "user2", 20, null, scanResults);
444
445 long en = System.currentTimeMillis();
446
447 accum += (en - st);
448
449 if (!result.equals(Status.OK)) {
450 System.out.println("Error " + result + " for " + key);
451 }
452
453 if (i % 10 == 0) {
454 System.out.println(i + " operations, average latency: " + (((double) accum) / ((double) i)));
455 }
456 }
457 } catch (Exception e) {
458 e.printStackTrace();
459 }
460 }
461 };
462 allthreads.add(t);
463 }

Callers

nothing calls this directly

Calls 4

initMethod · 0.95
scanMethod · 0.95
equalsMethod · 0.95
setPropertiesMethod · 0.45

Tested by

no test coverage detected