int i = rnd.nextInt(nodePaths.size() + propertyPaths.size());
String path = i < nodePaths.size()
? nodePaths.get(i)
: propertyPaths.get(i - nodePaths.size());
long t1 = System.currentTimeMillis();
Item item = session.getItem(path);
long t2 = System.currentTimeMillis();
items.add(item);
return t2 - t1;
}
@Override
public String toString() {
return "getItem";
}
});
break;
}
case 1: { // getNode
callables.add(new Callable<Long>() {
public Long call() throws Exception {
String path = nodePaths.get(rnd.nextInt(nodePaths.size()));
long t1 = System.currentTimeMillis();
Node node = session.getNode(path);
long t2 = System.currentTimeMillis();
items.add(node);
return t2 - t1;
}
@Override
public String toString() {
return "getNode";
}
});
break;
}
case 2: { // getProperty
callables.add(new Callable<Long>() {
public Long call() throws Exception {
String path = propertyPaths.get(rnd.nextInt(propertyPaths.size()));
long t1 = System.currentTimeMillis();
Property property = session.getProperty(path);
long t2 = System.currentTimeMillis();
items.add(property);
return t2 - t1;
}
@Override
public String toString() {
return "getProperty";
}
});
break;
}
case 3: { // refresh
callables.add(new Callable<Long>() {
public Long call() throws Exception {
if (items.isEmpty()) {
return 0L;
}
Item item = items.get(rnd.nextInt(items.size()));
long t1 = System.currentTimeMillis();
item.refresh(rnd.nextBoolean());
long t2 = System.currentTimeMillis();
return t2 - t1;
}
@Override