@@ -0,0 +1,3489 @@
+/**%0A * Copyright 2015 Palantir Technologies%0A *%0A * Licensed under the BSD-3 License (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A * http://opensource.org/licenses/BSD-3-Clause%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0Apackage com.palantir.atlasdb.cleaner;%0A%0Aimport java.io.File;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0A%0Aimport com.google.common.base.Supplier;%0Aimport com.google.common.base.Suppliers;%0Aimport com.google.common.collect.ImmutableList;%0Aimport com.google.common.io.Files;%0Aimport com.palantir.atlasdb.keyvalue.rocksdb.impl.RocksDbKeyValueService;%0Aimport com.palantir.atlasdb.sweep.SweepTaskRunner;%0Aimport com.palantir.atlasdb.transaction.api.AtlasDbConstraintCheckingMode;%0Aimport com.palantir.atlasdb.transaction.api.LockAwareTransactionManager;%0Aimport com.palantir.atlasdb.transaction.impl.ConflictDetectionManager;%0Aimport com.palantir.atlasdb.transaction.impl.ConflictDetectionManagers;%0Aimport com.palantir.atlasdb.transaction.impl.SnapshotTransactionManager;%0Aimport com.palantir.atlasdb.transaction.impl.SweepStrategyManager;%0Aimport com.palantir.atlasdb.transaction.impl.SweepStrategyManagers;%0Aimport com.palantir.atlasdb.transaction.service.TransactionServices;%0Aimport com.palantir.lock.LockClient;%0Aimport com.palantir.lock.LockServerOptions;%0Aimport com.palantir.lock.impl.LockServiceImpl;%0Aimport com.palantir.timestamp.InMemoryTimestampService;%0Aimport com.palantir.timestamp.TimestampService;%0A%0Apublic class RocksDbSweeperTest extends AbstractSweeperTest %7B%0A    private File tempDir;%0A    private LockServiceImpl lockService;%0A%0A    @Before%0A    @SuppressWarnings(%22serial%22)%0A    public void setup() %7B%0A        tempDir = Files.createTempDir();%0A        kvs = RocksDbKeyValueService.create(tempDir.getAbsolutePath());%0A        TimestampService tsService = new InMemoryTimestampService();%0A        LockClient lockClient = LockClient.of(%22sweep client%22);%0A        lockService = LockServiceImpl.create(new LockServerOptions() %7B @Override public boolean isStandaloneServer() %7B return false; %7D%7D);%0A        txService = TransactionServices.createTransactionService(kvs);%0A        Supplier%3CAtlasDbConstraintCheckingMode%3E constraints = Suppliers.ofInstance(AtlasDbConstraintCheckingMode.NO_CONSTRAINT_CHECKING);%0A        ConflictDetectionManager cdm = ConflictDetectionManagers.createDefault(kvs);%0A        SweepStrategyManager ssm = SweepStrategyManagers.createDefault(kvs);%0A        Cleaner cleaner = new NoOpCleaner();%0A        LockAwareTransactionManager txManager = new SnapshotTransactionManager(kvs, tsService, lockClient, lockService, txService, constraints, cdm, ssm, cleaner, false);%0A        SnapshotTransactionManager.createTables(kvs);%0A        Supplier%3CLong%3E tsSupplier = new Supplier%3CLong%3E() %7B @Override public Long get() %7B return sweepTimestamp.get(); %7D%7D;%0A        sweepRunner = new SweepTaskRunner(txManager, kvs, tsSupplier, tsSupplier, txService, ssm, ImmutableList.%3CFollower%3Eof());%0A    %7D%0A%0A    @After%0A    public void teardown() %7B%0A        lockService.close();%0A        kvs.close();%0A        for (File file : Files.fileTreeTraverser().postOrderTraversal(tempDir)) %7B%0A            file.delete();%0A        %7D%0A    %7D%0A%7D%0A

add rocks sweeper test