@Test public void shutdownBlobStoreTest() throws IOException { CloudStorageManager cloudStorageManager = createNewCloudStorageManager(); ReplicaId mockReplicaId = clusterMap.getReplicaIds(clusterMap.getDataNodeIds().get(0)).get(0); PartitionId partitionId = mockReplicaId.getPartitionId(); Assert.assertFalse(cloudStorageManager.shutdownBlobStore(partitionId)); Assert.assertTrue(cloudStorageManager.addBlobStore(mockReplicaId)); Assert.assertTrue(cloudStorageManager.shutdownBlobStore(partitionId)); Assert.assertTrue(cloudStorageManager.removeBlobStore(partitionId)); Assert.assertFalse(cloudStorageManager.shutdownBlobStore(partitionId)); }
@Override public boolean shutdownBlobStore(PartitionId id) { try { lock.writeLock().lock(); if (partitionToStore.get(id) != null) { partitionToStore.get(id).shutdown(); return true; } } finally { lock.writeLock().unlock(); } return false; }
CloudStorageManager implements StoreManager { @Override public boolean shutdownBlobStore(PartitionId id) { try { lock.writeLock().lock(); if (partitionToStore.get(id) != null) { partitionToStore.get(id).shutdown(); return true; } } finally { lock.writeLock().unlock(); } return false; } }
CloudStorageManager implements StoreManager { @Override public boolean shutdownBlobStore(PartitionId id) { try { lock.writeLock().lock(); if (partitionToStore.get(id) != null) { partitionToStore.get(id).shutdown(); return true; } } finally { lock.writeLock().unlock(); } return false; } CloudStorageManager(VerifiableProperties properties, VcrMetrics vcrMetrics, CloudDestination cloudDestination,
      ClusterMap clusterMap); }
CloudStorageManager implements StoreManager { @Override public boolean shutdownBlobStore(PartitionId id) { try { lock.writeLock().lock(); if (partitionToStore.get(id) != null) { partitionToStore.get(id).shutdown(); return true; } } finally { lock.writeLock().unlock(); } return false; } CloudStorageManager(VerifiableProperties properties, VcrMetrics vcrMetrics, CloudDestination cloudDestination,
      ClusterMap clusterMap); @Override boolean addBlobStore(ReplicaId replica); @Override boolean shutdownBlobStore(PartitionId id); @Override Store getStore(PartitionId id); @Override boolean scheduleNextForCompaction(PartitionId id); @Override boolean startBlobStore(PartitionId id); @Override boolean controlCompactionForBlobStore(PartitionId id, boolean enabled); @Override List<PartitionId> setBlobStoreStoppedState(List<PartitionId> partitionIds, boolean markStop); @Override ReplicaId getReplica(String partitionName); @Override Collection<PartitionId> getLocalPartitions(); @Override boolean removeBlobStore(PartitionId id); @Override ServerErrorCode checkLocalPartitionStatus(PartitionId partition, ReplicaId localReplica); }
CloudStorageManager implements StoreManager { @Override public boolean shutdownBlobStore(PartitionId id) { try { lock.writeLock().lock(); if (partitionToStore.get(id) != null) { partitionToStore.get(id).shutdown(); return true; } } finally { lock.writeLock().unlock(); } return false; } CloudStorageManager(VerifiableProperties properties, VcrMetrics vcrMetrics, CloudDestination cloudDestination,
      ClusterMap clusterMap); @Override boolean addBlobStore(ReplicaId replica); @Override boolean shutdownBlobStore(PartitionId id); @Override Store getStore(PartitionId id); @Override boolean scheduleNextForCompaction(PartitionId id); @Override boolean startBlobStore(PartitionId id); @Override boolean controlCompactionForBlobStore(PartitionId id, boolean enabled); @Override List<PartitionId> setBlobStoreStoppedState(List<PartitionId> partitionIds, boolean markStop); @Override ReplicaId getReplica(String partitionName); @Override Collection<PartitionId> getLocalPartitions(); @Override boolean removeBlobStore(PartitionId id); @Override ServerErrorCode checkLocalPartitionStatus(PartitionId partition, ReplicaId localReplica);  }