Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id ABB8B10490 for ; Fri, 6 Sep 2013 01:48:36 +0000 (UTC) Received: (qmail 19058 invoked by uid 500); 6 Sep 2013 01:48:33 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 18960 invoked by uid 500); 6 Sep 2013 01:48:33 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 17581 invoked by uid 99); 6 Sep 2013 01:48:31 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 06 Sep 2013 01:48:31 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 5BCFA901D7D; Fri, 6 Sep 2013 01:48:31 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ctubbsii@apache.org To: commits@accumulo.apache.org Date: Fri, 06 Sep 2013 01:49:13 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [45/53] [abbrv] ACCUMULO-658 Move native library to its own module http://git-wip-us.apache.org/repos/asf/accumulo/blob/d1b449d3/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap.cc ---------------------------------------------------------------------- diff --git a/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap.cc b/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap.cc deleted file mode 100644 index 5049bc8..0000000 --- a/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap.cc +++ /dev/null @@ -1,149 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You 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. -*/ -#include "org_apache_accumulo_server_tabletserver_NativeMap.h" -#include "SubKey.h" -#include "Field.h" -#include "NativeMap.h" -#include -#include -#include -#include - -#ifdef _POSIX_MEMLOCK -#include -#endif - -using namespace std; - -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_createNM(JNIEnv *env, jclass cls){ - return (jlong)(new NativeMap(1<<17, 1<<11)); -} - -JNIEXPORT jint JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_sizeNM(JNIEnv *env, jclass cls, jlong nm) -{ - return ((NativeMap *)nm)->count; -} - -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_memoryUsedNM(JNIEnv *env, jclass cls, jlong nm) -{ - return ((NativeMap *)nm)->getMemoryUsed(); -} - -JNIEXPORT void JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_singleUpdate(JNIEnv *env, jclass cls, jlong nm, jbyteArray r, jbyteArray cf, jbyteArray cq, jbyteArray cv, jlong ts, jboolean del, jbyteArray val, jint mutationCount) -{ - jlong uid = Java_org_apache_accumulo_server_tabletserver_NativeMap_startUpdate(env, cls, nm, r); - Java_org_apache_accumulo_server_tabletserver_NativeMap_update(env, cls, nm, uid, cf, cq, cv, ts, del, val, mutationCount); -} - -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_startUpdate(JNIEnv *env, jclass cls, jlong nm, jbyteArray r) -{ - NativeMap *nativeMap = (NativeMap *)nm; - - ColumnMap *cm = nativeMap->startUpdate(env, r); - - return (jlong)cm; -} - -JNIEXPORT void JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_update(JNIEnv *env, jclass cls, jlong nm, jlong uid, jbyteArray cf, jbyteArray cq, jbyteArray cv, jlong ts, jboolean del, jbyteArray val, jint mutationCount) -{ - NativeMap *nativeMap = (NativeMap *)nm; - nativeMap->update((ColumnMap *)uid, env, cf, cq, cv, ts, del, val, mutationCount); -} - -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_deleteNM(JNIEnv *env, jclass cls, jlong nm) -{ - NativeMap *nativeMap = (NativeMap *)nm; - delete(nativeMap); - return 0; -} - - -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_createNMI__J_3I(JNIEnv *env, jclass cls, jlong nm, jintArray lens) -{ - NativeMap *nativeMap = (NativeMap *)nm; - - int32_t ia[7]; - Iterator *iter = nativeMap->iterator(ia); - if(iter->atEnd()){ - delete(iter); - return 0; - } - - env->SetIntArrayRegion(lens, 0, 7, ia); - - return (jlong)iter; - -} - -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_createNMI__J_3B_3B_3B_3BJZ_3I(JNIEnv *env, jclass cls, jlong nm, jbyteArray r, jbyteArray cf, jbyteArray cq, jbyteArray cv, jlong ts, jboolean del, jintArray lens) -{ - NativeMap *nativeMap = (NativeMap *)nm; - - LocalField row(env, r); - LocalSubKey sk(env, cf, cq, cv, ts, del); - - int32_t ia[7]; - Iterator *iter = nativeMap->iterator(row, sk, ia); - - if(iter->atEnd()){ - delete(iter); - return 0; - } - - env->SetIntArrayRegion(lens, 0, 7, ia); - - return (jlong)iter; - -} - -JNIEXPORT jboolean JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_nmiNext(JNIEnv *env, jclass cls, jlong ip, jintArray lens){ - Iterator &iter = *((Iterator *)ip); - - int32_t ia[7]; - iter.advance(ia); - if(iter.atEnd()){ - return false; - } - - env->SetIntArrayRegion(lens, 0, 7, ia); - return true; -} - -JNIEXPORT void JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_nmiGetData(JNIEnv *env, jclass cls, jlong ip, jbyteArray r, jbyteArray cf, jbyteArray cq, jbyteArray cv, jbyteArray val){ - Iterator &iter = *((Iterator *)ip); - - if(r != NULL){ - iter.rowIter->first.fillIn(env, r); - } - - iter.colIter->first.getCF().fillIn(env, cf); - iter.colIter->first.getCQ().fillIn(env, cq); - iter.colIter->first.getCV().fillIn(env, cv); - iter.colIter->second.fillIn(env, val); -} - -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_nmiGetTS(JNIEnv *env, jclass cls, jlong ip){ - Iterator &iter = *((Iterator *)ip); - return iter.colIter->first.getTimestamp(); -} - - - -JNIEXPORT void JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_deleteNMI(JNIEnv *env, jclass cls, jlong ip){ - delete((Iterator *)ip); -} - http://git-wip-us.apache.org/repos/asf/accumulo/blob/d1b449d3/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap.h ---------------------------------------------------------------------- diff --git a/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap.h b/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap.h deleted file mode 100644 index 1082f33..0000000 --- a/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap.h +++ /dev/null @@ -1,133 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You 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. -*/ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_apache_accumulo_server_tabletserver_NativeMap */ - -#ifndef _Included_org_apache_accumulo_server_tabletserver_NativeMap -#define _Included_org_apache_accumulo_server_tabletserver_NativeMap -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_apache_accumulo_server_tabletserver_NativeMap - * Method: createNM - * Signature: ()J - */ -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_createNM - (JNIEnv *, jclass); - -/* - * Class: org_apache_accumulo_server_tabletserver_NativeMap - * Method: singleUpdate - * Signature: (J[B[B[B[BJZ[BI)V - */ -JNIEXPORT void JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_singleUpdate - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jlong, jboolean, jbyteArray, jint); - -/* - * Class: org_apache_accumulo_server_tabletserver_NativeMap - * Method: startUpdate - * Signature: (J[B)J - */ -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_startUpdate - (JNIEnv *, jclass, jlong, jbyteArray); - -/* - * Class: org_apache_accumulo_server_tabletserver_NativeMap - * Method: update - * Signature: (JJ[B[B[BJZ[BI)V - */ -JNIEXPORT void JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_update - (JNIEnv *, jclass, jlong, jlong, jbyteArray, jbyteArray, jbyteArray, jlong, jboolean, jbyteArray, jint); - -/* - * Class: org_apache_accumulo_server_tabletserver_NativeMap - * Method: sizeNM - * Signature: (J)I - */ -JNIEXPORT jint JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_sizeNM - (JNIEnv *, jclass, jlong); - -/* - * Class: org_apache_accumulo_server_tabletserver_NativeMap - * Method: memoryUsedNM - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_memoryUsedNM - (JNIEnv *, jclass, jlong); - -/* - * Class: org_apache_accumulo_server_tabletserver_NativeMap - * Method: deleteNM - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_deleteNM - (JNIEnv *, jclass, jlong); - -/* - * Class: org_apache_accumulo_server_tabletserver_NativeMap - * Method: createNMI - * Signature: (J[I)J - */ -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_createNMI__J_3I - (JNIEnv *, jclass, jlong, jintArray); - -/* - * Class: org_apache_accumulo_server_tabletserver_NativeMap - * Method: createNMI - * Signature: (J[B[B[B[BJZ[I)J - */ -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_createNMI__J_3B_3B_3B_3BJZ_3I - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jlong, jboolean, jintArray); - -/* - * Class: org_apache_accumulo_server_tabletserver_NativeMap - * Method: nmiNext - * Signature: (J[I)Z - */ -JNIEXPORT jboolean JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_nmiNext - (JNIEnv *, jclass, jlong, jintArray); - -/* - * Class: org_apache_accumulo_server_tabletserver_NativeMap - * Method: nmiGetData - * Signature: (J[B[B[B[B[B)V - */ -JNIEXPORT void JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_nmiGetData - (JNIEnv *, jclass, jlong, jbyteArray, jbyteArray, jbyteArray, jbyteArray, jbyteArray); - -/* - * Class: org_apache_accumulo_server_tabletserver_NativeMap - * Method: nmiGetTS - * Signature: (J)J - */ -JNIEXPORT jlong JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_nmiGetTS - (JNIEnv *, jclass, jlong); - -/* - * Class: org_apache_accumulo_server_tabletserver_NativeMap - * Method: deleteNMI - * Signature: (J)V - */ -JNIEXPORT void JNICALL Java_org_apache_accumulo_server_tabletserver_NativeMap_deleteNMI - (JNIEnv *, jclass, jlong); - -#ifdef __cplusplus -} -#endif -#endif http://git-wip-us.apache.org/repos/asf/accumulo/blob/d1b449d3/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_ConcurrentIterator.h ---------------------------------------------------------------------- diff --git a/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_ConcurrentIterator.h b/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_ConcurrentIterator.h deleted file mode 100644 index fedfdf1..0000000 --- a/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_ConcurrentIterator.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You 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. -*/ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_apache_accumulo_server_tabletserver_NativeMap_ConcurrentIterator */ - -#ifndef _Included_org_apache_accumulo_server_tabletserver_NativeMap_ConcurrentIterator -#define _Included_org_apache_accumulo_server_tabletserver_NativeMap_ConcurrentIterator -#ifdef __cplusplus -extern "C" { -#endif -#undef org_apache_accumulo_server_tabletserver_NativeMap_ConcurrentIterator_MAX_READ_AHEAD_ENTRIES -#define org_apache_accumulo_server_tabletserver_NativeMap_ConcurrentIterator_MAX_READ_AHEAD_ENTRIES 16L -#undef org_apache_accumulo_server_tabletserver_NativeMap_ConcurrentIterator_READ_AHEAD_BYTES -#define org_apache_accumulo_server_tabletserver_NativeMap_ConcurrentIterator_READ_AHEAD_BYTES 4096L -#ifdef __cplusplus -} -#endif -#endif http://git-wip-us.apache.org/repos/asf/accumulo/blob/d1b449d3/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_NMEntry.h ---------------------------------------------------------------------- diff --git a/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_NMEntry.h b/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_NMEntry.h deleted file mode 100644 index 48533e8..0000000 --- a/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_NMEntry.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You 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. -*/ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_apache_accumulo_server_tabletserver_NativeMap_NMEntry */ - -#ifndef _Included_org_apache_accumulo_server_tabletserver_NativeMap_NMEntry -#define _Included_org_apache_accumulo_server_tabletserver_NativeMap_NMEntry -#ifdef __cplusplus -extern "C" { -#endif -#ifdef __cplusplus -} -#endif -#endif http://git-wip-us.apache.org/repos/asf/accumulo/blob/d1b449d3/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_NMIterator.h ---------------------------------------------------------------------- diff --git a/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_NMIterator.h b/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_NMIterator.h deleted file mode 100644 index 2b0b26e..0000000 --- a/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_NMIterator.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You 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. -*/ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_apache_accumulo_server_tabletserver_NativeMap_NMIterator */ - -#ifndef _Included_org_apache_accumulo_server_tabletserver_NativeMap_NMIterator -#define _Included_org_apache_accumulo_server_tabletserver_NativeMap_NMIterator -#ifdef __cplusplus -extern "C" { -#endif -#ifdef __cplusplus -} -#endif -#endif http://git-wip-us.apache.org/repos/asf/accumulo/blob/d1b449d3/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_NMSKVIter.h ---------------------------------------------------------------------- diff --git a/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_NMSKVIter.h b/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_NMSKVIter.h deleted file mode 100644 index e2b92a8..0000000 --- a/server/server/src/main/c++/nativeMap/org_apache_accumulo_server_tabletserver_NativeMap_NMSKVIter.h +++ /dev/null @@ -1,29 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You 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. -*/ -/* DO NOT EDIT THIS FILE - it is machine generated */ -#include -/* Header for class org_apache_accumulo_server_tabletserver_NativeMap_NMSKVIter */ - -#ifndef _Included_org_apache_accumulo_server_tabletserver_NativeMap_NMSKVIter -#define _Included_org_apache_accumulo_server_tabletserver_NativeMap_NMSKVIter -#ifdef __cplusplus -extern "C" { -#endif -#ifdef __cplusplus -} -#endif -#endif http://git-wip-us.apache.org/repos/asf/accumulo/blob/d1b449d3/server/server/src/main/c++/nativeMap/test.cc ---------------------------------------------------------------------- diff --git a/server/server/src/main/c++/nativeMap/test.cc b/server/server/src/main/c++/nativeMap/test.cc deleted file mode 100644 index 4089061..0000000 --- a/server/server/src/main/c++/nativeMap/test.cc +++ /dev/null @@ -1,152 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You 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. -*/ -#include "NativeMap.h" -#include "util.h" -#include "Key.h" -#include - -void runTest(int numRows, int numCf, int numCq, int rowLen, int cfLen, int cqLen, int cvLen, int valLen, bool testOld){ - - map tm; - tm.insert(pair("a","b")); - tm.insert(pair("a","c")).first->second="c"; - - cout << tm["a"] << std::endl; - - size_t initialMemUsage = getMemUsage(); - - NativeMap nm(1<<17, 1<<11); - - cout << " size pair : " << sizeof(std::pair) << endl; - cout << " size pair : " << sizeof(std::pair) << endl; - cout << " size pair : " << sizeof(std::pair) << endl; - -// std::less comp; -// map, block_allocator > > oldMap(comp, block_allocator >(&lba)); - map oldMap; - - int entries = 0; - - - char rowFmt[16]; - char cfFmt[16]; - char cqFmt[16]; - char cvFmt[16]; - char valFmt[16]; - - sprintf(rowFmt, "%s0%dd", "%", rowLen); - sprintf(cfFmt, "%s0%dd", "%", cfLen); - sprintf(cqFmt, "%s0%dd", "%", cqLen); - sprintf(cvFmt, "%s0%dd", "%", cvLen); - sprintf(valFmt, "%s0%dd", "%", valLen); - - for(int r = 0; r < numRows; r++){ - char row[rowLen+1]; - snprintf(row, rowLen+1, rowFmt, r); - - CMT *cmt = NULL; - if(!testOld){ - cmt = nm.startUpdate(row); - } - - for(int cf = 0; cf < numCf; cf++){ - char colf[cfLen+1]; - snprintf(colf, cfLen+1, cfFmt, cf); - - for(int cq = 0; cq < numCq; cq++){ - char colq[cqLen+1]; - snprintf(colq, cqLen+1, cqFmt, cq); - - char colv[cvLen+1]; - snprintf(colv, cvLen+1, cvFmt, 1); - - char val[valLen+1]; - snprintf(val, valLen+1, valFmt, entries); - - if(!testOld){ - nm.update(cmt, colf, colq, colv, 5, false, val, valLen); - }else{ - oldMap.insert(pair(Key(row, colf, colq, colv, 5, false), Field(val))); - } - - - entries++; - - } - } - } - - int expectedRowBytes = rowLen * numRows; - int expectedEntryBytes = entries * (cfLen + cqLen + cvLen + 9 + valLen); - - cout << "row bytes : " << expectedRowBytes << endl; - cout << "entry bytes : " << expectedEntryBytes << endl; - cout << "count : " << nm.count << " " << entries << endl; - size_t memUsage = getMemUsage(); - cout << " mem delta " << memUsage - initialMemUsage << endl; - cout << " mem usage " << memUsage << endl; - cout << " simple overhead " << ( (getMemUsage() - initialMemUsage) - (entries * (rowLen + cfLen + cqLen + cvLen + 9 + valLen) ) ) / ((double)entries) << endl; - - if(testOld){ - map::iterator iter = oldMap.begin(); - while(iter != oldMap.end()){ - delete(iter->first.keyData); - delete(iter->second.field); - iter++; - } - } - -/* - - int32_t ia[6]; - Iterator *iter = nm.iterator(ia); - - while(!iter->atEnd()){ - const Field &row = iter->rowIter->first; - const SubKey &sk = iter->colIter->first; - const Field &value = iter->colIter->second; - cout << row.toString() << " " << sk.toString() << " " << value.toString() << endl; - - iter->advance(ia); - } - - delete(iter); -*/ -} - -int main(int argc, char **argv){ - int numRows,numCf, numCq, rowLen, cfLen, cqLen, cvLen, valLen, testOld; - - if(argc != 10){ - cout << "Usage : " << argv[0] << " " << endl; - return -1; - } - - sscanf(argv[1], "%d", &numRows); - sscanf(argv[2], "%d", &numCf); - sscanf(argv[3], "%d", &numCq); - sscanf(argv[4], "%d", &rowLen); - sscanf(argv[5], "%d", &cfLen); - sscanf(argv[6], "%d", &cqLen); - sscanf(argv[7], "%d", &cvLen); - sscanf(argv[8], "%d", &valLen); - sscanf(argv[9], "%d", &testOld); - - for(int i = 0; i < 3; i++){ - runTest(numRows,numCf, numCq, rowLen, cfLen, cqLen, cvLen, valLen, testOld); - } -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/d1b449d3/server/server/src/main/c++/nativeMap/util.cc ---------------------------------------------------------------------- diff --git a/server/server/src/main/c++/nativeMap/util.cc b/server/server/src/main/c++/nativeMap/util.cc deleted file mode 100644 index d4907e3..0000000 --- a/server/server/src/main/c++/nativeMap/util.cc +++ /dev/null @@ -1,40 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You 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. -*/ -#include -#include -#include - -#include "util.h" - -size_t getMemUsage(){ - pid_t pid = getpid(); - - char cmd[1000]; - - sprintf(cmd, "cat /proc/%d/status | grep VmData | awk '{print $2}'", pid); - - - FILE *f = popen(cmd, "r"); - - int dataSize; - - fscanf(f, "%d\n", &dataSize); - - pclose(f); - - return (size_t)dataSize * (size_t)1024; -} http://git-wip-us.apache.org/repos/asf/accumulo/blob/d1b449d3/server/server/src/main/c++/nativeMap/util.h ---------------------------------------------------------------------- diff --git a/server/server/src/main/c++/nativeMap/util.h b/server/server/src/main/c++/nativeMap/util.h deleted file mode 100644 index 65d5721..0000000 --- a/server/server/src/main/c++/nativeMap/util.h +++ /dev/null @@ -1,19 +0,0 @@ -/* -* Licensed to the Apache Software Foundation (ASF) under one or more -* contributor license agreements. See the NOTICE file distributed with -* this work for additional information regarding copyright ownership. -* The ASF licenses this file to You 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. -*/ - -size_t getMemUsage(); -