@Override public KeyRecord next() { KeyRecord kr = recordSet.record; more = recordSet.next(); return kr; }
RecordSetIterator(RecordSet recordSet) { this.recordSet = recordSet; more = this.recordSet.next(); }
@Override public KeyRecord next() { KeyRecord kr = recordSet.record; more = recordSet.next(); return kr; }
RecordSetIterator(RecordSet recordSet) { this.recordSet = recordSet; more = this.recordSet.next(); }
RecordSet recordSet = client.query(null, statement); while (recordSet.next()) {
@Override public long getCommittedWindowId(String appId, int operatorId) { try { lastWindowFetchCommand.setFilters(Filter.equal(metaTableOperatorIdColumn, operatorId)); lastWindowFetchCommand.setFilters(Filter.equal(metaTableAppIdColumn, appId)); long lastWindow = -1; RecordSet recordSet = client.query(null, lastWindowFetchCommand); while(recordSet.next()) { lastWindow = Long.parseLong(recordSet.getRecord().getValue(metaTableWindowColumn).toString()); } return lastWindow; } catch (AerospikeException ex) { throw new RuntimeException(ex); } }
@Override public long getCommittedWindowId(String appId, int operatorId) { try { lastWindowFetchCommand.setFilters(Filter.equal(metaTableOperatorIdColumn, operatorId)); lastWindowFetchCommand.setFilters(Filter.equal(metaTableAppIdColumn, appId)); long lastWindow = -1; RecordSet recordSet = client.query(null, lastWindowFetchCommand); while (recordSet.next()) { lastWindow = Long.parseLong(recordSet.getRecord().getValue(metaTableWindowColumn).toString()); } return lastWindow; } catch (AerospikeException ex) { throw new RuntimeException(ex); } }
/** * This executes the query to retrieve result from database. * It then converts each row into tuple and emit that into output port. */ @Override public void emitTuples() { Statement query = queryToRetrieveData(); logger.debug(String.format("select statement: %s", query.toString())); RecordSet rs; try { rs = store.getClient().query(null, query); while(rs.next()){ Record rec = rs.getRecord(); T tuple = getTuple(rec); outputPort.emit(tuple); } } catch (Exception ex) { store.disconnect(); DTThrowable.rethrow(ex); } } }
/** * This executes the query to retrieve result from database. * It then converts each row into tuple and emit that into output port. */ @Override public void emitTuples() { Statement query = queryToRetrieveData(); logger.debug(String.format("select statement: %s", query.toString())); RecordSet rs; try { rs = store.getClient().query(null, query); while (rs.next()) { Record rec = rs.getRecord(); T tuple = getTuple(rec); outputPort.emit(tuple); } } catch (Exception ex) { store.disconnect(); DTThrowable.rethrow(ex); } } }
int count = 0; while (rs.next()) { Key key = rs.getKey(); Record record = rs.getRecord();
Set <String> uniques = new HashSet<String>(); while (rs.next()) { Record record = rs.getRecord();
static long getNumOfEventsInStore() { AerospikeClient client = null; try { long count = 0; client = new AerospikeClient(NODE, PORT); Statement stmnt = new Statement(); stmnt.setNamespace(NAMESPACE); stmnt.setSetName(SET_NAME); RecordSet rs = client.query(null, stmnt); while (rs.next()) { count++; } return count; } catch (AerospikeException e) { LOG.error("getNumOfEventsInStore failed: {}", e); throw e; } finally { if (null != client) { client.close(); } } }
while (rs.next()) { Record record = rs.getRecord(); console.info("Record: " + record.toString());
static void cleanTable() { AerospikeClient client = null; try { client = new AerospikeClient(NODE, PORT); Statement stmnt = new Statement(); stmnt.setNamespace(NAMESPACE); stmnt.setSetName(SET_NAME); RecordSet rs = client.query(null, stmnt); while (rs.next()) { client.delete(null, rs.getKey()); } } catch (AerospikeException e) { LOG.error("cleanTable failed: {}", e); throw e; } finally { if (null != client) { client.close(); } } }
static void cleanMetaTable() { AerospikeClient client = null; try { client = new AerospikeClient(NODE, PORT); Statement stmnt = new Statement(); stmnt.setNamespace(NAMESPACE); stmnt.setSetName(AerospikeTransactionalStore.DEFAULT_META_SET); RecordSet rs = client.query(null, stmnt); while (rs.next()) { client.delete(null, rs.getKey()); } } catch (AerospikeException e) { LOG.error("cleanMetaTable failed: {}", e); throw e; } finally { if (null != client) { client.close(); } } }
static boolean checkEvents() { long count = 0; AerospikeClient client = null; try { client = new AerospikeClient(NODE, PORT); Statement stmnt = new Statement(); stmnt.setNamespace(NAMESPACE); stmnt.setSetName(SET_NAME); RecordSet rs = client.query(null, stmnt); while ( rs.next() ) { Record record = rs.getRecord(); Key key = rs.getKey(); if (!TestPOJO.check(key, record)) { return false; } count++; } } catch (AerospikeException e) { throw new RuntimeException("Error fetching records: ", e); } finally { if (null != client) { client.close(); } } return NUM_TUPLES == count; }
while (rs.next()) { Record record = rs.getRecord(); console.info("Record: " + record.toString());
int count = 0; while (rs.next()) { Key key = rs.getKey(); Record record = rs.getRecord();
int count = 0; while (rs.next()) { Key key = rs.getKey(); Record record = rs.getRecord();
while (rs.next()) { Record record = rs.getRecord(); console.info("Record: " + record.toString());