Class ResolverMappingReplicator
- java.lang.Object
-
- com.apple.foundationdb.record.provider.foundationdb.keyspace.ResolverMappingReplicator
-
- All Implemented Interfaces:
AutoCloseable
@API(EXPERIMENTAL) public class ResolverMappingReplicator extends Object implements AutoCloseable
Copies the contents of oneLocatableResolver
to another. This can be useful for migrating between different underlyingLocatableResolver
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 (seeLocatableResolver.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 toScopedDirectoryLayer
is not supported.
-
-
Constructor Summary
Constructors Constructor Description ResolverMappingReplicator(LocatableResolver primary)
ResolverMappingReplicator(LocatableResolver primary, int transactionRowLimit)
ResolverMappingReplicator(LocatableResolver primary, int transactionRowLimit, long transactionTimeLimitMillis)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
copyTo(LocatableResolver replica)
Copy the mappings stored in aLocatableResolver
to the specified replica.CompletableFuture<Void>
copyToAsync(LocatableResolver replica)
Copy the mappings stored in aLocatableResolver
to the specified replica.String
toString()
-
-
-
Constructor Detail
-
ResolverMappingReplicator
public ResolverMappingReplicator(@Nonnull LocatableResolver primary)
-
ResolverMappingReplicator
public ResolverMappingReplicator(@Nonnull LocatableResolver primary, int transactionRowLimit)
-
ResolverMappingReplicator
public ResolverMappingReplicator(@Nonnull LocatableResolver primary, int transactionRowLimit, long transactionTimeLimitMillis)
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
-
copyTo
public void copyTo(LocatableResolver replica)
Copy the mappings stored in aLocatableResolver
to the specified replica.- Parameters:
replica
- TheLocatableResolver
to copy to.
-
copyToAsync
public CompletableFuture<Void> copyToAsync(@Nonnull LocatableResolver replica)
Copy the mappings stored in aLocatableResolver
to the specified replica.- Parameters:
replica
- TheLocatableResolver
to copy to.- Returns:
- A future that will complete when the copy is finished.
-
-