private List<Runnable> loadQOperations() {
List<Runnable> operations = new ArrayList<Runnable>();
addOperation(operations, new Runnable() {
public void run() {
IQueue q = hazelcast.getQueue("myQ");
q.offer(new byte[100]);
}
}, 10);
addOperation(operations, new Runnable() {
public void run() {
IQueue q = hazelcast.getQueue("myQ");
try {
q.offer(new byte[100], 10, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}, 10);
addOperation(operations, new Runnable() {
public void run() {
IQueue q = hazelcast.getQueue("myQ");
q.contains(new byte[100]);
}
}, 1);
addOperation(operations, new Runnable() {
public void run() {
IQueue q = hazelcast.getQueue("myQ");
q.isEmpty();
}
}, 1);
addOperation(operations, new Runnable() {
public void run() {
IQueue q = hazelcast.getQueue("myQ");
q.size();
}
}, 1);
addOperation(operations, new Runnable() {
public void run() {
IQueue q = hazelcast.getQueue("myQ");
q.remove(new byte[100]);
}
}, 1);
addOperation(operations, new Runnable() {
public void run() {
IQueue q = hazelcast.getQueue("myQ");
q.remainingCapacity();
}
}, 1);
addOperation(operations, new Runnable() {
public void run() {
IQueue q = hazelcast.getQueue("myQ");
q.poll();
}
}, 10);
addOperation(operations, new Runnable() {
public void run() {
IQueue q = hazelcast.getQueue("myQ");
q.add(new byte[100]);
}
}, 10);
addOperation(operations, new Runnable() {
public void run() {
IQueue q = hazelcast.getQueue("myQ");
try {
q.take();
} catch (InterruptedException e) {
throw new RuntimeException(e);
}
}
}, 10);
addOperation(operations, new Runnable() {
public void run() {
IQueue q = hazelcast.getQueue("myQ");
List list = new ArrayList();
for (int i = 0; i < 10; i++) {
list.add(new byte[100]);
}
q.addAll(list);
}
}, 1);
addOperation(operations, new Runnable() {
public void run() {
IQueue q = hazelcast.getQueue("myQ");
List list = new ArrayList();
q.drainTo(list);
}
}, 1);
return operations;
}