change ambiguous field name
git-svn-id: svn+ssh://svn.corp.yahoo.com/yahoo/yrl/labs/pnuts/code/logstore@2939 8dad8b1f-cf64-0410-95b6-bcf113ffbcfe
This commit is contained in:
parent
e944fa63c9
commit
a24f1e34fe
1 changed files with 7 additions and 7 deletions
|
@ -27,7 +27,7 @@ public:
|
||||||
regionCount_ = TarrayListLength(xid, header_.region_list);
|
regionCount_ = TarrayListLength(xid, header_.region_list);
|
||||||
}
|
}
|
||||||
// Create a new region allocator.
|
// Create a new region allocator.
|
||||||
RegionAllocator(int xid, pageid_t region_length) :
|
RegionAllocator(int xid, pageid_t region_page_count) :
|
||||||
nextPage_(0),
|
nextPage_(0),
|
||||||
endOfRegion_(0),
|
endOfRegion_(0),
|
||||||
regionCount_(0),
|
regionCount_(0),
|
||||||
|
@ -36,7 +36,7 @@ public:
|
||||||
{
|
{
|
||||||
rid_ = Talloc(xid, sizeof(header_));
|
rid_ = Talloc(xid, sizeof(header_));
|
||||||
header_.region_list = TarrayListAlloc(xid, 1, 2, sizeof(pageid_t));
|
header_.region_list = TarrayListAlloc(xid, 1, 2, sizeof(pageid_t));
|
||||||
header_.region_length = region_length;
|
header_.region_page_count = region_page_count;
|
||||||
Tset(xid, rid_, &header_);
|
Tset(xid, rid_, &header_);
|
||||||
}
|
}
|
||||||
explicit RegionAllocator() :
|
explicit RegionAllocator() :
|
||||||
|
@ -58,14 +58,14 @@ public:
|
||||||
pageid_t ret = nextPage_;
|
pageid_t ret = nextPage_;
|
||||||
nextPage_ += extent_length;
|
nextPage_ += extent_length;
|
||||||
if(nextPage_ >= endOfRegion_) {
|
if(nextPage_ >= endOfRegion_) {
|
||||||
ret = TregionAlloc(xid, header_.region_length, 42); // XXX assign a region allocator id
|
ret = TregionAlloc(xid, header_.region_page_count, 42); // XXX assign a region allocator id
|
||||||
TarrayListExtend(xid, header_.region_list, 1);
|
TarrayListExtend(xid, header_.region_list, 1);
|
||||||
recordid rid = header_.region_list;
|
recordid rid = header_.region_list;
|
||||||
rid.slot = regionCount_;
|
rid.slot = regionCount_;
|
||||||
Tset(xid, rid, &ret);
|
Tset(xid, rid, &ret);
|
||||||
assert(extent_length <= header_.region_length); // XXX could handle this case if we wanted to. Would remove this error case, and not be hard.
|
assert(extent_length <= header_.region_page_count); // XXX could handle this case if we wanted to. Would remove this error case, and not be hard.
|
||||||
nextPage_ = ret + extent_length;
|
nextPage_ = ret + extent_length;
|
||||||
endOfRegion_ = ret + header_.region_length;
|
endOfRegion_ = ret + header_.region_page_count;
|
||||||
regionCount_++;
|
regionCount_++;
|
||||||
assert(regionCount_ == TarrayListLength(xid, header_.region_list));
|
assert(regionCount_ == TarrayListLength(xid, header_.region_list));
|
||||||
}
|
}
|
||||||
|
@ -110,7 +110,7 @@ public:
|
||||||
rid.slot = i;
|
rid.slot = i;
|
||||||
Tread(xid, rid, &ret[i]);
|
Tread(xid, rid, &ret[i]);
|
||||||
}
|
}
|
||||||
*region_length = header_.region_length;
|
*region_length = header_.region_page_count;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
void done() {
|
void done() {
|
||||||
|
@ -131,7 +131,7 @@ public:
|
||||||
private:
|
private:
|
||||||
typedef struct {
|
typedef struct {
|
||||||
recordid region_list;
|
recordid region_list;
|
||||||
pageid_t region_length;
|
pageid_t region_page_count;
|
||||||
} persistent_state;
|
} persistent_state;
|
||||||
|
|
||||||
recordid rid_;
|
recordid rid_;
|
||||||
|
|
Loading…
Reference in a new issue