| 1 | /******************************************************************** |
| 2 | * Copyright (c) 2013 - 2014, Pivotal Inc. |
| 3 | * All rights reserved. |
| 4 | * |
| 5 | * Author: Zhanwei Wang |
| 6 | ********************************************************************/ |
| 7 | /******************************************************************** |
| 8 | * 2014 - |
| 9 | * open source under Apache License Version 2.0 |
| 10 | ********************************************************************/ |
| 11 | /** |
| 12 | * Licensed to the Apache Software Foundation (ASF) under one |
| 13 | * or more contributor license agreements. See the NOTICE file |
| 14 | * distributed with this work for additional information |
| 15 | * regarding copyright ownership. The ASF licenses this file |
| 16 | * to you under the Apache License, Version 2.0 (the |
| 17 | * "License"); you may not use this file except in compliance |
| 18 | * with the License. You may obtain a copy of the License at |
| 19 | * |
| 20 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 21 | * |
| 22 | * Unless required by applicable law or agreed to in writing, software |
| 23 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 24 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 25 | * See the License for the specific language governing permissions and |
| 26 | * limitations under the License. |
| 27 | */ |
| 28 | #ifndef _HDFS_LIBHDFS3_CLIENT_PACKETHEADER_H_ |
| 29 | #define |
| 30 | |
| 31 | #include "datatransfer.pb.h" |
| 32 | |
| 33 | namespace Hdfs { |
| 34 | namespace Internal { |
| 35 | |
| 36 | class { |
| 37 | public: |
| 38 | (); |
| 39 | (int packetLen, int64_t offsetInBlock, int64_t seqno, |
| 40 | bool lastPacketInBlock, int dataLen); |
| 41 | bool (); |
| 42 | bool (int64_t lastSeqNo); |
| 43 | int (); |
| 44 | int (); |
| 45 | int64_t (); |
| 46 | int64_t (); |
| 47 | void (const char * buf, size_t size); |
| 48 | /** |
| 49 | * Write the header into the buffer. |
| 50 | * This requires that PKT_HEADER_LEN bytes are available. |
| 51 | */ |
| 52 | void (char * buf, size_t size); |
| 53 | |
| 54 | public: |
| 55 | static int (); |
| 56 | static int (); |
| 57 | |
| 58 | private: |
| 59 | static int ; |
| 60 | private: |
| 61 | int32_t ; |
| 62 | PacketHeaderProto ; |
| 63 | }; |
| 64 | |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | #endif /* _HDFS_LIBHDFS3_CLIENT_PACKETHEADER_H_ */ |
| 69 | |