/** * Creates a {@link Status} for newly-created data that must be replicated * * @param recordsIngested * Offset of records which need to be replicated * @return A {@link Status} tracking data that must be replicated */ public static Status ingestedUntil(long recordsIngested) { return ingestedUntil(Status.newBuilder(), recordsIngested); }
/** * Creates a {@link Status} for newly-created data that must be replicated * * @param recordsIngested * Offset of records which need to be replicated * @return A {@link Status} tracking data that must be replicated */ public static Status ingestedUntil(long recordsIngested) { return ingestedUntil(Status.newBuilder(), recordsIngested); }
@Test public void partiallyReplicatedReferencedWalsAreNotClosed() throws Exception { String file = "file:/accumulo/wal/tserver+port/12345"; Set<String> wals = Collections.singleton(file); BatchWriter bw = ReplicationTable.getBatchWriter(conn); Mutation m = new Mutation(file); StatusSection.add(m, "1", ProtobufUtil.toValue(StatusUtil.ingestedUntil(1000))); bw.addMutation(m); bw.close(); refs.updateReplicationEntries(conn, wals); Scanner s = ReplicationTable.getScanner(conn); Entry<Key,Value> entry = Iterables.getOnlyElement(s); Status status = Status.parseFrom(entry.getValue().get()); Assert.assertFalse(status.getClosed()); }