├── .gitignore ├── .rat-excludes ├── CHANGES.txt ├── LICENSE.txt ├── NEWS.txt ├── NOTICE.txt ├── README.txt ├── add_loopback_address.bash ├── bin ├── cassandra ├── cassandra-cli ├── cassandra-cli.bat ├── cassandra.bat ├── cassandra.in.sh ├── cqlsh ├── cqlshrc.sample ├── json2sstable ├── json2sstable.bat ├── nodetool ├── nodetool.bat ├── sstable2json ├── sstable2json.bat ├── sstablekeys ├── sstablekeys.bat ├── sstableloader └── stop-server ├── build.properties.default ├── build.xml ├── cassandra_dc_launcher.bash ├── cassandra_var └── check_logs_for_errors.bash ├── conf-orig ├── README.txt ├── cassandra-env.sh ├── cassandra-topology.properties.orig ├── cassandra.yaml ├── cassandra_BASE.yaml ├── cassandra_VICCI_BASE.yaml ├── log4j-server.properties ├── log4j-server_BASE.properties └── log4j-tools.properties ├── conf ├── README.txt ├── cassandra-env.sh ├── cassandra-topology.properties.orig ├── cassandra.princeton1.yaml ├── cassandra.yaml ├── cassandra_BASE.yaml ├── cassandra_KODIAK_BASE.yaml ├── cassandra_VICCI_BASE.yaml ├── log4j-server.properties ├── log4j-server_BASE.properties ├── log4j-tools.properties └── vicci │ └── .gitignore ├── contrib └── pig │ ├── README.txt │ ├── bin │ └── pig_cassandra │ ├── build.xml │ ├── example-script.pig │ └── src │ └── java │ └── org │ └── apache │ └── cassandra │ └── hadoop │ └── pig │ └── CassandraStorage.java ├── debian ├── README.Debian ├── TODO ├── cassandra-sysctl.conf ├── cassandra.conf ├── cassandra.in.sh ├── cassandra.install ├── cassandra.postinst ├── changelog ├── compat ├── control ├── copyright ├── default ├── dirs ├── init └── rules ├── doc └── cql │ ├── CQL.css │ └── CQL.textile ├── examples ├── client_only │ ├── README.txt │ ├── bin │ │ └── client_only │ ├── build.xml │ ├── conf │ │ └── cassandra.yaml │ └── src │ │ └── ClientOnlyExample.java ├── hadoop_word_count │ ├── README.txt │ ├── bin │ │ ├── word_count │ │ ├── word_count_counters │ │ └── word_count_setup │ ├── build.xml │ ├── ivy.xml │ └── src │ │ ├── WordCount.java │ │ ├── WordCountCounters.java │ │ └── WordCountSetup.java └── simple_authentication │ ├── README.txt │ ├── conf │ ├── access.properties │ └── passwd.properties │ └── src │ └── org │ └── apache │ └── cassandra │ └── auth │ ├── SimpleAuthenticator.java │ └── SimpleAuthority.java ├── experiments ├── dep_propagation.bash ├── dep_propagation_postprocess_combine.bash ├── dep_propagation_postprocess_full.bash ├── dep_propagation_postprocess_trial.bash ├── dwp_debug.bash ├── dwtf_debug.bash ├── dynamic.bash ├── dynamic_columns_per_read.bash ├── dynamic_columns_per_write.bash ├── dynamic_common ├── dynamic_defaults ├── dynamic_keys_per_read.bash ├── dynamic_keys_per_write.bash ├── dynamic_per_client_tput.bash ├── dynamic_postprocess_client.bash ├── dynamic_postprocess_combine_clients.bash ├── dynamic_postprocess_combine_trials.bash ├── dynamic_postprocess_full.bash ├── dynamic_shuffle_dirs.bash ├── dynamic_size.bash ├── dynamic_write_perc.bash ├── dynamic_write_trans_frac.bash ├── facebook.bash ├── kill_stress_local_mbp.bash ├── kodiak_common ├── kodiak_scale.bash ├── micro_benchmark_cops_ops.bash └── write_txn.bash ├── interface ├── cassandra.thrift └── thrift │ └── gen-java │ └── org │ └── apache │ └── cassandra │ └── thrift │ ├── AuthenticationException.java │ ├── AuthenticationRequest.java │ ├── AuthorizationException.java │ ├── BatchMutateResult.java │ ├── Cassandra.java │ ├── Cassandra.java.orig │ ├── CfDef.java │ ├── Column.java │ ├── ColumnDef.java │ ├── ColumnOrSuperColumn.java │ ├── ColumnParent.java │ ├── ColumnPath.java │ ├── Compression.java │ ├── ConsistencyLevel.java │ ├── Constants.java │ ├── CountWithMetadata.java │ ├── CounterColumn.java │ ├── CounterSuperColumn.java │ ├── CqlMetadata.java │ ├── CqlPreparedResult.java │ ├── CqlResult.java │ ├── CqlResultType.java │ ├── CqlRow.java │ ├── Deletion.java │ ├── Dep.java │ ├── EndpointDetails.java │ ├── GetCountResult.java │ ├── GetIndexedSlicesResult.java │ ├── GetRangeSlicesResult.java │ ├── GetResult.java │ ├── GetSliceResult.java │ ├── IndexClause.java │ ├── IndexExpression.java │ ├── IndexOperator.java │ ├── IndexType.java │ ├── InvalidRequestException.java │ ├── KeyCount.java │ ├── KeyRange.java │ ├── KeySlice.java │ ├── KsDef.java │ ├── MultigetCountResult.java │ ├── MultigetSliceResult.java │ ├── Mutation.java │ ├── NotFoundException.java │ ├── SchemaDisagreementException.java │ ├── SlicePredicate.java │ ├── SliceRange.java │ ├── SuperColumn.java │ ├── TimedOutException.java │ ├── TokenRange.java │ ├── UnavailableException.java │ └── WriteResult.java ├── kill_all_cassandra.bash ├── kill_stress_vicci.bash ├── kodiak_cassandra_killer.bash ├── kodiak_dc_launcher.bash ├── lib ├── antlr-3.2.jar ├── avro-1.4.0-fixes.jar ├── avro-1.4.0-sources-fixes.jar ├── commons-cli-1.1.jar ├── commons-codec-1.2.jar ├── commons-lang-2.4.jar ├── compress-lzf-0.8.4.jar ├── concurrentlinkedhashmap-lru-1.2.jar ├── guava-r08.jar ├── high-scale-lib-1.1.2.jar ├── jackson-core-asl-1.9.2.jar ├── jackson-mapper-asl-1.9.2.jar ├── jamm-0.2.5.jar ├── jline-0.9.94.jar ├── json-simple-1.1.jar ├── libthrift-0.7.0.jar ├── licenses │ ├── antlr-3.1.3.txt │ ├── avro-1.3.1-dev.txt │ ├── commons-cli-1.1.txt │ ├── commons-codec-1.2.txt │ ├── commons-collections-3.2.1.txt │ ├── commons-lang-2.4.txt │ ├── compress-lzf-0.8.4.txt │ ├── concurrentlinkedhashmap-lru-1.2.txt │ ├── guava-r08.txt │ ├── high-scale-lib-1.1.2.txt │ ├── jackson-core-asl-1.9.2.txt │ ├── jackson-mapper-asl-1.9.2.txt │ ├── jamm-0.2.2.txt │ ├── jetty-6.1.21.txt │ ├── jetty-util-6.1.21.txt │ ├── jline-0.9.94.txt │ ├── json-simple-1.1.txt │ ├── libthrift-0.7.txt │ ├── log4j-1.2.16.txt │ ├── servlet-api-2.5-20081211.txt │ ├── slf4j-api-1.6.1.txt │ ├── slf4j-log4j12-1.6.1.txt │ ├── snakeyaml-1.6.txt │ ├── snappy-java-1.0.3.txt │ └── snaptree-0.1-SNAPSHOT.txt ├── log4j-1.2.16.jar ├── servlet-api-2.5-20081211.jar ├── slf4j-api-1.6.1.jar ├── slf4j-log4j12-1.6.1.jar ├── snakeyaml-1.6.jar ├── snappy-java-1.0.4.1.jar └── snaptree-0.1-SNAPSHOT.jar ├── pylib └── cqlshlib │ ├── __init__.py │ ├── cqlhandling.py │ ├── pylexotron.py │ └── saferscanner.py ├── src ├── avro │ └── internode.genavro ├── java │ └── org │ │ └── apache │ │ └── cassandra │ │ ├── auth │ │ ├── AllowAllAuthenticator.java │ │ ├── AllowAllAuthority.java │ │ ├── AuthenticatedUser.java │ │ ├── IAuthenticator.java │ │ ├── IAuthority.java │ │ ├── Permission.java │ │ └── Resources.java │ │ ├── cache │ │ ├── AutoSavingCache.java │ │ ├── CacheKey.java │ │ ├── ConcurrentLinkedHashCache.java │ │ ├── ConcurrentLinkedHashCacheProvider.java │ │ ├── FreeableMemory.java │ │ ├── ICache.java │ │ ├── IRowCacheProvider.java │ │ ├── InstrumentingCache.java │ │ ├── KeyCacheKey.java │ │ ├── RowCacheKey.java │ │ ├── SerializingCache.java │ │ └── SerializingCacheProvider.java │ │ ├── cli │ │ ├── Cli.g │ │ ├── CliClient.java │ │ ├── CliCommandHelp.java │ │ ├── CliCompiler.java │ │ ├── CliCompleter.java │ │ ├── CliMain.java │ │ ├── CliOptions.java │ │ ├── CliSessionState.java │ │ ├── CliUserHelp.java │ │ └── CliUtils.java │ │ ├── client │ │ ├── BlockingQueueCallback.java │ │ ├── ClientContext.java │ │ ├── ClientLibrary.java │ │ ├── IgnoredCallback.java │ │ └── RingCache.java │ │ ├── concurrent │ │ ├── Context.java │ │ ├── CreationTimeAwareFuture.java │ │ ├── DebuggableScheduledThreadPoolExecutor.java │ │ ├── DebuggableThreadPoolExecutor.java │ │ ├── IExecutorMBean.java │ │ ├── JMXConfigurableThreadPoolExecutor.java │ │ ├── JMXConfigurableThreadPoolExecutorMBean.java │ │ ├── JMXEnabledThreadPoolExecutor.java │ │ ├── JMXEnabledThreadPoolExecutorMBean.java │ │ ├── NamedThreadFactory.java │ │ ├── Stage.java │ │ └── StageManager.java │ │ ├── config │ │ ├── CFMetaData.java │ │ ├── ColumnDefinition.java │ │ ├── Config.java │ │ ├── ConfigurationException.java │ │ ├── DatabaseDescriptor.java │ │ ├── EncryptionOptions.java │ │ ├── KSMetaData.java │ │ ├── RequestSchedulerOptions.java │ │ ├── Schema.java │ │ └── SeedProviderDef.java │ │ ├── cql │ │ ├── AbstractModification.java │ │ ├── AlterTableStatement.java │ │ ├── Attributes.java │ │ ├── BatchStatement.java │ │ ├── CFPropDefs.java │ │ ├── CQLStatement.java │ │ ├── Cql.g │ │ ├── CreateColumnFamilyStatement.java │ │ ├── CreateIndexStatement.java │ │ ├── CreateKeyspaceStatement.java │ │ ├── DeleteStatement.java │ │ ├── DropIndexStatement.java │ │ ├── Operation.java │ │ ├── QueryProcessor.java │ │ ├── Relation.java │ │ ├── SelectExpression.java │ │ ├── SelectStatement.java │ │ ├── StatementType.java │ │ ├── Term.java │ │ ├── UpdateStatement.java │ │ ├── WhereClause.java │ │ └── jdbc │ │ │ ├── AbstractJdbcType.java │ │ │ ├── AbstractJdbcUUID.java │ │ │ ├── JdbcAscii.java │ │ │ ├── JdbcBoolean.java │ │ │ ├── JdbcBytes.java │ │ │ ├── JdbcCounterColumn.java │ │ │ ├── JdbcDate.java │ │ │ ├── JdbcDecimal.java │ │ │ ├── JdbcDouble.java │ │ │ ├── JdbcFloat.java │ │ │ ├── JdbcInt32.java │ │ │ ├── JdbcInteger.java │ │ │ ├── JdbcLexicalUUID.java │ │ │ ├── JdbcLong.java │ │ │ ├── JdbcTimeUUID.java │ │ │ ├── JdbcUTF8.java │ │ │ ├── JdbcUUID.java │ │ │ ├── MarshalException.java │ │ │ └── TypesMap.java │ │ ├── db │ │ ├── AbstractColumnContainer.java │ │ ├── AbstractThreadUnsafeSortedColumns.java │ │ ├── AppliedOperations.java │ │ ├── ArrayBackedSortedColumns.java │ │ ├── AtomicSortedColumns.java │ │ ├── CollationController.java │ │ ├── Column.java │ │ ├── ColumnFamily.java │ │ ├── ColumnFamilyNotDefinedException.java │ │ ├── ColumnFamilySerializer.java │ │ ├── ColumnFamilyStore.java │ │ ├── ColumnFamilyStoreMBean.java │ │ ├── ColumnFamilyType.java │ │ ├── ColumnIndexer.java │ │ ├── ColumnSerializer.java │ │ ├── CounterColumn.java │ │ ├── CounterMutation.java │ │ ├── CounterMutationCompletion.java │ │ ├── CounterMutationVerbHandler.java │ │ ├── CounterUpdateColumn.java │ │ ├── DBConstants.java │ │ ├── DataTracker.java │ │ ├── DecoratedKey.java │ │ ├── DefinitionsUpdateVerbHandler.java │ │ ├── DefsTable.java │ │ ├── DeletedColumn.java │ │ ├── Dependency.java │ │ ├── DependencyCheck.java │ │ ├── DependencyCheckVerbHandler.java │ │ ├── Directories.java │ │ ├── EchoedRow.java │ │ ├── ExpiringColumn.java │ │ ├── HideableTimestamp.java │ │ ├── HintedHandOffManager.java │ │ ├── HintedHandOffManagerMBean.java │ │ ├── IColumn.java │ │ ├── IColumnContainer.java │ │ ├── IMutation.java │ │ ├── ISortedColumns.java │ │ ├── IndexScanCommand.java │ │ ├── KeyspaceNotDefinedException.java │ │ ├── Memtable.java │ │ ├── MeteredFlusher.java │ │ ├── RangeSliceCommand.java │ │ ├── RangeSliceReply.java │ │ ├── ReadCommand.java │ │ ├── ReadRepairVerbHandler.java │ │ ├── ReadResponse.java │ │ ├── ReadVerbHandler.java │ │ ├── RetriedSliceFromReadCommand.java │ │ ├── Row.java │ │ ├── RowIteratorFactory.java │ │ ├── RowMutation.java │ │ ├── RowMutationCompletion.java │ │ ├── RowMutationVerbHandler.java │ │ ├── RowPosition.java │ │ ├── SchemaCheckVerbHandler.java │ │ ├── SliceByNamesReadCommand.java │ │ ├── SliceFromReadCommand.java │ │ ├── SuperColumn.java │ │ ├── SystemTable.java │ │ ├── Table.java │ │ ├── TreeMapBackedSortedColumns.java │ │ ├── TruncateResponse.java │ │ ├── TruncateVerbHandler.java │ │ ├── Truncation.java │ │ ├── UnserializableColumnFamilyException.java │ │ ├── WriteResponse.java │ │ ├── columniterator │ │ │ ├── IColumnIterator.java │ │ │ ├── ICountableColumnIterator.java │ │ │ ├── IdentityQueryFilter.java │ │ │ ├── IndexedSliceReader.java │ │ │ ├── SSTableNamesIterator.java │ │ │ ├── SSTableSliceIterator.java │ │ │ ├── SimpleAbstractColumnIterator.java │ │ │ └── SimpleSliceReader.java │ │ ├── commitlog │ │ │ ├── AbstractCommitLogExecutorService.java │ │ │ ├── BatchCommitLogExecutorService.java │ │ │ ├── CommitLog.java │ │ │ ├── CommitLogAllocator.java │ │ │ ├── CommitLogMBean.java │ │ │ ├── CommitLogSegment.java │ │ │ ├── ICommitLogExecutorService.java │ │ │ ├── PeriodicCommitLogExecutorService.java │ │ │ └── ReplayPosition.java │ │ ├── compaction │ │ │ ├── AbstractCompactedRow.java │ │ │ ├── AbstractCompactionIterable.java │ │ │ ├── AbstractCompactionStrategy.java │ │ │ ├── AbstractCompactionTask.java │ │ │ ├── CompactionController.java │ │ │ ├── CompactionInfo.java │ │ │ ├── CompactionInterruptedException.java │ │ │ ├── CompactionIterable.java │ │ │ ├── CompactionManager.java │ │ │ ├── CompactionManagerMBean.java │ │ │ ├── CompactionTask.java │ │ │ ├── LazilyCompactedRow.java │ │ │ ├── LeveledCompactionStrategy.java │ │ │ ├── LeveledCompactionTask.java │ │ │ ├── LeveledManifest.java │ │ │ ├── OperationType.java │ │ │ ├── ParallelCompactionIterable.java │ │ │ ├── PrecompactedRow.java │ │ │ └── SizeTieredCompactionStrategy.java │ │ ├── context │ │ │ ├── CounterContext.java │ │ │ └── IContext.java │ │ ├── filter │ │ │ ├── AbstractColumnIterator.java │ │ │ ├── ExtendedFilter.java │ │ │ ├── IFilter.java │ │ │ ├── NamesQueryFilter.java │ │ │ ├── QueryFilter.java │ │ │ ├── QueryPath.java │ │ │ └── SliceQueryFilter.java │ │ ├── index │ │ │ ├── PerColumnSecondaryIndex.java │ │ │ ├── PerRowSecondaryIndex.java │ │ │ ├── SecondaryIndex.java │ │ │ ├── SecondaryIndexBuilder.java │ │ │ ├── SecondaryIndexManager.java │ │ │ ├── SecondaryIndexSearcher.java │ │ │ └── keys │ │ │ │ ├── KeysIndex.java │ │ │ │ └── KeysSearcher.java │ │ ├── marshal │ │ │ ├── AbstractCommutativeType.java │ │ │ ├── AbstractCompositeType.java │ │ │ ├── AbstractType.java │ │ │ ├── AsciiType.java │ │ │ ├── BooleanType.java │ │ │ ├── BytesType.java │ │ │ ├── CompositeType.java │ │ │ ├── CounterColumnType.java │ │ │ ├── DateType.java │ │ │ ├── DecimalType.java │ │ │ ├── DoubleType.java │ │ │ ├── DynamicCompositeType.java │ │ │ ├── FloatType.java │ │ │ ├── Int32Type.java │ │ │ ├── IntegerType.java │ │ │ ├── LexicalUUIDType.java │ │ │ ├── LocalByPartionerType.java │ │ │ ├── LongType.java │ │ │ ├── MarshalException.java │ │ │ ├── ReversedType.java │ │ │ ├── TimeUUIDType.java │ │ │ ├── TypeParser.java │ │ │ ├── UTF8Type.java │ │ │ └── UUIDType.java │ │ ├── migration │ │ │ ├── AddColumnFamily.java │ │ │ ├── AddKeyspace.java │ │ │ ├── DropColumnFamily.java │ │ │ ├── DropKeyspace.java │ │ │ ├── Migration.java │ │ │ ├── UpdateColumnFamily.java │ │ │ └── UpdateKeyspace.java │ │ └── transaction │ │ │ ├── AbstractTransactionMessage.java │ │ │ ├── AckMessage.java │ │ │ ├── BatchMutateTransactionCohort.java │ │ │ ├── BatchMutateTransactionCoordinator.java │ │ │ ├── BatchMutateTransactionUtil.java │ │ │ ├── CheckTransactionCallback.java │ │ │ ├── CheckTransactionMessage.java │ │ │ ├── CohortMessage.java │ │ │ ├── CommitMessage.java │ │ │ ├── NotifyMessage.java │ │ │ ├── PendingTransactionColumn.java │ │ │ ├── PendingTransactionMutation.java │ │ │ ├── PrepareMessage.java │ │ │ ├── TransactionCohortVerbHandler.java │ │ │ ├── TransactionCoordinatorVerbHandler.java │ │ │ ├── TransactionMessageVerbHandler.java │ │ │ ├── TransactionProxy.java │ │ │ ├── TransactionsCheckedMessage.java │ │ │ └── YesVoteMessage.java │ │ ├── dht │ │ ├── AbstractBounds.java │ │ ├── AbstractByteOrderedPartitioner.java │ │ ├── AbstractPartitioner.java │ │ ├── BigIntegerToken.java │ │ ├── BootStrapper.java │ │ ├── Bounds.java │ │ ├── ByteOrderedPartitioner.java │ │ ├── BytesToken.java │ │ ├── CollatingOrderPreservingPartitioner.java │ │ ├── IPartitioner.java │ │ ├── LocalPartitioner.java │ │ ├── LocalToken.java │ │ ├── OrderPreservingPartitioner.java │ │ ├── RandomPartitioner.java │ │ ├── Range.java │ │ ├── RingPosition.java │ │ ├── StringToken.java │ │ └── Token.java │ │ ├── gms │ │ ├── ApplicationState.java │ │ ├── EndpointState.java │ │ ├── FailureDetector.java │ │ ├── FailureDetectorMBean.java │ │ ├── GossipDigest.java │ │ ├── GossipDigestAck2Message.java │ │ ├── GossipDigestAck2VerbHandler.java │ │ ├── GossipDigestAckMessage.java │ │ ├── GossipDigestAckVerbHandler.java │ │ ├── GossipDigestSynMessage.java │ │ ├── GossipDigestSynVerbHandler.java │ │ ├── Gossiper.java │ │ ├── GossiperMBean.java │ │ ├── HeartBeatState.java │ │ ├── IEndpointStateChangeSubscriber.java │ │ ├── IFailureDetectionEventListener.java │ │ ├── IFailureDetector.java │ │ ├── IFailureNotification.java │ │ ├── PureRandom.java │ │ ├── VersionGenerator.java │ │ └── VersionedValue.java │ │ ├── hadoop │ │ ├── BulkOutputFormat.java │ │ ├── BulkRecordWriter.java │ │ ├── ColumnFamilyInputFormat.java │ │ ├── ColumnFamilyOutputFormat.java │ │ ├── ColumnFamilyRecordReader.java │ │ ├── ColumnFamilyRecordWriter.java │ │ ├── ColumnFamilySplit.java │ │ └── ConfigHelper.java │ │ ├── io │ │ ├── IColumnSerializer.java │ │ ├── ISerializer.java │ │ ├── IVersionedSerializer.java │ │ ├── SerDeUtils.java │ │ ├── compress │ │ │ ├── CompressedRandomAccessReader.java │ │ │ ├── CompressedSequentialWriter.java │ │ │ ├── CompressionMetadata.java │ │ │ ├── CompressionParameters.java │ │ │ ├── CorruptedBlockException.java │ │ │ ├── DeflateCompressor.java │ │ │ ├── ICompressor.java │ │ │ └── SnappyCompressor.java │ │ ├── sstable │ │ │ ├── AbstractSSTableSimpleWriter.java │ │ │ ├── BloomFilterTracker.java │ │ │ ├── Component.java │ │ │ ├── Descriptor.java │ │ │ ├── IndexHelper.java │ │ │ ├── IndexSummary.java │ │ │ ├── KeyIterator.java │ │ │ ├── ReducingKeyIterator.java │ │ │ ├── SSTable.java │ │ │ ├── SSTableBoundedScanner.java │ │ │ ├── SSTableDeletingTask.java │ │ │ ├── SSTableIdentityIterator.java │ │ │ ├── SSTableLoader.java │ │ │ ├── SSTableMetadata.java │ │ │ ├── SSTableReader.java │ │ │ ├── SSTableScanner.java │ │ │ ├── SSTableSimpleUnsortedWriter.java │ │ │ ├── SSTableSimpleWriter.java │ │ │ └── SSTableWriter.java │ │ └── util │ │ │ ├── AbstractDataInput.java │ │ │ ├── BufferedSegmentedFile.java │ │ │ ├── ColumnSortedMap.java │ │ │ ├── CompressedSegmentedFile.java │ │ │ ├── DataOutputBuffer.java │ │ │ ├── FastByteArrayInputStream.java │ │ │ ├── FastByteArrayOutputStream.java │ │ │ ├── FileDataInput.java │ │ │ ├── FileMark.java │ │ │ ├── FileUtils.java │ │ │ ├── IIterableColumns.java │ │ │ ├── MappedFileDataInput.java │ │ │ ├── Memory.java │ │ │ ├── MemoryInputStream.java │ │ │ ├── MemoryOutputStream.java │ │ │ ├── MmappedSegmentedFile.java │ │ │ ├── OutputBuffer.java │ │ │ ├── RandomAccessReader.java │ │ │ ├── SegmentedFile.java │ │ │ └── SequentialWriter.java │ │ ├── locator │ │ ├── AbstractEndpointSnitch.java │ │ ├── AbstractNetworkTopologySnitch.java │ │ ├── AbstractReplicationStrategy.java │ │ ├── DynamicEndpointSnitch.java │ │ ├── DynamicEndpointSnitchMBean.java │ │ ├── Ec2MultiRegionSnitch.java │ │ ├── Ec2Snitch.java │ │ ├── EndpointSnitchInfo.java │ │ ├── EndpointSnitchInfoMBean.java │ │ ├── IEndpointSnitch.java │ │ ├── ILatencySubscriber.java │ │ ├── LocalStrategy.java │ │ ├── NetworkTopologyStrategy.java │ │ ├── OldNetworkTopologyStrategy.java │ │ ├── PropertyFileSnitch.java │ │ ├── RackInferringSnitch.java │ │ ├── SeedProvider.java │ │ ├── SimpleSeedProvider.java │ │ ├── SimpleSnitch.java │ │ ├── SimpleStrategy.java │ │ └── TokenMetadata.java │ │ ├── net │ │ ├── AsyncResult.java │ │ ├── CachingMessageProducer.java │ │ ├── CallbackInfo.java │ │ ├── CompactEndpointSerializationHelper.java │ │ ├── Header.java │ │ ├── HeaderTypes.java │ │ ├── IAsyncCallback.java │ │ ├── IAsyncResult.java │ │ ├── ICompletable.java │ │ ├── IMessageCallback.java │ │ ├── IVerbHandler.java │ │ ├── IncomingTcpConnection.java │ │ ├── Message.java │ │ ├── MessageDeliveryTask.java │ │ ├── MessageProducer.java │ │ ├── MessagingService.java │ │ ├── MessagingServiceMBean.java │ │ ├── OutboundTcpConnection.java │ │ ├── OutboundTcpConnectionPool.java │ │ ├── ResponseVerbHandler.java │ │ ├── io │ │ │ └── SerializerType.java │ │ └── sink │ │ │ ├── IMessageSink.java │ │ │ └── SinkManager.java │ │ ├── notifications │ │ ├── INotification.java │ │ ├── INotificationConsumer.java │ │ ├── SSTableAddedNotification.java │ │ └── SSTableListChangedNotification.java │ │ ├── scheduler │ │ ├── IRequestScheduler.java │ │ ├── NoScheduler.java │ │ ├── RoundRobinScheduler.java │ │ ├── WeightedQueue.java │ │ └── WeightedQueueMBean.java │ │ ├── security │ │ └── SSLFactory.java │ │ ├── service │ │ ├── AbstractCassandraDaemon.java │ │ ├── AbstractRowResolver.java │ │ ├── AbstractWriteResponseHandler.java │ │ ├── AntiEntropyService.java │ │ ├── AsyncRepairCallback.java │ │ ├── CacheService.java │ │ ├── CacheServiceMBean.java │ │ ├── CassandraDaemon.java │ │ ├── ClientState.java │ │ ├── DatacenterReadCallback.java │ │ ├── DatacenterSyncWriteResponseHandler.java │ │ ├── DatacenterWriteResponseHandler.java │ │ ├── DepCheckCallback.java │ │ ├── DigestMismatchException.java │ │ ├── EmbeddedCassandraService.java │ │ ├── GCInspector.java │ │ ├── IReadCommand.java │ │ ├── IResponseResolver.java │ │ ├── IWriteResponseHandler.java │ │ ├── IndexScanVerbHandler.java │ │ ├── LoadBroadcaster.java │ │ ├── MigrationManager.java │ │ ├── RangeSliceResponseResolver.java │ │ ├── RangeSliceVerbHandler.java │ │ ├── ReadCallback.java │ │ ├── RepairCallback.java │ │ ├── RowDigestResolver.java │ │ ├── RowRepairResolver.java │ │ ├── SocketSessionManagementService.java │ │ ├── StorageProxy.java │ │ ├── StorageProxyMBean.java │ │ ├── StorageService.java │ │ ├── StorageServiceMBean.java │ │ ├── TruncateResponseHandler.java │ │ └── WriteResponseHandler.java │ │ ├── streaming │ │ ├── FileStreamTask.java │ │ ├── IncomingStreamReader.java │ │ ├── OperationType.java │ │ ├── PendingFile.java │ │ ├── ReplicationFinishedVerbHandler.java │ │ ├── StreamHeader.java │ │ ├── StreamIn.java │ │ ├── StreamInSession.java │ │ ├── StreamOut.java │ │ ├── StreamOutSession.java │ │ ├── StreamReply.java │ │ ├── StreamReplyVerbHandler.java │ │ ├── StreamRequestMessage.java │ │ ├── StreamRequestVerbHandler.java │ │ ├── StreamingRepairTask.java │ │ ├── StreamingService.java │ │ └── StreamingServiceMBean.java │ │ ├── thrift │ │ ├── CassandraDaemon.java │ │ ├── CassandraServer.java │ │ ├── CustomTHsHaServer.java │ │ ├── CustomTNonBlockingServer.java │ │ ├── CustomTThreadPoolServer.java │ │ ├── RequestType.java │ │ ├── TBinaryProtocol.java │ │ ├── TCustomNonblockingServerSocket.java │ │ ├── TCustomServerSocket.java │ │ ├── TCustomSocket.java │ │ ├── ThriftConverter.java │ │ └── ThriftValidation.java │ │ ├── tools │ │ ├── BulkLoader.java │ │ ├── GetVersion.java │ │ ├── NodeCmd.java │ │ ├── NodeProbe.java │ │ ├── SSTableExport.java │ │ └── SSTableImport.java │ │ └── utils │ │ ├── AbstractStatsDeque.java │ │ ├── Allocator.java │ │ ├── BigLongArray.java │ │ ├── BloomCalculations.java │ │ ├── BloomFilter.java │ │ ├── BloomFilterSerializer.java │ │ ├── BoundedStatsDeque.java │ │ ├── ByteBufferUtil.java │ │ ├── BytesReadTracker.java │ │ ├── CLibrary.java │ │ ├── CloseableIterator.java │ │ ├── ColumnOrSuperColumnHelper.java │ │ ├── DefaultDouble.java │ │ ├── DefaultInteger.java │ │ ├── DestructivePQIterator.java │ │ ├── EstimatedHistogram.java │ │ ├── ExpiringMap.java │ │ ├── FBUtilities.java │ │ ├── FastByteComparisons.java │ │ ├── Filter.java │ │ ├── GuidGenerator.java │ │ ├── HeapAllocator.java │ │ ├── Hex.java │ │ ├── IMergeIterator.java │ │ ├── IntervalTree │ │ ├── Interval.java │ │ ├── IntervalNode.java │ │ └── IntervalTree.java │ │ ├── LamportClock.java │ │ ├── LatencyTracker.java │ │ ├── LegacyBloomFilter.java │ │ ├── LegacyBloomFilterSerializer.java │ │ ├── MergeIterator.java │ │ ├── MerkleTree.java │ │ ├── MurmurHash.java │ │ ├── Mx4jTool.java │ │ ├── NodeId.java │ │ ├── Pair.java │ │ ├── ResourceWatcher.java │ │ ├── ShortNodeId.java │ │ ├── SimpleCondition.java │ │ ├── SkipNullRepresenter.java │ │ ├── SlabAllocator.java │ │ ├── StatusLogger.java │ │ ├── Throttle.java │ │ ├── UUIDGen.java │ │ ├── VersionUtil.java │ │ ├── WrappedRunnable.java │ │ ├── XMLUtils.java │ │ └── obs │ │ ├── ArrayUtil.java │ │ ├── BitUtil.java │ │ └── OpenBitSet.java └── resources │ └── org │ └── apache │ └── cassandra │ └── cli │ └── CliHelp.yaml ├── test ├── cassandra.in.sh ├── conf │ ├── access.properties │ ├── cassandra-topology.properties │ ├── cassandra.yaml │ ├── datacenters.properties │ ├── log4j-junit.properties │ └── log4j-server.properties ├── data │ ├── corrupt-sstables │ │ ├── Keyspace1-Super5-f-2-Data.db │ │ ├── Keyspace1-Super5-f-2-Filter.db │ │ ├── Keyspace1-Super5-f-2-Index.db │ │ └── Keyspace1-Super5-f-2-Statistics.db │ ├── legacy-sstables │ │ ├── b │ │ │ └── Keyspace1 │ │ │ │ ├── Keyspace1-Standard1-b-0-Data.db │ │ │ │ ├── Keyspace1-Standard1-b-0-Filter.db │ │ │ │ └── Keyspace1-Standard1-b-0-Index.db │ │ ├── e │ │ │ └── Keyspace1 │ │ │ │ ├── Keyspace1-Standard1-e-0-Data.db │ │ │ │ ├── Keyspace1-Standard1-e-0-Filter.db │ │ │ │ ├── Keyspace1-Standard1-e-0-Index.db │ │ │ │ └── Keyspace1-Standard1-e-0-Statistics.db │ │ └── hb │ │ │ └── Keyspace1 │ │ │ ├── Keyspace1-Indexed1-hb-1-Data.db │ │ │ ├── Keyspace1-Indexed1-hb-1-Digest.sha1 │ │ │ ├── Keyspace1-Indexed1-hb-1-Filter.db │ │ │ ├── Keyspace1-Indexed1-hb-1-Index.db │ │ │ ├── Keyspace1-Indexed1-hb-1-Statistics.db │ │ │ ├── Keyspace1-Indexed1.626972746864617465-hb-1-Data.db │ │ │ ├── Keyspace1-Indexed1.626972746864617465-hb-1-Digest.sha1 │ │ │ ├── Keyspace1-Indexed1.626972746864617465-hb-1-Filter.db │ │ │ ├── Keyspace1-Indexed1.626972746864617465-hb-1-Index.db │ │ │ ├── Keyspace1-Indexed1.626972746864617465-hb-1-Statistics.db │ │ │ ├── Keyspace1-Standard1-hb-0-Data.db │ │ │ ├── Keyspace1-Standard1-hb-0-Digest.sha1 │ │ │ ├── Keyspace1-Standard1-hb-0-Filter.db │ │ │ ├── Keyspace1-Standard1-hb-0-Index.db │ │ │ └── Keyspace1-Standard1-hb-0-Statistics.db │ └── serialization │ │ └── 0.7 │ │ ├── db.RangeSliceCommand.bin │ │ ├── db.Row.bin │ │ ├── db.RowMutation.bin │ │ ├── db.SliceByNamesReadCommand.bin │ │ ├── db.SliceFromReadCommand.bin │ │ ├── db.Truncation.bin │ │ ├── db.WriteResponse.bin │ │ ├── db.migration.Keyspace1.bin │ │ ├── db.migration.Keyspace2.bin │ │ ├── db.migration.Keyspace3.bin │ │ ├── db.migration.Keyspace4.bin │ │ ├── db.migration.Keyspace5.bin │ │ ├── gms.EndpointState.bin │ │ ├── gms.Gossip.bin │ │ ├── service.TreeRequest.bin │ │ ├── service.TreeResponse.bin │ │ ├── streaming.PendingFile.bin │ │ ├── streaming.StreamHeader.bin │ │ ├── streaming.StreamReply.bin │ │ ├── streaming.StreamRequestMessage.bin │ │ ├── utils.BloomFilter.bin │ │ ├── utils.EstimatedHistogram.bin │ │ └── utils.LegacyBloomFilter.bin ├── long │ └── org │ │ └── apache │ │ └── cassandra │ │ ├── db │ │ ├── LongTableTest.java │ │ ├── MeteredFlusherTest.java │ │ └── compaction │ │ │ └── LongCompactionSpeedTest.java │ │ └── utils │ │ ├── LongBloomFilterTest.java │ │ └── LongLegacyBloomFilterTest.java ├── resources │ ├── CounterCF.json │ ├── SimpleCF.json │ ├── SimpleCF.oldformat.json │ ├── SuperCF.json │ ├── UnsortedSuperCF.json │ ├── functions │ │ ├── configure_cassandra.sh │ │ ├── install_cassandra.sh │ │ ├── nodetool_cassandra.sh │ │ ├── start_cassandra.sh │ │ ├── stop_cassandra.sh │ │ └── wipe_cassandra.sh │ └── whirr-default.properties ├── system │ ├── __init__.py │ └── test_thrift_server.py └── unit │ └── org │ └── apache │ └── cassandra │ ├── AbstractSerializationsTester.java │ ├── CleanupHelper.java │ ├── EmbeddedServer.java │ ├── SchemaLoader.java │ ├── Util.java │ ├── cache │ └── CacheProviderTest.java │ ├── cli │ └── CliTest.java │ ├── client │ └── TestRingCache.java │ ├── concurrent │ └── DebuggableThreadPoolExecutorTest.java │ ├── config │ ├── CFMetaDataTest.java │ ├── ColumnDefinitionTest.java │ └── DatabaseDescriptorTest.java │ ├── cops2 │ ├── Cops2Test.java │ ├── EmbeddedCops2Test.java │ └── MultiDcCops2Test.java │ ├── db │ ├── ArrayBackedSortedColumnsTest.java │ ├── CleanupTest.java │ ├── ColumnFamilyStoreTest.java │ ├── ColumnFamilyTest.java │ ├── CommitLogTest.java │ ├── CounterColumnTest.java │ ├── CounterMutationTest.java │ ├── DefsTest.java │ ├── DirectoriesTest.java │ ├── KeyCacheTest.java │ ├── KeyCollisionTest.java │ ├── MultitableTest.java │ ├── NameSortTest.java │ ├── ReadMessageTest.java │ ├── RecoveryManager2Test.java │ ├── RecoveryManager3Test.java │ ├── RecoveryManagerTest.java │ ├── RecoveryManagerTruncateTest.java │ ├── RemoveColumnFamilyTest.java │ ├── RemoveColumnFamilyWithFlush1Test.java │ ├── RemoveColumnFamilyWithFlush2Test.java │ ├── RemoveColumnTest.java │ ├── RemoveSubColumnTest.java │ ├── RemoveSuperColumnTest.java │ ├── RowCacheTest.java │ ├── RowIterationTest.java │ ├── RowTest.java │ ├── ScrubTest.java │ ├── SerializationsTest.java │ ├── SuperColumnTest.java │ ├── SystemTableTest.java │ ├── TableTest.java │ ├── TimeSortTest.java │ ├── compaction │ │ ├── CompactionsPurgeTest.java │ │ ├── CompactionsTest.java │ │ ├── OneCompactionTest.java │ │ └── SizeTieredCompactionStrategyTest.java │ ├── context │ │ └── CounterContextTest.java │ ├── marshal │ │ ├── BytesTypeTest.java │ │ ├── CompositeTypeTest.java │ │ ├── DecimalTypeTest.java │ │ ├── DynamicCompositeTypeTest.java │ │ ├── IntegerTypeTest.java │ │ ├── ReversedTypeTest.java │ │ ├── RoundTripTest.java │ │ ├── TimeUUIDTypeTest.java │ │ ├── TypeCompareTest.java │ │ ├── TypeParserTest.java │ │ ├── TypeValidationTest.java │ │ └── UUIDTypeTest.java │ └── migration │ │ └── SerializationsTest.java │ ├── dht │ ├── AbstractBoundsTest.java │ ├── BootStrapperTest.java │ ├── ByteOrderedPartitionerTest.java │ ├── CollatingOrderPreservingPartitionerTest.java │ ├── OrderPreservingPartitionerTest.java │ ├── PartitionerTestCase.java │ ├── RandomPartitionerTest.java │ └── RangeTest.java │ ├── gms │ ├── ArrivalWindowTest.java │ ├── GossipDigestTest.java │ └── SerializationsTest.java │ ├── hadoop │ └── ColumnFamilyInputFormatTest.java │ ├── io │ ├── BloomFilterTrackerTest.java │ ├── CompactSerializerTest.java │ ├── LazilyCompactedRowTest.java │ ├── compress │ │ └── CompressedRandomAccessReaderTest.java │ ├── sstable │ │ ├── DescriptorTest.java │ │ ├── IndexHelperTest.java │ │ ├── LegacySSTableTest.java │ │ ├── SSTableMetadataSerializerTest.java │ │ ├── SSTableReaderTest.java │ │ ├── SSTableSimpleWriterTest.java │ │ ├── SSTableTest.java │ │ └── SSTableUtils.java │ └── util │ │ └── BufferedRandomAccessFileTest.java │ ├── locator │ ├── DynamicEndpointSnitchTest.java │ ├── EC2SnitchTest.java │ ├── NetworkTopologyStrategyTest.java │ ├── OldNetworkTopologyStrategyTest.java │ ├── ReplicationStrategyEndpointCacheTest.java │ ├── SimpleStrategyTest.java │ └── TokenMetadataTest.java │ ├── net │ └── MessageSerializer.java │ ├── service │ ├── AntiEntropyServiceCounterTest.java │ ├── AntiEntropyServiceStandardTest.java │ ├── AntiEntropyServiceTestAbstract.java │ ├── CassandraServerTest.java │ ├── EmbeddedCassandraServiceTest.java │ ├── InitClientTest.java │ ├── LeaveAndBootstrapTest.java │ ├── MoveTest.java │ ├── RemoveTest.java │ ├── RowResolverTest.java │ ├── SerializationsTest.java │ ├── StorageProxyTest.java │ ├── StorageServiceAccessor.java │ ├── StorageServiceClientTest.java │ └── StorageServiceServerTest.java │ ├── streaming │ ├── BootstrapTest.java │ ├── SerializationsTest.java │ ├── StreamUtil.java │ └── StreamingTransferTest.java │ ├── thrift │ └── ThriftValidationTest.java │ ├── tools │ ├── SSTableExportTest.java │ └── SSTableImportTest.java │ └── utils │ ├── BloomFilterTest.java │ ├── BoundedStatsDequeTest.java │ ├── ByteBufferUtilTest.java │ ├── BytesReadTrackerTest.java │ ├── EstimatedHistogramTest.java │ ├── FBUtilitiesTest.java │ ├── FilterTestHelper.java │ ├── HexTest.java │ ├── IntervalTest.java │ ├── IntervalTreeTest.java │ ├── KeyGenerator.java │ ├── LegacyBloomFilterTest.java │ ├── MergeIteratorTest.java │ ├── MerkleTreeTest.java │ ├── ResetableIterator.java │ ├── SerializationsTest.java │ └── UUIDTests.java ├── tools ├── py_stress │ ├── README.txt │ └── stress.py └── stress │ ├── README.txt │ ├── bin │ ├── stress │ ├── stress.bat │ └── stressd │ ├── build.xml │ ├── src │ └── org │ │ └── apache │ │ └── cassandra │ │ └── stress │ │ ├── Session.java │ │ ├── Stress.java │ │ ├── StressAction.java │ │ ├── StressServer.java │ │ ├── operations │ │ ├── CounterAdder.java │ │ ├── CounterGetter.java │ │ ├── CqlCounterAdder.java │ │ ├── CqlCounterGetter.java │ │ ├── CqlIndexedRangeSlicer.java │ │ ├── CqlInserter.java │ │ ├── CqlMultiGetter.java │ │ ├── CqlRangeSlicer.java │ │ ├── CqlReader.java │ │ ├── DynamicOneServer.java │ │ ├── DynamicWorkload.java │ │ ├── FacebookPopulator.java │ │ ├── FacebookWorkload.java │ │ ├── IndexedRangeSlicer.java │ │ ├── Inserter.java │ │ ├── MultiGetter.java │ │ ├── RangeSlicer.java │ │ ├── Reader.java │ │ ├── TwoRoundReadTxn.java │ │ └── WriteTransactionWorkload.java │ │ ├── server │ │ └── StressThread.java │ │ └── util │ │ └── Operation.java │ └── test.bash ├── uuid_token.py ├── vicci_cassandra_cleaner.bash ├── vicci_cassandra_killer.bash ├── vicci_dc_launcher.bash ├── vicci_dcl_config ├── 16_clients_in_princeton ├── 16_in_princeton ├── 16_stanford_and_uw_clients_in_princeton ├── 16_stanford_and_uw_in_princeton ├── 16_stanford_clients_in_princeton ├── 16_stanford_in_princeton ├── 2_clients_in_princeton ├── 2_in_princeton ├── 2_stanford_clients_in_princeton ├── 2_stanford_in_princeton ├── 32_clients_in_princeton ├── 32_in_princeton ├── 32_stanford_and_uw_clients_in_princeton ├── 32_stanford_and_uw_in_princeton ├── 3node3DCs ├── 4_clients_in_princeton ├── 4_in_princeton ├── 6node3DCs ├── 7_8_in_princeton ├── 8_clients_in_princeton ├── 8_in_princeton ├── kill_all_nodes ├── kodiak_16 ├── kodiak_16_clients ├── kodiak_2 ├── kodiak_2_clients ├── kodiak_32 ├── kodiak_4 ├── kodiak_4_clients ├── kodiak_8 ├── kodiak_8_clients ├── make_kodiak_1switch_config.bash ├── make_kodiak_cfg.bash └── princeton_35_36 └── vicci_scripts ├── find_live_nodes.bash ├── install_java.bash ├── princeton_1to20 ├── princeton_1to60 ├── princeton_1to70 ├── princeton_5and6 ├── push_cops_bins.bash ├── stanford_1to70 ├── stanford_69_70 ├── vicci_hosts_1to20 ├── vicci_hosts_1to40 ├── vicci_hosts_1to4_princeton ├── vicci_hosts_1to5 ├── vicci_hosts_1to70 └── washington_1to70 /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | build/ 3 | src/gen-java/ 4 | cassandra_var/*/* 5 | cassandra_var/cassandra_system.*.log 6 | conf/cassandra-topology.properties 7 | conf/*x*.yaml 8 | conf/log4j-server_[0-9]*.properties 9 | .classpath 10 | .project 11 | vicci_scripts/pssh_std* 12 | vicci_scripts/live_nodes 13 | vicci_scripts/cops_bin_push.tmp 14 | experiments/dynamic__* 15 | experiments/dynamic_ 16 | experiments/write_txn 17 | experiments/facebook 18 | experiments/progress 19 | *.diff 20 | tools/stress/old 21 | vicci_dcl_config/old 22 | vicci_dcl_config/live_nodes 23 | vicci_dcl_config/kodiak_* -------------------------------------------------------------------------------- /.rat-excludes: -------------------------------------------------------------------------------- 1 | **/*.avpr 2 | debian/** 3 | .classpath 4 | .rat-excludes 5 | **/.project 6 | **/.pydevproject 7 | CHANGES.txt 8 | .git/** 9 | **/*.json 10 | **/*.patch 11 | interface/*/gen-*/** 12 | src/gen-java/** 13 | build/** 14 | lib/licenses/*.txt 15 | .settings/** 16 | contrib/pig/example-script.pig 17 | **/cassandra.yaml 18 | **/*.db 19 | redhat/apache-cassandra.spec 20 | redhat/cassandra 21 | redhat/cassandra.conf 22 | redhat/cassandra.in.sh 23 | redhat/default 24 | .externalToolBuilders/** 25 | test/data/serialization/*/* 26 | **/*.wpr 27 | conf/schema-sample.txt 28 | drivers/txpy/txcql/cassandra/* 29 | drivers/py/cql/cassandra/* 30 | doc/cql/CQL* 31 | build.properties.default 32 | test/data/legacy-sstables/** 33 | -------------------------------------------------------------------------------- /NOTICE.txt: -------------------------------------------------------------------------------- 1 | Apache Cassandra 2 | Copyright 2009, 2010 The Apache Software Foundation 3 | 4 | This product includes software developed by The Apache Software 5 | Foundation (http://www.apache.org/). 6 | 7 | Some alternate data structures provided by high-scale-lib from 8 | http://sourceforge.net/projects/high-scale-lib/. 9 | Written by Cliff Click and released as Public Domain. 10 | 11 | Some alternate data structures provided by concurrentlinkedhashmap 12 | from http://code.google.com/p/concurrentlinkedhashmap/. 13 | Copyright 2009 Benjamin Manes 14 | 15 | Alternative collection types provided by google-collections from 16 | http://code.google.com/p/google-collections/. 17 | Copyright (C) 2007 Google Inc. 18 | 19 | JSON (de)serialization provided by jackson (http://jackson.codehaus.org). 20 | Copyright (C) 2010 Tatu Saloranta and others. 21 | 22 | Alternative JSON (de)serialization by json-simple from 23 | (http://code.google.com/p/json-simple). 24 | Copyright (C) 2009 Fang Yidong and Chris Nokleberg 25 | 26 | This product includes the Jetty HTTP server 27 | (http://jetty.codehaus.org/jetty/). 28 | Copyright 1995-2006 Mort Bay Consulting Pty Ltd 29 | 30 | YAML support provided by snakeyaml (http://code.google.com/p/snakeyaml/). 31 | Copyright (c) 2008-2010 Andrey Somov 32 | 33 | Compression support provided by snappy-java (http://code.google.com/p/snappy-java/) 34 | Written by Taro L. Saito. 35 | 36 | Streaming compression support provided by ning-compress 37 | (https://github.com/ning/compress) 38 | Copyright 2009-2010 Ning, Inc. 39 | -------------------------------------------------------------------------------- /add_loopback_address.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Add up to N loopback addresses 4 | # 5 | # Tested on Mac OS 10.7.2 6 | 7 | set -u 8 | 9 | if [ $# -ne 1 ]; then 10 | echo "Usage: "$0" [number of loopback addresses to add (starting at 127.0.0.2)]" 11 | exit 12 | fi 13 | 14 | num_addrs=$1 15 | 16 | if [[ $num_addrs -gt 254 || $num_addrs -lt 1 ]]; then 17 | echo "Must be a small integer number of addresses, not ${num_addrs}" 18 | exit 19 | fi 20 | 21 | for i in $(seq 2 $((num_addrs + 1))); do 22 | sudo ifconfig lo0 inet 127.0.0.${i} add 23 | done 24 | 25 | #In case we're offline, we need this alias so getLocalHost() returns something to us 26 | sudo ifconfig en0 alias 127.0.0.1 27 | 28 | ifconfig -------------------------------------------------------------------------------- /bin/cqlshrc.sample: -------------------------------------------------------------------------------- 1 | ; Licensed to the Apache Software Foundation (ASF) under one 2 | ; or more contributor license agreements. See the NOTICE file 3 | ; distributed with this work for additional information 4 | ; regarding copyright ownership. The ASF licenses this file 5 | ; to you under the Apache License, Version 2.0 (the 6 | ; "License"); you may not use this file except in compliance 7 | ; with the License. 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, 12 | ; software distributed under the License is distributed on an 13 | ; "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | ; KIND, either express or implied. See the License for the 15 | ; specific language governing permissions and limitations 16 | ; under the License. 17 | ; 18 | ; Sample ~/.cqlshrc file. 19 | 20 | [authentication] 21 | username = fred 22 | password = !!bang!!$ 23 | 24 | [ui] 25 | color = on 26 | completekey = tab 27 | 28 | [connection] 29 | hostname = 127.0.0.1 30 | port = 9160 31 | 32 | ; vim: set ft=dosini : 33 | -------------------------------------------------------------------------------- /bin/stop-server: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. 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 | echo "please read the stop-server script before use" 19 | 20 | # if you are using the cassandra start script with -p, this 21 | # is the best way to stop: 22 | 23 | # kill `cat ` 24 | 25 | 26 | # otherwise, you can run something like this, but 27 | # this is a shotgun approach and will kill other processes 28 | # with cassandra in their name or arguments too: 29 | 30 | # user=`whoami` 31 | # pgrep -u $user -f cassandra | xargs kill -9 32 | -------------------------------------------------------------------------------- /build.properties.default: -------------------------------------------------------------------------------- 1 | # Maven2 Repository Locations (you can override these in "build.properties" to point to a local proxy, e.g. Nexus) 2 | artifact.remoteRepository.central: http://repo1.maven.org/maven2 3 | artifact.remoteRepository.java.net2: http://download.java.net/maven/2 4 | artifact.remoteRepository.apache: https://repository.apache.org/content/repositories/releases 5 | artifact.remoteRepository.jclouds: http://jclouds.googlecode.com/svn/repo 6 | artifact.remoteRepository.oauth: http://oauth.googlecode.com/svn/code/maven 7 | 8 | -------------------------------------------------------------------------------- /cassandra_var/check_logs_for_errors.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | matches=$(egrep "ERROR|assert" cassandra_system*log) 4 | 5 | if [ "$matches" == "" ]; then 6 | exit 0 7 | else 8 | echo "$matches" | head -n 5 9 | exit 1 10 | fi -------------------------------------------------------------------------------- /conf-orig/README.txt: -------------------------------------------------------------------------------- 1 | Required configuration files 2 | ============================ 3 | 4 | cassandra.yaml: main Cassandra configuration file 5 | log4j-server.proprties: log4j configuration file for Cassandra server 6 | 7 | 8 | Optional configuration files 9 | ============================ 10 | 11 | cassandra-topology.properties: used by PropertyFileSnitch 12 | -------------------------------------------------------------------------------- /conf-orig/log4j-tools.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. 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 | # for production, you should probably set the root to INFO 18 | # and the pattern to %c instead of %l. (%l is slower.) 19 | 20 | # output messages into a rolling log file as well as stdout 21 | log4j.rootLogger=WARN,stderr 22 | 23 | # stderr 24 | log4j.appender.stderr=org.apache.log4j.ConsoleAppender 25 | log4j.appender.stderr.target=System.err 26 | log4j.appender.stderr.layout=org.apache.log4j.PatternLayout 27 | log4j.appender.stderr.layout.ConversionPattern=%5p %d{HH:mm:ss,SSS} %m%n 28 | -------------------------------------------------------------------------------- /conf/README.txt: -------------------------------------------------------------------------------- 1 | Required configuration files 2 | ============================ 3 | 4 | cassandra.yaml: main Cassandra configuration file 5 | log4j-server.proprties: log4j configuration file for Cassandra server 6 | 7 | 8 | Optional configuration files 9 | ============================ 10 | 11 | cassandra-topology.properties: used by PropertyFileSnitch 12 | -------------------------------------------------------------------------------- /conf/cassandra-topology.properties.orig: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. 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 | # Cassandra Node IP=Data Center:Rack 18 | 192.168.1.100=DC1:RAC1 19 | 192.168.2.200=DC2:RAC2 20 | 21 | 10.0.0.10=DC1:RAC1 22 | 10.0.0.11=DC1:RAC1 23 | 10.0.0.12=DC1:RAC2 24 | 25 | 10.20.114.10=DC2:RAC1 26 | 10.20.114.11=DC2:RAC1 27 | 28 | 10.21.119.13=DC3:RAC1 29 | 10.21.119.10=DC3:RAC1 30 | 31 | 10.0.0.13=DC1:RAC2 32 | 10.21.119.14=DC3:RAC2 33 | 10.20.114.15=DC2:RAC2 34 | 35 | # default for unknown nodes 36 | default=DC1:r1 37 | 38 | # Native IPv6 is supported, however you must escape the colon in the IPv6 Address 39 | # Also be sure to comment out JVM_OPTS="$JVM_OPTS -Djava.net.preferIPv4Stack=true" 40 | # in cassandra-env.sh 41 | fe80\:0\:0\:0\:202\:b3ff\:fe1e\:8329=DC1:RAC3 42 | -------------------------------------------------------------------------------- /conf/log4j-tools.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. 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 | # for production, you should probably set the root to INFO 18 | # and the pattern to %c instead of %l. (%l is slower.) 19 | 20 | # output messages into a rolling log file as well as stdout 21 | log4j.rootLogger=WARN,stderr 22 | 23 | # stderr 24 | log4j.appender.stderr=org.apache.log4j.ConsoleAppender 25 | log4j.appender.stderr.target=System.err 26 | log4j.appender.stderr.layout=org.apache.log4j.PatternLayout 27 | log4j.appender.stderr.layout.ConversionPattern=%5p %d{HH:mm:ss,SSS} %m%n 28 | -------------------------------------------------------------------------------- /conf/vicci/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /contrib/pig/example-script.pig: -------------------------------------------------------------------------------- 1 | rows = LOAD 'cassandra://MyKeyspace/MyColumnFamily' USING CassandraStorage() AS (key, columns: bag {T: tuple(name, value)}); 2 | cols = FOREACH rows GENERATE flatten(columns); 3 | colnames = FOREACH cols GENERATE $0; 4 | namegroups = GROUP colnames BY (chararray) $0; 5 | namecounts = FOREACH namegroups GENERATE COUNT($1), group; 6 | orderednames = ORDER namecounts BY $0; 7 | topnames = LIMIT orderednames 50; 8 | dump topnames; -------------------------------------------------------------------------------- /debian/README.Debian: -------------------------------------------------------------------------------- 1 | Cassandra for Debian 2 | ==================== 3 | 4 | This package is not a part of Debian, (and there are no immediate plans 5 | to have it added). Bugs should be sent to eevans@apache.org, *not* filed 6 | in the Debian BTS. 7 | 8 | -- Eric Evans Sun, 26 Jul 2009 14:35:11 -0500 9 | -------------------------------------------------------------------------------- /debian/TODO: -------------------------------------------------------------------------------- 1 | 2 | * don't embed jars for which debian packages exist 3 | -------------------------------------------------------------------------------- /debian/cassandra-sysctl.conf: -------------------------------------------------------------------------------- 1 | vm.max_map_count = 1048575 2 | -------------------------------------------------------------------------------- /debian/cassandra.conf: -------------------------------------------------------------------------------- 1 | # Provided by the cassandra package 2 | cassandra - memlock unlimited 3 | cassandra - nofile 100000 4 | -------------------------------------------------------------------------------- /debian/cassandra.in.sh: -------------------------------------------------------------------------------- 1 | 2 | # The directory where Cassandra's configs live (required) 3 | CASSANDRA_CONF=/etc/cassandra 4 | 5 | CASSANDRA_HOME=/usr/share/cassandra 6 | 7 | # The java classpath (required) 8 | if [ -n "$CLASSPATH" ]; then 9 | CLASSPATH=$CLASSPATH:$CASSANDRA_CONF 10 | else 11 | CLASSPATH=$CASSANDRA_CONF 12 | fi 13 | 14 | for jar in /usr/share/cassandra/lib/*.jar; do 15 | CLASSPATH=$CLASSPATH:$jar 16 | done 17 | 18 | for jar in /usr/share/cassandra/*.jar; do 19 | CLASSPATH=$CLASSPATH:$jar 20 | done 21 | -------------------------------------------------------------------------------- /debian/cassandra.install: -------------------------------------------------------------------------------- 1 | conf/log4j-server.properties etc/cassandra 2 | conf/cassandra.yaml etc/cassandra 3 | conf/cassandra-env.sh etc/cassandra 4 | debian/cassandra.in.sh usr/share/cassandra 5 | debian/cassandra.conf etc/security/limits.d 6 | debian/cassandra-sysctl.conf etc/sysctl.d 7 | bin/cassandra usr/sbin 8 | bin/cassandra-cli usr/bin 9 | bin/nodetool usr/bin 10 | bin/json2sstable usr/bin 11 | bin/sstable2json usr/bin 12 | bin/sstablekeys usr/bin 13 | bin/sstableloader usr/bin 14 | lib/*.jar usr/share/cassandra/lib 15 | lib/licenses usr/share/doc/cassandra 16 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 5 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: cassandra 2 | Section: misc 3 | Priority: extra 4 | Maintainer: Eric Evans 5 | Build-Depends: debhelper (>= 5), openjdk-6-jdk (>= 6b11) | java6-sdk, ant (>= 1.7), ant-optional (>= 1.7), subversion 6 | Homepage: http://cassandra.apache.org 7 | Vcs-Svn: https://svn.apache.org/repos/asf/cassandra/trunk 8 | Vcs-Browser: http://svn.apache.org/viewvc/cassandra/trunk 9 | Standards-Version: 3.8.3 10 | 11 | Package: cassandra 12 | Architecture: all 13 | Depends: openjdk-6-jre-headless (>= 6b11) | java6-runtime, jsvc (>= 1.0), libcommons-daemon-java (>= 1.0), adduser, libjna-java 14 | Conflicts: apache-cassandra1 15 | Replaces: apache-cassandra1 16 | Description: distributed storage system for structured data 17 | Cassandra is a distributed (peer-to-peer) system for the management 18 | and storage of structured data. 19 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Eric Evans on 2 | Sun, 26 Jul 2009 15:12:10 +0000 3 | 4 | Upstream Author: Cassandra Developers 5 | 6 | Copyright (c) 2009, The Apache Software Foundation. 7 | 8 | This software is licensed under the Apache License 2.0. On Debian 9 | GNU/Linux systems you can find the complete text of the Apache-2.0 10 | license in `/usr/share/common-licenses/Apache-2.0'. 11 | -------------------------------------------------------------------------------- /debian/default: -------------------------------------------------------------------------------- 1 | # NOTICE: See also /etc/cassandra/cassandra-env.sh 2 | 3 | # EXTRA_CLASSPATH provides the means to extend Cassandra's classpath with 4 | # additional libraries. It is formatted as a colon-delimited list of 5 | # class directories and/or jar files. For example, to enable the 6 | # JMX-to-web bridge install libmx4j-java and uncomment the following. 7 | #EXTRA_CLASSPATH="/usr/share/java/mx4j-tools.jar" 8 | -------------------------------------------------------------------------------- /debian/dirs: -------------------------------------------------------------------------------- 1 | usr/share/cassandra 2 | usr/share/cassandra/lib 3 | usr/sbin 4 | usr/bin 5 | etc/cassandra 6 | var/lib/cassandra 7 | var/log/cassandra 8 | -------------------------------------------------------------------------------- /doc/cql/CQL.css: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | /* Just a sample of some things that might be helpful in rendering CQL.html */ 23 | 24 | pre.sample { 25 | padding: 1ex; 26 | border: 1px solid black; 27 | background-color: #ffe0e0; 28 | } 29 | pre.syntax { 30 | padding: 1ex; 31 | border: 1px solid black; 32 | background-color: #e0e0ff; 33 | } 34 | table { 35 | width: 80%; 36 | border-collapse: collapse; 37 | border: 1px solid black; 38 | } 39 | td { 40 | padding: 2px 1ex; 41 | border: 1px solid black; 42 | } 43 | body { 44 | background-color: white; 45 | } 46 | h2 { 47 | margin-top: 3em; 48 | } 49 | -------------------------------------------------------------------------------- /examples/hadoop_word_count/README.txt: -------------------------------------------------------------------------------- 1 | WordCount hadoop example: Inserts a bunch of words across multiple rows, 2 | and counts them, with RandomPartitioner. The word_count_counters example sums 3 | the value of counter columns for a key. 4 | 5 | The scripts in bin/ assume you are running with cwd of contrib/word_count. 6 | 7 | First build and start a Cassandra server with the default configuration*, 8 | then run 9 | 10 | contrib/word_count$ ant 11 | contrib/word_count$ bin/word_count_setup 12 | contrib/word_count$ bin/word_count 13 | contrib/word_count$ bin/word_count_counters 14 | 15 | In order to view the results in Cassandra, one can use bin/cassandra-cli and 16 | perform the following operations: 17 | $ bin/cassandra-cli 18 | > connect localhost/9160; 19 | > use wordcount; 20 | > list output_words; 21 | 22 | The output of the word count can now be configured. In the bin/word_count 23 | file, you can specify the OUTPUT_REDUCER. The two options are 'filesystem' 24 | and 'cassandra'. The filesystem option outputs to the /tmp/word_count* 25 | directories. The cassandra option outputs to the 'output_words' column family 26 | in the 'wordcount' keyspace. 'cassandra' is the default. 27 | 28 | Read the code in src/ for more details. 29 | 30 | The word_count_counters example sums the counter columns for a row. The output 31 | is written to a text file in /tmp/word_count_counters. 32 | 33 | *If you want to point wordcount at a real cluster, modify the seed 34 | and listenaddress settings accordingly. 35 | -------------------------------------------------------------------------------- /examples/hadoop_word_count/ivy.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /examples/simple_authentication/README.txt: -------------------------------------------------------------------------------- 1 | The files in this directory provide a (simplistic) example of how to add 2 | authentication and resource permissions to Cassandra by implementing the 3 | org.apache.cassandra.auth.{IAuthenticator, IAuthority} interfaces. 4 | 5 | To try those examples, copy the two JAVA sources (in src/) into the main 6 | cassandra sources directory and the two configuration files (in conf/) in the 7 | main cassandra configuration directory. 8 | 9 | You can then set the authenticator and authority properties in cassandra.yaml 10 | to use those classes. See the two configuration files access.properties and 11 | passwd.properties to configure the authorized users and permissions. 12 | 13 | Please note that the code in this directory is for demonstration purposes. In 14 | particular, it does not provide a high level of security. 15 | -------------------------------------------------------------------------------- /examples/simple_authentication/conf/passwd.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. 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 | # This is a sample password file for SimpleAuthenticator. The format of 18 | # this file is username=password. If -Dpasswd.mode=MD5 then the password 19 | # is represented as an md5 digest, otherwise it is cleartext (keep this 20 | # in mind when setting file mode and ownership). 21 | jsmith=havebadpass 22 | Elvis\ Presley=graceland4evar 23 | dilbert=nomoovertime 24 | -------------------------------------------------------------------------------- /experiments/dep_propagation_postprocess_combine.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -u 4 | 5 | if [ $# -ne 1 ]; then 6 | echo "Usage: "$0" [output_dir]" 7 | exit 8 | fi 9 | 10 | output_dir=$1 11 | 12 | cd $output_dir 13 | 14 | graph_lines=$(ls trial1/*.graph | awk -F".graph" '{ print $1 }' | awk -F"trial1/" '{ print $2 }') 15 | 16 | for graph_line in $graph_lines; do 17 | all_file=${graph_line}".all" 18 | graph_file=${graph_line}".graph" 19 | 20 | echo -n > $all_file 21 | echo -n > $graph_file 22 | 23 | for data_point in $(ls trial1/$graph_line.*.tput | awk -F"trial1/" '{ print $2 }' ); do 24 | control_var=$(echo $data_point | awk -F"." '{ print $2 }') 25 | all_tputs="" 26 | 27 | 28 | for trial in $(ls -d trial*); do 29 | tput=$(cat ${trial}/${data_point}) 30 | all_tputs=$(echo -e "${all_tputs}\t${tput}") 31 | done 32 | #sort all tputs 33 | all_tputs=$(echo $all_tputs | sed 's/ /\n/g' | sort -n | xargs) 34 | num_tputs=$(echo $all_tputs | wc -w) 35 | median_tput_line=$(echo "(${num_tputs}+1)/2" | bc) 36 | median_tput=$(echo $all_tputs | awk '{ print $'$median_tput_line' }') 37 | 38 | echo -e "${control_var}${all_tputs}" >> ${all_file} 39 | echo -e "${control_var}\t${median_tput}" >> ${graph_file} 40 | done 41 | 42 | cat $all_file | sort -n > tmp 43 | mv tmp $all_file 44 | 45 | cat $graph_file | sort -n > tmp 46 | mv tmp $graph_file 47 | done 48 | -------------------------------------------------------------------------------- /experiments/dep_propagation_postprocess_full.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -u 4 | 5 | if [ $# -ne 5 ]; then 6 | echo "Usage: "$0" [exp_dir] [num_trials] [output_dir] [run_length] [trim_length]" 7 | exit 8 | fi 9 | 10 | exp_dir=$1 11 | num_trials=$2 12 | output_dir=$3 13 | run_length=$4 14 | trim=$5 15 | 16 | for trial in $(seq $num_trials); do 17 | output_dir_exp="${output_dir}/trial${trial}" 18 | ${exp_dir}/dep_propagation_postprocess_trial.bash ${output_dir_exp} ${run_length} ${trim} 19 | 20 | echo; echo; echo "TRIAL $trial" 21 | tail $output_dir_exp/*.graph 22 | done 23 | 24 | ${exp_dir}/dep_propagation_postprocess_combine.bash ${output_dir} 25 | 26 | echo; echo; echo "COMBINED" 27 | tail $output_dir/*.graph 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /experiments/dynamic_defaults: -------------------------------------------------------------------------------- 1 | total_keys=1000000 2 | value_size=512 3 | value_size=128 4 | cols_per_key_read=5 5 | cols_per_key_write=5 6 | keys_per_read=5 7 | keys_per_write=5 8 | write_frac=0.1 9 | write_trans_frac=0.5 10 | run_time=40 11 | trial=1 -------------------------------------------------------------------------------- /experiments/dynamic_per_client_tput.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -u 4 | 5 | if [ $# -ne 1 ]; then 6 | echo "Usage: "$0" [output_dir]" 7 | exit 8 | fi 9 | 10 | output_dir=$1 11 | 12 | 13 | for system in cops2 vanilla; do 14 | per_cli_file=$output_dir/$system".per_client_tput" 15 | 16 | #datapoints=$(ls $output_dir/trial1/cops2/client0/*+tput | awk -F"+" '{ print $2 }' | sort -un) 17 | datapoints=$(ls $output_dir/trial1/*/client0/*+tput | awk -F"+" '{ print $2 }' | sort -un) 18 | 19 | echo -n "" > $per_cli_file 20 | for dp in $datapoints; do 21 | echo -e "---- $dp ----" >> $per_cli_file 22 | echo -e "trial\tmin\tmedian\tmax\tmean±stddev" >> $per_cli_file 23 | for tri_dir in $(ls -d $output_dir/trial*); do 24 | awk '{ print $1 }' $tri_dir/$system/client*/*+$dp+tput | sort -n > sorted_ops_tmp 25 | min=$(head -n 1 sorted_ops_tmp) 26 | med=$(head -n $(( ($(cat sorted_ops_tmp | wc -l) +1)/ 2)) sorted_ops_tmp | tail -n 1) 27 | max=$(tail -n 1 sorted_ops_tmp) 28 | mean=$(cat sorted_ops_tmp | awk '{ sum+=$1 } END {printf("%d",sum/NR)}') 29 | stddev=$(cat sorted_ops_tmp | awk '{sum+=$1; array[NR]=$1} END {for(x=1;x<=NR;x++){sumsq+=((array[x]-(sum/NR))*(array[x]-(sum/NR)));} printf("%d", sqrt(sumsq/NR))}') 30 | 31 | tri=$(echo $tri_dir | awk -F"trial" '{ print $2 }') 32 | echo -e "$tri\t$min\t$med\t$max\t$mean±$stddev" >> $per_cli_file 33 | echo -e "all\t$(cat sorted_ops_tmp | xargs)" >> $per_cli_file 34 | rm sorted_ops_tmp 35 | done 36 | echo >> $per_cli_file 37 | done 38 | done 39 | -------------------------------------------------------------------------------- /experiments/dynamic_postprocess_full.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -u 4 | 5 | if [ $# -lt 4 ]; then 6 | echo "Usage: "$0" [exp_dir] [output_dir] [run time] [trim] {shuffle}" 7 | exit 8 | fi 9 | 10 | exp_dir=$1 11 | output_dir=$2 12 | run_length=$3 13 | trim=$4 14 | 15 | if [ $# -gt 4 ]; then 16 | ${exp_dir}/dynamic_shuffle_dirs.bash ${output_dir} 17 | fi 18 | 19 | ${exp_dir}/dynamic_postprocess_combine_trials.bash ${exp_dir} ${output_dir} ${run_length} ${trim} 20 | ${exp_dir}/dynamic_per_client_tput.bash ${output_dir} 21 | 22 | cd ${output_dir} 23 | #tar -cjf trials.tar.bz2 trial* 24 | #mv trial? .trash -------------------------------------------------------------------------------- /experiments/dynamic_shuffle_dirs.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -u 4 | 5 | if [ $# -ne 1 ]; then 6 | echo "Usage: "$0" [dir with client0 ... in it]" 7 | exit 8 | fi 9 | 10 | output_dir=$1 11 | 12 | #have client/system/trial ... want trial/system/client 13 | for client_full in $(ls -d $output_dir/client*); do 14 | client=$(echo $client_full | awk -F"${output_dir}/" '{ print $2 }') 15 | echo $client 16 | for system_full in $(ls -dp ${client_full}/* | grep '/$'); do 17 | system=$(echo $system_full | awk -F"${client_full}/" '{ print $2 }') 18 | echo " "$system 19 | for trial_full in $(ls -dp ${system_full}/* | grep '/$'); do 20 | trial=$(echo $trial_full | awk -F"${system_full}/" '{ print $2 }') 21 | echo " "$trial 22 | 23 | target_dir="$output_dir/$trial/$system/$client" 24 | mkdir -p $target_dir 25 | cp $trial_full/* $target_dir/ 26 | done 27 | done 28 | done 29 | 30 | cd $output_dir 31 | tar -cjf clis.tar.bz2 client* 32 | mkdir .trash 33 | mv client* .trash -------------------------------------------------------------------------------- /experiments/kill_stress_local_mbp.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -u 4 | 5 | if [ $# -ne 1 ]; then 6 | echo "$0: [stress pid]" 7 | exit 1 8 | fi 9 | 10 | stress_pid=$1 11 | 12 | group_id=$(ps x -o "pid, pgid" | grep $stress_pid | awk '{ print $2 }') 13 | stress_ids=$(ps x -o "pid, ppid, command" | grep $group_id | grep stress | awk '{ print $1 }') 14 | echo $stress_ids 15 | for pid in $stress_ids; do 16 | kill $pid 17 | done -------------------------------------------------------------------------------- /kill_all_cassandra.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ "$(uname -s)" == "Darwin" ]; then 4 | for pid in $(ps -Al | grep org.apache.cassandra.thrift.CassandraDaemon | grep -v grep | awk '{ print $2 }'); do 5 | kill -9 $pid; 6 | done 7 | else 8 | for pid in $(ps -Afl | grep org.apache.cassandra.thrift.CassandraDaemon | grep -v grep | awk '{ print $4 }'); do 9 | kill -9 $pid; 10 | done 11 | fi 12 | -------------------------------------------------------------------------------- /kill_stress_vicci.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -u 4 | 5 | for pid in $(ps x | grep org.apache.cassandra.stress.Stress | awk '{ print $1 }'); do 6 | kill $pid 7 | done 8 | 9 | 10 | # if [ $# -ne 1 ]; then 11 | # echo "$0: [stress pid]" 12 | # exit 1 13 | # fi 14 | 15 | # stress_pid=$1 16 | 17 | # group_id=$(ps x -o "pid pgid" | grep $stress_pid | awk '{ print $2 }') 18 | # stress_ids=$(ps x -o "pid ppid command" | grep $group_id | grep stress | awk '{ print $1 }') 19 | # echo $stress_ids 20 | # for pid in $stress_ids; do 21 | # kill $pid 22 | # done -------------------------------------------------------------------------------- /kodiak_cassandra_killer.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Kills cassandra on all nodes mentioned in the dcl_config_file 4 | # 5 | 6 | set -u 7 | 8 | if [ $# -ne 1 ]; then 9 | echo "Usage: "$0" [vicci_dcl_config_file]" 10 | exit 11 | fi 12 | 13 | dcl_config=$1 14 | 15 | num_dcs=$(grep num_dcs $dcl_config | awk -F "=" '{ print $2 }') 16 | ips=($(grep cassandra_ips $dcl_config | awk -F "=" '{ print $2 }')) 17 | ips=($(echo "echo ${ips[@]}" | bash)) 18 | 19 | #kill in parallel 20 | set -m #need monitor mode to fg processes 21 | for ip in ${ips[@]}; do 22 | echo $ip 23 | ssh -t -t -o StrictHostKeyChecking=no $ip "cops2/kill_all_cassandra.bash" & 24 | done 25 | 26 | for ip in ${ips[@]}; do 27 | fg 28 | done -------------------------------------------------------------------------------- /lib/antlr-3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/antlr-3.2.jar -------------------------------------------------------------------------------- /lib/avro-1.4.0-fixes.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/avro-1.4.0-fixes.jar -------------------------------------------------------------------------------- /lib/avro-1.4.0-sources-fixes.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/avro-1.4.0-sources-fixes.jar -------------------------------------------------------------------------------- /lib/commons-cli-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/commons-cli-1.1.jar -------------------------------------------------------------------------------- /lib/commons-codec-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/commons-codec-1.2.jar -------------------------------------------------------------------------------- /lib/commons-lang-2.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/commons-lang-2.4.jar -------------------------------------------------------------------------------- /lib/compress-lzf-0.8.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/compress-lzf-0.8.4.jar -------------------------------------------------------------------------------- /lib/concurrentlinkedhashmap-lru-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/concurrentlinkedhashmap-lru-1.2.jar -------------------------------------------------------------------------------- /lib/guava-r08.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/guava-r08.jar -------------------------------------------------------------------------------- /lib/high-scale-lib-1.1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/high-scale-lib-1.1.2.jar -------------------------------------------------------------------------------- /lib/jackson-core-asl-1.9.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/jackson-core-asl-1.9.2.jar -------------------------------------------------------------------------------- /lib/jackson-mapper-asl-1.9.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/jackson-mapper-asl-1.9.2.jar -------------------------------------------------------------------------------- /lib/jamm-0.2.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/jamm-0.2.5.jar -------------------------------------------------------------------------------- /lib/jline-0.9.94.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/jline-0.9.94.jar -------------------------------------------------------------------------------- /lib/json-simple-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/json-simple-1.1.jar -------------------------------------------------------------------------------- /lib/libthrift-0.7.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/libthrift-0.7.0.jar -------------------------------------------------------------------------------- /lib/licenses/antlr-3.1.3.txt: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2003-2006 Terence Parr 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions 7 | are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright 10 | notice, this list of conditions and the following disclaimer. 11 | 2. Redistributions in binary form must reproduce the above copyright 12 | notice, this list of conditions and the following disclaimer in the 13 | documentation and/or other materials provided with the distribution. 14 | 3. The name of the author may not be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 18 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 19 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 20 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 21 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 22 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | 28 | -------------------------------------------------------------------------------- /lib/licenses/compress-lzf-0.8.4.txt: -------------------------------------------------------------------------------- 1 | Copyright 2009-2010 Ning, Inc. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); you may not 4 | use this file except in compliance with the License. You may obtain a copy of 5 | the License at http://www.apache.org/licenses/LICENSE-2.0 6 | 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS,WITHOUT 9 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | License for the specific language governing permissions and limitations under 11 | the License. -------------------------------------------------------------------------------- /lib/licenses/slf4j-api-1.6.1.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2008 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a 5 | copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /lib/licenses/slf4j-log4j12-1.6.1.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2004-2008 QOS.ch 2 | All rights reserved. 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a 5 | copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /lib/log4j-1.2.16.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/log4j-1.2.16.jar -------------------------------------------------------------------------------- /lib/servlet-api-2.5-20081211.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/servlet-api-2.5-20081211.jar -------------------------------------------------------------------------------- /lib/slf4j-api-1.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/slf4j-api-1.6.1.jar -------------------------------------------------------------------------------- /lib/slf4j-log4j12-1.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/slf4j-log4j12-1.6.1.jar -------------------------------------------------------------------------------- /lib/snakeyaml-1.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/snakeyaml-1.6.jar -------------------------------------------------------------------------------- /lib/snappy-java-1.0.4.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/snappy-java-1.0.4.1.jar -------------------------------------------------------------------------------- /lib/snaptree-0.1-SNAPSHOT.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/lib/snaptree-0.1-SNAPSHOT.jar -------------------------------------------------------------------------------- /pylib/cqlshlib/__init__.py: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. 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 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/auth/AllowAllAuthority.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.auth; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | import java.util.EnumSet; 24 | import java.util.List; 25 | 26 | import org.apache.cassandra.config.ConfigurationException; 27 | 28 | public class AllowAllAuthority implements IAuthority 29 | { 30 | public EnumSet authorize(AuthenticatedUser user, List resource) 31 | { 32 | return Permission.ALL; 33 | } 34 | 35 | public void validateConfiguration() throws ConfigurationException 36 | { 37 | // pass 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/auth/Permission.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | 22 | package org.apache.cassandra.auth; 23 | 24 | import java.util.EnumSet; 25 | 26 | /** 27 | * An enum encapsulating the set of possible permissions that an authenticated user can have for a resource. 28 | * 29 | * IAuthority implementations may encode permissions using ordinals, so the Enum order must never change. 30 | */ 31 | public enum Permission 32 | { 33 | READ, 34 | WRITE; 35 | 36 | public static final EnumSet ALL = EnumSet.allOf(Permission.class); 37 | public static final EnumSet NONE = EnumSet.noneOf(Permission.class); 38 | } 39 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/cache/CacheKey.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | * 19 | */ 20 | package org.apache.cassandra.cache; 21 | 22 | import java.nio.ByteBuffer; 23 | 24 | import org.apache.cassandra.utils.Pair; 25 | 26 | public interface CacheKey 27 | { 28 | /** 29 | * @return Serialized part of the key which should be persisted 30 | */ 31 | public ByteBuffer serializeForStorage(); 32 | 33 | /** 34 | * @return The size of the serialized key 35 | */ 36 | public int serializedSize(); 37 | 38 | /** 39 | * @return The keyspace and ColumnFamily names to which this key belongs 40 | */ 41 | public Pair getPathInfo(); 42 | } 43 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/cache/IRowCacheProvider.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.cache; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | import org.apache.cassandra.db.ColumnFamily; 24 | 25 | /** 26 | * Provides cache objects with a requested capacity. 27 | */ 28 | public interface IRowCacheProvider 29 | { 30 | public ICache create(int capacity, boolean useMemoryWeigher); 31 | } 32 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/cache/SerializingCacheProvider.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.cache; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | import org.apache.cassandra.db.ColumnFamily; 24 | 25 | public class SerializingCacheProvider implements IRowCacheProvider 26 | { 27 | public ICache create(int capacity, boolean useMemoryWeigher) 28 | { 29 | return new SerializingCache(capacity, useMemoryWeigher, ColumnFamily.serializer()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/cli/CliCommandHelp.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 org.apache.cassandra.cli; 19 | 20 | public class CliCommandHelp 21 | { 22 | public String name; 23 | public String help; 24 | } -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/cli/CliUserHelp.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 org.apache.cassandra.cli; 19 | 20 | import java.util.List; 21 | 22 | public class CliUserHelp 23 | { 24 | public String banner; 25 | 26 | public String help; 27 | 28 | public List commands; 29 | } 30 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/client/IgnoredCallback.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.client; 2 | 3 | import org.apache.thrift.async.AsyncMethodCallback; 4 | 5 | public class IgnoredCallback implements AsyncMethodCallback 6 | { 7 | public IgnoredCallback() {} 8 | 9 | @Override 10 | public void onComplete(T response) 11 | { 12 | //ignored 13 | } 14 | 15 | @Override 16 | public void onError(Exception exception) 17 | { 18 | assert false : "Should not be an exception on oneway calls: " + exception; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/concurrent/IExecutorMBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.cassandra.concurrent; 20 | 21 | public interface IExecutorMBean 22 | { 23 | /** 24 | * Get the current number of running tasks 25 | */ 26 | public int getActiveCount(); 27 | 28 | /** 29 | * Get the number of completed tasks 30 | */ 31 | public long getCompletedTasks(); 32 | 33 | /** 34 | * Get the number of tasks waiting to be executed 35 | */ 36 | public long getPendingTasks(); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/concurrent/JMXConfigurableThreadPoolExecutorMBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.concurrent; 20 | 21 | public interface JMXConfigurableThreadPoolExecutorMBean extends JMXEnabledThreadPoolExecutorMBean 22 | { 23 | void setCorePoolSize(int n); 24 | 25 | int getCorePoolSize(); 26 | } -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/concurrent/JMXEnabledThreadPoolExecutorMBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.cassandra.concurrent; 20 | 21 | public interface JMXEnabledThreadPoolExecutorMBean extends IExecutorMBean 22 | { 23 | /** 24 | * Get the number of tasks that had blocked before being accepted (or 25 | * rejected). 26 | */ 27 | public int getTotalBlockedTasks(); 28 | 29 | /** 30 | * Get the number of tasks currently blocked, waiting to be accepted by 31 | * the executor (because all threads are busy and the backing queue is full). 32 | */ 33 | public int getCurrentlyBlockedTasks(); 34 | } 35 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/config/ConfigurationException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.config; 20 | 21 | public class ConfigurationException extends Exception 22 | { 23 | public ConfigurationException(String message) 24 | { 25 | super(message); 26 | } 27 | 28 | public ConfigurationException(String message, Exception e) 29 | { 30 | super(message, e); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/config/RequestSchedulerOptions.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.config; 2 | 3 | import java.util.Map; 4 | /* 5 | * 6 | * Licensed to the Apache Software Foundation (ASF) under one 7 | * or more contributor license agreements. See the NOTICE file 8 | * distributed with this work for additional information 9 | * regarding copyright ownership. The ASF licenses this file 10 | * to you under the Apache License, Version 2.0 (the 11 | * "License"); you may not use this file except in compliance 12 | * with the License. You may obtain a copy of the License at 13 | * 14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | * 16 | * Unless required by applicable law or agreed to in writing, 17 | * software distributed under the License is distributed on an 18 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 19 | * KIND, either express or implied. See the License for the 20 | * specific language governing permissions and limitations 21 | * under the License. 22 | * 23 | */ 24 | 25 | /** 26 | * 27 | */ 28 | public class RequestSchedulerOptions 29 | { 30 | public static final Integer DEFAULT_THROTTLE_LIMIT = 80; 31 | public static final Integer DEFAULT_WEIGHT = 1; 32 | 33 | public Integer throttle_limit = DEFAULT_THROTTLE_LIMIT; 34 | public Integer default_weight = DEFAULT_WEIGHT; 35 | public Map weights; 36 | } 37 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/config/SeedProviderDef.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.config; 2 | 3 | import java.util.LinkedHashMap; 4 | import java.util.List; 5 | import java.util.Map; 6 | 7 | /** 8 | * Licensed to the Apache Software Foundation (ASF) under one 9 | * or more contributor license agreements. See the NOTICE file 10 | * distributed with this work for additional information 11 | * regarding copyright ownership. The ASF licenses this file 12 | * to you under the Apache License, Version 2.0 (the 13 | * "License"); you may not use this file except in compliance 14 | * with the License. You may obtain a copy of the License at 15 | *

16 | * http://www.apache.org/licenses/LICENSE-2.0 17 | *

18 | * Unless required by applicable law or agreed to in writing, software 19 | * distributed under the License is distributed on an "AS IS" BASIS, 20 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 21 | * See the License for the specific language governing permissions and 22 | * limitations under the License. 23 | */ 24 | 25 | 26 | public class SeedProviderDef 27 | { 28 | public String class_name; 29 | public Map parameters; 30 | 31 | public SeedProviderDef(LinkedHashMap p) 32 | { 33 | class_name = (String)p.get("class_name"); 34 | parameters = (Map)((List)p.get("parameters")).get(0); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/cql/CQLStatement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | package org.apache.cassandra.cql; 22 | 23 | public class CQLStatement 24 | { 25 | public StatementType type; 26 | public Object statement; 27 | public int boundTerms = 0; 28 | 29 | public CQLStatement(StatementType type, Object statement, int lastMarker) 30 | { 31 | this.type = type; 32 | this.statement = statement; 33 | this.boundTerms = lastMarker + 1; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/cql/StatementType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Licensed to the Apache Software Foundation (ASF) under one 4 | * or more contributor license agreements. See the NOTICE file 5 | * distributed with this work for additional information 6 | * regarding copyright ownership. The ASF licenses this file 7 | * to you under the Apache License, Version 2.0 (the 8 | * "License"); you may not use this file except in compliance 9 | * with the License. You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, 14 | * software distributed under the License is distributed on an 15 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 | * KIND, either express or implied. See the License for the 17 | * specific language governing permissions and limitations 18 | * under the License. 19 | * 20 | */ 21 | package org.apache.cassandra.cql; 22 | 23 | import java.util.EnumSet; 24 | 25 | public enum StatementType 26 | { 27 | SELECT, INSERT, UPDATE, BATCH, USE, TRUNCATE, DELETE, CREATE_KEYSPACE, CREATE_COLUMNFAMILY, CREATE_INDEX, DROP_INDEX, 28 | DROP_KEYSPACE, DROP_COLUMNFAMILY, ALTER_TABLE; 29 | 30 | // Statement types that don't require a keyspace to be set. 31 | private static final EnumSet topLevel = EnumSet.of(USE, CREATE_KEYSPACE, DROP_KEYSPACE); 32 | public static final EnumSet requiresKeyspace = EnumSet.complementOf(topLevel); 33 | } 34 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/cql/jdbc/JdbcCounterColumn.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.cql.jdbc; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | public class JdbcCounterColumn extends JdbcLong 25 | { 26 | public static final JdbcCounterColumn instance = new JdbcCounterColumn(); 27 | 28 | JdbcCounterColumn() {} 29 | } 30 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/cql/jdbc/MarshalException.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.cql.jdbc; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | public class MarshalException extends RuntimeException 25 | { 26 | public MarshalException(String message) 27 | { 28 | super(message); 29 | } 30 | 31 | public MarshalException(String message, Throwable cause) 32 | { 33 | super(message, cause); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/ColumnFamilyNotDefinedException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.db; 20 | 21 | import org.apache.cassandra.thrift.InvalidRequestException; 22 | 23 | public class ColumnFamilyNotDefinedException extends InvalidRequestException 24 | { 25 | public ColumnFamilyNotDefinedException(String message) 26 | { 27 | super(message); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/ColumnFamilyType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 org.apache.cassandra.db; 19 | 20 | /** 21 | * column family type enum 22 | */ 23 | public enum ColumnFamilyType 24 | { 25 | Standard, 26 | Super; 27 | 28 | public static ColumnFamilyType create(String name) 29 | { 30 | try 31 | { 32 | // TODO thrift optional parameter in CfDef is leaking down here which it shouldn't 33 | return name == null ? ColumnFamilyType.Standard : ColumnFamilyType.valueOf(name); 34 | } 35 | catch (IllegalArgumentException e) 36 | { 37 | return null; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/CounterMutationCompletion.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db; 2 | 3 | import org.apache.cassandra.net.ICompletable; 4 | import org.apache.cassandra.net.Message; 5 | 6 | public class CounterMutationCompletion implements ICompletable 7 | { 8 | private final Message message; 9 | private final String id; 10 | private final CounterMutation cm; 11 | 12 | public CounterMutationCompletion(Message message, String id, CounterMutation cm) 13 | { 14 | this.message = message; 15 | this.id = id; 16 | this.cm = cm; 17 | } 18 | 19 | // Complete the blocked RowMutation 20 | @Override 21 | public void complete() 22 | { 23 | CounterMutationVerbHandler.instance().applyAndRespond(message, id, cm); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/DBConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.cassandra.db; 20 | 21 | public class DBConstants 22 | { 23 | public static final int boolSize = 1; 24 | public static final int intSize = 4; 25 | public static final int longSize = 8; 26 | public static final int shortSize = 2; 27 | public static final int tsSize = 8; 28 | } 29 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/DependencyCheckVerbHandler.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db; 2 | 3 | import java.io.IOException; 4 | 5 | import org.apache.cassandra.net.IVerbHandler; 6 | import org.apache.cassandra.net.Message; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | public class DependencyCheckVerbHandler implements IVerbHandler 11 | { 12 | private static Logger logger_ = LoggerFactory.getLogger(DependencyCheckVerbHandler.class); 13 | 14 | @Override 15 | public void doVerb(Message message, String id) 16 | { 17 | DependencyCheck depCheck = null; 18 | try { 19 | depCheck = DependencyCheck.fromBytes(message.getMessageBody(), message.getVersion()); 20 | } catch (IOException e) { 21 | logger_.error("Error in decoding dependencyCheck"); 22 | } 23 | AppliedOperations.checkDependency(depCheck, message, id); 24 | } 25 | } -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/HideableTimestamp.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db; 2 | 3 | import org.apache.cassandra.utils.VersionUtil; 4 | 5 | public class HideableTimestamp 6 | { 7 | private final long value; 8 | private final boolean visible; 9 | 10 | public HideableTimestamp(long value, boolean visible) 11 | { 12 | this.value = value; 13 | this.visible = visible; 14 | } 15 | 16 | public long getValue() 17 | { 18 | return value; 19 | } 20 | 21 | public boolean isVisible() 22 | { 23 | return visible; 24 | } 25 | 26 | @Override 27 | public String toString() 28 | { 29 | return VersionUtil.toString(value) + (visible ? "(v)" : "(h)"); 30 | } 31 | } -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/KeyspaceNotDefinedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.cassandra.db; 20 | 21 | import org.apache.cassandra.thrift.InvalidRequestException; 22 | 23 | public class KeyspaceNotDefinedException extends InvalidRequestException 24 | { 25 | public KeyspaceNotDefinedException(String why) 26 | { 27 | super(why); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/RowMutationCompletion.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db; 2 | 3 | import org.apache.cassandra.net.ICompletable; 4 | import org.apache.cassandra.net.Message; 5 | 6 | public class RowMutationCompletion implements ICompletable 7 | { 8 | private final Message message; 9 | private final String id; 10 | private final RowMutation rm; 11 | 12 | public RowMutationCompletion(Message message, String id, RowMutation rm) 13 | { 14 | this.message = message; 15 | this.id = id; 16 | this.rm = rm; 17 | } 18 | 19 | // Complete the blocked RowMutation 20 | @Override 21 | public void complete() 22 | { 23 | RowMutationVerbHandler.instance().applyAndRespond(message, id, rm); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/UnserializableColumnFamilyException.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * Licensed to the Apache Software Foundation (ASF) under one 7 | * or more contributor license agreements. See the NOTICE file 8 | * distributed with this work for additional information 9 | * regarding copyright ownership. The ASF licenses this file 10 | * to you under the Apache License, Version 2.0 (the 11 | * "License"); you may not use this file except in compliance 12 | * with the License. You may obtain a copy of the License at 13 | *

14 | * http://www.apache.org/licenses/LICENSE-2.0 15 | *

16 | * Unless required by applicable law or agreed to in writing, software 17 | * distributed under the License is distributed on an "AS IS" BASIS, 18 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 19 | * See the License for the specific language governing permissions and 20 | * limitations under the License. 21 | */ 22 | 23 | 24 | public class UnserializableColumnFamilyException extends IOException 25 | { 26 | public final int cfId; 27 | 28 | public UnserializableColumnFamilyException(String msg, int cfId) 29 | { 30 | super(msg); 31 | this.cfId = cfId; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/columniterator/ICountableColumnIterator.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.columniterator; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | public interface ICountableColumnIterator extends IColumnIterator 25 | { 26 | public int getColumnCount(); 27 | 28 | public void reset(); 29 | } 30 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/columniterator/SimpleAbstractColumnIterator.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.columniterator; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | import java.io.IOException; 25 | 26 | import com.google.common.collect.AbstractIterator; 27 | 28 | import org.apache.cassandra.db.IColumn; 29 | 30 | public abstract class SimpleAbstractColumnIterator extends AbstractIterator implements IColumnIterator 31 | { 32 | public void close() throws IOException {} 33 | } 34 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/commitlog/CommitLogMBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.cassandra.db.commitlog; 20 | 21 | 22 | 23 | public interface CommitLogMBean 24 | { 25 | /** 26 | * Get the number of completed tasks 27 | */ 28 | public long getCompletedTasks(); 29 | 30 | /** 31 | * Get the number of tasks waiting to be executed 32 | */ 33 | public long getPendingTasks(); 34 | 35 | /** 36 | * Get the current size used by all the commitlog segments. 37 | */ 38 | public long getTotalCommitlogSize(); 39 | } -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/compaction/CompactionInterruptedException.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.compaction; 2 | 3 | public class CompactionInterruptedException extends RuntimeException 4 | { 5 | private static final long serialVersionUID = -8651427062512310398L; 6 | 7 | public CompactionInterruptedException(CompactionInfo info) 8 | { 9 | super("Compaction interrupted: " + info); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/filter/AbstractColumnIterator.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.filter; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | import java.io.IOException; 25 | 26 | import org.apache.cassandra.db.columniterator.IColumnIterator; 27 | 28 | public abstract class AbstractColumnIterator implements IColumnIterator 29 | { 30 | public void close() throws IOException 31 | {} 32 | 33 | public void remove() 34 | { 35 | throw new UnsupportedOperationException(); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/marshal/MarshalException.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.marshal; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | public class MarshalException extends RuntimeException 25 | { 26 | public MarshalException(String message) 27 | { 28 | super(message); 29 | } 30 | 31 | public MarshalException(String message, Throwable cause) 32 | { 33 | super(message, cause); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/transaction/AckMessage.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.transaction; 2 | 3 | public class AckMessage extends CohortMessage 4 | { 5 | public AckMessage(long transactionId, int localKeyCount) 6 | { 7 | super(transactionId, localKeyCount); 8 | } 9 | 10 | @Override 11 | public int serializationFlags() 12 | { 13 | return TransactionMessageSerializer.ACK_MASK; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/transaction/CheckTransactionMessage.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.transaction; 2 | 3 | import java.util.List; 4 | 5 | public class CheckTransactionMessage extends AbstractTransactionMessage 6 | { 7 | final List transactionIds; 8 | final long checkTime; 9 | 10 | public CheckTransactionMessage(List transactionIds, long chosenTime) 11 | { 12 | this.transactionIds = transactionIds; 13 | this.checkTime = chosenTime; 14 | } 15 | 16 | public List getTransactionIds() 17 | { 18 | return transactionIds; 19 | } 20 | 21 | public long getCheckTime() 22 | { 23 | return checkTime; 24 | } 25 | 26 | @Override 27 | public int serializationFlags() 28 | { 29 | return TransactionMessageSerializer.CHECK_MASK; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/transaction/CohortMessage.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.transaction; 2 | 3 | public abstract class CohortMessage extends AbstractTransactionMessage 4 | { 5 | final long transactionId; 6 | final int localKeyCount; 7 | 8 | public CohortMessage(long transactionId, int localKeyCount) 9 | { 10 | this.transactionId = transactionId; 11 | this.localKeyCount = localKeyCount; 12 | } 13 | 14 | public long getTransactionId() 15 | { 16 | return transactionId; 17 | } 18 | 19 | public int getLocalKeyCount() 20 | { 21 | return localKeyCount; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/transaction/CommitMessage.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.transaction; 2 | 3 | 4 | public class CommitMessage extends AbstractTransactionMessage 5 | { 6 | final long transactionId; 7 | final long commitTime; 8 | 9 | public CommitMessage(long transactionId, long commitTime) 10 | { 11 | this.transactionId = transactionId; 12 | this.commitTime = commitTime; 13 | } 14 | 15 | public long getTransactionId() 16 | { 17 | return transactionId; 18 | } 19 | 20 | public long getCommitTime() 21 | { 22 | return commitTime; 23 | } 24 | 25 | @Override 26 | public int serializationFlags() 27 | { 28 | return TransactionMessageSerializer.COMMIT_MASK; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/transaction/NotifyMessage.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.transaction; 2 | 3 | public class NotifyMessage extends CohortMessage 4 | { 5 | public NotifyMessage(long transactionId, int localKeyCount) 6 | { 7 | super(transactionId, localKeyCount); 8 | } 9 | 10 | @Override 11 | public int serializationFlags() 12 | { 13 | return TransactionMessageSerializer.NOTIFY_MASK; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/transaction/PrepareMessage.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.transaction; 2 | 3 | 4 | public class PrepareMessage extends AbstractTransactionMessage 5 | { 6 | final long transactionId; 7 | 8 | public PrepareMessage(long transactionId) 9 | { 10 | this.transactionId = transactionId; 11 | } 12 | 13 | public long getTransactionId() 14 | { 15 | return transactionId; 16 | } 17 | 18 | @Override 19 | public int serializationFlags() 20 | { 21 | return TransactionMessageSerializer.PREPARE_MASK; 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/transaction/TransactionCohortVerbHandler.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.transaction; 2 | 3 | import java.io.IOException; 4 | 5 | import org.apache.cassandra.net.IVerbHandler; 6 | import org.apache.cassandra.net.Message; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | public class TransactionCohortVerbHandler implements IVerbHandler 11 | { 12 | private static Logger logger_ = LoggerFactory.getLogger(TransactionCohortVerbHandler.class); 13 | 14 | @Override 15 | public void doVerb(Message message, String id) 16 | { 17 | try { 18 | BatchMutateTransactionCohort cohort = BatchMutateTransactionCohort.fromBytes(message.getMessageBody(), message.getVersion()); 19 | //deserialization calls receiveReplicated... on the cohort 20 | } catch (IOException e) { 21 | logger_.error("Error in decoding batchMutateTransactionCohort"); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/transaction/TransactionCoordinatorVerbHandler.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.transaction; 2 | 3 | import java.io.IOException; 4 | 5 | import org.apache.cassandra.net.IVerbHandler; 6 | import org.apache.cassandra.net.Message; 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | public class TransactionCoordinatorVerbHandler implements IVerbHandler 11 | { 12 | private static Logger logger_ = LoggerFactory.getLogger(TransactionCoordinatorVerbHandler.class); 13 | 14 | @Override 15 | public void doVerb(Message message, String id) 16 | { 17 | try { 18 | BatchMutateTransactionCoordinator coordinator = BatchMutateTransactionCoordinator.fromBytes(message.getMessageBody(), message.getVersion()); 19 | //deserialization calls receiveReplicated... on the coordinator 20 | } catch (IOException e) { 21 | logger_.error("Error in decoding batchMutateTransactionCoordinator"); 22 | } 23 | 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/db/transaction/YesVoteMessage.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.db.transaction; 2 | 3 | public class YesVoteMessage extends CohortMessage 4 | { 5 | public YesVoteMessage(long transactionId, int localKeyCount) 6 | { 7 | super(transactionId, localKeyCount); 8 | } 9 | 10 | @Override 11 | public int serializationFlags() 12 | { 13 | return TransactionMessageSerializer.YESVOTE_MASK; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/dht/AbstractPartitioner.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 org.apache.cassandra.dht; 19 | 20 | public abstract class AbstractPartitioner implements IPartitioner 21 | { 22 | public R minValue(Class klass) 23 | { 24 | Token minToken = getMinimumToken(); 25 | if (minToken.getClass().equals(klass)) 26 | return (R)minToken; 27 | else 28 | return (R)minToken.minKeyBound(); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/dht/BigIntegerToken.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.cassandra.dht; 20 | 21 | import java.math.BigInteger; 22 | 23 | public class BigIntegerToken extends Token 24 | { 25 | static final long serialVersionUID = -5833589141319293006L; 26 | 27 | public BigIntegerToken(BigInteger token) 28 | { 29 | super(token); 30 | } 31 | 32 | // convenience method for testing 33 | public BigIntegerToken(String token) { 34 | this(new BigInteger(token)); 35 | } 36 | 37 | public int compareTo(Token o) 38 | { 39 | return token.compareTo(o.token); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/dht/ByteOrderedPartitioner.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.dht; 20 | 21 | import java.nio.ByteBuffer; 22 | 23 | public class ByteOrderedPartitioner extends AbstractByteOrderedPartitioner 24 | { 25 | public BytesToken getToken(ByteBuffer key) 26 | { 27 | if (key.remaining() == 0) 28 | return MINIMUM; 29 | return new BytesToken(key); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/dht/StringToken.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.cassandra.dht; 20 | 21 | 22 | public class StringToken extends Token 23 | { 24 | static final long serialVersionUID = 5464084395277974963L; 25 | 26 | public StringToken(String token) 27 | { 28 | super(token); 29 | } 30 | 31 | public int compareTo(Token o) 32 | { 33 | return token.compareTo(o.token); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/gms/ApplicationState.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.gms; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | public enum ApplicationState 25 | { 26 | STATUS, 27 | LOAD, 28 | SCHEMA, 29 | DC, 30 | RACK, 31 | RELEASE_VERSION, 32 | REMOVAL_COORDINATOR, 33 | INTERNAL_IP, 34 | RPC_ADDRESS, 35 | // pad to allow adding new states to existing cluster 36 | X1, 37 | X2, 38 | X3, 39 | X4, 40 | X5, 41 | } 42 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/gms/FailureDetectorMBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.gms; 20 | 21 | import java.net.UnknownHostException; 22 | import java.util.Map; 23 | 24 | public interface FailureDetectorMBean 25 | { 26 | public void dumpInterArrivalTimes(); 27 | 28 | public void setPhiConvictThreshold(int phi); 29 | 30 | public int getPhiConvictThreshold(); 31 | 32 | public String getAllEndpointStates(); 33 | 34 | public String getEndpointState(String address) throws UnknownHostException; 35 | 36 | public Map getSimpleStates(); 37 | } 38 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/gms/GossiperMBean.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.gms; 20 | 21 | import java.net.UnknownHostException; 22 | 23 | public interface GossiperMBean 24 | { 25 | public int getVersion(String address) throws UnknownHostException; 26 | 27 | public long getEndpointDowntime(String address) throws UnknownHostException; 28 | 29 | public int getCurrentGenerationNumber(String address) throws UnknownHostException; 30 | 31 | public void unsafeAssassinateEndpoint(String address) throws UnknownHostException; 32 | 33 | } -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/gms/IFailureDetectionEventListener.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.gms; 20 | 21 | import java.net.InetAddress; 22 | 23 | /** 24 | * Implemented by the Gossiper to convict an endpoint 25 | * based on the PHI calculated by the Failure Detector on the inter-arrival 26 | * times of the heart beats. 27 | */ 28 | 29 | public interface IFailureDetectionEventListener 30 | { 31 | /** 32 | * Convict the specified endpoint. 33 | * @param ep endpoint to be convicted 34 | * @param phi the value of phi with with ep was convicted 35 | */ 36 | public void convict(InetAddress ep, double phi); 37 | } 38 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/gms/IFailureNotification.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.gms; 20 | 21 | import java.net.InetAddress; 22 | 23 | public interface IFailureNotification 24 | { 25 | public void convict(InetAddress ep); 26 | public void revive(InetAddress ep); 27 | } 28 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/gms/VersionGenerator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.gms; 20 | 21 | import java.util.concurrent.atomic.AtomicInteger; 22 | 23 | /** 24 | * A unique version number generator for any state that is generated by the 25 | * local node. 26 | */ 27 | 28 | public class VersionGenerator 29 | { 30 | private static AtomicInteger version_ = new AtomicInteger(0); 31 | 32 | public static int getNextVersion() 33 | { 34 | return version_.incrementAndGet(); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/io/compress/CorruptedBlockException.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.cassandra.io.compress; 20 | 21 | import java.io.IOException; 22 | 23 | public class CorruptedBlockException extends IOException 24 | { 25 | public CorruptedBlockException(String filePath, CompressionMetadata.Chunk chunk) 26 | { 27 | this(filePath, chunk.offset, chunk.length); 28 | } 29 | 30 | public CorruptedBlockException(String filePath, long offset, int length) 31 | { 32 | super(String.format("(%s): corruption detected, chunk at %d of length %d.", filePath, offset, length)); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/io/util/FileMark.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.io.util; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | public interface FileMark {} 24 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/io/util/IIterableColumns.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.io.util; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | import org.apache.cassandra.db.IColumn; 25 | import org.apache.cassandra.db.marshal.AbstractType; 26 | 27 | public interface IIterableColumns extends Iterable 28 | { 29 | public int getEstimatedColumnCount(); 30 | 31 | AbstractType getComparator(); 32 | } 33 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/locator/DynamicEndpointSnitchMBean.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | 20 | package org.apache.cassandra.locator; 21 | 22 | import java.net.InetAddress; 23 | import java.net.UnknownHostException; 24 | import java.util.Map; 25 | import java.util.List; 26 | 27 | public interface DynamicEndpointSnitchMBean { 28 | public Map getScores(); 29 | public int getUpdateInterval(); 30 | public int getResetInterval(); 31 | public double getBadnessThreshold(); 32 | public String getSubsnitchClassName(); 33 | public List dumpTimings(String hostname) throws UnknownHostException; 34 | } 35 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/locator/ILatencySubscriber.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.locator; 20 | 21 | import java.net.InetAddress; 22 | 23 | public interface ILatencySubscriber 24 | { 25 | public void receiveTiming(InetAddress address, Double latency); 26 | } 27 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/locator/SeedProvider.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 org.apache.cassandra.locator; 19 | 20 | import java.net.InetAddress; 21 | import java.util.List; 22 | 23 | public interface SeedProvider 24 | { 25 | List getSeeds(); 26 | } 27 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/net/HeaderTypes.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.net; 20 | 21 | public class HeaderTypes 22 | { 23 | public final static String TASK_PROFILE_CHAIN = "TASK_PROFILE_CHAIN"; 24 | public static String TASK_ID = "TASK_ID"; 25 | } 26 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/net/IAsyncCallback.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.net; 20 | 21 | /** 22 | * implementors of IAsyncCallback need to make sure that any public methods 23 | * are threadsafe with respect to response() being called from the message 24 | * service. In particular, if any shared state is referenced, making 25 | * response alone synchronized will not suffice. 26 | */ 27 | public interface IAsyncCallback extends IMessageCallback 28 | { 29 | /** 30 | * @param msg response received. 31 | */ 32 | public void response(Message msg); 33 | } 34 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/net/ICompletable.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.net; 2 | 3 | public interface ICompletable 4 | { 5 | public void complete(); 6 | } 7 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/net/IMessageCallback.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.net; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | public interface IMessageCallback 25 | { 26 | /** 27 | * @return true if this callback is on the read path and its latency should be 28 | * given as input to the dynamic snitch. 29 | */ 30 | public boolean isLatencyForSnitch(); 31 | } 32 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/net/MessageProducer.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.net; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | import java.io.IOException; 25 | 26 | public interface MessageProducer 27 | { 28 | public Message getMessage(Integer version) throws IOException; 29 | } 30 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/net/io/SerializerType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.net.io; 20 | 21 | public enum SerializerType 22 | { 23 | BINARY, 24 | JAVA, 25 | XML, 26 | JSON 27 | } 28 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/net/sink/IMessageSink.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.net.sink; 20 | 21 | import java.net.InetAddress; 22 | 23 | import org.apache.cassandra.net.Message; 24 | 25 | public interface IMessageSink 26 | { 27 | public Message handleMessage(Message message, String id, InetAddress to); 28 | } 29 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/notifications/INotification.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.notifications; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | /** 25 | * Created by IntelliJ IDEA. 26 | * User: bcoverston 27 | * Date: 6/9/11 28 | * Time: 10:53 PM 29 | * To change this template use File | Settings | File Templates. 30 | */ 31 | public interface INotification 32 | { 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/notifications/INotificationConsumer.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.notifications; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | public interface INotificationConsumer 25 | { 26 | void handleNotification(INotification notification, Object sender); 27 | } 28 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/notifications/SSTableAddedNotification.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.notifications; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | import org.apache.cassandra.io.sstable.SSTableReader; 25 | 26 | import java.util.List; 27 | 28 | public class SSTableAddedNotification implements INotification 29 | { 30 | public SSTableReader added; 31 | public SSTableAddedNotification(SSTableReader added) 32 | { 33 | this.added = added; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/notifications/SSTableListChangedNotification.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.notifications; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | import org.apache.cassandra.io.sstable.SSTableReader; 25 | 26 | import java.util.List; 27 | 28 | public class SSTableListChangedNotification implements INotification 29 | { 30 | public Iterable removed; 31 | public Iterable added; 32 | public SSTableListChangedNotification(Iterable added, Iterable removed) 33 | { 34 | this.removed = removed; 35 | this.added = added; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/scheduler/NoScheduler.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.scheduler; 2 | 3 | import org.apache.cassandra.config.RequestSchedulerOptions; 4 | 5 | /* 6 | * 7 | * Licensed to the Apache Software Foundation (ASF) under one 8 | * or more contributor license agreements. See the NOTICE file 9 | * distributed with this work for additional information 10 | * regarding copyright ownership. The ASF licenses this file 11 | * to you under the Apache License, Version 2.0 (the 12 | * "License"); you may not use this file except in compliance 13 | * with the License. You may obtain a copy of the License at 14 | * 15 | * http://www.apache.org/licenses/LICENSE-2.0 16 | * 17 | * Unless required by applicable law or agreed to in writing, 18 | * software distributed under the License is distributed on an 19 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 20 | * KIND, either express or implied. See the License for the 21 | * specific language governing permissions and limitations 22 | * under the License. 23 | * 24 | */ 25 | 26 | /** 27 | * This is basically not having a scheduler, the requests are 28 | * processed as normally would be handled by the JVM. 29 | */ 30 | public class NoScheduler implements IRequestScheduler 31 | { 32 | 33 | public NoScheduler(RequestSchedulerOptions options) {} 34 | 35 | public NoScheduler() {} 36 | 37 | public void queue(Thread t, String id, long timeoutMS) {} 38 | 39 | public void release() {} 40 | } 41 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/scheduler/WeightedQueueMBean.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.scheduler; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | /** 24 | * Exposes client request scheduling metrics for a particular scheduler queue. 25 | */ 26 | public interface WeightedQueueMBean 27 | { 28 | public long getOperations(); 29 | public long getTotalLatencyMicros(); 30 | public double getRecentLatencyMicros(); 31 | public long[] getTotalLatencyHistogramMicros(); 32 | public long[] getRecentLatencyHistogramMicros(); 33 | } 34 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/service/IReadCommand.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.service; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | public interface IReadCommand 25 | { 26 | public String getKeyspace(); 27 | } 28 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/service/IWriteResponseHandler.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.service; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | import java.util.concurrent.TimeoutException; 24 | 25 | import org.apache.cassandra.concurrent.CreationTimeAwareFuture; 26 | import org.apache.cassandra.net.IAsyncCallback; 27 | import org.apache.cassandra.thrift.UnavailableException; 28 | 29 | public interface IWriteResponseHandler extends IAsyncCallback 30 | { 31 | public void get() throws TimeoutException; 32 | public void addFutureForHint(CreationTimeAwareFuture hintFuture); 33 | public void assureSufficientLiveNodes() throws UnavailableException; 34 | } 35 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/streaming/OperationType.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.streaming; 20 | 21 | /** 22 | * Streaming operation type. 23 | */ 24 | public enum OperationType 25 | { 26 | AES, 27 | BOOTSTRAP, 28 | UNBOOTSTRAP, 29 | RESTORE_REPLICA_COUNT, 30 | BULK_LOAD; 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/thrift/RequestType.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.thrift; 2 | 3 | public enum RequestType 4 | { 5 | READ, 6 | WRITE 7 | } 8 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/tools/GetVersion.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 org.apache.cassandra.tools; 19 | 20 | import static org.apache.cassandra.utils.FBUtilities.getReleaseVersionString; 21 | 22 | public class GetVersion { 23 | public static void main(String[] args) { 24 | System.out.println(getReleaseVersionString()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/utils/Allocator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2011 The Apache Software Foundation 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.apache.cassandra.utils; 21 | 22 | import java.nio.ByteBuffer; 23 | 24 | public abstract class Allocator 25 | { 26 | /** 27 | * Allocate a slice of the given length. 28 | */ 29 | public ByteBuffer clone(ByteBuffer buffer) 30 | { 31 | assert buffer != null; 32 | ByteBuffer cloned = allocate(buffer.remaining()); 33 | 34 | cloned.mark(); 35 | cloned.put(buffer.duplicate()); 36 | cloned.reset(); 37 | return cloned; 38 | } 39 | 40 | public abstract ByteBuffer allocate(int size); 41 | } 42 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/utils/CloseableIterator.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.utils; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | import java.io.Closeable; 25 | import java.util.Iterator; 26 | 27 | // so we can instantiate anonymous classes implementing both interfaces 28 | public interface CloseableIterator extends Iterator, Closeable 29 | { 30 | } 31 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/utils/DefaultDouble.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.utils; 2 | 3 | /** 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | 22 | public class DefaultDouble 23 | { 24 | private final double originalValue; 25 | private double currentValue; 26 | 27 | public DefaultDouble(double value) 28 | { 29 | originalValue = value; 30 | currentValue = value; 31 | } 32 | 33 | public double value() 34 | { 35 | return currentValue; 36 | } 37 | 38 | public void set(double d) 39 | { 40 | currentValue = d; 41 | } 42 | 43 | public boolean isModified() 44 | { 45 | return originalValue != currentValue; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/utils/DefaultInteger.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.utils; 2 | 3 | /** 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | 21 | 22 | public class DefaultInteger 23 | { 24 | private final int originalValue; 25 | private int currentValue; 26 | 27 | public DefaultInteger(int value) 28 | { 29 | originalValue = value; 30 | currentValue = value; 31 | } 32 | 33 | public int value() 34 | { 35 | return currentValue; 36 | } 37 | 38 | public void set(int i) 39 | { 40 | currentValue = i; 41 | } 42 | 43 | public boolean isModified() 44 | { 45 | return originalValue != currentValue; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/utils/DestructivePQIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.cassandra.utils; 20 | 21 | import java.util.Iterator; 22 | import java.util.PriorityQueue; 23 | 24 | public class DestructivePQIterator implements Iterator { 25 | private PriorityQueue pq; 26 | 27 | public DestructivePQIterator(PriorityQueue pq) { 28 | this.pq = pq; 29 | } 30 | 31 | public boolean hasNext() { 32 | return pq.size() > 0; 33 | } 34 | 35 | public T next() { 36 | return pq.poll(); 37 | } 38 | 39 | public void remove() { 40 | throw new UnsupportedOperationException(); 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/utils/Filter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.cassandra.utils; 20 | 21 | import java.nio.ByteBuffer; 22 | 23 | public abstract class Filter 24 | { 25 | int hashCount; 26 | 27 | int getHashCount() 28 | { 29 | return hashCount; 30 | } 31 | 32 | public abstract void add(ByteBuffer key); 33 | 34 | public abstract boolean isPresent(ByteBuffer key); 35 | } 36 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/utils/HeapAllocator.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright 2011 The Apache Software Foundation 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, software 15 | * distributed under the License is distributed on an "AS IS" BASIS, 16 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 17 | * See the License for the specific language governing permissions and 18 | * limitations under the License. 19 | */ 20 | package org.apache.cassandra.utils; 21 | 22 | import java.nio.ByteBuffer; 23 | 24 | public final class HeapAllocator extends Allocator 25 | { 26 | public static final HeapAllocator instance = new HeapAllocator(); 27 | 28 | private HeapAllocator() {} 29 | 30 | public ByteBuffer allocate(int size) 31 | { 32 | return ByteBuffer.allocate(size); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/utils/IMergeIterator.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.utils; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | public interface IMergeIterator extends CloseableIterator 25 | { 26 | Iterable> iterators(); 27 | } 28 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/utils/VersionUtil.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.utils; 2 | 3 | public class VersionUtil 4 | { 5 | private VersionUtil() 6 | { 7 | //just helper methods, don't instantiate 8 | } 9 | 10 | public static short extractShortNodeId(long version) 11 | { 12 | return (short) (version & 0xFFFF); 13 | } 14 | 15 | public static long extractLamportTime(long version) 16 | { 17 | return version >>> 16; 18 | } 19 | 20 | public static String toString(long version) 21 | { 22 | return version + "=" + extractLamportTime(version) + "." + extractDatacenter(version) + "." + (extractShortNodeId(version) & 0x0FFF); 23 | } 24 | 25 | public static byte extractDatacenter(long version) 26 | { 27 | return (byte) ((version & 0xF000) >>> 12); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/utils/WrappedRunnable.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.utils; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | public abstract class WrappedRunnable implements Runnable 25 | { 26 | public final void run() 27 | { 28 | try 29 | { 30 | runMayThrow(); 31 | } 32 | catch (Exception e) 33 | { 34 | throw FBUtilities.unchecked(e); 35 | } 36 | } 37 | 38 | abstract protected void runMayThrow() throws Exception; 39 | } 40 | -------------------------------------------------------------------------------- /src/java/org/apache/cassandra/utils/obs/ArrayUtil.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. 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 | package org.apache.cassandra.utils.obs; 19 | 20 | /** 21 | * Methods for manipulating arrays. 22 | * 23 | * @lucene.internal 24 | */ 25 | 26 | final class ArrayUtil { 27 | public static long[] grow(long[] array, int minSize) { 28 | if (array.length < minSize) { 29 | long[] newArray = new long[Math.max(array.length << 1, minSize)]; 30 | System.arraycopy(array, 0, newArray, 0, array.length); 31 | return newArray; 32 | } else 33 | return array; 34 | } 35 | 36 | public static long[] grow(long[] array) { 37 | return grow(array, 1 + array.length); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /test/conf/access.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. 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 | # This is a sample access file for SimpleAuthority. The format of 18 | # this file is keyspace=users, where users is a comma delimited list of 19 | # authenticatable users from passwd.properties. This file contains 20 | # potentially sensitive information, keep this in mind when setting its 21 | # mode and ownership. 22 | # 23 | # The magical '' property lists users who can modify the 24 | # list of keyspaces: all users will be able to view the list of keyspaces. 25 | =user1 26 | 27 | Keyspace1.=user1,user2 28 | Keyspace1.Standard1.=user2 29 | Keyspace1.Standard1.=user1 30 | -------------------------------------------------------------------------------- /test/conf/cassandra-topology.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. 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 | # Cassandra Node IP=Data Center:Rack 18 | 192.168.1.100=DC1:RAC1 19 | 192.168.2.200=DC2:RAC2 20 | 21 | 10.0.0.10=DC1:RAC1 22 | 10.0.0.11=DC1:RAC1 23 | 10.0.0.12=DC1:RAC2 24 | 25 | 10.20.114.10=DC2:RAC1 26 | 10.20.114.11=DC2:RAC1 27 | 28 | 10.21.119.13=DC3:RAC1 29 | 10.21.119.10=DC3:RAC1 30 | 31 | 10.0.0.13=DC1:RAC2 32 | 10.21.119.14=DC3:RAC2 33 | 10.20.114.15=DC2:RAC2 34 | 35 | 127.0.0.1=DC1:RAC1 36 | 127.0.0.2=DC1:RAC2 37 | 127.0.0.3=DC1:RAC3 38 | 127.0.0.4=DC2:RAC4 39 | 127.0.0.5=DC2:RAC5 40 | 127.0.0.6=DC3:RAC6 41 | 127.0.0.7=DC3:RAC7 42 | 127.0.0.8=DC3:RAC8 43 | 44 | # default for unknown nodes 45 | default=DC1:r1 46 | -------------------------------------------------------------------------------- /test/conf/cassandra.yaml: -------------------------------------------------------------------------------- 1 | # 2 | # Warning! 3 | # Consider the effects on 'o.a.c.i.s.LegacySSTableTest' before changing schemas in this file. 4 | # 5 | cluster_name: Test Cluster 6 | in_memory_compaction_limit_in_mb: 1 7 | commitlog_sync: batch 8 | commitlog_sync_batch_window_in_ms: 1.0 9 | partitioner: org.apache.cassandra.dht.CollatingOrderPreservingPartitioner 10 | rpc_timeout_in_ms: 5000 11 | listen_address: 127.0.0.1 12 | storage_port: 7010 13 | rpc_port: 9170 14 | column_index_size_in_kb: 4 15 | commitlog_directory: build/test/cassandra/commitlog 16 | saved_caches_directory: build/test/cassandra/saved_caches 17 | data_file_directories: 18 | - build/test/cassandra/data 19 | disk_access_mode: mmap 20 | seed_provider: 21 | - class_name: org.apache.cassandra.locator.SimpleSeedProvider 22 | parameters: 23 | - seeds: "127.0.0.1" 24 | endpoint_snitch: org.apache.cassandra.locator.SimpleSnitch 25 | dynamic_snitch: true 26 | request_scheduler: org.apache.cassandra.scheduler.RoundRobinScheduler 27 | request_scheduler_id: keyspace 28 | encryption_options: 29 | internode_encryption: none 30 | keystore: conf/.keystore 31 | keystore_password: cassandra 32 | truststore: conf/.truststore 33 | truststore_password: cassandra 34 | incremental_backups: true 35 | flush_largest_memtables_at: 1.0 36 | -------------------------------------------------------------------------------- /test/conf/datacenters.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. 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 | # The sum of all the datacenter replication factor values should equal 18 | # the replication factor of the keyspace (i.e. sum(dc_rf) = RF) 19 | 20 | # keyspace\:datacenter=replication factor 21 | Keyspace1\:DC1=3 22 | Keyspace1\:DC2=2 23 | Keyspace1\:DC3=1 24 | Keyspace3\:DC1=3 25 | Keyspace3\:DC2=1 26 | Keyspace3\:DC3=1 -------------------------------------------------------------------------------- /test/data/corrupt-sstables/Keyspace1-Super5-f-2-Data.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/corrupt-sstables/Keyspace1-Super5-f-2-Data.db -------------------------------------------------------------------------------- /test/data/corrupt-sstables/Keyspace1-Super5-f-2-Filter.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/corrupt-sstables/Keyspace1-Super5-f-2-Filter.db -------------------------------------------------------------------------------- /test/data/corrupt-sstables/Keyspace1-Super5-f-2-Index.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/corrupt-sstables/Keyspace1-Super5-f-2-Index.db -------------------------------------------------------------------------------- /test/data/corrupt-sstables/Keyspace1-Super5-f-2-Statistics.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/corrupt-sstables/Keyspace1-Super5-f-2-Statistics.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/b/Keyspace1/Keyspace1-Standard1-b-0-Data.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/b/Keyspace1/Keyspace1-Standard1-b-0-Data.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/b/Keyspace1/Keyspace1-Standard1-b-0-Filter.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/b/Keyspace1/Keyspace1-Standard1-b-0-Filter.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/b/Keyspace1/Keyspace1-Standard1-b-0-Index.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/b/Keyspace1/Keyspace1-Standard1-b-0-Index.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/e/Keyspace1/Keyspace1-Standard1-e-0-Data.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/e/Keyspace1/Keyspace1-Standard1-e-0-Data.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/e/Keyspace1/Keyspace1-Standard1-e-0-Filter.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/e/Keyspace1/Keyspace1-Standard1-e-0-Filter.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/e/Keyspace1/Keyspace1-Standard1-e-0-Index.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/e/Keyspace1/Keyspace1-Standard1-e-0-Index.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/e/Keyspace1/Keyspace1-Standard1-e-0-Statistics.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/e/Keyspace1/Keyspace1-Standard1-e-0-Statistics.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1-hb-1-Data.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1-hb-1-Data.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1-hb-1-Digest.sha1: -------------------------------------------------------------------------------- 1 | 095dd05150d499846782cdf1c77544048477cc9b Indexed1-hb-1-Data.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1-hb-1-Filter.db: -------------------------------------------------------------------------------- 1 | 2 | @@T -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1-hb-1-Index.db: -------------------------------------------------------------------------------- 1 | k1 -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1-hb-1-Statistics.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1-hb-1-Statistics.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1.626972746864617465-hb-1-Data.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1.626972746864617465-hb-1-Data.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1.626972746864617465-hb-1-Digest.sha1: -------------------------------------------------------------------------------- 1 | a6a32d25ca3cdf76ac5a1a6bffa78936463f9648 Indexed1.626972746864617465-hb-1-Data.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1.626972746864617465-hb-1-Filter.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1.626972746864617465-hb-1-Filter.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1.626972746864617465-hb-1-Index.db: -------------------------------------------------------------------------------- 1 |  -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1.626972746864617465-hb-1-Statistics.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Indexed1.626972746864617465-hb-1-Statistics.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Standard1-hb-0-Data.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Standard1-hb-0-Data.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Standard1-hb-0-Digest.sha1: -------------------------------------------------------------------------------- 1 | 72295cc1b64e6ffdb67a39dec9996c4ff0363cce Standard1-hb-0-Data.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Standard1-hb-0-Filter.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Standard1-hb-0-Filter.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Standard1-hb-0-Index.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Standard1-hb-0-Index.db -------------------------------------------------------------------------------- /test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Standard1-hb-0-Statistics.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/legacy-sstables/hb/Keyspace1/Keyspace1-Standard1-hb-0-Statistics.db -------------------------------------------------------------------------------- /test/data/serialization/0.7/db.RangeSliceCommand.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/db.RangeSliceCommand.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/db.Row.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/db.Row.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/db.RowMutation.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/db.RowMutation.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/db.SliceByNamesReadCommand.bin: -------------------------------------------------------------------------------- 1 |  Keyspace1Key01 Standard1AAABBBCCC Keyspace1Key01Super1SCNameAAABBBCCC Keyspace1Key01 Standard1AAABBBCCC Keyspace1Key01Super1SCNameAAABBBCCC6 Keyspace1Key01 Standard1AAABBBCCC9 Keyspace1Key01Super1SCNameAAABBBCCC -------------------------------------------------------------------------------- /test/data/serialization/0.7/db.SliceFromReadCommand.bin: -------------------------------------------------------------------------------- 1 |  Keyspace1Key01 Standard1StartStopd Keyspace1Key01Super1SCNameStartStopd Keyspace1Key01 Standard1StartStopd Keyspace1Key01Super1SCNameStartStopd5 Keyspace1Key01 Standard1StartStopd8 Keyspace1Key01Super1SCNameStartStopd -------------------------------------------------------------------------------- /test/data/serialization/0.7/db.Truncation.bin: -------------------------------------------------------------------------------- 1 | Keyspace1Doesn't Really Matter Keyspace1Doesn't Matter Either Keyspace1Still Doesn't Matter" Keyspace1Doesn't Really Matter# Keyspace1Doesn't Matter Either" Keyspace1Still Doesn't Matter -------------------------------------------------------------------------------- /test/data/serialization/0.7/db.WriteResponse.bin: -------------------------------------------------------------------------------- 1 | Keyspace1Key01 Keyspace1Key01 -------------------------------------------------------------------------------- /test/data/serialization/0.7/db.migration.Keyspace1.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/db.migration.Keyspace1.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/db.migration.Keyspace2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/db.migration.Keyspace2.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/db.migration.Keyspace5.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/db.migration.Keyspace5.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/gms.EndpointState.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/gms.EndpointState.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/gms.Gossip.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/gms.Gossip.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/service.TreeRequest.bin: -------------------------------------------------------------------------------- 1 | sessionId Keyspace1 Standard1 & sessionId Keyspace1 Standard1 -------------------------------------------------------------------------------- /test/data/serialization/0.7/service.TreeResponse.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/service.TreeResponse.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/streaming.PendingFile.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/streaming.PendingFile.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/streaming.StreamHeader.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/streaming.StreamHeader.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/streaming.StreamReply.bin: -------------------------------------------------------------------------------- 1 | {this is a file{this is a file -------------------------------------------------------------------------------- /test/data/serialization/0.7/streaming.StreamRequestMessage.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/streaming.StreamRequestMessage.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/utils.BloomFilter.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/utils.BloomFilter.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/utils.EstimatedHistogram.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/utils.EstimatedHistogram.bin -------------------------------------------------------------------------------- /test/data/serialization/0.7/utils.LegacyBloomFilter.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wlloyd/eiger/88c1d164813badd9803da8229c762f51c1ae3164/test/data/serialization/0.7/utils.LegacyBloomFilter.bin -------------------------------------------------------------------------------- /test/resources/CounterCF.json: -------------------------------------------------------------------------------- 1 | { 2 | "726f7741": [["636f6c4141", "000100008c619170467411e00000fe8ebeead9ee0000000000000001000000000000002a", 1294532915068, "c", 0]] 3 | } 4 | -------------------------------------------------------------------------------- /test/resources/SimpleCF.json: -------------------------------------------------------------------------------- 1 | { 2 | "726f7741": [["636f6c4141", "76616c4141", 1294532915068], ["636f6c4142", "76616c4142", 1294532915069], ["636f6c4143", "76616c4143", 1294532915071, "e", 42, 2000000000]], 3 | "726f7742": [["636f6c4241", "76616c4241", 1294532915070], ["636f6c4242", "76616c4242", 1294532915073]] 4 | } 5 | -------------------------------------------------------------------------------- /test/resources/SimpleCF.oldformat.json: -------------------------------------------------------------------------------- 1 | { 2 | "726f7741": [["636f6c4141", "76616c4141", 1294532915068, false], ["636f6c4142", "76616c4142", 1294532915069, false], ["636f6c4143", "76616c4143", 1294532915071, false, 42, 2000000000 ]], 3 | "726f7742": [["636f6c4241", "76616c4241", 1294532915070, false], ["636f6c4242", "76616c4242", 1294532915073, false]] 4 | } 5 | -------------------------------------------------------------------------------- /test/resources/SuperCF.json: -------------------------------------------------------------------------------- 1 | { 2 | "726f7741": {"737570657241": {"deletedAt": -9223372036854775808, "subColumns": [["636f6c4141", "76616c75654141", 1294532915069], ["636f6c4142", "76616c75654142", 1294532915069]]}}, 3 | "726f7742": {"737570657242": {"deletedAt": -9223372036854775808, "subColumns": [["636f6c4241", "76616c75654241", 1294532915069], ["636f6c4242", "76616c75654242", 1294532915069]]}} 4 | } 5 | -------------------------------------------------------------------------------- /test/resources/UnsortedSuperCF.json: -------------------------------------------------------------------------------- 1 | { 2 | "303935": { "5330": {"deletedAt": -9223372036854775808, "subColumns": [["4330", "366338333439636337323630", 1294656637116, false], ["4331", "366338333439636337323630", 1294656637116, false], ["4332", "366338333439636337323630", 1294656637116, false], ["4333", "366338333439636337323630", 1294656637116, false], ["4334", "366338333439636337323630", 1294656637116, false]]}} , 3 | "303630": { "5330": {"deletedAt": -9223372036854775808, "subColumns": [["4330", "643364393434363830326134", 1294656636902, false], ["4331", "643364393434363830326134", 1294656636902, false], ["4332", "643364393434363830326134", 1294656636902, false], ["4333", "643364393434363830326134", 1294656636902, false], ["4334", "643364393434363830326134", 1294656636902, false]]}} , 4 | "303638": { "5330": {"deletedAt": -9223372036854775808, "subColumns": [["4330", "366634393232663435353638", 1294656636885, false], ["4331", "366634393232663435353638", 1294656636885, false], ["4332", "366634393232663435353638", 1294656636885, false], ["4333", "366634393232663435353638", 1294656636885, false], ["4334", "366634393232663435353638", 1294656636885, false]]}} 5 | } 6 | -------------------------------------------------------------------------------- /test/resources/functions/nodetool_cassandra.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. 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 | function nodetool_cassandra() { 19 | set -x 20 | set -e 21 | 22 | . /etc/profile 23 | 24 | sudo nodetool -h localhost $* 25 | exit $? 26 | } 27 | -------------------------------------------------------------------------------- /test/resources/functions/start_cassandra.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. 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 | function start_cassandra() { 19 | set -x 20 | set -e 21 | 22 | . /etc/profile 23 | 24 | # launch using the script created by install 25 | sudo nohup /etc/rc.local & 26 | sleep 5 27 | } 28 | -------------------------------------------------------------------------------- /test/resources/functions/stop_cassandra.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. 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 | function stop_cassandra() { 19 | set -x 20 | set -e 21 | 22 | . /etc/profile 23 | 24 | # assume we are the only java process 25 | # FIXME: unsafe assumption, but easier than true init 26 | sudo killall java 27 | exit $? 28 | } 29 | -------------------------------------------------------------------------------- /test/resources/functions/wipe_cassandra.sh: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. 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 | function wipe_cassandra() { 19 | set -x 20 | set -e 21 | 22 | . /etc/profile 23 | 24 | DD=/var/lib/cassandra 25 | sudo rm -Rf $DD/data $DD/commitlog $DD/saved_caches 26 | exit $? 27 | } 28 | -------------------------------------------------------------------------------- /test/resources/whirr-default.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one 3 | # or more contributor license agreements. See the NOTICE file 4 | # distributed with this work for additional information 5 | # regarding copyright ownership. The ASF licenses this file 6 | # to you under the Apache License, Version 2.0 (the 7 | # "License"); you may not use this file except in compliance 8 | # with the License. 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 | whirr.service-name=cassandra 19 | whirr.cluster-name=cassandra_test 20 | whirr.cluster-user=app 21 | whirr.instance-templates=4 cassandra 22 | whirr.version=0.4.0-incubating 23 | -------------------------------------------------------------------------------- /test/unit/org/apache/cassandra/db/marshal/BytesTypeTest.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | * 19 | */ 20 | package org.apache.cassandra.db.marshal; 21 | 22 | import org.junit.Test; 23 | 24 | public class BytesTypeTest 25 | { 26 | private static final String INVALID_HEX = "33AG45F"; // Invalid (has a G) 27 | private static final String VALID_HEX = "33A45F"; 28 | 29 | @Test (expected = MarshalException.class) 30 | public void testFromStringWithInvalidString() 31 | { 32 | BytesType.instance.fromString(INVALID_HEX); 33 | } 34 | 35 | @Test 36 | public void testFromStringWithValidString() 37 | { 38 | BytesType.instance.fromString(VALID_HEX); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /test/unit/org/apache/cassandra/dht/ByteOrderedPartitionerTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.cassandra.dht; 20 | 21 | import org.junit.Test; 22 | 23 | import org.apache.cassandra.utils.FBUtilities; 24 | 25 | public class ByteOrderedPartitionerTest extends PartitionerTestCase 26 | { 27 | public void initPartitioner() 28 | { 29 | partitioner = new ByteOrderedPartitioner(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /test/unit/org/apache/cassandra/dht/RandomPartitionerTest.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.dht; 2 | /* 3 | * 4 | * Licensed to the Apache Software Foundation (ASF) under one 5 | * or more contributor license agreements. See the NOTICE file 6 | * distributed with this work for additional information 7 | * regarding copyright ownership. The ASF licenses this file 8 | * to you under the Apache License, Version 2.0 (the 9 | * "License"); you may not use this file except in compliance 10 | * with the License. You may obtain a copy of the License at 11 | * 12 | * http://www.apache.org/licenses/LICENSE-2.0 13 | * 14 | * Unless required by applicable law or agreed to in writing, 15 | * software distributed under the License is distributed on an 16 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 17 | * KIND, either express or implied. See the License for the 18 | * specific language governing permissions and limitations 19 | * under the License. 20 | * 21 | */ 22 | 23 | 24 | import static org.junit.Assert.assertEquals; 25 | 26 | import org.apache.cassandra.db.DecoratedKey; 27 | import org.junit.Test; 28 | 29 | public class RandomPartitionerTest extends PartitionerTestCase 30 | { 31 | public void initPartitioner() 32 | { 33 | partitioner = new RandomPartitioner(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test/unit/org/apache/cassandra/service/InitClientTest.java: -------------------------------------------------------------------------------- 1 | package org.apache.cassandra.service; 2 | 3 | import org.junit.Test; 4 | 5 | import java.io.IOException; 6 | 7 | import org.apache.cassandra.config.ConfigurationException; 8 | 9 | /** 10 | * Licensed to the Apache Software Foundation (ASF) under one 11 | * or more contributor license agreements. See the NOTICE file 12 | * distributed with this work for additional information 13 | * regarding copyright ownership. The ASF licenses this file 14 | * to you under the Apache License, Version 2.0 (the 15 | * "License"); you may not use this file except in compliance 16 | * with the License. You may obtain a copy of the License at 17 | * 18 | * http://www.apache.org/licenses/LICENSE-2.0 19 | * 20 | * Unless required by applicable law or agreed to in writing, software 21 | * distributed under the License is distributed on an "AS IS" BASIS, 22 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 23 | * See the License for the specific language governing permissions and 24 | * limitations under the License. 25 | */ 26 | 27 | 28 | public class InitClientTest // extends CleanupHelper 29 | { 30 | @Test 31 | public void testInitClientStartup() throws IOException, ConfigurationException 32 | { 33 | StorageService.instance.initClient(0); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /test/unit/org/apache/cassandra/service/StorageServiceAccessor.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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 | 19 | package org.apache.cassandra.service; 20 | 21 | import org.apache.cassandra.locator.TokenMetadata; 22 | 23 | public class StorageServiceAccessor 24 | { 25 | public static TokenMetadata setTokenMetadata(TokenMetadata tmd) 26 | { 27 | return StorageService.instance.setTokenMetadataUnsafe(tmd); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /test/unit/org/apache/cassandra/utils/ResetableIterator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one 3 | * or more contributor license agreements. See the NOTICE file 4 | * distributed with this work for additional information 5 | * regarding copyright ownership. The ASF licenses this file 6 | * to you under the Apache License, Version 2.0 (the 7 | * "License"); you may not use this file except in compliance 8 | * with the License. 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, 13 | * software distributed under the License is distributed on an 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 | * KIND, either express or implied. See the License for the 16 | * specific language governing permissions and limitations 17 | * under the License. 18 | */ 19 | package org.apache.cassandra.utils; 20 | 21 | import java.util.Iterator; 22 | 23 | public interface ResetableIterator extends Iterator { 24 | public void reset(); 25 | 26 | int size(); 27 | } 28 | -------------------------------------------------------------------------------- /tools/stress/test.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -u 4 | 5 | op=insert 6 | #op=read 7 | 8 | #for col_and_size in 1:1 10:1 100:1 1000:1; do 9 | for col_and_size in 1:1 10:1 100:1 1000:1 1:100 10:100 100:100 1000:100 1:1000 10:1000 100:1000 1:10000; do 10 | 11 | columns=$(echo $col_and_size | awk -F":" '{ print $1 }') 12 | size=$(echo $col_and_size | awk -F":" '{ print $2 }') 13 | tot_size=$((columns * size)) 14 | 15 | num_keys=2000000 16 | if [[ $tot_size -gt 9999 ]]; then 17 | num_keys=200000 18 | fi 19 | if [[ $tot_size -gt 99999 ]]; then 20 | num_keys=20000 21 | fi 22 | 23 | set -x 24 | bin/stress --num-different-keys=1000 --columns=$columns --column-size=$size -d node5.princeton.vicci.org --num-keys=$num_keys -o $op 25 | set +x 26 | done -------------------------------------------------------------------------------- /uuid_token.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import sys 4 | 5 | #From http://wiki.apache.org/cassandra/ByteOrderedPartitioner 6 | #modified to include dc_index to keep tokens unique 7 | 8 | def get_cassandra_tokens_uuid4_keys_bop(node_count, dc_index): 9 | # BOP expects tokens to be byte arrays, specified in hex 10 | return ["%032x" % (i*(2**128)/node_count + dc_index) for i in xrange(0, node_count)] 11 | 12 | if len(sys.argv) != 4: 13 | print "Usage: " + sys.argv[0] + " [dc index] [node index] [nodes/dc]" 14 | sys.exit(-1) 15 | 16 | dc_index = int(sys.argv[1]) 17 | node_index = int(sys.argv[2]) 18 | nodes_per_dc = int(sys.argv[3]) 19 | 20 | print get_cassandra_tokens_uuid4_keys_bop(nodes_per_dc, dc_index)[node_index] 21 | -------------------------------------------------------------------------------- /vicci_cassandra_cleaner.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Kills cassandra on all nodes mentioned in the dcl_config_file 4 | # 5 | 6 | set -u 7 | 8 | if [ $# -ne 1 ]; then 9 | echo "Usage: "$0" [vicci_dcl_config_file]" 10 | exit 11 | fi 12 | 13 | dcl_config=$1 14 | 15 | num_dcs=$(grep num_dcs $dcl_config | awk -F "=" '{ print $2 }') 16 | ips=($(grep cassandra_ips $dcl_config | awk -F "=" '{ print $2 }')) 17 | ips=($(echo "echo ${ips[@]}" | bash)) 18 | for ip in ${ips[@]}; do 19 | ssh -t -t -o StrictHostKeyChecking=no $ip "\ 20 | rm ~/cassandra_var/cassandra_system.*.log.*;\ 21 | rm -rf ~/cassandra_var/data/* 2> /dev/null;\ 22 | rm -rf ~/cassandra_var/commitlog/* 2> /dev/null;\ 23 | rm -rf ~/cassandra_var/saved_caches/* 2> /dev/null;\ 24 | rm -rf ~/cassandra_var/stdout/* 2> /dev/null;\ 25 | rm ~/cops2/*hprof;\ 26 | rm ~/cassandra-vanilla/*hprof;\ 27 | " 28 | done -------------------------------------------------------------------------------- /vicci_cassandra_killer.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Kills cassandra on all nodes mentioned in the dcl_config_file 4 | # 5 | 6 | set -u 7 | 8 | if [ $# -ne 1 ]; then 9 | echo "Usage: "$0" [vicci_dcl_config_file]" 10 | exit 11 | fi 12 | 13 | dcl_config=$1 14 | 15 | num_dcs=$(grep num_dcs $dcl_config | awk -F "=" '{ print $2 }') 16 | ips=($(grep cassandra_ips $dcl_config | awk -F "=" '{ print $2 }')) 17 | ips=($(echo "echo ${ips[@]}" | bash)) 18 | 19 | #kill in parallel 20 | set -m #need monitor mode to fg processes 21 | for ip in ${ips[@]}; do 22 | ssh -t -t -o StrictHostKeyChecking=no princeton_cops@$ip "/home/princeton_cops/cops2/kill_all_cassandra.bash" & 23 | done 24 | 25 | for ip in ${ips[@]}; do 26 | fg 27 | done -------------------------------------------------------------------------------- /vicci_dcl_config/16_clients_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node36.princeton.vicci.org 3 | cassandra_ips=node37.princeton.vicci.org 4 | cassandra_ips=node38.princeton.vicci.org 5 | cassandra_ips=node39.princeton.vicci.org 6 | 7 | cassandra_ips=node42.princeton.vicci.org 8 | cassandra_ips=node63.princeton.vicci.org 9 | cassandra_ips=node64.princeton.vicci.org 10 | cassandra_ips=node65.princeton.vicci.org 11 | 12 | cassandra_ips=node52.princeton.vicci.org 13 | cassandra_ips=node53.princeton.vicci.org 14 | cassandra_ips=node54.princeton.vicci.org 15 | cassandra_ips=node56.princeton.vicci.org 16 | 17 | cassandra_ips=node57.princeton.vicci.org 18 | cassandra_ips=node58.princeton.vicci.org 19 | cassandra_ips=node59.princeton.vicci.org 20 | cassandra_ips=node60.princeton.vicci.org 21 | 22 | 23 | -------------------------------------------------------------------------------- /vicci_dcl_config/16_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node3.princeton.vicci.org 3 | cassandra_ips=node5.princeton.vicci.org 4 | cassandra_ips=node6.princeton.vicci.org 5 | cassandra_ips=node7.princeton.vicci.org 6 | cassandra_ips=node8.princeton.vicci.org 7 | cassandra_ips=node9.princeton.vicci.org 8 | cassandra_ips=node10.princeton.vicci.org 9 | cassandra_ips=node12.princeton.vicci.org 10 | cassandra_ips=node13.princeton.vicci.org 11 | cassandra_ips=node14.princeton.vicci.org 12 | cassandra_ips=node15.princeton.vicci.org 13 | cassandra_ips=node16.princeton.vicci.org 14 | cassandra_ips=node17.princeton.vicci.org 15 | cassandra_ips=node18.princeton.vicci.org 16 | cassandra_ips=node19.princeton.vicci.org 17 | cassandra_ips=node20.princeton.vicci.org 18 | 19 | -------------------------------------------------------------------------------- /vicci_dcl_config/16_stanford_and_uw_clients_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node52.stanford.vicci.org 3 | cassandra_ips=node53.stanford.vicci.org 4 | cassandra_ips=node54.stanford.vicci.org 5 | cassandra_ips=node55.stanford.vicci.org 6 | 7 | cassandra_ips=node56.stanford.vicci.org 8 | cassandra_ips=node57.stanford.vicci.org 9 | cassandra_ips=node58.stanford.vicci.org 10 | cassandra_ips=node59.stanford.vicci.org 11 | 12 | cassandra_ips=node51.washington.vicci.org 13 | cassandra_ips=node52.washington.vicci.org 14 | cassandra_ips=node54.washington.vicci.org 15 | cassandra_ips=node55.washington.vicci.org 16 | 17 | cassandra_ips=node56.washington.vicci.org 18 | cassandra_ips=node57.washington.vicci.org 19 | cassandra_ips=node58.washington.vicci.org 20 | cassandra_ips=node59.washington.vicci.org 21 | -------------------------------------------------------------------------------- /vicci_dcl_config/16_stanford_and_uw_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node1.stanford.vicci.org 3 | cassandra_ips=node2.stanford.vicci.org 4 | cassandra_ips=node3.stanford.vicci.org 5 | cassandra_ips=node4.stanford.vicci.org 6 | 7 | cassandra_ips=node5.stanford.vicci.org 8 | cassandra_ips=node6.stanford.vicci.org 9 | cassandra_ips=node7.stanford.vicci.org 10 | cassandra_ips=node8.stanford.vicci.org 11 | 12 | cassandra_ips=node1.washington.vicci.org 13 | cassandra_ips=node2.washington.vicci.org 14 | cassandra_ips=node3.washington.vicci.org 15 | cassandra_ips=node5.washington.vicci.org 16 | 17 | cassandra_ips=node6.washington.vicci.org 18 | cassandra_ips=node9.washington.vicci.org 19 | cassandra_ips=node10.washington.vicci.org 20 | cassandra_ips=node11.washington.vicci.org 21 | -------------------------------------------------------------------------------- /vicci_dcl_config/16_stanford_clients_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node52.stanford.vicci.org 3 | cassandra_ips=node53.stanford.vicci.org 4 | cassandra_ips=node54.stanford.vicci.org 5 | cassandra_ips=node55.stanford.vicci.org 6 | 7 | cassandra_ips=node56.stanford.vicci.org 8 | cassandra_ips=node57.stanford.vicci.org 9 | cassandra_ips=node58.stanford.vicci.org 10 | cassandra_ips=node59.stanford.vicci.org 11 | 12 | cassandra_ips=node61.stanford.vicci.org 13 | cassandra_ips=node62.stanford.vicci.org 14 | cassandra_ips=node63.stanford.vicci.org 15 | cassandra_ips=node64.stanford.vicci.org 16 | 17 | cassandra_ips=node65.stanford.vicci.org 18 | cassandra_ips=node68.stanford.vicci.org 19 | cassandra_ips=node69.stanford.vicci.org 20 | cassandra_ips=node70.stanford.vicci.org 21 | -------------------------------------------------------------------------------- /vicci_dcl_config/16_stanford_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node1.stanford.vicci.org 3 | cassandra_ips=node2.stanford.vicci.org 4 | cassandra_ips=node3.stanford.vicci.org 5 | cassandra_ips=node4.stanford.vicci.org 6 | 7 | cassandra_ips=node5.stanford.vicci.org 8 | cassandra_ips=node6.stanford.vicci.org 9 | cassandra_ips=node7.stanford.vicci.org 10 | cassandra_ips=node8.stanford.vicci.org 11 | 12 | cassandra_ips=node9.stanford.vicci.org 13 | cassandra_ips=node10.stanford.vicci.org 14 | cassandra_ips=node11.stanford.vicci.org 15 | cassandra_ips=node12.stanford.vicci.org 16 | 17 | cassandra_ips=node13.stanford.vicci.org 18 | cassandra_ips=node15.stanford.vicci.org 19 | cassandra_ips=node16.stanford.vicci.org 20 | cassandra_ips=node18.stanford.vicci.org 21 | -------------------------------------------------------------------------------- /vicci_dcl_config/2_clients_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node59.princeton.vicci.org 3 | cassandra_ips=node60.princeton.vicci.org 4 | -------------------------------------------------------------------------------- /vicci_dcl_config/2_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node3.princeton.vicci.org 3 | cassandra_ips=node5.princeton.vicci.org 4 | -------------------------------------------------------------------------------- /vicci_dcl_config/2_stanford_clients_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node69.stanford.vicci.org 3 | cassandra_ips=node70.stanford.vicci.org 4 | -------------------------------------------------------------------------------- /vicci_dcl_config/2_stanford_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node1.stanford.vicci.org 3 | cassandra_ips=node2.stanford.vicci.org 4 | -------------------------------------------------------------------------------- /vicci_dcl_config/32_clients_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node38.princeton.vicci.org 3 | cassandra_ips=node39.princeton.vicci.org 4 | cassandra_ips=node40.princeton.vicci.org 5 | cassandra_ips=node41.princeton.vicci.org 6 | cassandra_ips=node42.princeton.vicci.org 7 | cassandra_ips=node43.princeton.vicci.org 8 | cassandra_ips=node44.princeton.vicci.org 9 | cassandra_ips=node45.princeton.vicci.org 10 | cassandra_ips=node46.princeton.vicci.org 11 | cassandra_ips=node47.princeton.vicci.org 12 | cassandra_ips=node48.princeton.vicci.org 13 | cassandra_ips=node49.princeton.vicci.org 14 | cassandra_ips=node50.princeton.vicci.org 15 | cassandra_ips=node51.princeton.vicci.org 16 | cassandra_ips=node52.princeton.vicci.org 17 | cassandra_ips=node53.princeton.vicci.org 18 | cassandra_ips=node54.princeton.vicci.org 19 | cassandra_ips=node55.princeton.vicci.org 20 | cassandra_ips=node56.princeton.vicci.org 21 | cassandra_ips=node57.princeton.vicci.org 22 | cassandra_ips=node58.princeton.vicci.org 23 | cassandra_ips=node59.princeton.vicci.org 24 | cassandra_ips=node60.princeton.vicci.org 25 | cassandra_ips=node61.princeton.vicci.org 26 | cassandra_ips=node63.princeton.vicci.org 27 | cassandra_ips=node64.princeton.vicci.org 28 | cassandra_ips=node65.princeton.vicci.org 29 | cassandra_ips=node66.princeton.vicci.org 30 | cassandra_ips=node67.princeton.vicci.org 31 | cassandra_ips=node68.princeton.vicci.org 32 | cassandra_ips=node69.princeton.vicci.org 33 | cassandra_ips=node70.princeton.vicci.org 34 | -------------------------------------------------------------------------------- /vicci_dcl_config/32_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node2.princeton.vicci.org 3 | cassandra_ips=node3.princeton.vicci.org 4 | cassandra_ips=node5.princeton.vicci.org 5 | cassandra_ips=node6.princeton.vicci.org 6 | cassandra_ips=node7.princeton.vicci.org 7 | cassandra_ips=node8.princeton.vicci.org 8 | cassandra_ips=node9.princeton.vicci.org 9 | cassandra_ips=node10.princeton.vicci.org 10 | cassandra_ips=node11.princeton.vicci.org 11 | cassandra_ips=node12.princeton.vicci.org 12 | cassandra_ips=node13.princeton.vicci.org 13 | cassandra_ips=node14.princeton.vicci.org 14 | cassandra_ips=node15.princeton.vicci.org 15 | cassandra_ips=node16.princeton.vicci.org 16 | cassandra_ips=node17.princeton.vicci.org 17 | cassandra_ips=node18.princeton.vicci.org 18 | cassandra_ips=node19.princeton.vicci.org 19 | cassandra_ips=node20.princeton.vicci.org 20 | cassandra_ips=node21.princeton.vicci.org 21 | cassandra_ips=node22.princeton.vicci.org 22 | cassandra_ips=node23.princeton.vicci.org 23 | cassandra_ips=node24.princeton.vicci.org 24 | cassandra_ips=node25.princeton.vicci.org 25 | cassandra_ips=node26.princeton.vicci.org 26 | cassandra_ips=node27.princeton.vicci.org 27 | cassandra_ips=node28.princeton.vicci.org 28 | cassandra_ips=node29.princeton.vicci.org 29 | cassandra_ips=node30.princeton.vicci.org 30 | cassandra_ips=node31.princeton.vicci.org 31 | cassandra_ips=node32.princeton.vicci.org 32 | cassandra_ips=node33.princeton.vicci.org 33 | cassandra_ips=node34.princeton.vicci.org 34 | -------------------------------------------------------------------------------- /vicci_dcl_config/32_stanford_and_uw_clients_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node52.stanford.vicci.org 3 | cassandra_ips=node53.stanford.vicci.org 4 | cassandra_ips=node54.stanford.vicci.org 5 | cassandra_ips=node55.stanford.vicci.org 6 | 7 | cassandra_ips=node56.stanford.vicci.org 8 | cassandra_ips=node57.stanford.vicci.org 9 | cassandra_ips=node58.stanford.vicci.org 10 | cassandra_ips=node49.stanford.vicci.org 11 | 12 | cassandra_ips=node61.stanford.vicci.org 13 | cassandra_ips=node62.stanford.vicci.org 14 | cassandra_ips=node50.stanford.vicci.org 15 | cassandra_ips=node51.stanford.vicci.org 16 | 17 | cassandra_ips=node65.stanford.vicci.org 18 | cassandra_ips=node68.stanford.vicci.org 19 | cassandra_ips=node69.stanford.vicci.org 20 | cassandra_ips=node70.stanford.vicci.org 21 | 22 | 23 | cassandra_ips=node53.washington.vicci.org 24 | cassandra_ips=node54.washington.vicci.org 25 | cassandra_ips=node55.washington.vicci.org 26 | cassandra_ips=node56.washington.vicci.org 27 | 28 | cassandra_ips=node57.washington.vicci.org 29 | cassandra_ips=node58.washington.vicci.org 30 | cassandra_ips=node59.washington.vicci.org 31 | cassandra_ips=node60.washington.vicci.org 32 | 33 | cassandra_ips=node61.washington.vicci.org 34 | cassandra_ips=node64.washington.vicci.org 35 | cassandra_ips=node65.washington.vicci.org 36 | cassandra_ips=node66.washington.vicci.org 37 | 38 | cassandra_ips=node67.washington.vicci.org 39 | cassandra_ips=node68.washington.vicci.org 40 | cassandra_ips=node69.washington.vicci.org 41 | cassandra_ips=node70.washington.vicci.org -------------------------------------------------------------------------------- /vicci_dcl_config/32_stanford_and_uw_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node1.stanford.vicci.org 3 | cassandra_ips=node2.stanford.vicci.org 4 | cassandra_ips=node3.stanford.vicci.org 5 | cassandra_ips=node4.stanford.vicci.org 6 | 7 | cassandra_ips=node5.stanford.vicci.org 8 | cassandra_ips=node6.stanford.vicci.org 9 | cassandra_ips=node7.stanford.vicci.org 10 | cassandra_ips=node8.stanford.vicci.org 11 | 12 | cassandra_ips=node9.stanford.vicci.org 13 | cassandra_ips=node10.stanford.vicci.org 14 | cassandra_ips=node11.stanford.vicci.org 15 | cassandra_ips=node12.stanford.vicci.org 16 | 17 | cassandra_ips=node13.stanford.vicci.org 18 | cassandra_ips=node15.stanford.vicci.org 19 | cassandra_ips=node16.stanford.vicci.org 20 | cassandra_ips=node18.stanford.vicci.org 21 | 22 | 23 | cassandra_ips=node1.washington.vicci.org 24 | cassandra_ips=node2.washington.vicci.org 25 | cassandra_ips=node3.washington.vicci.org 26 | cassandra_ips=node5.washington.vicci.org 27 | 28 | cassandra_ips=node6.washington.vicci.org 29 | cassandra_ips=node9.washington.vicci.org 30 | cassandra_ips=node10.washington.vicci.org 31 | cassandra_ips=node11.washington.vicci.org 32 | 33 | cassandra_ips=node12.washington.vicci.org 34 | cassandra_ips=node13.washington.vicci.org 35 | cassandra_ips=node15.washington.vicci.org 36 | cassandra_ips=node16.washington.vicci.org 37 | 38 | cassandra_ips=node17.washington.vicci.org 39 | cassandra_ips=node18.washington.vicci.org 40 | cassandra_ips=node19.washington.vicci.org 41 | cassandra_ips=node21.washington.vicci.org 42 | 43 | -------------------------------------------------------------------------------- /vicci_dcl_config/3node3DCs: -------------------------------------------------------------------------------- 1 | num_dcs=3 2 | cassandra_ips=node35.princeton.vicci.org 3 | cassandra_ips=node31.stanford.vicci.org 4 | cassandra_ips=node3.washington.vicci.org 5 | 6 | -------------------------------------------------------------------------------- /vicci_dcl_config/4_clients_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node57.princeton.vicci.org 3 | cassandra_ips=node58.princeton.vicci.org 4 | cassandra_ips=node59.princeton.vicci.org 5 | cassandra_ips=node60.princeton.vicci.org 6 | -------------------------------------------------------------------------------- /vicci_dcl_config/4_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node3.princeton.vicci.org 3 | cassandra_ips=node5.princeton.vicci.org 4 | cassandra_ips=node6.princeton.vicci.org 5 | cassandra_ips=node7.princeton.vicci.org 6 | 7 | -------------------------------------------------------------------------------- /vicci_dcl_config/6node3DCs: -------------------------------------------------------------------------------- 1 | num_dcs=3 2 | cassandra_ips=node36.princeton.vicci.org 3 | cassandra_ips=node35.princeton.vicci.org 4 | cassandra_ips=node31.stanford.vicci.org 5 | cassandra_ips=node30.stanford.vicci.org 6 | cassandra_ips=node3.washington.vicci.org 7 | cassandra_ips=node2.washington.vicci.org 8 | 9 | -------------------------------------------------------------------------------- /vicci_dcl_config/7_8_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node7.princeton.vicci.org 3 | cassandra_ips=node8.princeton.vicci.org 4 | -------------------------------------------------------------------------------- /vicci_dcl_config/8_clients_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node52.princeton.vicci.org 3 | cassandra_ips=node53.princeton.vicci.org 4 | cassandra_ips=node54.princeton.vicci.org 5 | cassandra_ips=node42.princeton.vicci.org 6 | 7 | cassandra_ips=node57.princeton.vicci.org 8 | cassandra_ips=node58.princeton.vicci.org 9 | cassandra_ips=node59.princeton.vicci.org 10 | cassandra_ips=node60.princeton.vicci.org 11 | -------------------------------------------------------------------------------- /vicci_dcl_config/8_in_princeton: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node3.princeton.vicci.org 3 | cassandra_ips=node5.princeton.vicci.org 4 | cassandra_ips=node6.princeton.vicci.org 5 | cassandra_ips=node7.princeton.vicci.org 6 | cassandra_ips=node8.princeton.vicci.org 7 | cassandra_ips=node9.princeton.vicci.org 8 | cassandra_ips=node10.princeton.vicci.org 9 | cassandra_ips=node12.princeton.vicci.org 10 | 11 | -------------------------------------------------------------------------------- /vicci_dcl_config/kodiak_16: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=h0.ib0 3 | cassandra_ips=h1.ib0 4 | cassandra_ips=h2.ib0 5 | cassandra_ips=h3.ib0 6 | cassandra_ips=h4.ib0 7 | cassandra_ips=h5.ib0 8 | cassandra_ips=h6.ib0 9 | cassandra_ips=h7.ib0 10 | cassandra_ips=h8.ib0 11 | cassandra_ips=h9.ib0 12 | cassandra_ips=h10.ib0 13 | cassandra_ips=h11.ib0 14 | cassandra_ips=h12.ib0 15 | cassandra_ips=h13.ib0 16 | cassandra_ips=h14.ib0 17 | cassandra_ips=h15.ib0 18 | -------------------------------------------------------------------------------- /vicci_dcl_config/kodiak_16_clients: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=h16.ib0 3 | cassandra_ips=h17.ib0 4 | cassandra_ips=h18.ib0 5 | cassandra_ips=h19.ib0 6 | cassandra_ips=h20.ib0 7 | cassandra_ips=h21.ib0 8 | cassandra_ips=h22.ib0 9 | cassandra_ips=h23.ib0 10 | cassandra_ips=h24.ib0 11 | cassandra_ips=h25.ib0 12 | cassandra_ips=h26.ib0 13 | cassandra_ips=h27.ib0 14 | cassandra_ips=h28.ib0 15 | cassandra_ips=h29.ib0 16 | cassandra_ips=h30.ib0 17 | cassandra_ips=h31.ib0 18 | -------------------------------------------------------------------------------- /vicci_dcl_config/kodiak_2: -------------------------------------------------------------------------------- 1 | h109.ib0 2 | h22.ib0 3 | -------------------------------------------------------------------------------- /vicci_dcl_config/kodiak_2_clients: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=h2.ib0 3 | cassandra_ips=h3.ib0 4 | -------------------------------------------------------------------------------- /vicci_dcl_config/kodiak_32: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=h0.ib0 3 | cassandra_ips=h1.ib0 4 | cassandra_ips=h2.ib0 5 | cassandra_ips=h3.ib0 6 | cassandra_ips=h4.ib0 7 | cassandra_ips=h5.ib0 8 | cassandra_ips=h6.ib0 9 | cassandra_ips=h7.ib0 10 | cassandra_ips=h8.ib0 11 | cassandra_ips=h9.ib0 12 | cassandra_ips=h10.ib0 13 | cassandra_ips=h11.ib0 14 | cassandra_ips=h12.ib0 15 | cassandra_ips=h13.ib0 16 | cassandra_ips=h14.ib0 17 | cassandra_ips=h15.ib0 18 | cassandra_ips=h16.ib0 19 | cassandra_ips=h17.ib0 20 | cassandra_ips=h18.ib0 21 | cassandra_ips=h19.ib0 22 | cassandra_ips=h20.ib0 23 | cassandra_ips=h21.ib0 24 | cassandra_ips=h22.ib0 25 | cassandra_ips=h23.ib0 26 | cassandra_ips=h24.ib0 27 | cassandra_ips=h25.ib0 28 | cassandra_ips=h26.ib0 29 | cassandra_ips=h27.ib0 30 | cassandra_ips=h28.ib0 31 | cassandra_ips=h29.ib0 32 | cassandra_ips=h30.ib0 33 | cassandra_ips=h31.ib0 34 | -------------------------------------------------------------------------------- /vicci_dcl_config/kodiak_4: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=h0.ib0 3 | cassandra_ips=h1.ib0 4 | cassandra_ips=h2.ib0 5 | cassandra_ips=h3.ib0 6 | -------------------------------------------------------------------------------- /vicci_dcl_config/kodiak_4_clients: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=h4.ib0 3 | cassandra_ips=h5.ib0 4 | cassandra_ips=h6.ib0 5 | cassandra_ips=h7.ib0 6 | -------------------------------------------------------------------------------- /vicci_dcl_config/kodiak_8: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=h0.ib0 3 | cassandra_ips=h1.ib0 4 | cassandra_ips=h2.ib0 5 | cassandra_ips=h3.ib0 6 | cassandra_ips=h4.ib0 7 | cassandra_ips=h5.ib0 8 | cassandra_ips=h6.ib0 9 | cassandra_ips=h7.ib0 10 | -------------------------------------------------------------------------------- /vicci_dcl_config/kodiak_8_clients: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=h8.ib0 3 | cassandra_ips=h9.ib0 4 | cassandra_ips=h10.ib0 5 | cassandra_ips=h11.ib0 6 | cassandra_ips=h12.ib0 7 | cassandra_ips=h13.ib0 8 | cassandra_ips=h14.ib0 9 | cassandra_ips=h15.ib0 10 | -------------------------------------------------------------------------------- /vicci_dcl_config/make_kodiak_1switch_config.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #bad_nodes is egrep regex, e.g., "h68.ib0|h70.ib0" 4 | bad_nodes="h68.ib0|h551.ib0|h612.ib0" 5 | 6 | for n in 2 4 8 16 32 64 128 3 6 12 25 50 100 200; do 7 | echo "num_dcs=2" > kodiak_${n}A; 8 | cat /etc/hosts | grep "10.3.1" | sort -u | sort -n | awk '{ print "cassandra_ips="$2 }' | egrep -v $bad_nodes | head -n $n >> kodiak_${n}A 9 | done 10 | 11 | for n in 2 4 8 16 32 64 128 3 6 12 25 50 100 200; do 12 | echo "num_dcs=2" > kodiak_${n}A_clients; 13 | #NOTE: we want to make sure client0 is client0 in all size configurations (the output collection scripts expect this) 14 | # If we don't have this, we'll end up counting the same client multiple times for smaller configurations 15 | # thus the sed script 16 | cat /etc/hosts | grep "10.3.1" | sort -u | sort -n | awk '{ print "cassandra_ips="$2 }' | egrep -v $bad_nodes | tail -n $n | sed '1!G;h;$!d' >> kodiak_${n}A_clients 17 | done -------------------------------------------------------------------------------- /vicci_dcl_config/make_kodiak_cfg.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #run with: 4 | # for n in 2 4 8 16 32 64 128; do ./make_kodiak_cfg.bash $n; done 5 | 6 | set -u 7 | 8 | bad_node_list="h46 h47 h51" 9 | bad_node_list=${bad_node_list}" " #trailing space required 10 | 11 | if [ $# -ne 1 ]; then 12 | echo "$0: [total server count]" 13 | exit 14 | fi 15 | 16 | num_srvs=$1 17 | 18 | srv_file=kodiak_${num_srvs} 19 | cli_file=kodiak_${num_srvs}_clients 20 | 21 | echo "num_dcs=2" > $srv_file 22 | echo "num_dcs=2" > $cli_file 23 | 24 | h_index=-1 25 | for i in $(seq $num_srvs ); do 26 | ((h_index++)) 27 | while [ "$(echo "$bad_node_list" | grep h${h_index}'[[:space:]]')" != "" ]; do 28 | ((h_index++)) 29 | done 30 | 31 | echo "cassandra_ips=h"${h_index}".ib0" >> $srv_file 32 | done 33 | 34 | for i in $(seq $num_srvs); do 35 | ((h_index++)) 36 | while [ "$(echo "$bad_node_list" | grep h${h_index}'[[:space:]]')" != "" ]; do 37 | ((h_index++)) 38 | done 39 | 40 | echo "cassandra_ips=h"${h_index}".ib0" >> $cli_file 41 | done -------------------------------------------------------------------------------- /vicci_dcl_config/princeton_35_36: -------------------------------------------------------------------------------- 1 | num_dcs=2 2 | cassandra_ips=node35.princeton.vicci.org 3 | cassandra_ips=node36.princeton.vicci.org 4 | -------------------------------------------------------------------------------- /vicci_scripts/find_live_nodes.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -u 4 | 5 | echo -n "" > live_nodes 6 | failures="" 7 | for school in princeton washington stanford gt; do 8 | for i in $(seq 70); do 9 | host="node${i}.${school}.vicci.org" 10 | echo -n ${host}": " 11 | ping -c 1 -w 3 ${host} > /dev/null 2>&1 12 | ping_ret=$? 13 | if [[ ${ping_ret} -eq 0 ]]; then 14 | echo "success" 15 | echo ${host} >> live_nodes 16 | else 17 | echo "failed, ping return $ping_ret" 18 | failures=$(echo -e "${failures}\n${host}") 19 | fi 20 | done 21 | done 22 | 23 | echo -n "Failures:" 24 | echo "${failures}" -------------------------------------------------------------------------------- /vicci_scripts/install_java.bash: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ $# -ne 1 ]; then 4 | echo "Usage: $0 [hosts file]" 5 | exit 6 | fi 7 | 8 | host_file=$1 9 | num_hosts=$(cat $host_file | wc -l) 10 | timeout=60 11 | 12 | remote_path=/home/princeton_cops/ 13 | 14 | #pssh -h $host_file -p $num_hosts -t $timeout -o pssh_stdout \ 15 | # -e pssh_stderr "sudo yum install ant-* -y" 16 | 17 | for host in $(cat $host_file); do 18 | echo $host 19 | ssh -t -t -o StrictHostKeyChecking=no $host "sudo yum install java-1.6.0-openjdk -y" & 20 | #ssh -t -t -o StrictHostKeyChecking=no $host "mkdir ~/cassandra_var; mkdir ~/cassandra_var/data; mkdir ~/cassandra_var/commit-log; mkdir ~/cassandra_var/saved_caches" 21 | done -------------------------------------------------------------------------------- /vicci_scripts/princeton_1to20: -------------------------------------------------------------------------------- 1 | princeton_cops@node3.princeton.vicci.org 2 | princeton_cops@node4.princeton.vicci.org 3 | princeton_cops@node5.princeton.vicci.org 4 | princeton_cops@node6.princeton.vicci.org 5 | princeton_cops@node7.princeton.vicci.org 6 | princeton_cops@node8.princeton.vicci.org 7 | princeton_cops@node9.princeton.vicci.org 8 | princeton_cops@node10.princeton.vicci.org 9 | princeton_cops@node11.princeton.vicci.org 10 | princeton_cops@node12.princeton.vicci.org 11 | princeton_cops@node13.princeton.vicci.org 12 | princeton_cops@node14.princeton.vicci.org 13 | princeton_cops@node15.princeton.vicci.org 14 | princeton_cops@node16.princeton.vicci.org 15 | princeton_cops@node17.princeton.vicci.org 16 | princeton_cops@node18.princeton.vicci.org 17 | princeton_cops@node19.princeton.vicci.org 18 | princeton_cops@node20.princeton.vicci.org 19 | -------------------------------------------------------------------------------- /vicci_scripts/princeton_5and6: -------------------------------------------------------------------------------- 1 | princeton_cops@node5.princeton.vicci.org 2 | princeton_cops@node6.princeton.vicci.org 3 | -------------------------------------------------------------------------------- /vicci_scripts/stanford_69_70: -------------------------------------------------------------------------------- 1 | princeton_cops@node69.stanford.vicci.org 2 | princeton_cops@node70.stanford.vicci.org 3 | -------------------------------------------------------------------------------- /vicci_scripts/vicci_hosts_1to4_princeton: -------------------------------------------------------------------------------- 1 | princeton_cops@node2.princeton.vicci.org 2 | princeton_cops@node3.princeton.vicci.org 3 | princeton_cops@node4.princeton.vicci.org 4 | -------------------------------------------------------------------------------- /vicci_scripts/vicci_hosts_1to5: -------------------------------------------------------------------------------- 1 | princeton_cops@node2.princeton.vicci.org 2 | princeton_cops@node3.princeton.vicci.org 3 | princeton_cops@node4.princeton.vicci.org 4 | princeton_cops@node5.princeton.vicci.org 5 | princeton_cops@node1.washington.vicci.org 6 | princeton_cops@node2.washington.vicci.org 7 | princeton_cops@node3.washington.vicci.org 8 | princeton_cops@node4.washington.vicci.org 9 | princeton_cops@node5.washington.vicci.org 10 | princeton_cops@node1.stanford.vicci.org 11 | princeton_cops@node2.stanford.vicci.org 12 | princeton_cops@node3.stanford.vicci.org 13 | princeton_cops@node4.stanford.vicci.org 14 | princeton_cops@node5.stanford.vicci.org 15 | --------------------------------------------------------------------------------