(partialTruncate.isPartiallyTruncated() && (partialTruncate.getMinActiveDLSN().compareTo(minActiveDLSN) < 0)))) { LogSegmentMetadata newSegment = metadataUpdater.setLogSegmentPartiallyTruncated( updateTxn, partialTruncate, minActiveDLSN);
Mutator(LogSegmentMetadata original) { super(original.getZkPath(), original.getVersion(), original.getLedgerId(), original.getFirstTxId()); this.inprogress = original.isInProgress(); this.logSegmentSequenceNo = original.getLogSegmentSequenceNumber(); this.lastEntryId = original.getLastEntryId(); this.lastSlotId = original.getLastSlotId(); this.lastTxId = original.getLastTxId(); this.completionTime = original.getCompletionTime(); this.recordCount = original.getRecordCount(); this.regionId = original.getRegionId(); this.status = original.getStatus(); this.minActiveEntryId = original.getMinActiveDLSN().getEntryId(); this.minActiveSlotId = original.getMinActiveDLSN().getSlotId(); this.startSequenceId = original.getStartSequenceId(); this.envelopeEntries = original.getEnvelopeEntries(); }
(l.getMinActiveDLSN().compareTo(nextReadDLSN) > 0)) { if (conf.getAlertWhenPositioningOnTruncated()) { alertStatsLogger.raise("Trying to position reader on {} when {} is marked partially truncated", long startBKEntry = 0; if (l.isPartiallyTruncated() && !conf.getIgnoreTruncationStatus()) { startBKEntry = l.getMinActiveDLSN().getEntryId(); readAheadCache.setMinActiveDLSN(l.getMinActiveDLSN());
@Test(timeout = 60000) public void testMutateTruncationStatus() { LogSegmentMetadata metadata = new LogSegmentMetadataBuilder( "/metadata", LogSegmentMetadataVersion.VERSION_V4_ENVELOPED_ENTRIES, 1L, 0L) .setRegionId(0).setLogSegmentSequenceNo(1L).build(); metadata = metadata.completeLogSegment("/completed-metadata", 1000L, 1000, 1000L, 0L, 0L); LogSegmentMetadata partiallyTruncatedSegment = metadata.mutator() .setTruncationStatus(TruncationStatus.PARTIALLY_TRUNCATED) .setMinActiveDLSN(new DLSN(1L, 500L, 0L)) .build(); LogSegmentMetadata fullyTruncatedSegment = partiallyTruncatedSegment.mutator() .setTruncationStatus(TruncationStatus.TRUNCATED) .build(); assertEquals(new DLSN(1L, 500L, 0L), fullyTruncatedSegment.getMinActiveDLSN()); }
ZKLogMetadata.getLogSegmentsPath(uri, name, conf.getUnpartitionedStreamName())); Assert.assertTrue(segmentList.get(truncDLSN.getLogSegmentSequenceNo()).getMinActiveDLSN().compareTo(truncDLSN) == 0);