IndexManager.DEBUG_RUN_SLOW.set(false);
}
}
private void runBackPressureViaQuery(final String tableName) throws InterruptedException {
final Iface client = getClient();
final BlurQuery blurQueryRow = new BlurQuery();
Query queryRow = new Query();
queryRow.setQuery("test.test:value");
blurQueryRow.setQuery(queryRow);
blurQueryRow.setUseCacheIfPresent(false);
blurQueryRow.setCacheResult(false);
blurQueryRow.setUuid("1234");
final AtomicReference<BlurException> error = new AtomicReference<BlurException>();
final AtomicBoolean fail = new AtomicBoolean();
System.gc();
System.gc();
MemoryMXBean memoryMXBean = ManagementFactory.getMemoryMXBean();
MemoryUsage usage = memoryMXBean.getHeapMemoryUsage();
long max = usage.getMax();
System.out.println("Max Heap [" + max + "]");
long used = usage.getUsed();
System.out.println("Used Heap [" + used + "]");
long limit = (long) (max * 0.80);
System.out.println("Limit Heap [" + limit + "]");
long difference = limit - used;
int sizeToAllocate = (int) ((int) difference * 0.50);
System.out.println("Allocating [" + sizeToAllocate + "] Heap [" + getHeapSize() + "] Max [" + getMaxHeapSize()
+ "]");
byte[] bufferToFillHeap = new byte[sizeToAllocate];
new Thread(new Runnable() {
@Override
public void run() {
try {
// This call will take several seconds to execute.
client.query(tableName, blurQueryRow);
fail.set(true);
} catch (BlurException e) {
System.out.println("-------------------");
System.out.println("-------------------");
System.out.println("-------------------");