2011-06-12 22:00:51 +00:00
|
|
|
/**
|
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one
|
|
|
|
* or more contributor license agreements. See the NOTICE file
|
|
|
|
* distributed with this work for additional information
|
|
|
|
* regarding copyright ownership. The ASF licenses this file
|
|
|
|
* to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance
|
|
|
|
* with the License. You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2013-06-21 19:53:21 +00:00
|
|
|
/**
|
|
|
|
* These .proto interfaces are private and stable.
|
|
|
|
* Please see http://wiki.apache.org/hadoop/Compatibility
|
|
|
|
* for what changes are allowed for a *stable* .proto interface.
|
|
|
|
*/
|
|
|
|
|
2011-06-12 22:00:51 +00:00
|
|
|
// This file contains protocol buffers that are used to transfer data
|
|
|
|
// to and from the datanode, as well as between datanodes.
|
|
|
|
|
|
|
|
option java_package = "org.apache.hadoop.hdfs.protocol.proto";
|
|
|
|
option java_outer_classname = "DataTransferProtos";
|
|
|
|
option java_generate_equals_and_hash = true;
|
2012-10-27 18:25:02 +00:00
|
|
|
package hadoop.hdfs;
|
2011-06-12 22:00:51 +00:00
|
|
|
|
2013-01-04 16:49:49 +00:00
|
|
|
import "Security.proto";
|
2011-06-12 22:00:51 +00:00
|
|
|
import "hdfs.proto";
|
|
|
|
|
2012-08-07 16:40:03 +00:00
|
|
|
message DataTransferEncryptorMessageProto {
|
|
|
|
enum DataTransferEncryptorStatus {
|
|
|
|
SUCCESS = 0;
|
|
|
|
ERROR_UNKNOWN_KEY = 1;
|
|
|
|
ERROR = 2;
|
|
|
|
}
|
|
|
|
required DataTransferEncryptorStatus status = 1;
|
|
|
|
optional bytes payload = 2;
|
|
|
|
optional string message = 3;
|
|
|
|
}
|
|
|
|
|
2011-06-12 22:00:51 +00:00
|
|
|
message BaseHeaderProto {
|
|
|
|
required ExtendedBlockProto block = 1;
|
2013-01-04 16:49:49 +00:00
|
|
|
optional hadoop.common.TokenProto token = 2;
|
2014-09-16 20:58:40 +00:00
|
|
|
optional DataTransferTraceInfoProto traceInfo = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DataTransferTraceInfoProto {
|
|
|
|
required uint64 traceId = 1;
|
|
|
|
required uint64 parentId = 2;
|
2011-06-12 22:00:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message ClientOperationHeaderProto {
|
|
|
|
required BaseHeaderProto baseHeader = 1;
|
|
|
|
required string clientName = 2;
|
|
|
|
}
|
|
|
|
|
2013-07-22 18:15:18 +00:00
|
|
|
message CachingStrategyProto {
|
|
|
|
optional bool dropBehind = 1;
|
|
|
|
optional int64 readahead = 2;
|
|
|
|
}
|
|
|
|
|
2011-06-12 22:00:51 +00:00
|
|
|
message OpReadBlockProto {
|
|
|
|
required ClientOperationHeaderProto header = 1;
|
|
|
|
required uint64 offset = 2;
|
|
|
|
required uint64 len = 3;
|
2013-01-14 20:47:08 +00:00
|
|
|
optional bool sendChecksums = 4 [default = true];
|
2013-07-22 18:15:18 +00:00
|
|
|
optional CachingStrategyProto cachingStrategy = 5;
|
2011-06-12 22:00:51 +00:00
|
|
|
}
|
2011-11-01 05:17:08 +00:00
|
|
|
|
|
|
|
|
|
|
|
message ChecksumProto {
|
2012-10-12 14:32:16 +00:00
|
|
|
required ChecksumTypeProto type = 1;
|
2011-11-01 05:17:08 +00:00
|
|
|
required uint32 bytesPerChecksum = 2;
|
|
|
|
}
|
2011-06-12 22:00:51 +00:00
|
|
|
|
|
|
|
message OpWriteBlockProto {
|
|
|
|
required ClientOperationHeaderProto header = 1;
|
|
|
|
repeated DatanodeInfoProto targets = 2;
|
|
|
|
optional DatanodeInfoProto source = 3;
|
|
|
|
enum BlockConstructionStage {
|
|
|
|
PIPELINE_SETUP_APPEND = 0;
|
|
|
|
// pipeline set up for failed PIPELINE_SETUP_APPEND recovery
|
|
|
|
PIPELINE_SETUP_APPEND_RECOVERY = 1;
|
|
|
|
// data streaming
|
|
|
|
DATA_STREAMING = 2;
|
|
|
|
// pipeline setup for failed data streaming recovery
|
|
|
|
PIPELINE_SETUP_STREAMING_RECOVERY = 3;
|
|
|
|
// close the block and pipeline
|
|
|
|
PIPELINE_CLOSE = 4;
|
|
|
|
// Recover a failed PIPELINE_CLOSE
|
|
|
|
PIPELINE_CLOSE_RECOVERY = 5;
|
|
|
|
// pipeline set up for block creation
|
|
|
|
PIPELINE_SETUP_CREATE = 6;
|
|
|
|
// transfer RBW for adding datanodes
|
|
|
|
TRANSFER_RBW = 7;
|
|
|
|
// transfer Finalized for adding datanodes
|
|
|
|
TRANSFER_FINALIZED = 8;
|
|
|
|
}
|
|
|
|
required BlockConstructionStage stage = 4;
|
|
|
|
required uint32 pipelineSize = 5;
|
|
|
|
required uint64 minBytesRcvd = 6;
|
|
|
|
required uint64 maxBytesRcvd = 7;
|
|
|
|
required uint64 latestGenerationStamp = 8;
|
2011-11-01 05:17:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The requested checksum mechanism for this block write.
|
|
|
|
*/
|
|
|
|
required ChecksumProto requestedChecksum = 9;
|
2013-07-22 18:15:18 +00:00
|
|
|
optional CachingStrategyProto cachingStrategy = 10;
|
2014-07-22 07:41:24 +00:00
|
|
|
optional StorageTypeProto storageType = 11 [default = DISK];
|
|
|
|
repeated StorageTypeProto targetStorageTypes = 12;
|
2014-08-27 22:13:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Hint to the DataNode that the block can be allocated on transient
|
|
|
|
* storage i.e. memory and written to disk lazily. The DataNode is free
|
|
|
|
* to ignore this hint.
|
|
|
|
*/
|
|
|
|
optional bool allowLazyPersist = 13 [default = false];
|
2011-06-12 22:00:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message OpTransferBlockProto {
|
|
|
|
required ClientOperationHeaderProto header = 1;
|
|
|
|
repeated DatanodeInfoProto targets = 2;
|
2014-07-22 07:41:24 +00:00
|
|
|
repeated StorageTypeProto targetStorageTypes = 3;
|
2011-06-12 22:00:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message OpReplaceBlockProto {
|
|
|
|
required BaseHeaderProto header = 1;
|
|
|
|
required string delHint = 2;
|
|
|
|
required DatanodeInfoProto source = 3;
|
2014-07-22 07:41:24 +00:00
|
|
|
optional StorageTypeProto storageType = 4 [default = DISK];
|
2011-06-12 22:00:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message OpCopyBlockProto {
|
|
|
|
required BaseHeaderProto header = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message OpBlockChecksumProto {
|
|
|
|
required BaseHeaderProto header = 1;
|
|
|
|
}
|
|
|
|
|
2014-03-03 03:58:37 +00:00
|
|
|
/**
|
|
|
|
* An ID uniquely identifying a shared memory segment.
|
|
|
|
*/
|
|
|
|
message ShortCircuitShmIdProto {
|
|
|
|
required int64 hi = 1;
|
|
|
|
required int64 lo = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* An ID uniquely identifying a slot within a shared memory segment.
|
|
|
|
*/
|
|
|
|
message ShortCircuitShmSlotProto {
|
|
|
|
required ShortCircuitShmIdProto shmId = 1;
|
|
|
|
required int32 slotIdx = 2;
|
|
|
|
}
|
|
|
|
|
2013-01-11 23:52:22 +00:00
|
|
|
message OpRequestShortCircuitAccessProto {
|
|
|
|
required BaseHeaderProto header = 1;
|
|
|
|
|
|
|
|
/** In order to get short-circuit access to block data, clients must set this
|
|
|
|
* to the highest version of the block data that they can understand.
|
|
|
|
* Currently 1 is the only version, but more versions may exist in the future
|
|
|
|
* if the on-disk format changes.
|
|
|
|
*/
|
|
|
|
required uint32 maxVersion = 2;
|
2014-03-03 03:58:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The shared memory slot to use, if we are using one.
|
|
|
|
*/
|
|
|
|
optional ShortCircuitShmSlotProto slotId = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ReleaseShortCircuitAccessRequestProto {
|
|
|
|
required ShortCircuitShmSlotProto slotId = 1;
|
2014-09-16 20:58:40 +00:00
|
|
|
optional DataTransferTraceInfoProto traceInfo = 2;
|
2014-03-03 03:58:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message ReleaseShortCircuitAccessResponseProto {
|
|
|
|
required Status status = 1;
|
|
|
|
optional string error = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ShortCircuitShmRequestProto {
|
|
|
|
// The name of the client requesting the shared memory segment. This is
|
|
|
|
// purely for logging / debugging purposes.
|
|
|
|
required string clientName = 1;
|
2014-09-16 20:58:40 +00:00
|
|
|
optional DataTransferTraceInfoProto traceInfo = 2;
|
2014-03-03 03:58:37 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message ShortCircuitShmResponseProto {
|
|
|
|
required Status status = 1;
|
|
|
|
optional string error = 2;
|
|
|
|
optional ShortCircuitShmIdProto id = 3;
|
2013-01-11 23:52:22 +00:00
|
|
|
}
|
2011-06-12 22:00:51 +00:00
|
|
|
|
|
|
|
message PacketHeaderProto {
|
|
|
|
// All fields must be fixed-length!
|
|
|
|
required sfixed64 offsetInBlock = 1;
|
|
|
|
required sfixed64 seqno = 2;
|
|
|
|
required bool lastPacketInBlock = 3;
|
|
|
|
required sfixed32 dataLen = 4;
|
2012-05-30 19:10:09 +00:00
|
|
|
optional bool syncBlock = 5 [default = false];
|
2011-06-12 22:00:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
enum Status {
|
|
|
|
SUCCESS = 0;
|
|
|
|
ERROR = 1;
|
|
|
|
ERROR_CHECKSUM = 2;
|
|
|
|
ERROR_INVALID = 3;
|
|
|
|
ERROR_EXISTS = 4;
|
|
|
|
ERROR_ACCESS_TOKEN = 5;
|
|
|
|
CHECKSUM_OK = 6;
|
2013-01-11 23:52:22 +00:00
|
|
|
ERROR_UNSUPPORTED = 7;
|
2014-02-24 23:38:04 +00:00
|
|
|
OOB_RESTART = 8; // Quick restart
|
|
|
|
OOB_RESERVED1 = 9; // Reserved
|
|
|
|
OOB_RESERVED2 = 10; // Reserved
|
|
|
|
OOB_RESERVED3 = 11; // Reserved
|
2014-08-13 18:43:05 +00:00
|
|
|
IN_PROGRESS = 12;
|
2011-06-12 22:00:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
message PipelineAckProto {
|
|
|
|
required sint64 seqno = 1;
|
|
|
|
repeated Status status = 2;
|
2012-07-05 22:18:30 +00:00
|
|
|
optional uint64 downstreamAckTimeNanos = 3 [default = 0];
|
2011-06-12 22:00:51 +00:00
|
|
|
}
|
|
|
|
|
2011-11-01 05:17:08 +00:00
|
|
|
/**
|
|
|
|
* Sent as part of the BlockOpResponseProto
|
|
|
|
* for READ_BLOCK and COPY_BLOCK operations.
|
|
|
|
*/
|
|
|
|
message ReadOpChecksumInfoProto {
|
|
|
|
required ChecksumProto checksum = 1;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The offset into the block at which the first packet
|
|
|
|
* will start. This is necessary since reads will align
|
|
|
|
* backwards to a checksum chunk boundary.
|
|
|
|
*/
|
|
|
|
required uint64 chunkOffset = 2;
|
|
|
|
}
|
|
|
|
|
2011-06-12 22:00:51 +00:00
|
|
|
message BlockOpResponseProto {
|
|
|
|
required Status status = 1;
|
|
|
|
|
|
|
|
optional string firstBadLink = 2;
|
|
|
|
optional OpBlockChecksumResponseProto checksumResponse = 3;
|
2011-11-01 05:17:08 +00:00
|
|
|
optional ReadOpChecksumInfoProto readOpChecksumInfo = 4;
|
2011-10-31 21:53:58 +00:00
|
|
|
|
|
|
|
/** explanatory text which may be useful to log on the client side */
|
2011-11-01 05:17:08 +00:00
|
|
|
optional string message = 5;
|
2013-01-11 23:52:22 +00:00
|
|
|
|
|
|
|
/** If the server chooses to agree to the request of a client for
|
|
|
|
* short-circuit access, it will send a response message with the relevant
|
|
|
|
* file descriptors attached.
|
|
|
|
*
|
|
|
|
* In the body of the message, this version number will be set to the
|
|
|
|
* specific version number of the block data that the client is about to
|
|
|
|
* read.
|
|
|
|
*/
|
|
|
|
optional uint32 shortCircuitAccessVersion = 6;
|
2011-06-12 22:00:51 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Message sent from the client to the DN after reading the entire
|
|
|
|
* read request.
|
|
|
|
*/
|
|
|
|
message ClientReadStatusProto {
|
|
|
|
required Status status = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message DNTransferAckProto {
|
|
|
|
required Status status = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
message OpBlockChecksumResponseProto {
|
|
|
|
required uint32 bytesPerCrc = 1;
|
|
|
|
required uint64 crcPerBlock = 2;
|
|
|
|
required bytes md5 = 3;
|
2013-01-22 02:59:25 +00:00
|
|
|
optional ChecksumTypeProto crcType = 4;
|
2011-06-12 22:00:51 +00:00
|
|
|
}
|