Lease 的机制:hdfs支持write-once-read-many,也就是说不支持并行写,那么对读写的互斥同步就是靠Lease实现的。Lease说白了就是一个有时间约束的锁。客户端写文件时需要先申请一个Lease,对应到namenode中的LeaseManager,客户端的client name就作为一个lease的holder,即租约持有者。LeaseManager起什么作用呢?
读写过程的容错是怎么做的?数据块是如何复制的?数据块的恢复机制?本文都有涉及。...
                            
                            
                                分类:
其他好文   时间:
2014-05-02 23:22:14   
                                阅读次数:
450
                             
                    
                        
                            
                            
                                查询数据库中第五条数据到第十条数据,分两种情况:
1,ID是连接的,当然这种情况比较好查。直接SELECT就可以了,取ID大于5小于10就可以了,
这种情况比较少。
2,ID不是连接的,如果要取第五条数据到第十条数据,就得从SQL查询SELECT着手
select top 10 * from TB1 where Id not in (select top 5 Id ...
                            
                            
                                分类:
数据库   时间:
2014-05-02 22:58:20   
                                阅读次数:
597
                             
                    
                        
                            
                            
                                HDU  2063
 求一个二分图的最大匹配。
完全的裸题。贴代码。
#include
#include
#include
#include
#include
using namespace std;
vector G[1005];
bool check[1005];
int mac[1005];
int n;
void add_edge(int from,int to)
{
    G[f...
                            
                            
                                分类:
其他好文   时间:
2014-05-02 20:57:04   
                                阅读次数:
359
                             
                    
                        
                            
                            
                                Shaass has decided to hunt some birds. There are n horizontal electricity wires aligned parallel to each other. Wires are numbered 1 to n from
 top to bottom. On each wire there are some oskols sitti...
                            
                            
                                分类:
其他好文   时间:
2014-05-02 20:48:26   
                                阅读次数:
462
                             
                    
                        
                            
                            
                                一次性通过的,比较顺利,从读题到编写到检查到通过,14分50秒,我在不断进步中,相信经过一段时间联系,这种题可以一眼就写出来,不超过5分钟。这道题应该说方法跟 
Remove Duplicates from sorted Array挺类似的My Solution: 1 public class Sol...
                            
                            
                                分类:
其他好文   时间:
2014-05-02 12:56:10   
                                阅读次数:
260
                             
                    
                        
                            
                            
                                这道题,采用动态规划算法。from top to 
down,把到每个节点的最小路径和都求出来。下面是AC代码: 1 /** 2 * Given a triangle, find the minimum path 
sum from top to bottom. 3 * Each ...
                            
                            
                                分类:
其他好文   时间:
2014-05-02 12:19:23   
                                阅读次数:
382
                             
                    
                        
                            
                            
                                vimsendmail.pl#!/usr/bin/perl-wuseMIME::Lite;subperl_sendmail{my$mail_to="$_[0]";收件人邮箱my$from="$_[1]";发件人邮箱my$subject="$_[2]";邮件标题my$data="$_[3]";邮件内容$sendmail=MIME::Lite->new(From=>$from,To=>$mail_to,Subject=>$subject,Data=>..
                            
                            
                                分类:
其他好文   时间:
2014-05-02 03:00:15   
                                阅读次数:
283
                             
                    
                        
                            
                            
                                - (void)viewDidLoad{ [super viewDidLoad]; // Do any 
additional setup after loading the view, typically from a nib. [NSThread 
sleepForTimeInte...
                            
                            
                                分类:
移动开发   时间:
2014-05-02 00:25:42   
                                阅读次数:
441
                             
                    
                        
                            
                            
                                org.springframework.dao.InvalidDataAccessApiUsageException: Write operations are not allowed in read-only mode (FlushMode.NEVER) - turn your Session into FlushMode.AUTO or remove 'readOnly' marker from transaction definition...
                            
                            
                                分类:
数据库   时间:
2014-05-01 18:16:35   
                                阅读次数:
377
                             
                    
                        
                            
                            
                                1,按照vmware,导入系统(注意td提供的版本是64位的)
2,linux系统:root/root
3,配置ip:
Enter a cop entry in the linux hosts file (/etc/hosts accessible from the linux command line in the VMware console, ie. c:>vi /etc/host...
                            
                            
                                分类:
其他好文   时间:
2014-04-30 22:13:39   
                                阅读次数:
503