cleaned up code

master
grantwra 2017-05-30 22:01:19 -04:00
parent 83cc00aa34
commit 126404acb2
51 changed files with 281 additions and 4918 deletions

BIN
.DS_Store vendored

Binary file not shown.

2
.gitignore vendored
View File

@ -3,3 +3,5 @@
*.info
*_summary
*_info
graphs/
old_logs

Binary file not shown.

View File

@ -10,7 +10,7 @@
<ConfirmationsSetting value="0" id="Add" />
<ConfirmationsSetting value="0" id="Remove" />
</component>
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" default="true" assert-keyword="true" jdk-15="true">
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" assert-keyword="true" jdk-15="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">

View File

@ -2,215 +2,215 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="8e7bd406-70f9-422b-a1e4-831f34265622" name="Default" comment="">
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/.name" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/modules.xml" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/runConfigurations.xml" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/vcs.xml" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadA.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadC.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadD.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadE.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadF.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadIA.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadIB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadIC.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadA.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadC.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadD.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadE.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadF.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadIA.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadIB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadIC.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_BDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadD_withcache/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_C_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_BDB2.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_BDB_INFO" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_SQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_SQL2.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_SQL_INFO" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/bargraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/graphing/YCSB_WorkloadA_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/graphing/YCSB_WorkloadB_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadE.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadA_withcache/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadE_withcache/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/graphing/YCSB_WorkloadC_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/graphing/YCSB_WorkloadD_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/graphing/YCSB_WorkloadE_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/graphing/YCSB_WorkloadF_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/graphing/newgraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/oldgraphs/YCSB_WorkloadA_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/oldgraphs/YCSB_WorkloadB_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadD_withcache/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadIA.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/runConfigurations.xml" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadA/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIB/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadB/WorkloadB_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadF_withcache/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/16MB/lakshmi_phone_files/DB_CONFIG" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_IB_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_SQL_INFO" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadC_withcache/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadC/WorkloadC_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIC/WorkloadIC_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_E_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadD/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_IB_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_IC_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIC/WorkloadIC_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadA_withcache/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/oldgraphs/hotDb_BDB_YCSB_WorkloadA.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/oldgraphs/hotDb_SQL_YCSB_WorkloadA.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/with100MBCache/YCSB_A.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/with100MBCache/YCSB_B.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadD_withcache/WorkloadD.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/16MB/lakshmi_phone_files/preBenchmark.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/benchmark.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/with100MBCache/YCSB_C.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/with100MBCache/YCSB_D.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/with100MBCache/YCSB_E.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/with100MBCache/YCSB_F.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_A_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/graphing/newgraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/withHeapRestrict50/newgraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIA/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_F_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_IC_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_D_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/take2/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadA_withcache/WorkloadA.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/16MB/lakshmi_phone_files/removeBenchmarkData.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadF_withcache/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_IA_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/remove.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_IC_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadC.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/WorkloadE_BDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadA/WorkloadA_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/vcs.xml" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/withHeapRestrict25/bigtrace2.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/WorkloadE_SQL_INFO" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIB/WorkloadIB_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/WorkloadE_BDB_INFO" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_F_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_C_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/take2/WorkloadF_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadD/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_C_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadE/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadC/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadIB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_E_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_IB_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/oldgraphs/YCSB_WorkloadA_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadIC.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadF.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_SQL2.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadB_withcache/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_F_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadD.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadF.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadB_withcache/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadB/WorkloadB_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/oldTrace/WorkloadE_BDB2" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadE/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/modules.xml" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadA/WorkloadA_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadC.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadB_withcache/WorkloadB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/bargraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_BDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadE_withcache/WorkloadE.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/with100MBCache/YCSB_B.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadIC.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadB/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_IB_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_IA_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/bigtrace2WithMem.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_E_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadE/WorkloadE_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_D_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/bigtrace2.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/WorkloadE_SQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadC_withcache/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_SQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/graphing/YCSB_WorkloadF_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_IA_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadA/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_D_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/WorkloadF_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIC/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newgraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadB/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIB/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/graphing/YCSB_WorkloadE_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/YCSB_E_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadC/WorkloadC_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/with100MBCache/bigtrace2.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/withHeapRestrict25/newgraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadD/WorkloadD_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_E_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/WorkloadE_SQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/bigtrace.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/16MB/lakshmi_phone_files/benchmark.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/graphing/YCSB_WorkloadB_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIA/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadB_withcache/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadE_withcache/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIA/WorkloadIA_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_A_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_B_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadD.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/take2/WorkloadF_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_A_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/bigtrace2.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/graphing/YCSB_WorkloadA_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadC/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadF_withcache/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/oldTrace/WorkloadE_SQL2" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_BDB_INFO" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/bargraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadB/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/sql.trace" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_IC_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadE/WorkloadE_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/with100MBCache/YCSB_E.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIB/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadD_withcache/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_B_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_C_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_C_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_D_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_D_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_E_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_E_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_F_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_F_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_IA_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_IA_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_IB_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_IB_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_IC_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_IC_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/bigtrace2.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/newgraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_A_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_A_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_B_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_B_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_C_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_C_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_D_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_D_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_E_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_E_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_F_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_F_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_IA_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_IA_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_IB_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_IB_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_IC_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_IC_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadA/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadA/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadA/WorkloadA_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadA/WorkloadA_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadA/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadB/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadB/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadB/WorkloadB_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadB/WorkloadB_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadB/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadC/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadC/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadC/WorkloadC_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadC/WorkloadC_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadC/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadD/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadD/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadD/WorkloadD_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadD/WorkloadD_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadD/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadE/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadE/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadE/WorkloadE_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadE/WorkloadE_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadE/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/WorkloadF_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/WorkloadF_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/take2/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/take2/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/take2/WorkloadF_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/take2/WorkloadF_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIA/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIA/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIA/WorkloadIA_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIA/WorkloadIA_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIA/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIB/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIB/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIB/WorkloadIB_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIB/WorkloadIB_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIB/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIC/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIC/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIC/WorkloadIC_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIC/WorkloadIC_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIC/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/WorkloadE_BDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/WorkloadE_BDB_INFO" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/WorkloadE_SQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/WorkloadE_SQL_INFO" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/YCSB_E_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/YCSB_E_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/bargraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadA_withcache/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadA_withcache/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadA_withcache/WorkloadA.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadA_withcache/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadB_withcache/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadB_withcache/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadB_withcache/WorkloadB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadB_withcache/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadC_withcache/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadC_withcache/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadC_withcache/WorkloadC.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadC_withcache/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadD_withcache/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadD_withcache/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadD_withcache/WorkloadD.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadD_withcache/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadE_withcache/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadE_withcache/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadE_withcache/WorkloadE.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadE_withcache/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadF_withcache/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadF_withcache/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIA/WorkloadIA_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadD/WorkloadD_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadF_withcache/WorkloadF.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadF_withcache/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/16MB/bigtrace2.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/16MB/lakshmi_phone_files/DB_CONFIG" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/16MB/lakshmi_phone_files/benchmark.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/16MB/lakshmi_phone_files/preBenchmark.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/16MB/lakshmi_phone_files/removeBenchmarkData.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_IA_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_B_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/with100MBCache/YCSB_A.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/bargraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/benchmark.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/bigtrace.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/bigtrace2.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/bigtrace2WithMem.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadD/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/graph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/WorkloadE_SQL_INFO" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/withHeapRestrict50/bigtrace2.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/heapTesting/bigtrace2.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/heapTesting/newgraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIB/WorkloadIB_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/bargraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/oldgraphs/YCSB_WorkloadB_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/WorkloadE_BDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadC_withcache/WorkloadC.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/.idea/.name" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadE_withcache/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadE/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/WorkloadE_BDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/WorkloadE_BDB_INFO" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/WorkloadE_SQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/WorkloadE_SQL_INFO" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/bargraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/oldTrace/WorkloadE_BDB2" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/oldTrace/WorkloadE_SQL2" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/bargraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/remove.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newgraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/sql.trace" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadIB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_F_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadIA.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadA.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadF/WorkloadF_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/with100MBCache/YCSB_F.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/trace.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/with100MBCache/bigtrace2.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/BDB_YCSB_WorkloadA.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadA_withcache/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/with100MBCache/WorkloadC_withcache/newgraphWithMem.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadA/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/with100MBCache/newgraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/withHeapRestrict25/bigtrace2.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/withHeapRestrict25/newgraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/withHeapRestrict50/bigtrace2.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/withHeapRestrict50/newgraph.py" afterPath="" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/gradle.xml" afterPath="$PROJECT_DIR$/.idea/gradle.xml" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_A_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/16MB/bigtrace2.sh" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_B_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/YCSB_B_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/oldWorkloadE/YCSB_E_BDB.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/graphing/YCSB_WorkloadD_TimingA.log" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/barGraphs/WorkloadE_BDB2.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/WorkloadE/WorkloadE_BDB_INFO" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict25/withHeapRestrict25/newgraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/oldgraphs/hotDb_SQL_YCSB_WorkloadA.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/bargraph.py" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/with100MBCache/YCSB_D.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIC/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withHeapRestrict50/YCSB_D_SQL.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadIA/MemorySQL" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/SQL_YCSB_WorkloadE.png" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/Graphs/withMemUsage/WorkloadC/MemoryBDB" afterPath="" />
<change type="DELETED" beforePath="$PROJECT_DIR$/helper/newTrace/newgraphWithMem.py" afterPath="" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/misc.xml" afterPath="$PROJECT_DIR$/.idea/misc.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/com/example/benchmark_withjson/MainActivity.java" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/benchmark_withjson/MainActivity.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/com/example/benchmark_withjson/Queries.java" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/benchmark_withjson/Queries.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/gradle.xml" afterPath="$PROJECT_DIR$/.idea/gradle.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/com/example/benchmark_withjson/Utils.java" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/benchmark_withjson/Utils.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/com/example/benchmark_withjson/Queries.java" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/benchmark_withjson/Queries.java" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/app/src/main/java/com/example/benchmark_withjson/MainActivity.java" afterPath="$PROJECT_DIR$/app/src/main/java/com/example/benchmark_withjson/MainActivity.java" />
</list>
<ignored path="Benchmark_withJson.iws" />
<ignored path=".idea/workspace.xml" />
@ -379,36 +379,36 @@
<editor active="false" />
<layout>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Nl-Palette" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Android Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Nl-Palette" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Build Variants" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
<window_info id="Palette&#9;" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Image Layers" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Capture Analysis" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Android Monitor" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Properties" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Captures" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Gradle Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Capture Tool" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Designer" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Gradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Android Model" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="-1" side_tool="true" content_ui="tabs" />
<window_info id="Android Model" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
<window_info id="Theme Preview" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="true" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Gradle Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Gradle" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">

View File

@ -37,12 +37,12 @@ public class Queries {
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload A BDB100\"}", "trace_marker");
utils.putMarker("{\"EVENT\":\"Workload A SQL\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
/*
///*
utils.putMarker("{\"EVENT\":\"SQL_START\"}", "trace_marker");
int tester = sqlQueries();
@ -51,8 +51,8 @@ public class Queries {
}
utils.putMarker("{\"EVENT\":\"SQL_END\"}", "trace_marker");
*/
///*
//*/
/*
utils.putMarker("{\"EVENT\":\"BDB_START\"}", "trace_marker");
int tester = bdbQueries();
@ -62,7 +62,7 @@ public class Queries {
utils.putMarker("{\"EVENT\":\"BDB_END\"}", "trace_marker");
//*/
*/
utils.putMarker("END: app finished\n", "trace_marker");
/*

View File

@ -180,8 +180,6 @@ public class Utils {
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
//double availableMegs = mi.availMem / 1048576L;
//return availableMegs;
return mi.availMem;
}
@ -191,7 +189,6 @@ public class Utils {
for(int i = 0; i < 25165824; i++){
MainActivity.a[i] = i;
}
//return a;
}
public void restrictHeapTo25(){
@ -201,7 +198,6 @@ public class Utils {
for(int i = 0; i < temp; i++){
MainActivity.a[i] = i;
}
//return a;
}
public void restrictHeapTo12_5(){

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload A BDB100\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +88,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +124,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +147,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +154,30 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
//memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
//memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
//memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
//utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
//memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +213,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,11 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
workloadJsonObject = Utils.workloadJsonObject;
@ -32,11 +27,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload B BDB100\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +55,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +65,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +72,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -113,11 +80,7 @@ public class Queries {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +88,15 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +126,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +149,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +156,31 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
//memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
//memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
//memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
//utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
//memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +216,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,11 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
workloadJsonObject = Utils.workloadJsonObject;
@ -32,11 +27,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload C BDB100\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +55,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +65,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +72,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +79,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,48 +87,14 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
@ -197,21 +125,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +148,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +155,31 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +215,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload D BDB100\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,48 +88,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
@ -197,21 +125,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +148,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +155,32 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +216,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload E BDB100\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +88,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +124,12 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +148,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +155,30 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +214,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload F BDB100\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +88,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +124,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +147,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +154,32 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +215,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload IA BDB100\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +88,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +124,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +147,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +154,31 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +214,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload IB BDB100\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,48 +88,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
@ -197,21 +125,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +148,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +155,30 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +214,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload IC BDB100\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -64,20 +55,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +65,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +72,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +79,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,48 +87,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
@ -197,21 +124,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +147,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +154,31 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +214,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload A BDB\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +88,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +124,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +147,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +154,29 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
//memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
//memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
//memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
//utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
//memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +212,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -33,10 +29,6 @@ public class Queries {
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload B BDB\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +57,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +67,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +74,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +81,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,48 +89,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
@ -197,21 +126,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +149,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +156,32 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
//memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
//memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
//memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
//utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
//memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +217,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload C BDB\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +88,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +124,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +147,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +154,30 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +213,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload D BDB\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,50 +88,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
@ -197,21 +123,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +146,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +153,31 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +213,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,11 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
workloadJsonObject = Utils.workloadJsonObject;
@ -32,11 +27,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload E BDB\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +55,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +65,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +72,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +79,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,50 +87,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
@ -197,21 +122,12 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +146,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +153,29 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +211,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,11 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
workloadJsonObject = Utils.workloadJsonObject;
@ -32,11 +27,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload F BDB\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +55,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +65,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +72,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +79,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +87,16 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +126,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +149,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +156,29 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +214,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,11 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
workloadJsonObject = Utils.workloadJsonObject;
@ -32,11 +27,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload IA BDB\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -64,20 +54,7 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +65,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +72,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +79,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,50 +87,14 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
@ -197,21 +123,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +146,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +153,29 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +211,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload IB BDB\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,50 +88,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
@ -197,21 +123,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +146,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +153,29 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +211,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,11 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
workloadJsonObject = Utils.workloadJsonObject;
@ -32,11 +27,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload IC BDB\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +55,6 @@ public class Queries {
//*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +65,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +72,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +79,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,50 +87,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
@ -197,21 +122,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +145,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +152,26 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +207,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -34,32 +34,10 @@ public class MainActivity extends AppCompatActivity {
Utils utils = new Utils();
//long memNow = utils.memoryAvailable(this);
//utils.restrictHeapTo12_5();
//long memafter = utils.memoryAvailable(this);
long start = System.currentTimeMillis();
int tester;
/*
File file2 = new File(this.getFilesDir().getPath() + "/start_end");
//File file = new File("/data/BDBtime");
FileOutputStream fos2;
try {
fos2 = this.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("Start: " + start + "\n").getBytes());;
} catch (IOException e) {
e.printStackTrace();
}
utils.putMarker("{\"EVENT\":\"testing\"}", "trace_marker");
this.finishAffinity();
*/
if(!utils.doesDBExist(this,"BDBBenchmark")){
//Create the databases from the JSON
CreateDB createDB = new CreateDB(this);
@ -71,8 +49,6 @@ public class MainActivity extends AppCompatActivity {
}
else {
//utils.restrictHeapTo25();
String singleJsonString = utils.jsonToString(this, workload_a_timing_a);
utils.jsonStringToObject(singleJsonString);
@ -86,40 +62,20 @@ public class MainActivity extends AppCompatActivity {
//Find what queries were not executed successfully in the SQL or BDB traces
utils.findMissingQueries(this);
/*
int tester2 = utils.findMissingQueries(this);
if(tester2 != 0){
this.finishAffinity();
}
*/
//Calculate total time of the traces
long end = System.currentTimeMillis();
long delta = end - start;
double elapsedSeconds = delta / 1000.0;
/*
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
long total = mi.totalMem;
*/
File file = new File(this.getFilesDir().getPath() + "/time");
//File file = new File("/data/BDBtime");
FileOutputStream fos;
try {
fos = this.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + "\n").getBytes());
//fos.write(("Mem total: " + total + "\n").getBytes());
//fos.write(("Mem at start: " + memNow + "\n").getBytes());
//fos.write(("Mem after heap allocation: " + memafter + "\n").getBytes());
//fos.close();
} catch (IOException e) {
e.printStackTrace();
}
//this.finishAffinity();
}
}
}

View File

@ -34,32 +34,9 @@ public class MainActivity extends AppCompatActivity {
Utils utils = new Utils();
//long memNow = utils.memoryAvailable(this);
//utils.restrictHeapTo12_5();
//long memafter = utils.memoryAvailable(this);
long start = System.currentTimeMillis();
int tester;
/*
File file2 = new File(this.getFilesDir().getPath() + "/start_end");
//File file = new File("/data/BDBtime");
FileOutputStream fos2;
try {
fos2 = this.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("Start: " + start + "\n").getBytes());;
} catch (IOException e) {
e.printStackTrace();
}
utils.putMarker("{\"EVENT\":\"testing\"}", "trace_marker");
this.finishAffinity();
*/
if(!utils.doesDBExist(this,"BDBBenchmark")){
//Create the databases from the JSON
CreateDB createDB = new CreateDB(this);
@ -71,8 +48,6 @@ public class MainActivity extends AppCompatActivity {
}
else {
//utils.restrictHeapTo25();
String singleJsonString = utils.jsonToString(this, workload_b_timing_a);
utils.jsonStringToObject(singleJsonString);
@ -86,40 +61,20 @@ public class MainActivity extends AppCompatActivity {
//Find what queries were not executed successfully in the SQL or BDB traces
utils.findMissingQueries(this);
/*
int tester2 = utils.findMissingQueries(this);
if(tester2 != 0){
this.finishAffinity();
}
*/
//Calculate total time of the traces
long end = System.currentTimeMillis();
long delta = end - start;
double elapsedSeconds = delta / 1000.0;
/*
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
long total = mi.totalMem;
*/
File file = new File(this.getFilesDir().getPath() + "/time");
//File file = new File("/data/BDBtime");
FileOutputStream fos;
try {
fos = this.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + "\n").getBytes());
//fos.write(("Mem total: " + total + "\n").getBytes());
//fos.write(("Mem at start: " + memNow + "\n").getBytes());
//fos.write(("Mem after heap allocation: " + memafter + "\n").getBytes());
//fos.close();
} catch (IOException e) {
e.printStackTrace();
}
//this.finishAffinity();
}
}
}

View File

@ -34,32 +34,9 @@ public class MainActivity extends AppCompatActivity {
Utils utils = new Utils();
//long memNow = utils.memoryAvailable(this);
//utils.restrictHeapTo12_5();
//long memafter = utils.memoryAvailable(this);
long start = System.currentTimeMillis();
int tester;
/*
File file2 = new File(this.getFilesDir().getPath() + "/start_end");
//File file = new File("/data/BDBtime");
FileOutputStream fos2;
try {
fos2 = this.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("Start: " + start + "\n").getBytes());;
} catch (IOException e) {
e.printStackTrace();
}
utils.putMarker("{\"EVENT\":\"testing\"}", "trace_marker");
this.finishAffinity();
*/
if(!utils.doesDBExist(this,"BDBBenchmark")){
//Create the databases from the JSON
CreateDB createDB = new CreateDB(this);
@ -71,8 +48,6 @@ public class MainActivity extends AppCompatActivity {
}
else {
//utils.restrictHeapTo25();
String singleJsonString = utils.jsonToString(this, workload_c_timing_a);
utils.jsonStringToObject(singleJsonString);
@ -86,40 +61,21 @@ public class MainActivity extends AppCompatActivity {
//Find what queries were not executed successfully in the SQL or BDB traces
utils.findMissingQueries(this);
/*
int tester2 = utils.findMissingQueries(this);
if(tester2 != 0){
this.finishAffinity();
}
*/
//Calculate total time of the traces
long end = System.currentTimeMillis();
long delta = end - start;
double elapsedSeconds = delta / 1000.0;
/*
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
long total = mi.totalMem;
*/
File file = new File(this.getFilesDir().getPath() + "/time");
//File file = new File("/data/BDBtime");
FileOutputStream fos;
try {
fos = this.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + "\n").getBytes());
//fos.write(("Mem total: " + total + "\n").getBytes());
//fos.write(("Mem at start: " + memNow + "\n").getBytes());
//fos.write(("Mem after heap allocation: " + memafter + "\n").getBytes());
//fos.close();
} catch (IOException e) {
e.printStackTrace();
}
//this.finishAffinity();
}
}
}

View File

@ -34,32 +34,9 @@ public class MainActivity extends AppCompatActivity {
Utils utils = new Utils();
//long memNow = utils.memoryAvailable(this);
//utils.restrictHeapTo12_5();
//long memafter = utils.memoryAvailable(this);
long start = System.currentTimeMillis();
int tester;
/*
File file2 = new File(this.getFilesDir().getPath() + "/start_end");
//File file = new File("/data/BDBtime");
FileOutputStream fos2;
try {
fos2 = this.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("Start: " + start + "\n").getBytes());;
} catch (IOException e) {
e.printStackTrace();
}
utils.putMarker("{\"EVENT\":\"testing\"}", "trace_marker");
this.finishAffinity();
*/
if(!utils.doesDBExist(this,"BDBBenchmark")){
//Create the databases from the JSON
CreateDB createDB = new CreateDB(this);
@ -71,8 +48,6 @@ public class MainActivity extends AppCompatActivity {
}
else {
//utils.restrictHeapTo25();
String singleJsonString = utils.jsonToString(this, workload_d_timing_a);
utils.jsonStringToObject(singleJsonString);
@ -86,40 +61,20 @@ public class MainActivity extends AppCompatActivity {
//Find what queries were not executed successfully in the SQL or BDB traces
utils.findMissingQueries(this);
/*
int tester2 = utils.findMissingQueries(this);
if(tester2 != 0){
this.finishAffinity();
}
*/
//Calculate total time of the traces
long end = System.currentTimeMillis();
long delta = end - start;
double elapsedSeconds = delta / 1000.0;
/*
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
long total = mi.totalMem;
*/
File file = new File(this.getFilesDir().getPath() + "/time");
//File file = new File("/data/BDBtime");
FileOutputStream fos;
try {
fos = this.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + "\n").getBytes());
//fos.write(("Mem total: " + total + "\n").getBytes());
//fos.write(("Mem at start: " + memNow + "\n").getBytes());
//fos.write(("Mem after heap allocation: " + memafter + "\n").getBytes());
//fos.close();
} catch (IOException e) {
e.printStackTrace();
}
//this.finishAffinity();
}
}
}

View File

@ -34,32 +34,9 @@ public class MainActivity extends AppCompatActivity {
Utils utils = new Utils();
//long memNow = utils.memoryAvailable(this);
//utils.restrictHeapTo12_5();
//long memafter = utils.memoryAvailable(this);
long start = System.currentTimeMillis();
int tester;
/*
File file2 = new File(this.getFilesDir().getPath() + "/start_end");
//File file = new File("/data/BDBtime");
FileOutputStream fos2;
try {
fos2 = this.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("Start: " + start + "\n").getBytes());;
} catch (IOException e) {
e.printStackTrace();
}
utils.putMarker("{\"EVENT\":\"testing\"}", "trace_marker");
this.finishAffinity();
*/
if(!utils.doesDBExist(this,"BDBBenchmark")){
//Create the databases from the JSON
CreateDB createDB = new CreateDB(this);
@ -71,8 +48,6 @@ public class MainActivity extends AppCompatActivity {
}
else {
//utils.restrictHeapTo25();
String singleJsonString = utils.jsonToString(this, workload_e_timing_a);
utils.jsonStringToObject(singleJsonString);
@ -86,40 +61,20 @@ public class MainActivity extends AppCompatActivity {
//Find what queries were not executed successfully in the SQL or BDB traces
utils.findMissingQueries(this);
/*
int tester2 = utils.findMissingQueries(this);
if(tester2 != 0){
this.finishAffinity();
}
*/
//Calculate total time of the traces
long end = System.currentTimeMillis();
long delta = end - start;
double elapsedSeconds = delta / 1000.0;
/*
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
long total = mi.totalMem;
*/
File file = new File(this.getFilesDir().getPath() + "/time");
//File file = new File("/data/BDBtime");
FileOutputStream fos;
try {
fos = this.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + "\n").getBytes());
//fos.write(("Mem total: " + total + "\n").getBytes());
//fos.write(("Mem at start: " + memNow + "\n").getBytes());
//fos.write(("Mem after heap allocation: " + memafter + "\n").getBytes());
//fos.close();
} catch (IOException e) {
e.printStackTrace();
}
//this.finishAffinity();
}
}
}

View File

@ -34,32 +34,9 @@ public class MainActivity extends AppCompatActivity {
Utils utils = new Utils();
//long memNow = utils.memoryAvailable(this);
//utils.restrictHeapTo12_5();
//long memafter = utils.memoryAvailable(this);
long start = System.currentTimeMillis();
int tester;
/*
File file2 = new File(this.getFilesDir().getPath() + "/start_end");
//File file = new File("/data/BDBtime");
FileOutputStream fos2;
try {
fos2 = this.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("Start: " + start + "\n").getBytes());;
} catch (IOException e) {
e.printStackTrace();
}
utils.putMarker("{\"EVENT\":\"testing\"}", "trace_marker");
this.finishAffinity();
*/
if(!utils.doesDBExist(this,"BDBBenchmark")){
//Create the databases from the JSON
CreateDB createDB = new CreateDB(this);
@ -71,8 +48,6 @@ public class MainActivity extends AppCompatActivity {
}
else {
//utils.restrictHeapTo25();
String singleJsonString = utils.jsonToString(this, workload_f_timing_a);
utils.jsonStringToObject(singleJsonString);
@ -86,40 +61,20 @@ public class MainActivity extends AppCompatActivity {
//Find what queries were not executed successfully in the SQL or BDB traces
utils.findMissingQueries(this);
/*
int tester2 = utils.findMissingQueries(this);
if(tester2 != 0){
this.finishAffinity();
}
*/
//Calculate total time of the traces
long end = System.currentTimeMillis();
long delta = end - start;
double elapsedSeconds = delta / 1000.0;
/*
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
long total = mi.totalMem;
*/
File file = new File(this.getFilesDir().getPath() + "/time");
//File file = new File("/data/BDBtime");
FileOutputStream fos;
try {
fos = this.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + "\n").getBytes());
//fos.write(("Mem total: " + total + "\n").getBytes());
//fos.write(("Mem at start: " + memNow + "\n").getBytes());
//fos.write(("Mem after heap allocation: " + memafter + "\n").getBytes());
//fos.close();
} catch (IOException e) {
e.printStackTrace();
}
//this.finishAffinity();
}
}
}

View File

@ -34,32 +34,9 @@ public class MainActivity extends AppCompatActivity {
Utils utils = new Utils();
//long memNow = utils.memoryAvailable(this);
//utils.restrictHeapTo12_5();
//long memafter = utils.memoryAvailable(this);
long start = System.currentTimeMillis();
int tester;
/*
File file2 = new File(this.getFilesDir().getPath() + "/start_end");
//File file = new File("/data/BDBtime");
FileOutputStream fos2;
try {
fos2 = this.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("Start: " + start + "\n").getBytes());;
} catch (IOException e) {
e.printStackTrace();
}
utils.putMarker("{\"EVENT\":\"testing\"}", "trace_marker");
this.finishAffinity();
*/
if(!utils.doesDBExist(this,"BDBBenchmark")){
//Create the databases from the JSON
CreateDB createDB = new CreateDB(this);
@ -71,8 +48,6 @@ public class MainActivity extends AppCompatActivity {
}
else {
//utils.restrictHeapTo25();
String singleJsonString = utils.jsonToString(this, workload_ia_timing_a);
utils.jsonStringToObject(singleJsonString);
@ -86,40 +61,20 @@ public class MainActivity extends AppCompatActivity {
//Find what queries were not executed successfully in the SQL or BDB traces
utils.findMissingQueries(this);
/*
int tester2 = utils.findMissingQueries(this);
if(tester2 != 0){
this.finishAffinity();
}
*/
//Calculate total time of the traces
long end = System.currentTimeMillis();
long delta = end - start;
double elapsedSeconds = delta / 1000.0;
/*
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
long total = mi.totalMem;
*/
File file = new File(this.getFilesDir().getPath() + "/time");
//File file = new File("/data/BDBtime");
FileOutputStream fos;
try {
fos = this.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + "\n").getBytes());
//fos.write(("Mem total: " + total + "\n").getBytes());
//fos.write(("Mem at start: " + memNow + "\n").getBytes());
//fos.write(("Mem after heap allocation: " + memafter + "\n").getBytes());
//fos.close();
} catch (IOException e) {
e.printStackTrace();
}
//this.finishAffinity();
}
}
}

View File

@ -34,32 +34,9 @@ public class MainActivity extends AppCompatActivity {
Utils utils = new Utils();
//long memNow = utils.memoryAvailable(this);
//utils.restrictHeapTo12_5();
//long memafter = utils.memoryAvailable(this);
long start = System.currentTimeMillis();
int tester;
/*
File file2 = new File(this.getFilesDir().getPath() + "/start_end");
//File file = new File("/data/BDBtime");
FileOutputStream fos2;
try {
fos2 = this.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("Start: " + start + "\n").getBytes());;
} catch (IOException e) {
e.printStackTrace();
}
utils.putMarker("{\"EVENT\":\"testing\"}", "trace_marker");
this.finishAffinity();
*/
if(!utils.doesDBExist(this,"BDBBenchmark")){
//Create the databases from the JSON
CreateDB createDB = new CreateDB(this);
@ -71,8 +48,6 @@ public class MainActivity extends AppCompatActivity {
}
else {
//utils.restrictHeapTo25();
String singleJsonString = utils.jsonToString(this, workload_ib_timing_a);
utils.jsonStringToObject(singleJsonString);
@ -86,40 +61,20 @@ public class MainActivity extends AppCompatActivity {
//Find what queries were not executed successfully in the SQL or BDB traces
utils.findMissingQueries(this);
/*
int tester2 = utils.findMissingQueries(this);
if(tester2 != 0){
this.finishAffinity();
}
*/
//Calculate total time of the traces
long end = System.currentTimeMillis();
long delta = end - start;
double elapsedSeconds = delta / 1000.0;
/*
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
long total = mi.totalMem;
*/
File file = new File(this.getFilesDir().getPath() + "/time");
//File file = new File("/data/BDBtime");
FileOutputStream fos;
try {
fos = this.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + "\n").getBytes());
//fos.write(("Mem total: " + total + "\n").getBytes());
//fos.write(("Mem at start: " + memNow + "\n").getBytes());
//fos.write(("Mem after heap allocation: " + memafter + "\n").getBytes());
//fos.close();
} catch (IOException e) {
e.printStackTrace();
}
//this.finishAffinity();
}
}
}

View File

@ -34,32 +34,9 @@ public class MainActivity extends AppCompatActivity {
Utils utils = new Utils();
//long memNow = utils.memoryAvailable(this);
//utils.restrictHeapTo12_5();
//long memafter = utils.memoryAvailable(this);
long start = System.currentTimeMillis();
int tester;
/*
File file2 = new File(this.getFilesDir().getPath() + "/start_end");
//File file = new File("/data/BDBtime");
FileOutputStream fos2;
try {
fos2 = this.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("Start: " + start + "\n").getBytes());;
} catch (IOException e) {
e.printStackTrace();
}
utils.putMarker("{\"EVENT\":\"testing\"}", "trace_marker");
this.finishAffinity();
*/
if(!utils.doesDBExist(this,"BDBBenchmark")){
//Create the databases from the JSON
CreateDB createDB = new CreateDB(this);
@ -71,8 +48,6 @@ public class MainActivity extends AppCompatActivity {
}
else {
//utils.restrictHeapTo25();
String singleJsonString = utils.jsonToString(this, workload_ic_timing_a);
utils.jsonStringToObject(singleJsonString);
@ -86,40 +61,20 @@ public class MainActivity extends AppCompatActivity {
//Find what queries were not executed successfully in the SQL or BDB traces
utils.findMissingQueries(this);
/*
int tester2 = utils.findMissingQueries(this);
if(tester2 != 0){
this.finishAffinity();
}
*/
//Calculate total time of the traces
long end = System.currentTimeMillis();
long delta = end - start;
double elapsedSeconds = delta / 1000.0;
/*
ActivityManager.MemoryInfo mi = new ActivityManager.MemoryInfo();
ActivityManager activityManager = (ActivityManager) this.getSystemService(Context.ACTIVITY_SERVICE);
activityManager.getMemoryInfo(mi);
long total = mi.totalMem;
*/
File file = new File(this.getFilesDir().getPath() + "/time");
//File file = new File("/data/BDBtime");
FileOutputStream fos;
try {
fos = this.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + "\n").getBytes());
//fos.write(("Mem total: " + total + "\n").getBytes());
//fos.write(("Mem at start: " + memNow + "\n").getBytes());
//fos.write(("Mem after heap allocation: " + memafter + "\n").getBytes());
//fos.close();
} catch (IOException e) {
e.printStackTrace();
}
//this.finishAffinity();
}
}
}

View File

@ -22,7 +22,7 @@ echo 1 > $trace_dir/events/block/block_rq_complete/enable
echo 1 > $trace_dir/events/cpufreq_interactive/enable
echo > $trace_dir/trace
echo 1 > $trace_dir/tracing_enabled
#echo 1 > $trace_dir/tracing_enabled
echo 1 > $trace_dir/tracing_on

View File

@ -22,7 +22,7 @@ echo 1 > $trace_dir/events/block/block_rq_complete/enable
echo 1 > $trace_dir/events/cpufreq_interactive/enable
echo > $trace_dir/trace
echo 1 > $trace_dir/tracing_enabled
#echo 1 > $trace_dir/tracing_enabled
echo 1 > $trace_dir/tracing_on

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload A SQL\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +88,14 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +125,12 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +149,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +156,31 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
//memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
//memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
//memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
//utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
//memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +216,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload B SQL\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +88,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +124,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +147,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +154,31 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
//memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
//memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
//memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
//utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
//memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +214,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload C SQL\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,48 +88,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
@ -197,21 +125,12 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +149,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +156,31 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +216,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -33,10 +29,6 @@ public class Queries {
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload D SQL\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +57,6 @@ public class Queries {
*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +67,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +74,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +81,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +89,14 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +126,12 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +150,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +157,30 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +216,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload E SQL\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,48 +88,14 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
@ -197,21 +126,12 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +150,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +157,31 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +217,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -32,11 +28,6 @@ public class Queries {
}
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload F SQL\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +56,6 @@ public class Queries {
*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +66,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +73,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +80,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +88,14 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +125,12 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +149,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +156,31 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +216,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -33,10 +29,6 @@ public class Queries {
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload IA SQL\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +57,6 @@ public class Queries {
*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +67,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +74,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +81,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,48 +89,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
@ -197,21 +126,12 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +150,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +157,31 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +217,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -33,10 +29,6 @@ public class Queries {
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload IB SQL\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +57,6 @@ public class Queries {
*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +67,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +74,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +81,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +89,14 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +126,12 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +150,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +157,32 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +218,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}

View File

@ -20,10 +20,6 @@ public class Queries {
JSONObject workloadJsonObject;
Context context;
Utils utils;
//Double SELECT;
//Double UPDATE;
//Double INSERT;
//Double DELETE;
public Queries(Context inContext){
utils = new Utils();
@ -33,10 +29,6 @@ public class Queries {
public int startQueries(){
//int a[] = utils.restrictHeapTo25();
//int a[] = utils.restrictHeapTo50();
//utils.restrictHeapTo25();
utils.putMarker("{\"EVENT\":\"Workload IC SQL\"}", "trace_marker");
utils.putMarker("START: App started\n", "trace_marker");
@ -65,19 +57,6 @@ public class Queries {
*/
utils.putMarker("END: app finished\n", "trace_marker");
/*
try {
File file2 = new File(context.getFilesDir().getPath() + "/percentage");
FileOutputStream fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("SELECT: " + (SELECT / 1800) * 100 + "%\n").getBytes());
fos2.write(("UPDATE: " + (UPDATE / 1800) * 100 + "%\n").getBytes());
fos2.write(("INSERT: " + (INSERT / 1800) * 100 + "%\n").getBytes());
fos2.write(("DELETE: " + (DELETE / 1800) * 100 + "%\n").getBytes());
fos2.close();
} catch (IOException e) {
e.printStackTrace();
}
*/
return 0;
}
@ -88,12 +67,6 @@ public class Queries {
try {
JSONArray benchmarkArray = workloadJsonObject.getJSONArray("benchmark");
// SELECT = 0.0;
//UPDATE = 0.0;
//INSERT = 0.0;
//DELETE = 0.0;
//utils.putMarker("{\"EVENT\":\"SELECT_START\"}\n","trace_marker");
for(int i = 0; i < benchmarkArray.length(); i ++){
JSONObject operationJson = benchmarkArray.getJSONObject(i);
Object operationObject = operationJson.get("op");
@ -101,10 +74,6 @@ public class Queries {
switch (operation) {
case "query": {
//double startSql;
//double endSql;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -112,12 +81,7 @@ public class Queries {
try {
if(query.contains("SELECT")){
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
Cursor cursor = db.rawQuery(query,null);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
if(cursor.moveToFirst()) {
int numColumns = cursor.getColumnCount();
do {
@ -125,49 +89,13 @@ public class Queries {
while (j< numColumns) {
j++;
}
//String temp = cursor.toString();
//}
//process cursor
} while(cursor.moveToNext());
}
cursor.close();
// SELECT++;
}
else {
//startSql = System.currentTimeMillis();
//memBeforeQuery = utils.memoryAvailable(context);
db.execSQL(query);
//memAfterQuery = utils.memoryAvailable(context);
//endSql = System.currentTimeMillis();
/*
if(query.contains("UPDATE")) {
UPDATE++;
}
if(query.contains("INSERT")){
INSERT++;
}
if(query.contains("DELETE")){
DELETE++;
}*/
}
/*
double delta = endSql - startSql;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testSQL");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemorySQL");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
}
catch (SQLiteException e){
@ -197,21 +125,11 @@ public class Queries {
}
//utils.putMarker("{\"EVENT\":\"SELECT_END\"}\n","trace_marker");
} catch (JSONException e) {
e.printStackTrace();
db.close();
return 1;
} /*catch (FileNotFoundException e) {
e.printStackTrace();
db.close();
return 1;
} catch (IOException e) {
e.printStackTrace();
db.close();
return 1;
}*/
}
db.close();
return 0;
}
@ -230,10 +148,6 @@ public class Queries {
String operation = operationObject.toString();
switch (operation) {
case "query": {
//double startBdb;
//double endBdb;
long memBeforeQuery;
long memAfterQuery;
sqlException = 0;
Object queryObject = operationJson.get("sql");
String query = queryObject.toString();
@ -241,81 +155,31 @@ public class Queries {
try {
stmt = con.createStatement();
//startBdb = System.currentTimeMillis();
if(query.contains("UPDATE")){
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
int tester = stmt.executeUpdate(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if(tester == 0 || tester < 0){
stmt.close();
//throw new SQLiteException(query);
}
}
else {
// memBeforeQuery = utils.memoryAvailable(context);
// utils.putMarker("{\"EVENT\":\"QUERY_START\"}", "trace_marker");
Boolean test = stmt.execute(query);
// utils.putMarker("{\"EVENT\":\"QUERY_END\"}", "trace_marker");
// memAfterQuery = utils.memoryAvailable(context);
if (!test){
stmt.close();
//throw new SQLiteException();
}
//memAfterQuery = utils.memoryAvailable(context);
//endBdb = System.currentTimeMillis();
stmt.close();
}
/*
double delta = endBdb - startBdb;
double elapsedSeconds = delta / 1000.00000;
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((elapsedSeconds + ": " + query + "\n").getBytes());
fos.close();
*/
/*
File file2 = new File(context.getFilesDir().getPath() + "/MemoryBDB");
FileOutputStream fos2;
fos2 = context.openFileOutput(file2.getName(), Context.MODE_APPEND);
fos2.write(("B Available: " + memBeforeQuery + "\n").getBytes());
fos2.write(("B Available: " + memAfterQuery + '\n').getBytes());
fos2.close();
*/
/*
File file = new File(context.getFilesDir().getPath() + "/testBDB");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((query + "\n").getBytes());
fos.close();
*/
}
catch (SQLiteException e){
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
continue;
} catch (SQLException e) {
sqlException = 1;
/*
File file = new File(context.getFilesDir().getPath() + "/failedtestH2");
FileOutputStream fos = context.openFileOutput(file.getName(), Context.MODE_APPEND);
fos.write((e + "\n").getBytes());
fos.close();
*/
e.printStackTrace();
continue;
}
@ -351,27 +215,7 @@ public class Queries {
}
return 1;
} /* catch (FileNotFoundException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
} catch (IOException e) {
e.printStackTrace();
try {
con.close();
} catch (SQLException e1) {
e1.printStackTrace();
}
return 1;
}*/ catch (SQLException e) {
} catch (SQLException e) {
e.printStackTrace();
return 1;
}