forked from sanketmarkan/HDFS-MapReduce
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hdfs.proto
97 lines (76 loc) · 2.15 KB
/
hdfs.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
option java_package = 'Protobuf';
option java_outer_classname = "HDFS";
message OpenFileRequest {
optional string fileName = 1; // fileName
optional bool forRead = 2; // true, for read; false for write
}
message OpenFileResponse {
optional int32 status = 1; // result of the call
optional int32 handle = 2; // file handle. Use this to close file on write
// for read, the numbers for the various blocks. Not populated in write mode
repeated int32 blockNums = 3;
}
message CloseFileRequest {
optional int32 handle = 1; // obtained from OpenFile
}
message CloseFileResponse {
optional int32 status = 1;
}
message WriteBlockRequest {
required int32 blockNumber = 1;
repeated bytes data = 2;
}
message WriteBlockResponse {
optional int32 status = 1;
}
message DataNodeLocation {
optional string ip = 1 ;
optional int32 port = 2;
}
message BlockLocations {
required int32 blockNumber = 1;
repeated DataNodeLocation locations = 2;
}
message BlockLocationRequest {
repeated int32 blockNums = 1;
}
message BlockLocationResponse {
optional int32 status = 1;
repeated BlockLocations blockLocations = 2;
}
message AssignBlockRequest {
optional int32 handle = 1; // obtain using call to OpenFile
}
message AssignBlockResponse {
optional int32 status = 1;
optional BlockLocations newBlock = 2;
}
message ListFilesRequest {
optional string dirName = 1; // unused, place holder to support mkdir, etc
}
message ListFilesResponse {
optional int32 status = 1;
repeated string fileNames = 2;
}
message ReadBlockRequest {
required int32 blockNumber = 1;
}
message ReadBlockResponse {
optional int32 status = 1;
repeated bytes data = 2;
}
message BlockReportRequest {
optional int32 id = 1; // identity of the DN. All communication to the NN uses the same id
optional DataNodeLocation location = 2;
repeated int32 blockNumbers = 3;
}
message BlockReportResponse {
repeated int32 status = 1;
}
message HeartBeatRequest {
optional int32 id = 1;
optional DataNodeLocation location = 2;
}
message HeartBeatResponse {
optional int32 status = 1;
}