0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
UpdateRecRange.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; either version 3
9  * of the 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 
26 
27 #ifndef Hypertable_RangeServer_UpdateRecRange_h
28 #define Hypertable_RangeServer_UpdateRecRange_h
29 
32 
34 
35 #include <Common/DynamicBuffer.h>
36 
37 #include <vector>
38 
39 namespace Hypertable {
40 
43 
46  public:
50  uint64_t offset;
52  uint64_t len;
53  };
54 
57  public:
58  void reset_updates(UpdateRequest *request) {
59  if (request == last_request) {
60  if (starting_update_count < updates.size())
63  }
64  }
65  void add_update(UpdateRequest *request, UpdateRecRange &update) {
66  if (request != last_request) {
68  last_request = request;
70  }
71  if (update.len)
72  updates.push_back(update);
73  }
75  std::vector<UpdateRecRange> updates;
82  bool range_blocked {};
83  };
84 
86 
87 }
88 
89 #endif // Hypertable_RangeServer_UpdateRecRange_h
bool empty() const
Returns true if the buffer is empty.
Definition: DynamicBuffer.h:73
std::vector< UpdateRecRange > updates
uint8_t * ptr
Pointer to the end of the used part of the buffer.
A dynamic, resizable and reference counted memory buffer.
Definition: DynamicBuffer.h:42
static const int64_t TIMESTAMP_MIN
Definition: KeySpec.h:34
A dynamic, resizable memory buffer.
DynamicBuffer * bufp
Pointer to buffer holding updates (serialized key/value pairs).
Declarations for Range.
Hypertable definitions
void reset_updates(UpdateRequest *request)
Declarations for UpdateRequest.
std::shared_ptr< Range > RangePtr
Smart pointer to Range.
Definition: Range.h:404
uint8_t * base
Pointer to the allocated memory buffer.
size_t fill() const
Returns the size of the used portion.
Definition: DynamicBuffer.h:70
std::shared_ptr< CommitLog > CommitLogPtr
Smart pointer to CommitLog.
Definition: CommitLog.h:223
uint64_t offset
Offset of beginning of update range within bufp.
void add_update(UpdateRequest *request, UpdateRecRange &update)
Holds client update request and error state.
Definition: UpdateRequest.h:54
Declarations for CommitLog.
Holds updates destined for a specific range.
Specifies a range of updates (key/value pairs) within a buffer.
uint64_t len
Length of update range within bufp starting at offset.