@Test public void testDefragmentOldestBinFailsWhenTooManyBins() { runner.setProperty(MergeRecord.MIN_RECORDS, "5"); runner.setProperty(MergeRecord.MAX_RECORDS, "10"); runner.setProperty(MergeRecord.MAX_BIN_COUNT, "5"); runner.setProperty(MergeRecord.MERGE_STRATEGY, MergeRecord.MERGE_STRATEGY_DEFRAGMENT); final Map<String, String> attrs = new HashMap<>(); attrs.put(MergeRecord.FRAGMENT_COUNT_ATTRIBUTE, "5"); for (int i = 0; i < 5; i++) { attrs.put(MergeRecord.FRAGMENT_ID_ATTRIBUTE, String.valueOf(i)); runner.enqueue("Name, Age\nJohn, 3" + i, attrs); } runner.run(1, false); runner.assertTransferCount(MergeRecord.REL_MERGED, 0); runner.assertTransferCount(MergeRecord.REL_ORIGINAL, 0); runner.assertTransferCount(MergeRecord.REL_FAILURE, 0); attrs.put(MergeRecord.FRAGMENT_ID_ATTRIBUTE, "5"); runner.enqueue("Name, Age\nJohn, 35", attrs); assertEquals(5, ((MergeRecord) runner.getProcessor()).getBinCount()); runner.run(1, false, false); runner.assertTransferCount(MergeRecord.REL_MERGED, 0); runner.assertTransferCount(MergeRecord.REL_ORIGINAL, 0); runner.assertTransferCount(MergeRecord.REL_FAILURE, 1); assertEquals(5, ((MergeRecord) runner.getProcessor()).getBinCount()); }
int getBinCount() { return binManager.get().getBinCount(); }
MergeRecord extends AbstractSessionFactoryProcessor { int getBinCount() { return binManager.get().getBinCount(); } }
MergeRecord extends AbstractSessionFactoryProcessor { int getBinCount() { return binManager.get().getBinCount(); }  }
MergeRecord extends AbstractSessionFactoryProcessor { int getBinCount() { return binManager.get().getBinCount(); }  @Override Set<Relationship> getRelationships(); @OnStopped final void resetState(); @Override void onTrigger(final ProcessContext context, final ProcessSessionFactory sessionFactory); }
MergeRecord extends AbstractSessionFactoryProcessor { int getBinCount() { return binManager.get().getBinCount(); }  @Override Set<Relationship> getRelationships(); @OnStopped final void resetState(); @Override void onTrigger(final ProcessContext context, final ProcessSessionFactory sessionFactory); static final String FRAGMENT_ID_ATTRIBUTE; static final String FRAGMENT_INDEX_ATTRIBUTE; static final String FRAGMENT_COUNT_ATTRIBUTE; static final String MERGE_COUNT_ATTRIBUTE; static final String MERGE_BIN_AGE_ATTRIBUTE; static final String MERGE_UUID_ATTRIBUTE; static final AllowableValue MERGE_STRATEGY_BIN_PACK; static final AllowableValue MERGE_STRATEGY_DEFRAGMENT; static final PropertyDescriptor RECORD_READER; static final PropertyDescriptor RECORD_WRITER; static final PropertyDescriptor MERGE_STRATEGY; static final PropertyDescriptor CORRELATION_ATTRIBUTE_NAME; static final PropertyDescriptor MIN_SIZE; static final PropertyDescriptor MAX_SIZE; static final PropertyDescriptor MIN_RECORDS; static final PropertyDescriptor MAX_RECORDS; static final PropertyDescriptor MAX_BIN_COUNT; static final PropertyDescriptor MAX_BIN_AGE; static final Relationship REL_MERGED; static final Relationship REL_ORIGINAL; static final Relationship REL_FAILURE; }