public static ResourceClaim getResourceClaim(final Record record, final ResourceClaimManager claimManager) { final String container = (String) record.getFieldValue(ContentClaimSchema.CLAIM_CONTAINER); final String section = (String) record.getFieldValue(ContentClaimSchema.CLAIM_SECTION); final String identifier = (String) record.getFieldValue(ContentClaimSchema.CLAIM_IDENTIFIER); final Boolean lossTolerant = (Boolean) record.getFieldValue(ContentClaimSchema.LOSS_TOLERANT); // Make sure that we preserve the existing ResourceClaim, if there is already one held by the Resource Claim Manager // because we need to honor its determination of whether or not the claim is writable. If the Resource Claim Manager // does not have a copy of this Resource Claim, then we can go ahead and just create one and assume that it is not // writable (because if it were writable, then the Resource Claim Manager would know about it). ResourceClaim resourceClaim = claimManager.getResourceClaim(container, section, identifier); if (resourceClaim == null) { resourceClaim = claimManager.newResourceClaim(container, section, identifier, lossTolerant, false); } return resourceClaim; }
resourceClaim = claimManager.getResourceClaim(container, section, claimId); if (resourceClaim == null) { logger.error("Swap file indicates that FlowFile was referencing Resource Claim at container={}, section={}, claimId={}, "
public static ContentClaim getContentClaim(final Record claimRecord, final ResourceClaimManager resourceClaimManager) { final Record resourceClaimRecord = (Record) claimRecord.getFieldValue(ContentClaimSchema.RESOURCE_CLAIM); final String container = (String) resourceClaimRecord.getFieldValue(ContentClaimSchema.CLAIM_CONTAINER); final String section = (String) resourceClaimRecord.getFieldValue(ContentClaimSchema.CLAIM_SECTION); final String identifier = (String) resourceClaimRecord.getFieldValue(ContentClaimSchema.CLAIM_IDENTIFIER); final Boolean lossTolerant = (Boolean) resourceClaimRecord.getFieldValue(ContentClaimSchema.LOSS_TOLERANT); final Long length = (Long) claimRecord.getFieldValue(ContentClaimSchema.CONTENT_CLAIM_LENGTH); final Long resourceOffset = (Long) claimRecord.getFieldValue(ContentClaimSchema.RESOURCE_CLAIM_OFFSET); // Make sure that we preserve the existing ResourceClaim, if there is already one held by the Resource Claim Manager // because we need to honor its determination of whether or not the claim is writable. If the Resource Claim Manager // does not have a copy of this Resource Claim, then we can go ahead and just create one and assume that it is not // writable (because if it were writable, then the Resource Claim Manager would know about it). ResourceClaim resourceClaim = resourceClaimManager.getResourceClaim(container, section, identifier); if (resourceClaim == null) { resourceClaim = resourceClaimManager.newResourceClaim(container, section, identifier, lossTolerant, false); } final StandardContentClaim contentClaim = new StandardContentClaim(resourceClaim, resourceOffset); contentClaim.setLength(length); return contentClaim; }
ResourceClaim resourceClaim = resourceClaimManager.getResourceClaim(event.getPreviousContentClaimContainer(), event.getPreviousContentClaimSection(), event.getPreviousContentClaimIdentifier()); if (resourceClaim == null) {
public static ResourceClaim getResourceClaim(final Record record, final ResourceClaimManager claimManager) { final String container = (String) record.getFieldValue(ContentClaimSchema.CLAIM_CONTAINER); final String section = (String) record.getFieldValue(ContentClaimSchema.CLAIM_SECTION); final String identifier = (String) record.getFieldValue(ContentClaimSchema.CLAIM_IDENTIFIER); final Boolean lossTolerant = (Boolean) record.getFieldValue(ContentClaimSchema.LOSS_TOLERANT); // Make sure that we preserve the existing ResourceClaim, if there is already one held by the Resource Claim Manager // because we need to honor its determination of whether or not the claim is writable. If the Resource Claim Manager // does not have a copy of this Resource Claim, then we can go ahead and just create one and assume that it is not // writable (because if it were writable, then the Resource Claim Manager would know about it). ResourceClaim resourceClaim = claimManager.getResourceClaim(container, section, identifier); if (resourceClaim == null) { resourceClaim = claimManager.newResourceClaim(container, section, identifier, lossTolerant, false); } return resourceClaim; }
public static ContentClaim getContentClaim(final Record claimRecord, final ResourceClaimManager resourceClaimManager) { final Record resourceClaimRecord = (Record) claimRecord.getFieldValue(ContentClaimSchema.RESOURCE_CLAIM); final String container = (String) resourceClaimRecord.getFieldValue(ContentClaimSchema.CLAIM_CONTAINER); final String section = (String) resourceClaimRecord.getFieldValue(ContentClaimSchema.CLAIM_SECTION); final String identifier = (String) resourceClaimRecord.getFieldValue(ContentClaimSchema.CLAIM_IDENTIFIER); final Boolean lossTolerant = (Boolean) resourceClaimRecord.getFieldValue(ContentClaimSchema.LOSS_TOLERANT); final Long length = (Long) claimRecord.getFieldValue(ContentClaimSchema.CONTENT_CLAIM_LENGTH); final Long resourceOffset = (Long) claimRecord.getFieldValue(ContentClaimSchema.RESOURCE_CLAIM_OFFSET); // Make sure that we preserve the existing ResourceClaim, if there is already one held by the Resource Claim Manager // because we need to honor its determination of whether or not the claim is writable. If the Resource Claim Manager // does not have a copy of this Resource Claim, then we can go ahead and just create one and assume that it is not // writable (because if it were writable, then the Resource Claim Manager would know about it). ResourceClaim resourceClaim = resourceClaimManager.getResourceClaim(container, section, identifier); if (resourceClaim == null) { resourceClaim = resourceClaimManager.newResourceClaim(container, section, identifier, lossTolerant, false); } final StandardContentClaim contentClaim = new StandardContentClaim(resourceClaim, resourceOffset); contentClaim.setLength(length); return contentClaim; }