@Override public void onRecord(Key key, Record record) throws AerospikeException { sink.next(new KeyRecord(key, record)); } @Override
@Override public void onSuccess(Key key, Record record) { sink.success(new KeyRecord(key, record)); } @Override
@SuppressWarnings("unchecked") @Override public KeyRecord next() { KeyRecord keyRecord = null; if (this.recordSetIterator != null) { keyRecord = this.recordSetIterator.next(); } else if (this.resultSetIterator != null) { Map<String, Object> map = (Map<String, Object>) this.resultSetIterator.next(); Map<String, Object> meta = (Map<String, Object>) map.get(META_DATA); map.remove(META_DATA); Map<String, Object> binMap = new HashMap<String, Object>(map); if (log.isDebugEnabled()) { for (Map.Entry<String, Object> entry : map.entrySet()) { log.debug(entry.getKey() + " = " + entry.getValue()); } } Long generation = (Long) meta.get(GENERATION); Long ttl = (Long) meta.get(EXPIRY); Record record = new Record(binMap, generation.intValue(), ttl.intValue()); Key key = new Key(namespace, (byte[]) meta.get(DIGEST), (String) meta.get(SET_NAME), null); keyRecord = new KeyRecord(key, record); } else if (singleRecord != null) { keyRecord = singleRecord; singleRecord = null; } return keyRecord; }
@Override protected void parseRow(Key key) throws IOException { Record record = parseRecord(); if (! valid) { throw new AerospikeException.QueryTerminated(); } if (! recordSet.put(new KeyRecord(key, record))) { stop(); throw new AerospikeException.QueryTerminated(); } } }
@Override protected void parseRow(Key key) throws IOException { Record record = parseRecord(); if (! valid) { throw new AerospikeException.QueryTerminated(); } if (! recordSet.put(new KeyRecord(key, record))) { stop(); throw new AerospikeException.QueryTerminated(); } } }
return new KeyRecordIterator(stmt.getNamespace()); } else { KeyRecord keyRecord = new KeyRecord(key, record); return new KeyRecordIterator(stmt.getNamespace(), keyRecord);