/** * Sets the value from any Boolean instance. * * @param value the value to set, not null * @throws NullPointerException if the object is null */ public void setValue(Object value) { setValue(((Boolean) value).booleanValue()); }
protected static ASTNode rewriteGroupingFunctionAST(final List<ASTNode> grpByAstExprs, ASTNode targetNode, final boolean noneSet) throws SemanticException { final MutableBoolean visited = new MutableBoolean(false); final MutableBoolean found = new MutableBoolean(false); if (visited.booleanValue() && !found.booleanValue()) { throw new SemanticException(ErrorMsg.HIVE_GROUPING_FUNCTION_EXPR_NOT_IN_GROUPBY.getMsg());
MutableBoolean firstAttempt = new MutableBoolean(true); Map<String, LookupExtractorFactoryContainer> lookupMap = RetryUtils.retry( () -> { if (firstAttempt.isTrue()) { firstAttempt.setValue(false); } else if (lookupConfig.getCoordinatorRetryDelay() > 0) {
public static boolean hasAllDefinitions(ObjectFilter filter) { final MutableBoolean hasAllDefinitions = new MutableBoolean(true); Visitor visitor = f -> { if (f instanceof ValueFilter) { ItemDefinition definition = ((ValueFilter<?,?>) f).getDefinition(); if (definition == null) { hasAllDefinitions.setValue(false); } } }; filter.accept(visitor); return hasAllDefinitions.booleanValue(); }
@Override public void process(long ledgerId, long entryStartPos, ByteBuf entry) { if (!stopScanning.booleanValue()) { if ((rangeEndPos != -1) && (entryStartPos > rangeEndPos)) { stopScanning.setValue(true); } else { int entrySize = entry.readableBytes(); /** * entrySize of an entry (inclusive of payload and * header) value is stored as int value in log file, but * it is not counted in the entrySize, hence for calculating * the end position of the entry we need to add additional * 4 (intsize of entrySize). Please check * EntryLogger.scanEntryLog. */ long entryEndPos = entryStartPos + entrySize + 4 - 1; if (((rangeEndPos == -1) || (entryStartPos <= rangeEndPos)) && (rangeStartPos <= entryEndPos)) { formatEntry(entryStartPos, entry, printMsg); entryFound.setValue(true); } } } } });
/** * Compares this object to the specified object. The result is <code>true</code> if and only if the argument is * not <code>null</code> and is an <code>MutableBoolean</code> object that contains the same * <code>boolean</code> value as this object. * * @param obj the object to compare with, null returns false * @return <code>true</code> if the objects are the same; <code>false</code> otherwise. */ public boolean equals(Object obj) { if (obj instanceof MutableBoolean) { return value == ((MutableBoolean) obj).booleanValue(); } return false; }
vals1 = pruneAndResolve(vals1, new MutableBoolean()); assertEquals("Must have one winning version", 1, vals1.size()); assertEquals("Must resolve to onlineClock", onlineClock1, vals1.get(0).getVersion());
List<YourClass> someList = new ArrayList<>(); MutableBoolean result = new MutableBoolean(true); someList.stream().map(YourClass::getBooleanMember).forEach(b -> result.setValue(result.getValue() && b));
final MutableBoolean safeDist = new MutableBoolean(safe); ConsoleProperties consoleComponent = getConsoleComponent(ConsoleProperties.class); final File file = consoleComponent.getDistributionDirectory().getFile(); if (safeDist.isTrue()) { if (safeDist.isFalse()) { ThreadUtils.sleep(1000); checkSafetyWithCacheState(fileDistribution, cacheStateCondition, fileCount);
GrinderProperties properties = new GrinderProperties(scriptFile); properties.setAssociatedFile(new File("long-time-prepare-test.properties")); final MutableBoolean timeouted = new MutableBoolean(false); console1.addListener(new SingleConsole.ConsoleShutdownListener() { @Override console1.startTest(properties); for (int i = 0; i < 20; i++) { if (timeouted.isTrue()) { break; assertTrue(timeouted.isTrue());
private static boolean lineExists(Optional<List<Map<String, Map<String, List<Map<String, String>>>>>> ordersOrNull, Line lineItem) { final String LINE_ITEMS = "lineItems"; final String ELEMENTS = "elements"; final String NOTE = "note"; MutableBoolean exists = new MutableBoolean(false); // if there is no order payload then the order hasn't already been posted so there can't be a duplicate line item ordersOrNull.ifPresent(orders -> { orders.stream().filter(order -> order.containsKey(LINE_ITEMS)) .map(order -> order.get(LINE_ITEMS)) .filter(lineItems -> lineItems.containsKey(ELEMENTS)) .flatMap(lineItems -> lineItems.get(ELEMENTS).stream()) .filter(element -> element.containsKey(NOTE) && element.get(NOTE).contains(lineItem.getNote())) .map(existingLine -> existingLine.get(NOTE)) .findAny() .ifPresent(n -> { System.out.println(String.format("Line item with note containing %s already exists in order.", lineItem.getNote())); exists.set(); }); }); return exists.get(); }
@Override public Boolean get() { final MutableBoolean result = new MutableBoolean(false); cache.accept(new CacheVisitor() { @Override public void visit(int numOutstandingMmaps, Map<ExtendedBlockId, ShortCircuitReplica> replicas, Map<ExtendedBlockId, InvalidToken> failedLoads, Map<Long, ShortCircuitReplica> evictable, Map<Long, ShortCircuitReplica> evictableMmapped) { Assert.assertEquals(expectedOutstandingMmaps, numOutstandingMmaps); ShortCircuitReplica replica = replicas.get(ExtendedBlockId.fromExtendedBlock(block)); Assert.assertNotNull(replica); Slot slot = replica.getSlot(); if ((expectedIsAnchorable != slot.isAnchorable()) || (expectedIsAnchored != slot.isAnchored())) { LOG.info("replica " + replica + " has isAnchorable = " + slot.isAnchorable() + ", isAnchored = " + slot.isAnchored() + ". Waiting for isAnchorable = " + expectedIsAnchorable + ", isAnchored = " + expectedIsAnchored); return; } result.setValue(true); } }); return result.toBoolean(); } }, 10, 60000);
replicaInfo1.getReplica().getMetaStream()); replicaInfo1.getReplica().unref(); final MutableBoolean triedToCreate = new MutableBoolean(false); do { Thread.sleep(10); replicaInfo2.getReplica().unref(); } while (triedToCreate.isFalse()); cache.close();
@Override public void run() { while (running.isTrue()) { for (ExecutorService executorServiceToWatch : poolsToObserve) { final ControlledThreadPoolExecutorService pool = (ControlledThreadPoolExecutorService) executorServiceToWatch;
MutableBoolean isAcceptable = new MutableBoolean(true); for (ProhibitedValueItemType prohibitedItemType: prohibitedValuesType.getItem()) { failAction.accept(prohibitedItemType); isAcceptable.setValue(false); return false; return isAcceptable.booleanValue();
/** * Get the dimensional offsets for the passed full offset. * * @param nonTemporalOffset * @return */ protected int[] getOffsets(int offset, MutableBoolean nodata) { int[] extentOffsets = scale.getCursor().getElementIndexes(offset); int[] dimensionOffsets = new int[dimensionCount]; int eIdx = 0, dIdx = 0; nodata.setValue(false); for (IExtent ext : scale) { for (int o : ext.getDimensionOffsets(extentOffsets[eIdx], true)) { dimensionOffsets[dIdx++] = o; } if (!nodata.booleanValue()) { nodata.setValue(!ext.isCovered(extentOffsets[eIdx])); } eIdx++; } return dimensionOffsets; }
@Override public boolean accept(long ledgerId) { return !stopScanning.booleanValue(); }
... final MutableBoolean finished = new MutableBoolean(false); new Thread(new Runnable(){ public void run() { doComplicatedStuff(finished); } }).start(); Thread.sleep(4000); finished.setValue(true);
final MutableBoolean calledCreate = new MutableBoolean(false); replicaInfos[0] = cache.fetchOrCreate( new ExtendedBlockId(0, "test_bp1"), Assert.assertTrue(calledCreate.isTrue());
List<Versioned<byte[]>> vals = lockHandle.getValues(); List<Integer> keyReplicas = routingPlan.getReplicationNodeList(routingPlan.getMasterPartitionId(key.get())); MutableBoolean didPrune = new MutableBoolean(false); List<Versioned<byte[]>> prunedVals = pruneNonReplicaEntries(vals, keyReplicas, if(didPrune.booleanValue()) { List<Versioned<byte[]>> resolvedVals = VectorClockUtils.resolveVersions(prunedVals);