WorkSection.limit(bs); try { Text buffer = new Text();
WorkSection.limit(bs); try { Text buffer = new Text();
WorkSection.limit(bs); bs.setRanges(Collections.singleton(new Range()));
try { s = ReplicationTable.getScanner(conn); WorkSection.limit(s); Entry<Key,Value> e = Iterables.getOnlyElement(s); log.info("Found entry: " + e.getKey().toStringNoTruncate());
for (int i = 0; i < 10 && notFound; i++) { s = ReplicationTable.getScanner(conn); WorkSection.limit(s); int elementsFound = Iterables.size(s); if (0 < elementsFound) { for (int i = 0; i < 10 && notFound; i++) { s = ReplicationTable.getScanner(conn); WorkSection.limit(s); int elementsFound = Iterables.size(s); if (2 == elementsFound) {
WorkSection.limit(s); for (Entry<Key,Value> entry : s) { Status status = Status.parseFrom(entry.getValue().get());
WorkSection.limit(s); for (Entry<Key,Value> entry : s) { Status status = Status.parseFrom(entry.getValue().get());
WorkSection.limit(bs); bs.setRanges(Collections.singleton(new Range()));
bs.setRanges(Collections.singleton(new Range())); StatusSection.limit(bs); WorkSection.limit(bs); IteratorSetting cfg = new IteratorSetting(50, WholeRowIterator.class); bs.addScanIterator(cfg);
WorkSection.limit(workScanner); workScanner.setRange(Range.exact(file));
for (int i = 0; i < 10 && notFound; i++) { s = ReplicationTable.getScanner(conn); WorkSection.limit(s); try { Entry<Key,Value> e = Iterables.getOnlyElement(s);
WorkSection.limit(s);
IteratorSetting cfg = new IteratorSetting(50, WholeRowIterator.class); StatusSection.limit(bs); WorkSection.limit(bs); bs.addScanIterator(cfg);
WorkSection.limit(s);
WorkSection.limit(bs); try { Text buffer = new Text();
@Test public void dontCreateWorkForEntriesWithNothingToReplicate() throws Exception { String table = testName.getMethodName(); conn.tableOperations().create(table); String tableId = conn.tableOperations().tableIdMap().get(table); String file = "hdfs://localhost:8020/accumulo/wal/123456-1234-1234-12345678"; Mutation m = new Mutation(new Path(file).toString()); m.put(StatusSection.NAME, new Text(tableId), StatusUtil.fileCreatedValue(System.currentTimeMillis())); BatchWriter bw = ReplicationTable.getBatchWriter(conn); bw.addMutation(m); bw.flush(); // Assert that we have one record in the status section Scanner s = ReplicationTable.getScanner(conn); StatusSection.limit(s); Assert.assertEquals(1, Iterables.size(s)); MockWorkMaker workMaker = new MockWorkMaker(conn); conn.tableOperations().setProperty(ReplicationTable.NAME, Property.TABLE_REPLICATION_TARGET.getKey() + "remote_cluster_1", "4"); workMaker.setBatchWriter(bw); // If we don't shortcircuit out, we should get an exception because // ServerConfiguration.getTableConfiguration // won't work with MockAccumulo workMaker.run(); s = ReplicationTable.getScanner(conn); WorkSection.limit(s); Assert.assertEquals(0, Iterables.size(s)); }
WorkSection.limit(workScanner); workScanner.setRange(Range.exact(file));
IteratorSetting cfg = new IteratorSetting(50, WholeRowIterator.class); StatusSection.limit(bs); WorkSection.limit(bs); bs.addScanIterator(cfg);