public ContentClaim getContentClaim() throws IOException { final ContentClaim contentClaim = queue.poll(); if (contentClaim != null) { contentRepo.incrementClaimaintCount(contentClaim); return contentClaim; } final ContentClaim claim = contentRepo.create(false); registerStream(claim); return claim; }
@Override public int incrementClaimaintCount(final ContentClaim claim) { if (claim == null) { return 0; } final ContentClaim backupClaim = getBackupClaim(claim); if (backupClaim == null) { return claimManager.incrementClaimantCount(resolveClaim(claim).getResourceClaim()); } else { return getBackupRepository().incrementClaimaintCount(backupClaim); } }
contentRepository.incrementClaimaintCount(flowFile.getFlowFile().getContentClaim());
context.getContentRepository().incrementClaimaintCount(claim);
@Override public FlowFile clone(FlowFile example, final long offset, final long size) { verifyTaskActive(); example = validateRecordState(example); final StandardRepositoryRecord exampleRepoRecord = getRecord(example); final FlowFileRecord currRec = exampleRepoRecord.getCurrent(); final ContentClaim claim = exampleRepoRecord.getCurrentClaim(); if (offset + size > example.getSize()) { throw new FlowFileHandlingException("Specified offset of " + offset + " and size " + size + " exceeds size of " + example.toString()); } final StandardFlowFileRecord.Builder builder = new StandardFlowFileRecord.Builder().fromFlowFile(currRec); builder.id(context.getNextFlowFileSequence()); builder.contentClaimOffset(currRec.getContentClaimOffset() + offset); builder.size(size); final String newUuid = UUID.randomUUID().toString(); builder.addAttribute(CoreAttributes.UUID.key(), newUuid); final FlowFileRecord clone = builder.build(); if (claim != null) { context.getContentRepository().incrementClaimaintCount(claim); } final StandardRepositoryRecord record = new StandardRepositoryRecord(null); record.setWorking(clone, clone.getAttributes()); records.put(clone.getId(), record); if (offset == 0L && size == example.getSize()) { provenanceReporter.clone(example, clone); } else { registerForkEvent(example, clone); } return clone; }