Windows Azure Storage (25) Azure Append Blob
《Windows Azure Platform 系列文章目录》
在笔者之前的文章中,我们介绍了Azure Blob 有两种:Block Blob和Page Blob。
在这里笔者介绍Blob的第三种:Append Blob。
概念:
1.Append Blob概念类似于Block Blob,因为都是由块组成的
2.单个Block Blob可以包含最多50000个块,每个块最大100MB,总大小大约4.75TB (100MB * 50000)。
3.Append Blob针对追加操作进行了优化,特别适合与日志记录方案
4.Append Blob可以包含最多50000个块,每个块最大4MB。总大小约为195GB
5.Append Blob不支持修改和删除,每个对Append Blob的操作,都会追加到Append Blob的末尾。
我们这里写一个.NET的Sample Code:
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; using Microsoft.WindowsAzure.Storage; using System.Configuration; using Microsoft.WindowsAzure.Storage.Blob; using System.IO;namespace WindowsFormsApplication1 {public partial class Form1 : Form{public Form1(){InitializeComponent();}private void button1_Click(object sender, EventArgs e){CloudStorageAccount cloudStorageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["AzureStorageConnectionString"]);CloudBlobClient cloudBlobClient = cloudStorageAccount.CreateCloudBlobClient();//Container Name必须为小写CloudBlobContainer cloudBlobContainer = cloudBlobClient.GetContainerReference("appendblobcontainer");cloudBlobContainer.CreateIfNotExists();CloudAppendBlob cloudAppendBlob = cloudBlobContainer.GetAppendBlobReference("helloworld.txt");//如果不存在,则创建该文件if(!cloudAppendBlob.Exists()){ cloudAppendBlob.CreateOrReplace();}var tasks = new Task[100];for (int i = 0; i < 100; i++){var message = string.Format("Appending log number {0} to an append blob.\r\n", i);var bytes = Encoding.UTF8.GetBytes(message);var stream = new MemoryStream(bytes);tasks[i] = cloudAppendBlob.AppendBlockAsync(stream);}Task.WaitAll(tasks);string appendBlobContent = cloudAppendBlob.DownloadText();}} }
如果我们执行代码两次,然后通过Azure Storage Explorer查看这个TXT文件,就可以看到文件被追加到Azure Append Blob里面了。
本文转自Azure Lei Zhang博客园博客,原文链接:http://www.cnblogs.com/threestone/p/7904706.html,如需转载请自行联系原作者
Windows Azure Storage (25) Azure Append Blob相关推荐
- Windows Azure Storage (19) 再谈Azure Block Blob和Page Blob
<Windows Azure Platform 系列文章目录> 请读者在参考本文之前,预习相关背景知识:Windows Azure Storage (1) Windows Azure St ...
- Windows Azure Storage (4) Windows Azure Storage Service存储服务之Blob Share Access Signature
<Windows Azure Platform 系列文章目录> 如果读者使用的是国内由世纪互联运维的Azure China服务,请参考笔者的博文Azure China (4) 管理Azur ...
- Windows Azure Storage (3) Windows Azure Storage Service存储服务之Blob详解(中)
<Windows Azure Platform 系列文章目录> 如果读者使用的是国内由世纪互联运维的Azure China服务,请参考笔者的博文Azure China (4) 管理Azur ...
- Azure Blob Storage 基本用法 -- Azure Storage 之 Blob
Azure Storage 是微软 Azure 云提供的云端存储解决方案,当前支持的存储类型有 Blob.Queue.File 和 Table. 笔者在<Azure Table storage ...
- Windows Azure Storage (23) 计算Azure VHD实际使用容量
<Windows Azure Platform 系列文章目录> 对于A系列和D系列的虚拟机来说,使用的是普通存储. 普通存储的存储资源,是按照每GB每月计费的.Microsoft Azur ...
- Windows Azure Storage浏览器
我们不时被问到Windows Azure Storage有哪些工具可用,所以我们决定把我们知道的存储浏览器做成列表供大家参考.这些Windows Azure Storage浏览器都可以用来查看blob ...
- Windows Azure Storage (10) Windows Azure 上的托管服务CDN (下) Hosted Service
<Windows Azure Platform 系列文章目录> 使用Blob Service CDN需要将所有需要缓存的文件放入Blob Service中,然后设置CDN指向这个Stora ...
- Windows Azure Storage论文解读
Windows Azure Storage论文解读 整体架构 文件流层 stream layer 存储引擎 存储优化 分区层 Partition Layer 存储引擎 WAS总结 WAS是微软开发的云 ...
- [SDK2.2]Windows Azure Storage (16) 使用WCF服务,将本地图片上传至Azure Storage (上) 客户端代码...
<Windows Azure Platform 系列文章目录> 前一章我们完成了服务器端的代码,并且已经发布到了Windows Azure云端. 本章我们将实现客户端的代码,客户端这里我们 ...
最新文章
- Nat. Mach. Intell. | 深度神经网络中的捷径学习
- 基于特征的对抗迁移学习论文_lt;EYD与机器学习gt;迁移学习:PTL选择式对抗网络...
- 翻看雷军近10年演讲、采访,我们整理出70条干货
- svm加载数据集并预测
- 百度NeurIPS全球顶会冠军团队,带你7日从零实践强化学习
- 服务器性能指标有哪些
- stm32 之引脚和各功能模块间关系
- FPGA学习之verilog语言入门指导
- 初识数据流 bit byte char三者的区别 java
- Cookie篡改攻击
- 《Oracle高性能自动化运维》一一2.3 Library Cache
- Linux 获取grep前后几行
- ThinkPHP 接入 SeasLog 日志组件
- spring springMvc spring-boot spring-cloud分别是什么
- 儿童学python下哪个软件好_少儿学编程适合哪个软件
- 苹果手机上网很慢_手机信号满格,4G上网速度却很慢?你可能需要这样做了
- [车联网安全自学篇] ATTACK安全之从ATTCK看车联网安全如何落地企业SOC之基础知识篇
- Origin | 数据处理 | 公式编辑栏 | F(x)栏的使用 | 数据提取 | 数据筛选及删减
- Python之3~20的乘积
- vue基础 - 11 (组件间的通信:event bus -- 事件车,$emit,$on,$off,封装一个事件车)
热门文章
- IE和火狐都支持的方法(输入用户名和密码后按下 enter 键)
- SDWebImage使用——一个可管理远程图片加载的类库
- 【C++】拷贝,赋值与构造
- ecshop中ajax的调用原理
- 锦上添花DataGrid!
- Spring源码分析【9】-SpringSecurity密码Remove原理
- 激活函数之logistic sigmoid函数介绍及C++实现
- C++中nothrow的介绍及使用
- 【网络】通讯名词解释:带宽、速率、波特率、奈奎斯特定律、香农定理
- java gettext_JAVA中getText()怎么从一个JTextArea中读出内容?