public boolean containsKey(K key) { synchronized (_lock) { return _rotatingMap.containsKey(key); } }
/** * Returns list of groups for a user * * @param user get groups for this user * @return list of groups for a given user */ @Override public Set<String> getGroups(String user) throws IOException { synchronized (this) { rotateIfNeeded(); if (cachedGroups.containsKey(user)) { return cachedGroups.get(user); } } Set<String> groups = getUnixGroups(user); if (!groups.isEmpty()) { synchronized (this) { cachedGroups.put(user, groups); } } return groups; }
if (batchMessageMap.containsKey(tx.getTransactionId())) { LOG.warn("FAILED duplicate batch with transaction id " + tx.getTransactionId() + "/" + tx.getAttemptId() + " for " + name); fail(tx.getTransactionId(), batchMessageMap.get(tx.getTransactionId()));
@Override public void emitBatch(TransactionAttempt tx, Object coordinatorMeta, TridentCollector collector) { long txid = tx.getTransactionId(); long now = System.currentTimeMillis(); if (now - lastRotate > rotateTime) { Map<Long, List<Object>> failed = idsMap.rotate(); for (Long id : failed.keySet()) { //TODO: this isn't right... it's not in the map anymore fail(id); } lastRotate = now; } if (idsMap.containsKey(txid)) { fail(txid); } _collector.reset(collector); if (!prepared) { _spout.open(_conf, _context, new SpoutOutputCollector(_collector)); prepared = true; } for (int i = 0; i < _maxBatchSize; i++) { _spout.nextTuple(); if (_collector.numEmitted < i) { break; } } idsMap.put(txid, _collector.ids); _collector.pendingCount = idsMap.size(); }
public boolean containsKey(K key) { synchronized(_lock) { return _rotatingMap.containsKey(key); } }
@Override protected void removeQuery(String id) { // Only update count if query was in queries or postFinishBuffer. if (queries.containsKey(id) || postFinishBuffer.containsKey(id)) { updateCount(activeQueriesCount, -1L); } queries.remove(id); postFinishBuffer.remove(id); bufferedMetadata.remove(id); // It should not be in the preStartBuffer under normal operations but could be if it was killed. preStartBuffer.remove(id); }
@Override protected void removeQuery(String id) { // Only update count if query was in queries or postFinishBuffer. if (queries.containsKey(id) || postFinishBuffer.containsKey(id)) { updateCount(activeQueriesCount, -1L); } queries.remove(id); postFinishBuffer.remove(id); bufferedMetadata.remove(id); // It should not be in the preStartBuffer under normal operations but could be if it was killed. preStartBuffer.remove(id); }
if(batchMessageMap.containsKey(tx.getTransactionId())) { LOG.warn("FAILED duplicate batch with transaction id "+tx.getTransactionId()+"/"+tx.getAttemptId()+" for "+name); fail(tx.getTransactionId(), batchMessageMap.get(tx.getTransactionId()));
if(batchMessageMap.containsKey(tx.getTransactionId())) { LOG.warn("FAILED duplicate batch with transaction id "+tx.getTransactionId()+"/"+tx.getAttemptId()+" for "+name); fail(tx.getTransactionId(), batchMessageMap.get(tx.getTransactionId()));
if(idsMap.containsKey(txid)) { fail(txid);