/** * To be used by tests only (via {@link org.apache.cassandra.service.StorageService#setPartitionerUnsafe}). */ @VisibleForTesting public TokenMetadata cloneWithNewPartitioner(IPartitioner newPartitioner) { return new TokenMetadata(tokenToEndpointMap, endpointToHostIdMap, topology, newPartitioner); }
/** * To be used by tests only (via {@link org.apache.cassandra.service.StorageService#setPartitionerUnsafe}). */ @VisibleForTesting public TokenMetadata cloneWithNewPartitioner(IPartitioner newPartitioner) { return new TokenMetadata(tokenToEndpointMap, endpointToHostIdMap, topology, newPartitioner); }
/** * To be used by tests only (via {@link org.apache.cassandra.service.StorageService#setPartitionerUnsafe}). */ @VisibleForTesting public TokenMetadata cloneWithNewPartitioner(IPartitioner newPartitioner) { return new TokenMetadata(tokenToEndpointMap, endpointToHostIdMap, topology, newPartitioner); }
/** * Create a copy of TokenMetadata with only tokenToEndpointMap. That is, pending ranges, * bootstrap tokens and leaving endpoints are not included in the copy. */ public TokenMetadata cloneOnlyTokenMap() { lock.readLock().lock(); try { return new TokenMetadata(SortedBiMultiValMap.create(tokenToEndpointMap, null, inetaddressCmp), HashBiMap.create(endpointToHostIdMap), new Topology(topology), partitioner); } finally { lock.readLock().unlock(); } }
/** * Create a copy of TokenMetadata with only tokenToEndpointMap. That is, pending ranges, * bootstrap tokens and leaving endpoints are not included in the copy. */ public TokenMetadata cloneOnlyTokenMap() { lock.readLock().lock(); try { return new TokenMetadata(SortedBiMultiValMap.create(tokenToEndpointMap, null, inetaddressCmp), HashBiMap.create(endpointToHostIdMap), new Topology(topology), partitioner); } finally { lock.readLock().unlock(); } }
/** * Create a copy of TokenMetadata with only tokenToEndpointMap. That is, pending ranges, * bootstrap tokens and leaving endpoints are not included in the copy. */ public TokenMetadata cloneOnlyTokenMap() { lock.readLock().lock(); try { return new TokenMetadata(SortedBiMultiValMap.create(tokenToEndpointMap, null, inetaddressCmp), HashBiMap.create(endpointToHostIdMap), new Topology(topology), partitioner); } finally { lock.readLock().unlock(); } }
/** * Create a copy of TokenMetadata with only tokenToEndpointMap. That is, pending ranges, * bootstrap tokens and leaving endpoints are not included in the copy. */ public TokenMetadata cloneOnlyTokenMap() { lock.readLock().lock(); try { return new TokenMetadata(SortedBiMultiValMap.create(tokenToEndpointMap, null, inetaddressCmp), HashBiMap.create(endpointToHostIdMap), new Topology(topology)); } finally { lock.readLock().unlock(); } }