/** * @return Number of active tasks per stripe. */ public boolean[] stripesActiveStatuses() { boolean[] res = new boolean[stripes()]; for (int i = 0; i < res.length; i++) res[i] = stripes[i].active; return res; }
awaitLatch = new CountDownLatch(stripes()); range(0, stripes()).forEach(idx -> execute(idx, awaitLatch::countDown)); ", awaitLatch=" + awaitLatch.getCount() + ", stripes=" + (stripes.length == 0 ? Arrays.toString(range(0, stripes()).toArray()) : Arrays.toString(stripes)) + ", queueSize=" + Arrays.toString(stripesQueueSizes()) + ", activeStatus=" + Arrays.toString(stripesActiveStatuses()));
/** * @return Completed tasks per stripe count. */ public long[] stripesCompletedTasks() { long[] res = new long[stripes()]; for (int i = 0; i < res.length; i++) res[i] = stripes[i].completedCnt; return res; }
/** {@inheritDoc} */ @Override public int getStripesCount() { return exec.stripes(); }
/** * @return Size of queue per stripe. */ public int[] stripesQueueSizes() { int[] res = new int[stripes()]; for (int i = 0; i < res.length; i++) res[i] = stripes[i].queueSize(); return res; }
/** * Calculate the maximum number of concurrent tasks for apply through the striped executor. * * @param exec Striped executor. * @return Number of permits. */ private int semaphorePertmits(StripedExecutor exec) { // 4 task per-stripe by default. int permits = exec.stripes() * 4; long maxMemory = Runtime.getRuntime().maxMemory(); // Heuristic calculation part of heap size as a maximum number of concurrent tasks. int permits0 = (int)((maxMemory * 0.2) / (4096 * 2)); // May be for small heap. Get a low number of permits. if (permits0 < permits) permits = permits0; // Property for override any calculation. return IgniteSystemProperties.getInteger(IGNITE_RECOVERY_SEMAPHORE_PERMITS, permits); }
assert semaphore != null; int stripes = exec.stripes();
/** * @return Number of active tasks per stripe. */ public boolean[] stripesActiveStatuses() { boolean[] res = new boolean[stripes()]; for (int i = 0; i < res.length; i++) res[i] = stripes[i].active; return res; }
/** * @return Completed tasks per stripe count. */ public long[] stripesCompletedTasks() { long[] res = new long[stripes()]; for (int i = 0; i < res.length; i++) res[i] = stripes[i].completedCnt; return res; }
/** {@inheritDoc} */ @Override public int getStripesCount() { return exec.stripes(); }
/** * @return Size of queue per stripe. */ public int[] stripesQueueSizes() { int[] res = new int[stripes()]; for (int i = 0; i < res.length; i++) res[i] = stripes[i].queueSize(); return res; }