├── .checkstyle ├── .classpath ├── .gitignore ├── .project ├── .settings ├── org.eclipse.jdt.core.prefs └── org.eclipse.jdt.ui.prefs ├── CRAPL-LICENSE ├── LICENSE ├── NOTICE ├── README ├── conf ├── Benchmark.json ├── DataStore │ └── SwiftCloud.json ├── Populator │ └── TPCW.json └── Workload │ ├── TPCWBrowsingMix.json │ ├── TPCWConsistency.json │ ├── TPCWOrderingMix.json │ ├── TPCWShoppingMix.json │ └── backup │ ├── TPCWBrowsingMix.json │ ├── TPCWConsistency.json │ ├── TPCWOrderingMix.json │ └── TPCWShoppingMix.json ├── eval_R ├── Makefile ├── analyze_run.R └── compare_runs.R ├── evaluation ├── legacy │ ├── analysis.R │ ├── analysis_dist_commands.R │ ├── analysis_social.R │ ├── plot-distribution.sh │ ├── plot-social-bycommand.sh │ ├── plot-social.sh │ ├── plot-timeline.sh │ ├── plot.sh │ ├── result-ping-stats.txt │ ├── result-ping-time.pdf │ ├── result-social-commands.pdf │ ├── result-social-stats.txt │ ├── result-social-time.pdf │ ├── social-responsiveness-config-RR-result-social-commands.pdf │ ├── social-responsiveness-config-RR-result-social-time.pdf │ └── social_timeline.R ├── swiftdoc │ └── swiftdoc-patches.zip └── swiftsocial │ ├── create_users.py │ ├── gen_commands_local.py │ └── users.txt ├── jar-build.xml ├── lib ├── core │ ├── kryo-2.24.1.jar │ ├── kryo-LICENSE.txt │ ├── lz4-1.2.0.jar │ ├── minlog-1.2.jar │ ├── netty-all-4.0.20.Final.jar │ ├── objenesis-1.2.jar │ ├── reflectasm-1.09-shaded.jar │ ├── riak-client-1.0.3-jar-with-dependencies.jar │ └── xstream-1.4.3.jar └── extras │ ├── fuse4j-core-2.4.0.0-SNAPSHOT.jar │ ├── junit-4.4.jar │ └── tpcw │ ├── RadixTree-0.3.jar │ ├── colt.jar │ ├── httpclient-4.1.1.jar │ ├── jackson-core-asl-1.7.5.jar │ ├── jackson-mapper-asl-1.7.5.jar │ ├── log4j-1.2.13.jar │ └── zookeeper-3.3.6-fatjar.jar ├── scripts ├── groovy │ └── swift │ │ ├── deployment │ │ ├── Parallel.groovy │ │ ├── SwiftBase.groovy │ │ ├── SwiftSocial.groovy │ │ ├── SwiftSocial2.groovy │ │ ├── SwiftYCSB.groovy │ │ ├── Tools.groovy │ │ ├── Topology.groovy │ │ ├── runclientfailures.groovy │ │ ├── runresponsetimelocality.groovy │ │ ├── runrpcbenchmark.groovy │ │ ├── runscalabilityclients.groovy │ │ ├── runscalabilitydbsize.groovy │ │ ├── runscalabilitythroughput.groovy │ │ ├── runsocial_initdb.groovy │ │ ├── runsocialmanual.groovy │ │ ├── runstaleness.groovy │ │ ├── runycsbmanual.groovy │ │ ├── shutdown.groovy │ │ ├── stale │ │ │ ├── PlanetLab_3X.groovy │ │ │ ├── PlanetLab_3xX.groovy │ │ │ ├── PlanetLab_Europe.groovy │ │ │ ├── SwiftDoc.groovy │ │ │ ├── runSwiftDoc.groovy │ │ │ ├── runsocial2.groovy │ │ │ ├── runsocial4batch.groovy │ │ │ ├── runsocial_batch.groovy │ │ │ ├── runsocial_batch_dc.groovy │ │ │ ├── runsocial_cdf.groovy │ │ │ ├── runsocial_dc_scout.groovy │ │ │ ├── runsocial_dc_scout4batch.groovy │ │ │ ├── runsocial_failover.groovy │ │ │ └── test_runsocial_old.groovy │ │ ├── test_runsocial.groovy │ │ ├── test_runsocial_cluster.groovy │ │ ├── test_runsocial_p2p.groovy │ │ ├── topology_1dcs_30clients_AD.groovy │ │ ├── topology_1dcs_30clients_BD.groovy │ │ ├── topology_1dcs_30clients_C.groovy │ │ ├── topology_1dctest.groovy │ │ ├── topology_3dcs_30clients_A.groovy │ │ ├── topology_3dcs_30clients_B.groovy │ │ ├── topology_3dcs_30clients_C.groovy │ │ ├── topology_3dcs_30clients_D.groovy │ │ ├── topology_6dcs_30clients_A.groovy │ │ ├── topology_6dcs_30clients_B.groovy │ │ ├── topology_6dcs_30clients_C.groovy │ │ ├── topology_6dcs_30clients_D.groovy │ │ ├── topology_6dcs_30clients_TEMPLATE.groovy.inactive │ │ ├── topology_9dcs_30clients_A.groovy │ │ ├── topology_9dcs_30clients_B.groovy │ │ ├── topology_9dcs_30clients_C.groovy │ │ ├── topology_9dcs_30clients_D.groovy │ │ ├── topology_9dcs_30clients_TEMPLATE.groovy.inactive │ │ ├── topology_planetlab.groovy │ │ ├── topology_pool_1dcs_30clients.groovy │ │ ├── topology_pool_3dcs_30clients.groovy │ │ ├── topology_pool_6dcs_30clients.groovy │ │ ├── topology_pool_9dcs_30clients.groovy │ │ └── topology_staleness_3dcs_30clients_1.groovy │ │ └── stats │ │ ├── GnuPlot.groovy │ │ ├── Histogram.groovy │ │ ├── MetadataLogsProcessor.groovy │ │ ├── Series.groovy │ │ ├── Stats.groovy │ │ ├── runsocial_metadata.groovy │ │ ├── runsocial_metadata_raw.groovy │ │ ├── runsocial_performance_vs_latency.groovy │ │ ├── runsocial_staleness.java │ │ └── stale │ │ ├── runsocial_batch_dc.groovy │ │ ├── runsocial_cdf_rr_cached.groovy │ │ ├── runsocial_cdf_si_cached.groovy │ │ ├── runsocial_cdf_snapshop_isolation.groovy │ │ ├── runsocial_clt_performance_vs_latencyW91W99.groovy │ │ ├── runsocial_failover.groovy │ │ ├── runsocial_latency_cdfs.groovy │ │ ├── runsocial_performance_vs_latencyW91.groovy │ │ ├── runsocial_performance_vs_latencyW91_clt.groovy │ │ ├── runsocial_performance_vs_latencyW91_dc.groovy │ │ ├── runsocial_singlecdf.groovy │ │ ├── runsocial_stable_cdf.groovy │ │ ├── runsocial_stable_multicdf.groovy │ │ ├── runsocial_stable_rw_multicdf.groovy │ │ ├── runsocial_stable_rw_singlecdf.groovy │ │ ├── runsocial_stable_singlecdf.groovy │ │ ├── runsocial_stalereads.groovy │ │ ├── runsocial_stalereads2.groovy │ │ ├── runsocial_stalereads_vs_clts.groovy │ │ ├── runsocial_workload_cdf.groovy │ │ └── swiftdocs.groovy └── planetlab │ ├── .gitignore │ ├── CopyJar.sh │ ├── KILL_ALL.sh │ ├── create_users.py │ ├── cs_Filesystem.sh │ ├── cs_runSocial-batch.sh │ ├── cs_runSocial-cdn-4batch.sh │ ├── cs_runSocial-cdn.sh │ ├── cs_runSocial-common-4batch.sh │ ├── cs_runSocial-dc-4batch.sh │ ├── cs_runSocial-dc.sh │ ├── cs_runSocial-osdi-4batch.sh │ ├── cs_runSocial-osdi-dht.sh │ ├── cs_runSocial-osdi.sh │ ├── cs_runSwiftDoc-batch.sh │ ├── cs_runSwiftDoc-cdn.sh │ ├── cs_runSwiftDoc-dc.sh │ ├── cs_runSwiftDoc-osdi.sh │ ├── cs_runSwiftDoc-rdc.sh │ ├── cs_runsocial.sh │ ├── ec2_ping.sh │ ├── gen_commands.py │ ├── gen_commands_local.py │ ├── pl-common.sh │ ├── pl-copy-to.sh │ ├── pl-deploy.sh │ ├── pl-kill.sh │ ├── pl-ping.sh │ ├── pl-run.sh │ ├── pl-start-servers-ds-seq-dht.sh │ ├── pl-start-servers-ds-seq.sh │ ├── pl-start-servers.sh │ ├── runSwiftdoc.sh │ ├── runsocial.sh │ └── test.sh ├── smd-jar-build.xml ├── src-app-test └── swift │ └── application │ └── filesystem │ ├── FilesystemBasicTest.java │ └── fuse │ ├── FilesystemFuseTest.java │ └── FuseOpeenSetterMock.java ├── src-app ├── swift │ └── application │ │ ├── ClientIsolationLevelsStressTest.java │ │ ├── CountingStressTest.java │ │ ├── LocalConcurrencyTest.java │ │ ├── PingSpeedBenchmark.java │ │ ├── PingSpeedTest.java │ │ ├── filesystem │ │ ├── Blob.java │ │ ├── FileBasic.java │ │ ├── FilePaged.java │ │ ├── Filesystem.java │ │ ├── FilesystemBasic.java │ │ ├── FilesystemTest.java │ │ ├── IFile.java │ │ ├── cs │ │ │ ├── SwiftFuseClient.java │ │ │ ├── SwiftFuseServer.java │ │ │ └── proto │ │ │ │ ├── ChmodOperation.java │ │ │ │ ├── ChownOperation.java │ │ │ │ ├── FSyncOperation.java │ │ │ │ ├── FlushOperation.java │ │ │ │ ├── FuseOperationResult.java │ │ │ │ ├── FuseRemoteOperation.java │ │ │ │ ├── FuseResultHandler.java │ │ │ │ ├── GetAttrOperation.java │ │ │ │ ├── GetDirOperation.java │ │ │ │ ├── GetXAttrOperation.java │ │ │ │ ├── LinkOperation.java │ │ │ │ ├── MkdirOperation.java │ │ │ │ ├── MknodOperation.java │ │ │ │ ├── OpenOperation.java │ │ │ │ ├── ReadLinkOperation.java │ │ │ │ ├── ReadOperation.java │ │ │ │ ├── ReleaseOperation.java │ │ │ │ ├── RemoteFuseOperationHandler.java │ │ │ │ ├── RenameOperation.java │ │ │ │ ├── RmdirOperation.java │ │ │ │ ├── StatFsOperation.java │ │ │ │ ├── SymLinkOperation.java │ │ │ │ ├── TruncateOperation.java │ │ │ │ ├── UTimeOperation.java │ │ │ │ ├── UnlinkOperation.java │ │ │ │ └── WriteOperation.java │ │ └── fuse │ │ │ └── FilesystemFuse.java │ │ ├── social │ │ ├── Commands.java │ │ ├── Friend.java │ │ ├── Message.java │ │ ├── NamingScheme.java │ │ ├── StatusMessage.java │ │ ├── SwiftSocialApp.java │ │ ├── SwiftSocialBenchmark.java │ │ ├── SwiftSocialOps.java │ │ ├── User.java │ │ ├── Workload.java │ │ └── cs │ │ │ ├── Reply.java │ │ │ ├── Request.java │ │ │ ├── RequestHandler.java │ │ │ ├── SwiftSocialBenchmarkClient.java │ │ │ └── SwiftSocialBenchmarkServer.java │ │ └── swiftdoc │ │ ├── SwiftDoc.java │ │ ├── SwiftDocBenchmark.java │ │ ├── SwiftDocLineNumberGenerator.java │ │ ├── SwiftDocOps.java │ │ ├── SwiftDocPatchReplay.java │ │ ├── TextLine.java │ │ └── cs │ │ ├── SwiftDocBenchmarkClient.java │ │ ├── SwiftDocBenchmarkServer.java │ │ ├── SwiftDocClient.java │ │ ├── SwiftDocClient2.java │ │ ├── SwiftDocServer.java │ │ └── msgs │ │ ├── AckHandler.java │ │ ├── AppRpcHandler.java │ │ ├── BeginTransaction.java │ │ ├── BulkTransaction.java │ │ ├── CommitTransaction.java │ │ ├── InitScoutServer.java │ │ ├── InsertAtom.java │ │ ├── RemoveAtom.java │ │ ├── ServerACK.java │ │ ├── ServerReply.java │ │ └── SwiftDocRpc.java └── sys │ └── ec2 │ └── ClosestDomain.java ├── src-contrib-extras └── swift │ └── dc │ └── db │ └── DCBerkeleyDBDatabase.java ├── src-contrib ├── com │ └── yahoo │ │ └── ycsb │ │ ├── BasicDB.java │ │ ├── ByteArrayByteIterator.java │ │ ├── ByteIterator.java │ │ ├── Client.java │ │ ├── CommandLine.java │ │ ├── DB.java │ │ ├── DBException.java │ │ ├── DBFactory.java │ │ ├── DBWrapper.java │ │ ├── InputStreamByteIterator.java │ │ ├── RandomByteIterator.java │ │ ├── StringByteIterator.java │ │ ├── TerminatorThread.java │ │ ├── UnknownDBException.java │ │ ├── Utils.java │ │ ├── Workload.java │ │ ├── WorkloadException.java │ │ ├── generator │ │ ├── CachedPoolIntegerGenerator.java │ │ ├── CombinerIntegerGeneratorDecorator.java │ │ ├── ConstantIntegerGenerator.java │ │ ├── CounterGenerator.java │ │ ├── DiscreteGenerator.java │ │ ├── ExponentialGenerator.java │ │ ├── FileGenerator.java │ │ ├── Generator.java │ │ ├── HistogramGenerator.java │ │ ├── HotspotIntegerGenerator.java │ │ ├── IntegerGenerator.java │ │ ├── ScrambledIntegerGeneratorDecorator.java │ │ ├── ScrambledZipfianGenerator.java │ │ ├── SkewedLatestGenerator.java │ │ ├── UniformGenerator.java │ │ ├── UniformIntegerGenerator.java │ │ └── ZipfianGenerator.java │ │ ├── measurements │ │ ├── Measurements.java │ │ ├── OneMeasurement.java │ │ ├── OneMeasurementHistogram.java │ │ ├── OneMeasurementTimeSeries.java │ │ └── exporter │ │ │ ├── JSONMeasurementsExporter.java │ │ │ ├── MeasurementsExporter.java │ │ │ └── TextMeasurementsExporter.java │ │ └── workloads │ │ ├── ConstantOccupancyWorkload.java │ │ └── CoreWorkload.java ├── org │ └── uminho │ │ └── gsd │ │ └── benchmarks │ │ ├── benchmark │ │ ├── BenchmarkExecutor.java │ │ ├── BenchmarkMain.java │ │ ├── BenchmarkMaster.java │ │ ├── BenchmarkNodeID.java │ │ └── BenchmarkSlave.java │ │ ├── dataStatistics │ │ ├── ConcurrentResultHandler.java │ │ ├── PerformanceMeasurement.java │ │ └── ResultHandler.java │ │ ├── generic │ │ ├── BuyingResult.java │ │ ├── Constants.java │ │ ├── entities │ │ │ ├── Address.java │ │ │ ├── Author.java │ │ │ ├── CCXact.java │ │ │ ├── Country.java │ │ │ ├── Customer.java │ │ │ ├── Item.java │ │ │ ├── Order.java │ │ │ ├── OrderLine.java │ │ │ ├── Results.java │ │ │ ├── ShoppingCart.java │ │ │ └── ShoppingCartLine.java │ │ ├── helpers │ │ │ └── NodeKeyGenerator.java │ │ └── workloads │ │ │ ├── ConsistencyTestWorkloadFactory.java │ │ │ ├── ConsistencyWorkloadGenerator.java │ │ │ ├── TPCWWorkloadFactory.java │ │ │ └── TPCWWorkloadGeneration.java │ │ ├── helpers │ │ ├── BenchmarkUtil.java │ │ ├── Constants.java │ │ ├── JsonUtil.java │ │ ├── Pair.java │ │ ├── ProgressBar.java │ │ ├── RiakGenericObject.java │ │ ├── RiakItem.java │ │ ├── SqlReader.java │ │ ├── TPM_counter.java │ │ ├── TestClass.java │ │ ├── ThinkTime.java │ │ ├── Util.java │ │ └── Workload.java │ │ ├── interfaces │ │ ├── Entity.java │ │ ├── KeyGenerator.java │ │ ├── ProbabilityDistribution.java │ │ ├── Workload │ │ │ ├── AbstractWorkloadGeneratorFactory.java │ │ │ ├── Operation.java │ │ │ └── WorkloadGeneratorInterface.java │ │ ├── executor │ │ │ ├── AbstractDatabaseExecutorFactory.java │ │ │ └── DatabaseExecutorInterface.java │ │ └── populator │ │ │ └── AbstractBenchmarkPopulator.java │ │ └── probabilityDistributions │ │ ├── PowerLawDistribution.java │ │ └── ZipfDistribution.java ├── pt │ └── citi │ │ └── cs │ │ └── crdt │ │ └── benchmarks │ │ └── tpcw │ │ ├── database │ │ ├── TPCWSwiftCloudExecutorFactory.java │ │ └── TPCW_SwiftCloud_Executor.java │ │ ├── entities │ │ ├── Address.java │ │ ├── Author.java │ │ ├── AuthorIndex.java │ │ ├── BestSellerEntry.java │ │ ├── CCXactItem.java │ │ ├── Country.java │ │ ├── Customer.java │ │ ├── TPCWNamingScheme.java │ │ └── crdt │ │ │ ├── Item.java │ │ │ ├── Order.java │ │ │ ├── OrderInfo.java │ │ │ ├── OrderLine.java │ │ │ ├── SCLine.java │ │ │ ├── SetAuthorIndexCRDT.java │ │ │ ├── SetBestSellersCRDT.java │ │ │ ├── SetIndexByDateCRDT.java │ │ │ └── ShoppingCart.java │ │ ├── misc │ │ ├── CDFOutputMultipleFile.java │ │ ├── CDFOutputMultipleFileAllOps.java │ │ ├── CDFOutputSingleFile.java │ │ ├── Operations.java │ │ └── TPLATOutput.java │ │ ├── populator │ │ └── SwiftCloudPopulator.java │ │ └── synchronization │ │ ├── MessageSize.java │ │ ├── ScoutOperationManager.java │ │ ├── SimulatedClient.java │ │ ├── SyncPrimitive.java │ │ ├── TPCWRpc.java │ │ └── TPCWRpcHandler.java └── swift │ └── application │ ├── tpcw │ └── TPCWBenchmark.java │ └── ycsb │ ├── AbstractSwiftClient.java │ ├── StringHashMapWrapper.java │ ├── SwiftMapPerKeyClient.java │ ├── SwiftRegisterPerFieldClient.java │ └── SwiftRegisterPerKeyClient.java ├── src-core-bench └── sys │ └── net │ └── impl │ ├── Handler.java │ ├── Reply.java │ ├── Request.java │ ├── RpcClient.java │ ├── RpcClientServer.java │ └── RpcServer.java ├── src-core-test ├── notifications │ ├── Test1.java │ └── Test2.java ├── swift │ ├── clocks │ │ ├── ReturnableTimestampSourceDecoratorTest.java │ │ ├── TimestampMappingTest.java │ │ ├── TimestampTest.java │ │ ├── TripleTimestampTest.java │ │ ├── VersionVectorWithExceptionBasicTest.java │ │ ├── VersionVectorWithExceptionsNewTest.java │ │ └── VersionVectorWithExceptionsTest.java │ └── crdt │ │ ├── AddWinsSetConcurrencyTest.java │ │ ├── AddWinsSetTest.java │ │ ├── DirectoryConcurrencyTest.java │ │ ├── DirectoryTest.java │ │ ├── IntegerConcurrencyTest.java │ │ ├── IntegerTest.java │ │ ├── LWWRegisterConcurrencyTest.java │ │ ├── LWWRegisterTest.java │ │ ├── LowerBoundCounterConcurrencyTest.java │ │ ├── LowerBoundCounterTest.java │ │ ├── ManagedCRDTTest.java │ │ ├── PutOnlyLWWMapConcurrencyTest.java │ │ ├── PutOnlyLWWMapTest.java │ │ ├── SharedLockConcurrencyTest.java │ │ ├── SharedLockTest.java │ │ ├── SwiftTester.java │ │ ├── TxnTester.java │ │ └── UpperBoundCounterTest.java └── sys │ └── stats │ ├── CountingSourceTester.java │ ├── HistogramTester.java │ ├── PollingValueTester1.java │ ├── PollingValueTester2.java │ └── ValueSourceTester.java ├── src-core ├── swift │ ├── client │ │ ├── AbstractObjectUpdatesListener.java │ │ ├── AbstractTxnHandle.java │ │ ├── CoarseCacheStats.java │ │ ├── CommitListener.java │ │ ├── FailOverHandler.java │ │ ├── FineCacheStats.java │ │ ├── LRUObjectsCache.java │ │ ├── RepeatableReadsTxnHandle.java │ │ ├── SnapshotIsolationTxnHandle.java │ │ ├── SwiftImpl.java │ │ ├── SwiftOptions.java │ │ ├── SwiftSessionToScoutAdapter.java │ │ └── TxnManager.java │ ├── clocks │ │ ├── CCIncrementalTimestampGenerator.java │ │ ├── CausalityClock.java │ │ ├── ClockFactory.java │ │ ├── ClockUtils.java │ │ ├── DottedVersionVector.java │ │ ├── IncrementalTimestampGenerator.java │ │ ├── IncrementalTripleTimestampGenerator.java │ │ ├── ReturnableTimestampSourceDecorator.java │ │ ├── Timestamp.java │ │ ├── TimestampMapping.java │ │ ├── TimestampSource.java │ │ ├── TripleTimestamp.java │ │ ├── VersionVector.java │ │ ├── VersionVectorWithExceptions.java │ │ └── VersionVectorWithExceptionsOld.java │ ├── crdt │ │ ├── AbstractAddOnlySetCRDT.java │ │ ├── AbstractAddWinsSetCRDT.java │ │ ├── AbstractLWWRegisterCRDT.java │ │ ├── AbstractPutOnlyLWWMapCRDT.java │ │ ├── AcquireLockUpdate.java │ │ ├── AddOnlySetCRDT.java │ │ ├── AddOnlySetUpdate.java │ │ ├── AddOnlyStringSetCRDT.java │ │ ├── AddOnlyStringSetUpdate.java │ │ ├── AddWinsIdSetCRDT.java │ │ ├── AddWinsIdSetUpdate.java │ │ ├── AddWinsMessageSetCRDT.java │ │ ├── AddWinsMessageSetUpdate.java │ │ ├── AddWinsSetCRDT.java │ │ ├── AddWinsSetUpdate.java │ │ ├── AddWinsSortedSetCRDT.java │ │ ├── AddWinsUtils.java │ │ ├── BloatedIntegerCRDT.java │ │ ├── BloatedIntegerUpdate.java │ │ ├── BoundedCounterCRDT.java │ │ ├── BoundedCounterDecrement.java │ │ ├── BoundedCounterIncrement.java │ │ ├── BoundedCounterTransfer.java │ │ ├── DirectoryCRDT.java │ │ ├── DirectoryCreateUpdate.java │ │ ├── DirectoryRemoveUpdate.java │ │ ├── GetOwnershipUpdate.java │ │ ├── IncompatibleLockException.java │ │ ├── IntegerCRDT.java │ │ ├── IntegerUpdate.java │ │ ├── IntegerValueQuery.java │ │ ├── LWWRegisterCRDT.java │ │ ├── LWWRegisterUpdate.java │ │ ├── LWWStringMapRegisterCRDT.java │ │ ├── LWWStringMapRegisterUpdate.java │ │ ├── LWWStringRegisterCRDT.java │ │ ├── LWWStringRegisterUpdate.java │ │ ├── LWWUserRegisterCRDT.java │ │ ├── LWWUserRegisterUpdate.java │ │ ├── LockType.java │ │ ├── LowerBoundCounterCRDT.java │ │ ├── MapCRDT.java │ │ ├── MaxCRDT.java │ │ ├── MaxUpdate.java │ │ ├── PreferOwnerPolicy.java │ │ ├── PreferenceListPolicy.java │ │ ├── PutOnlyLWWMapCRDT.java │ │ ├── PutOnlyLWWMapUpdate.java │ │ ├── PutOnlyLWWStringMapCRDT.java │ │ ├── PutOnlyLWWStringMapUpdate.java │ │ ├── RegisterValueQuery.java │ │ ├── ReleaseLockUpdate.java │ │ ├── ReleaseOwnershipUpdate.java │ │ ├── SequenceCRDT.java │ │ ├── SequenceInsertUpdate.java │ │ ├── SequenceRemoveUpdate.java │ │ ├── SetLookupQuery.java │ │ ├── SetValueQuery.java │ │ ├── SharedLockCRDT.java │ │ ├── UpperBoundCounterCRDT.java │ │ └── core │ │ │ ├── BaseCRDT.java │ │ │ ├── BulkGetProgressListener.java │ │ │ ├── CRDT.java │ │ │ ├── CRDTIdentifier.java │ │ │ ├── CRDTObjectUpdatesGroup.java │ │ │ ├── CRDTOperationDependencyPolicy.java │ │ │ ├── CRDTQuery.java │ │ │ ├── CRDTUpdate.java │ │ │ ├── CachePolicy.java │ │ │ ├── Copyable.java │ │ │ ├── IsolationLevel.java │ │ │ ├── ManagedCRDT.java │ │ │ ├── ObjectUpdatesListener.java │ │ │ ├── SwiftScout.java │ │ │ ├── SwiftSession.java │ │ │ ├── TxnGetterSetter.java │ │ │ ├── TxnHandle.java │ │ │ └── TxnStatus.java │ ├── dc │ │ ├── CRDTData.java │ │ ├── DCConstants.java │ │ ├── DCDataServer.java │ │ ├── DCSequencerServer.java │ │ ├── DCServer.java │ │ ├── DCSurrogate.java │ │ ├── ExecCRDTResult.java │ │ └── db │ │ │ ├── DCKryoFileDatabase.java │ │ │ ├── DCNodeDatabase.java │ │ │ ├── DCRiakDatabase.java │ │ │ ├── DevNullNodeDatabase.java │ │ │ └── StatsNodeDatabaseWrapper.java │ ├── exceptions │ │ ├── CvRDTSerializationException.java │ │ ├── IncompatibleTypeException.java │ │ ├── NetworkException.java │ │ ├── NoSuchObjectException.java │ │ ├── NotSupportedOperationException.java │ │ ├── SwiftException.java │ │ ├── VersionNotFoundException.java │ │ └── WrongTypeException.java │ ├── proto │ │ ├── BatchCommitUpdatesReply.java │ │ ├── BatchCommitUpdatesRequest.java │ │ ├── BatchFetchObjectVersionReply.java │ │ ├── BatchFetchObjectVersionRequest.java │ │ ├── ClientRequest.java │ │ ├── CommitTSReply.java │ │ ├── CommitTSRequest.java │ │ ├── CommitUpdatesReply.java │ │ ├── CommitUpdatesRequest.java │ │ ├── DHTExecCRDT.java │ │ ├── DHTExecCRDTReply.java │ │ ├── DHTGetCRDT.java │ │ ├── DHTGetCRDTReply.java │ │ ├── GenerateDCTimestampReply.java │ │ ├── GenerateDCTimestampRequest.java │ │ ├── LatestKnownClockReply.java │ │ ├── LatestKnownClockRequest.java │ │ ├── MetadataSamplable.java │ │ ├── MetadataStatsCollector.java │ │ ├── ObjectUpdatesInfo.java │ │ ├── PingReply.java │ │ ├── PingRequest.java │ │ ├── PubSubHandshake.java │ │ ├── PubSubHandshakeReply.java │ │ ├── SeqCommitUpdatesReply.java │ │ ├── SeqCommitUpdatesRequest.java │ │ ├── SwiftProtocolHandler.java │ │ ├── UnsubscribeUpdatesReply.java │ │ └── UnsubscribeUpdatesRequest.java │ ├── pubsub │ │ ├── BatchUpdatesNotification.java │ │ ├── CommitNotification.java │ │ ├── DataServerPubSubService.java │ │ ├── FifoQueues.java │ │ ├── ScoutPubSubService.java │ │ ├── SurrogatePubSubService.java │ │ ├── SwiftSubscriber.java │ │ └── UpdateNotification.java │ ├── test │ │ └── microbenchmark │ │ │ ├── AggregateRawDataCollector.java │ │ │ ├── BenchOperation.java │ │ │ ├── BenchUtil.java │ │ │ ├── CompleteRawDataCollector.java │ │ │ ├── MicroBenchmark.java │ │ │ ├── OpType.java │ │ │ ├── RawDataCollector.java │ │ │ ├── RiakExecutorWorker.java │ │ │ ├── RiakInitializerWorker.java │ │ │ ├── RiakMicroBenchmark.java │ │ │ ├── SerializerTester.java │ │ │ ├── SwiftExecutorWorker.java │ │ │ ├── SwiftInitializerWorker.java │ │ │ ├── SwiftMicroBenchmark.java │ │ │ ├── interfaces │ │ │ ├── MicroBenchmarkWorker.java │ │ │ ├── ResultHandler.java │ │ │ └── WorkerManager.java │ │ │ └── objects │ │ │ └── StringCopyable.java │ └── utils │ │ ├── DatabaseSizeStats.java │ │ ├── DummyLog.java │ │ ├── FutureResult.java │ │ ├── FutureResultHandler.java │ │ ├── KryoCRDTUtils.java │ │ ├── KryoDiskLog.java │ │ ├── NanoTimeCollector.java │ │ ├── NoFlushLogDecorator.java │ │ ├── Pair.java │ │ ├── PrettyPrint.java │ │ ├── SafeLog.java │ │ └── TransactionsLog.java └── sys │ ├── RpcServices.java │ ├── Sys.java │ ├── dht │ ├── DHT_Node.java │ ├── Node.java │ └── OrdinalDB.java │ ├── herd │ ├── Herd.java │ ├── Shepard.java │ └── proto │ │ ├── GrazingAccepted.java │ │ ├── GrazingGranted.java │ │ ├── GrazingRequest.java │ │ ├── HerdProtoHandler.java │ │ ├── HerdQueryReply.java │ │ ├── HerdQueryRequest.java │ │ ├── JoinHerdReply.java │ │ ├── JoinHerdRequest.java │ │ └── ShepardProtoHandler.java │ ├── net │ ├── api │ │ ├── Endpoint.java │ │ ├── Message.java │ │ ├── MessageHandler.java │ │ ├── Networking.java │ │ ├── NetworkingException.java │ │ ├── Serializer.java │ │ ├── SerializerException.java │ │ ├── TransportConnection.java │ │ └── rpc │ │ │ ├── AbstractRpcHandler.java │ │ │ ├── RpcEndpoint.java │ │ │ ├── RpcFactory.java │ │ │ ├── RpcHandle.java │ │ │ ├── RpcHandler.java │ │ │ └── RpcMessage.java │ └── impl │ │ ├── AbstractEndpoint.java │ │ ├── AbstractLocalEndpoint.java │ │ ├── AbstractMessage.java │ │ ├── DefaultMessageHandler.java │ │ ├── FailedTransportConnection.java │ │ ├── KryoLib.java │ │ ├── KryoSerializer.java │ │ ├── LocalEndpoint.java │ │ ├── Lz4Lib.java │ │ ├── NetworkingConstants.java │ │ ├── NetworkingImpl.java │ │ ├── RemoteEndpoint.java │ │ ├── providers │ │ ├── AbstractTransport.java │ │ ├── InitiatorInfo.java │ │ ├── RemoteEndpointUpdater.java │ │ ├── inproc │ │ │ └── InProcEndpoint.java │ │ ├── lz4_oio │ │ │ └── TcpEndpoint.java │ │ ├── netty │ │ │ └── TcpEndpoint.java │ │ └── oio │ │ │ └── TcpEndpoint.java │ │ └── rpc │ │ ├── AbstractRpcPacket.java │ │ ├── RpcFactoryImpl.java │ │ └── RpcPacket.java │ ├── pubsub │ ├── PubSub.java │ ├── PubSubNotification.java │ ├── RemoteSubscriber.java │ └── impl │ │ ├── AbstractPubSub.java │ │ └── AbstractSubscriber.java │ ├── riak │ └── Riak.java │ ├── scheduler │ ├── CustomPriorityQueue.java │ ├── PeriodicTask.java │ ├── RT_Scheduler.java │ ├── Task.java │ ├── TaskOwner.java │ ├── TaskScheduler.java │ ├── Token.java │ └── VT_Scheduler.java │ ├── stats │ ├── ClosedStatsException.java │ ├── DummyStats.java │ ├── RpcStats.java │ ├── Stats.java │ ├── StatsConstants.java │ ├── StatsImpl.java │ ├── common │ │ ├── PlaneValue.java │ │ └── PlotValues.java │ ├── output │ │ ├── BufferedFileDumper.java │ │ ├── HistogramOutput.java │ │ ├── StatisticsOutput.java │ │ └── ValuesOutput.java │ ├── overtime │ │ ├── CounterOverTime.java │ │ ├── FixedRateValueOverTime.java │ │ ├── GenericStatisticsOverTime.java │ │ ├── HistogramOverTime.java │ │ └── ValueOverTime.java │ ├── sliced │ │ ├── SlicedStatistics.java │ │ └── slices │ │ │ ├── CounterImpl.java │ │ │ ├── ValueImpl.java │ │ │ └── histogram │ │ │ ├── CommDistributionImpl.java │ │ │ └── Histogram.java │ └── sources │ │ ├── CounterSignalSource.java │ │ ├── PollingBasedValueProvider.java │ │ └── ValueSignalSource.java │ └── utils │ ├── Args.java │ ├── ConcurrentHashSet.java │ ├── FifoQueue.java │ ├── FileUtils.java │ ├── IO.java │ ├── IP.java │ ├── Progress.java │ ├── Props.java │ ├── SlidingIntSet.java │ ├── SysLogConsoleHandler.java │ ├── Threading.java │ ├── Timings.java │ └── XmlExternalizable.java ├── stuff ├── all_logging.properties ├── checkstyle.xml ├── deployment_logging.properties ├── formatter.xml └── logging.properties ├── swiftadservice-test.props ├── swiftsocial-test.props └── ycsb ├── workloads ├── workloada ├── workloada-test ├── workloadb ├── workloadc ├── workloadd ├── workloade └── workloadf ├── ycsb └── ycsb.sh /.checkstyle: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | bin 2 | swiftcloud*.jar 3 | org.eclipse.jdt.internal.junit.runner.RemoteTestRunner@*stats.xml 4 | planetlab-key* 5 | swiftcloud.pub 6 | swiftcloud.pem 7 | /swiftsocial-test.props 8 | /stuff 9 | /results 10 | /kryoDB-data.db 11 | /kryoDB-seq.db 12 | /.settings 13 | /.gitignore 14 | statistics* 15 | teste/ 16 | tmp/ 17 | **/Rplots.pdf 18 | /db 19 | bin.orig/ 20 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | SwiftCloud 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | net.sf.eclipsecs.core.CheckstyleBuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | net.sf.eclipsecs.core.CheckstyleNature 22 | 23 | 24 | -------------------------------------------------------------------------------- /.settings/org.eclipse.jdt.ui.prefs: -------------------------------------------------------------------------------- 1 | #Mon Feb 27 07:44:32 CET 2012 2 | eclipse.preferences.version=1 3 | formatter_profile=_SwiftProfile 4 | formatter_settings_version=11 5 | -------------------------------------------------------------------------------- /conf/DataStore/SwiftCloud.json: -------------------------------------------------------------------------------- 1 | { 2 | "DataBaseInfo":{ 3 | "keyspace":"Tpcw" 4 | }, 5 | "DataBaseConnections":{ 6 | "localhost":"9999" 7 | }, 8 | "Configuration":{ 9 | "retrievedRowSlices":"1000" 10 | }, 11 | "ConsistencyLevels":{ 12 | "ISOLATION_LEVEL":"SNAPSHOT_ISOLATION", 13 | "CACHE_POLICY":"MOST_RECENT" 14 | }, 15 | "ScoutsResultPath":{ 16 | "path":"./Results/" 17 | }, 18 | "ColumnPaths":{ 19 | "OrderLines":"OL_O_ID", 20 | "ShoppingCart":"KEY_SHOPPING_CART", 21 | "results":"CLIENT_ID" 22 | }, 23 | "OtherConnections":{ 24 | }, 25 | "Replication":{ 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /conf/Populator/TPCW.json: -------------------------------------------------------------------------------- 1 | { 2 | "BenchmarkPopulator":{ 3 | "name":"TPCW_POPULATOR", 4 | "thread_number":"1", 5 | "delay_inserts":"true", 6 | "delay_time":"1000", 7 | "result_path":"/tmp/tpcw/Results/populating", 8 | "tpcw_numEBS":"1", 9 | "tpcw_numItems":"10000" 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /conf/Workload/TPCWBrowsingMix.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration":{ 3 | "name":"TPCW_BROWSING_WORKLOAD", 4 | "initialStock":"500000", 5 | "resultPath":"../Results/browsing" 6 | }, 7 | "ProbabilityDistributions":{ 8 | "Distribution":"org.uminho.gsd.benchmarks.probabilityDistributions.PowerLawDistribution", 9 | "alpha":"2.0" 10 | }, 11 | "Workload":{ 12 | "home":"29.00", 13 | "new_products":"11.00", 14 | "best_sellers":"11.00", 15 | "product_detail":"21.19", 16 | "search":"23.00", 17 | "shoppingCart":"2.00", 18 | "register/login":"0.82", 19 | "buy_request":"0.75", 20 | "buy_confirm":"0.69", 21 | "order_inquiry":"0.55", 22 | "admin_change":"0.0", 23 | "itemSetSize":"20", 24 | "itemRepetitionFrequency":"0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /conf/Workload/TPCWConsistency.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "Configuration":{ 4 | "name":"TPCW_CONSISTENCY_WORKLOAD", 5 | "initialStock":"500000", 6 | "resultPath":"../Results/Consistency" 7 | }, 8 | "ProbabilityDistributions":{ 9 | "Distribution":"org.uminho.gsd.benchmarks.probabilityDistributions.PowerLawDistribution", 10 | "skew":"1.2" 11 | }, 12 | "Workload":{ 13 | } 14 | } -------------------------------------------------------------------------------- /conf/Workload/TPCWOrderingMix.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration":{ 3 | "name":"TPCW_ORDERING_WORKLOAD", 4 | "initialStock":"500000", 5 | "resultPath":"../Results/ordering" 6 | }, 7 | "ProbabilityDistributions":{ 8 | "Distribution":"org.uminho.gsd.benchmarks.probabilityDistributions.PowerLawDistribution", 9 | "alpha":"2.0" 10 | }, 11 | "Workload":{ 12 | "home":"9.12", 13 | "new_products":"0.46", 14 | "best_sellers":"0.46", 15 | "product_detail":"12.58", 16 | "search":"27.61", 17 | "shoppingCart":"13.53", 18 | "register/login":"12.86", 19 | "buy_request":"12.73", 20 | "buy_confirm":"10.18", 21 | "order_inquiry":"0.47", 22 | "admin_change": "0.00" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /conf/Workload/TPCWShoppingMix.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration":{ 3 | "name":"TPCW_SHOPPING_WORKLOAD", 4 | "initialStock":"500000", 5 | "resultPath":"../Results/shopping" 6 | }, 7 | "ProbabilityDistributions":{ 8 | "Distribution":"org.uminho.gsd.benchmarks.probabilityDistributions.PowerLawDistribution", 9 | "alpha":"2.0" 10 | }, 11 | "Workload":{ 12 | "home":"16.00", 13 | "new_products":"5.00", 14 | "best_sellers":"5.00", 15 | "product_detail":"17.19", 16 | "search":"37.00", 17 | "shoppingCart":"11.60", 18 | "register/login":"3.0", 19 | "buy_request":"2.60", 20 | "buy_confirm":"1.20", 21 | "order_inquiry":"1.41", 22 | "admin_change":"0.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /conf/Workload/backup/TPCWBrowsingMix.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration":{ 3 | "name":"TPCW_BROWSING_WORKLOAD", 4 | "initialStock":"500000", 5 | "resultPath":"../Results/browsing" 6 | }, 7 | "ProbabilityDistributions":{ 8 | "Distribution":"org.uminho.gsd.benchmarks.probabilityDistributions.PowerLawDistribution", 9 | "alpha":"2.0" 10 | }, 11 | "Workload":{ 12 | "home":"29.00", 13 | "new_products":"11.00", 14 | "best_sellers":"11.00", 15 | "product_detail":"21.00", 16 | "search":"23.00", 17 | "shoppingCart":"2.00", 18 | "register/login":"0.82", 19 | "buy_request":"0.75", 20 | "buy_confirm":"0.69", 21 | "order_inquiry":"0.55", 22 | "admin_change":"0.19", 23 | "itemSetSize":"20", 24 | "itemRepetitionFrequency":"0" 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /conf/Workload/backup/TPCWConsistency.json: -------------------------------------------------------------------------------- 1 | { 2 | 3 | "Configuration":{ 4 | "name":"TPCW_CONSISTENCY_WORKLOAD", 5 | "initialStock":"500000", 6 | "resultPath":"../Results/Consistency" 7 | }, 8 | "ProbabilityDistributions":{ 9 | "Distribution":"org.uminho.gsd.benchmarks.probabilityDistributions.PowerLawDistribution", 10 | "skew":"1.2" 11 | }, 12 | "Workload":{ 13 | } 14 | } -------------------------------------------------------------------------------- /conf/Workload/backup/TPCWOrderingMix.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration":{ 3 | "name":"TPCW_ORDERING_WORKLOAD", 4 | "initialStock":"500000", 5 | "resultPath":"../Results/ordering" 6 | }, 7 | "ProbabilityDistributions":{ 8 | "Distribution":"org.uminho.gsd.benchmarks.probabilityDistributions.PowerLawDistribution", 9 | "alpha":"2.0" 10 | }, 11 | "Workload":{ 12 | "home":"9.12", 13 | "new_products":"0.46", 14 | "best_sellers":"0.46", 15 | "product_detail":"12.35", 16 | "search":"27.61", 17 | "shoppingCart":"13.53", 18 | "register/login":"12.86", 19 | "buy_request":"12.73", 20 | "buy_confirm":"10.18", 21 | "order_inquiry":"0.47", 22 | "admin_change": "0.23" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /conf/Workload/backup/TPCWShoppingMix.json: -------------------------------------------------------------------------------- 1 | { 2 | "Configuration":{ 3 | "name":"TPCW_SHOPPING_WORKLOAD", 4 | "initialStock":"500000", 5 | "resultPath":"../Results/shopping" 6 | }, 7 | "ProbabilityDistributions":{ 8 | "Distribution":"org.uminho.gsd.benchmarks.probabilityDistributions.PowerLawDistribution", 9 | "alpha":"2.0" 10 | }, 11 | "Workload":{ 12 | "home":"16.00", 13 | "new_products":"5.00", 14 | "best_sellers":"5.00", 15 | "product_detail":"17.19", 16 | "search":"37.00", 17 | "shoppingCart":"11.60", 18 | "register/login":"3.0", 19 | "buy_request":"2.60", 20 | "buy_confirm":"1.20", 21 | "order_inquiry":"1.41", 22 | "admin_change":"0.0" 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /eval_R/Makefile: -------------------------------------------------------------------------------- 1 | RUNS=$(wildcard *.tar.gz) 2 | RESULTS_DIR=processed 3 | # TODO: add -meta*.csv too 4 | RUN_SUMMARIZED=$(addprefix $(RESULTS_DIR)/,$(RUNS:.tar.gz=-ops.csv)) 5 | 6 | EVAL_R_DIR=/home/zawir/code/swiftcloud/eval_R 7 | RSCRIPT_RUN=Rscript $(EVAL_R_DIR)/analyze_run.R 8 | is_file_synced=dropbox filestatus $(1) | grep -q "up to date" 9 | 10 | all: $(RUN_SUMMARIZED) 11 | 12 | # TODO add SPECTROGRAM only mode 13 | 14 | $(RESULTS_DIR)/%-ops.csv: %.tar.gz 15 | $(call is_file_synced,$<) && $(RSCRIPT_RUN) all $< 16 | 17 | clean: 18 | rm -Rf $(RESULTS_DIR) 19 | 20 | .PHONY: clean 21 | 22 | -------------------------------------------------------------------------------- /evaluation/legacy/analysis.R: -------------------------------------------------------------------------------- 1 | path <- "/Users/annettebieniusa/Documents/workspace/SwiftCloud/results/"; 2 | fname <- "result-ping-"; 3 | f <- paste(path,fname,sep=""); 4 | 5 | for (type in c("REPEATABLE_READS-CACHED-true","REPEATABLE_READS-MOST_RECENT-false","REPEATABLE_READS-STRICTLY_MOST_RECENT-false")) { 6 | outname <- paste(f,"stats.txt",sep=""); 7 | out <- file(outname,"a+"); 8 | 9 | infile <- paste(f,type,".log",sep=""); 10 | data <- read.table(infile); 11 | line <- c(type,median(data$V1),mean(data$V1),sd(data$V1),median(data$V1)-sd(data$V1),median(data$V1)+sd(data$V1)); 12 | cat(line,file=out,sep=" "); 13 | flush(out); 14 | cat("\n",file=out); 15 | 16 | close(out); 17 | } -------------------------------------------------------------------------------- /evaluation/legacy/plot-distribution.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | name=social-session-distribution 3 | data=result-social-cummulative.txt 4 | 5 | grun=${name}-time.gp 6 | epsrun=${name}-time.eps 7 | 8 | 9 | echo "set term postscript eps enhanced color 22" > ${grun} 10 | echo "set output \"${epsrun}\"" >> ${grun} 11 | echo "set size 1.1,1" >> ${grun} 12 | echo "set key left" >> ${grun} 13 | echo "set xlabel \"Duration [ms]\"" >> ${grun} 14 | echo "set ylabel \"% of operations\"" >> ${grun} 15 | echo "set pointsize 3" >> ${grun} 16 | echo "set style data histograms" >> ${grun} 17 | echo "unset xtics" >> ${grun} 18 | echo "set xtics nomirror rotate by -45 scale 2 font \",18\"" >> ${grun} 19 | 20 | echo "set yrange [0:1]" >> ${grun} 21 | #echo "set style histogram errorbars linewidth 3 gap 4" >> ${grun} 22 | echo "set style histogram cluster gap 1" >>${grun} 23 | echo "set boxwidth 1.00 relative" >> ${grun} 24 | 25 | echo "set style fill solid border -1" >> ${grun} 26 | echo "set bars front" >> ${grun} 27 | echo -n "plot \"${data}\" using 2 t \"STATUS\" fs pattern 1, '' using 2 t \"POST\" fs pattern 2,'' using 3 t \"FRIEND\" fs pattern 5, '' using 2 t \"READ\" fs pattern 4,'' using 5:xtic(1) t \"SEE-FRIENDS\" " >> ${grun} 28 | 29 | 30 | 31 | 32 | gnuplot ${grun} 33 | epstopdf ${epsrun} 34 | 35 | -------------------------------------------------------------------------------- /evaluation/legacy/plot-social-bycommand.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | name=social-responsiveness-config-RR-result-social 3 | data=$name-stats.txt 4 | 5 | grun=${name}-commands.gp 6 | epsrun=${name}-commands.eps 7 | 8 | #set boxwidth 0.75 absolute 9 | 10 | echo "set term postscript eps enhanced color 22" > ${grun} 11 | echo "set output \"${epsrun}\"" >> ${grun} 12 | echo "set size 1,1.1" >> ${grun} 13 | echo "set xlabel \"Setting\"" >> ${grun} 14 | echo "set ylabel \"Time [ms]\"" >> ${grun} 15 | echo "set pointsize 3" >> ${grun} 16 | echo "set key invert reverse left" >> ${grun} 17 | 18 | echo "set style data histograms" >> ${grun} 19 | echo "unset xtics" >> ${grun} 20 | echo "set xtics nomirror rotate by -45 scale 0 font \",18\"" >> ${grun} 21 | echo "set key outside right top vertical Left reverse noenhanced autotitles columnhead nobox" >> ${grun} 22 | 23 | 24 | echo "set yrange [0:]" >> ${grun} 25 | echo "set style histogram rowstacked title offset character 0, 0, 0" >> ${grun} 26 | echo "set style fill solid border -1" >> ${grun} 27 | echo "set boxwidth 0.75 relative" >> ${grun} 28 | 29 | echo "i=5" >> ${grun} 30 | echo -n "plot \"${data}\" using 9 fs pattern 1, '' using 6 fs pattern 2,'' using 3 fs pattern 5, '' using 7 fs pattern 4,'' using 8:xtic(10)" >> ${grun} 31 | 32 | gnuplot ${grun} 33 | epstopdf ${epsrun} 34 | 35 | -------------------------------------------------------------------------------- /evaluation/legacy/plot-social.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | name=social-responsiveness-config-RR-result-social 3 | data=$name-stats.txt 4 | 5 | grun=${name}-time.gp 6 | epsrun=${name}-time.eps 7 | 8 | 9 | echo "set term postscript eps enhanced color 22" > ${grun} 10 | echo "set output \"${epsrun}\"" >> ${grun} 11 | echo "set size 1.1,1" >> ${grun} 12 | echo "set xlabel \"Setting\"" >> ${grun} 13 | echo "set ylabel \"Time [ms]\"" >> ${grun} 14 | echo "set pointsize 3" >> ${grun} 15 | echo "set style data histograms" >> ${grun} 16 | echo "unset xtics" >> ${grun} 17 | echo "set xtics nomirror rotate by -45 scale 2 font \",18\"" >> ${grun} 18 | 19 | echo "set yrange [0:]" >> ${grun} 20 | echo "set style histogram errorbars linewidth 3 gap 4" >> ${grun} 21 | 22 | echo "set boxwidth 2.00 relative" >> ${grun} 23 | 24 | echo "set style fill solid border -1" >> ${grun} 25 | echo "set bars front" >> ${grun} 26 | echo -n "plot \"${data}\" every ::1 using 11:2:xtic(10) notitle" >> ${grun} 27 | 28 | gnuplot ${grun} 29 | epstopdf ${epsrun} 30 | 31 | -------------------------------------------------------------------------------- /evaluation/legacy/plot-timeline.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | data1=social-timeline-cached.txt 3 | data2=social-timeline-notcached.txt 4 | 5 | name=social-session 6 | grun=${name}-timeline.gp 7 | epsrun=${name}-timeline.eps 8 | 9 | 10 | echo "set term postscript eps enhanced color 22" > ${grun} 11 | echo "set output \"${epsrun}\"" >> ${grun} 12 | echo "set size 1.1,1" >> ${grun} 13 | echo "set xlabel \"Setting\"" >> ${grun} 14 | echo "set ylabel \"Time [ms]\"" >> ${grun} 15 | #echo "set pointsize 3" >> ${grun} 16 | #echo "set style data histograms" >> ${grun} 17 | echo "unset xtics" >> ${grun} 18 | #echo "set xtics nomirror rotate by -45 scale 2 font \",18\"" >> ${grun} 19 | 20 | echo "set yrange [0:]" >> ${grun} 21 | #echo "set style histogram errorbars linewidth 3 gap 4" >> ${grun} 22 | 23 | echo -n "plot \"${data1}\" every ::3::500 using 5:4 with lines,\"${data2}\" every ::3::500 using 5:4 with lines" >> ${grun} 24 | 25 | gnuplot ${grun} 26 | epstopdf ${epsrun} 27 | 28 | -------------------------------------------------------------------------------- /evaluation/legacy/plot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | name=result-ping 3 | data=$name-stats.txt 4 | 5 | grun=${name}-time.gp 6 | epsrun=${name}-time.eps 7 | 8 | echo "set term postscript eps enhanced color 22" > ${grun} 9 | echo "set output \"${epsrun}\"" >> ${grun} 10 | echo "set size 1,1.1" >> ${grun} 11 | echo "set xlabel \"Setting\"" >> ${grun} 12 | echo "set ylabel \"Time [ms]\"" >> ${grun} 13 | echo "set pointsize 3" >> ${grun} 14 | 15 | echo "set style data histograms" >> ${grun} 16 | echo "unset xtics" >> ${grun} 17 | echo "set xtics nomirror rotate by -45 scale 0 " >> ${grun} 18 | 19 | echo "set yrange [0:]" >> ${grun} 20 | echo "set style histogram errorbars linewidth 3 gap 1" >> ${grun} 21 | echo "set style fill solid 0.3 border -1" >> ${grun} 22 | echo "set bars front" >> ${grun} 23 | echo -n "plot \"${data}\" using 3:6:7:xtic(1) notitle" >> ${grun} 24 | 25 | gnuplot ${grun} 26 | epstopdf ${epsrun} 27 | 28 | -------------------------------------------------------------------------------- /evaluation/legacy/result-ping-stats.txt: -------------------------------------------------------------------------------- 1 | setting-1 REPEATABLE_READS-CACHED-true 495 501 27.1939368992728 467.806063100727 522.193936899273 2 | setting-2 REPEATABLE_READS-MOST_RECENT-false 621 625.888888888889 62.225050551203 558.774949448797 683.225050551203 3 | setting-3 REPEATABLE_READS-STRICTLY_MOST_RECENT-false 714 711.868686868687 71.236405285879 642.763594714121 785.236405285879 4 | roundtrip PING -------------------------------------------------------------------------------- /evaluation/legacy/result-ping-time.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/evaluation/legacy/result-ping-time.pdf -------------------------------------------------------------------------------- /evaluation/legacy/result-social-commands.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/evaluation/legacy/result-social-commands.pdf -------------------------------------------------------------------------------- /evaluation/legacy/result-social-stats.txt: -------------------------------------------------------------------------------- 1 | 868 255.394302990494 17.0909090909091 514.12 18.4473684210526 11.0291411042945 7.1904761904762 15 REPEATABLE_READS-STRICTLY_MOST_RECENT-false-60000-false-1000 EU .ec2-176-34-221-41.eu-west-1.compute.amazonaws.com 2 | 3312.96 369.228303357151 134.181818181818 597.36 134.9 81.8305847076462 60.6666666666667 112.333333333333 REPEATABLE_READS-STRICTLY_MOST_RECENT-false-60000-false-1000 US .ec2-184-72-10-67.us-west-1.compute.amazonaws.com 3 | -------------------------------------------------------------------------------- /evaluation/legacy/result-social-time.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/evaluation/legacy/result-social-time.pdf -------------------------------------------------------------------------------- /evaluation/legacy/social-responsiveness-config-RR-result-social-commands.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/evaluation/legacy/social-responsiveness-config-RR-result-social-commands.pdf -------------------------------------------------------------------------------- /evaluation/legacy/social-responsiveness-config-RR-result-social-time.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/evaluation/legacy/social-responsiveness-config-RR-result-social-time.pdf -------------------------------------------------------------------------------- /evaluation/legacy/social_timeline.R: -------------------------------------------------------------------------------- 1 | data <- read.table("/Users/annettebieniusa/Documents/workspace/SwiftCloud/results/social-responsiveness-config-RR-4/result-social-REPEATABLE_READS-CACHED-true-120000-true-1000.log.ec2-122-248-226-204.ap-southeast-1.compute.amazonaws.com",header = TRUE, sep = ","); 2 | 3 | session <- subset(data,data$session_id==1); 4 | write.table(session,"/Users/annettebieniusa/Documents/workspace/SwiftCloud/results/social-timeline-cached.txt",sep = " "); 5 | 6 | data2 <- read.table("/Users/annettebieniusa/Documents/workspace/SwiftCloud/results/social-responsiveness-config-RR-1/result-social-REPEATABLE_READS-STRICTLY_MOST_RECENT-false-120000-false-1000.log.ec2-122-248-226-204.ap-southeast-1.compute.amazonaws.com",header = TRUE, sep = ","); 7 | 8 | session2 <- subset(data2,data2$session_id==1); 9 | write.table(session2,"/Users/annettebieniusa/Documents/workspace/SwiftCloud/results/social-timeline-notcached.txt",sep = " "); -------------------------------------------------------------------------------- /evaluation/swiftdoc/swiftdoc-patches.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/evaluation/swiftdoc/swiftdoc-patches.zip -------------------------------------------------------------------------------- /evaluation/swiftsocial/create_users.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Generate a command file for adding bogus users to a file 3 | # TODO: CLARIFY LICENSING: THIS SCRIPT COMES FROM WALTER PAPER PUBLISHED IN OSDI 2011 4 | 5 | import sys, os, base64, hashlib 6 | 7 | def main(): 8 | numUsers=0 9 | 10 | if (len(sys.argv) != 2 and len(sys.argv) != 3): 11 | print "Usage ", sys.argv[0]," []" 12 | sys.exit() 13 | 14 | numUsers = int(sys.argv[1]) 15 | 16 | if len(sys.argv) == 3: 17 | outFile = sys.argv[2] 18 | f = open(outFile, 'w') 19 | else: 20 | f = sys.stdout 21 | 22 | print "Start with generation..." 23 | 24 | for i in range(0, numUsers): 25 | name = base64.b64encode(os.urandom(6)) 26 | m = hashlib.md5() 27 | m.update(name) 28 | hex_oid = int(m.hexdigest()[0:16], 16) 29 | # verify that the name is in the range 30 | f.write('usr_add;{0};passwd;"{0} {0}son";01/01/01;"";\n'.format(name)) 31 | 32 | print "Finished creating", numUsers, "users." 33 | if len(sys.argv) == 3: 34 | print "Result in:", sys.argv[2] 35 | 36 | if __name__ == "__main__": 37 | main() 38 | -------------------------------------------------------------------------------- /jar-build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /lib/core/kryo-2.24.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/core/kryo-2.24.1.jar -------------------------------------------------------------------------------- /lib/core/kryo-LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008, Nathan Sweet 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 5 | 6 | * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 7 | * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 8 | * Neither the name of Esoteric Software nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. 9 | 10 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 11 | 12 | -------------------------------------------------------------------------------- /lib/core/lz4-1.2.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/core/lz4-1.2.0.jar -------------------------------------------------------------------------------- /lib/core/minlog-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/core/minlog-1.2.jar -------------------------------------------------------------------------------- /lib/core/netty-all-4.0.20.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/core/netty-all-4.0.20.Final.jar -------------------------------------------------------------------------------- /lib/core/objenesis-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/core/objenesis-1.2.jar -------------------------------------------------------------------------------- /lib/core/reflectasm-1.09-shaded.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/core/reflectasm-1.09-shaded.jar -------------------------------------------------------------------------------- /lib/core/riak-client-1.0.3-jar-with-dependencies.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/core/riak-client-1.0.3-jar-with-dependencies.jar -------------------------------------------------------------------------------- /lib/core/xstream-1.4.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/core/xstream-1.4.3.jar -------------------------------------------------------------------------------- /lib/extras/fuse4j-core-2.4.0.0-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/extras/fuse4j-core-2.4.0.0-SNAPSHOT.jar -------------------------------------------------------------------------------- /lib/extras/junit-4.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/extras/junit-4.4.jar -------------------------------------------------------------------------------- /lib/extras/tpcw/RadixTree-0.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/extras/tpcw/RadixTree-0.3.jar -------------------------------------------------------------------------------- /lib/extras/tpcw/colt.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/extras/tpcw/colt.jar -------------------------------------------------------------------------------- /lib/extras/tpcw/httpclient-4.1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/extras/tpcw/httpclient-4.1.1.jar -------------------------------------------------------------------------------- /lib/extras/tpcw/jackson-core-asl-1.7.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/extras/tpcw/jackson-core-asl-1.7.5.jar -------------------------------------------------------------------------------- /lib/extras/tpcw/jackson-mapper-asl-1.7.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/extras/tpcw/jackson-mapper-asl-1.7.5.jar -------------------------------------------------------------------------------- /lib/extras/tpcw/log4j-1.2.13.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/extras/tpcw/log4j-1.2.13.jar -------------------------------------------------------------------------------- /lib/extras/tpcw/zookeeper-3.3.6-fatjar.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SyncFree/SwiftCloud/ff87f80412211d2ac3647f27b016ba7f62b4dd0d/lib/extras/tpcw/zookeeper-3.3.6-fatjar.jar -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/runclientfailures.groovy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | //usr/bin/env groovy -classpath .:scripts/groovy "$0" $@; exit $? 3 | 4 | package swift.deployment 5 | 6 | import static swift.deployment.SwiftYCSB.* 7 | import static swift.deployment.Tools.* 8 | import static swift.deployment.Topology.*; 9 | 10 | if (args.length < 5) { 11 | System.err.println "usage: runclientfailures.groovy " 12 | System.exit(1) 13 | } 14 | 15 | // TOPOLOGY CONFIGURATION 16 | topologyDef = new File(args[0]) 17 | println "==== Loading topology definition from file " + topologyDef + "====" 18 | evaluate(topologyDef) 19 | 20 | // VARs 21 | def workloadName = args[1] 22 | def exp 23 | if (workloadName.startsWith("workload-social")) { 24 | exp = new SwiftSocial2() 25 | exp.baseWorkload = SwiftSocial2.WORKLOADS[workloadName] 26 | // results-backwards compatibility hack(!) 27 | exp.baseWorkload += SwiftSocial2.LEGACY_HIGHLOCALITY 28 | } else { 29 | exp = new SwiftYCSB() 30 | exp.baseWorkload = SwiftYCSB.WORKLOADS[workloadName] 31 | } 32 | def modeName = args[2] 33 | exp.mode = SwiftBase.MODES[modeName] 34 | def failures = args[3].toInteger() 35 | exp.dbSize = 10000 36 | exp.clients = 500 37 | exp.incomingOpPerSecLimit = 1000 38 | def outputDir = args[4] 39 | def outputDirs = [] 40 | for (int accFailures = 0; accFailures <= failures; accFailures += exp.clients) { 41 | outputDirs += String.format("%s/%s-mode-%s-failures-%d", outputDir, workloadName, modeName, accFailures) 42 | } 43 | 44 | exp.runExperiment(*outputDirs) 45 | 46 | System.exit(0) 47 | 48 | -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/runresponsetimelocality.groovy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | //usr/bin/env groovy -classpath .:scripts/groovy "$0" $@; exit $? 3 | 4 | package swift.deployment 5 | 6 | import static swift.deployment.SwiftYCSB.* 7 | import static swift.deployment.Tools.* 8 | import static swift.deployment.Topology.*; 9 | 10 | if (args.length != 5) { 11 | System.err.println "usage: runresponsetime.groovy " 12 | System.exit(1) 13 | } 14 | 15 | topologyDef = new File(args[0]) 16 | println "==== Loading topology definition from file " + topologyDef + "====" 17 | evaluate(topologyDef) 18 | 19 | SwiftYCSB ycsb = new SwiftYCSB() 20 | // VARs 21 | def workloadName = args[1] 22 | ycsb.baseWorkload = SwiftYCSB.WORKLOADS[workloadName] 23 | def modeName = args[2] 24 | ycsb.mode = SwiftYCSB.MODES[modeName] 25 | if (workloadName.startsWith("workloada")) { 26 | ycsb.incomingOpPerSecLimit = 400 27 | ycsb.mode['swift.cacheSize'] = '64' 28 | ycsb.localRecordCount = 48 29 | } else { 30 | ycsb.incomingOpPerSecLimit = 4000 31 | // TODO: increase? 32 | ycsb.mode['swift.cacheSize'] = '64' 33 | ycsb.localRecordCount = 48 34 | } 35 | ycsb.mode['localRequestProportion'] = args[3] 36 | ycsb.clients = 1000 37 | def outputDir = args[4] 38 | ycsb.runExperiment(String.format("%s/%s-mode-%s-locality-%s", outputDir, workloadName, modeName, ycsb.mode['localRequestProportion'])) 39 | 40 | System.exit(0) 41 | 42 | -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/runscalabilitythroughput.groovy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | //usr/bin/env groovy -classpath .:scripts/groovy "$0" $@; exit $? 3 | 4 | package swift.deployment 5 | 6 | import static swift.deployment.SwiftYCSB.* 7 | import static swift.deployment.Tools.* 8 | import static swift.deployment.Topology.*; 9 | 10 | if (args.length < 5) { 11 | System.err.println "usage: runycscalabilitythroughput.groovy [#clients]" 12 | System.exit(1) 13 | } 14 | 15 | // TOPOLOGY CONFIGURATION 16 | topologyDef = new File(args[0]) 17 | println "==== Loading topology definition from file " + topologyDef + "====" 18 | evaluate(topologyDef) 19 | 20 | // VARs 21 | def workloadName = args[1] 22 | def exp 23 | if (workloadName.startsWith("workload-social")) { 24 | exp = new SwiftSocial2() 25 | exp.baseWorkload = SwiftSocial2.WORKLOADS[workloadName] 26 | } else { 27 | exp = new SwiftYCSB() 28 | exp.baseWorkload = SwiftYCSB.WORKLOADS[workloadName] 29 | } 30 | def modeName = args[2] 31 | exp.mode = SwiftBase.MODES[modeName] 32 | exp.incomingOpPerSecLimit = args[3].toInteger() 33 | def outputDir = args[4] 34 | exp.clients = 1000 35 | if (args.length > 5) { 36 | exp.clients = args[5].toInteger() 37 | } 38 | if (modeName == "no-caching" && exp.incomingOpPerSecLimit > 4000) { 39 | exp.clients = 2500 40 | } 41 | 42 | // Do not compute DATABASE_TABLE_SIZE as it puts more load on the DC/clients 43 | exp.dcReports -= 'DATABASE_TABLE_SIZE' 44 | exp.reports -= 'DATABASE_TABLE_SIZE' 45 | exp.runExperiment(outputDir) 46 | 47 | System.exit(0) 48 | 49 | -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/runsocialmanual.groovy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | //usr/bin/env groovy -classpath .:scripts/groovy "$0" $@; exit $? 3 | 4 | package swift.deployment 5 | 6 | import static swift.deployment.Tools.* 7 | import static swift.deployment.Topology.*; 8 | 9 | if (args.length != 1) { 10 | System.err.println "usage: runsocialmanual.groovy " 11 | System.exit(1) 12 | } 13 | 14 | // TOPOLOGY CONFIGURATION 15 | topologyDef = new File(args[0]) 16 | println "==== Loading topology definition from file " + topologyDef + "====" 17 | evaluate(topologyDef) 18 | 19 | SwiftSocial2 social = new SwiftSocial2() 20 | social.dbSize = social.scouts.size() * social.threads * 200 21 | social.runExperiment("results/swiftsocial/" + new Date().format('MMMdd-') + System.currentTimeMillis() + "-" + social.version + "-" + "test") 22 | 23 | System.exit(0) 24 | 25 | -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/runstaleness.groovy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | //usr/bin/env groovy -classpath .:scripts/groovy "$0" $@; exit $? 3 | 4 | package swift.deployment 5 | 6 | import static swift.deployment.SwiftYCSB.* 7 | import static swift.deployment.Tools.* 8 | import static swift.deployment.Topology.*; 9 | 10 | if (args.length < 5) { 11 | System.err.println "usage: runstaleness.groovy " 12 | System.exit(1) 13 | } 14 | 15 | // TOPOLOGY CONFIGURATION 16 | topologyDef = new File(args[0]) 17 | println "==== Loading topology definition from file " + topologyDef + "====" 18 | evaluate(topologyDef) 19 | 20 | // VARs 21 | def workloadName = args[1] 22 | def exp 23 | if (workloadName.startsWith("workload-social")) { 24 | exp = new SwiftSocial2() 25 | exp.baseWorkload = SwiftSocial2.WORKLOADS[workloadName] 26 | } else { 27 | exp = new SwiftYCSB() 28 | exp.baseWorkload = SwiftYCSB.WORKLOADS[workloadName] 29 | } 30 | def modeName = args[2] 31 | exp.mode = SwiftBase.MODES[modeName] 32 | exp.dbSize = args[3].toInteger() 33 | exp.clients = 500 34 | exp.incomingOpPerSecLimit = 1000 35 | exp.reports += ['STALENESS_YCSB_READ', 'STALENESS_READ', 'STALENESS_CALIB'] 36 | def outputDir = args[4] 37 | exp.runExperiment(outputDir) 38 | 39 | System.exit(0) 40 | 41 | -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/runycsbmanual.groovy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | //usr/bin/env groovy -classpath .:scripts/groovy "$0" $@; exit $? 3 | 4 | package swift.deployment 5 | 6 | import static swift.deployment.SwiftYCSB.* 7 | import static swift.deployment.Tools.* 8 | import static swift.deployment.Topology.*; 9 | 10 | if (args.length != 1) { 11 | System.err.println "usage: runycsbmanual.groovy " 12 | System.exit(1) 13 | } 14 | 15 | // TOPOLOGY CONFIGURATION 16 | topologyDef = new File(args[0]) 17 | println "==== Loading topology definition from file " + topologyDef + "====" 18 | evaluate(topologyDef) 19 | 20 | SwiftYCSB ycsb = new SwiftYCSB() 21 | // ycsb.duration = 60 22 | // ycsb.dbSize = 1000 23 | ycsb.runExperiment("results/ycsb/" + new Date().format('MMMdd-') + System.currentTimeMillis() + "-" + ycsb.version + "-" + "test") 24 | 25 | System.exit(0) 26 | 27 | -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/shutdown.groovy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | //usr/bin/env groovy -classpath .:scripts/groovy "$0" $@; exit $? 3 | 4 | package swift.deployment 5 | 6 | import static swift.deployment.Tools.* 7 | import static swift.deployment.Topology.*; 8 | 9 | if (args.length < 1) { 10 | System.err.println "usage: shutdown.groovy [topology2 topology3 ...]" 11 | System.exit(1) 12 | } 13 | 14 | for (String arg : args) { 15 | topologyDef = new File(arg) 16 | println "==== Loading topology definition from file " + topologyDef + "====" 17 | evaluate(topologyDef) 18 | println "==== Shuttding down " + Topology.allMachines().size() + " machines ====" 19 | Tools.shutdown(Topology.allMachines()) 20 | } 21 | 22 | System.exit(0) 23 | 24 | -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/stale/SwiftDoc.groovy: -------------------------------------------------------------------------------- 1 | package swift.deployment 2 | 3 | import java.util.concurrent.atomic.AtomicInteger 4 | 5 | 6 | class SwiftDoc extends SwiftBase { 7 | static String SCOUT_CMD = "-Xincgc -cp swiftcloud.jar -Xincgc -Djava.util.logging.config.file=all_logging.properties swift.application.swiftdoc.SwiftDocBenchmark" 8 | 9 | static String CS_SCOUT_CMD = "-Xincgc -cp swiftcloud.jar -Xincgc -Djava.util.logging.config.file=all_logging.properties swift.application.social.cs.SwiftSocialBenchmarkServer" 10 | static String CS_ENDCLIENT_CMD = "-Xincgc -cp swiftcloud.jar -Djava.util.logging.config.file=all_logging.properties swift.application.social.cs.SwiftSocialBenchmarkClient" 11 | 12 | static void runStandaloneScouts( List scouts, String server, String iterations, String isolationLevel, String cachepolicy, String notifications, String heap ="512m" ) { 13 | def cmd = { host -> 14 | String clientId = 1 + scouts.indexOf( host ) 15 | def res = "nohup java -Xmx" + heap + " " + SCOUT_CMD + " " + server + " " + iterations + " " + clientId + " " + isolationLevel + " " + cachepolicy + " " + notifications 16 | res += "> scout-stdout.txt 2> scout-stderr.txt < /dev/null &" 17 | return res; 18 | } 19 | 20 | AtomicInteger n = new AtomicInteger(); 21 | def resHandler = { host, res -> 22 | def str = n.incrementAndGet() + "/" + scouts.size() + (res < 1 ? " [ OK ]" : " [FAILED]") + " : " + host 23 | println str 24 | } 25 | Parallel.rsh( scouts, cmd, resHandler, true, 500000) 26 | } 27 | } -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/topology_1dctest.groovy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | //usr/bin/env groovy -classpath .:scripts/groovy "$0" $@; exit $? 3 | 4 | package swift.deployment 5 | import static swift.deployment.Topology.*; 6 | 7 | Topology.clear() 8 | SGroup(['ec2-54-191-203-95.us-west-2.compute.amazonaws.com', 9 | 'ec2-54-191-191-178.us-west-2.compute.amazonaws.com', 10 | 'ec2-54-191-163-242.us-west-2.compute.amazonaws.com' 11 | ], DC(['ec2-54-191-192-105.us-west-2.compute.amazonaws.com'], 12 | ['ec2-54-191-192-105.us-west-2.compute.amazonaws.com'])) 13 | -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/topology_planetlab.groovy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | //usr/bin/env groovy -classpath .:scripts/groovy "$0" $@; exit $? 3 | 4 | package swift.deployment 5 | import static swift.deployment.Topology.*; 6 | 7 | // planetlab test (WARNING: unlikely reproducible performance and issues) 8 | DC_1 = DC([PlanetLab[0]], [PlanetLab[0]]) 9 | DC_2 = DC([PlanetLab[2]], [PlanetLab[2]]) 10 | DC_3 = DC([PlanetLab[4]], [PlanetLab[4]]) 11 | 12 | Scouts1 = SGroup( PlanetLab[1..1], DC_1 ) 13 | Scouts2 = SGroup( PlanetLab[3..3], DC_2 ) 14 | Scouts3 = SGroup( PlanetLab[5..5], DC_3 ) 15 | -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/topology_pool_1dcs_30clients.groovy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | //usr/bin/env groovy -classpath .:scripts/groovy "$0" $@; exit $? 3 | 4 | package swift.deployment 5 | import static swift.deployment.Topology.*; 6 | 7 | evaluate(Topology.acquireTopologyFile("topology_1dcs_30clients")) 8 | -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/topology_pool_3dcs_30clients.groovy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | //usr/bin/env groovy -classpath .:scripts/groovy "$0" $@; exit $? 3 | 4 | package swift.deployment 5 | import static swift.deployment.Topology.*; 6 | 7 | evaluate(Topology.acquireTopologyFile("topology_3dcs_30clients")) 8 | -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/topology_pool_6dcs_30clients.groovy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | //usr/bin/env groovy -classpath .:scripts/groovy "$0" $@; exit $? 3 | 4 | package swift.deployment 5 | import static swift.deployment.Topology.*; 6 | 7 | evaluate(Topology.acquireTopologyFile("topology_6dcs_30clients")) 8 | -------------------------------------------------------------------------------- /scripts/groovy/swift/deployment/topology_pool_9dcs_30clients.groovy: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | //usr/bin/env groovy -classpath .:scripts/groovy "$0" $@; exit $? 3 | 4 | package swift.deployment 5 | import static swift.deployment.Topology.*; 6 | 7 | evaluate(Topology.acquireTopologyFile("topology_9dcs_30clients")) 8 | -------------------------------------------------------------------------------- /scripts/groovy/swift/stats/Series.groovy: -------------------------------------------------------------------------------- 1 | package swift.stats 2 | 3 | public class Series { 4 | 5 | final String name; 6 | final List xVal = new ArrayList(); 7 | final List yVal = new ArrayList(); 8 | final List eVal = new ArrayList(); 9 | 10 | public Series(String name) { 11 | this.name = name; 12 | } 13 | 14 | public void add(X x, Y y) { 15 | xVal.add(x); 16 | yVal.add(y); 17 | eVal.add(0); 18 | } 19 | 20 | public void add(X x, Y y, Y e) { 21 | xVal.add(x); 22 | yVal.add(y); 23 | eVal.add(e); 24 | } 25 | 26 | public String name() { 27 | return name; 28 | } 29 | 30 | public int size() { 31 | return xVal.size(); 32 | } 33 | 34 | public X xValue(int index) { 35 | return xVal.get(index); 36 | } 37 | 38 | public Y yValue(int index) { 39 | return yVal.get(index); 40 | } 41 | 42 | public Y eValue(int index) { 43 | return eVal.get(index); 44 | } 45 | public List xValues() { 46 | return Collections.unmodifiableList(xVal); 47 | } 48 | 49 | public List yValues() { 50 | return Collections.unmodifiableList(yVal); 51 | } 52 | 53 | public List eValues() { 54 | return Collections.unmodifiableList(eVal); 55 | } 56 | 57 | public String toString() { 58 | return name(); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /scripts/groovy/swift/stats/stale/runsocial_cdf_rr_cached.groovy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env groovy -classpath .:scripts/groovy:lib/core/ssj.jar 2 | package swift.stats 3 | 4 | 5 | 6 | DIR = new File("/Users/smd/Dropbox/bitbucket-git/swiftcloud-gforce/results/swiftsocial/SOSP/clt_cdfs") 7 | DC = new File("/Users/smd/Dropbox/bitbucket-git/swiftcloud-gforce/results/swiftsocial/SOSP/dc_cdfs") 8 | 9 | CACHEPOLICY = 'CACHED' 10 | ISOLATION = 'REPEATABLE_READS' 11 | new runsocial_latency_cdfs( getBinding() ).run() 12 | -------------------------------------------------------------------------------- /scripts/groovy/swift/stats/stale/runsocial_cdf_si_cached.groovy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env groovy -classpath .:scripts/groovy:lib/core/ssj.jar 2 | package swift.stats 3 | 4 | 5 | 6 | DIR = new File("/Users/smd/Dropbox/bitbucket-git/swiftcloud-gforce/results/swiftsocial/SOSP/clt_cdfs") 7 | DC = new File("/Users/smd/Dropbox/bitbucket-git/swiftcloud-gforce/results/swiftsocial/SOSP/dc_cdfs") 8 | 9 | CACHEPOLICY = 'CACHED' 10 | ISOLATION = 'SNAPSHOT_ISOLATION' 11 | new runsocial_latency_cdfs( getBinding() ).run() 12 | -------------------------------------------------------------------------------- /scripts/groovy/swift/stats/stale/runsocial_cdf_snapshop_isolation.groovy: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env groovy -classpath .:scripts/groovy:lib/core/ssj.jar 2 | package swift.stats 3 | 4 | 5 | 6 | DIR = new File("/Users/smd/Dropbox/bitbucket-git/swiftcloud-gforce/results/swiftsocial/SOSP/clt_cdfs") 7 | ISOLATION = 'SNAPSHOT_ISOLATION' 8 | new runsocial_latency_cdfs( getBinding() ).run() 9 | -------------------------------------------------------------------------------- /scripts/planetlab/.gitignore: -------------------------------------------------------------------------------- 1 | /runsocial_pssh.sh 2 | -------------------------------------------------------------------------------- /scripts/planetlab/KILL_ALL.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | . ./scripts/planetlab/pl-common.sh 4 | 5 | 6 | 7 | # TOPOLOGY 8 | DCS[0]=${EC2_PROD_EU_M1SMALL[0]} 9 | DCSEQ[0]=${EC2_PROD_EU_M1SMALL[1]} 10 | 11 | DCS[1]=${EC2_PROD_EU_M1SMALL[2]} 12 | DCSEQ[1]=${EC2_PROD_EU_M1SMALL[3]} 13 | 14 | DC_CLIENTS[0]=${EC2_PROD_EU_M1SMALL[4]} 15 | DC_CLIENTS[1]=${EC2_PROD_EU_M1SMALL[5]} 16 | 17 | MACHINES="${DCS[*]} ${DCSEQ[*]} ${DC_CLIENTS[*]}" 18 | INIT_DB_DC=${DCS[0]} 19 | INIT_DB_CLIENT=${EC2_PROD_EU_M1SMALL[0]} 20 | 21 | 22 | # INPUT DATA PARAMS 23 | INPUT_USERS=1000 24 | INPUT_ACTIVE_USERS=50 25 | INPUT_USER_FRIENDS=25 26 | INPUT_USER_BIASED_OPS=9 27 | INPUT_USER_RANDOM_OPS=1 28 | INPUT_USER_OPS_GROUPS=500 29 | FILE_USERS=input/users.txt 30 | FILE_CMDS_PREFIX=input/commands.txt 31 | 32 | # BENCHMARK PARAMS 33 | NOTIFICATIONS=false 34 | ISOLATION=REPEATABLE_READS 35 | CACHING=STRICTLY_MOST_RECENT 36 | CACHE_EVICTION_TIME_MS=120 #120000 37 | ASYNC_COMMIT=false 38 | THINK_TIME_MS=0 39 | MAX_CONCURRENT_SESSIONS_PER_JVM=8 #10 40 | 41 | echo "==== KILLING EXISTING SERVERS AND CLIENTS ====" 42 | scripts/planetlab/pl-kill.sh $MACHINES 43 | echo "==== DONE ====" 44 | 45 | -------------------------------------------------------------------------------- /scripts/planetlab/create_users.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # Generate a command file for adding bogus users to a file 3 | # TODO: CLARIFY LICENSING: THIS SCRIPT COMES FROM WALTER PAPER PUBLISHED IN OSDI 2011 4 | 5 | import sys, os, base64, hashlib 6 | 7 | def main(): 8 | numUsers=0 9 | 10 | if (len(sys.argv) != 3 and len(sys.argv) != 4): 11 | print "Usage ", sys.argv[0]," []" 12 | sys.exit() 13 | 14 | max_oid = int(sys.argv[1], 16) 15 | numUsers = int(sys.argv[2]) 16 | 17 | if len(sys.argv) == 4: 18 | outFile = sys.argv[3] 19 | f = open(outFile, 'w') 20 | else: 21 | f = sys.stdout 22 | 23 | print "Start with generation..." 24 | 25 | for i in range(0, numUsers): 26 | name = base64.b64encode(os.urandom(6)) 27 | m = hashlib.md5() 28 | m.update(name) 29 | hex_oid = int(m.hexdigest()[0:16], 16) 30 | # verify that the name is in the range 31 | f.write('usr_add;{0};passwd;"{0} {0}son";01/01/01;"";\n'.format(name)) 32 | 33 | if __name__ == "__main__": 34 | main() 35 | -------------------------------------------------------------------------------- /scripts/planetlab/cs_runSocial-batch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # INPUT DATA PARAMS 4 | export DURATION=60 5 | export THINK_TIME_MS=0 6 | export CACHE_EVICTION_TIME_MS=120000 #120000 7 | 8 | export INPUT_USERS=1500 9 | export INPUT_ACTIVE_USERS=$(($CLIENTS_NUMBER*1)) 10 | 11 | export INPUT_USER_FRIENDS=25 12 | export INPUT_USER_BIASED_OPS=9 13 | export INPUT_USER_RANDOM_OPS=1 14 | export INPUT_USER_OPS_GROUPS=500 15 | export MAX_CONCURRENT_SESSIONS_PER_JVM=$INPUT_ACTIVE_USERS 16 | 17 | 18 | # BENCHMARK PARAMS 19 | export CACHING=CACHED 20 | export ASYNC_COMMIT=false 21 | export NOTIFICATIONS=false 22 | export ISOLATION=REPEATABLE_READS 23 | 24 | . ./scripts/planetlab/cs_runSocial-cdn-4batch.sh 25 | . ./scripts/planetlab/cs_runSocial-cdn-4batch.sh 26 | 27 | . ./scripts/planetlab/cs_runSocial-osdi-4batch.sh 28 | . ./scripts/planetlab/cs_runSocial-osdi-4batch.sh 29 | 30 | . ./scripts/planetlab/cs_runSocial-dc-4batch.sh 31 | . ./scripts/planetlab/cs_runSocial-dc-4batch.sh 32 | 33 | export CACHING=CACHED 34 | export ASYNC_COMMIT=false 35 | export NOTIFICATIONS=false 36 | export ISOLATION=SNAPSHOT_ISOLATION 37 | 38 | . ./scripts/planetlab/cs_runSwiftDoc-cdn-4batch.sh 39 | . ./scripts/planetlab/cs_runSwiftDoc-cdn-4batch.sh 40 | 41 | . ./scripts/planetlab/cs_runSwiftDoc-osdi-4batch.sh 42 | . ./scripts/planetlab/cs_runSwiftDoc-osdi-4batch.sh 43 | 44 | . ./scripts/planetlab/cs_runSwiftDoc-dc-4batch.sh 45 | . ./scripts/planetlab/cs_runSwiftDoc-dc-4batch.sh 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /scripts/planetlab/cs_runSocial-cdn-4batch.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | . ./scripts/planetlab/pl-common.sh 4 | 5 | SCENARIO="cdn" 6 | 7 | export DATACENTER_SERVERS=( 8 | peeramide.irisa.fr 9 | ) 10 | 11 | export SCOUT_NODES=( 12 | ait21.us.es 13 | ait05.us.es 14 | ) 15 | 16 | export ENDCLIENT_NODES=( 17 | planetlab-1.iscte.pt 18 | planetlab-2.iscte.pt 19 | planetlab-3.iscte.pt 20 | planetlab-4.iscte.pt 21 | #planetlab-1.tagus.ist.utl.pt 22 | #planetlab-2.tagus.ist.utl.pt 23 | #planetlab1.fct.ualg.pt 24 | #planetlab2.fct.ualg.pt 25 | #planetlab1.di.fct.unl.pt 26 | #planetlab2.di.fct.unl.pt 27 | #planetlab-um00.di.uminho.pt 28 | #planetlab-um10.di.uminho.pt 29 | ) 30 | 31 | . ./scripts/planetlab/cs_runSocial-common-4batch.sh 32 | 33 | exit -------------------------------------------------------------------------------- /scripts/planetlab/cs_runSocial-dc-4batch.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | echo "PLEASE CONFIGURE NODES" 4 | exit 5 | 6 | . ./scripts/planetlab/pl-common.sh 7 | 8 | SCENARIO="dc" 9 | 10 | 11 | export DATACENTER_SERVERS=( 12 | peeramide.irisa.fr 13 | ) 14 | 15 | export SCOUT_NODES=( 16 | peeramide.irisa.fr 17 | ) 18 | 19 | 20 | export ENDCLIENT_NODES=( 21 | planetlab-3.iscte.pt 22 | planetlab-4.iscte.pt 23 | planetlab-1.tagus.ist.utl.pt 24 | planetlab-2.tagus.ist.utl.pt 25 | planetlab1.fct.ualg.pt 26 | planetlab2.fct.ualg.pt 27 | planetlab1.di.fct.unl.pt 28 | planetlab2.di.fct.unl.pt 29 | planetlab-um00.di.uminho.pt 30 | planetlab-um10.di.uminho.pt 31 | ) 32 | 33 | . ./scripts/planetlab/cs_runSocial-common-4batch.sh -------------------------------------------------------------------------------- /scripts/planetlab/cs_runSocial-osdi-4batch.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | echo "PLEASE CONFIGURE NODES" 4 | exit 5 | 6 | . ./scripts/planetlab/pl-common.sh 7 | 8 | SCENARIO="osdi" 9 | 10 | export DATACENTER_SERVERS=( 11 | ec2-176-34-78-57.eu-west-1.compute.amazonaws.com 12 | ) 13 | 14 | export SCOUT_NODES=( 15 | ait21.us.es 16 | ait05.us.es 17 | ) 18 | 19 | 20 | export ENDCLIENT_NODES=( 21 | planetlab-3.iscte.pt 22 | planetlab-4.iscte.pt 23 | planetlab-1.tagus.ist.utl.pt 24 | planetlab-2.tagus.ist.utl.pt 25 | planetlab1.fct.ualg.pt 26 | planetlab2.fct.ualg.pt 27 | planetlab1.di.fct.unl.pt 28 | planetlab2.di.fct.unl.pt 29 | planetlab-um00.di.uminho.pt 30 | planetlab-um10.di.uminho.pt 31 | ) 32 | 33 | . ./scripts/planetlab/cs_runSocial-common-4batch.sh -------------------------------------------------------------------------------- /scripts/planetlab/cs_runSwiftDoc-batch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | 4 | . ./scripts/planetlab/cs_runSwiftDoc-cdn.sh 5 | . ./scripts/planetlab/cs_runSwiftDoc-cdn.sh 6 | . ./scripts/planetlab/cs_runSwiftDoc-cdn.sh 7 | . ./scripts/planetlab/cs_runSwiftDoc-cdn.sh 8 | . ./scripts/planetlab/cs_runSwiftDoc-cdn.sh 9 | 10 | . ./scripts/planetlab/cs_runSwiftDoc-cdn.sh 11 | . ./scripts/planetlab/cs_runSwiftDoc-cdn.sh 12 | . ./scripts/planetlab/cs_runSwiftDoc-cdn.sh 13 | . ./scripts/planetlab/cs_runSwiftDoc-cdn.sh 14 | . ./scripts/planetlab/cs_runSwiftDoc-cdn.sh 15 | 16 | . ./scripts/planetlab/cs_runSwiftDoc-dc.sh 17 | . ./scripts/planetlab/cs_runSwiftDoc-dc.sh 18 | . ./scripts/planetlab/cs_runSwiftDoc-dc.sh 19 | . ./scripts/planetlab/cs_runSwiftDoc-dc.sh 20 | . ./scripts/planetlab/cs_runSwiftDoc-dc.sh 21 | -------------------------------------------------------------------------------- /scripts/planetlab/ec2_ping.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | export DATACENTER_SERVERS=( 4 | ec2-54-228-106-66.eu-west-1.compute.amazonaws.com 5 | ec2-54-249-137-48.ap-northeast-1.compute.amazonaws.com 6 | ec2-50-112-200-169.us-west-2.compute.amazonaws.com 7 | ) 8 | 9 | DCS=("${DATACENTER_SERVERS[@]}") 10 | MACHINES="${DCS[*]}" 11 | 12 | 13 | rm -f .ec2-rtts 14 | i=0; 15 | for m in ${MACHINES[*]}; do 16 | echo $m 17 | echo $m >> .ec2-rtts 18 | ping -a -q -c 20 $m >> .ec2-rtts 19 | done 20 | 21 | -------------------------------------------------------------------------------- /scripts/planetlab/pl-common.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Execute from root SwiftCloud directory. 3 | 4 | export EC2_IDENTITY_FILE=swiftcloud.pem 5 | export EC2_USER=fctple_SwiftCloud 6 | 7 | if [ -z $DUMMY ]; then 8 | SSH=ssh 9 | SCP=scp 10 | RSYNC=rsync 11 | else 12 | SSH=echo 13 | SCP=echo 14 | RSYNC=echo 15 | fi 16 | 17 | # CAREFUL: Depending on the settings EC2_ALL needs to be adapted 18 | export EC2_ALL="${EC2_TEST_EU[*]}" 19 | export JAR=swiftcloud.jar 20 | export PROPS=all_logging.properties 21 | export SWIFT_FILES="$JAR $PROPS" 22 | 23 | # run_cmd 24 | run_cmd() { 25 | server=$1 26 | shift 27 | cmd=$* 28 | echo "Running command on $server" 29 | echo "$cmd" 30 | $SSH "$EC2_USER@$server" "$cmd" 31 | } 32 | 33 | # run_cmd_bg 34 | run_cmd_bg() { 35 | server=$1 36 | shift 37 | cmd=$* 38 | echo "Running command on $server and detaching" 39 | echo "$cmd" 40 | $SSH "$EC2_USER@$server" "$cmd" & 41 | } 42 | 43 | 44 | # swift_app_cmd 45 | # output in CMD 46 | swift_app_cmd() { 47 | swift_app_cmd_raw "$* 2> >(tee stderr.txt 1>&2) > >(tee stdout.txt)" 48 | } 49 | 50 | swift_app_cmd_nostdout() { 51 | swift_app_cmd_raw "$* 2> >(tee stderr.txt 1>&2) > stdout.txt" 52 | } 53 | 54 | swift_app_cmd_raw() { 55 | args=$* 56 | CMD=$(cat < " 6 | echo "Copies given local file to provided ec2 host." 7 | exit 1 8 | fi 9 | 10 | lfile=$1 11 | server=$2 12 | rfile=$3 13 | copy_to $lfile $server $rfile 14 | 15 | -------------------------------------------------------------------------------- /scripts/planetlab/pl-deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ec2-deploy 3 | . scripts/planetlab/pl-common.sh 4 | 5 | if [ -z "$*" ]; then 6 | echo "no servers specified on commandline, taking $EC2_ALL" 7 | servers=$EC2_ALL 8 | else 9 | servers=$* 10 | fi 11 | 12 | if [ ! -f "$JAR" ]; then 13 | echo "file $JAR not found" && exit 1 14 | fi 15 | 16 | 17 | for host in $servers; do 18 | deploy_swift_on $host 19 | done 20 | 21 | -------------------------------------------------------------------------------- /scripts/planetlab/pl-kill.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ec2-kill 3 | 4 | . scripts/planetlab/pl-common.sh 5 | 6 | if [ -z "$*" ]; then 7 | echo "ec2-kill.sh " 8 | echo "Stops java processes at provided hosts" 9 | exit 1 10 | fi 11 | 12 | if [ "$1" == all ]; then 13 | servers=$EC2_ALL 14 | else 15 | servers=$* 16 | fi 17 | 18 | # stop 19 | stop() { 20 | servers=$* 21 | echo "Stopping swift apps: $servers" 22 | for server in $servers; do 23 | kill_swift $server 24 | done 25 | } 26 | 27 | echo "killing: $servers" 28 | stop $servers 29 | -------------------------------------------------------------------------------- /scripts/planetlab/pl-ping.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ec2-run 3 | . scripts/planetlab/pl-common.sh 4 | 5 | machines=$* 6 | for i in $machines; do 7 | # do not repide two side!! 8 | for j in $machines; do 9 | PING="ping -c 5 $j" 10 | run_cmd "$i" "$PING" > results/pingtime_"$i"_"$j".log 11 | done 12 | done 13 | 14 | -------------------------------------------------------------------------------- /scripts/planetlab/pl-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ec2-run 3 | . scripts/planetlab/pl-common.sh 4 | 5 | if [ -z "$*" ]; then 6 | echo "ec2-run.sh
" 7 | echo "Runs swift java application on given ec2-instance" 8 | exit 1 9 | fi 10 | 11 | server=$1 12 | class=$2 13 | shift 2 14 | args=$* 15 | swift_app_cmd $class $args 16 | 17 | run_cmd $server $CMD 18 | 19 | -------------------------------------------------------------------------------- /scripts/planetlab/pl-start-servers-ds-seq.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | # ec2-start-servers 3 | . scripts/planetlab/pl-common.sh 4 | 5 | servers_start() { 6 | local arg1="$1[*]" 7 | local arg2="$2[*]" 8 | 9 | local server_list=${!arg1} 10 | local sequencer_list=${!arg2} 11 | 12 | local sequencer_array=($sequencer_list) 13 | 14 | echo 15 | echo "***** Starting swift sequencers: " $sequencer_list 16 | 17 | i=0 18 | for srv in $sequencer_list; do 19 | seq=${sequencer_array[$i]} 20 | other_seq=${sequencer_list//$seq/} 21 | 22 | swift_app_cmd -Xmx512m swift.dc.DCSequencerServer -name "X$i" -servers $srv -sequencers $other_seq 23 | 24 | run_cmd_bg $seq $CMD 25 | 26 | i=$(($i+1)) 27 | done 28 | 29 | SEQ_NUMBER=${#sequencer_array[@]} 30 | 31 | echo "***** Starting swift servers: " $server_list 32 | 33 | i=0 34 | for srv in $server_list; do 35 | 36 | j=$(($i % $SEQ_NUMBER)) 37 | seq=${sequencer_list[$j]} 38 | 39 | 40 | swift_app_cmd -Xmx512m swift.dc.DCServer -sequencer $seq 41 | 42 | run_cmd_bg $srv $CMD 43 | 44 | i=$(($i+1)) 45 | sleep 5 46 | done 47 | } -------------------------------------------------------------------------------- /scripts/planetlab/pl-start-servers.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # ec2-start-servers 3 | . scripts/planetlab/pl-common.sh 4 | 5 | if [ -z "$*" ]; then 6 | echo "ec2-start-servers.sh " 7 | echo "Starts multi-dc Swift store configuration on provided ec2 hosts." 8 | exit 1 9 | fi 10 | 11 | # start 12 | start() { 13 | servers=$* 14 | echo "Starting swift servers: $servers" 15 | # TODO: logging! 16 | i=0 17 | for server in $servers; do 18 | other_servers=${servers//$server/} 19 | swift_app_cmd -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11111 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false swift.dc.DCSequencerServer -name "X$i" -servers localhost -sequencers $other_servers 20 | run_cmd_bg $server $CMD 21 | sleep 2 22 | swift_app_cmd swift.dc.DCServer -sequencer localhost 23 | run_cmd_bg $server $CMD 24 | i=$(($i+1)) 25 | done 26 | } 27 | 28 | #-Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=11111 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false 29 | 30 | start $* 31 | 32 | -------------------------------------------------------------------------------- /scripts/planetlab/test.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | 4 | . ./scripts/planetlab/pl-common.sh 5 | 6 | 7 | 8 | # TOPOLOGY 9 | DCS[0]=${EC2_PROD_EU_M1SMALL[0]} 10 | DCSEQ[0]=${EC2_PROD_EU_M1SMALL[1]} 11 | 12 | DCS[1]=${EC2_PROD_EU_M1SMALL[2]} 13 | DCSEQ[1]=${EC2_PROD_EU_M1SMALL[3]} 14 | 15 | DC_CLIENTS[0]=${EC2_PROD_EU_M1SMALL[4]} 16 | DC_CLIENTS[1]=${EC2_PROD_EU_M1SMALL[5]} 17 | 18 | 19 | MACHINES="${DCS[*]} ${DC_CLIENTS[*]}" 20 | INIT_DB_DC=${DCS[0]} 21 | INIT_DB_CLIENT=${EC2_PROD_EU_M1SMALL[0]} 22 | 23 | 24 | # INPUT DATA PARAMS 25 | INPUT_USERS=2500 26 | INPUT_ACTIVE_USERS=10 27 | INPUT_USER_FRIENDS=25 28 | INPUT_USER_BIASED_OPS=9 29 | INPUT_USER_RANDOM_OPS=1 30 | INPUT_USER_OPS_GROUPS=500 31 | FILE_USERS=input/users.txt 32 | FILE_CMDS_PREFIX=input/commands.txt 33 | 34 | # BENCHMARK PARAMS 35 | NOTIFICATIONS=false 36 | ISOLATION=REPEATABLE_READS 37 | CACHING=STRICTLY_MOST_RECENT 38 | CACHE_EVICTION_TIME_MS=120 #120000 39 | ASYNC_COMMIT=false 40 | THINK_TIME_MS=0 41 | MAX_CONCURRENT_SESSIONS_PER_JVM=5 42 | 43 | echo "==== STARTING SEQUENCERS AND DC SERVERS ====" 44 | 45 | . ./scripts/planetlab/pl-start-servers-ds-seq.sh 46 | 47 | servers_start DCS DCSEQ 48 | -------------------------------------------------------------------------------- /src-app/swift/application/filesystem/Blob.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2012 University of Kaiserslautern 4 | * Copyright 2011-2012 Universidade Nova de Lisboa 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | *****************************************************************************/ 18 | package swift.application.filesystem; 19 | 20 | import swift.crdt.core.Copyable; 21 | 22 | public class Blob implements Copyable { 23 | private final byte[] content; 24 | 25 | public Blob() { 26 | this.content = new byte[0]; 27 | } 28 | 29 | public Blob(byte[] s) { 30 | this.content = s; 31 | } 32 | 33 | public byte[] get() { 34 | return content; 35 | } 36 | 37 | @Override 38 | public Object copy() { 39 | return new Blob(this.content.clone()); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src-app/swift/application/filesystem/cs/proto/FuseRemoteOperation.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2012 University of Kaiserslautern 4 | * Copyright 2011-2012 Universidade Nova de Lisboa 5 | * 6 | * Licensed under the Apache License, Version 2.0 (the "License"); 7 | * you may not use this file except in compliance with the License. 8 | * You may obtain a copy of the License at 9 | * 10 | * http://www.apache.org/licenses/LICENSE-2.0 11 | * 12 | * Unless required by applicable law or agreed to in writing, software 13 | * distributed under the License is distributed on an "AS IS" BASIS, 14 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | * See the License for the specific language governing permissions and 16 | * limitations under the License. 17 | *****************************************************************************/ 18 | package swift.application.filesystem.cs.proto; 19 | 20 | import sys.net.api.rpc.RpcHandle; 21 | import sys.net.api.rpc.RpcHandler; 22 | import sys.net.api.rpc.RpcMessage; 23 | 24 | public class FuseRemoteOperation implements RpcMessage { 25 | 26 | // for kryo 27 | FuseRemoteOperation() { 28 | } 29 | 30 | @Override 31 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 32 | ((RemoteFuseOperationHandler) handler).onReceive(handle, this); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src-app/swift/application/social/Commands.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.social; 18 | 19 | public enum Commands { 20 | LOGIN, LOGOUT, FRIEND, READ, SEE_FRIENDS, STATUS, POST; 21 | 22 | public static Commands extract(String cmdLine) { 23 | final int sepIdx = cmdLine.indexOf(';'); 24 | if (sepIdx < 0) { 25 | return null; 26 | } 27 | try { 28 | return Commands.valueOf(cmdLine.substring(0, sepIdx).toUpperCase()); 29 | } catch (IllegalArgumentException x) { 30 | return null; 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src-app/swift/application/social/StatusMessage.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.social; 18 | 19 | import swift.crdt.core.CRDTIdentifier; 20 | 21 | public class StatusMessage { 22 | CRDTIdentifier from; 23 | long timestamp; 24 | String text; 25 | } 26 | -------------------------------------------------------------------------------- /src-app/swift/application/social/cs/Reply.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.social.cs; 18 | 19 | import sys.net.api.rpc.RpcHandle; 20 | import sys.net.api.rpc.RpcHandler; 21 | import sys.net.api.rpc.RpcMessage; 22 | 23 | public class Reply implements RpcMessage { 24 | 25 | String payload; 26 | 27 | Reply() { 28 | } 29 | 30 | public Reply(String payload) { 31 | this.payload = payload; 32 | } 33 | 34 | @Override 35 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src-app/swift/application/social/cs/Request.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.social.cs; 18 | 19 | import sys.net.api.rpc.RpcHandle; 20 | import sys.net.api.rpc.RpcHandler; 21 | import sys.net.api.rpc.RpcMessage; 22 | 23 | public class Request implements RpcMessage { 24 | 25 | String payload; 26 | 27 | Request() { 28 | } 29 | 30 | public Request(String payload) { 31 | this.payload = payload; 32 | } 33 | 34 | @Override 35 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 36 | ((RequestHandler) handler).onReceive(handle, this); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src-app/swift/application/social/cs/RequestHandler.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.social.cs; 18 | 19 | import sys.net.api.rpc.AbstractRpcHandler; 20 | import sys.net.api.rpc.RpcHandle; 21 | 22 | public abstract class RequestHandler extends AbstractRpcHandler { 23 | 24 | public void onReceive(final RpcHandle handle, final Request r) { 25 | Thread.dumpStack(); 26 | } 27 | 28 | } -------------------------------------------------------------------------------- /src-app/swift/application/swiftdoc/SwiftDocLineNumberGenerator.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.swiftdoc; 18 | 19 | public class SwiftDocLineNumberGenerator { 20 | 21 | public void parseFiles(SwiftDocOps seq) throws Exception { 22 | 23 | if (seq != null) 24 | seq.begin(); 25 | 26 | for (int i = 0; i < 1000000; i++) 27 | if (seq != null) { 28 | seq.add(seq.size(), seq.gen(String.format("%10d", i))); 29 | } 30 | 31 | if (seq != null) 32 | seq.commit(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src-app/swift/application/swiftdoc/SwiftDocOps.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.swiftdoc; 18 | 19 | public interface SwiftDocOps { 20 | 21 | V gen(String s); 22 | 23 | void begin(); 24 | 25 | void add(int i, V v); 26 | 27 | V get(int v); 28 | 29 | public V remove(int v); 30 | 31 | int size(); 32 | 33 | void commit(); 34 | } 35 | -------------------------------------------------------------------------------- /src-app/swift/application/swiftdoc/cs/msgs/AckHandler.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.swiftdoc.cs.msgs; 18 | 19 | public class AckHandler extends AppRpcHandler { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src-app/swift/application/swiftdoc/cs/msgs/BeginTransaction.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.swiftdoc.cs.msgs; 18 | 19 | import sys.net.api.rpc.RpcHandle; 20 | import sys.net.api.rpc.RpcHandler; 21 | 22 | public class BeginTransaction extends SwiftDocRpc { 23 | 24 | public BeginTransaction() { 25 | } 26 | 27 | @Override 28 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 29 | ((AppRpcHandler) handler).onReceive(handle, this); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src-app/swift/application/swiftdoc/cs/msgs/BulkTransaction.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.swiftdoc.cs.msgs; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | import sys.net.api.rpc.RpcHandle; 23 | import sys.net.api.rpc.RpcHandler; 24 | 25 | public class BulkTransaction extends SwiftDocRpc { 26 | 27 | public List ops; 28 | 29 | BulkTransaction() { 30 | } 31 | 32 | public BulkTransaction(List ops) { 33 | this.ops = new ArrayList(ops); 34 | } 35 | 36 | @Override 37 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 38 | ((AppRpcHandler) handler).onReceive(handle, this); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src-app/swift/application/swiftdoc/cs/msgs/CommitTransaction.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.swiftdoc.cs.msgs; 18 | 19 | import sys.net.api.rpc.RpcHandle; 20 | import sys.net.api.rpc.RpcHandler; 21 | 22 | public class CommitTransaction extends SwiftDocRpc { 23 | 24 | public CommitTransaction() { 25 | } 26 | 27 | @Override 28 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 29 | ((AppRpcHandler) handler).onReceive(handle, this); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src-app/swift/application/swiftdoc/cs/msgs/InitScoutServer.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.swiftdoc.cs.msgs; 18 | 19 | import sys.net.api.rpc.RpcHandle; 20 | import sys.net.api.rpc.RpcHandler; 21 | 22 | public class InitScoutServer extends SwiftDocRpc { 23 | 24 | public InitScoutServer() { 25 | } 26 | 27 | @Override 28 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 29 | ((AppRpcHandler) handler).onReceive(handle, this); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src-app/swift/application/swiftdoc/cs/msgs/InsertAtom.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.swiftdoc.cs.msgs; 18 | 19 | import swift.application.swiftdoc.TextLine; 20 | import sys.net.api.rpc.RpcHandle; 21 | import sys.net.api.rpc.RpcHandler; 22 | 23 | public class InsertAtom extends SwiftDocRpc { 24 | 25 | public int pos; 26 | public TextLine atom; 27 | 28 | InsertAtom() { 29 | } 30 | 31 | public InsertAtom(TextLine atom, int pos) { 32 | this.pos = pos; 33 | this.atom = atom; 34 | } 35 | 36 | @Override 37 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 38 | ((AppRpcHandler) handler).onReceive(handle, this); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src-app/swift/application/swiftdoc/cs/msgs/RemoveAtom.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.swiftdoc.cs.msgs; 18 | 19 | import sys.net.api.rpc.RpcHandle; 20 | import sys.net.api.rpc.RpcHandler; 21 | 22 | public class RemoveAtom extends SwiftDocRpc { 23 | 24 | public int pos; 25 | 26 | RemoveAtom() { 27 | } 28 | 29 | public RemoveAtom(int pos) { 30 | this.pos = pos; 31 | } 32 | 33 | @Override 34 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 35 | ((AppRpcHandler) handler).onReceive(handle, this); 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src-app/swift/application/swiftdoc/cs/msgs/ServerACK.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.swiftdoc.cs.msgs; 18 | 19 | import sys.net.api.rpc.RpcHandle; 20 | import sys.net.api.rpc.RpcHandler; 21 | 22 | public class ServerACK extends SwiftDocRpc { 23 | 24 | public long serial; 25 | 26 | ServerACK() { 27 | } 28 | 29 | public ServerACK(SwiftDocRpc rpc) { 30 | this.serial = rpc.serial; 31 | } 32 | 33 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 34 | ((AppRpcHandler) handler).onReceive(this); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src-app/swift/application/swiftdoc/cs/msgs/ServerReply.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.swiftdoc.cs.msgs; 18 | 19 | import java.util.List; 20 | 21 | import swift.application.swiftdoc.TextLine; 22 | import sys.net.api.rpc.RpcHandle; 23 | import sys.net.api.rpc.RpcHandler; 24 | import sys.net.api.rpc.RpcMessage; 25 | 26 | public class ServerReply implements RpcMessage { 27 | 28 | public List atoms; 29 | 30 | ServerReply() { 31 | } 32 | 33 | public ServerReply(List atoms) { 34 | this.atoms = atoms; 35 | } 36 | 37 | @Override 38 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 39 | ((AppRpcHandler) handler).onReceive(this); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src-app/swift/application/swiftdoc/cs/msgs/SwiftDocRpc.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.application.swiftdoc.cs.msgs; 18 | 19 | import java.util.concurrent.atomic.AtomicLong; 20 | 21 | import sys.net.api.rpc.RpcMessage; 22 | 23 | public abstract class SwiftDocRpc implements RpcMessage { 24 | 25 | static AtomicLong serialFactory = new AtomicLong(0); 26 | 27 | public long serial = serialFactory.getAndIncrement(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src-contrib/com/yahoo/ycsb/generator/CachedPoolIntegerGenerator.java: -------------------------------------------------------------------------------- 1 | package com.yahoo.ycsb.generator; 2 | 3 | /** 4 | * An integer generator that draws integers from a precached pool of integers 5 | * acquired from the provided origin generator, according to a provided access 6 | * distribution inside a pool. 7 | * 8 | * @author mzawirski 9 | */ 10 | public class CachedPoolIntegerGenerator extends IntegerGenerator { 11 | private final int[] pool; 12 | private final double mean; 13 | private final IntegerGenerator poolKeyChooser; 14 | 15 | public CachedPoolIntegerGenerator(IntegerGenerator originGenerator, int poolSize, IntegerGenerator poolKeyChooser) { 16 | this.poolKeyChooser = poolKeyChooser; 17 | this.pool = new int[poolSize]; 18 | double accum = 0; 19 | for (int i = 0; i < poolSize; i++) { 20 | pool[i] = originGenerator.nextInt(); 21 | accum += pool[i]; 22 | } 23 | mean = accum / poolSize; 24 | nextInt(); 25 | } 26 | 27 | @Override 28 | public int nextInt() { 29 | final int result = pool[poolKeyChooser.nextInt()]; 30 | setLastInt(result); 31 | return result; 32 | } 33 | 34 | @Override 35 | public double mean() { 36 | return mean; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src-contrib/com/yahoo/ycsb/generator/CombinerIntegerGeneratorDecorator.java: -------------------------------------------------------------------------------- 1 | package com.yahoo.ycsb.generator; 2 | 3 | import com.yahoo.ycsb.Utils; 4 | 5 | /** 6 | * Integer number generator that combines two given generators according to a 7 | * predefined proportion of requests served by each one. 8 | * 9 | * @author mzawirski 10 | */ 11 | public class CombinerIntegerGeneratorDecorator extends IntegerGenerator { 12 | private final IntegerGenerator primaryGenerator; 13 | private final IntegerGenerator secondaryGenerator; 14 | private final double secondaryProportion; 15 | 16 | public CombinerIntegerGeneratorDecorator(IntegerGenerator primaryGenerator, IntegerGenerator secondaryGenerator, 17 | double secondaryProportion) { 18 | this.primaryGenerator = primaryGenerator; 19 | this.secondaryGenerator = secondaryGenerator; 20 | this.secondaryProportion = secondaryProportion; 21 | nextInt(); 22 | } 23 | 24 | @Override 25 | public int nextInt() { 26 | final int result; 27 | if (Utils.random().nextDouble() < secondaryProportion) { 28 | result = secondaryGenerator.nextInt(); 29 | } else { 30 | result = primaryGenerator.nextInt(); 31 | } 32 | setLastInt(result); 33 | return result; 34 | } 35 | 36 | @Override 37 | public double mean() { 38 | return primaryGenerator.mean() * (1 - secondaryProportion) + secondaryGenerator.mean() * secondaryProportion; 39 | } 40 | } -------------------------------------------------------------------------------- /src-contrib/org/uminho/gsd/benchmarks/benchmark/BenchmarkNodeID.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ********************************************************************* 3 | * Copyright (c) 2010 Pedro Gomes and Universidade do Minho. 4 | * All rights reserved. 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | * ******************************************************************** 18 | */ 19 | 20 | package org.uminho.gsd.benchmarks.benchmark; 21 | 22 | 23 | public class BenchmarkNodeID { 24 | 25 | private int id; 26 | 27 | public BenchmarkNodeID(int id) { 28 | this.id = id; 29 | } 30 | 31 | public int getId() { 32 | return id; 33 | } 34 | 35 | public void setId(int id) { 36 | this.id = id; 37 | } 38 | 39 | public boolean isMaster() { 40 | return id == 1; 41 | 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src-contrib/org/uminho/gsd/benchmarks/generic/BuyingResult.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ********************************************************************* 3 | * Copyright (c) 2010 Pedro Gomes and Universidade do Minho. 4 | * All rights reserved. 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | * ******************************************************************** 18 | */ 19 | 20 | package org.uminho.gsd.benchmarks.generic; 21 | 22 | public enum BuyingResult { 23 | BOUGHT, //Product bought 24 | NOT_AVAILABLE, //not available, the product has no stock, so you cant buy it 25 | OUT_OF_STOCK, //bought product, but there is no stock to deliver the product 26 | DOES_NOT_EXIST, //debug result, the item does not exist 27 | CANT_COMFIRM //debug result, when we can't see the item stock after being bought 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src-contrib/org/uminho/gsd/benchmarks/generic/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ********************************************************************* 3 | * Copyright (c) 2010 Pedro Gomes and Universidade do Minho. 4 | * All rights reserved. 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | * ******************************************************************** 18 | */ 19 | 20 | package org.uminho.gsd.benchmarks.generic; 21 | 22 | 23 | public class Constants { 24 | 25 | public static /* final */ int NUM_EBS = 10; 26 | public static /* final */ int NUM_ITEMS = 10000; 27 | public static /* final */ int NUM_CUSTOMERS = NUM_EBS * 2880; 28 | public static /* final */ int NUM_ADDRESSES = 2 * NUM_CUSTOMERS; 29 | public static /* final */ int NUM_AUTHORS = (int) (.25 * NUM_ITEMS); 30 | public static /* final */ int NUM_ORDERS = (int) (.9 * NUM_CUSTOMERS); 31 | public static /* final */ int NUM_COUNTRIES = 92; // this is constant. Never changes! 32 | 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src-contrib/org/uminho/gsd/benchmarks/helpers/RiakGenericObject.java: -------------------------------------------------------------------------------- 1 | package org.uminho.gsd.benchmarks.helpers; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | public class RiakGenericObject { 7 | 8 | private Map attributes; 9 | 10 | public RiakGenericObject(){ 11 | attributes = new HashMap(); 12 | } 13 | 14 | public void setAttribute(String attributeName, Object value){ 15 | attributes.put(attributeName, value); 16 | } 17 | 18 | public Object getAttribute(String attributeName){ 19 | return attributes.get(attributeName); 20 | 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src-contrib/org/uminho/gsd/benchmarks/helpers/TPM_counter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ********************************************************************* 3 | * Copyright (c) 2010 Pedro Gomes and Universidade do Minho. 4 | * All rights reserved. 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | * ******************************************************************** 18 | */ 19 | 20 | package org.uminho.gsd.benchmarks.helpers; 21 | 22 | 23 | public class TPM_counter { 24 | 25 | int transactions =0; 26 | 27 | public void increment(){ 28 | transactions++; 29 | } 30 | 31 | public int getTransactions(){ 32 | return transactions; 33 | } 34 | 35 | public int get_and_reset(){ 36 | int t = transactions; 37 | transactions =0; 38 | return t ; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src-contrib/org/uminho/gsd/benchmarks/helpers/ThinkTime.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ********************************************************************* 3 | * Copyright (c) 2010 Pedro Gomes and Universidade do Minho. 4 | * All rights reserved. 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | * ******************************************************************** 18 | */ 19 | 20 | package org.uminho.gsd.benchmarks.helpers; 21 | 22 | 23 | import org.uminho.gsd.benchmarks.benchmark.BenchmarkMain; 24 | 25 | import java.util.Random; 26 | 27 | public class ThinkTime { 28 | 29 | 30 | private static Random random = new Random(); 31 | 32 | public static long getThinkTime() { 33 | 34 | if (BenchmarkMain.thinkTime == -1) { 35 | long simulatedDelay = (long) ((-Math.log(random.nextDouble()) * 7) * 1000d); 36 | 37 | if (simulatedDelay > 70000) { 38 | simulatedDelay = 70000; 39 | } 40 | 41 | return simulatedDelay; 42 | } else { 43 | return BenchmarkMain.thinkTime; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src-contrib/org/uminho/gsd/benchmarks/interfaces/Entity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ********************************************************************* 3 | * Copyright (c) 2010 Pedro Gomes and Universidade do Minho. 4 | * All rights reserved. 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | * ******************************************************************** 18 | */ 19 | 20 | /* 21 | * To change this template, choose Tools | Templates 22 | * and open the template in the editor. 23 | */ 24 | 25 | package org.uminho.gsd.benchmarks.interfaces; 26 | 27 | import java.util.TreeMap; 28 | 29 | import swift.crdt.core.Copyable; 30 | 31 | public interface Entity extends Copyable { 32 | 33 | public String getKeyName(); 34 | 35 | public TreeMap getValuesToInsert(); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src-contrib/org/uminho/gsd/benchmarks/interfaces/KeyGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ********************************************************************* 3 | * Copyright (c) 2010 Pedro Gomes and Universidade do Minho. 4 | * All rights reserved. 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | * ******************************************************************** 18 | */ 19 | 20 | package org.uminho.gsd.benchmarks.interfaces; 21 | 22 | public interface KeyGenerator { 23 | 24 | public Object getNextKey(); 25 | 26 | public Object getNextKey(int client); 27 | } 28 | -------------------------------------------------------------------------------- /src-contrib/org/uminho/gsd/benchmarks/interfaces/ProbabilityDistribution.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ********************************************************************* 3 | * Copyright (c) 2010 Pedro Gomes and Universidade do Minho. 4 | * All rights reserved. 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | * ******************************************************************** 18 | */ 19 | 20 | package org.uminho.gsd.benchmarks.interfaces; 21 | 22 | import java.util.Map; 23 | 24 | public interface ProbabilityDistribution { 25 | 26 | 27 | public void init(int numberElements, Map options); 28 | 29 | public void setInfo(Map info); 30 | 31 | public int getNextElement(); 32 | 33 | public ProbabilityDistribution getNewInstance(); 34 | 35 | //info methods 36 | public String getName(); 37 | 38 | public Map getInfo(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src-contrib/org/uminho/gsd/benchmarks/interfaces/Workload/WorkloadGeneratorInterface.java: -------------------------------------------------------------------------------- 1 | /* 2 | * ********************************************************************* 3 | * Copyright (c) 2010 Pedro Gomes and Universidade do Minho. 4 | * All rights reserved. 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | * 17 | * ******************************************************************** 18 | */ 19 | 20 | package org.uminho.gsd.benchmarks.interfaces.Workload; 21 | 22 | 23 | /** 24 | * A workload generation client that assigned to a execution client, should 25 | */ 26 | public interface WorkloadGeneratorInterface { 27 | 28 | 29 | /** 30 | * Get the next database operation 31 | * 32 | * @return the next Operation to be executed. 33 | */ 34 | public Operation getNextOperation(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src-contrib/pt/citi/cs/crdt/benchmarks/tpcw/entities/crdt/OrderInfo.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package pt.citi.cs.crdt.benchmarks.tpcw.entities.crdt; 18 | 19 | import java.text.ParseException; 20 | 21 | public class OrderInfo { 22 | 23 | long date; 24 | String o_id; 25 | 26 | OrderInfo() { 27 | 28 | } 29 | 30 | public OrderInfo(String o_id, long date) { 31 | this.o_id = o_id; 32 | this.date = date; 33 | } 34 | 35 | public long getO_DATE() throws ParseException { 36 | return date; 37 | } 38 | 39 | public String getO_ID() { 40 | return o_id; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src-contrib/pt/citi/cs/crdt/benchmarks/tpcw/misc/Operations.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package pt.citi.cs.crdt.benchmarks.tpcw.misc; 18 | 19 | public enum Operations { 20 | OP_HOME, OP_NEW_PRODUCTS, OP_BEST_SELLERS, OP_ITEM_INFO, OP_SEARCH, OP_SHOPPING_CART, OP_REGISTER, OP_BUY_REQUEST, OP_BUY_CONFIRM, OP_ORDER_INQUIRY, OP_LOGIN 21 | } 22 | 23 | /* 24 | * public enum Operations { OP_HOME, OP_NEW_PRODUCTS, OP_BEST_SELLERS, 25 | * OP_ITEM_INFO, OP_SEARCH, OP_SHOPPING_CART, OP_REGISTER, OP_BUY_REQUEST, 26 | * OP_BUY_CONFIRM, OP_ADMIN_CHANGE, OP_ORDER_INQUIRY, OP_LOGIN } 27 | */ -------------------------------------------------------------------------------- /src-contrib/pt/citi/cs/crdt/benchmarks/tpcw/synchronization/MessageSize.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package pt.citi.cs.crdt.benchmarks.tpcw.synchronization; 18 | 19 | public enum MessageSize { 20 | OP_ITEM_INFO(1726), OP_HOME(7172), OP_SEARCH(2004), OP_LOGIN(2056), OP_SHOPPING_CART( 21 | 2056), OP_BUY_REQUEST(3690), OP_BUY_CONFIRM(1530), OP_REGISTER(2769), OP_ADMIN_CHANGE( 22 | 1349), OP_BEST_SELLERS(6640), OP_ORDER_INQUIRY(953), OP_NEW_PRODUCTS(8095); 23 | 24 | private final int size; 25 | 26 | MessageSize(int size) { 27 | this.size = size; 28 | } 29 | 30 | int size() { 31 | return size; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src-contrib/swift/application/tpcw/TPCWBenchmark.java: -------------------------------------------------------------------------------- 1 | package swift.application.tpcw; 2 | 3 | import org.uminho.gsd.benchmarks.benchmark.BenchmarkMain; 4 | 5 | import swift.dc.DCSequencerServer; 6 | import swift.dc.DCServer; 7 | 8 | public class TPCWBenchmark { 9 | 10 | public static void main(String[] args) throws InterruptedException { 11 | // Initialize DC 12 | DCSequencerServer.main(new String[] { "-name", "localhost" }); 13 | DCServer.main(new String[] { "-servers", "localhost" }); 14 | 15 | String[] benchArgs = { "-d", "swiftcloud", // select database 16 | "-id", "pop", // populator id 17 | "-pop" // populate and exit 18 | }; 19 | 20 | BenchmarkMain.main(benchArgs); 21 | 22 | Thread.sleep(10000); 23 | 24 | System.exit(0); 25 | 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src-contrib/swift/application/ycsb/StringHashMapWrapper.java: -------------------------------------------------------------------------------- 1 | package swift.application.ycsb; 2 | 3 | import java.util.HashMap; 4 | 5 | import swift.crdt.core.Copyable; 6 | 7 | /** 8 | * Copyable wrapper of a String-to-String Hashmap. Workaround to use HashMap 9 | * with LWW register {@link RegisterVersioned}. 10 | * 11 | * @author mzawirsk 12 | */ 13 | public class StringHashMapWrapper implements Copyable { 14 | /** 15 | * 16 | */ 17 | private static final long serialVersionUID = 3583391796205883150L; 18 | 19 | public static StringHashMapWrapper createWithValue(HashMap value) { 20 | final StringHashMapWrapper wrapper = new StringHashMapWrapper(); 21 | wrapper.map = value; 22 | return wrapper; 23 | } 24 | 25 | private HashMap map; 26 | 27 | /** 28 | * Kryo-only, DO NOT USE. Use {@link #createWithValue(HashMap)} 29 | */ 30 | public StringHashMapWrapper() { 31 | } 32 | 33 | public HashMap getValue() { 34 | return map; 35 | } 36 | 37 | @Override 38 | public Object copy() { 39 | final StringHashMapWrapper wrapper = new StringHashMapWrapper(); 40 | wrapper.map = new HashMap(this.map); 41 | return wrapper; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src-core-bench/sys/net/impl/Handler.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.net.impl; 18 | 19 | import sys.net.api.rpc.AbstractRpcHandler; 20 | import sys.net.api.rpc.RpcHandle; 21 | 22 | /** 23 | * 24 | * @author smd 25 | * 26 | */ 27 | abstract public class Handler extends AbstractRpcHandler { 28 | 29 | public void onReceive(final Reply r) { 30 | Thread.dumpStack(); 31 | } 32 | 33 | public void onReceive(final RpcHandle handle, final Reply r) { 34 | Thread.dumpStack(); 35 | } 36 | 37 | public void onReceive(final RpcHandle handle, final Request r) { 38 | Thread.dumpStack(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src-core-test/notifications/Test1.java: -------------------------------------------------------------------------------- 1 | package notifications; 2 | 3 | import java.util.Properties; 4 | 5 | import swift.client.SwiftImpl; 6 | import swift.client.SwiftImpl.CacheUpdateProtocol; 7 | import swift.client.SwiftOptions; 8 | import swift.crdt.IntegerCRDT; 9 | import swift.crdt.core.CRDTIdentifier; 10 | import swift.crdt.core.CachePolicy; 11 | import swift.crdt.core.IsolationLevel; 12 | import swift.crdt.core.SwiftSession; 13 | import swift.crdt.core.TxnHandle; 14 | import swift.dc.DCConstants; 15 | 16 | public class Test1 { 17 | 18 | public static void main(String[] args) throws Exception { 19 | 20 | final CRDTIdentifier id = new CRDTIdentifier("/integers", "1"); 21 | 22 | final SwiftOptions options = new SwiftOptions("localhost", DCConstants.SURROGATE_PORT, new Properties()); 23 | options.getCacheUpdateProtocol(); 24 | options.setCacheUpdateProtocol(CacheUpdateProtocol.CAUSAL_NOTIFICATIONS_STREAM); 25 | options.setCacheSize(100); 26 | options.setDisasterSafe(true); 27 | 28 | SwiftSession server = SwiftImpl.newSingleSessionInstance(options); 29 | 30 | for (;;) { 31 | TxnHandle txn = server.beginTxn(IsolationLevel.SNAPSHOT_ISOLATION, CachePolicy.CACHED, false); 32 | IntegerCRDT i = (IntegerCRDT) txn.get(id, true, IntegerCRDT.class); 33 | i.add(1); 34 | System.err.println("---->" + i.getValue()); 35 | txn.commit(); 36 | Thread.sleep(1000); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src-core/swift/client/AbstractObjectUpdatesListener.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.client; 18 | 19 | import swift.crdt.core.CRDTIdentifier; 20 | import swift.crdt.core.ObjectUpdatesListener; 21 | import swift.crdt.core.TxnHandle; 22 | import swift.crdt.core.CRDT; 23 | 24 | /** 25 | * Base class for {@link ObjectUpdatesListener} implementations expecting 26 | * notifications. 27 | * 28 | * @author mzawirski 29 | */ 30 | public abstract class AbstractObjectUpdatesListener implements ObjectUpdatesListener { 31 | @Override 32 | public abstract void onObjectUpdate(TxnHandle txn, CRDTIdentifier id, CRDT previousValue); 33 | 34 | @Override 35 | public boolean isSubscriptionOnly() { 36 | return false; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src-core/swift/client/CommitListener.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.client; 18 | 19 | import swift.crdt.core.TxnHandle; 20 | 21 | /** 22 | * Notification mechanism for asynchronous transaction commit. 23 | * 24 | * @author mzawirski 25 | */ 26 | public interface CommitListener { 27 | /** 28 | * Specifies action called on global commit of a transaction. 29 | * 30 | * @param transaction 31 | * globally committed transaction 32 | */ 33 | void onGlobalCommit(TxnHandle transaction); 34 | } 35 | -------------------------------------------------------------------------------- /src-core/swift/client/FailOverHandler.java: -------------------------------------------------------------------------------- 1 | package swift.client; 2 | 3 | public interface FailOverHandler { 4 | 5 | public void onFailOver(); 6 | } 7 | -------------------------------------------------------------------------------- /src-core/swift/clocks/TimestampSource.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.clocks; 18 | 19 | /** 20 | * Source for generating new timestamps. 21 | * 22 | * @param T 23 | * type of timestamps 24 | * 25 | * @author nmp 26 | */ 27 | public interface TimestampSource { 28 | 29 | /** 30 | * Generates a new timestamp. 31 | * 32 | * @return 33 | */ 34 | T generateNew(); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src-core/swift/crdt/AcquireLockUpdate.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import swift.crdt.core.CRDTUpdate; 4 | 5 | public class AcquireLockUpdate implements CRDTUpdate { 6 | 7 | private String ownerId; 8 | private LockType type; 9 | 10 | public AcquireLockUpdate(String ownerId, LockType type) { 11 | this.ownerId = ownerId; 12 | this.type = type; 13 | } 14 | 15 | @Override 16 | public void applyTo(SharedLockCRDT crdt) { 17 | crdt.applyAcquireLock(this); 18 | } 19 | 20 | protected String getOwnerId() { 21 | return ownerId; 22 | } 23 | 24 | protected void setOwnerId(String ownerId) { 25 | this.ownerId = ownerId; 26 | } 27 | 28 | protected LockType getType() { 29 | return type; 30 | } 31 | 32 | protected void setType(LockType type) { 33 | this.type = type; 34 | } 35 | 36 | @Override 37 | public Object getValueWithoutMetadata() { 38 | // TODO Auto-generated method stub 39 | return null; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src-core/swift/crdt/AddOnlySetCRDT.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import java.util.HashSet; 4 | import java.util.Set; 5 | 6 | import swift.clocks.CausalityClock; 7 | import swift.crdt.core.CRDTIdentifier; 8 | import swift.crdt.core.TxnHandle; 9 | 10 | /** 11 | * A generic add-only set. 12 | * 13 | * @author mzawirsk 14 | * @param 15 | * elements type 16 | */ 17 | public class AddOnlySetCRDT extends AbstractAddOnlySetCRDT, V> { 18 | // Kryo 19 | public AddOnlySetCRDT() { 20 | } 21 | 22 | public AddOnlySetCRDT(CRDTIdentifier id) { 23 | super(id); 24 | } 25 | 26 | private AddOnlySetCRDT(CRDTIdentifier id, TxnHandle txn, CausalityClock clock, Set elements) { 27 | super(id, txn, clock, elements); 28 | } 29 | 30 | @Override 31 | public AddOnlySetCRDT copy() { 32 | return new AddOnlySetCRDT(id, txn, clock, new HashSet(elements)); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src-core/swift/crdt/AddOnlySetUpdate.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import swift.crdt.core.CRDTUpdate; 4 | 5 | public class AddOnlySetUpdate, V> implements CRDTUpdate { 6 | protected V element; 7 | 8 | // Kryo 9 | public AddOnlySetUpdate() { 10 | } 11 | 12 | public AddOnlySetUpdate(V element) { 13 | this.element = element; 14 | } 15 | 16 | @Override 17 | public void applyTo(I crdt) { 18 | crdt.applyAdd(element); 19 | } 20 | 21 | @Override 22 | public Object getValueWithoutMetadata() { 23 | return element; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src-core/swift/crdt/AddOnlyStringSetUpdate.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import com.esotericsoftware.kryo.Kryo; 4 | import com.esotericsoftware.kryo.KryoSerializable; 5 | import com.esotericsoftware.kryo.io.Input; 6 | import com.esotericsoftware.kryo.io.Output; 7 | 8 | public class AddOnlyStringSetUpdate extends AddOnlySetUpdate implements KryoSerializable { 9 | // Kryo 10 | public AddOnlyStringSetUpdate() { 11 | } 12 | 13 | public AddOnlyStringSetUpdate(String element) { 14 | super(element); 15 | } 16 | 17 | @Override 18 | public void read(Kryo kryo, Input input) { 19 | element = input.readString(); 20 | } 21 | 22 | @Override 23 | public void write(Kryo kryo, Output output) { 24 | output.writeString(element); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src-core/swift/crdt/AddWinsIdSetUpdate.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import java.util.Set; 4 | 5 | import com.esotericsoftware.kryo.Kryo; 6 | import com.esotericsoftware.kryo.KryoSerializable; 7 | import com.esotericsoftware.kryo.io.Input; 8 | import com.esotericsoftware.kryo.io.Output; 9 | 10 | import swift.clocks.TripleTimestamp; 11 | import swift.crdt.core.CRDTIdentifier; 12 | 13 | public class AddWinsIdSetUpdate extends AddWinsSetUpdate implements KryoSerializable { 14 | // Kryo-use only 15 | public AddWinsIdSetUpdate() { 16 | } 17 | 18 | public AddWinsIdSetUpdate(CRDTIdentifier val, TripleTimestamp newInstance, Set removedInstances) { 19 | super(val, newInstance, removedInstances); 20 | } 21 | 22 | @Override 23 | protected void writeElement(Kryo kryo, Output output) { 24 | val.write(kryo, output); 25 | } 26 | 27 | @Override 28 | protected void readElement(Kryo kryo, Input input) { 29 | val = new CRDTIdentifier(); 30 | val.read(kryo, input); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src-core/swift/crdt/AddWinsMessageSetUpdate.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import java.util.Set; 4 | 5 | import swift.application.social.Message; 6 | import swift.clocks.TripleTimestamp; 7 | 8 | import com.esotericsoftware.kryo.Kryo; 9 | import com.esotericsoftware.kryo.KryoSerializable; 10 | import com.esotericsoftware.kryo.io.Input; 11 | import com.esotericsoftware.kryo.io.Output; 12 | 13 | public class AddWinsMessageSetUpdate extends AddWinsSetUpdate implements 14 | KryoSerializable { 15 | // Kryo-use only 16 | public AddWinsMessageSetUpdate() { 17 | } 18 | 19 | public AddWinsMessageSetUpdate(Message val, TripleTimestamp newInstance, Set removedInstances) { 20 | super(val, newInstance, removedInstances); 21 | } 22 | 23 | @Override 24 | protected void writeElement(Kryo kryo, Output output) { 25 | val.write(kryo, output); 26 | } 27 | 28 | @Override 29 | protected void readElement(Kryo kryo, Input input) { 30 | val = new Message(); 31 | val.read(kryo, input); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src-core/swift/crdt/BoundedCounterDecrement.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import swift.crdt.core.CRDTUpdate; 4 | 5 | public class BoundedCounterDecrement> implements CRDTUpdate { 6 | 7 | private int amount; 8 | private String siteId; 9 | 10 | public BoundedCounterDecrement() { 11 | 12 | } 13 | 14 | public BoundedCounterDecrement(String siteId, int amount) { 15 | this.amount = amount; 16 | this.siteId = siteId; 17 | } 18 | 19 | @Override 20 | public void applyTo(T crdt) { 21 | crdt.applyDec(this); 22 | } 23 | 24 | protected int getAmount() { 25 | return amount; 26 | } 27 | 28 | protected void setAmount(int amount) { 29 | this.amount = amount; 30 | } 31 | 32 | protected String getSiteId() { 33 | return siteId; 34 | } 35 | 36 | protected void setSiteId(String siteId) { 37 | this.siteId = siteId; 38 | } 39 | 40 | @Override 41 | public Object getValueWithoutMetadata() { 42 | // TODO Auto-generated method stub 43 | return null; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src-core/swift/crdt/BoundedCounterIncrement.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import swift.crdt.core.CRDTUpdate; 4 | 5 | public class BoundedCounterIncrement> implements CRDTUpdate { 6 | 7 | private int amount; 8 | private String siteId; 9 | 10 | public BoundedCounterIncrement() { 11 | 12 | } 13 | 14 | public BoundedCounterIncrement(String siteId, int amount) { 15 | this.amount = amount; 16 | this.siteId = siteId; 17 | } 18 | 19 | @Override 20 | public void applyTo(T crdt) { 21 | crdt.applyInc(this); 22 | } 23 | 24 | protected int getAmount() { 25 | return amount; 26 | } 27 | 28 | protected void setAmount(int amount) { 29 | this.amount = amount; 30 | } 31 | 32 | protected String getSiteId() { 33 | return siteId; 34 | } 35 | 36 | protected void setSiteId(String siteId) { 37 | this.siteId = siteId; 38 | } 39 | 40 | @Override 41 | public Object getValueWithoutMetadata() { 42 | // TODO Auto-generated method stub 43 | return null; 44 | } 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src-core/swift/crdt/BoundedCounterTransfer.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import swift.crdt.core.CRDTUpdate; 4 | 5 | public class BoundedCounterTransfer> implements CRDTUpdate { 6 | 7 | private String originId, targetId; 8 | private int amount; 9 | 10 | public BoundedCounterTransfer() { 11 | 12 | } 13 | 14 | public BoundedCounterTransfer(String originId, String targetId, int amount) { 15 | this.originId = originId; 16 | this.targetId = targetId; 17 | this.amount = amount; 18 | } 19 | 20 | @Override 21 | public void applyTo(T crdt) { 22 | crdt.applyTransfer(this); 23 | 24 | } 25 | 26 | protected String getOriginId() { 27 | return originId; 28 | } 29 | 30 | protected void setOriginId(String originId) { 31 | this.originId = originId; 32 | } 33 | 34 | protected String getTargetId() { 35 | return targetId; 36 | } 37 | 38 | protected void setTargetId(String targetId) { 39 | this.targetId = targetId; 40 | } 41 | 42 | protected int getAmount() { 43 | return amount; 44 | } 45 | 46 | protected void setAmount(int amount) { 47 | this.amount = amount; 48 | } 49 | 50 | @Override 51 | public Object getValueWithoutMetadata() { 52 | // TODO Auto-generated method stub 53 | return null; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src-core/swift/crdt/IncompatibleLockException.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | public class IncompatibleLockException extends RuntimeException { 4 | 5 | private static final long serialVersionUID = 1L; 6 | 7 | public IncompatibleLockException(String msg) { 8 | super(msg); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src-core/swift/crdt/IntegerUpdate.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.crdt; 18 | 19 | import swift.crdt.core.CRDTUpdate; 20 | 21 | public class IntegerUpdate implements CRDTUpdate { 22 | protected int delta; 23 | 24 | // required for kryo 25 | public IntegerUpdate() { 26 | } 27 | 28 | public IntegerUpdate(int val) { 29 | this.delta = val; 30 | } 31 | 32 | public int getVal() { 33 | return this.delta; 34 | } 35 | 36 | @Override 37 | public void applyTo(IntegerCRDT crdt) { 38 | crdt.applyAdd(delta); 39 | } 40 | 41 | @Override 42 | public Object getValueWithoutMetadata() { 43 | return delta; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src-core/swift/crdt/IntegerValueQuery.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.crdt; 18 | 19 | import swift.crdt.core.CRDTQuery; 20 | 21 | public class IntegerValueQuery implements CRDTQuery { 22 | 23 | @Override 24 | public Integer executeAt(IntegerCRDT crdt) { 25 | return crdt.getValue(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src-core/swift/crdt/LWWStringMapRegisterUpdate.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map.Entry; 5 | 6 | import swift.clocks.TripleTimestamp; 7 | 8 | import com.esotericsoftware.kryo.Kryo; 9 | import com.esotericsoftware.kryo.KryoSerializable; 10 | import com.esotericsoftware.kryo.io.Input; 11 | import com.esotericsoftware.kryo.io.Output; 12 | 13 | public class LWWStringMapRegisterUpdate extends LWWRegisterUpdate, LWWStringMapRegisterCRDT> 14 | implements KryoSerializable { 15 | // Kryo-use only 16 | public LWWStringMapRegisterUpdate() { 17 | } 18 | 19 | public LWWStringMapRegisterUpdate(long registerTimestamp, TripleTimestamp tiebreakingTimestamp, 20 | HashMap val) { 21 | super(registerTimestamp, tiebreakingTimestamp, val); 22 | } 23 | 24 | @Override 25 | protected void writeValue(Kryo kryo, Output output) { 26 | output.writeVarInt(val.size(), true); 27 | for (Entry entry : val.entrySet()) { 28 | output.writeString(entry.getKey()); 29 | output.writeString(entry.getValue()); 30 | } 31 | } 32 | 33 | @Override 34 | protected void readValue(Kryo kryo, Input input) { 35 | final int valSize = input.readVarInt(true); 36 | val = new HashMap<>(valSize); 37 | for (int i = 0; i < valSize; i++) { 38 | String key = input.readString(); 39 | String value = input.readString(); 40 | val.put(key, value); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src-core/swift/crdt/LWWStringRegisterUpdate.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import swift.clocks.TripleTimestamp; 4 | 5 | import com.esotericsoftware.kryo.Kryo; 6 | import com.esotericsoftware.kryo.KryoSerializable; 7 | import com.esotericsoftware.kryo.io.Input; 8 | import com.esotericsoftware.kryo.io.Output; 9 | 10 | public class LWWStringRegisterUpdate extends LWWRegisterUpdate implements 11 | KryoSerializable { 12 | // Kryo-use only 13 | public LWWStringRegisterUpdate() { 14 | } 15 | 16 | public LWWStringRegisterUpdate(long registerTimestamp, TripleTimestamp tiebreakingTimestamp, String val) { 17 | super(registerTimestamp, tiebreakingTimestamp, val); 18 | } 19 | 20 | @Override 21 | protected void writeValue(Kryo kryo, Output output) { 22 | output.writeString(val); 23 | } 24 | 25 | @Override 26 | protected void readValue(Kryo kryo, Input input) { 27 | val = input.readString(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src-core/swift/crdt/LWWUserRegisterUpdate.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import swift.application.social.User; 4 | import swift.clocks.TripleTimestamp; 5 | 6 | import com.esotericsoftware.kryo.Kryo; 7 | import com.esotericsoftware.kryo.KryoSerializable; 8 | import com.esotericsoftware.kryo.io.Input; 9 | import com.esotericsoftware.kryo.io.Output; 10 | 11 | public class LWWUserRegisterUpdate extends LWWRegisterUpdate implements KryoSerializable { 12 | // Kryo-use only 13 | public LWWUserRegisterUpdate() { 14 | } 15 | 16 | public LWWUserRegisterUpdate(long registerTimestamp, TripleTimestamp tiebreakingTimestamp, User val) { 17 | super(registerTimestamp, tiebreakingTimestamp, val); 18 | } 19 | 20 | @Override 21 | protected void writeValue(Kryo kryo, Output output) { 22 | val.write(kryo, output); 23 | } 24 | 25 | @Override 26 | protected void readValue(Kryo kryo, Input input) { 27 | val = new User(); 28 | val.read(kryo, input); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src-core/swift/crdt/LockType.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | public enum LockType { 4 | EXCLUSIVE_ALLOW, ALLOW, FORBID; 5 | } 6 | -------------------------------------------------------------------------------- /src-core/swift/crdt/MaxCRDT.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import swift.clocks.CausalityClock; 4 | import swift.crdt.core.BaseCRDT; 5 | import swift.crdt.core.CRDTIdentifier; 6 | import swift.crdt.core.TxnHandle; 7 | 8 | /** 9 | * Maximum CRDT object. 10 | * 11 | * @author mzawirsk 12 | * 13 | * @param 14 | * a comparable type of value 15 | */ 16 | class MaxCRDT> extends BaseCRDT> { 17 | V max; 18 | 19 | public MaxCRDT() { 20 | } 21 | 22 | public MaxCRDT(CRDTIdentifier id) { 23 | super(id, null, null); 24 | } 25 | 26 | private MaxCRDT(CRDTIdentifier id, TxnHandle txn, CausalityClock clock, V max) { 27 | super(id, txn, clock); 28 | this.max = max; 29 | } 30 | 31 | public void set(V value) { 32 | if (max == null || value.compareTo(max) > 0) { 33 | registerLocalOperation(new MaxUpdate(value)); 34 | } 35 | } 36 | 37 | public void applySet(V value) { 38 | if (max == null || value.compareTo(max) > 0) { 39 | max = value; 40 | } 41 | } 42 | 43 | /** 44 | * @return maximum assigned ({@link #set(Comparable)}) value, or null if 45 | * there was no assignment so far 46 | */ 47 | @Override 48 | public V getValue() { 49 | return max; 50 | } 51 | 52 | @Override 53 | public MaxCRDT copy() { 54 | return new MaxCRDT(id, txn, clock, max); 55 | } 56 | } -------------------------------------------------------------------------------- /src-core/swift/crdt/MaxUpdate.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import swift.crdt.core.CRDTUpdate; 4 | 5 | public class MaxUpdate> implements CRDTUpdate> { 6 | V value; 7 | 8 | public MaxUpdate(V value) { 9 | this.value = value; 10 | } 11 | 12 | @Override 13 | public void applyTo(MaxCRDT crdt) { 14 | crdt.applySet(value); 15 | } 16 | 17 | @Override 18 | public Object getValueWithoutMetadata() { 19 | return value; 20 | } 21 | } -------------------------------------------------------------------------------- /src-core/swift/crdt/PreferOwnerPolicy.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | public class PreferOwnerPolicy implements PreferenceListPolicy { 7 | 8 | @Override 9 | public List getPreferenceList(SharedLockCRDT lock) { 10 | String primaryOwner = lock.getPrimaryOwner(); 11 | ArrayList prefrredOwners = new ArrayList(lock.getCurrentOwners()); 12 | prefrredOwners.add(0, primaryOwner); 13 | return prefrredOwners; 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src-core/swift/crdt/PreferenceListPolicy.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import java.util.List; 4 | 5 | public interface PreferenceListPolicy { 6 | 7 | public List getPreferenceList(SharedLockCRDT lock); 8 | 9 | } 10 | -------------------------------------------------------------------------------- /src-core/swift/crdt/PutOnlyLWWMapUpdate.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import swift.clocks.TripleTimestamp; 4 | import swift.crdt.core.CRDTUpdate; 5 | 6 | public class PutOnlyLWWMapUpdate> implements CRDTUpdate { 7 | protected K key; 8 | protected V val; 9 | protected long registerTimestamp; 10 | protected TripleTimestamp tiebreakingTimestamp; 11 | 12 | // required for kryo 13 | public PutOnlyLWWMapUpdate() { 14 | } 15 | 16 | public PutOnlyLWWMapUpdate(K key, long registerTimestamp, TripleTimestamp tiebreakingTimestamp, V val) { 17 | this.key = key; 18 | this.registerTimestamp = registerTimestamp; 19 | this.tiebreakingTimestamp = tiebreakingTimestamp; 20 | this.val = val; 21 | } 22 | 23 | @Override 24 | public void applyTo(T map) { 25 | map.applyPut(key, registerTimestamp, tiebreakingTimestamp, val); 26 | } 27 | 28 | @Override 29 | public Object getValueWithoutMetadata() { 30 | // TODO: check if it works with Kryo 31 | return new Object[] { key, val }; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src-core/swift/crdt/PutOnlyLWWStringMapUpdate.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import com.esotericsoftware.kryo.Kryo; 4 | import com.esotericsoftware.kryo.KryoSerializable; 5 | import com.esotericsoftware.kryo.io.Input; 6 | import com.esotericsoftware.kryo.io.Output; 7 | 8 | import swift.clocks.TripleTimestamp; 9 | 10 | public class PutOnlyLWWStringMapUpdate extends PutOnlyLWWMapUpdate implements 11 | KryoSerializable { 12 | 13 | public PutOnlyLWWStringMapUpdate() { 14 | // Kryo-use only 15 | } 16 | 17 | public PutOnlyLWWStringMapUpdate(String key, long timestamp, TripleTimestamp timestampTiebreaker, String val) { 18 | super(key, timestamp, timestampTiebreaker, val); 19 | } 20 | 21 | @Override 22 | public void write(Kryo kryo, Output output) { 23 | output.writeString(key); 24 | output.writeString(val); 25 | output.writeLong(registerTimestamp); 26 | tiebreakingTimestamp.write(kryo, output); 27 | } 28 | 29 | @Override 30 | public void read(Kryo kryo, Input input) { 31 | key = input.readString(); 32 | val = input.readString(); 33 | registerTimestamp = input.readLong(); 34 | tiebreakingTimestamp = new TripleTimestamp(); 35 | tiebreakingTimestamp.read(kryo, input); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src-core/swift/crdt/RegisterValueQuery.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.crdt; 18 | 19 | import swift.crdt.core.CRDTQuery; 20 | import swift.crdt.core.Copyable; 21 | 22 | public class RegisterValueQuery implements CRDTQuery> { 23 | @Override 24 | public V executeAt(LWWRegisterCRDT crdtVersion) { 25 | return crdtVersion.getValue(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /src-core/swift/crdt/ReleaseLockUpdate.java: -------------------------------------------------------------------------------- 1 | package swift.crdt; 2 | 3 | import swift.crdt.core.CRDTUpdate; 4 | 5 | public class ReleaseLockUpdate implements CRDTUpdate { 6 | 7 | private String ownerId; 8 | private LockType type; 9 | 10 | public ReleaseLockUpdate(String ownerId, LockType type) { 11 | this.ownerId = ownerId; 12 | this.type = type; 13 | } 14 | 15 | @Override 16 | public void applyTo(SharedLockCRDT crdt) { 17 | crdt.applyReleaseLock(this); 18 | } 19 | 20 | protected String getOwnerId() { 21 | return ownerId; 22 | } 23 | 24 | protected void setOwnerId(String ownerId) { 25 | this.ownerId = ownerId; 26 | } 27 | 28 | protected LockType getType() { 29 | return type; 30 | } 31 | 32 | protected void setType(LockType type) { 33 | this.type = type; 34 | } 35 | 36 | @Override 37 | public Object getValueWithoutMetadata() { 38 | // TODO Auto-generated method stub 39 | return null; 40 | } 41 | 42 | } -------------------------------------------------------------------------------- /src-core/swift/crdt/SetLookupQuery.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.crdt; 18 | 19 | import swift.crdt.core.CRDTQuery; 20 | 21 | public class SetLookupQuery> implements CRDTQuery { 22 | protected V element; 23 | 24 | public SetLookupQuery(V element) { 25 | this.element = element; 26 | } 27 | 28 | @Override 29 | public Object executeAt(T crdtVersion) { 30 | return crdtVersion.lookup(element); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src-core/swift/crdt/SetValueQuery.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.crdt; 18 | 19 | import swift.crdt.core.CRDTQuery; 20 | 21 | public class SetValueQuery> implements CRDTQuery { 22 | @Override 23 | public Object executeAt(T crdtVersion) { 24 | return crdtVersion.getValue(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src-core/swift/crdt/core/BulkGetProgressListener.java: -------------------------------------------------------------------------------- 1 | package swift.crdt.core; 2 | 3 | 4 | public interface BulkGetProgressListener { 5 | 6 | void onGet(final TxnHandle txn, final CRDTIdentifier id, CRDT view); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /src-core/swift/crdt/core/CRDTQuery.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.crdt.core; 18 | 19 | public interface CRDTQuery> { 20 | Object executeAt(V crdtVersion); 21 | } 22 | -------------------------------------------------------------------------------- /src-core/swift/crdt/core/CRDTUpdate.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.crdt.core; 18 | 19 | /** 20 | * Basic interface for representing an update operation on a CRDT. Immutable. 21 | * 22 | * @author nmp, annettebieniusa, mzawirsk 23 | */ 24 | public interface CRDTUpdate> { 25 | /** 26 | * Applies operation to the given object instance. 27 | * 28 | * @param crdt 29 | * object where operation is applied 30 | */ 31 | void applyTo(V crdt); 32 | 33 | /** 34 | * @return estimated size of pure "value" in the update, as opposed to 35 | * metadata; for PERFORMANCE MEASUREMENTS purposes only, return null 36 | * if in doubt 37 | */ 38 | Object getValueWithoutMetadata(); 39 | } 40 | -------------------------------------------------------------------------------- /src-core/swift/crdt/core/Copyable.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.crdt.core; 18 | 19 | /** 20 | * Interface for deep copy operation. 21 | * 22 | * @author annettebieniusa 23 | * 24 | * @param 25 | */ 26 | public interface Copyable { 27 | /** 28 | * Creates a deep copy of the object. 29 | * 30 | * @return object copy 31 | */ 32 | Object copy(); 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src-core/swift/dc/db/DCNodeDatabase.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.dc.db; 18 | 19 | import java.util.Properties; 20 | 21 | import swift.crdt.core.CRDTIdentifier; 22 | import swift.dc.CRDTData; 23 | 24 | public interface DCNodeDatabase { 25 | 26 | void sync(boolean flag); 27 | 28 | boolean ramOnly(); 29 | 30 | void init(Properties props); 31 | 32 | CRDTData read(CRDTIdentifier id); 33 | 34 | boolean write(CRDTIdentifier id, CRDTData data); 35 | 36 | Object readSysData(String table, String key); 37 | 38 | boolean writeSysData(String table, String key, Object data); 39 | } 40 | -------------------------------------------------------------------------------- /src-core/swift/exceptions/CvRDTSerializationException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.exceptions; 18 | 19 | public class CvRDTSerializationException extends Exception { 20 | 21 | private static final long serialVersionUID = 1L; 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src-core/swift/exceptions/IncompatibleTypeException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.exceptions; 18 | 19 | @SuppressWarnings("serial") 20 | public class IncompatibleTypeException extends Exception { 21 | public IncompatibleTypeException(final Exception e) { 22 | super(e); 23 | } 24 | 25 | public IncompatibleTypeException() { 26 | super(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src-core/swift/exceptions/NetworkException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.exceptions; 18 | 19 | public class NetworkException extends SwiftException { 20 | /** 21 | * 22 | */ 23 | private static final long serialVersionUID = 1231199243385467538L; 24 | 25 | public NetworkException(String message) { 26 | super(message); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src-core/swift/exceptions/NoSuchObjectException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.exceptions; 18 | 19 | public class NoSuchObjectException extends SwiftException { 20 | /** 21 | * 22 | */ 23 | private static final long serialVersionUID = 5997340774968214678L; 24 | 25 | public NoSuchObjectException(Exception exception) { 26 | super(exception); 27 | } 28 | 29 | public NoSuchObjectException(String string) { 30 | super(string); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src-core/swift/exceptions/NotSupportedOperationException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.exceptions; 18 | 19 | @SuppressWarnings("serial") 20 | public class NotSupportedOperationException extends RuntimeException { 21 | 22 | public NotSupportedOperationException(String msg) { 23 | super(msg); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src-core/swift/exceptions/SwiftException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.exceptions; 18 | 19 | public class SwiftException extends Exception { 20 | public SwiftException(String message) { 21 | super(message); 22 | } 23 | 24 | public SwiftException(Exception exception) { 25 | super(exception); 26 | } 27 | 28 | private static final long serialVersionUID = -4007786119262519915L; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src-core/swift/exceptions/VersionNotFoundException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.exceptions; 18 | 19 | public class VersionNotFoundException extends SwiftException { 20 | /** 21 | * 22 | */ 23 | private static final long serialVersionUID = 1231199243385467538L; 24 | 25 | public VersionNotFoundException(String message) { 26 | super(message); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src-core/swift/exceptions/WrongTypeException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.exceptions; 18 | 19 | public class WrongTypeException extends SwiftException { 20 | 21 | public WrongTypeException(String message) { 22 | super(message); 23 | // TODO Auto-generated constructor stub 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src-core/swift/proto/MetadataSamplable.java: -------------------------------------------------------------------------------- 1 | package swift.proto; 2 | 3 | /** 4 | * A message that can provide a sample of metadata size it carries. 5 | * 6 | * @author mzawirsk 7 | */ 8 | public interface MetadataSamplable { 9 | 10 | /** 11 | * Records metadata size statistics for this object if the colletor is 12 | * enabled 13 | */ 14 | public void recordMetadataSample(MetadataStatsCollector collector); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src-core/swift/pubsub/FifoQueues.java: -------------------------------------------------------------------------------- 1 | package swift.pubsub; 2 | 3 | import java.util.concurrent.ConcurrentHashMap; 4 | 5 | import swift.crdt.core.CRDTIdentifier; 6 | import sys.pubsub.PubSub; 7 | import sys.pubsub.PubSubNotification; 8 | import sys.utils.FifoQueue; 9 | 10 | public class FifoQueues { 11 | 12 | public FifoQueue> queueFor(Object id, 13 | final PubSub.Subscriber subscriber) { 14 | FifoQueue> res = fifoQueues.get(id), nq; 15 | if (res == null) { 16 | res = fifoQueues.putIfAbsent(id, nq = new FifoQueue>() { 17 | public void process(PubSubNotification event) { 18 | event.notifyTo(subscriber); 19 | } 20 | }); 21 | if (res == null) 22 | res = nq; 23 | } 24 | return res; 25 | } 26 | 27 | final ConcurrentHashMap>> fifoQueues = new ConcurrentHashMap>>(); 28 | } 29 | -------------------------------------------------------------------------------- /src-core/swift/pubsub/SwiftSubscriber.java: -------------------------------------------------------------------------------- 1 | package swift.pubsub; 2 | 3 | import swift.crdt.core.CRDTIdentifier; 4 | import sys.pubsub.PubSub.Subscriber; 5 | import sys.pubsub.PubSubNotification; 6 | 7 | public interface SwiftSubscriber extends Subscriber { 8 | void onNotification(UpdateNotification evt); 9 | 10 | void onNotification(BatchUpdatesNotification evt); 11 | 12 | void onNotification(PubSubNotification evt); 13 | } 14 | -------------------------------------------------------------------------------- /src-core/swift/pubsub/UpdateNotification.java: -------------------------------------------------------------------------------- 1 | package swift.pubsub; 2 | 3 | import java.util.Set; 4 | 5 | import swift.clocks.CausalityClock; 6 | import swift.crdt.core.CRDTIdentifier; 7 | import swift.proto.ObjectUpdatesInfo; 8 | import swift.proto.SwiftProtocolHandler; 9 | import sys.net.api.rpc.RpcHandle; 10 | import sys.net.api.rpc.RpcHandler; 11 | import sys.pubsub.PubSub.Subscriber; 12 | import sys.pubsub.PubSubNotification; 13 | 14 | public class UpdateNotification extends PubSubNotification { 15 | 16 | // TODO: lots of redundant things on the wire? 17 | public ObjectUpdatesInfo info; 18 | public CausalityClock dcVersion; 19 | 20 | UpdateNotification() { 21 | } 22 | 23 | public UpdateNotification(Object srcId, ObjectUpdatesInfo info, CausalityClock dcVersion) { 24 | super(srcId); 25 | this.info = info; 26 | this.dcVersion = dcVersion; 27 | } 28 | 29 | @Override 30 | public CRDTIdentifier key() { 31 | return info.getId(); 32 | } 33 | 34 | @Override 35 | public Set keys() { 36 | return null; 37 | } 38 | 39 | public CausalityClock dcVersion() { 40 | return dcVersion; 41 | } 42 | 43 | @Override 44 | public void notifyTo(Subscriber subscriber) { 45 | ((SwiftSubscriber) subscriber).onNotification(this); 46 | } 47 | 48 | @Override 49 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 50 | ((SwiftProtocolHandler) handler).onReceive(this); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src-core/swift/test/microbenchmark/BenchOperation.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.test.microbenchmark; 18 | 19 | import swift.crdt.core.CRDTIdentifier; 20 | 21 | public class BenchOperation { 22 | private CRDTIdentifier identifier; 23 | private V value; 24 | private OpType type; 25 | 26 | public BenchOperation(CRDTIdentifier identifier, V value, OpType type) { 27 | super(); 28 | this.identifier = identifier; 29 | this.value = value; 30 | this.type = type; 31 | } 32 | 33 | public CRDTIdentifier getIdentifier() { 34 | return identifier; 35 | } 36 | 37 | public V getValue() { 38 | return value; 39 | } 40 | 41 | public OpType getType() { 42 | return type; 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /src-core/swift/test/microbenchmark/MicroBenchmark.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.test.microbenchmark; 18 | 19 | public class MicroBenchmark { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src-core/swift/test/microbenchmark/OpType.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.test.microbenchmark; 18 | 19 | public enum OpType { 20 | READ_ONLY, UPDATE, INSERT, DELETE, 21 | } 22 | -------------------------------------------------------------------------------- /src-core/swift/test/microbenchmark/interfaces/MicroBenchmarkWorker.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.test.microbenchmark.interfaces; 18 | 19 | import swift.test.microbenchmark.RawDataCollector; 20 | 21 | public interface MicroBenchmarkWorker extends Runnable { 22 | 23 | void stop(); 24 | 25 | ResultHandler getResults(); 26 | 27 | RawDataCollector getRawData(); 28 | 29 | String getWorkerID(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src-core/swift/test/microbenchmark/interfaces/ResultHandler.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.test.microbenchmark.interfaces; 18 | 19 | public interface ResultHandler { 20 | 21 | public double getExecutionTime(); 22 | 23 | public int getNumExecutedTransactions(); 24 | 25 | public int getWriteOps(); 26 | 27 | public int getReadOps(); 28 | 29 | public String getWorkerID(); 30 | // public String getRawResults(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src-core/swift/test/microbenchmark/interfaces/WorkerManager.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.test.microbenchmark.interfaces; 18 | 19 | import swift.test.microbenchmark.RawDataCollector; 20 | 21 | public interface WorkerManager { 22 | 23 | public void onWorkerStart(MicroBenchmarkWorker worker); 24 | 25 | public void onWorkerFinish(MicroBenchmarkWorker worker); 26 | 27 | public RawDataCollector getNewRawDataCollector(String workerName, int runCount, String outputDir); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src-core/swift/test/microbenchmark/objects/StringCopyable.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.test.microbenchmark.objects; 18 | 19 | import swift.crdt.core.Copyable; 20 | 21 | public class StringCopyable implements Copyable { 22 | 23 | private String value; 24 | 25 | public StringCopyable() { 26 | 27 | } 28 | 29 | public StringCopyable(String value) { 30 | this.value = value; 31 | } 32 | 33 | @Override 34 | public Object copy() { 35 | return new StringCopyable(value); 36 | } 37 | 38 | public String getValue() { 39 | return value; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return value; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src-core/swift/utils/DummyLog.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.utils; 18 | 19 | /** 20 | * No-op DurableLog implementation. 21 | * 22 | * @author mzawirski 23 | */ 24 | public class DummyLog implements TransactionsLog { 25 | @Override 26 | public void writeEntry(final long transactionId, final Object entry) { 27 | // no-op 28 | } 29 | 30 | @Override 31 | public void flush() { 32 | // no-op 33 | } 34 | 35 | @Override 36 | public void close() { 37 | // no-op 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src-core/swift/utils/FutureResultHandler.java: -------------------------------------------------------------------------------- 1 | package swift.utils; 2 | 3 | public interface FutureResultHandler { 4 | public void onResult(final V result); 5 | } 6 | -------------------------------------------------------------------------------- /src-core/swift/utils/NoFlushLogDecorator.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package swift.utils; 18 | 19 | /** 20 | * TransactionalLog decorator that discard all flush requests. 21 | */ 22 | public class NoFlushLogDecorator implements TransactionsLog { 23 | private TransactionsLog implementation; 24 | 25 | public NoFlushLogDecorator(TransactionsLog implementation) { 26 | this.implementation = implementation; 27 | } 28 | 29 | @Override 30 | public void writeEntry(long transactionId, Object entry) { 31 | implementation.writeEntry(transactionId, entry); 32 | } 33 | 34 | @Override 35 | public void flush() { 36 | // no-op 37 | } 38 | 39 | @Override 40 | public void close() { 41 | implementation.close(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src-core/sys/RpcServices.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys; 18 | 19 | public enum RpcServices { 20 | SWIFT, PUBSUB, CATADUPA, DHT, TITAN 21 | } 22 | -------------------------------------------------------------------------------- /src-core/sys/herd/proto/GrazingAccepted.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.herd.proto; 18 | 19 | import sys.net.api.rpc.RpcHandle; 20 | import sys.net.api.rpc.RpcHandler; 21 | import sys.net.api.rpc.RpcMessage; 22 | 23 | public class GrazingAccepted implements RpcMessage { 24 | 25 | public GrazingAccepted() { 26 | } 27 | 28 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 29 | ((ShepardProtoHandler) handler).onReceive(this); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src-core/sys/herd/proto/GrazingRequest.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.herd.proto; 18 | 19 | import sys.net.api.rpc.RpcHandle; 20 | import sys.net.api.rpc.RpcHandler; 21 | import sys.net.api.rpc.RpcMessage; 22 | 23 | public class GrazingRequest implements RpcMessage { 24 | 25 | public GrazingRequest() { 26 | } 27 | 28 | @Override 29 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 30 | ((ShepardProtoHandler) handler).onReceive(handle, this); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src-core/sys/herd/proto/HerdProtoHandler.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.herd.proto; 18 | 19 | import sys.net.api.rpc.RpcHandle; 20 | 21 | public class HerdProtoHandler extends ShepardProtoHandler { 22 | 23 | public void onReceive(RpcHandle client, JoinHerdRequest r) { 24 | Thread.dumpStack(); 25 | } 26 | 27 | public void onReceive(JoinHerdReply r) { 28 | Thread.dumpStack(); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src-core/sys/herd/proto/HerdQueryReply.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.herd.proto; 18 | 19 | import sys.net.api.rpc.RpcHandle; 20 | import sys.net.api.rpc.RpcHandler; 21 | import sys.net.api.rpc.RpcMessage; 22 | 23 | public class HerdQueryReply implements RpcMessage { 24 | 25 | public HerdQueryReply() { 26 | } 27 | 28 | @Override 29 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 30 | ((ShepardProtoHandler) handler).onReceive(handle, this); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src-core/sys/herd/proto/HerdQueryRequest.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.herd.proto; 18 | 19 | import sys.net.api.rpc.RpcHandle; 20 | import sys.net.api.rpc.RpcHandler; 21 | import sys.net.api.rpc.RpcMessage; 22 | 23 | public class HerdQueryRequest implements RpcMessage { 24 | 25 | public HerdQueryRequest() { 26 | } 27 | 28 | @Override 29 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 30 | ((ShepardProtoHandler) handler).onReceive(handle, this); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src-core/sys/net/api/NetworkingException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.net.api; 18 | 19 | /** 20 | * 21 | * A generic exception for wrapping assorted networking-related errors. 22 | * 23 | * @author smd 24 | * 25 | */ 26 | public class NetworkingException extends RuntimeException { 27 | 28 | private static final long serialVersionUID = 1L; 29 | 30 | public NetworkingException(final String cause) { 31 | super(cause); 32 | } 33 | 34 | public NetworkingException(final Throwable t) { 35 | super(t); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src-core/sys/net/api/SerializerException.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.net.api; 18 | 19 | /** 20 | * 21 | * A generic exception for wrapping assorted serialization errors. Currently 22 | * unchecked... 23 | * 24 | * @author smd (smd@fct.unl.pt) 25 | * 26 | */ 27 | public class SerializerException extends RuntimeException { 28 | 29 | private static final long serialVersionUID = 1L; 30 | 31 | public SerializerException(final String cause) { 32 | super(cause); 33 | } 34 | 35 | public SerializerException(final Throwable t) { 36 | super(t); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src-core/sys/net/api/rpc/AbstractRpcHandler.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.net.api.rpc; 18 | 19 | /** 20 | * 21 | * A convenience class for creating anonymous classes for processing invocations 22 | * involving specific message classes 23 | * 24 | * @author smd 25 | * 26 | */ 27 | abstract public class AbstractRpcHandler implements RpcHandler { 28 | 29 | @Override 30 | public void onFailure(final RpcHandle h) { 31 | Thread.dumpStack(); 32 | } 33 | 34 | @Override 35 | public void onReceive(final RpcMessage m) { 36 | Thread.dumpStack(); 37 | } 38 | 39 | @Override 40 | public void onReceive(final RpcHandle h, final RpcMessage m) { 41 | Thread.dumpStack(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src-core/sys/net/api/rpc/RpcHandler.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.net.api.rpc; 18 | 19 | /** 20 | * 21 | * 22 | * @author smduarte 23 | * 24 | */ 25 | public interface RpcHandler { 26 | 27 | void onReceive(final RpcMessage m); 28 | 29 | void onReceive(final RpcHandle handle, final RpcMessage m); 30 | 31 | void onFailure(final RpcHandle handle); 32 | 33 | static public final RpcHandler NONE = new RpcHandler() { 34 | 35 | public void onReceive(final RpcMessage m) { 36 | } 37 | 38 | public void onFailure(final RpcHandle handle) { 39 | } 40 | 41 | public void onReceive(final RpcHandle handle, final RpcMessage m) { 42 | } 43 | 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /src-core/sys/net/api/rpc/RpcMessage.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.net.api.rpc; 18 | 19 | /** 20 | * 21 | * Interface for specifying the messages exchanged in a basic rpc service 22 | * 23 | * @author smduarte 24 | * 25 | */ 26 | public interface RpcMessage { 27 | 28 | void deliverTo(final RpcHandle handle, final RpcHandler handler); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src-core/sys/net/impl/Lz4Lib.java: -------------------------------------------------------------------------------- 1 | package sys.net.impl; 2 | 3 | import net.jpountz.lz4.LZ4Compressor; 4 | import net.jpountz.lz4.LZ4Factory; 5 | import net.jpountz.lz4.LZ4SafeDecompressor; 6 | 7 | public class Lz4Lib { 8 | 9 | private static final ThreadLocal lz4Compressor = new ThreadLocal() { 10 | LZ4Factory factory = LZ4Factory.fastestInstance(); 11 | 12 | @Override 13 | protected LZ4Compressor initialValue() { 14 | return factory.highCompressor(); 15 | } 16 | }; 17 | 18 | public static LZ4Compressor lz4Compressor() { 19 | return lz4Compressor.get(); 20 | } 21 | 22 | private static final ThreadLocal lz4Decompressor = new ThreadLocal() { 23 | LZ4Factory factory = LZ4Factory.fastestInstance(); 24 | 25 | @Override 26 | protected LZ4SafeDecompressor initialValue() { 27 | return factory.safeDecompressor(); 28 | } 29 | }; 30 | 31 | public static LZ4SafeDecompressor lz4Decompressor() { 32 | return lz4Decompressor.get(); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src-core/sys/net/impl/providers/InitiatorInfo.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.net.impl.providers; 18 | 19 | import sys.net.api.Endpoint; 20 | import sys.net.api.MessageHandler; 21 | import sys.net.api.TransportConnection; 22 | import sys.net.impl.AbstractMessage; 23 | 24 | public class InitiatorInfo extends AbstractMessage { 25 | 26 | protected Endpoint local; 27 | 28 | public InitiatorInfo() { 29 | } 30 | 31 | public InitiatorInfo(Endpoint local) { 32 | this.local = local; 33 | } 34 | 35 | public void deliverTo(final TransportConnection conn, final MessageHandler handler) { 36 | ((RemoteEndpointUpdater) conn).setRemoteEndpoint(local); 37 | handler.onAccept(conn); 38 | } 39 | } -------------------------------------------------------------------------------- /src-core/sys/net/impl/providers/RemoteEndpointUpdater.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.net.impl.providers; 18 | 19 | import sys.net.api.Endpoint; 20 | 21 | public interface RemoteEndpointUpdater { 22 | 23 | void setRemoteEndpoint(Endpoint remote); 24 | } 25 | -------------------------------------------------------------------------------- /src-core/sys/pubsub/PubSubNotification.java: -------------------------------------------------------------------------------- 1 | package sys.pubsub; 2 | 3 | import swift.proto.SwiftProtocolHandler; 4 | import sys.net.api.rpc.RpcHandle; 5 | import sys.net.api.rpc.RpcHandler; 6 | import sys.net.api.rpc.RpcMessage; 7 | import sys.net.impl.KryoLib; 8 | import sys.pubsub.PubSub.Notifyable; 9 | 10 | abstract public class PubSubNotification implements RpcMessage, Notifyable { 11 | 12 | protected long seqN; 13 | protected Object src; 14 | 15 | protected PubSubNotification() { 16 | } 17 | 18 | protected PubSubNotification(Object src) { 19 | this.src = src; 20 | this.seqN = -1L; 21 | } 22 | 23 | @Override 24 | public void deliverTo(RpcHandle handle, RpcHandler handler) { 25 | ((SwiftProtocolHandler) handler).onReceive(this); 26 | } 27 | 28 | public Notifyable payload() { 29 | return this; 30 | } 31 | 32 | @Override 33 | public Object src() { 34 | return src; 35 | } 36 | 37 | @Override 38 | public long seqN() { 39 | return seqN; 40 | } 41 | 42 | public Notifyable clone(long newSeqN) { 43 | PubSubNotification res = KryoLib.copyShallow(this); 44 | res.seqN = newSeqN; 45 | return res; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src-core/sys/pubsub/RemoteSubscriber.java: -------------------------------------------------------------------------------- 1 | package sys.pubsub; 2 | 3 | import java.util.logging.Logger; 4 | 5 | import sys.net.api.Endpoint; 6 | import sys.net.api.rpc.RpcEndpoint; 7 | import sys.net.api.rpc.RpcHandler; 8 | import sys.pubsub.PubSub.Notifyable; 9 | import sys.pubsub.impl.AbstractSubscriber; 10 | 11 | public class RemoteSubscriber extends AbstractSubscriber { 12 | static Logger Log = Logger.getLogger(RemoteSubscriber.class.getName()); 13 | 14 | final RpcEndpoint endpoint; 15 | protected volatile Endpoint remote; 16 | 17 | public RemoteSubscriber(String id, RpcEndpoint endpoint, Endpoint remote) { 18 | super(id); 19 | this.remote = remote; 20 | this.endpoint = endpoint; 21 | } 22 | 23 | protected void setRemote(Endpoint remote) { 24 | this.remote = remote; 25 | } 26 | 27 | public boolean isOffline() { 28 | return remote == null; 29 | } 30 | 31 | @Override 32 | public void onNotification(Notifyable info) { 33 | try { 34 | if (remote != null) { 35 | if (endpoint.send(remote, (PubSubNotification) info, RpcHandler.NONE, 0).failed()) { 36 | Log.info("Supressing remote notifications to: " + remote); 37 | remote = null; 38 | } 39 | } 40 | } catch (Exception x) { 41 | x.printStackTrace(); 42 | } 43 | } 44 | 45 | public Endpoint remoteEndpoint() { 46 | return remote; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src-core/sys/pubsub/impl/AbstractSubscriber.java: -------------------------------------------------------------------------------- 1 | package sys.pubsub.impl; 2 | 3 | import java.util.concurrent.atomic.AtomicLong; 4 | 5 | import sys.pubsub.PubSub; 6 | import sys.pubsub.PubSub.Notifyable; 7 | 8 | public abstract class AbstractSubscriber implements PubSub.Subscriber { 9 | 10 | final String id; 11 | final private AtomicLong fifoSeq = new AtomicLong(0L); 12 | 13 | public AbstractSubscriber(String id) { 14 | this.id = id; 15 | } 16 | 17 | public int hashCode() { 18 | return id.hashCode(); 19 | } 20 | 21 | public boolean equals(Object other) { 22 | return other instanceof AbstractSubscriber && id.equals(((AbstractSubscriber) other).id); 23 | } 24 | 25 | @Override 26 | public String id() { 27 | return id; 28 | } 29 | 30 | @Override 31 | public long nextSeqN() { 32 | return fifoSeq.incrementAndGet(); 33 | } 34 | 35 | @Override 36 | public void onNotification(Notifyable info) { 37 | Thread.dumpStack(); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src-core/sys/scheduler/TaskOwner.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.scheduler; 18 | 19 | public interface TaskOwner { 20 | 21 | public void registerTask(Task t); 22 | 23 | public void cancelAllTasks(); 24 | } 25 | -------------------------------------------------------------------------------- /src-core/sys/scheduler/TaskScheduler.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.scheduler; 18 | 19 | /** 20 | * 21 | * Defines the task scheduler as one that executes tasks in real time. 22 | * 23 | * @author smduarte (smd@fct.unl.pt) 24 | * 25 | */ 26 | public class TaskScheduler extends sys.scheduler.RT_Scheduler { 27 | } 28 | -------------------------------------------------------------------------------- /src-core/sys/scheduler/Token.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.scheduler; 18 | 19 | import static sys.scheduler.VT_Scheduler.Scheduler; 20 | 21 | import java.util.concurrent.Semaphore; 22 | 23 | public class Token extends Semaphore { 24 | 25 | Token() { 26 | super(0); 27 | } 28 | 29 | public void block() { 30 | Scheduler.threadManager.acquire(this); 31 | } 32 | 33 | public void unblock() { 34 | Scheduler.threadManager.release(this); 35 | } 36 | 37 | private static final long serialVersionUID = 1L; 38 | } -------------------------------------------------------------------------------- /src-core/sys/stats/ClosedStatsException.java: -------------------------------------------------------------------------------- 1 | package sys.stats; 2 | 3 | public class ClosedStatsException extends Exception { 4 | 5 | } 6 | -------------------------------------------------------------------------------- /src-core/sys/stats/StatsConstants.java: -------------------------------------------------------------------------------- 1 | package sys.stats; 2 | 3 | public final class StatsConstants { 4 | 5 | public static final int histogramTimeFrequency = 30000; 6 | 7 | public static final double[] UNSTABLE_COMMIT_DURATION = { 1, 10, 50, 100, 200 }; 8 | 9 | public static final double[] BATCH_SIZE = { 1, 10, 50, 100, 200 }; 10 | 11 | public static final char VS = ';'; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src-core/sys/stats/output/StatisticsOutput.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.stats.output; 18 | 19 | import java.io.IOException; 20 | 21 | /** 22 | * The output interface for the statistics collectors TODO: Needs improvement, 23 | * interface seems redundant 24 | * 25 | * @author balegas 26 | * 27 | */ 28 | public interface StatisticsOutput { 29 | 30 | public void output(ValuesOutput valuesOutput) throws IOException; 31 | 32 | public void output(HistogramOutput valuesOutput) throws IOException; 33 | 34 | public void close() throws IOException; 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src-core/sys/stats/output/ValuesOutput.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.stats.output; 18 | 19 | import sys.stats.common.PlotValues; 20 | 21 | public interface ValuesOutput { 22 | PlotValues getPlotValues(); 23 | } 24 | -------------------------------------------------------------------------------- /src-core/sys/stats/sliced/SlicedStatistics.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.stats.sliced; 18 | 19 | public interface SlicedStatistics> { 20 | V createNew(); 21 | } 22 | -------------------------------------------------------------------------------- /src-core/sys/stats/sliced/slices/ValueImpl.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.stats.sliced.slices; 18 | 19 | import sys.stats.sliced.SlicedStatistics; 20 | 21 | public class ValueImpl implements SlicedStatistics { 22 | 23 | private double value; 24 | 25 | public ValueImpl() { 26 | 27 | } 28 | 29 | public void setValue(double value) { 30 | this.value = value; 31 | } 32 | 33 | public double getValue() { 34 | return value; 35 | } 36 | 37 | public ValueImpl createNew() { 38 | return new ValueImpl(); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /src-core/sys/stats/sliced/slices/histogram/Histogram.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.stats.sliced.slices.histogram; 18 | 19 | import sys.stats.common.PlotValues; 20 | 21 | public interface Histogram { 22 | 23 | PlotValues getHistogram(); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src-core/sys/stats/sources/CounterSignalSource.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.stats.sources; 18 | 19 | public interface CounterSignalSource { 20 | void incCounter(); 21 | 22 | void decCounter(); 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src-core/sys/stats/sources/PollingBasedValueProvider.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.stats.sources; 18 | 19 | public interface PollingBasedValueProvider { 20 | double poll(); 21 | } 22 | -------------------------------------------------------------------------------- /src-core/sys/stats/sources/ValueSignalSource.java: -------------------------------------------------------------------------------- 1 | /***************************************************************************** 2 | * Copyright 2011-2012 INRIA 3 | * Copyright 2011-2012 Universidade Nova de Lisboa 4 | * 5 | * Licensed under the Apache License, Version 2.0 (the "License"); 6 | * you may not use this file except in compliance with the License. 7 | * You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | *****************************************************************************/ 17 | package sys.stats.sources; 18 | 19 | public interface ValueSignalSource { 20 | 21 | void setValue(double value); 22 | 23 | Stopper createEventDurationSignal(); 24 | 25 | interface Stopper { 26 | void stop(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /src-core/sys/utils/Progress.java: -------------------------------------------------------------------------------- 1 | package sys.utils; 2 | 3 | public class Progress { 4 | 5 | public static String percentage(int curr, int total) { 6 | String now = String.format("%.1f%%", 100.0 * curr / total); 7 | String before = msg.get(); 8 | 9 | if (before.equals(now)) 10 | return before; 11 | else { 12 | msg.set(now); 13 | return now; 14 | } 15 | } 16 | 17 | private static final ThreadLocal msg = new ThreadLocal() { 18 | @Override 19 | protected String initialValue() { 20 | return ""; 21 | } 22 | }; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /stuff/all_logging.properties: -------------------------------------------------------------------------------- 1 | handlers=java.util.logging.ConsoleHandler 2 | 3 | java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter 4 | swift.level = ALL 5 | swift.dc.level = ALL 6 | swift.client.level = ALL 7 | swift.application.level = ALL 8 | swift.benchmark.level = ALL 9 | 10 | sys.handlers=sys.utils.SysLogConsoleHandler 11 | sys.level = ALL 12 | sys.utils.SysLogConsoleHandler.level = ALL 13 | -------------------------------------------------------------------------------- /stuff/deployment_logging.properties: -------------------------------------------------------------------------------- 1 | handlers=java.util.logging.ConsoleHandler 2 | 3 | swift.level = WARNING 4 | swift.dc.level = WARNING 5 | swift.client.level = WARNING 6 | swift.application.level = INFO 7 | sys.level = WARNING 8 | 9 | -------------------------------------------------------------------------------- /stuff/logging.properties: -------------------------------------------------------------------------------- 1 | handlers=java.util.logging.ConsoleHandler 2 | 3 | java.util.logging.ConsoleHandler.formatter = java.util.logging.SimpleFormatter 4 | swift.level = WARNING 5 | swift.dc.level = WARNING 6 | #swift.dc.level = INFO 7 | swift.client.level = WARNING 8 | swift.application.level = WARNING 9 | swift.benchmark.level = WARNING 10 | 11 | sys.handlers=sys.utils.SysLogConsoleHandler 12 | sys.level = WARNING 13 | -------------------------------------------------------------------------------- /swiftadservice-test.props: -------------------------------------------------------------------------------- 1 | swift.AsyncCommit=true 2 | swift.Notifications=true 3 | swift.CachePolicy=CACHED 4 | swift.IsolationLevel=REPEATABLE_READS 5 | swift.cacheEvictionTimeMillis=5000000 6 | swift.BatchSize=10 7 | swift.AsyncQueue=50 8 | swift.CacheSize=512 9 | 10 | swiftadservice.numUsers=500 11 | swiftadservice.userFriends=25 12 | swiftadservice.biasedOps=9 13 | swiftadservice.randomOps=1 14 | swiftadservice.opGroups=10000 15 | swiftadservice.thinkTime=1 -------------------------------------------------------------------------------- /swiftsocial-test.props: -------------------------------------------------------------------------------- 1 | swift.AsyncCommit=true 2 | swift.Notifications=true 3 | swift.CachePolicy=CACHED 4 | swift.IsolationLevel=SNAPSHOT_ISOLATION 5 | swift.cacheEvictionTimeMillis=5000000 6 | swift.disasterSafe=true 7 | swift.batchSize=10 8 | swift.asyncQueue=50 9 | swift.cacheSize=512 10 | swift.computeMetadataStatistics=false 11 | 12 | swiftsocial.numUsers=1000 13 | swiftsocial.userFriends=25 14 | swiftsocial.biasedOps=9 15 | swiftsocial.randomOps=1 16 | swiftsocial.opGroups=10000 17 | swiftsocial.thinkTime=10 18 | swiftsocial.recordPageViews=true --------------------------------------------------------------------------------