Skip to content

Commit fcb66f1

Browse files
committed
small cleanups in the state code
ensure that variables are initialized. remove unused variables. provide additional information for state exeception Signed-off-by: Mic Bowman <mic.bowman@intel.com>
1 parent 35a178c commit fcb66f1

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

common/state/basic_kv.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ namespace state
2323
{
2424
class Basic_KV
2525
{
26-
protected:
27-
void* handle;
28-
2926
public:
3027
virtual ~Basic_KV() {}
3128
virtual void Finalize(ByteArray& id) = 0;

common/state/data_node_io.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ void pstate::data_node_io::init_append_data_node()
5959

6060
void pstate::data_node_io::add_and_init_append_data_node()
6161
{
62-
pdo::error::ThrowIf<pdo::error::RuntimeError>(append_dn_->free_bytes() == data_node::data_end_index() - data_node::data_begin_index(),
63-
"appending new data node after empty one");
62+
pdo::error::ThrowIf<pdo::error::RuntimeError>(
63+
append_dn_->free_bytes() == data_node::data_end_index() - data_node::data_begin_index(),
64+
"appending new data node after empty one; %u bytes in block %u",
65+
append_dn_->free_bytes(), append_dn_->get_block_num());
6466

6567
unsigned int append_data_node_block_num = block_warehouse_.get_last_block_num();
6668

common/state/data_node_io.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ namespace state
2828
data_node* append_dn_;
2929
Cache cache_;
3030

31-
data_node_io(const ByteArray& key) : block_warehouse_(key), cache_(block_warehouse_) {}
31+
data_node_io(const ByteArray& key) :
32+
block_warehouse_(key), cache_(block_warehouse_) { append_dn_ = nullptr; }
33+
3234
void initialize(pdo::state::StateNode& node);
3335

3436
void init_append_data_node();

0 commit comments

Comments
 (0)