Return-Path: X-Original-To: apmail-concerted-commits-archive@minotaur.apache.org Delivered-To: apmail-concerted-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id B0CC118188 for ; Mon, 26 Oct 2015 15:04:20 +0000 (UTC) Received: (qmail 98941 invoked by uid 500); 26 Oct 2015 14:57:28 -0000 Delivered-To: apmail-concerted-commits-archive@concerted.apache.org Received: (qmail 98703 invoked by uid 500); 26 Oct 2015 14:57:28 -0000 Mailing-List: contact commits-help@concerted.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@concerted.incubator.apache.org Delivered-To: mailing list commits@concerted.incubator.apache.org Received: (qmail 98421 invoked by uid 99); 26 Oct 2015 14:57:28 -0000 Received: from Unknown (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2015 14:57:28 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 716A5180F5B for ; Mon, 26 Oct 2015 14:57:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.771 X-Spam-Level: * X-Spam-Status: No, score=1.771 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, T_RP_MATCHES_RCVD=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id v_x7mN07LyU1 for ; Mon, 26 Oct 2015 14:57:15 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with SMTP id 8365D20924 for ; Mon, 26 Oct 2015 14:57:13 +0000 (UTC) Received: (qmail 98192 invoked by uid 99); 26 Oct 2015 14:57:12 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 26 Oct 2015 14:57:12 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 7A32FE01F4; Mon, 26 Oct 2015 14:57:12 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: atri@apache.org To: commits@concerted.incubator.apache.org Message-Id: X-Mailer: ASF-Git Admin Mailer Subject: incubator-concerted git commit: CONCERTED-20:Add Apache header to files and change license Date: Mon, 26 Oct 2015 14:57:12 +0000 (UTC) Repository: incubator-concerted Updated Branches: refs/heads/master c99bbdcf6 -> af37c9fe8 CONCERTED-20:Add Apache header to files and change license Project: http://git-wip-us.apache.org/repos/asf/incubator-concerted/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-concerted/commit/af37c9fe Tree: http://git-wip-us.apache.org/repos/asf/incubator-concerted/tree/af37c9fe Diff: http://git-wip-us.apache.org/repos/asf/incubator-concerted/diff/af37c9fe Branch: refs/heads/master Commit: af37c9fe88aa45deadb829b3c4206fbbd02c864f Parents: c99bbdc Author: Nupur Authored: Mon Oct 26 20:26:22 2015 +0530 Committer: Nupur Committed: Mon Oct 26 20:26:22 2015 +0530 ---------------------------------------------------------------------- include/CacheManager.h | 16 ++ include/ConcDCT.h | 16 ++ include/ConcDef.h | 16 ++ include/ConcInvertedIndex.h | 18 ++- include/ConcMAT.h | 16 ++ include/ConcQueue.h | 32 +++- include/ConcSegHashTable.h | 24 ++- include/QueueLock.h | 22 ++- include/QueueLock2.h | 22 ++- include/TransactionManager.h | 18 ++- license | 203 +++++++++++++++++++++++- makefile | 17 ++ src/CacheManager.cpp | 16 ++ src/ConcQueueTest.cpp | 18 ++- test/ConcDCTConcurrencyTest.cpp | 20 ++- test/ConcDCTFileReader.cpp | 18 ++- test/ConcDCTFileReader.cpp~ | 53 ------- test/ConcDCTTest.cpp | 16 ++ test/ConcDCTTest.cpp~ | 62 -------- test/ConcInvertedIndexTest.cpp | 18 ++- test/ConcInvertedIndexTest.cpp~ | 28 ---- test/ConcMATFileReader.cpp | 18 ++- test/ConcMATTest.cpp | 19 ++- test/ConcMATTest.cpp~ | 24 --- test/ConcSegHashTableTest.cpp | 18 ++- test/ConcSegHashTableTest.cpp~ | 87 ----------- test/ConcSkipListTest.cpp | 22 ++- test/ConcSkipListTest.cpp~ | 294 ----------------------------------- test/FileReader.cpp | 16 ++ test/FileReader.cpp~ | 52 ------- test/QueueLockTest.cpp | 18 ++- test/QueueLockTest.cpp~ | 43 ----- 32 files changed, 593 insertions(+), 687 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/include/CacheManager.h ---------------------------------------------------------------------- diff --git a/include/CacheManager.h b/include/CacheManager.h index 4c137f3..546ff22 100644 --- a/include/CacheManager.h +++ b/include/CacheManager.h @@ -1,3 +1,19 @@ +/* + * 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 "ConcDef.h" using namespace std; http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/include/ConcDCT.h ---------------------------------------------------------------------- diff --git a/include/ConcDCT.h b/include/ConcDCT.h index 59a4e34..1c323ae 100644 --- a/include/ConcDCT.h +++ b/include/ConcDCT.h @@ -1,3 +1,19 @@ +/* + * 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 "TransactionManager.h" using namespace std; http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/include/ConcDef.h ---------------------------------------------------------------------- diff --git a/include/ConcDef.h b/include/ConcDef.h index c518e6c..4c75d81 100644 --- a/include/ConcDef.h +++ b/include/ConcDef.h @@ -1,3 +1,19 @@ +/* + * 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 using namespace std; http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/include/ConcInvertedIndex.h ---------------------------------------------------------------------- diff --git a/include/ConcInvertedIndex.h b/include/ConcInvertedIndex.h index 9fbab2f..4cf6fa6 100644 --- a/include/ConcInvertedIndex.h +++ b/include/ConcInvertedIndex.h @@ -1,3 +1,19 @@ +/* + * 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 using namespace std; @@ -273,7 +289,7 @@ public: index_val->insert_val(temp); traverse = temp; } - + for (i = 1;i < n;i++) { if (i != index) http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/include/ConcMAT.h ---------------------------------------------------------------------- diff --git a/include/ConcMAT.h b/include/ConcMAT.h index 1c8dc0e..8694567 100644 --- a/include/ConcMAT.h +++ b/include/ConcMAT.h @@ -1,3 +1,19 @@ +/* + * 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 using namespace std; http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/include/ConcQueue.h ---------------------------------------------------------------------- diff --git a/include/ConcQueue.h b/include/ConcQueue.h index 07dba00..c015580 100644 --- a/include/ConcQueue.h +++ b/include/ConcQueue.h @@ -1,3 +1,19 @@ +/* + * 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. + */ #ifndef CONCQUEUE_INCLUDED #define CONCQUEUE_INCLUDED @@ -58,7 +74,7 @@ public: insertion_lock.lock_value = 0; deletion_lock.lock_value = 0; } - + int CAS(volatile int *val, int compare_value, int swap_value) { @@ -77,7 +93,7 @@ public: traverse = traverse->GetPointer(); } } - + const QueueElement* AddElement(data_val_type val) { QueueElement *temp = NULL; @@ -86,8 +102,8 @@ public: temp = new QueueElement(val); temp->SetPointer(NULL); - /* Synchronization by locking with compare and swap.The current value of - * lock is compared with the expected value(locked,unlocked) and + /* Synchronization by locking with compare and swap.The current value of + * lock is compared with the expected value(locked,unlocked) and * swapped accordingly.Threads spin until they acquire the lock. */ while(!(CAS(&(insertion_lock.lock_value), 0, 1))) @@ -121,8 +137,8 @@ public: temp = new QueueElement(val); temp->SetPointer(NULL); - /* Synchronization by locking with compare and swap.The current value of - * lock is compared with the expected value(locked,unlocked) and + /* Synchronization by locking with compare and swap.The current value of + * lock is compared with the expected value(locked,unlocked) and * swapped accordingly.Threads spin until they acquire the lock. */ while(!(CAS(&(insertion_lock.lock_value), 0, 1))) @@ -150,7 +166,7 @@ public: { QueueElement *current_element = head; QueueElement *temp = NULL; - + while(!(CAS(&(deletion_lock.lock_value), 0, 1))) { //Spin waiting for the lock @@ -235,5 +251,5 @@ public: } }; - + #endif http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/include/ConcSegHashTable.h ---------------------------------------------------------------------- diff --git a/include/ConcSegHashTable.h b/include/ConcSegHashTable.h index 764e323..7eed6db 100644 --- a/include/ConcSegHashTable.h +++ b/include/ConcSegHashTable.h @@ -1,3 +1,19 @@ +/* + * 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 "QueueLock.h" template class ConcSegHashTable @@ -33,7 +49,7 @@ public: read_lock_queues = new QueueLock[m * n]; write_lock_queues = new QueueLock[m * n]; read_lock_queues->SetTimeOutPeriod(3.0); - write_lock_queues->SetTimeOutPeriod(3.0); + write_lock_queues->SetTimeOutPeriod(3.0); } int HashVal(data_val_type val) @@ -115,7 +131,7 @@ public: cout<<"Lock already taken"< @@ -70,7 +86,7 @@ public: const QueueElement *p_add = lock_queue.AddElementInFront(0); const int *p_spin = p_add->GetPointerToData(); struct timespec requestStart, requestEnd; - + if(lock_taken != 0) { clock_gettime(CLOCK_REALTIME, &requestStart); @@ -99,7 +115,7 @@ public: return (1); } - + int CheckLockIsAcquired() { @@ -118,5 +134,3 @@ public: } }; - - http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/include/QueueLock2.h ---------------------------------------------------------------------- diff --git a/include/QueueLock2.h b/include/QueueLock2.h index e4ada9e..7b846d9 100644 --- a/include/QueueLock2.h +++ b/include/QueueLock2.h @@ -1,3 +1,19 @@ +/* + * 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 "ConcQueue.h" #include @@ -70,7 +86,7 @@ public: const QueueElement *p_add = lock_queue.AddElementInFront(0); const int *p_spin = p_add->GetPointerToData(); struct timespec requestStart, requestEnd; - + if(lock_taken != 0) { clock_gettime(CLOCK_REALTIME, &requestStart); @@ -99,7 +115,7 @@ public: return (1); } - + int CheckLockIsAcquired() { @@ -118,5 +134,3 @@ public: } }; - - http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/include/TransactionManager.h ---------------------------------------------------------------------- diff --git a/include/TransactionManager.h b/include/TransactionManager.h index cb7c1ff..e8e6d8c 100644 --- a/include/TransactionManager.h +++ b/include/TransactionManager.h @@ -1,4 +1,20 @@ -#include +/* + * 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 "QueueLock2.h" #include "ConcDef.h" using namespace std; http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/license ---------------------------------------------------------------------- diff --git a/license b/license index 42c955d..5e0fd33 100644 --- a/license +++ b/license @@ -1,10 +1,201 @@ -Copyright (c) 2013, Atri Sharma -All rights reserved. +Apache License +Version 2.0, January 2004 +http://www.apache.org/licenses/ -Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +1. Definitions. -2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +"License" shall mean the terms and conditions for use, reproduction, +and distribution as defined by Sections 1 through 9 of this document. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +"Licensor" shall mean the copyright owner or entity authorized by +the copyright owner that is granting the License. + +"Legal Entity" shall mean the union of the acting entity and all +other entities that control, are controlled by, or are under common +control with that entity. For the purposes of this definition, +"control" means (i) the power, direct or indirect, to cause the +direction or management of such entity, whether by contract or +otherwise, or (ii) ownership of fifty percent (50%) or more of the +outstanding shares, or (iii) beneficial ownership of such entity. + +"You" (or "Your") shall mean an individual or Legal Entity +exercising permissions granted by this License. + +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation +source, and configuration files. + +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but +not limited to compiled object code, generated documentation, +and conversions to other media types. + +"Work" shall mean the work of authorship, whether in Source or +Object form, made available under the License, as indicated by a +copyright notice that is included in or attached to the work +(an example is provided in the Appendix below). + +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, +the Work and Derivative Works thereof. + +"Contribution" shall mean any work of authorship, including +the original version of the Work and any modifications or additions +to that Work or Derivative Works thereof, that is intentionally +submitted to Licensor for inclusion in the Work by the copyright owner +or by an individual or Legal Entity authorized to submit on behalf of +the copyright owner. For the purposes of this definition, "submitted" +means any form of electronic, verbal, or written communication sent +to the Licensor or its representatives, including but not limited to +communication on electronic mailing lists, source code control systems, +and issue tracking systems that are managed by, or on behalf of, the +Licensor for the purpose of discussing and improving the Work, but +excluding communication that is conspicuously marked or otherwise +designated in writing by the copyright owner as "Not a Contribution." + +"Contributor" shall mean Licensor and any individual or Legal Entity +on behalf of whom a Contribution has been received by Licensor and +subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +copyright license to reproduce, prepare Derivative Works of, +publicly display, publicly perform, sublicense, and distribute the +Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable +(except as stated in this section) patent license to make, have made, +use, offer to sell, sell, import, and otherwise transfer the Work, +where such license applies only to those patent claims licensable +by such Contributor that are necessarily infringed by their +Contribution(s) alone or by combination of their Contribution(s) +with the Work to which such Contribution(s) was submitted. If You +institute patent litigation against any entity (including a +cross-claim or counterclaim in a lawsuit) alleging that the Work +or a Contribution incorporated within the Work constitutes direct +or contributory patent infringement, then any patent licenses +granted to You under this License for that Work shall terminate +as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the +Work or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You +meet the following conditions: + +(a) You must give any other recipients of the Work or +Derivative Works a copy of this License; and + +(b) You must cause any modified files to carry prominent notices +stating that You changed the files; and + +(c) You must retain, in the Source form of any Derivative Works +that You distribute, all copyright, patent, trademark, and +attribution notices from the Source form of the Work, +excluding those notices that do not pertain to any part of +the Derivative Works; and + +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must +include a readable copy of the attribution notices contained +within such NOTICE file, excluding those notices that do not +pertain to any part of the Derivative Works, in at least one +of the following places: within a NOTICE text file distributed +as part of the Derivative Works; within the Source form or +documentation, if provided along with the Derivative Works; or, +within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents +of the NOTICE file are for informational purposes only and +do not modify the License. You may add Your own attribution +notices within Derivative Works that You distribute, alongside +or as an addendum to the NOTICE text from the Work, provided +that such additional attribution notices cannot be construed +as modifying the License. + +You may add Your own copyright statement to Your modifications and +may provide additional or different license terms and conditions +for use, reproduction, or distribution of Your modifications, or +for any such Derivative Works as a whole, provided Your use, +reproduction, and distribution of the Work otherwise complies with +the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work +by You to the Licensor shall be under the terms and conditions of +this License, without any additional terms or conditions. +Notwithstanding the above, nothing herein shall supersede or modify +the terms of any separate license agreement you may have executed +with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the +origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or +agreed to in writing, Licensor provides the Work (and each +Contributor provides its Contributions) on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or +implied, including, without limitation, any warranties or conditions +of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A +PARTICULAR PURPOSE. You are solely responsible for determining the +appropriateness of using or redistributing the Work and assume any +risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, +unless required by applicable law (such as deliberate and grossly +negligent acts) or agreed to in writing, shall any Contributor be +liable to You for damages, including any direct, indirect, special, +incidental, or consequential damages of any character arising as a +result of this License or out of the use or inability to use the +Work (including but not limited to damages for loss of goodwill, +work stoppage, computer failure or malfunction, or any and all +other commercial damages or losses), even if such Contributor +has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing +the Work or Derivative Works thereof, You may choose to offer, +and charge a fee for, acceptance of support, warranty, indemnity, +or other liability obligations and/or rights consistent with this +License. However, in accepting such obligations, You may act only +on Your own behalf and on Your sole responsibility, not on behalf +of any other Contributor, and only if You agree to indemnify, +defend, and hold each Contributor harmless for any liability +incurred by, or claims asserted against, such Contributor by reason +of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + +To apply the Apache License to your work, attach the following +boilerplate notice, with the fields enclosed by brackets "{}" +replaced with your own identifying information. (Don't include +the brackets!) The text should be enclosed in the appropriate +comment syntax for the file format. We also recommend that a +file or class name and description of purpose be included on the +same "printed page" as the copyright notice for easier +identification within third-party archives. + +Copyright {yyyy} {name of copyright owner} + +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. http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/makefile ---------------------------------------------------------------------- diff --git a/makefile b/makefile index adfb34a..abae2b8 100644 --- a/makefile +++ b/makefile @@ -1,3 +1,20 @@ +# /* +# * 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. +# */ + OBJS = obj/CacheManager.o obj/ConcDCT.o obj/ConcMAT.o obj/ConcQueue.o obj/ConcSegHashTable.o obj/ConcInvertedIndex.o all: mkdirectory libconcerted.a obj/CacheManager.o obj/ConcDCT.o obj/ConcInvertedIndex.o obj/ConcMAT.o obj/ConcQueue.o obj/ConcSegHashTable.o http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/src/CacheManager.cpp ---------------------------------------------------------------------- diff --git a/src/CacheManager.cpp b/src/CacheManager.cpp index 1043e03..a62bc52 100644 --- a/src/CacheManager.cpp +++ b/src/CacheManager.cpp @@ -1,3 +1,19 @@ +/* + * 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 "ConcDef.h" class CacheManager http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/src/ConcQueueTest.cpp ---------------------------------------------------------------------- diff --git a/src/ConcQueueTest.cpp b/src/ConcQueueTest.cpp index a17919c..3fd6489 100644 --- a/src/ConcQueueTest.cpp +++ b/src/ConcQueueTest.cpp @@ -1,3 +1,19 @@ +/* + * 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 "ConcQueue.h" int main() @@ -10,5 +26,3 @@ int main() intqueue.GetToFront(intqueue.SearchQueue(6)); intqueue.PrintQueue(); } - - http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/test/ConcDCTConcurrencyTest.cpp ---------------------------------------------------------------------- diff --git a/test/ConcDCTConcurrencyTest.cpp b/test/ConcDCTConcurrencyTest.cpp index ed775bb..544d72c 100644 --- a/test/ConcDCTConcurrencyTest.cpp +++ b/test/ConcDCTConcurrencyTest.cpp @@ -1,3 +1,19 @@ +/* + * 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 "../ConcDCT.h" void *thread_lock_test1(void *arg1) @@ -47,7 +63,7 @@ search_val(arr_val, tree_val); } - + int main() { dct_tree *tree_val = NULL; @@ -68,5 +84,3 @@ pthread_join(tid3,NULL); pthread_join(tid4,NULL); } - - http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/test/ConcDCTFileReader.cpp ---------------------------------------------------------------------- diff --git a/test/ConcDCTFileReader.cpp b/test/ConcDCTFileReader.cpp index 33ac373..4e7471f 100644 --- a/test/ConcDCTFileReader.cpp +++ b/test/ConcDCTFileReader.cpp @@ -1,3 +1,19 @@ +/* + * 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 @@ -15,7 +31,7 @@ int count; int arr_val[3]; dct_tree *tree_val = NULL; TransactionManager t1; - + tree_val = build_dcttree(3); count = 0; while (std::getline(infile, line)) // this does the checking! http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/test/ConcDCTFileReader.cpp~ ---------------------------------------------------------------------- diff --git a/test/ConcDCTFileReader.cpp~ b/test/ConcDCTFileReader.cpp~ deleted file mode 100644 index 630c35e..0000000 --- a/test/ConcDCTFileReader.cpp~ +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include -#include -#include -#include "../ConcDCT.h" - -using namespace std; - -std::string line; -std::ifstream infile("sat.trn"); - -int main() -{ -int count; -int arr_val[3]; -dct_tree *tree_val = NULL; -TransactionManager t1; - -tree_val = build_dcttree(3); -count = 0; -while (std::getline(infile, line)) // this does the checking! -{ - std::istringstream iss(line); - char c; - - int value; - while (iss >> value) - { - if (count == 3) - { - insert_val(arr_val, tree_val, t1); - count = 0; - cout<<"record"<getdummy()), (tree_val->getnumber_of_nodes())); - }catch (int e) - { - cout<<"exception caught"<<" "< *index1; - int att_values[3]; - int return_value; - - return_value = 0; - index1 = new inv_index<3,0>; - att_values[0] = 3; - att_values[1] = 4; - att_values[2] = 5; - - insert_val(att_values, index1); - - return_value = search_val(&(att_values[0]), index1); - - if (return_value == 1) - { - cout<<"values found"<<" "< #include #include @@ -23,7 +39,7 @@ while (std::getline(infile, line)) // this does the checking! char c; int value; - while (iss >> value) + while (iss >> value) { if (count == 3) { http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/test/ConcMATTest.cpp ---------------------------------------------------------------------- diff --git a/test/ConcMATTest.cpp b/test/ConcMATTest.cpp index 555c033..5d87d54 100644 --- a/test/ConcMATTest.cpp +++ b/test/ConcMATTest.cpp @@ -1,4 +1,20 @@ -#include "../include/ConcMAT.h" +/* + * 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/ConcMAT.h" int main() { @@ -21,4 +37,3 @@ delete tree_val; } - http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/test/ConcMATTest.cpp~ ---------------------------------------------------------------------- diff --git a/test/ConcMATTest.cpp~ b/test/ConcMATTest.cpp~ deleted file mode 100644 index 459cdcc..0000000 --- a/test/ConcMATTest.cpp~ +++ /dev/null @@ -1,24 +0,0 @@ -#include "../ConcMAT.h" - - int main() - { - int att_array[3]; - int i = 0; - mat_tree *tree_val = NULL; - tree_val = build_mattree(3); - att_array[0] = 1; - att_array[1] = 2; - att_array[2] = 3; - insert_val(att_array, tree_val); - if (search_val(att_array, tree_val)) - { - cout<<"All values found"< tab1(10,2); void *thread_lock_test(void *arg1) http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/test/ConcSegHashTableTest.cpp~ ---------------------------------------------------------------------- diff --git a/test/ConcSegHashTableTest.cpp~ b/test/ConcSegHashTableTest.cpp~ deleted file mode 100644 index 6a61a1a..0000000 --- a/test/ConcSegHashTableTest.cpp~ +++ /dev/null @@ -1,87 +0,0 @@ -#include "../ConcSegHashTable.h" - -ConcSegHashTable tab1(10,2); -void *thread_lock_test(void *arg1) -{ - //tab1.GetWriteLock(0,2,(char*)arg1); - //tab1.InsertElement(5, false, (char*)arg1); - if((tab1.InsertElement(5, false,(char*)arg1)) == 0) - { - cout<<"Value not inserted"<<" "<<(char*)arg1<<" "<<5<getval()<getnext()) != NULL && (traverse->getval()) < a && ((traverse->getnext())->getval()) < a) - { - cout<<"In loop"<getnext(); - }*/ - - while (i > 0) - { - traverse = traverse->getnext(); - --i; - } - - if ((traverse->getnext()) == NULL) - { - traverse->setnext(temp); - return; - } - /*else if ((traverse->getval()) >= a) - { - temp->setnext(traverse); - return; - }*/ - - temp->setnext(traverse->getnext()); - traverse->setnext(temp); - - } - - void insert_skip(int a) - { - linked_list **traverse_skip = NULL; - linked_list *traverse_list = NULL; - linked_list *previous_pointer = NULL; - linked_list *temp = NULL; - int i = 0; - int j = 0; - int level = 0; - int iteration_value = 0; - - level = level_generate(); - i = level - 1; - - if (level > max_level) - { - iteration_value = max_level; - } - else - { - iteration_value = level; - } - - temp = (linked_list*)malloc(sizeof(linked_list)); - - temp->setval(a); - - if (!list_array) - { - insert_val(a, 0, temp); - return; - } - else - { - traverse_skip = (linked_list**)malloc(sizeof(linked_list*) * max_level); - } - - traverse_list = list_array[level - 1]; - - for (i = (level - 1);i >= 0;i--) - { - previous_pointer = NULL; - - if (j > 0) - { - while (j > 0) - { - traverse_list = traverse_list->getnext(); - --j; - } - } - - if (traverse_list == NULL) - { - cout<<"traverse_list is NULL"<getval()) < a) - { - cout<<"In loop 2"<<" "<<(traverse_list->getval())<getnext(); - } - - traverse_skip[i] = previous_pointer; - - traverse_list = list_array[i]; - } - - insert_val(0, j, temp); - /*for (i = 1;i <= (level - 1);i++) - {*/ - - } - - - void print_val() - { - linked_list *traverse = NULL; - - if (list_array) - { - traverse = list_array[0]; - } - - while (traverse != NULL) - { - cout<<"val is"<<" "<getval()<getnext(); - } - } - - int level_generate() - { - double rand_val = static_cast(rand()) / RAND_MAX; - int level = 0; - - while (rand_val > probability_val && level < max_level) - { - ++level; - rand_val = static_cast(rand()) / RAND_MAX; - } - - return level; - } - - int search_val(int key) - { - linked_list **traverse_skip = NULL; - linked_list *traverse_list = NULL; - int i = 0; - int j = 0; - - i = curr_level; - - if (!list_array) - { - return 0; - } - else - { - traverse_skip = (linked_list**)malloc(sizeof(linked_list*) * max_level); - } - - traverse_list = list_array[curr_level - 1]; - - for (i = (curr_level - 1);i >= 0;i--) - { - if (j > 0) - { - while (j > 0) - { - traverse_list = traverse_list->getnext(); - --j; - } - } - - while (traverse_list != NULL && (traverse_list->getval()) != key) - { - cout<<"In loop 2"<<" "<<(traverse_list->getval())<getnext(); - } - - if (traverse_list != NULL) - { - return 1; - } - - traverse_list = list_array[i]; - } - - return -1; - } -}; - -int main() -{ - srand(time(0)); - int low = 0; - int high = 1; - int result_search = 0; - double dUniform = static_cast(rand()) / RAND_MAX; - skip_list_master list1; - int val1 = list1.level_generate(); - - //list1.insert_val(1,0); - //list1.insert_val(2,0); - //list1.insert_val(4,0); - //list1.insert_val(7,0); - //list1.insert_val(6,0); - - list1.insert_skip(1); - //list1.insert_skip(2); - //list1.insert_skip(3); - //list1.insert_skip(4); - //list1.insert_skip(5); - - - //list1.print_val(); - - result_search = list1.search_val(1); - - cout<<"search result"<<" "< 5) - { - cout<<"insertion"< #include #include http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/test/FileReader.cpp~ ---------------------------------------------------------------------- diff --git a/test/FileReader.cpp~ b/test/FileReader.cpp~ deleted file mode 100644 index 3e924fc..0000000 --- a/test/FileReader.cpp~ +++ /dev/null @@ -1,52 +0,0 @@ -#include -#include -#include -#include -#include "../ConcMAT.h" - -using namespace std; - -std::string line; -std::ifstream infile("sat.trn"); - -int main() -{ -int count; -int arr_val[3]; -mat_tree *tree_val = NULL; - -tree_val = build_mattree(3); -count = 0; -while (std::getline(infile, line)) // this does the checking! -{ - std::istringstream iss(line); - char c; - - int value; - while (iss >> value) - { - if (count == 3) - { - insert_val(arr_val, tree_val); - count = 0; - cout<<"record"< #include "../include/QueueLock.h" @@ -39,5 +55,3 @@ int main() pthread_join(tid4,NULL); pthread_join(tid5,NULL); } - - http://git-wip-us.apache.org/repos/asf/incubator-concerted/blob/af37c9fe/test/QueueLockTest.cpp~ ---------------------------------------------------------------------- diff --git a/test/QueueLockTest.cpp~ b/test/QueueLockTest.cpp~ deleted file mode 100644 index 2e48f69..0000000 --- a/test/QueueLockTest.cpp~ +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include "../QueueLock.h" - -QueueLock GlobalQueueLock; -void *thread_getlock_start(void *arg1) -{ - GlobalQueueLock.GetLock(); - cout<<"Lock acquired by"<<" "<<(char*)arg1<