1, ClientProtocol This thing version number is 61l;datanodeprotocol is 26l;namenodeprotocol is 3L; Refreshauthorizationpolicyprotocol is 1l,refreshusermappingsprotocol is 1L,
Well, to enumerate what the use of this thing, we also see, in fact, the most often change is clientprotocol, and then is Datanodeprotocol, behind that two basic haven't moved, hey
People write code is not casually come, there are order
public class NameNode implements ClientProtocol, Datanodeprotocol,
Namenodeprotocol, Fsconstants,
Refreshauthorizationpolicyprotocol,
Refreshusermappingsprotocol
2, first look at ClientProtocol, this inside method is many, constant also many, enumeration under constant
public int get_stats_capacity_idx = 0;
public int get_stats_used_idx = 1;
public int get_stats_remaining_idx = 2;
public int get_stats_under_replicated_idx = 3;
public int get_stats_corrupt_blocks_idx = 4;
public int get_stats_missing_blocks_idx = 5;
What do these six numbers do?
Don't worry, look slowly,
This protocol has a total of three parts:
respectively is
File contents, Namespace management, System issues and management
The first part is file contents, a total of 14 methods, inside Create and Addblock are overloaded methods.
Getblocklocations, create (2), append, Recoverlease, isfileclosed, Setreplication, SetPermission, SetOwner, Abandonblock, Addblock (2), complete, reportbadblocks.
According to the additions and deletions to the division,
Add: Create (2), Addblock (2),
Deletion: Abandonblock
Change: Append, Setreplication, SetPermission, SetOwner, recoverlease
Check: Getblocklocations, isfileclosed, complete, reportbadblocks
Starting from protocol Versionedprotocol 3--clientprotocol, Datanodeprotocol, Namenodeprotocol, Refreshauthorizationpolicyprotocol, Refreshusermappingsprotocol