public interface ResourceClaimManager
Modifier and Type | Method and Description |
---|---|
int |
decrementClaimantCount(ResourceClaim claim)
Decreases by 1 the count of how many FlowFiles hold a claim to a
particular piece of FlowFile content and returns the new count
|
void |
drainDestructableClaims(Collection<ResourceClaim> destination,
int maxElements)
Drains up to
maxElements Content Claims from the internal queue
of destructable content claims to the given destination so that
they can be destroyed. |
void |
drainDestructableClaims(Collection<ResourceClaim> destination,
int maxElements,
long timeout,
TimeUnit unit)
Drains up to
maxElements Content Claims from the internal queue
of destructable content claims to the given destination so that
they can be destroyed. |
int |
getClaimantCount(ResourceClaim claim) |
int |
incrementClaimantCount(ResourceClaim claim)
Increases by 1 the count of how many FlowFiles hold a claim to a
particular piece of FlowFile content and returns the new count
|
int |
incrementClaimantCount(ResourceClaim claim,
boolean newClaim)
Increases by 1 the count of how many FlowFiles hold a claim to a
particular piece of FlowFile content and returns the new count.
|
void |
markDestructable(ResourceClaim claim)
Indicates that the given ResourceClaim can now be destroyed by the
appropriate Content Repository.
|
ResourceClaim |
newResourceClaim(String container,
String section,
String id,
boolean lossTolerant)
Creates a new Resource Claim with the given id, container, section, and
loss tolerance.
|
void |
purge()
Clears the manager's memory of any and all ResourceClaims that it knows
about
|
ResourceClaim newResourceClaim(String container, String section, String id, boolean lossTolerant)
id
- of claimcontainer
- of claimsection
- of claimlossTolerant
- of claimint getClaimantCount(ResourceClaim claim)
claim
- to obtain reference count forint decrementClaimantCount(ResourceClaim claim)
claim
- to decrement claimants onint incrementClaimantCount(ResourceClaim claim)
claim
- to increment claims onint incrementClaimantCount(ResourceClaim claim, boolean newClaim)
true
as the second argument, as it may allow the manager to
optimize its tasks, knowing that the Content Claim cannot be referenced
by any other componentclaim
- to incrementnewClaim
- provides a hint that no other process can have access to this
claim right nowvoid markDestructable(ResourceClaim claim)
Using this method of marking the ResourceClaim as destructable only when the FlowFile repository has been synced with the underlying storage mechanism, we can ensure that on restart, we will not point to this unneeded claim. As such, it is now safe to destroy the contents.
claim
- to mark as now destructablevoid drainDestructableClaims(Collection<ResourceClaim> destination, int maxElements)
maxElements
Content Claims from the internal queue
of destructable content claims to the given destination
so that
they can be destroyed.destination
- to drain tomaxElements
- max items to drainvoid drainDestructableClaims(Collection<ResourceClaim> destination, int maxElements, long timeout, TimeUnit unit)
maxElements
Content Claims from the internal queue
of destructable content claims to the given destination
so that
they can be destroyed. If no ResourceClaim is ready to be destroyed at
this time, will wait up to the specified amount of time before returning.
If, after the specified amount of time, there is still no ResourceClaim
ready to be destroyed, the method will return without having added
anything to the given destination
.destination
- to drain tomaxElements
- max items to draintimeout
- maximum time to waitunit
- unit of time to waitvoid purge()
Copyright © 2015 Apache NiFi Project. All rights reserved.