@API(value=EXPERIMENTAL) public class ResolverMappingReplicator extends Object implements AutoCloseable
LocatableResolver
to another. This can be useful for migrating between different
underlying LocatableResolver
implementations. The copy operation is not transactional so the resulting copy
will not be a consistent snapshot of the original. It is the responsibility of the caller to ensure that the copied
snapshot is consistent by, for example, preventing any writes to the resolver
(see LocatableResolver.enableWriteLock()
). After copying, the allocation window on the replica
will be set to the largest value seen during the copy operation. This means that all allocations in the replica will
be larger than any value present in the original. Note, copying to ScopedDirectoryLayer
is not supported.Constructor and Description |
---|
ResolverMappingReplicator(LocatableResolver primary) |
ResolverMappingReplicator(LocatableResolver primary,
int transactionRowLimit) |
ResolverMappingReplicator(LocatableResolver primary,
int transactionRowLimit,
long transactionTimeLimitMillis) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
copyTo(LocatableResolver replica)
Copy the mappings stored in a
LocatableResolver to the specified replica. |
CompletableFuture<Void> |
copyToAsync(LocatableResolver replica)
Copy the mappings stored in a
LocatableResolver to the specified replica. |
String |
toString() |
public ResolverMappingReplicator(@Nonnull LocatableResolver primary)
public ResolverMappingReplicator(@Nonnull LocatableResolver primary, int transactionRowLimit)
public ResolverMappingReplicator(@Nonnull LocatableResolver primary, int transactionRowLimit, long transactionTimeLimitMillis)
public void close()
close
in interface AutoCloseable
public void copyTo(LocatableResolver replica)
LocatableResolver
to the specified replica.replica
- The LocatableResolver
to copy to.public CompletableFuture<Void> copyToAsync(@Nonnull LocatableResolver replica)
LocatableResolver
to the specified replica.replica
- The LocatableResolver
to copy to.