0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MetaLog.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
27 #ifndef Hypertable_Lib_MetaLog_h
28 #define Hypertable_Lib_MetaLog_h
29 
30 #include <Common/Filesystem.h>
31 
32 #include <deque>
33 #include <iostream>
34 
35 namespace Hypertable {
36 
44  namespace MetaLog {
45 
57  class Header {
58 
59  public:
60 
69  void encode(uint8_t **bufp) const;
70 
76  void decode(const uint8_t **bufp, size_t *remainp);
77 
80  enum {
81  LENGTH = 16
82  };
83 
85  uint16_t version;
86 
88  char name[14];
89  };
90 
102  void scan_log_directory(FilesystemPtr &fs, const std::string &path,
103  std::deque<int32_t> &file_ids);
104 
105  }
106 
108 }
109 
110 #endif // Hypertable_Lib_MetaLog_h
char name[14]
MetaLog definition name (e.g. "mml" or "rsml")
Definition: MetaLog.h:88
void encode(uint8_t **bufp) const
Encodes MetaLog file header.
Definition: MetaLog.cc:40
Abstract base class for a filesystem.
void decode(const uint8_t **bufp, size_t *remainp)
Decodes serialized header.
Definition: MetaLog.cc:46
Static header length.
Definition: MetaLog.h:81
void scan_log_directory(FilesystemPtr &fs, const std::string &path, std::deque< int32_t > &file_ids)
Scans MetaLog directory for numeric file names.
Definition: MetaLog.cc:54
Hypertable definitions
uint16_t version
MetaLog definition version number
Definition: MetaLog.h:85
std::shared_ptr< Filesystem > FilesystemPtr
Smart pointer to Filesystem.
Definition: Filesystem.h:572
Metalog file header.
Definition: MetaLog.h:57