@Path("status") @GET @Produces(MediaType.APPLICATION_JSON) public Response getClusterStatus() throws Exception { InstanceConfig config = context.getExhibitor().getConfigManager().getConfig(); ServerList serverList = new ServerList(config.getString(StringConfigs.SERVERS_SPEC)); ClusterStatusTask task = new ClusterStatusTask(context.getExhibitor(), serverList.getSpecs()); List<ServerStatus> statuses = context.getExhibitor().getForkJoinPool().invoke(task); GenericEntity<List<ServerStatus>> entity = new GenericEntity<List<ServerStatus>>(statuses){}; return Response.ok(entity).build(); }
private List<ServerStatus> getStatuses(ServerList serverList) { exhibitor.getLog().add(ActivityLog.Type.DEBUG, "Automatic Instance Management querying for instance statuses..."); ClusterStatusTask task = new ClusterStatusTask(exhibitor, serverList.getSpecs()); List<ServerStatus> statuses = exhibitor.getForkJoinPool().invoke(task); exhibitor.getLog().add(ActivityLog.Type.DEBUG, "Instance statuses query done."); return statuses; } }
public void test () { Log.info("CholTest::test enter"); for (int sz = 6000; sz < 10000; sz+=2000) { Log.info("CholTest::test sz is " + sz); DataSetup data = new DataSetup(sz, 12345); long start = System.currentTimeMillis(); CholeskyDecomposition jamaChol = new Matrix(data.xx).chol(); Log.info("JAMA CHOLESKY [N = " + sz + "] TAKES " + (System.currentTimeMillis() - start) + " MILLISECONDS."); if (!jamaChol.isSPD()) continue; ForkJoinPool fjp = new ForkJoinPool(32); for (int t = 2; t <= 32; t += 2) { for (int step : STEPS) fjp.invoke(new TestSetup(new DataSetup(data.xx),jamaChol.getL().getArray(),step,t)); } } Log.info("CholTest::test exit"); }
/** * Replaces elements with the results of applying the given * op to their indices. * @param op the op * @return this (to simplify use in expressions) */ public ParallelDoubleArrayWithFilter replaceWithMappedIndex(IntToDouble op) { ex.invoke(new PAS.FJDIndexMap(this, origin, fence, null, op)); return this; }
/** * Replaces elements with the results of applying the given * mapping to each index and current element value. * @param op the op * @return this (to simplify use in expressions) */ public ParallelDoubleArrayWithFilter replaceWithMappedIndex(IntAndDoubleToDouble op) { ex.invoke(new PAS.FJDBinaryIndexMap (this, origin, fence, null, op)); return this; }
/** * Replaces elements with results of applying the given generator. * @param generator the generator * @return this (to simplify use in expressions) */ public ParallelDoubleArrayWithFilter replaceWithGeneratedValue(DoubleGenerator generator) { ex.invoke(new PAS.FJDGenerate (this, origin, fence, null, generator)); return this; }
/** * Applies the given procedure to mapped elements. * @param procedure the procedure */ public void apply(Procedure<? super U> procedure) { ex.invoke(new PAS.FJOApply(this, origin, fence, null, procedure)); }
/** * Applies the given procedure to elements. * @param procedure the procedure */ public void apply(LongProcedure procedure) { ex.invoke(new PAS.FJLApply(this, origin, fence, null, procedure)); }
/** * Returns reduction of elements. * @param reducer the reducer * @param base the result for an empty array * @return reduction */ public U reduce(Reducer<U> reducer, U base) { PAS.FJOReduce f = new PAS.FJOReduce (this, origin, fence, null, reducer, base); ex.invoke(f); return (U)(f.result); }
/** * Replaces elements with the given value. * @param value the value * @return this (to simplify use in expressions) */ public ParallelLongArrayWithFilter replaceWithValue(long value) { ex.invoke(new PAS.FJLFill (this, origin, fence, null, value)); return this; }
/** * Replaces elements with the given value. * @param value the value * @return this (to simplify use in expressions) */ public ParallelArrayWithFilter<T> replaceWithValue(T value) { ex.invoke(new PAS.FJOFill(this, origin, fence, null, value)); return this; }
/** * Replaces elements with the results of applying the given * op to their indices. * @param op the op * @return this (to simplify use in expressions) */ public ParallelLongArrayWithFilter replaceWithMappedIndex(IntToLong op) { ex.invoke(new PAS.FJLIndexMap (this, origin, fence, null, op)); return this; }
/** * Returns summary statistics. * @param comparator the comparator to use for * locating minimum and maximum elements * @return the summary */ public ParallelLongArray.SummaryStatistics summary (LongComparator comparator) { PAS.FJLStats f = new PAS.FJLStats (this, origin, fence, null, comparator); ex.invoke(f); return f; }
/** * Returns summary statistics. * @param comparator the comparator to use for * locating minimum and maximum elements * @return the summary */ public ParallelDoubleArray.SummaryStatistics summary (DoubleComparator comparator) { PAS.FJDStats f = new PAS.FJDStats (this, origin, fence, null, comparator); ex.invoke(f); return f; }
public ParallelDoubleArrayWithBounds sort(DoubleComparator cmp) { ex.invoke(new PAS.FJDSorter (cmp, this.array, new double[fence], origin, fence - origin, getThreshold())); return this; }
public ParallelArray<U> all(Class<? super U> elementType) { PAS.FJOSelectAllDriver r = new PAS.FJOSelectAllDriver (this, elementType); ex.invoke(r); return new ParallelArray<U>(ex, (U[])(r.results)); }
public ParallelArrayWithBounds<T> cumulate(Reducer<T> reducer, T base) { PAS.FJOCumulateOp op = new PAS.FJOCumulateOp(this, reducer, base); PAS.FJOScan r = new PAS.FJOScan(null, op, origin, fence); ex.invoke(r); return this; }
public double precumulate(DoubleReducer reducer, double base) { PAS.FJDPrecumulateOp op = new PAS.FJDPrecumulateOp(this, reducer, base); PAS.FJDScan r = new PAS.FJDScan(null, op, origin, fence); ex.invoke(r); return r.out; }
public ParallelDoubleArrayWithBounds sort(DoubleComparator cmp) { ex.invoke(new PAS.FJDSorter (cmp, this.array, new double[fence], origin, fence - origin, getThreshold())); return this; }
public double precumulate(DoubleReducer reducer, double base) { PAS.FJDPrecumulateOp op = new PAS.FJDPrecumulateOp(this, reducer, base); PAS.FJDScan r = new PAS.FJDScan(null, op, origin, fence); ex.invoke(r); return r.out; }