2012-01-19 16:49:54 +00:00
|
|
|
/*
|
|
|
|
* check_gen.cpp
|
|
|
|
*
|
|
|
|
* Copyright 2010-2012 Yahoo! Inc.
|
|
|
|
*
|
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
* Author: sears
|
|
|
|
*/
|
2010-03-17 21:51:26 +00:00
|
|
|
#include <stasis/transactional.h>
|
2012-02-22 23:12:28 +00:00
|
|
|
#include "blsm.h"
|
2010-04-12 20:56:54 +00:00
|
|
|
#include "regionAllocator.h"
|
2010-01-23 02:13:59 +00:00
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
unlink("storefile.txt");
|
|
|
|
unlink("logfile.txt");
|
2011-04-20 21:51:04 +00:00
|
|
|
system("rm -rf stasis_log/");
|
2010-01-23 02:13:59 +00:00
|
|
|
|
|
|
|
sync();
|
|
|
|
|
2012-02-22 22:57:02 +00:00
|
|
|
blsm::init_stasis();
|
2010-01-23 02:13:59 +00:00
|
|
|
|
|
|
|
int xid = Tbegin();
|
|
|
|
|
2012-02-22 22:57:02 +00:00
|
|
|
blsm *ltable = new blsm(1000, 10000, 5);
|
2010-01-23 02:13:59 +00:00
|
|
|
|
2010-12-11 00:51:19 +00:00
|
|
|
recordid table_root = ltable->allocTable(xid);
|
2010-01-23 02:13:59 +00:00
|
|
|
|
|
|
|
Tcommit(xid);
|
|
|
|
|
|
|
|
xid = Tbegin();
|
2010-04-12 20:56:54 +00:00
|
|
|
RegionAllocator * ro_alloc = new RegionAllocator();
|
|
|
|
|
2010-12-11 00:51:19 +00:00
|
|
|
diskTreeComponent::internalNodes::iterator * it = new diskTreeComponent::internalNodes::iterator(xid,ro_alloc, ltable->get_tree_c2()->get_root_rid() );
|
2010-03-05 22:21:44 +00:00
|
|
|
it->close();
|
|
|
|
delete it;
|
2010-04-12 20:56:54 +00:00
|
|
|
delete ro_alloc;
|
2010-01-23 02:13:59 +00:00
|
|
|
Tcommit(xid);
|
2010-12-11 00:51:19 +00:00
|
|
|
delete ltable;
|
2012-02-22 22:57:02 +00:00
|
|
|
blsm::deinit_stasis();
|
2010-01-23 02:13:59 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|