adaptive-caching-framework

fixing databases and updating docs

12/7/2018 10:04:20 PM

Details

diff --git a/evaluation/applications/AP/shopizer/sm-shop/src/main/webapp/WEB-INF/spring/appServlet/shopizer-properties.xml b/evaluation/applications/AP/shopizer/sm-shop/src/main/webapp/WEB-INF/spring/appServlet/shopizer-properties.xml
index 3f9bf1f..1e52318 100755
--- a/evaluation/applications/AP/shopizer/sm-shop/src/main/webapp/WEB-INF/spring/appServlet/shopizer-properties.xml
+++ b/evaluation/applications/AP/shopizer/sm-shop/src/main/webapp/WEB-INF/spring/appServlet/shopizer-properties.xml
@@ -32,7 +32,7 @@
 				<prop key="PRODUCT_IMAGE_MAX_SIZE">9000000</prop>
 				<prop key="IMAGE_FORMATS">jpg|png|gif</prop>
 
-				<prop key="POPULATE_TEST_DATA">true</prop>
+				<prop key="POPULATE_TEST_DATA">false</prop>
 
 				<prop key="ORDER_SCHEME">http</prop>
 				<prop key="CONTEXT_PATH">sm-shop</prop>
diff --git a/evaluation/applications/DEV/shopizer/sm-shop/src/main/webapp/WEB-INF/spring/appServlet/shopizer-properties.xml b/evaluation/applications/DEV/shopizer/sm-shop/src/main/webapp/WEB-INF/spring/appServlet/shopizer-properties.xml
index 3f9bf1f..1e52318 100755
--- a/evaluation/applications/DEV/shopizer/sm-shop/src/main/webapp/WEB-INF/spring/appServlet/shopizer-properties.xml
+++ b/evaluation/applications/DEV/shopizer/sm-shop/src/main/webapp/WEB-INF/spring/appServlet/shopizer-properties.xml
@@ -32,7 +32,7 @@
 				<prop key="PRODUCT_IMAGE_MAX_SIZE">9000000</prop>
 				<prop key="IMAGE_FORMATS">jpg|png|gif</prop>
 
-				<prop key="POPULATE_TEST_DATA">true</prop>
+				<prop key="POPULATE_TEST_DATA">false</prop>
 
 				<prop key="ORDER_SCHEME">http</prop>
 				<prop key="CONTEXT_PATH">sm-shop</prop>
diff --git a/evaluation/applications/NO/CloudStore/src/main/resources/hibernate.xml b/evaluation/applications/NO/CloudStore/src/main/resources/hibernate.xml
index ce70f4a..c7e8d3f 100755
--- a/evaluation/applications/NO/CloudStore/src/main/resources/hibernate.xml
+++ b/evaluation/applications/NO/CloudStore/src/main/resources/hibernate.xml
@@ -1,98 +1,91 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <beans xmlns="http://www.springframework.org/schema/beans"
-	xmlns:p="http://www.springframework.org/schema/p"
-	xmlns:tx="http://www.springframework.org/schema/tx"
-	xmlns:jdbc="http://www.springframework.org/schema/jdbc"
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
-	xmlns:context="http://www.springframework.org/schema/context"
-	xmlns:cache="http://www.springframework.org/schema/cache"
-	xsi:schemaLocation="http://www.springframework.org/schema/jdbc 
-			http://www.springframework.org/schema/jdbc/spring-jdbc.xsd 
-			http://www.springframework.org/schema/beans 
+       xmlns:tx="http://www.springframework.org/schema/tx"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xmlns:context="http://www.springframework.org/schema/context"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
 			http://www.springframework.org/schema/beans/spring-beans.xsd 
 			http://www.springframework.org/schema/tx 
 			http://www.springframework.org/schema/tx/spring-tx.xsd 
 			http://www.springframework.org/schema/context 
-			http://www.springframework.org/schema/context/spring-context.xsd
-			http://www.springframework.org/schema/cache
-			http://www.springframework.org/schema/cache/spring-cache.xsd">
-	
-		<context:property-placeholder 
-			location="classpath:database/database.hibernate.properties" />
-	<context:component-scan base-package="eu.cloudscale.showcase.db.dao.hibernate" />
-	
-	<bean id="service" class="eu.cloudscale.showcase.db.services.HibernateService" />
-	
-	<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
-		destroy-method="close">
+			http://www.springframework.org/schema/context/spring-context.xsd">
 
-		<property name="driverClass" value="${jdbc.driverClassName}" />
-		<property name="jdbcUrl" value="${jdbc.url}" />
-		<property name="user" value="${jdbc.username}" />
-		<property name="password" value="${jdbc.password}" />
-		<!-- these are C3P0 properties -->
-		<property name="acquireIncrement" value="1" />
-		<property name="minPoolSize" value="4" />
-		<property name="maxPoolSize" value="${jdbc.pool_size}" />
-<!-- 		<property name="maxPoolSize" value="500"/>  -->
-<!-- 		<property name="maxIdleTime" value="30" /> -->
-<!-- 		<property name="maxConnectionAge" value="180" /> -->
-		<!-- <property name="debugUnreturnedConnectionStackTraces" value="true" 
-			/> -->
-		<property name="initialPoolSize" value="4" />
-<!-- 		<property name="idleConnectionTestPeriod" value="5" /> -->
-<!-- 		<property name="checkoutTimeout" value="60000" /> -->
-<!-- 		<property name="maxIdleTimeExcessConnections" value="30" /> -->
-<!-- 		<property name="unreturnedConnectionTimeout" value="60" /> -->
-<!-- 		<property name="debugUnreturnedConnectionStackTraces" value="true" /> -->
-		<!-- <property name="automaticTestTable" value="conTest" /> -->
-<!-- 		<property name="testConnectionOnCheckin" value="true" /> -->
-<!-- 		<property name="testConnectionOnCheckout" value="true" /> -->
-	</bean>
+    <context:property-placeholder
+            location="classpath:database/database.hibernate.properties"/>
+    <context:component-scan base-package="eu.cloudscale.showcase.db.dao.hibernate"/>
 
-	<tx:annotation-driven transaction-manager="transactionManager" />
+    <bean id="service" class="eu.cloudscale.showcase.db.services.HibernateService"/>
 
-	<bean id="sessionFactory"
-		class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
-		<property name="dataSource" ref="dataSource" />
-		
-		<property name="packagesToScan" value="eu.cloudscale.showcase.db.dao" />
-		<property name="hibernateProperties">
-			<props>
-<!--  				<prop key="hibernate.hbm2ddl.auto">create-drop</prop> -->
-<!-- 				<prop key="hibernate.jdbc.batch_size">1000</prop> -->
-				<prop key="hibernate.show_sql">false</prop>
-				<prop key="hibernate.dialect">${jdbc.hibernate.dialect}</prop>
-<!-- 				<prop key="hibernate.max_fetch_depth">4</prop> -->
-				<!-- <prop key="hibernate.connection.release_mode">after_statement</prop> -->
+    <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"
+          destroy-method="close">
+
+        <property name="driverClass" value="${jdbc.driverClassName}"/>
+        <property name="jdbcUrl" value="${jdbc.url}"/>
+        <property name="user" value="${jdbc.username}"/>
+        <property name="password" value="${jdbc.password}"/>
+        <!-- these are C3P0 properties -->
+        <property name="acquireIncrement" value="1"/>
+        <property name="minPoolSize" value="4"/>
+        <property name="maxPoolSize" value="${jdbc.pool_size}"/>
+        <!-- 		<property name="maxPoolSize" value="500"/>  -->
+        <!-- 		<property name="maxIdleTime" value="30" /> -->
+        <!-- 		<property name="maxConnectionAge" value="180" /> -->
+        <!-- <property name="debugUnreturnedConnectionStackTraces" value="true"
+            /> -->
+        <property name="initialPoolSize" value="4"/>
+        <!-- 		<property name="idleConnectionTestPeriod" value="5" /> -->
+        <!-- 		<property name="checkoutTimeout" value="60000" /> -->
+        <!-- 		<property name="maxIdleTimeExcessConnections" value="30" /> -->
+        <!-- 		<property name="unreturnedConnectionTimeout" value="60" /> -->
+        <!-- 		<property name="debugUnreturnedConnectionStackTraces" value="true" /> -->
+        <!-- <property name="automaticTestTable" value="conTest" /> -->
+        <!-- 		<property name="testConnectionOnCheckin" value="true" /> -->
+        <!-- 		<property name="testConnectionOnCheckout" value="true" /> -->
+    </bean>
+
+    <tx:annotation-driven transaction-manager="transactionManager"/>
+
+    <bean id="sessionFactory"
+          class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
+        <property name="dataSource" ref="dataSource"/>
+
+        <property name="packagesToScan" value="eu.cloudscale.showcase.db.dao"/>
+        <property name="hibernateProperties">
+            <props>
+                <!--  				<prop key="hibernate.hbm2ddl.auto">create-drop</prop> -->
+                <!-- 				<prop key="hibernate.jdbc.batch_size">1000</prop> -->
+                <prop key="hibernate.show_sql">false</prop>
+                <prop key="hibernate.dialect">${jdbc.hibernate.dialect}</prop>
+                <!-- 				<prop key="hibernate.max_fetch_depth">4</prop> -->
+                <!-- <prop key="hibernate.connection.release_mode">after_statement</prop> -->
                 <!--TODO Jhonny removed cache-->
-				<!--<prop key="hibernate.cache.use_second_level_cache">true</prop>-->
-				<!--<prop key="hibernate.cache.use_query_cache">true</prop>-->
-				<!--<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</prop>-->
-				<!--<prop key="hibernate.cache.provider_configuration_file_resource_path">classpath:ehcache.xml</prop>-->
-<!-- 				<prop key="hibernate.generate_statistics">true</prop> -->
-			</props>
-		</property>
-		<property name="annotatedClasses">
-			<list>
-				<value>eu.cloudscale.showcase.db.model.hibernate.Address</value>
-				<value>eu.cloudscale.showcase.db.model.hibernate.Author</value>
-				<value>eu.cloudscale.showcase.db.model.hibernate.CcXacts</value>
-				<value>eu.cloudscale.showcase.db.model.hibernate.Country</value>
-				<value>eu.cloudscale.showcase.db.model.hibernate.Customer</value>
-				<value>eu.cloudscale.showcase.db.model.hibernate.Item</value>
-				<value>eu.cloudscale.showcase.db.model.hibernate.OrderLine</value>
-				<!-- <value>eu.cloudscale.showcase.db.model.rbms.CcXactsId</value> -->
-				<value>eu.cloudscale.showcase.db.model.hibernate.Orders</value>
-				<value>eu.cloudscale.showcase.db.model.hibernate.ShoppingCart
-				</value>
-				<value>eu.cloudscale.showcase.db.model.hibernate.ShoppingCartLine
-				</value>
-			</list>
-		</property>
-	</bean>
-	<bean id="transactionManager"
-		class="org.springframework.orm.hibernate4.HibernateTransactionManager">
-		<property name="sessionFactory" ref="sessionFactory" />
-	</bean>
+                <!--<prop key="hibernate.cache.use_second_level_cache">true</prop>-->
+                <!--<prop key="hibernate.cache.use_query_cache">true</prop>-->
+                <!--<prop key="hibernate.cache.region.factory_class">org.hibernate.cache.ehcache.SingletonEhCacheRegionFactory</prop>-->
+                <!--<prop key="hibernate.cache.provider_configuration_file_resource_path">classpath:ehcache.xml</prop>-->
+                <!-- 				<prop key="hibernate.generate_statistics">true</prop> -->
+            </props>
+        </property>
+        <property name="annotatedClasses">
+            <list>
+                <value>eu.cloudscale.showcase.db.model.hibernate.Address</value>
+                <value>eu.cloudscale.showcase.db.model.hibernate.Author</value>
+                <value>eu.cloudscale.showcase.db.model.hibernate.CcXacts</value>
+                <value>eu.cloudscale.showcase.db.model.hibernate.Country</value>
+                <value>eu.cloudscale.showcase.db.model.hibernate.Customer</value>
+                <value>eu.cloudscale.showcase.db.model.hibernate.Item</value>
+                <value>eu.cloudscale.showcase.db.model.hibernate.OrderLine</value>
+                <!-- <value>eu.cloudscale.showcase.db.model.rbms.CcXactsId</value> -->
+                <value>eu.cloudscale.showcase.db.model.hibernate.Orders</value>
+                <value>eu.cloudscale.showcase.db.model.hibernate.ShoppingCart
+                </value>
+                <value>eu.cloudscale.showcase.db.model.hibernate.ShoppingCartLine
+                </value>
+            </list>
+        </property>
+    </bean>
+    <bean id="transactionManager"
+          class="org.springframework.orm.hibernate4.HibernateTransactionManager">
+        <property name="sessionFactory" ref="sessionFactory"/>
+    </bean>
 </beans>
diff --git a/evaluation/applications/NO/shopizer/sm-shop/src/main/java/com/salesmanager/web/init/data/InitStoreData.java b/evaluation/applications/NO/shopizer/sm-shop/src/main/java/com/salesmanager/web/init/data/InitStoreData.java
index 5e8bbc9..82902f4 100755
--- a/evaluation/applications/NO/shopizer/sm-shop/src/main/java/com/salesmanager/web/init/data/InitStoreData.java
+++ b/evaluation/applications/NO/shopizer/sm-shop/src/main/java/com/salesmanager/web/init/data/InitStoreData.java
@@ -12,7 +12,6 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.authentication.encoding.PasswordEncoder;
-import org.springframework.stereotype.Component;
 
 import com.salesmanager.core.business.catalog.category.model.Category;
 import com.salesmanager.core.business.catalog.category.model.CategoryDescription;
@@ -71,7 +70,6 @@ import com.salesmanager.core.business.user.service.GroupService;
 import com.salesmanager.web.constants.Constants;
 import com.salesmanager.web.utils.LocaleUtils;
 
-@Component
 public class InitStoreData implements InitData {
 	
 	private static final Logger LOGGER = LoggerFactory.getLogger(InitStoreWithQuantity.class);
diff --git a/evaluation/applications/NO/shopizer/sm-shop/src/main/java/com/salesmanager/web/init/data/InitStoreWithQuantity.java b/evaluation/applications/NO/shopizer/sm-shop/src/main/java/com/salesmanager/web/init/data/InitStoreWithQuantity.java
index 52a3bb5..78dcf43 100644
--- a/evaluation/applications/NO/shopizer/sm-shop/src/main/java/com/salesmanager/web/init/data/InitStoreWithQuantity.java
+++ b/evaluation/applications/NO/shopizer/sm-shop/src/main/java/com/salesmanager/web/init/data/InitStoreWithQuantity.java
@@ -61,6 +61,7 @@ import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.authentication.encoding.PasswordEncoder;
+import org.springframework.stereotype.Component;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
@@ -70,6 +71,7 @@ import java.util.Date;
 import java.util.List;
 import java.util.concurrent.ThreadLocalRandom;
 
+@Component
 public class InitStoreWithQuantity implements InitData {
     private static final Logger LOGGER = LoggerFactory.getLogger(InitStoreData.class);
 
diff --git a/evaluation/applications/NO/shopizer/sm-shop/src/main/webapp/WEB-INF/spring/appServlet/shopizer-properties.xml b/evaluation/applications/NO/shopizer/sm-shop/src/main/webapp/WEB-INF/spring/appServlet/shopizer-properties.xml
index 3f9bf1f..1e52318 100755
--- a/evaluation/applications/NO/shopizer/sm-shop/src/main/webapp/WEB-INF/spring/appServlet/shopizer-properties.xml
+++ b/evaluation/applications/NO/shopizer/sm-shop/src/main/webapp/WEB-INF/spring/appServlet/shopizer-properties.xml
@@ -32,7 +32,7 @@
 				<prop key="PRODUCT_IMAGE_MAX_SIZE">9000000</prop>
 				<prop key="IMAGE_FORMATS">jpg|png|gif</prop>
 
-				<prop key="POPULATE_TEST_DATA">true</prop>
+				<prop key="POPULATE_TEST_DATA">false</prop>
 
 				<prop key="ORDER_SCHEME">http</prop>
 				<prop key="CONTEXT_PATH">sm-shop</prop>

experiments.sh 5(+5 -0)

diff --git a/experiments.sh b/experiments.sh
index 8aa85bc..5ef7411 100755
--- a/experiments.sh
+++ b/experiments.sh
@@ -1,5 +1,10 @@
 #!/bin/bash
 
+###########################################################
+#WORKING IN PROGRESS - DO NOT USE THIS SCRIPT             #
+###########################################################
+
+
 #start services manually in advance
 #mongod &
 #sudo service mysql start

README.md 59(+31 -28)

diff --git a/README.md b/README.md
index fdde6f3..ad4b40d 100644
--- a/README.md
+++ b/README.md
@@ -10,14 +10,15 @@ Evaluation set up - Identifying cacheable methods automatically
 
 Simulations were performed using three different caching configurations: (i) no application-level caching (NO), (ii) application-level caching manually designed and implemented by developers (DEV); and (iii) our approach (AP).
 
-######## Set up
+#### Summary
+
 - Three applications
 - Three set ups for each application: NO, DEV, AP
 - A simulation of a randomized workload for each set up
 
-Required Tools
----------
-- [Jmeter 3.3] (http://jmeter.apache.org/)
+#### Required Tools
+
+- [Jmeter 3.3](http://jmeter.apache.org/)
 - MySQL
 - Java 8
 - Maven 3
@@ -28,47 +29,49 @@ Applications
 To prevent application bias in our results, we selected applications with different sizes (6.3--111.3 KLOC) and domains.
 
 Our evaluation was performed with three open-source web applications:
-- [Cloud Store] (http://www.cloudscale-project.eu/)
-- [Spring petclinic] (https://github.com/SpringSource/spring-petclinic/)
-- [Shopizer] (https://github.com/shopizer-ecommerce/shopizer)
+- [Cloud Store](http://www.cloudscale-project.eu/)
+- [Spring petclinic](https://github.com/SpringSource/spring-petclinic/)
+- [Shopizer](https://github.com/shopizer-ecommerce/shopizer)
 
-Application's setup
--------------------
 
-###### Requirements
-
-- Java 8
-- Maven 3
-- Mysql database
+#### [Shopizer](https://github.com/shopizer-ecommerce/shopizer):
 
-[Shopizer] (https://github.com/shopizer-ecommerce/shopizer):
+This application requires the installation of Elasticsearch (https://www.elastic.co/) to run properly. You can use the docker image below to run elasticsearch:
 
-This application requires the installation of Elasticsearch (https://www.elastic.co/) to run properly.
+```
+docker pull docker.elastic.co/elasticsearch/elasticsearch:6.5.2
+docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.5.2
+```
 
 Installation and configuration:
+
 - Create schema `SALESMANAGER` on the database
 - Configure the file `database.properties` with your database info
-- Database population: in the file `shopizer-properties.xml` there is the tag `<prop key="POPULATE_TEST_DATA">true</prop>`. For AP and DEV, such configuration will provide 7 categories, 6 products, addresses USA, one customer, one admin, shipping info in the database in the first initialization of the system. For NO, it will be generated a lot of more randomized data. For more information on how the database is populated, please refer to `InitData.class` and its implementations.
-- Compile and run: `mvn clean install tomcat7:run-war -DskipTests`
+- Restore the dump of the database located in `evaluation/applications/database/shopizer.sql`
+- [OPTIONAL] You can also generate new data: in the file shopizer-properties.xml there is the tag <prop key="POPULATE_TEST_DATA">true</prop>. For AP and DEV, such configuration will provide 7 categories, 6 products, addresses USA, one customer, one admin, shipping info in the database in the first initialization of the system. For NO, it will be generated a lot of more randomized data. For more information on how the database is populated, please refer to InitData.class and its implementations.
+- Compile at the root folder: `mvn clean install -DskipTests`
+- Run in the folder `sm-shop` with `mvn tomcat7:run-war`
+
+Use the urls below to access system's features:
 
-Use the urls below to access system's features
-- http://localhost:8080/sm-shop/<profile>
-- /shop → Store page
-- /admin → Administration page where the login and password are: admin:password
+- http://localhost:8080/sm-shop/shop → Store page
+- http://localhost:8080/sm-shop/admin → Administration page where the login and password are: `admin:password`
 
-[Petclinic] (https://github.com/spring-projects/spring-petclinic)
+#### [Petclinic](https://github.com/spring-projects/spring-petclinic)
 
 Installation and configuration:
-- Create schema `perclinic` on the database
+
+- Create schema `petclinic` on the database
 - Configure database on the file `pom.xml`
-- Populate database: on the first initialization it will be populated automatically
+- Restore the dump of the database located in `evaluation/applications/database/petclinic.sql`
 - Compile and run: `mvn clean install tomcat7:run-war -DskipTests`
-- Url to access the system: http://localhost:9966/petclinic/
+- Url to access the system: http://localhost:8080/petclinic/
 
-[CloudStore] (https://github.com/CloudScale-Project/CloudStore)
+#### [CloudStore](https://github.com/CloudScale-Project/CloudStore)
 
 Installation and configuration:
-- Restore the [dump](https://github.com/CloudScale-Project/CloudStore) located in `DEV/database/rds-tpcw-dump-latest.sql`, such dump has 10000 books
+
+- Restore the [dump](https://github.com/CloudScale-Project/CloudStore) located in `evaluation/applications/database/cloudstore.sql`, such dump has 10000 books
 - Configure database on file `src/main/resources/database/database.hibernate.properties`
 - Compile and run: `mvn clean install tomcat7:run-war -DskipTests`
 - Url to access the system: http://localhost:8080/showcase/