You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by ec...@apache.org on 2013/10/11 20:57:35 UTC
git commit: ACCUMULO-1770 got the stand-alone c++ test to run;
ran it under valgrind and corrected the only warning. It never
leaked, though.
Updated Branches:
refs/heads/master d88be6c12 -> 3976e0a35
ACCUMULO-1770 got the stand-alone c++ test to run; ran it under valgrind and corrected the only warning. It never leaked, though.
Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo
Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/3976e0a3
Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/3976e0a3
Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/3976e0a3
Branch: refs/heads/master
Commit: 3976e0a351d729eb413e2a968df138bd782afeb5
Parents: d88be6c
Author: Eric Newton <er...@gmail.com>
Authored: Fri Oct 11 14:57:57 2013 -0400
Committer: Eric Newton <er...@gmail.com>
Committed: Fri Oct 11 14:57:57 2013 -0400
----------------------------------------------------------------------
server/src/main/c++/nativeMap/BlockAllocator.h | 4 ++--
server/src/main/c++/nativeMap/Makefile | 3 +++
server/src/main/c++/nativeMap/test.cc | 10 +++++-----
3 files changed, 10 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/accumulo/blob/3976e0a3/server/src/main/c++/nativeMap/BlockAllocator.h
----------------------------------------------------------------------
diff --git a/server/src/main/c++/nativeMap/BlockAllocator.h b/server/src/main/c++/nativeMap/BlockAllocator.h
index 3126217..d62ffd5 100644
--- a/server/src/main/c++/nativeMap/BlockAllocator.h
+++ b/server/src/main/c++/nativeMap/BlockAllocator.h
@@ -150,13 +150,13 @@ struct LinkedBlockAllocator {
//std::cout << "Deleting " << blocks.size() << " blocks, memused : " << memused << std::endl;
std::vector<Block>::iterator iter = blocks.begin();
while(iter != blocks.end()){
- delete(iter->data);
+ delete [] (iter->data);
iter++;
}
std::vector<BigBlock>::iterator iter2 = bigBlocks.begin();
while(iter2 != bigBlocks.end()){
- delete(iter2->ptr);
+ delete [] (iter2->ptr);
iter2++;
}
}
http://git-wip-us.apache.org/repos/asf/accumulo/blob/3976e0a3/server/src/main/c++/nativeMap/Makefile
----------------------------------------------------------------------
diff --git a/server/src/main/c++/nativeMap/Makefile b/server/src/main/c++/nativeMap/Makefile
index 26a8ad9..2124fa2 100644
--- a/server/src/main/c++/nativeMap/Makefile
+++ b/server/src/main/c++/nativeMap/Makefile
@@ -58,6 +58,9 @@ clean:
org_apache_accumulo_server_tabletserver_NativeMap.h :
javah -classpath ../../../../../lib/accumulo-server.jar org.apache.accumulo.server.tabletserver.NativeMap
+test: $(SRCS) $(HDRS)
+ g++ -g -o test -Wall -I$(JAVA_HOME)/include/linux -I$(JAVA_HOME)/include $(SRCS) test.cc
+
$(INSTALLED_LIBS) : $(INSTALL_DIR) $(LIBS)
cp $(LIBS) $(INSTALL_DIR)
http://git-wip-us.apache.org/repos/asf/accumulo/blob/3976e0a3/server/src/main/c++/nativeMap/test.cc
----------------------------------------------------------------------
diff --git a/server/src/main/c++/nativeMap/test.cc b/server/src/main/c++/nativeMap/test.cc
index 4089061..eda4531 100644
--- a/server/src/main/c++/nativeMap/test.cc
+++ b/server/src/main/c++/nativeMap/test.cc
@@ -31,9 +31,9 @@ void runTest(int numRows, int numCf, int numCq, int rowLen, int cfLen, int cqLen
NativeMap nm(1<<17, 1<<11);
- cout << " size pair<Key, Field> : " << sizeof(std::pair<Key, Field>) << endl;
- cout << " size pair<Field, CMT> : " << sizeof(std::pair<Field, CMT>) << endl;
- cout << " size pair<SubKey, Field> : " << sizeof(std::pair<SubKey, Field>) << endl;
+ cout << " size pair<Key, Field> : " << sizeof(std::pair<Key, Field>) << endl;
+ cout << " size pair<Field, ColumnMap> : " << sizeof(std::pair<Field, ColumnMap>) << endl;
+ cout << " size pair<SubKey, Field> : " << sizeof(std::pair<SubKey, Field>) << endl;
// std::less<Key> comp;
// map<Key, Field, std::less<Key>, block_allocator<std::pair<Key, Field> > > oldMap(comp, block_allocator<std::pair<Key, Field> >(&lba));
@@ -58,7 +58,7 @@ void runTest(int numRows, int numCf, int numCq, int rowLen, int cfLen, int cqLen
char row[rowLen+1];
snprintf(row, rowLen+1, rowFmt, r);
- CMT *cmt = NULL;
+ ColumnMap *cmt = NULL;
if(!testOld){
cmt = nm.startUpdate(row);
}
@@ -78,7 +78,7 @@ void runTest(int numRows, int numCf, int numCq, int rowLen, int cfLen, int cqLen
snprintf(val, valLen+1, valFmt, entries);
if(!testOld){
- nm.update(cmt, colf, colq, colv, 5, false, val, valLen);
+ nm.update(cmt, colf, colq, colv, 5, false, val, valLen, cf * numCq + numCq);
}else{
oldMap.insert(pair<Key, Field>(Key(row, colf, colq, colv, 5, false), Field(val)));
}