@Override public boolean contains(Object o) { //noinspection SuspiciousMethodCalls return this.delegatee.containsKey(o); }
/** @return <tt>true</tt> if this map contains a mapping for the specified key */ public boolean containsKey(GroupPartitionId key) { return readMap.containsKey(key); }
@Override public boolean containsKey(Object key) { try { return delegate.containsKey(checkValid(key)); } catch (NullPointerException | ClassCastException e) { return false; } }
/** * Searches this {@code TreeSet} for the specified object. * * @param object * the object to search for. * @return {@code true} if {@code object} is an element of this * {@code TreeSet}, {@code false} otherwise. * @throws ClassCastException * when the object cannot be compared with the elements in this * {@code TreeSet}. * @throws NullPointerException * when the object is null and the comparator cannot handle * null. */ @Override public boolean contains(Object object) { return backingMap.containsKey(object); }
private boolean check(byte[] row, byte[] family, byte[] qualifier, byte[] value) { if (value == null || value.length == 0) return !data.containsKey(row) || !data.get(row).containsKey(family) || !data.get(row).get(family).containsKey(qualifier); else return data.containsKey(row) && data.get(row).containsKey(family) && data.get(row).get(family).containsKey(qualifier) && !data.get(row).get(family).get(qualifier).isEmpty() && Arrays.equals(data.get(row).get(family).get(qualifier).lastEntry().getValue(), value); }
@CollectionSize.Require(absent = ZERO) public void testTailMapInclusive() { assertTrue(navigableMap.tailMap(a.getKey(), true).containsKey(a.getKey())); } }
@CollectionSize.Require(absent = ZERO) public void testTailMapExclusive() { assertFalse(navigableMap.tailMap(a.getKey(), false).containsKey(a.getKey())); }
@CollectionSize.Require(absent = ZERO) public void testHeadMapExclusive() { assertFalse(navigableMap.headMap(a.getKey(), false).containsKey(a.getKey())); }
@CollectionSize.Require(absent = ZERO) public void testHeadMapInclusive() { assertTrue(navigableMap.headMap(a.getKey(), true).containsKey(a.getKey())); }
public static Schema resolveBinaryOperatorResultType(final Schema.Type left, final Schema.Type right) { if (left == Schema.Type.STRING && right == Schema.Type.STRING) { return Schema.OPTIONAL_STRING_SCHEMA; } if (!TYPE_TO_SCHEMA.containsKey(left) || !TYPE_TO_SCHEMA.containsKey(right)) { throw new KsqlException("Unsupported arithmetic types. " + left + " " + right); } return TYPE_TO_SCHEMA.ceilingEntry(ARITHMETIC_TYPE_ORDERING.max(left, right)).getValue(); }
break; Long ack=ack_promise.getResult(500); if((Objects.equals(ack, seqno)) || !forward_table.containsKey(seqno)) break;
@Override public V get(K key) { LOG.debug("get key '{}'", key); byte[] redisKey = encoder.encodeKey(key); byte[] redisValue = null; if (pendingPrepare.containsKey(redisKey)) { redisValue = pendingPrepare.get(redisKey); } else if (pendingCommit.containsKey(redisKey)) { redisValue = pendingCommit.get(redisKey); } else { RedisCommands commands = null; try { commands = container.getInstance(); redisValue = commands.hget(namespace, redisKey); } finally { container.returnInstance(commands); } } V value = null; if (redisValue != null) { value = encoder.decodeValue(redisValue); } LOG.debug("Value for key '{}' is '{}'", key, value); return value; }
if (!topHist.containsKey(topVer)) { assert topHist.isEmpty() || topHist.lastKey() == topVer - 1 : "lastVer=" + (topHist.isEmpty() ? null : topHist.lastKey()) +
@Override public V get(K key) { LOG.debug("get key '{}'", key); byte[] columnKey = encoder.encodeKey(key); byte[] columnValue = null; if (pendingPrepare.containsKey(columnKey)) { columnValue = pendingPrepare.get(columnKey); } else if (pendingCommit.containsKey(columnKey)) { columnValue = pendingCommit.get(columnKey); } else { HBaseProjectionCriteria criteria = new HBaseProjectionCriteria(); HBaseProjectionCriteria.ColumnMetaData column = new HBaseProjectionCriteria.ColumnMetaData(columnFamily, STATE_QUALIFIER); criteria.addColumn(column); Get get = hbaseClient.constructGetRequests(getRowKeyForStateKey(columnKey), criteria); try { Result[] results = hbaseClient.batchGet(Collections.singletonList(get)); Result result = results[0]; columnValue = result.getValue(column.getColumnFamily(), column.getQualifier()); } catch (Exception e) { throw new RuntimeException(e); } } V value = null; if (columnValue != null) { value = encoder.decodeValue(columnValue); } LOG.debug("Value for key '{}' is '{}'", key, value); return value; }
@Test public void testBulkLoadWALEdits() throws Exception { // 1. Get the bulk load wal edit event NavigableMap<byte[], Integer> scope = new TreeMap<>(Bytes.BYTES_COMPARATOR); WALEdit logEdit = getBulkLoadWALEdit(scope); // 2. Create wal key WALKeyImpl logKey = new WALKeyImpl(scope); // 3. Enable bulk load hfile replication Configuration bulkLoadConf = HBaseConfiguration.create(conf); bulkLoadConf.setBoolean(HConstants.REPLICATION_BULKLOAD_ENABLE_KEY, true); // 4. Get the scopes for the key ReplicationSourceWALActionListener.scopeWALEdits(logKey, logEdit, bulkLoadConf); NavigableMap<byte[], Integer> scopes = logKey.getReplicationScopes(); // Assert family with replication scope global is present in the key scopes assertTrue("This family scope is set to global, should be part of replication key scopes.", scopes.containsKey(f1)); // Assert family with replication scope local is not present in the key scopes assertFalse("This family scope is set to local, should not be part of replication key scopes", scopes.containsKey(f2)); }
: positiveRangesByLowerBound.higherKey(positiveItr.peek().upperBound); } else if (!complementLowerBoundWindow.contains(Cut.<C>belowAll()) || positiveRangesByLowerBound.containsKey(Cut.belowAll())) { return Iterators.emptyIterator(); } else {
: positiveRangesByLowerBound.higherKey(positiveItr.peek().upperBound); } else if (!complementLowerBoundWindow.contains(Cut.<C>belowAll()) || positiveRangesByLowerBound.containsKey(Cut.belowAll())) { return Iterators.emptyIterator(); } else {
/** Fails if the map's first key is not equal to the given key. */ public void hasFirstKey(@NullableDecl Object key) { if (actualAsNavigableMap().isEmpty()) { fail("has first key", key); return; } if (!Objects.equal(actualAsNavigableMap().firstKey(), key)) { if (actualAsNavigableMap().containsKey(key)) { failWithoutActual( simpleFact( lenientFormat( "Not true that %s has first key <%s>. " + "It does contain this key, but the first key is <%s>", actualAsString(), key, actualAsNavigableMap().firstKey()))); return; } failWithoutActual( simpleFact( lenientFormat( "Not true that %s has first key <%s>. " + "It does not contain this key, and the first key is <%s>", actualAsString(), key, actualAsNavigableMap().firstKey()))); } }
/** Fails if the map's last key is not equal to the given key. */ public void hasLastKey(@NullableDecl Object key) { if (actualAsNavigableMap().isEmpty()) { fail("has last key", key); return; } if (!Objects.equal(actualAsNavigableMap().lastKey(), key)) { if (actualAsNavigableMap().containsKey(key)) { failWithoutActual( simpleFact( lenientFormat( "Not true that %s has last key <%s>. " + "It does contain this key, but the last key is <%s>", actualAsString(), key, actualAsNavigableMap().lastKey()))); return; } failWithoutActual( simpleFact( lenientFormat( "Not true that %s has last key <%s>. " + "It does not contain this key, and the last key is <%s>", actualAsString(), key, actualAsNavigableMap().lastKey()))); } }
: positiveRangesByLowerBound.higherKey(positiveItr.peek().upperBound); } else if (!complementLowerBoundWindow.contains(Cut.<C>belowAll()) || positiveRangesByLowerBound.containsKey(Cut.belowAll())) { return Iterators.emptyIterator(); } else {