Skip to content

Commit

Permalink
merge develop into perf cli branch (#820)
Browse files Browse the repository at this point in the history
* Nit: use single-element ImmutableSet for clarity

* SweepTaskRunnerImpl.getTimestampsToSweep: minor refactor

* 0.11.0 release notes edits

* Add ETE test for Atlas configured with no leader

* Remove wrong config value from ETE tests

* Refactor out on-demand loading and add tests for it. Clean-up files, convert/refactor tests to assertJ

* Switch error to warn since it isn't actually an error

* Rename SweepStrategySweeper to StrategySweeper

* Get rid of NOTHING shortcut (essentially the same atm)

* Make timestamp test work with all KVSes

* Add release notes

* Make test more consistent for DB KVS

* StrategySweeper -> Sweeper, new test to maker sure we don't call the kvs when there aren't any rows to sweep

* Get rid of Sweep at the beginning of two classes

* Log messages should use AtlasDB

* move to next release

* Fix weird compile error

* Remove bad optional.absent check

* Update circle.yml to include container-logs in artifacts

* Add split out logs for ETE tests

* 0.11.1 release note

* release notes for 0.11.2

* Add CassandraServerVersion with tests

* 0.11.3 release notes

* Update release-notes.rst

* Test for cassandra duplicate table creation bug

* Change the copyright header to use the regular one

* Passwords should not be output in generated toString() methods

Prevents an issue seen where a stack trace helpfully tries to print the
config but also prints the password to the log files.

Updated copyright of all modified classes to 2016.

* Bump version

* dont log loading a tracing prefs that isn't enabled

at some point we started shipping an example prefs file
that always gets loaded, so you get this 'error' message
at startup by default now.

* cleanup temp tables

Necessary for a corresponding internal change.
The general gist is open atlas never wanted this application-specific garbage anyways,
so I've mostly removed it here and made it so someone can just implement an interface.

Real reason for all of this is that we're moving to lazily initialized temp tables
because postgres' rubbish temp table creation speeds screw with Hikari pool resizing,
among other things.

* Switch to DockerComposeRule instead of DockerComposition

* Switch to DockerComposeRule instead of DockerComposition for TimelockServer

* Switch to DockerComposeRule instead of DockerComposition for EteSetup

* Switch to DockerComposeRule instead of DockerComposition for DbkvsTestSuite

* Adding diagnostics, as per Oracle Support

* Rename composeRule -> docker, per naming convention in DCR example code

* Add entry in ValueTypes table for UUID

A UUID is just two longs (a 16-byte value). We encode them as big-endian, so range scans are supported.

* Clean up explanation for VAR_LONG and VAR_SIGNED_LONG

* Reword introductory paragraph

* Update release notes for PR #755.

* Add advice for contributing code

* Add explanation about FIXED_LONG_LITTLE_ENDIAN

* Use footnotes because they're prettier

* Fix typos in contribution guidelines

* don't always log sql errors

especially ones that are expected errors / caller logic is set up to deal with the failure.

Fixes #709

* Add comment explaining the version

* Clean up tests

* Switch to shared static logger

* Adjust table widths so the footnotes don't spill over

* Add additional logging

* Unused imports

* ssl: false should override the presence of an SslConfiguration

We want to add a default SslConfiguration to our internal application.
However, users may have explicitly disabled Ssl for communication with
their Cassandra, which will be broken by the presence of the new block
overriding the `ssl()` param..

Despite being deprecated, the `ssl()` param should override the presence
of an ssl config, meaning that we can apply this without being a breaking
change.

* License

* Fix copy-paste error

* Upgrade checkstyle to 6.18

* Add .baseline files

* Remove a few of the checkstyle/findbugs. Change import order to match existing order. Change copyright notice to BSD-3. Auto-add copyright notice in IntelliJ

* Add baseline to the gradle files

* Enable checkstyle and findbugs report extraction in CircleCI

* CassandraTestSuite: Add a Classrule to ensure Cassandra images are created

* Switch from whitelisted projects to blacklisted projects

* Remove unused variable

* Clean up docker-compose

* CassandraSchemaLockTest: Automated test for detecting multiple table creation error

* Cleanup

* Add matchers to get better error messages

* Improve error messages

* Move the cassandra multinode test to a separate directory

* Revert copy-paste error

* Fix typo: SIGNED_VAR_LONG -> VAR_SIGNED_LONG

* Move checkstyle version into versions file, remove META-INF exclude, and add comment about why we have the findbugs excludes

* Ensure C* image is created before docker-compose

* Remove stray empty lines

* Prep and enable baseline for atlasdb-dropwizard-bundle

* Enable baseline for atlasdb-hikari

* Prep atlasdb-api for baseline

* Prep atlasdb-api tests for baseline

* Fix-up findbugs errors for atlasdb-api

* Enable baseline for atlasdb-api

* Run cassandra-multinode-tests in a separate container

* Create fromBoolean method in LockLeader enum

* Docs: cassandra_KVS_config should have more information on ssl and leader block.

* Improve the wording in docs

* Add release notes

* Upgrade to gradle 2.14.1 and jacoco to 0.7.7.201606060606. Fixes #767

* Revert "Test for cassandra duplicate table creation bug"

* Revert "Revert "Test for cassandra duplicate table creation bug""

* Add container logs directory

* Add .idea to .gitignore

* Move to package, blacklist

* Increase timeout

* Implement the timestamp dropwizard command

* Convert timestamp CLI dropwizard class into a generic one for all CLIs

* Fix checkstyle and similar

* Add temporary workaround for airlift/airline#51

* Convert leader blocks into TS/LOCK blocks

* Refactor configuration conversion and argument extraction out

* Add offline flag to CLIs

* Add offline support to console and propagate it through for CLIs

* Refector AtlasDbConfigs as part of #goldentime to play around with tell rather than ask code structure

* Update nullables and unused import

* Add missing copyright

* Revert "Update nullables and unused import"

This reverts commit 8ee3b4d.

* Revert "Refector AtlasDbConfigs as part of #goldentime to play around with tell rather than ask code structure"

This reverts commit 5248e3f.

* Parameterise TestTimestampCommand

* Further refactoring of timestamp command tests

* Implement some ETE dropwizard tests

* Refactor runCommand to take in a String

* Remove random generated files

* Add tests for AtlasDbCommandUtils

* Ignore dropwizard ETE tests until docker-compose-rule#95 is merged and a new version is tagged

* Added dropwizard bundle to release notes

* Clean-up some code, fix an EMPTY_NAMESPACE bug when serialising/deserialising

* Switch to docker run and re-enable tests

* Add @nullable to AtlasDbConfigs

* Set of minor modifications

* Set of minor modifications

* Annotate why we JsonIgnore onAcquireConnectionVisitor

* Add tests for AtlasDbCliCommand#getOptionTypesForCommandMetadata

* Refactor out addOptionToParser and add tests

* Refactor out serialisation command

* Fix-up checkstyle

* Move timestamp file clean up into method

* Add a new Leader configuration page

* Make timeout 2 minutes

* Fix checkstyle

* Use correct jacoco version

* Use assserThat from unit

* Refactor CassandraSchemaLockTest and cassandra yml

* Cleanup container logs

* Cleanup build.gradle

* Reduce timeout, extract CONTAINER_LOGS_DIRECTORY

* minor doc nits

* Prep atlasdb-dbkvs for baseline

* Prepare atlasdb-dbkvs for findbugs

* Enable baseline on atlasdb-dbkvs

* Remove @after method

* Increase timeout

* Remove dependencies on ete1 as this is causing hanging builds. Fixed in #793

* Newline for Ben

* Select the first leader according to alphabetical order to make sure lockCreator is deterministic.

* Add tests

* Fix CassandraConnectionTest by setting a valid quorumSize

* Add docs change

* Fix directory structure in atlasdb-impl-shared/src/test/java

* Add profiling KVS wrapper to default kvs startup, use same order as internal product

* Add necessary documentation for profiling kvs'

* Docs nit: add comma before "which"

* Add check to make sure it's possible to reach quorum

* Wait for DB start

* Prep atlasdb-impl-shared for baseline. Disable abbreviation checking in files with KV in their name.

* Prep atlasdb-impl-shared tests for baseline

* Get atlasdb-impl-shared and tests working with findbugs. Exclude DynamicPartitionMapImpl from synchronisation checks until later

* Enable baseline for atlasdb-impl-shared

* Code review fixes

* Rename atlasdb-server -> atlasdb-service, atlasdb-server-dropwizard -> atlasdb-service-server

* Add release notes

* Prep atlasdb-cassandra for baseline

* Fix-up some FindBugs for atlasdb-cassandra

* Enable baseline on atlasdb-cassandra

* Fix-up code review comments

* ignore eclipse generated stuff

* Reduce number of threads and timeout

* Expand title line and fix link to file

* Cleanup docs

* Docs changes

* Docs: Add link from Logging page to Enabling C* Tracing page.

* Docs: minor fixes, mostly capitalisation

* release notes edits for 0.12.0

* Rename link

* Check for unique key constraints when inserting tables into metadata

* Fix-up ETE dependencies so that we wait for the DB box to be created

* another atlas -> atlasdb

* Refactor DbkvsTestSuite so it runs more consistently locally

* Remove test that checks duplicate table names throws.

Cassandra doesn't throw, so we shouldn't really either

* fix index.rst pages

* edit breaking change note

* final 0.12.0 release notes nits

* Convert findbugs annotation version to a constant

* Prep atlasdb-config for baseline

* Enable baseline for atlasdb-config

* Move release notes to right version

* fix compile errors

* publish test artifacts

* add licenses

* fix checkstyle errors

* fixed errors from bad merge

* fix checkstyle rule failures caused by merge

* fix findbugs errors
  • Loading branch information
rjullman committed Sep 12, 2016
1 parent fe3eb06 commit 4792f4b
Show file tree
Hide file tree
Showing 71 changed files with 1,936 additions and 171 deletions.
3 changes: 3 additions & 0 deletions atlasdb-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ dependencies {
compile 'com.fasterxml.jackson.core:jackson-databind:' + libVersions.jackson
compile 'javax.validation:validation-api:1.1.0.Final'

<<<<<<< 7033b8fc57203bf309772ac48101c6126fb91d56
compile ('com.palantir.remoting:ssl-config:' + libVersions.http_remoting) {
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
}
=======
>>>>>>> merge develop into perf cli branch (#820)

testCompile(group: 'junit', name: 'junit', version: libVersions.junit) {
exclude group: 'org.hamcrest'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,11 @@ public File acceptorLogDir() {
@Size(min = 1)
public abstract Set<String> leaders();

<<<<<<< 7033b8fc57203bf309772ac48101c6126fb91d56:atlasdb-api/src/main/java/com/palantir/atlasdb/config/LeaderConfig.java
public abstract Optional<SslConfiguration> sslConfiguration();

=======
>>>>>>> merge develop into perf cli branch (#820):atlasdb-api/src/main/java/com/palantir/atlasdb/config/LeaderConfig.java
@JsonProperty("lockCreator")
@Value.Default
public String lockCreator() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ private enum ShouldThrow {
NO
}

<<<<<<< 7033b8fc57203bf309772ac48101c6126fb91d56
private final ShouldThrow shouldThrow;

AtlasDbConstraintCheckingMode(ShouldThrow shouldThrow) {
Expand All @@ -35,6 +36,16 @@ private enum ShouldThrow {

public boolean shouldThrowException() {
return shouldThrow == ShouldThrow.YES;
=======
private final ShouldThrow shouldThrowException;

AtlasDbConstraintCheckingMode(ShouldThrow shouldThrowException) {
this.shouldThrowException = shouldThrowException;
}

public boolean shouldThrowException() {
return shouldThrowException == ShouldThrow.YES;
>>>>>>> merge develop into perf cli branch (#820)
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,17 @@

import com.palantir.atlasdb.cassandra.CassandraKeyValueServiceConfigManager;
import com.palantir.atlasdb.keyvalue.api.KeyValueService;
<<<<<<< 7033b8fc57203bf309772ac48101c6126fb91d56:atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CQLKeyValueServiceTransactionIntegrationTest.java
import com.palantir.atlasdb.transaction.impl.AbstractTransactionTest;

public class CQLKeyValueServiceTransactionIntegrationTest extends AbstractTransactionTest {
=======
import com.palantir.atlasdb.sweep.AbstractSweeperTest;
>>>>>>> merge develop into perf cli branch (#820):atlasdb-cassandra-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceSweeperTest.java

@Override
protected KeyValueService getKeyValueService() {
<<<<<<< 7033b8fc57203bf309772ac48101c6126fb91d56:atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CQLKeyValueServiceTransactionIntegrationTest.java
return CQLKeyValueService.create(
CassandraKeyValueServiceConfigManager.createSimpleManager(CQLTestSuite.CQLKVS_CONFIG));
}
Expand All @@ -32,4 +37,9 @@ protected boolean supportsReverse() {
return false;
}

=======
return CassandraKeyValueService.create(
CassandraKeyValueServiceConfigManager.createSimpleManager(CassandraTestSuite.CASSANDRA_KVS_CONFIG), CassandraTestSuite.LEADER_CONFIG);
}
>>>>>>> merge develop into perf cli branch (#820):atlasdb-cassandra-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraKeyValueServiceSweeperTest.java
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
import com.google.common.collect.Range;
import com.palantir.atlasdb.AtlasDbConstants;
import com.palantir.atlasdb.cassandra.CassandraKeyValueServiceConfigManager;
<<<<<<< 7033b8fc57203bf309772ac48101c6126fb91d56:atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraClientPoolIntegrationTest.java
=======
import com.palantir.atlasdb.cassandra.ImmutableCassandraKeyValueServiceConfig;
>>>>>>> merge develop into perf cli branch (#820):atlasdb-cassandra-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraClientPoolTest.java
import com.palantir.atlasdb.keyvalue.cassandra.CassandraClientPool.LightweightOppToken;
import com.palantir.atlasdb.keyvalue.cassandra.CassandraClientPool.WeightedHosts;
import com.palantir.common.base.FunctionCheckedException;
Expand All @@ -52,7 +56,23 @@ public class CassandraClientPoolIntegrationTest {
@Before
public void setUp() {
kv = CassandraKeyValueService.create(
<<<<<<< 7033b8fc57203bf309772ac48101c6126fb91d56:atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraClientPoolIntegrationTest.java
CassandraKeyValueServiceConfigManager.createSimpleManager(CassandraTestSuite.CASSANDRA_KVS_CONFIG),
=======
CassandraKeyValueServiceConfigManager.createSimpleManager(
ImmutableCassandraKeyValueServiceConfig.builder()
.addServers(new InetSocketAddress("localhost", 9160))
.poolSize(20)
.keyspace("atlasdb")
.ssl(false)
.replicationFactor(1)
.mutationBatchCount(10000)
.mutationBatchSizeBytes(10000000)
.fetchBatchCount(1000)
.safetyDisabled(true)
.autoRefreshNodes(true)
.build()),
>>>>>>> merge develop into perf cli branch (#820):atlasdb-cassandra-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraClientPoolTest.java
CassandraTestSuite.LEADER_CONFIG);
kv.initializeFromFreshInstance();
kv.dropTable(AtlasDbConstants.TIMESTAMP_TABLE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@

@RunWith(Suite.class)
@SuiteClasses({
<<<<<<< 7033b8fc57203bf309772ac48101c6126fb91d56:atlasdb-cassandra-integration-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraTestSuite.java
CassandraKeyValueServiceTransactionIntegrationTest.class,
CassandraClientPoolIntegrationTest.class,
CassandraConnectionIntegrationTest.class,
Expand All @@ -53,6 +54,16 @@
CassandraKeyValueServiceIntegrationTest.class,
SchemaMutationLockIntegrationTest.class,
SchemaMutationLockTablesIntegrationTest.class,
=======
CassandraConnectionTest.class,
CassandraKeyValueServiceTableCreationTest.class,
CassandraKeyValueServiceSerializableTransactionTest.class,
CassandraKeyValueServiceSweeperTest.class,
CassandraTimestampTest.class,
CassandraKeyValueServiceTest.class,
SchemaMutationLockTest.class,
SchemaMutationLockTablesTest.class,
>>>>>>> merge develop into perf cli branch (#820):atlasdb-cassandra-tests/src/test/java/com/palantir/atlasdb/keyvalue/cassandra/CassandraTestSuite.java
})
public class CassandraTestSuite {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/**
* Copyright 2016 Palantir Technologies
*
* Licensed under the BSD-3 License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.palantir.atlasdb.keyvalue.cassandra;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.core.Is.is;

import org.junit.Test;

public class CassandraApiVersionTest {
@Test public void
version_19_36_0_does_not_support_cas() {
CassandraApiVersion version = new CassandraApiVersion("19.36.0");
assertThat(version.supportsCheckAndSet(), is(false));
}

@Test public void
version_19_37_0_supports_cas() {
CassandraApiVersion version = new CassandraApiVersion("19.37.0");
assertThat(version.supportsCheckAndSet(), is(true));
}

@Test public void
version_19_38_0_supports_cas() {
CassandraApiVersion version = new CassandraApiVersion("19.38.0");
assertThat(version.supportsCheckAndSet(), is(true));
}

@Test public void
version_20_1_0_supports_cas() {
CassandraApiVersion version = new CassandraApiVersion("20.1.0");
assertThat(version.supportsCheckAndSet(), is(true));
}

@Test public void
version_18_40_0_does_not_support_cas() {
CassandraApiVersion version = new CassandraApiVersion("18.40.0");
assertThat(version.supportsCheckAndSet(), is(false));
}

@Test public void
version_20_40_1_supports_cas() {
CassandraApiVersion version = new CassandraApiVersion("20.40.1");
assertThat(version.supportsCheckAndSet(), is(true));
}

@Test(expected=UnsupportedOperationException.class) public void
invalid_version_strings_throw_an_error() {
new CassandraApiVersion("20_4.1");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/**
* Copyright 2015 Palantir Technologies
*
* Licensed under the BSD-3 License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.palantir.atlasdb.keyvalue.cassandra;

import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;

import java.net.InetSocketAddress;
import java.nio.file.Paths;

import org.junit.Test;

import com.palantir.atlasdb.cassandra.ImmutableCassandraKeyValueServiceConfig;
import com.palantir.remoting.ssl.SslConfiguration;

public class CassandraKeyValueServiceConfigTest {
private static final InetSocketAddress SERVER_ADDRESS = InetSocketAddress.createUnresolved("localhost", 9160);
private static final SslConfiguration SSL_CONFIGURATION = SslConfiguration.of(Paths.get("./trustStore.jks"));

private static final ImmutableCassandraKeyValueServiceConfig CASSANDRA_CONFIG = ImmutableCassandraKeyValueServiceConfig.builder()
.addServers(SERVER_ADDRESS)
.replicationFactor(1)
.keyspace("atlasdb")
.build();


@Test
public void usingSslIfSslParamPresentAndTrue() {
assertTrue(CASSANDRA_CONFIG.withSsl(true).usingSsl());
}

@Test
public void notUsingSslIfSslParamPresentAndFalse() {
assertFalse(CASSANDRA_CONFIG.withSsl(false).usingSsl());
}

@Test
public void notUsingSslIfSslParamFalseAndSslConfigurationPresent() {
assertFalse(CASSANDRA_CONFIG.withSsl(false).withSslConfiguration(SSL_CONFIGURATION).usingSsl());
}

@Test
public void usingSslIfSslParamNotPresentAndSslConfigurationPresent() {
assertTrue(CASSANDRA_CONFIG.withSslConfiguration(SSL_CONFIGURATION).usingSsl());
}

@Test
public void notUsingSslIfSslParamNotPresentAndSslConfigurationNotPresent() {
assertFalse(CASSANDRA_CONFIG.usingSsl());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/**
* Copyright 2015 Palantir Technologies
*
* Licensed under the BSD-3 License (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://opensource.org/licenses/BSD-3-Clause
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.palantir.atlasdb.keyvalue.cassandra;

import java.util.concurrent.BrokenBarrierException;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.ForkJoinPool;
import java.util.stream.IntStream;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import com.palantir.atlasdb.AtlasDbConstants;
import com.palantir.atlasdb.cassandra.CassandraKeyValueServiceConfigManager;
import com.palantir.atlasdb.cassandra.ImmutableCassandraKeyValueServiceConfig;
import com.palantir.atlasdb.keyvalue.api.TableReference;

public class CassandraKeyValueServiceTableCreationTest {
public static final TableReference GOOD_TABLE = TableReference.createFromFullyQualifiedName("foo.bar");
public static final TableReference BAD_TABLE = TableReference.createFromFullyQualifiedName("foo.b@r");

protected CassandraKeyValueService kvs;
protected CassandraKeyValueService slowTimeoutKvs;

@Before
public void setUp() {
ImmutableCassandraKeyValueServiceConfig quickTimeoutConfig = CassandraTestSuite.CASSANDRA_KVS_CONFIG
.withSchemaMutationTimeoutMillis(500);
kvs = CassandraKeyValueService.create(
CassandraKeyValueServiceConfigManager.createSimpleManager(quickTimeoutConfig), CassandraTestSuite.LEADER_CONFIG);

ImmutableCassandraKeyValueServiceConfig slowTimeoutConfig = CassandraTestSuite.CASSANDRA_KVS_CONFIG
.withSchemaMutationTimeoutMillis(60 * 1000);
slowTimeoutKvs = CassandraKeyValueService.create(
CassandraKeyValueServiceConfigManager.createSimpleManager(slowTimeoutConfig), CassandraTestSuite.LEADER_CONFIG);

kvs.dropTable(AtlasDbConstants.TIMESTAMP_TABLE);
}

@After
public void tearDown() {
kvs.teardown();
}

@Test (timeout = 10 * 1000)
public void testTableCreationCanOccurAfterError() {
try {
kvs.createTable(BAD_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA);
} catch (Exception e) {
// failure expected
}
kvs.createTable(GOOD_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA);
kvs.dropTable(GOOD_TABLE);
}

@Test
public void testCreatingMultipleTablesAtOnce() {
int threadCount = 16;
CyclicBarrier barrier = new CyclicBarrier(threadCount);
ForkJoinPool threadPool = new ForkJoinPool(threadCount);

threadPool.submit(() -> {
IntStream.range(0, threadCount).parallel().forEach(i -> {
try {
barrier.await();
slowTimeoutKvs.createTable(GOOD_TABLE, AtlasDbConstants.GENERIC_TABLE_METADATA);
} catch (BrokenBarrierException | InterruptedException e) {
// Do nothing
}
});
});

slowTimeoutKvs.dropTable(GOOD_TABLE);
}

@Test
public void describeVersionBehavesCorrectly() throws Exception {
kvs.clientPool.runWithRetry(CassandraVerifier.underlyingCassandraClusterSupportsCASOperations);
}
}
Loading

0 comments on commit 4792f4b

Please sign in to comment.