@Test public void testSendToNext() { expect(scanner.isRemembering()).andReturn(true); expect(scanner.getCassandra()).andReturn(supportMock).anyTimes(); expect(supportMock.getSession()).andReturn(sessionMock); expect(supportMock.getPreparedQuery(UPDATE_HASH_U)).andReturn(statementMock); expect(docMock.getHash()).andReturn("DEADBEEF"); expect(docMock.getId()).andReturn("42").anyTimes(); expect(docMock.getSourceScannerName()).andReturn("Arthur Dent"); expect(statementMock.bind("DEADBEEF", "42", "Arthur Dent")).andReturn(bsMock); expect(sessionMock.execute(bsMock)).andReturn(null); scanner.superSendToNext(docMock); replay(); scanner.sendToNext(docMock); }
@Override public void sendToNext(Document doc) { if (isRemembering()) { CqlSession session = getCassandra().getSession(); PreparedStatement preparedQuery = getCassandra().getPreparedQuery(UPDATE_HASH_U); BoundStatement bind = preparedQuery.bind(doc.getHash(), doc.getId(), doc.getSourceScannerName()); session.execute(bind); } superSendToNext(doc); }
ScannerImpl extends StepImpl implements Scanner { @Override public void sendToNext(Document doc) { if (isRemembering()) { CqlSession session = getCassandra().getSession(); PreparedStatement preparedQuery = getCassandra().getPreparedQuery(UPDATE_HASH_U); BoundStatement bind = preparedQuery.bind(doc.getHash(), doc.getId(), doc.getSourceScannerName()); session.execute(bind); } superSendToNext(doc); } }
ScannerImpl extends StepImpl implements Scanner { @Override public void sendToNext(Document doc) { if (isRemembering()) { CqlSession session = getCassandra().getSession(); PreparedStatement preparedQuery = getCassandra().getPreparedQuery(UPDATE_HASH_U); BoundStatement bind = preparedQuery.bind(doc.getHash(), doc.getId(), doc.getSourceScannerName()); session.execute(bind); } superSendToNext(doc); } protected  ScannerImpl(); }
ScannerImpl extends StepImpl implements Scanner { @Override public void sendToNext(Document doc) { if (isRemembering()) { CqlSession session = getCassandra().getSession(); PreparedStatement preparedQuery = getCassandra().getPreparedQuery(UPDATE_HASH_U); BoundStatement bind = preparedQuery.bind(doc.getHash(), doc.getId(), doc.getSourceScannerName()); session.execute(bind); } superSendToNext(doc); } protected  ScannerImpl(); @Override void activate(); @Override void deactivate(); void run(); @Override void sendToNext(Document doc); void docFound(Document doc); @Override Runnable getScanOperation(); @Override Optional<Document> fetchById(String id); @Override long getInterval(); @Override Step[] getSubsequentSteps(); @Override boolean add(Document document); @Override boolean offer(Document document); @Override Document remove(); @Override Document poll(); @Override Document element(); @Override Document peek(); @Override void put(Document document); @Override boolean offer(Document document, long timeout, TimeUnit unit); @Override Document take(); @Override Document poll(long timeout, TimeUnit unit); @Override int remainingCapacity(); @Override boolean remove(Object o); @Override boolean containsAll(Collection<?> c); @Override boolean addAll(Collection<? extends Document> c); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c); @Override void clear(); @Override boolean contains(Object o); @Override Iterator<Document> iterator(); @Override Object[] toArray(); @Override T[] toArray(T[] a); @Override int drainTo(Collection<? super Document> c); @Override int drainTo(Collection<? super Document> c, int maxElements); @Override boolean isEmpty(); @Override void advertise(); @Override void stopAdvertising(); @Override void acceptJiniRequests(); @Override void denyJiniRequests(); @Override boolean readyForJiniRequests(); boolean isScanActive(); void scanStarted(); void scanFinished(); boolean isRemembering(); boolean isHashing(); CassandraSupport getCassandra(); void setCassandra(CassandraSupport cassandra); }
ScannerImpl extends StepImpl implements Scanner { @Override public void sendToNext(Document doc) { if (isRemembering()) { CqlSession session = getCassandra().getSession(); PreparedStatement preparedQuery = getCassandra().getPreparedQuery(UPDATE_HASH_U); BoundStatement bind = preparedQuery.bind(doc.getHash(), doc.getId(), doc.getSourceScannerName()); session.execute(bind); } superSendToNext(doc); } protected  ScannerImpl(); @Override void activate(); @Override void deactivate(); void run(); @Override void sendToNext(Document doc); void docFound(Document doc); @Override Runnable getScanOperation(); @Override Optional<Document> fetchById(String id); @Override long getInterval(); @Override Step[] getSubsequentSteps(); @Override boolean add(Document document); @Override boolean offer(Document document); @Override Document remove(); @Override Document poll(); @Override Document element(); @Override Document peek(); @Override void put(Document document); @Override boolean offer(Document document, long timeout, TimeUnit unit); @Override Document take(); @Override Document poll(long timeout, TimeUnit unit); @Override int remainingCapacity(); @Override boolean remove(Object o); @Override boolean containsAll(Collection<?> c); @Override boolean addAll(Collection<? extends Document> c); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c); @Override void clear(); @Override boolean contains(Object o); @Override Iterator<Document> iterator(); @Override Object[] toArray(); @Override T[] toArray(T[] a); @Override int drainTo(Collection<? super Document> c); @Override int drainTo(Collection<? super Document> c, int maxElements); @Override boolean isEmpty(); @Override void advertise(); @Override void stopAdvertising(); @Override void acceptJiniRequests(); @Override void denyJiniRequests(); @Override boolean readyForJiniRequests(); boolean isScanActive(); void scanStarted(); void scanFinished(); boolean isRemembering(); boolean isHashing(); CassandraSupport getCassandra(); void setCassandra(CassandraSupport cassandra); static final int DEF_MAX_ERROR_RETRY; static final String FOR_SCANNER; static final String RESET_DOCS_U; static final String UPDATE_HASH_U; }