⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 kfstypes.h

📁 nandflash文件系统源代码
💻 H
字号:
//---------------------------------------------------------- -*- Mode: C++ -*-// $Id: kfstypes.h 216 2008-11-07 07:43:36Z sriramsrao $ //// \brief Common declarations for KFS (meta/chunk/client-lib)//// Created 2006/10/20// Author: Sriram Rao//// Copyright 2008 Quantcast Corp.// Copyright 2006-2008 Kosmix Corp.//// This file is part of Kosmos File System (KFS).//// Licensed 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.////----------------------------------------------------------------------------#ifndef COMMON_KFSTYPES_H#define COMMON_KFSTYPES_Hextern "C" {#include <stdlib.h>}#include <cerrno>#include <cassert>#if defined (__APPLE__)// tr1 on Apple doesn't define the hash for int64#include "cxxutil.h"#endifnamespace KFS {typedef long long seq_t;        //!< request sequence no. for loggingtypedef long long seqid_t;      //!< sequence number id's for file/chunkstypedef seqid_t fid_t;          //!< file IDtypedef seqid_t chunkId_t;      //!< chunk IDtypedef long long chunkOff_t;   //!< chunk offsetconst fid_t ROOTFID = 2;        //!< special fid for "///!< Declarations as used in the Chunkserver/client-librarytypedef int64_t kfsFileId_t;typedef int64_t kfsChunkId_t;typedef int64_t kfsSeq_t;const size_t CHUNKSIZE = 1u << 26; //!< (64MB)const int MAX_RPC_HEADER_LEN = 1024; //!< Max length of header in RPC req/responseconst short int NUM_REPLICAS_PER_FILE = 3; //!< default degree of replicationconst short int MAX_REPLICAS_PER_FILE = 64; //!< max. replicas per chunk of file//!< Default lease interval of 5 minsconst int LEASE_INTERVAL_SECS = 300;//!< Error codes for KFS specific errors// version # being presented by client doesn't match what the server hasconst int EBADVERS = 1000;// lease has expiredconst int ELEASEEXPIRED = 1001;// checksum for data on a server is bad; client should read from elsewhereconst int EBADCKSUM = 1002;// data lives on chunkservers that are all non-reachableconst int EDATAUNAVAIL = 1003;// an error to indicate a server is busy and can't take on new workconst int ESERVERBUSY = 1004;// an error occurring during allocation; the client will see this error// code and retry. const int EALLOCFAILED = 1005;// error to indicate that there is a cluster key mismatch between// chunkserver and metaserver.const int EBADCLUSTERKEY = 1006;}#endif // COMMON_KFSTYPES_H

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -