@Override public String restoreBlock(long id, byte[] hash) throws IOException { if (id == -1) { SDFSLogger.getLog().warn("Hash not found for " + StringUtils.getHexString(hash) + " id " + id); return null; } String haName = this.restoreRequests.get(new Long(id)); if (haName == null) haName = EncyptUtils.encHashArchiveName(id, Main.chunkStoreEncryptionEnabled); else { return haName; } try { CloudBlockBlob blob = container.getBlockBlobReference("blocks/" + haName); blob.downloadAttributes(); if (blob.getProperties().getStandardBlobTier().equals(StandardBlobTier.ARCHIVE)) { blob.uploadStandardBlobTier(StandardBlobTier.HOT); bio.removeBlobDataTracker(id, EncyptUtils.encHashArchiveName(Main.DSEID, Main.chunkStoreEncryptionEnabled)); this.restoreRequests.put(new Long(id), haName); return haName; } else { this.restoreRequests.put(new Long(id), null); return null; } } catch (Exception e) { SDFSLogger.getLog().error("unable to restore " + id,e); throw new IOException(e); } }
if (this.tier != null && this.tier.equals(StandardBlobTier.ARCHIVE)) { blob.downloadAttributes(); if (blob.getProperties().getStandardBlobTier().equals(StandardBlobTier.ARCHIVE)) { this.restoreBlock(id, new byte [16]); throw new DataArchivedException(id, null); if (this.tier != null && this.tier.equals(StandardBlobTier.COOL)) { blob.uploadStandardBlobTier(StandardBlobTier.HOT);
serviceClient = account.createCloudBlobClient(); serviceClient.getDefaultRequestOptions().setConcurrentRequestCount(Main.dseIOThreads * 2); if (tier != null && (tier.equals(StandardBlobTier.ARCHIVE) || tier.equals(StandardBlobTier.COOL))) { this.bio = new BlobDataIO(this.name + "table", this.accessKey, this.secretKey, connectionProtocol);
&& (tier.equals(StandardBlobTier.ARCHIVE) || tier.equals(StandardBlobTier.COOL))) { HashSet<Long> orr = new HashSet<Long>(); String dseID = EncyptUtils.encHashArchiveName(Main.DSEID, Main.chunkStoreEncryptionEnabled); CloudBlockBlob blob = container.getBlockBlobReference("blocks/" + hashString); blob.downloadAttributes(); if (!blob.getProperties().getStandardBlobTier().equals(tier)) { blob.uploadStandardBlobTier(this.tier); SDFSLogger.getLog().info("Moved blocks/" + hashString + " to "
@Override public boolean blockRestored(String id) { try { CloudBlockBlob blob = container.getBlockBlobReference("blocks/" + id); if(!blob.exists()) return true; blob.downloadAttributes(); if (blob.getProperties().getStandardBlobTier().equals(StandardBlobTier.HOT)) { return true; } else { if (blob.getProperties().getRehydrationStatus() == null || blob.getProperties().getRehydrationStatus().equals(RehydrationStatus.UNKNOWN)) { SDFSLogger.getLog().warn("rehydration status unknow for " + id + " will attempt to rehydrate"); blob.uploadStandardBlobTier(StandardBlobTier.HOT); } return false; } } catch (Exception e) { SDFSLogger.getLog().warn("error while checking block [" + id + "] restored", e); return false; } }
properties.setPremiumPageBlobTier(premiumPageBlobTier); else if (!standardBlobTier.equals(StandardBlobTier.UNKNOWN)) { properties.setStandardBlobTier(standardBlobTier);
properties.setPremiumPageBlobTier(premiumPageBlobTier); else if (!standardBlobTier.equals(StandardBlobTier.UNKNOWN)) { properties.setStandardBlobTier(standardBlobTier);
properties.setPremiumPageBlobTier(premiumPageBlobTier); else if (!standardBlobTier.equals(StandardBlobTier.UNKNOWN)) { properties.setStandardBlobTier(standardBlobTier);
properties.setPremiumPageBlobTier(premiumPageBlobTier); else if (!standardBlobTier.equals(StandardBlobTier.UNKNOWN)) { properties.setStandardBlobTier(standardBlobTier);
@Override public Void preProcessResponse(CloudBlob blob, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_OK && this.getResult().getStatusCode() != HttpURLConnection.HTTP_ACCEPTED) { this.setNonExceptionedRetryableFailure(true); return null; } blob.updateEtagAndLastModifiedFromResponse(this.getConnection()); this.getResult().setRequestServiceEncrypted(BaseResponse.isServerRequestEncrypted(this.getConnection())); blob.getProperties().setBlobTierInferred(false); if (blob.getProperties().getBlobType() == BlobType.BLOCK_BLOB) { // For standard accounts when rehydrating a blob from archive, the status code will be 202 instead of 200. StandardBlobTier standardBlobTier = StandardBlobTier.parse(blobTierString); blob.getProperties().setRehydrationStatus(null); if (this.getResult().getStatusCode() == HttpURLConnection.HTTP_OK) { blob.getProperties().setStandardBlobTier(standardBlobTier); } else if (standardBlobTier.equals(StandardBlobTier.COOL)) { blob.getProperties().setStandardBlobTier(StandardBlobTier.ARCHIVE); } else if (standardBlobTier.equals(StandardBlobTier.HOT)) { blob.getProperties().setStandardBlobTier(StandardBlobTier.ARCHIVE); } } return null; }
@Override public Void preProcessResponse(CloudBlob blob, CloudBlobClient client, OperationContext context) throws Exception { if (this.getResult().getStatusCode() != HttpURLConnection.HTTP_OK && this.getResult().getStatusCode() != HttpURLConnection.HTTP_ACCEPTED) { this.setNonExceptionedRetryableFailure(true); return null; } blob.updateEtagAndLastModifiedFromResponse(this.getConnection()); this.getResult().setRequestServiceEncrypted(BaseResponse.isServerRequestEncrypted(this.getConnection())); blob.getProperties().setBlobTierInferred(false); if (blob.getProperties().getBlobType() == BlobType.BLOCK_BLOB) { // For standard accounts when rehydrating a blob from archive, the status code will be 202 instead of 200. StandardBlobTier standardBlobTier = StandardBlobTier.parse(blobTierString); blob.getProperties().setRehydrationStatus(null); if (this.getResult().getStatusCode() == HttpURLConnection.HTTP_OK) { blob.getProperties().setStandardBlobTier(standardBlobTier); } else if (standardBlobTier.equals(StandardBlobTier.COOL)) { blob.getProperties().setStandardBlobTier(StandardBlobTier.ARCHIVE); } else if (standardBlobTier.equals(StandardBlobTier.HOT)) { blob.getProperties().setStandardBlobTier(StandardBlobTier.ARCHIVE); } } return null; }