You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@omid.apache.org by ik...@apache.org on 2016/04/21 02:03:01 UTC
[44/52] [abbrv] incubator-omid git commit: Move com.yahoo ->
org.apache
Move com.yahoo -> org.apache
Change-Id: Ic3fbf788f932f5083ab99e5c1bcf9a69cb70ed41
Project: http://git-wip-us.apache.org/repos/asf/incubator-omid/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-omid/commit/9cd856c6
Tree: http://git-wip-us.apache.org/repos/asf/incubator-omid/tree/9cd856c6
Diff: http://git-wip-us.apache.org/repos/asf/incubator-omid/diff/9cd856c6
Branch: refs/heads/master
Commit: 9cd856c67f6e9ccd4f52ffbfd8cf4b483691654a
Parents: 5734cac
Author: Igor Katkov <ka...@yahoo-inc.com>
Authored: Fri Apr 15 16:05:25 2016 -0700
Committer: Igor Katkov <ka...@yahoo-inc.com>
Committed: Fri Apr 15 16:09:01 2016 -0700
----------------------------------------------------------------------
.gitignore | 2 +-
benchmarks/bin/benchmarks.sh | 2 +-
benchmarks/pom.xml | 10 +-
.../hbase/HBaseCommitTableTester.java | 137 --
.../yahoo/omid/benchmarks/tso/RawTxRunner.java | 301 ----
.../omid/benchmarks/tso/TSOServerBenchmark.java | 138 --
.../tso/TSOServerBenchmarkConfig.java | 160 ---
.../yahoo/omid/benchmarks/utils/Generator.java | 36 -
.../omid/benchmarks/utils/IntegerGenerator.java | 71 -
.../utils/ScrambledZipfianGenerator.java | 153 ---
.../omid/benchmarks/utils/UniformGenerator.java | 36 -
.../omid/benchmarks/utils/ZipfianGenerator.java | 298 ----
.../hbase/HBaseCommitTableTester.java | 137 ++
.../apache/omid/benchmarks/tso/RawTxRunner.java | 301 ++++
.../omid/benchmarks/tso/TSOServerBenchmark.java | 138 ++
.../tso/TSOServerBenchmarkConfig.java | 160 +++
.../apache/omid/benchmarks/utils/Generator.java | 30 +
.../omid/benchmarks/utils/IntegerGenerator.java | 65 +
.../utils/ScrambledZipfianGenerator.java | 147 ++
.../omid/benchmarks/utils/UniformGenerator.java | 36 +
.../omid/benchmarks/utils/ZipfianGenerator.java | 292 ++++
.../default-tso-server-benchmark-config.yml | 20 +-
codahale-metrics/pom.xml | 4 +-
.../omid/metrics/CodahaleMetricsConfig.java | 100 --
.../omid/metrics/CodahaleMetricsProvider.java | 346 -----
.../omid/metrics/CodahaleMetricsConfig.java | 100 ++
.../omid/metrics/CodahaleMetricsProvider.java | 346 +++++
commit-table/pom.xml | 2 +-
.../com/yahoo/omid/committable/CommitTable.java | 113 --
.../omid/committable/InMemoryCommitTable.java | 143 --
.../yahoo/omid/committable/NullCommitTable.java | 91 --
.../apache/omid/committable/CommitTable.java | 113 ++
.../omid/committable/InMemoryCommitTable.java | 143 ++
.../omid/committable/NullCommitTable.java | 91 ++
.../omid/committable/NullCommitTableTest.java | 70 -
.../omid/committable/NullCommitTableTest.java | 70 +
common/pom.xml | 2 +-
.../src/main/java/com/yahoo/omid/YAMLUtils.java | 81 --
.../main/java/com/yahoo/omid/zk/ZKUtils.java | 57 -
.../main/java/org/apache/omid/YAMLUtils.java | 81 ++
.../main/java/org/apache/omid/zk/ZKUtils.java | 57 +
common/src/main/proto/TSOProto.proto | 2 +-
.../test/java/com/yahoo/omid/YAMLUtilsTest.java | 50 -
.../java/org/apache/omid/YAMLUtilsTest.java | 50 +
examples/pom.xml | 10 +-
examples/run.sh | 6 +-
.../com/yahoo/omid/examples/BasicExample.java | 112 --
.../omid/examples/ConfigurationExample.java | 131 --
.../omid/examples/SnapshotIsolationExample.java | 174 ---
.../org/apache/omid/examples/BasicExample.java | 112 ++
.../omid/examples/ConfigurationExample.java | 131 ++
.../omid/examples/SnapshotIsolationExample.java | 174 +++
.../main/resources/hbase-omid-client-config.yml | 10 +-
examples/src/main/resources/log4j.properties | 3 +-
hbase-client/pom.xml | 18 +-
.../yahoo/omid/transaction/ColumnWrapper.java | 64 -
.../transaction/HBaseAsyncPostCommitter.java | 67 -
.../com/yahoo/omid/transaction/HBaseCellId.java | 80 --
.../HBaseOmidClientConfiguration.java | 170 ---
.../transaction/HBaseSyncPostCommitter.java | 125 --
.../omid/transaction/HBaseTransaction.java | 79 --
.../transaction/HBaseTransactionClient.java | 24 -
.../transaction/HBaseTransactionManager.java | 292 ----
.../java/com/yahoo/omid/transaction/TTable.java | 770 -----------
.../transaction/TTableCellGetterAdapter.java | 38 -
.../apache/omid/transaction/ColumnWrapper.java | 64 +
.../transaction/HBaseAsyncPostCommitter.java | 67 +
.../apache/omid/transaction/HBaseCellId.java | 80 ++
.../HBaseOmidClientConfiguration.java | 170 +++
.../transaction/HBaseSyncPostCommitter.java | 125 ++
.../omid/transaction/HBaseTransaction.java | 79 ++
.../transaction/HBaseTransactionClient.java | 24 +
.../transaction/HBaseTransactionManager.java | 292 ++++
.../org/apache/omid/transaction/TTable.java | 770 +++++++++++
.../transaction/TTableCellGetterAdapter.java | 38 +
.../default-hbase-omid-client-config.yml | 4 +-
.../yahoo/omid/transaction/OmidTestBase.java | 257 ----
.../TestAsynchronousPostCommitter.java | 323 -----
.../yahoo/omid/transaction/TestAutoFlush.java | 62 -
.../omid/transaction/TestBasicTransaction.java | 440 ------
.../yahoo/omid/transaction/TestCellUtils.java | 230 ----
.../omid/transaction/TestColumnIterator.java | 96 --
.../yahoo/omid/transaction/TestDeletion.java | 299 ----
.../TestEndToEndScenariosWithHA.java | 412 ------
.../com/yahoo/omid/transaction/TestFilters.java | 191 ---
.../TestHALeaseManagementModule.java | 75 -
.../TestHBaseOmidClientConfiguration.java | 43 -
.../transaction/TestHBaseTransactionClient.java | 465 -------
.../TestHBaseTransactionManager.java | 102 --
.../yahoo/omid/transaction/TestMultiplePut.java | 134 --
.../yahoo/omid/transaction/TestReadPath.java | 105 --
.../yahoo/omid/transaction/TestShadowCells.java | 508 -------
.../transaction/TestSingleColumnFamily.java | 108 --
.../yahoo/omid/transaction/TestTSOModule.java | 98 --
.../omid/transaction/TestTTableBehaviour.java | 155 ---
.../transaction/TestTransactionCleanup.java | 119 --
.../transaction/TestTransactionConflict.java | 308 -----
.../omid/transaction/TestTxMgrFailover.java | 353 -----
.../yahoo/omid/transaction/TestUpdateScan.java | 218 ---
.../apache/omid/transaction/OmidTestBase.java | 257 ++++
.../TestAsynchronousPostCommitter.java | 323 +++++
.../apache/omid/transaction/TestAutoFlush.java | 62 +
.../omid/transaction/TestBasicTransaction.java | 440 ++++++
.../apache/omid/transaction/TestCellUtils.java | 230 ++++
.../omid/transaction/TestColumnIterator.java | 96 ++
.../apache/omid/transaction/TestDeletion.java | 299 ++++
.../TestEndToEndScenariosWithHA.java | 412 ++++++
.../apache/omid/transaction/TestFilters.java | 191 +++
.../TestHALeaseManagementModule.java | 75 +
.../TestHBaseOmidClientConfiguration.java | 43 +
.../transaction/TestHBaseTransactionClient.java | 465 +++++++
.../TestHBaseTransactionManager.java | 102 ++
.../omid/transaction/TestMultiplePut.java | 134 ++
.../apache/omid/transaction/TestReadPath.java | 105 ++
.../omid/transaction/TestShadowCells.java | 508 +++++++
.../transaction/TestSingleColumnFamily.java | 108 ++
.../apache/omid/transaction/TestTSOModule.java | 98 ++
.../omid/transaction/TestTTableBehaviour.java | 155 +++
.../transaction/TestTransactionCleanup.java | 119 ++
.../transaction/TestTransactionConflict.java | 308 +++++
.../omid/transaction/TestTxMgrFailover.java | 353 +++++
.../apache/omid/transaction/TestUpdateScan.java | 218 +++
.../src/test/resources/log4j.properties | 13 +-
.../resources/test-hbase-omid-client-config.yml | 18 +-
hbase-commit-table/pom.xml | 12 +-
.../DefaultHBaseCommitTableStorageModule.java | 89 --
.../committable/hbase/HBaseCommitTable.java | 422 ------
.../hbase/HBaseCommitTableConfig.java | 82 --
.../hbase/HBaseCommitTableStorageModule.java | 37 -
.../DefaultHBaseCommitTableStorageModule.java | 89 ++
.../committable/hbase/HBaseCommitTable.java | 422 ++++++
.../hbase/HBaseCommitTableConfig.java | 82 ++
.../hbase/HBaseCommitTableStorageModule.java | 37 +
.../committable/hbase/TestHBaseCommitTable.java | 298 ----
.../committable/hbase/TestHBaseCommitTable.java | 298 ++++
hbase-common/pom.xml | 6 +-
.../java/com/yahoo/omid/HBaseConfigModule.java | 83 --
.../omid/committable/hbase/KeyGenerator.java | 29 -
.../hbase/KeyGeneratorImplementations.java | 160 ---
.../omid/committable/hbase/RegionSplitter.java | 259 ----
.../com/yahoo/omid/tools/hbase/HBaseLogin.java | 38 -
.../omid/tools/hbase/SecureHBaseConfig.java | 55 -
.../com/yahoo/omid/transaction/CellInfo.java | 59 -
.../com/yahoo/omid/transaction/CellUtils.java | 406 ------
.../java/org/apache/omid/HBaseConfigModule.java | 83 ++
.../omid/committable/hbase/KeyGenerator.java | 29 +
.../hbase/KeyGeneratorImplementations.java | 160 +++
.../omid/committable/hbase/RegionSplitter.java | 258 ++++
.../org/apache/omid/tools/hbase/HBaseLogin.java | 38 +
.../omid/tools/hbase/SecureHBaseConfig.java | 55 +
.../org/apache/omid/transaction/CellInfo.java | 59 +
.../org/apache/omid/transaction/CellUtils.java | 406 ++++++
.../hbase/TestHBaseCommitTableKey.java | 53 -
.../hbase/TestHBaseCommitTableKey.java | 53 +
hbase-coprocessor/pom.xml | 16 +-
.../yahoo/omid/transaction/CompactorUtil.java | 107 --
.../transaction/HRegionCellGetterAdapter.java | 39 -
.../yahoo/omid/transaction/OmidCompactor.java | 140 --
.../hbase/regionserver/CompactorScanner.java | 14 +-
.../apache/omid/transaction/CompactorUtil.java | 107 ++
.../transaction/HRegionCellGetterAdapter.java | 39 +
.../apache/omid/transaction/OmidCompactor.java | 140 ++
.../TSOForHBaseCompactorTestModule.java | 120 --
.../yahoo/omid/transaction/TestCompaction.java | 1299 ------------------
.../omid/transaction/TestCompactorScanner.java | 106 --
.../TSOForHBaseCompactorTestModule.java | 120 ++
.../apache/omid/transaction/TestCompaction.java | 1299 ++++++++++++++++++
.../omid/transaction/TestCompactorScanner.java | 106 ++
hbase-coprocessor/src/test/resources/log4j.xml | 4 +-
hbase-shims/hbase-0/pom.xml | 2 +-
.../main/java/com/yahoo/omid/HBaseShims.java | 59 -
.../main/java/org/apache/omid/HBaseShims.java | 59 +
hbase-shims/hbase-1/pom.xml | 2 +-
.../main/java/com/yahoo/omid/HBaseShims.java | 58 -
.../main/java/org/apache/omid/HBaseShims.java | 58 +
hbase-shims/pom.xml | 2 +-
hbase-tools/pom.xml | 10 +-
.../omid/tools/hbase/OmidTableManager.java | 203 ---
.../omid/tools/hbase/OmidTableManager.java | 203 +++
.../omid/tools/hbase/TestOmidTableManager.java | 119 --
.../omid/tools/hbase/TestOmidTableManager.java | 119 ++
metrics/pom.xml | 2 +-
.../omid/metrics/AbstractMetricsConfig.java | 43 -
.../java/com/yahoo/omid/metrics/Counter.java | 46 -
.../main/java/com/yahoo/omid/metrics/Gauge.java | 28 -
.../java/com/yahoo/omid/metrics/Histogram.java | 36 -
.../main/java/com/yahoo/omid/metrics/Meter.java | 34 -
.../java/com/yahoo/omid/metrics/Metric.java | 25 -
.../com/yahoo/omid/metrics/MetricsProvider.java | 41 -
.../com/yahoo/omid/metrics/MetricsRegistry.java | 61 -
.../yahoo/omid/metrics/MetricsRegistryMap.java | 105 --
.../com/yahoo/omid/metrics/MetricsUtils.java | 47 -
.../yahoo/omid/metrics/NullMetricsProvider.java | 135 --
.../main/java/com/yahoo/omid/metrics/Timer.java | 28 -
.../omid/metrics/AbstractMetricsConfig.java | 43 +
.../java/org/apache/omid/metrics/Counter.java | 46 +
.../java/org/apache/omid/metrics/Gauge.java | 28 +
.../java/org/apache/omid/metrics/Histogram.java | 36 +
.../java/org/apache/omid/metrics/Meter.java | 34 +
.../java/org/apache/omid/metrics/Metric.java | 25 +
.../apache/omid/metrics/MetricsProvider.java | 41 +
.../apache/omid/metrics/MetricsRegistry.java | 61 +
.../apache/omid/metrics/MetricsRegistryMap.java | 105 ++
.../org/apache/omid/metrics/MetricsUtils.java | 47 +
.../omid/metrics/NullMetricsProvider.java | 135 ++
.../java/org/apache/omid/metrics/Timer.java | 28 +
pom.xml | 25 +-
statemachine/pom.xml | 2 +-
.../com/yahoo/statemachine/StateMachine.java | 256 ----
.../statemachine/StateMachineLogParser.java | 163 ---
.../org/apache/statemachine/StateMachine.java | 256 ++++
.../statemachine/StateMachineLogParser.java | 163 +++
.../yahoo/statemachine/TestStateMachine.java | 100 --
.../apache/statemachine/TestStateMachine.java | 100 ++
timestamp-storage/pom.xml | 10 +-
.../DefaultHBaseTimestampStorageModule.java | 81 --
.../DefaultZKTimestampStorageModule.java | 57 -
.../storage/HBaseTimestampStorage.java | 89 --
.../storage/HBaseTimestampStorageConfig.java | 60 -
.../storage/HBaseTimestampStorageModule.java | 36 -
.../timestamp/storage/TimestampStorage.java | 28 -
.../yahoo/omid/timestamp/storage/ZKModule.java | 49 -
.../timestamp/storage/ZKTimestampPaths.java | 28 -
.../timestamp/storage/ZKTimestampStorage.java | 90 --
.../storage/ZKTimestampStorageModule.java | 37 -
.../DefaultHBaseTimestampStorageModule.java | 81 ++
.../DefaultZKTimestampStorageModule.java | 57 +
.../storage/HBaseTimestampStorage.java | 89 ++
.../storage/HBaseTimestampStorageConfig.java | 60 +
.../storage/HBaseTimestampStorageModule.java | 36 +
.../timestamp/storage/TimestampStorage.java | 28 +
.../apache/omid/timestamp/storage/ZKModule.java | 49 +
.../timestamp/storage/ZKTimestampPaths.java | 28 +
.../timestamp/storage/ZKTimestampStorage.java | 90 ++
.../storage/ZKTimestampStorageModule.java | 37 +
.../storage/TestHBaseTimestampStorage.java | 136 --
.../storage/TestZKTimestampStorage.java | 241 ----
.../storage/TestHBaseTimestampStorage.java | 136 ++
.../storage/TestZKTimestampStorage.java | 241 ++++
.../src/test/resources/log4j.properties | 15 +-
transaction-client/pom.xml | 12 +-
.../omid/transaction/AbstractTransaction.java | 217 ---
.../transaction/AbstractTransactionManager.java | 502 -------
.../transaction/CommitTimestampLocator.java | 38 -
.../omid/transaction/PostCommitActions.java | 41 -
.../omid/transaction/RollbackException.java | 35 -
.../com/yahoo/omid/transaction/Transaction.java | 76 -
.../omid/transaction/TransactionException.java | 31 -
.../omid/transaction/TransactionManager.java | 66 -
.../TransactionManagerException.java | 32 -
.../yahoo/omid/tso/client/AbortException.java | 27 -
.../java/com/yahoo/omid/tso/client/CellId.java | 24 -
.../yahoo/omid/tso/client/ClosingException.java | 28 -
.../omid/tso/client/ConnectionException.java | 30 -
.../omid/tso/client/ForwardingTSOFuture.java | 64 -
.../tso/client/HandshakeFailedException.java | 28 -
.../yahoo/omid/tso/client/MockTSOClient.java | 102 --
.../yahoo/omid/tso/client/NewTSOException.java | 27 -
.../tso/client/OmidClientConfiguration.java | 177 ---
.../tso/client/ServiceUnavailableException.java | 32 -
.../com/yahoo/omid/tso/client/TSOClient.java | 933 -------------
.../com/yahoo/omid/tso/client/TSOFuture.java | 25 -
.../com/yahoo/omid/tso/client/TSOProtocol.java | 56 -
.../yahoo/omid/tso/util/DummyCellIdImpl.java | 35 -
.../omid/transaction/AbstractTransaction.java | 217 +++
.../transaction/AbstractTransactionManager.java | 502 +++++++
.../transaction/CommitTimestampLocator.java | 38 +
.../omid/transaction/PostCommitActions.java | 41 +
.../omid/transaction/RollbackException.java | 35 +
.../apache/omid/transaction/Transaction.java | 76 +
.../omid/transaction/TransactionException.java | 31 +
.../omid/transaction/TransactionManager.java | 66 +
.../TransactionManagerException.java | 32 +
.../apache/omid/tso/client/AbortException.java | 27 +
.../java/org/apache/omid/tso/client/CellId.java | 24 +
.../omid/tso/client/ClosingException.java | 28 +
.../omid/tso/client/ConnectionException.java | 30 +
.../omid/tso/client/ForwardingTSOFuture.java | 64 +
.../tso/client/HandshakeFailedException.java | 28 +
.../apache/omid/tso/client/MockTSOClient.java | 102 ++
.../apache/omid/tso/client/NewTSOException.java | 27 +
.../tso/client/OmidClientConfiguration.java | 177 +++
.../tso/client/ServiceUnavailableException.java | 32 +
.../org/apache/omid/tso/client/TSOClient.java | 933 +++++++++++++
.../org/apache/omid/tso/client/TSOFuture.java | 25 +
.../org/apache/omid/tso/client/TSOProtocol.java | 56 +
.../apache/omid/tso/util/DummyCellIdImpl.java | 35 +
.../src/main/resources/omid-client-config.yml | 6 +-
.../omid/tso/client/TestMockTSOClient.java | 72 -
.../tso/client/TestOmidClientConfiguration.java | 32 -
.../omid/tso/client/TestMockTSOClient.java | 72 +
.../tso/client/TestOmidClientConfiguration.java | 32 +
tso-server/bin/omid.sh | 6 +-
tso-server/maven/assembly/bin.xml | 6 +-
tso-server/pom.xml | 20 +-
.../src/main/java/com/yahoo/omid/tso/Cache.java | 32 -
.../com/yahoo/omid/tso/CacheEvaluation.java | 105 --
.../java/com/yahoo/omid/tso/CommitHashMap.java | 81 --
.../com/yahoo/omid/tso/DisruptorModule.java | 36 -
.../yahoo/omid/tso/FatalExceptionHandler.java | 51 -
.../yahoo/omid/tso/HALeaseManagementModule.java | 81 --
.../tso/InMemoryCommitTableStorageModule.java | 35 -
.../tso/InMemoryTimestampStorageModule.java | 35 -
.../com/yahoo/omid/tso/LeaseManagement.java | 52 -
.../java/com/yahoo/omid/tso/LeaseManager.java | 310 -----
.../main/java/com/yahoo/omid/tso/LongCache.java | 85 --
.../java/com/yahoo/omid/tso/MockPanicker.java | 30 -
.../com/yahoo/omid/tso/MonitoringContext.java | 77 --
.../yahoo/omid/tso/NetworkInterfaceUtils.java | 126 --
.../main/java/com/yahoo/omid/tso/Panicker.java | 22 -
.../yahoo/omid/tso/PausableTimestampOracle.java | 70 -
.../yahoo/omid/tso/PersistenceProcessor.java | 30 -
.../omid/tso/PersistenceProcessorImpl.java | 431 ------
.../java/com/yahoo/omid/tso/ReplyProcessor.java | 43 -
.../com/yahoo/omid/tso/ReplyProcessorImpl.java | 236 ----
.../com/yahoo/omid/tso/RequestProcessor.java | 31 -
.../yahoo/omid/tso/RequestProcessorImpl.java | 309 -----
.../java/com/yahoo/omid/tso/RetryProcessor.java | 24 -
.../com/yahoo/omid/tso/RetryProcessorImpl.java | 185 ---
.../com/yahoo/omid/tso/SystemExitPanicker.java | 32 -
.../com/yahoo/omid/tso/TSOChannelHandler.java | 285 ----
.../main/java/com/yahoo/omid/tso/TSOModule.java | 67 -
.../main/java/com/yahoo/omid/tso/TSOServer.java | 131 --
.../com/yahoo/omid/tso/TSOServerConfig.java | 176 ---
.../com/yahoo/omid/tso/TSOStateManager.java | 95 --
.../com/yahoo/omid/tso/TSOStateManagerImpl.java | 78 --
.../com/yahoo/omid/tso/TimestampOracle.java | 34 -
.../com/yahoo/omid/tso/TimestampOracleImpl.java | 169 ---
.../com/yahoo/omid/tso/TsoServerDaemon.java | 60 -
.../omid/tso/VoidLeaseManagementModule.java | 92 --
.../com/yahoo/omid/tso/VoidLeaseManager.java | 53 -
.../main/java/org/apache/omid/tso/Cache.java | 32 +
.../org/apache/omid/tso/CacheEvaluation.java | 105 ++
.../java/org/apache/omid/tso/CommitHashMap.java | 81 ++
.../org/apache/omid/tso/DisruptorModule.java | 36 +
.../apache/omid/tso/FatalExceptionHandler.java | 51 +
.../omid/tso/HALeaseManagementModule.java | 81 ++
.../tso/InMemoryCommitTableStorageModule.java | 35 +
.../tso/InMemoryTimestampStorageModule.java | 35 +
.../org/apache/omid/tso/LeaseManagement.java | 52 +
.../java/org/apache/omid/tso/LeaseManager.java | 310 +++++
.../java/org/apache/omid/tso/LongCache.java | 85 ++
.../java/org/apache/omid/tso/MockPanicker.java | 30 +
.../org/apache/omid/tso/MonitoringContext.java | 77 ++
.../apache/omid/tso/NetworkInterfaceUtils.java | 126 ++
.../main/java/org/apache/omid/tso/Panicker.java | 22 +
.../omid/tso/PausableTimestampOracle.java | 70 +
.../apache/omid/tso/PersistenceProcessor.java | 30 +
.../omid/tso/PersistenceProcessorImpl.java | 431 ++++++
.../org/apache/omid/tso/ReplyProcessor.java | 43 +
.../org/apache/omid/tso/ReplyProcessorImpl.java | 236 ++++
.../org/apache/omid/tso/RequestProcessor.java | 31 +
.../apache/omid/tso/RequestProcessorImpl.java | 309 +++++
.../org/apache/omid/tso/RetryProcessor.java | 24 +
.../org/apache/omid/tso/RetryProcessorImpl.java | 185 +++
.../org/apache/omid/tso/SystemExitPanicker.java | 32 +
.../org/apache/omid/tso/TSOChannelHandler.java | 285 ++++
.../java/org/apache/omid/tso/TSOModule.java | 67 +
.../java/org/apache/omid/tso/TSOServer.java | 131 ++
.../org/apache/omid/tso/TSOServerConfig.java | 176 +++
.../org/apache/omid/tso/TSOStateManager.java | 95 ++
.../apache/omid/tso/TSOStateManagerImpl.java | 78 ++
.../org/apache/omid/tso/TimestampOracle.java | 34 +
.../apache/omid/tso/TimestampOracleImpl.java | 169 +++
.../org/apache/omid/tso/TsoServerDaemon.java | 60 +
.../omid/tso/VoidLeaseManagementModule.java | 92 ++
.../org/apache/omid/tso/VoidLeaseManager.java | 53 +
tso-server/src/main/resources/default-omid.yml | 74 +-
tso-server/src/main/resources/log4j.properties | 13 +-
.../src/test/java/com/yahoo/omid/TestUtils.java | 114 --
.../yahoo/omid/tso/PausableLeaseManager.java | 117 --
.../yahoo/omid/tso/ProgrammableTSOServer.java | 287 ----
.../java/com/yahoo/omid/tso/TSOMockModule.java | 76 -
.../com/yahoo/omid/tso/TSOServerConfigTest.java | 29 -
.../test/java/com/yahoo/omid/tso/TestBatch.java | 158 ---
.../com/yahoo/omid/tso/TestLeaseManager.java | 418 ------
.../java/com/yahoo/omid/tso/TestLongCache.java | 122 --
.../java/com/yahoo/omid/tso/TestPanicker.java | 163 ---
.../omid/tso/TestPersistenceProcessor.java | 221 ---
.../yahoo/omid/tso/TestRequestProcessor.java | 186 ---
.../com/yahoo/omid/tso/TestRetryProcessor.java | 126 --
.../omid/tso/TestTSOChannelHandlerNetty.java | 321 -----
.../com/yahoo/omid/tso/TestTSOStateManager.java | 121 --
.../com/yahoo/omid/tso/TestTimestampOracle.java | 117 --
.../omid/tso/client/TSOClientAccessor.java | 29 -
.../yahoo/omid/tso/client/TSOClientOneShot.java | 63 -
.../com/yahoo/omid/tso/client/TSOClientRaw.java | 150 --
...tionOfTSOClientServerBasicFunctionality.java | 233 ----
.../client/TestTSOClientConnectionToTSO.java | 284 ----
...stTSOClientRequestAndResponseBehaviours.java | 423 ------
.../client/TestTSOClientResponseHandling.java | 111 --
.../tso/client/TestUnconnectedTSOClient.java | 83 --
.../test/java/org/apache/omid/TestUtils.java | 114 ++
.../apache/omid/tso/PausableLeaseManager.java | 117 ++
.../apache/omid/tso/ProgrammableTSOServer.java | 287 ++++
.../java/org/apache/omid/tso/TSOMockModule.java | 76 +
.../apache/omid/tso/TSOServerConfigTest.java | 29 +
.../java/org/apache/omid/tso/TestBatch.java | 158 +++
.../org/apache/omid/tso/TestLeaseManager.java | 418 ++++++
.../java/org/apache/omid/tso/TestLongCache.java | 122 ++
.../java/org/apache/omid/tso/TestPanicker.java | 163 +++
.../omid/tso/TestPersistenceProcessor.java | 221 +++
.../apache/omid/tso/TestRequestProcessor.java | 186 +++
.../org/apache/omid/tso/TestRetryProcessor.java | 126 ++
.../omid/tso/TestTSOChannelHandlerNetty.java | 321 +++++
.../apache/omid/tso/TestTSOStateManager.java | 121 ++
.../apache/omid/tso/TestTimestampOracle.java | 117 ++
.../omid/tso/client/TSOClientAccessor.java | 29 +
.../omid/tso/client/TSOClientOneShot.java | 63 +
.../apache/omid/tso/client/TSOClientRaw.java | 150 ++
...tionOfTSOClientServerBasicFunctionality.java | 233 ++++
.../client/TestTSOClientConnectionToTSO.java | 284 ++++
...stTSOClientRequestAndResponseBehaviours.java | 423 ++++++
.../client/TestTSOClientResponseHandling.java | 111 ++
.../tso/client/TestUnconnectedTSOClient.java | 83 ++
tso-server/src/test/resources/log4j.properties | 15 +-
tso-server/src/test/resources/test-omid.yml | 8 +-
417 files changed, 26656 insertions(+), 26685 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9cd856c6/.gitignore
----------------------------------------------------------------------
diff --git a/.gitignore b/.gitignore
index dead464..03517e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -17,4 +17,4 @@ lib/
# TestNG
*/test-output/
-common/src/main/java/com/yahoo/omid/proto/
+common/src/main/java/org/apache/omid/proto/
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9cd856c6/benchmarks/bin/benchmarks.sh
----------------------------------------------------------------------
diff --git a/benchmarks/bin/benchmarks.sh b/benchmarks/bin/benchmarks.sh
index b7a037e..55b2031 100755
--- a/benchmarks/bin/benchmarks.sh
+++ b/benchmarks/bin/benchmarks.sh
@@ -20,7 +20,7 @@ for j in ../lib/*.jar; do
done
tso() {
- exec java $JVM_FLAGS -Dlog4j.configuration=log4j.xml -cp $CLASSPATH com.yahoo.omid.benchmarks.tso.TSOServerBenchmark $@
+ exec java $JVM_FLAGS -Dlog4j.configuration=log4j.xml -cp $CLASSPATH org.apache.omid.benchmarks.tso.TSOServerBenchmark $@
}
usage() {
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9cd856c6/benchmarks/pom.xml
----------------------------------------------------------------------
diff --git a/benchmarks/pom.xml b/benchmarks/pom.xml
index 9991a3d..8ec06db 100644
--- a/benchmarks/pom.xml
+++ b/benchmarks/pom.xml
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>com.yahoo.omid</groupId>
+ <groupId>org.apache.omid</groupId>
<artifactId>omid</artifactId>
<version>0.8.1.37-SNAPSHOT</version>
</parent>
@@ -16,22 +16,22 @@
<!-- Dependencies on Omid modules -->
<dependency>
- <groupId>com.yahoo.omid</groupId>
+ <groupId>org.apache.omid</groupId>
<artifactId>transaction-client</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>com.yahoo.omid</groupId>
+ <groupId>org.apache.omid</groupId>
<artifactId>hbase-commit-table</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>com.yahoo.omid</groupId>
+ <groupId>org.apache.omid</groupId>
<artifactId>metrics</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>com.yahoo.omid</groupId>
+ <groupId>org.apache.omid</groupId>
<artifactId>codahale-metrics</artifactId>
<version>${project.version}</version>
</dependency>
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9cd856c6/benchmarks/src/main/java/com/yahoo/omid/benchmarks/hbase/HBaseCommitTableTester.java
----------------------------------------------------------------------
diff --git a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/hbase/HBaseCommitTableTester.java b/benchmarks/src/main/java/com/yahoo/omid/benchmarks/hbase/HBaseCommitTableTester.java
deleted file mode 100644
index cd690e2..0000000
--- a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/hbase/HBaseCommitTableTester.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.yahoo.omid.benchmarks.hbase;
-
-import com.beust.jcommander.JCommander;
-import com.beust.jcommander.Parameter;
-import com.beust.jcommander.ParametersDelegate;
-import com.codahale.metrics.ConsoleReporter;
-import com.codahale.metrics.Meter;
-import com.codahale.metrics.MetricFilter;
-import com.codahale.metrics.MetricRegistry;
-import com.codahale.metrics.Timer;
-import com.codahale.metrics.graphite.Graphite;
-import com.codahale.metrics.graphite.GraphiteReporter;
-import com.yahoo.omid.committable.CommitTable;
-import com.yahoo.omid.committable.hbase.HBaseCommitTable;
-import com.yahoo.omid.committable.hbase.HBaseCommitTableConfig;
-import com.yahoo.omid.committable.hbase.KeyGenerator;
-import com.yahoo.omid.committable.hbase.KeyGeneratorImplementations.BadRandomKeyGenerator;
-import com.yahoo.omid.committable.hbase.KeyGeneratorImplementations.BucketKeyGenerator;
-import com.yahoo.omid.committable.hbase.KeyGeneratorImplementations.FullRandomKeyGenerator;
-import com.yahoo.omid.committable.hbase.KeyGeneratorImplementations.SeqKeyGenerator;
-import com.yahoo.omid.tools.hbase.HBaseLogin;
-import com.yahoo.omid.tools.hbase.SecureHBaseConfig;
-import org.apache.hadoop.conf.Configuration;
-import org.apache.hadoop.hbase.HBaseConfiguration;
-
-import java.net.InetSocketAddress;
-import java.util.concurrent.TimeUnit;
-
-public class HBaseCommitTableTester {
-
- private static class Config {
-
- @Parameter(names = "-fullRandomAlgo", description = "Full random algo")
- boolean fullRandomAlgo = false;
-
- @Parameter(names = "-badRandomAlgo", description = "The original algo")
- boolean badRandomAlgo = false;
-
- @Parameter(names = "-bucketAlgo", description = "Bucketing algorithm")
- boolean bucketingAlgo = false;
-
- @Parameter(names = "-seqAlgo", description = "Sequential algorithm")
- boolean seqAlgo = false;
-
- @Parameter(names = "-batchSize", description = "batch size")
- int batchSize = 10000;
-
- @Parameter(names = "-graphite", description = "graphite server to report to")
- String graphite = null;
-
- @ParametersDelegate
- SecureHBaseConfig loginFlags = new SecureHBaseConfig();
- }
-
- @SuppressWarnings("InfiniteLoopStatement")
- public static void main(String[] args) throws Exception {
- Config config = new Config();
- new JCommander(config, args);
-
- Configuration hbaseConfig = HBaseConfiguration.create();
-
- final KeyGenerator keygen;
- if (config.fullRandomAlgo) {
- keygen = new FullRandomKeyGenerator();
- } else if (config.badRandomAlgo) {
- keygen = new BadRandomKeyGenerator();
- } else if (config.bucketingAlgo) {
- keygen = new BucketKeyGenerator();
- } else if (config.seqAlgo) {
- keygen = new SeqKeyGenerator();
- } else {
- throw new IllegalArgumentException("Not supported keygen type");
- }
-
- HBaseLogin.loginIfNeeded(config.loginFlags);
-
- HBaseCommitTableConfig commitTableConfig = new HBaseCommitTableConfig();
- CommitTable commitTable = new HBaseCommitTable(hbaseConfig, commitTableConfig, keygen);
-
- CommitTable.Writer writer = commitTable.getWriter();
-
- MetricRegistry metrics = new MetricRegistry();
- if (config.graphite != null) {
- String parts[] = config.graphite.split(":");
- String host = parts[0];
- Integer port = Integer.valueOf(parts[1]);
-
- final Graphite graphite = new Graphite(new InetSocketAddress(host, port));
- final GraphiteReporter reporter = GraphiteReporter.forRegistry(metrics)
- .prefixedWith("omid-hbase." + keygen.getClass().getSimpleName())
- .convertRatesTo(TimeUnit.SECONDS)
- .convertDurationsTo(TimeUnit.MILLISECONDS)
- .filter(MetricFilter.ALL)
- .build(graphite);
- reporter.start(10, TimeUnit.SECONDS);
- }
- final ConsoleReporter reporter = ConsoleReporter.forRegistry(metrics)
- .convertRatesTo(TimeUnit.SECONDS)
- .convertDurationsTo(TimeUnit.MILLISECONDS)
- .build();
- reporter.start(10, TimeUnit.SECONDS);
-
- Timer flushTimer = metrics.timer("flush");
- Meter commitsMeter = metrics.meter("commits");
-
- int i = 0;
- long ts = 0;
- while (true) {
- writer.addCommittedTransaction(ts++, ts++);
- if (i++ == config.batchSize) {
- commitsMeter.mark(i);
- long start = System.nanoTime();
- writer.flush();
- flushTimer.update((System.nanoTime() - start), TimeUnit.NANOSECONDS);
- i = 0;
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9cd856c6/benchmarks/src/main/java/com/yahoo/omid/benchmarks/tso/RawTxRunner.java
----------------------------------------------------------------------
diff --git a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/tso/RawTxRunner.java b/benchmarks/src/main/java/com/yahoo/omid/benchmarks/tso/RawTxRunner.java
deleted file mode 100644
index eaef6e7..0000000
--- a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/tso/RawTxRunner.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.yahoo.omid.benchmarks.tso;
-
-import com.google.common.util.concurrent.RateLimiter;
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import com.google.inject.Binder;
-import com.google.inject.Guice;
-import com.google.inject.Injector;
-import com.google.inject.Module;
-import com.yahoo.omid.benchmarks.utils.IntegerGenerator;
-import com.yahoo.omid.committable.CommitTable;
-import com.yahoo.omid.metrics.Counter;
-import com.yahoo.omid.metrics.MetricsRegistry;
-import com.yahoo.omid.metrics.Timer;
-import com.yahoo.omid.tso.util.DummyCellIdImpl;
-import com.yahoo.omid.tso.client.AbortException;
-import com.yahoo.omid.tso.client.CellId;
-import com.yahoo.omid.tso.client.OmidClientConfiguration;
-import com.yahoo.omid.tso.client.TSOClient;
-import com.yahoo.omid.tso.client.TSOFuture;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.IOException;
-import java.net.InetAddress;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Random;
-import java.util.Set;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-import static com.codahale.metrics.MetricRegistry.name;
-
-class RawTxRunner implements Runnable {
-
- private static final Logger LOG = LoggerFactory.getLogger(RawTxRunner.class);
-
- private static volatile int txRunnerCounter = 0;
- private int txRunnerId = txRunnerCounter++;
-
- // Config params
- private final int writesetSize;
- private final boolean fixedWriteSetSize;
- private final long commitDelayInMs;
- private final int percentageOfReadOnlyTxs;
- private final IntegerGenerator cellIdGenerator;
- private final Random randomGen;
-
- // Main elements
- private final TSOClient tsoClient;
- private final CommitTable.Client commitTableClient;
-
- // Asynchronous executor for tx post begin sequence: TimestampListener -> Committer -> CommitListener
- private final ScheduledExecutorService callbackExec =
- Executors.newScheduledThreadPool(1, new ThreadFactoryBuilder()
- .setNameFormat("tx-runner-" + txRunnerId + "-callback")
- .setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() {
- @Override
- public void uncaughtException(Thread t, Throwable e) {
- LOG.error("Thread {} threw exception", t, e);
- }
- }).build());
-
- // Statistics to save
- private final Timer timestampTimer;
- private final Timer commitTimer;
- private final Timer abortTimer;
- private final Counter errorCounter;
-
- // Allows to setup a maximum rate for the client in req/sec
- private final RateLimiter rateLimiter;
-
- // Is this TxRunner still running?
- private volatile boolean isRunning = false;
-
- RawTxRunner(final TSOServerBenchmarkConfig expConfig) throws IOException, InterruptedException {
-
- // Injector configuration
- List<Module> guiceModules = new ArrayList<>();
- guiceModules.add(new Module() {
- @Override
- public void configure(Binder binder) {
- binder.bind(MetricsRegistry.class).toInstance(expConfig.getMetrics());
- }
- });
- guiceModules.add(expConfig.getCommitTableStoreModule());
- Injector injector = Guice.createInjector(guiceModules);
-
- // Tx Runner config
- this.writesetSize = expConfig.getWritesetSize();
- this.fixedWriteSetSize = expConfig.isFixedWritesetSize();
- this.commitDelayInMs = expConfig.getCommitDelayInMs();
- this.percentageOfReadOnlyTxs = expConfig.getPercentageOfReadOnlyTxs();
- this.cellIdGenerator = expConfig.getCellIdGenerator();
- this.randomGen = new Random(System.currentTimeMillis() * txRunnerId); // to make it channel dependent
-
- int txRateInReqPerSec = expConfig.getTxRateInRequestPerSecond();
- long warmUpPeriodInSecs = expConfig.getWarmUpPeriodInSecs();
-
- LOG.info("TxRunner-{} [ Tx Rate (Req per Sec) -> {} ]", txRunnerId, txRateInReqPerSec);
- LOG.info("TxRunner-{} [ Warm Up Period -> {} Secs ]", txRunnerId, warmUpPeriodInSecs);
- LOG.info("TxRunner-{} [ Cell Id Distribution Generator -> {} ]", txRunnerId, expConfig.getCellIdGenerator().getClass());
- LOG.info("TxRunner-{} [ Max Tx Size -> {} Fixed: {} ]", txRunnerId, writesetSize, fixedWriteSetSize);
- LOG.info("TxRunner-{} [ Commit delay -> {} Ms ]", txRunnerId, commitDelayInMs);
- LOG.info("TxRunner-{} [ % of Read-Only Tx -> {} % ]", txRunnerId, percentageOfReadOnlyTxs);
-
- // Commit table client initialization
- CommitTable commitTable = injector.getInstance(CommitTable.class);
- this.commitTableClient = commitTable.getClient();
-
- // Stat initialization
- MetricsRegistry metrics = injector.getInstance(MetricsRegistry.class);
- String hostName = InetAddress.getLocalHost().getHostName();
- this.timestampTimer = metrics.timer(name("tx_runner", Integer.toString(txRunnerId), hostName, "timestamp"));
- this.commitTimer = metrics.timer(name("tx_runner", Integer.toString(txRunnerId), hostName, "commit"));
- this.abortTimer = metrics.timer(name("tx_runner", Integer.toString(txRunnerId), hostName, "abort"));
- this.errorCounter = metrics.counter(name("tx_runner", Integer.toString(txRunnerId), hostName, "errors"));
- LOG.info("TxRunner-{} [ Metrics provider module -> {} ]", txRunnerId, expConfig.getMetrics().getClass());
-
- // TSO Client initialization
- OmidClientConfiguration tsoClientConf = expConfig.getOmidClientConfiguration();
- this.tsoClient = TSOClient.newInstance(tsoClientConf);
- LOG.info("TxRunner-{} [ Connection Type {}/Connection String {} ]", txRunnerId,
- tsoClientConf.getConnectionType(), tsoClientConf.getConnectionString());
-
- // Limiter for configured request per second
- this.rateLimiter = RateLimiter.create((double) txRateInReqPerSec, warmUpPeriodInSecs, TimeUnit.SECONDS);
- }
-
- @Override
- public void run() {
-
- isRunning = true;
-
- while (isRunning) {
- rateLimiter.acquire();
- long tsRequestTime = System.nanoTime();
- final TSOFuture<Long> tsFuture = tsoClient.getNewStartTimestamp();
- tsFuture.addListener(new TimestampListener(tsFuture, tsRequestTime), callbackExec);
- }
-
- shutdown();
-
- }
-
- public void stop() {
- isRunning = false;
- }
-
- private void shutdown() {
-
- try {
- LOG.info("Finishing TxRunner in 3 secs", txRunnerId);
- boolean wasSuccess = callbackExec.awaitTermination(3, TimeUnit.SECONDS);
- if (!wasSuccess) {
- callbackExec.shutdownNow();
- }
- commitTableClient.close();
- tsoClient.close().get();
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- // ignore
- } catch (ExecutionException | IOException e) {
- // ignore
- } finally {
- LOG.info("TxRunner {} finished", txRunnerId);
- }
-
- }
-
- private class TimestampListener implements Runnable {
-
- final TSOFuture<Long> tsFuture;
- final long tsRequestTime;
-
- TimestampListener(TSOFuture<Long> tsFuture, long tsRequestTime) {
- this.tsFuture = tsFuture;
- this.tsRequestTime = tsRequestTime;
- }
-
- @Override
- public void run() {
-
- try {
- long txId = tsFuture.get();
- timestampTimer.update(System.nanoTime() - tsRequestTime);
- if (commitDelayInMs <= 0) {
- callbackExec.execute(new Committer(txId));
- } else {
- callbackExec.schedule(new Committer(txId), commitDelayInMs, TimeUnit.MILLISECONDS);
- }
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- errorCounter.inc();
- } catch (ExecutionException e) {
- errorCounter.inc();
- }
-
- }
-
- }
-
- private class Committer implements Runnable {
-
- final long txId;
-
- Committer(long txId) {
- this.txId = txId;
- }
-
- @Override
- public void run() {
-
- int txWritesetSize = calculateTxWritesetSize();
-
- if (txWritesetSize == 0) {
- return; // Read only tx, no need to commit
- }
- // Otherwise, we create the writeset...
- final Set<CellId> cells = new HashSet<>();
- for (byte i = 0; i < txWritesetSize; i++) {
- long cellId = cellIdGenerator.nextInt();
- cells.add(new DummyCellIdImpl(cellId));
- }
- // ... and we commit the transaction
- long startCommitTimeInNs = System.nanoTime();
- final TSOFuture<Long> commitFuture = tsoClient.commit(txId, cells);
- commitFuture.addListener(new CommitListener(txId, commitFuture, startCommitTimeInNs), callbackExec);
-
- }
-
- private int calculateTxWritesetSize() {
- int txSize = 0;
- boolean readOnly = (randomGen.nextFloat() * 100) < percentageOfReadOnlyTxs;
- if (!readOnly) {
- if (fixedWriteSetSize) {
- txSize = writesetSize;
- } else {
- txSize = randomGen.nextInt(writesetSize) + 1;
- }
- }
- return txSize;
- }
-
- }
-
- private class CommitListener implements Runnable {
-
- final long txId;
- final long commitRequestTime;
- final TSOFuture<Long> commitFuture;
-
- CommitListener(long txId, TSOFuture<Long> commitFuture, long commitRequestTime) {
- this.txId = txId;
- this.commitFuture = commitFuture;
- this.commitRequestTime = commitRequestTime;
- }
-
- @Override
- public void run() {
-
- try {
- commitFuture.get();
- commitTableClient.completeTransaction(txId).get();
- commitTimer.update(System.nanoTime() - commitRequestTime);
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- errorCounter.inc();
- } catch (ExecutionException e) {
- if (e.getCause() instanceof AbortException) {
- abortTimer.update(System.nanoTime() - commitRequestTime);
- } else {
- errorCounter.inc();
- }
- }
-
- }
-
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9cd856c6/benchmarks/src/main/java/com/yahoo/omid/benchmarks/tso/TSOServerBenchmark.java
----------------------------------------------------------------------
diff --git a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/tso/TSOServerBenchmark.java b/benchmarks/src/main/java/com/yahoo/omid/benchmarks/tso/TSOServerBenchmark.java
deleted file mode 100644
index b39d28a..0000000
--- a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/tso/TSOServerBenchmark.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.yahoo.omid.benchmarks.tso;
-
-import com.google.common.util.concurrent.ThreadFactoryBuilder;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.Closeable;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.concurrent.ExecutionException;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Benchmark using directly TSOClient to connect to the TSO Server
- */
-public class TSOServerBenchmark implements Closeable {
-
- private static final Logger LOG = LoggerFactory.getLogger(TSOServerBenchmark.class);
-
- private volatile boolean isCleaningDone = false;
-
- private final TSOServerBenchmarkConfig expConfig;
-
- // Clients triggering txs (threads) & corresponding executor
- private final ArrayList<RawTxRunner> txRunners = new ArrayList<>();
- private final ScheduledExecutorService txRunnerExec;
-
- private TSOServerBenchmark(TSOServerBenchmarkConfig expConfig) throws IOException {
-
- this.expConfig = expConfig;
-
- // Executor for TxRunners (Clients triggering transactions)
- Thread.UncaughtExceptionHandler uncaughtExceptionHandler = new Thread.UncaughtExceptionHandler() {
- @Override
- public void uncaughtException(Thread t, Throwable e) {
- LOG.error("Thread {} threw exception", t, e);
- }
- };
- ThreadFactoryBuilder threadFactoryBuilder = new ThreadFactoryBuilder()
- .setNameFormat("tx-runner-%d")
- .setUncaughtExceptionHandler(uncaughtExceptionHandler);
- this.txRunnerExec = Executors.newScheduledThreadPool(expConfig.getTxRunners(), threadFactoryBuilder.build());
-
- }
-
- public static void main(String[] args) throws Exception {
-
- final TSOServerBenchmarkConfig config = new TSOServerBenchmarkConfig();
-
- final int nOfTxRunners = config.getTxRunners();
-
- final long benchmarkRunLengthInMins = config.getBenchmarkRunLengthInMins();
-
- try (TSOServerBenchmark tsoBenchmark = new TSOServerBenchmark(config)) {
-
- tsoBenchmark.attachShutDownHook();
-
- LOG.info("----- Starting TSO Benchmark [ {} TxRunner clients ] -----", nOfTxRunners);
-
- for (int i = 0; i < nOfTxRunners; ++i) {
- tsoBenchmark.createTxRunner();
- }
-
- LOG.info("Benchmark run lenght {} Mins", benchmarkRunLengthInMins);
- TimeUnit.MINUTES.sleep(benchmarkRunLengthInMins);
-
- } finally {
- LOG.info("----- TSO Benchmark complete - Check metrics from individual clients in log -----");
- }
-
- }
-
- private void attachShutDownHook() {
- Runtime.getRuntime().addShutdownHook(new Thread("benchmark-cleaner") {
- @Override
- public void run() {
- if (!isCleaningDone) {
- close();
- }
- }
- });
- LOG.info("Shutdown Hook Attached");
- }
-
- private void createTxRunner() throws IOException, InterruptedException, ExecutionException {
-
- RawTxRunner txRunner = new RawTxRunner(expConfig);
- txRunnerExec.submit(txRunner);
-
- txRunners.add(txRunner);
-
- }
-
- @Override
- public void close() {
-
- // Stop clients
- for (RawTxRunner txRunner : txRunners) {
- txRunner.stop();
- }
-
- // Shutdown executor
- try {
- LOG.info("Closing TxRunner Executor in 10 secs");
- boolean wasSuccess = txRunnerExec.awaitTermination(10, TimeUnit.SECONDS);
- if (!wasSuccess) {
- txRunnerExec.shutdownNow();
- }
- } catch (InterruptedException e) {
- Thread.currentThread().interrupt();
- LOG.info("Interrupted whilst shutting down TxRunner Executor!");
- } finally {
- LOG.info("TxRunner Executor stopped");
- }
-
- isCleaningDone = true;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9cd856c6/benchmarks/src/main/java/com/yahoo/omid/benchmarks/tso/TSOServerBenchmarkConfig.java
----------------------------------------------------------------------
diff --git a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/tso/TSOServerBenchmarkConfig.java b/benchmarks/src/main/java/com/yahoo/omid/benchmarks/tso/TSOServerBenchmarkConfig.java
deleted file mode 100644
index 150040c..0000000
--- a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/tso/TSOServerBenchmarkConfig.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.yahoo.omid.benchmarks.tso;
-
-import com.google.inject.AbstractModule;
-import com.yahoo.omid.YAMLUtils;
-import com.yahoo.omid.benchmarks.utils.IntegerGenerator;
-import com.yahoo.omid.metrics.MetricsRegistry;
-import com.yahoo.omid.tools.hbase.SecureHBaseConfig;
-import com.yahoo.omid.tso.client.OmidClientConfiguration;
-
-public class TSOServerBenchmarkConfig extends SecureHBaseConfig {
-
- private static final String DEFAULT_CONFIG_FILE_NAME = "tso-server-benchmark-config.yml";
- private static final String CONFIG_FILE_NAME = "default-tso-server-benchmark-config.yml";
-
- private long benchmarkRunLengthInMins;
-
- private int txRunners;
- private int txRateInRequestPerSecond;
- private long warmUpPeriodInSecs;
- private IntegerGenerator cellIdGenerator;
- private int writesetSize;
- private boolean fixedWritesetSize;
- private int percentageOfReadOnlyTxs;
- private long commitDelayInMs;
-
- private OmidClientConfiguration omidClientConfiguration;
- private AbstractModule commitTableStoreModule;
-
- private MetricsRegistry metrics;
-
- // ----------------------------------------------------------------------------------------------------------------
- // Instantiation
- // ----------------------------------------------------------------------------------------------------------------
-
- TSOServerBenchmarkConfig() {
- this(CONFIG_FILE_NAME);
- }
-
- TSOServerBenchmarkConfig(String configFileName) {
- new YAMLUtils().loadSettings(DEFAULT_CONFIG_FILE_NAME, configFileName, this);
- }
-
- // ----------------------------------------------------------------------------------------------------------------
- // Getters and setters for config params
- // ----------------------------------------------------------------------------------------------------------------
-
- public long getBenchmarkRunLengthInMins() {
- return benchmarkRunLengthInMins;
- }
-
- public void setBenchmarkRunLengthInMins(long benchmarkRunLengthInMins) {
- this.benchmarkRunLengthInMins = benchmarkRunLengthInMins;
- }
-
- public int getTxRunners() {
- return txRunners;
- }
-
- public void setTxRunners(int txRunners) {
- this.txRunners = txRunners;
- }
-
- public int getTxRateInRequestPerSecond() {
- return txRateInRequestPerSecond;
- }
-
- public void setTxRateInRequestPerSecond(int txRateInRequestPerSecond) {
- this.txRateInRequestPerSecond = txRateInRequestPerSecond;
- }
-
- public long getWarmUpPeriodInSecs() {
- return warmUpPeriodInSecs;
- }
-
- public void setWarmUpPeriodInSecs(long warmUpPeriodInSecs) {
- this.warmUpPeriodInSecs = warmUpPeriodInSecs;
- }
-
- public IntegerGenerator getCellIdGenerator() {
- return cellIdGenerator;
- }
-
- public void setCellIdGenerator(IntegerGenerator cellIdGenerator) {
- this.cellIdGenerator = cellIdGenerator;
- }
-
- public int getWritesetSize() {
- return writesetSize;
- }
-
- public void setWritesetSize(int writesetSize) {
- this.writesetSize = writesetSize;
- }
-
- public boolean isFixedWritesetSize() {
- return fixedWritesetSize;
- }
-
- public void setFixedWritesetSize(boolean fixedWritesetSize) {
- this.fixedWritesetSize = fixedWritesetSize;
- }
-
- public int getPercentageOfReadOnlyTxs() {
- return percentageOfReadOnlyTxs;
- }
-
- public void setPercentageOfReadOnlyTxs(int percentageOfReadOnlyTxs) {
- this.percentageOfReadOnlyTxs = percentageOfReadOnlyTxs;
- }
-
- public long getCommitDelayInMs() {
- return commitDelayInMs;
- }
-
- public void setCommitDelayInMs(long commitDelayInMs) {
- this.commitDelayInMs = commitDelayInMs;
- }
-
- public OmidClientConfiguration getOmidClientConfiguration() {
- return omidClientConfiguration;
- }
-
- public void setOmidClientConfiguration(OmidClientConfiguration omidClientConfiguration) {
- this.omidClientConfiguration = omidClientConfiguration;
- }
-
- public AbstractModule getCommitTableStoreModule() {
- return commitTableStoreModule;
- }
-
- public void setCommitTableStoreModule(AbstractModule commitTableStoreModule) {
- this.commitTableStoreModule = commitTableStoreModule;
- }
-
- public MetricsRegistry getMetrics() {
- return metrics;
- }
-
- public void setMetrics(MetricsRegistry metrics) {
- this.metrics = metrics;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9cd856c6/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/Generator.java
----------------------------------------------------------------------
diff --git a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/Generator.java b/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/Generator.java
deleted file mode 100644
index bbd106f..0000000
--- a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/Generator.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Copyright (c) 2010 Yahoo! Inc. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you
- * may not use this file except in compliance with the License. You
- * may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License. See accompanying
- * LICENSE file.
- */
-
-package com.yahoo.omid.benchmarks.utils;
-
-/**
- * An expression that generates a sequence of string values, following some distribution (Uniform, Zipfian, Sequential, etc.)
- */
-public abstract class Generator {
- /**
- * Generate the next string in the distribution.
- */
- public abstract String nextString();
-
- /**
- * Return the previous string generated by the distribution; e.g., returned from the last nextString() call.
- * Calling lastString() should not advance the distribution or have any side effects. If nextString() has not yet
- * been called, lastString() should return something reasonable.
- */
- public abstract String lastString();
-}
-
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9cd856c6/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/IntegerGenerator.java
----------------------------------------------------------------------
diff --git a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/IntegerGenerator.java b/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/IntegerGenerator.java
deleted file mode 100644
index 9f73e71..0000000
--- a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/IntegerGenerator.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/**
- * Copyright (c) 2010 Yahoo! Inc. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you
- * may not use this file except in compliance with the License. You
- * may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License. See accompanying
- * LICENSE file.
- */
-
-package com.yahoo.omid.benchmarks.utils;
-
-/**
- * A generator that is capable of generating ints as well as strings
- *
- * @author cooperb
- *
- */
-public abstract class IntegerGenerator extends Generator {
- int lastint;
-
- /**
- * Set the last value generated. IntegerGenerator subclasses must use this call
- * to properly set the last string value, or the lastString() and lastInt() calls won't work.
- */
- protected void setLastInt(int last) {
- lastint = last;
- }
-
- /**
- * Return the next value as an int. When overriding this method, be sure to call setLastString() properly, or the lastString() call won't work.
- */
- public abstract int nextInt();
-
- /**
- * Generate the next string in the distribution.
- */
- public String nextString() {
- return "" + nextInt();
- }
-
- /**
- * Return the previous string generated by the distribution; e.g., returned from the last nextString() call.
- * Calling lastString() should not advance the distribution or have any side effects. If nextString() has not yet
- * been called, lastString() should return something reasonable.
- */
- @Override
- public String lastString() {
- return "" + lastInt();
- }
-
- /**
- * Return the previous int generated by the distribution. This call is unique to IntegerGenerator subclasses, and assumes
- * IntegerGenerator subclasses always return ints for nextInt() (e.g. not arbitrary strings).
- */
- public int lastInt() {
- return lastint;
- }
-
- /**
- * Return the expected value (mean) of the values this generator will return.
- */
- public abstract double mean();
-}
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9cd856c6/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/ScrambledZipfianGenerator.java
----------------------------------------------------------------------
diff --git a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/ScrambledZipfianGenerator.java b/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/ScrambledZipfianGenerator.java
deleted file mode 100644
index 10c4103..0000000
--- a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/ScrambledZipfianGenerator.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/**
- * Copyright (c) 2010 Yahoo! Inc. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you
- * may not use this file except in compliance with the License. You
- * may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- * implied. See the License for the specific language governing
- * permissions and limitations under the License. See accompanying
- * LICENSE file.
- */
-
-package com.yahoo.omid.benchmarks.utils;
-
-
-/**
- * A generator of a zipfian distribution. It produces a sequence of items, such that some items are more popular than others, according
- * to a zipfian distribution. When you construct an instance of this class, you specify the number of items in the set to draw from, either
- * by specifying an itemcount (so that the sequence is of items from 0 to itemcount-1) or by specifying a min and a max (so that the sequence is of
- * items from min to max inclusive). After you construct the instance, you can change the number of items by calling nextInt(itemcount) or nextLong(itemcount).
- *
- * Unlike @ZipfianGenerator, this class scatters the "popular" items across the itemspace. Use this, instead of @ZipfianGenerator, if you
- * don't want the head of the distribution (the popular items) clustered together.
- */
-public class ScrambledZipfianGenerator extends IntegerGenerator {
- public static final double ZETAN = 26.46902820178302;
- public static final double USED_ZIPFIAN_CONSTANT = 0.99;
- public static final long ITEM_COUNT = 10000000000L;
-
- ZipfianGenerator gen;
- long _min, _max, _itemcount;
-
- /******************************* Constructors **************************************/
-
- /**
- * Create a zipfian generator for the specified number of items.
- * @param _items The number of items in the distribution.
- */
- public ScrambledZipfianGenerator(long _items) {
- this(0, _items - 1);
- }
-
- /**
- * Create a zipfian generator for items between min and max.
- * @param _min The smallest integer to generate in the sequence.
- * @param _max The largest integer to generate in the sequence.
- */
- public ScrambledZipfianGenerator(long _min, long _max) {
- this(_min, _max, ZipfianGenerator.ZIPFIAN_CONSTANT);
- }
-
- /**
- * Create a zipfian generator for the specified number of items using the specified zipfian constant.
- *
- * @param _items The number of items in the distribution.
- * @param _zipfianconstant The zipfian constant to use.
- */
- /*
-// not supported, as the value of zeta depends on the zipfian constant, and we have only precomputed zeta for one zipfian constant
- public ScrambledZipfianGenerator(long _items, double _zipfianconstant)
- {
- this(0,_items-1,_zipfianconstant);
- }
-*/
-
- /**
- * Create a zipfian generator for items between min and max (inclusive) for the specified zipfian constant. If you
- * use a zipfian constant other than 0.99, this will take a long time to complete because we need to recompute zeta.
- * @param min The smallest integer to generate in the sequence.
- * @param max The largest integer to generate in the sequence.
- * @param _zipfianconstant The zipfian constant to use.
- */
- public ScrambledZipfianGenerator(long min, long max, double _zipfianconstant) {
- _min = min;
- _max = max;
- _itemcount = _max - _min + 1;
- if (_zipfianconstant == USED_ZIPFIAN_CONSTANT) {
- gen = new ZipfianGenerator(0, ITEM_COUNT, _zipfianconstant, ZETAN);
- } else {
- gen = new ZipfianGenerator(0, ITEM_COUNT, _zipfianconstant);
- }
- }
-
- /**************************************************************************************************/
-
- /**
- * Return the next int in the sequence.
- */
- @Override
- public int nextInt() {
- return (int) nextLong();
- }
-
- /**
- * Return the next long in the sequence.
- */
- public long nextLong() {
- long ret = gen.nextLong();
- ret = _min + FNVhash64(ret) % _itemcount;
- setLastInt((int) ret);
- return ret;
- }
-
- public static void main(String[] args) {
- double newzetan = ZipfianGenerator.zetastatic(ITEM_COUNT, ZipfianGenerator.ZIPFIAN_CONSTANT);
- System.out.println("zetan: " + newzetan);
- System.exit(0);
-
- ScrambledZipfianGenerator gen = new ScrambledZipfianGenerator(10000);
-
- for (int i = 0; i < 1000000; i++) {
- System.out.println("" + gen.nextInt());
- }
- }
-
- /**
- * since the values are scrambled (hopefully uniformly), the mean is simply the middle of the range.
- */
- @Override
- public double mean() {
- return ((double) (((long) _min) + (long) _max)) / 2.0;
- }
-
- /**
- * 64 bit FNV hash. Produces more "random" hashes than (say) String.hashCode().
- *
- * @param val The value to hash.
- * @return The hash value
- */
- public static long FNVhash64(long val) {
- //from http://en.wikipedia.org/wiki/Fowler_Noll_Vo_hash
- long hashval = FNV_offset_basis_64;
-
- for (int i = 0; i < 8; i++) {
- long octet = val & 0x00ff;
- val = val >> 8;
-
- hashval = hashval ^ octet;
- hashval = hashval * FNV_prime_64;
- //hashval = hashval ^ octet;
- }
- return Math.abs(hashval);
- }
-
- public static final long FNV_offset_basis_64 = 0xCBF29CE484222325L;
- public static final long FNV_prime_64 = 1099511628211L;
-
-}
http://git-wip-us.apache.org/repos/asf/incubator-omid/blob/9cd856c6/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/UniformGenerator.java
----------------------------------------------------------------------
diff --git a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/UniformGenerator.java b/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/UniformGenerator.java
deleted file mode 100644
index eb27bd3..0000000
--- a/benchmarks/src/main/java/com/yahoo/omid/benchmarks/utils/UniformGenerator.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package com.yahoo.omid.benchmarks.utils;
-
-import java.util.Random;
-
-public class UniformGenerator extends IntegerGenerator {
-
- private final Random ramdom = new Random(System.nanoTime());
-
- @Override
- public int nextInt() {
- return ramdom.nextInt(Integer.MAX_VALUE);
- }
-
- @Override
- public double mean() {
- return 0;
- }
-
-}