From 9dc457125e24c4d2f64ca7410045c1ce70ae4c22 Mon Sep 17 00:00:00 2001 From: andrea Date: Tue, 28 Apr 2015 23:15:59 +0200 Subject: [PATCH] Minor, removed old unused expeiment for hawtdb groovy scripts --- distribution/src/main/scripts/moquette.sh | 2 +- .../integration/hawtdb_multindex.groovy | 81 ------------------- tools_scripts/integration/hawtdb_play.groovy | 65 --------------- .../integration/hawtdb_raw_access.groovy | 45 ----------- .../integration/sslSimplePublisher.groovy | 0 5 files changed, 1 insertion(+), 192 deletions(-) delete mode 100644 tools_scripts/integration/hawtdb_multindex.groovy delete mode 100644 tools_scripts/integration/hawtdb_play.groovy delete mode 100644 tools_scripts/integration/hawtdb_raw_access.groovy create mode 100644 tools_scripts/integration/sslSimplePublisher.groovy diff --git a/distribution/src/main/scripts/moquette.sh b/distribution/src/main/scripts/moquette.sh index 5d1b4235..82b31dc7 100644 --- a/distribution/src/main/scripts/moquette.sh +++ b/distribution/src/main/scripts/moquette.sh @@ -52,5 +52,5 @@ MOQUETTE_PATH=$MOQUETTE_HOME/ #LOG_FILE_LEVEL=fine JAVA_OPTS_SCRIPT="-XX:+HeapDumpOnOutOfMemoryError -Djava.awt.headless=true" -$JAVA -server $JAVA_OPTS $JAVA_OPTS_SCRIPT -Dlog4j.configuration="file:$LOG_FILE" -Dmoquette.path="$MOQUETTE_PATH" -cp "$MOQUETTE_HOME/lib/moquette-broker-0.6-SNAPSHOT.jar:$MOQUETTE_HOME/lib/*" org.eclipse.moquette.server.Server +$JAVA -server $JAVA_OPTS $JAVA_OPTS_SCRIPT -Dlog4j.configuration="file:$LOG_FILE" -Dmoquette.path="$MOQUETTE_PATH" -cp "$MOQUETTE_HOME/lib/moquette-broker-0.7-SNAPSHOT.jar:$MOQUETTE_HOME/lib/*" org.eclipse.moquette.server.Server diff --git a/tools_scripts/integration/hawtdb_multindex.groovy b/tools_scripts/integration/hawtdb_multindex.groovy deleted file mode 100644 index 44264415..00000000 --- a/tools_scripts/integration/hawtdb_multindex.groovy +++ /dev/null @@ -1,81 +0,0 @@ -@Grab(group='org.fusesource.hawtdb', module='hawtdb', version='1.6') - -import org.fusesource.hawtbuf.codec.StringCodec -import org.fusesource.hawtdb.api.IndexFactory -import org.fusesource.hawtdb.api.HashIndexFactory -import org.fusesource.hawtdb.api.BTreeIndexFactory -import org.fusesource.hawtdb.api.PageFile -import org.fusesource.hawtdb.api.PageFileFactory -import org.fusesource.hawtdb.api.MultiIndexFactory -import org.fusesource.hawtdb.api.SortedIndex - - - -File tmpFile = new File(System.getProperty("user.home") + File.separator + "test_hawtdb.dat") -//tmpFile.createNewFile() - -def writeSomeData(tmpFile) { - def factory = new PageFileFactory() - factory.file = tmpFile - factory.open() - def pageFile = factory.getPageFile() - MultiIndexFactory multiIndexFactory = new MultiIndexFactory(pageFile); - - BTreeIndexFactory indexFactory = new BTreeIndexFactory() - indexFactory.setKeyCodec(StringCodec.INSTANCE) - - BTreeIndexFactory indexFactory2 = new BTreeIndexFactory() - - - SortedIndex writeIndex = multiIndexFactory.openOrCreate("subscriptions", indexFactory) - SortedIndex retainedIndex = multiIndexFactory.openOrCreate("retained", indexFactory2) - println "Hawt opened, try to read" - println "Size: ${writeIndex.size()}" - - println "write something" - writeIndex.put("titolo", "capucetto rosso") - retainedIndex.put("autore", "leggenda popolare") - pageFile.flush() - - println "check after write content: ${writeIndex.get("titolo")}, size ${writeIndex.size()}" - - //pageFile.close() - factory.close() -} - - -def readAllFileContents(tmpFile) { - def factory = new PageFileFactory() - factory.file = tmpFile - factory.open() - def pageFile = factory.getPageFile() - - MultiIndexFactory multiIndexFactory = new MultiIndexFactory(pageFile); - - IndexFactory indexFactory = new BTreeIndexFactory() - BTreeIndexFactory indexFactory2 = new BTreeIndexFactory() - indexFactory.setKeyCodec(StringCodec.INSTANCE) - - SortedIndex readingIndex = multiIndexFactory.openOrCreate("subscriptions", indexFactory) - SortedIndex retainedIndex = multiIndexFactory.openOrCreate("retained", indexFactory2) - - println "read something, size ${readingIndex.size()}" - for (def entry : readingIndex) { - println "read k, v -> ${entry.key}, ${entry.value} " - } - - for (def entry : retainedIndex) { - println "read k, v -> ${entry.key}, ${entry.value} " - } - - factory.close() -} - - -writeSomeData(tmpFile) -readAllFileContents(tmpFile) - - - - - diff --git a/tools_scripts/integration/hawtdb_play.groovy b/tools_scripts/integration/hawtdb_play.groovy deleted file mode 100644 index 17efe18e..00000000 --- a/tools_scripts/integration/hawtdb_play.groovy +++ /dev/null @@ -1,65 +0,0 @@ -@Grab(group='org.fusesource.hawtdb', module='hawtdb', version='1.6') - -import org.fusesource.hawtbuf.codec.StringCodec -import org.fusesource.hawtdb.api.BTreeIndexFactory -import org.fusesource.hawtdb.api.PageFile -import org.fusesource.hawtdb.api.PageFileFactory -import org.fusesource.hawtdb.api.SortedIndex - - - -File tmpFile = new File(System.getProperty("user.home") + File.separator + "test_hawtdb.dat") -//tmpFile.createNewFile() - -def writeSomeData(tmpFile) { - def factory = new PageFileFactory() - factory.file = tmpFile - factory.open() - def pageFile = factory.getPageFile() - - BTreeIndexFactory indexFactory = new BTreeIndexFactory() - indexFactory.setKeyCodec(StringCodec.INSTANCE) - - SortedIndex writeIndex = indexFactory.openOrCreate(pageFile) - println "Hawt opened, try to read" - println "Size: ${writeIndex.size()}" - - println "write something" - writeIndex.put("titolo", "capucetto rosso") - pageFile.flush() - - println "check after write content: ${writeIndex.get("titolo")}, size ${writeIndex.size()}" - - //pageFile.close() - factory.close() -} - - -def readAllFileContents(tmpFile) { - def factory = new PageFileFactory() - factory.file = tmpFile - factory.open() - def pageFile = factory.getPageFile() - - BTreeIndexFactory indexFactory = new BTreeIndexFactory() - indexFactory.setKeyCodec(StringCodec.INSTANCE) - - SortedIndex readingIndex = indexFactory.openOrCreate(pageFile) - - println "read something, size ${readingIndex.size()}" - for (def entry : readingIndex) { - println "read k, v -> ${entry.key}, ${entry.value} " - } - - factory.close() -} - - -writeSomeData(tmpFile) -readAllFileContents(tmpFile) - - - - - - diff --git a/tools_scripts/integration/hawtdb_raw_access.groovy b/tools_scripts/integration/hawtdb_raw_access.groovy deleted file mode 100644 index 75579f46..00000000 --- a/tools_scripts/integration/hawtdb_raw_access.groovy +++ /dev/null @@ -1,45 +0,0 @@ -@Grab(group='org.fusesource.hawtdb', module='hawtdb', version='1.6') - -import org.fusesource.hawtbuf.codec.StringCodec -import org.fusesource.hawtdb.api.BTreeIndexFactory -import org.fusesource.hawtdb.api.PageFile -import org.fusesource.hawtdb.api.PageFileFactory -import org.fusesource.hawtdb.api.SortedIndex -import org.fusesource.hawtbuf.Buffer - - - -File tmpFile = new File(System.getProperty("user.home") + File.separator + "test_hawtdb.dat") -//tmpFile.createNewFile() - -def writeSomeData(tmpFile) { - def factory = new PageFileFactory() - factory.file = tmpFile - factory.open() - def pageFile = factory.getPageFile() - int pageIdx = pageFile.alloc() - pageFile.write(pageIdx, new Buffer("Test".getBytes())) - println "writed at page index ${pageIdx}" - pageFile.flush() - pageFile.close() -} - - -def readTest(tmpFile) { - def factory = new PageFileFactory() - factory.file = tmpFile - factory.open() - def pageFile = factory.getPageFile() - println "page size is: " + pageFile.pageSize - Buffer b = new Buffer(512) - pageFile.read(0, b) - println "content try read " + b - - pageFile.close() -} - - -writeSomeData(tmpFile) -readTest(tmpFile) - - diff --git a/tools_scripts/integration/sslSimplePublisher.groovy b/tools_scripts/integration/sslSimplePublisher.groovy new file mode 100644 index 00000000..e69de29b