Search in sources :

Example 1 with VersionManager

use of com.yelp.nrtsearch.server.backup.VersionManager in project nrtsearch by Yelp.

the class RemoteStateBackendTest method setup.

@Before
public void setup() throws IOException {
    Path s3Directory = folder.newFolder("s3").toPath();
    Path archiverDirectory = folder.newFolder("archiver").toPath();
    api = S3Mock.create(8011, s3Directory.toAbsolutePath().toString());
    api.start();
    AmazonS3 s3 = new AmazonS3Client(new AnonymousAWSCredentials());
    s3.setEndpoint("http://127.0.0.1:8011");
    s3.createBucket(TEST_BUCKET);
    TransferManager transferManager = TransferManagerBuilder.standard().withS3Client(s3).withShutDownThreadPools(false).build();
    ContentDownloader contentDownloader = new ContentDownloaderImpl(new TarImpl(TarImpl.CompressionMode.LZ4), transferManager, TEST_BUCKET, true);
    FileCompressAndUploader fileCompressAndUploader = new FileCompressAndUploader(new TarImpl(TarImpl.CompressionMode.LZ4), transferManager, TEST_BUCKET);
    versionManager = new VersionManager(s3, TEST_BUCKET);
    archiver = new IndexArchiver(mock(BackupDiffManager.class), fileCompressAndUploader, contentDownloader, versionManager, archiverDirectory);
}
Also used : Path(java.nio.file.Path) AmazonS3(com.amazonaws.services.s3.AmazonS3) TransferManager(com.amazonaws.services.s3.transfer.TransferManager) ContentDownloader(com.yelp.nrtsearch.server.backup.ContentDownloader) IndexArchiver(com.yelp.nrtsearch.server.backup.IndexArchiver) AmazonS3Client(com.amazonaws.services.s3.AmazonS3Client) FileCompressAndUploader(com.yelp.nrtsearch.server.backup.FileCompressAndUploader) AnonymousAWSCredentials(com.amazonaws.auth.AnonymousAWSCredentials) VersionManager(com.yelp.nrtsearch.server.backup.VersionManager) ContentDownloaderImpl(com.yelp.nrtsearch.server.backup.ContentDownloaderImpl) TarImpl(com.yelp.nrtsearch.server.backup.TarImpl) Before(org.junit.Before)

Aggregations

AnonymousAWSCredentials (com.amazonaws.auth.AnonymousAWSCredentials)1 AmazonS3 (com.amazonaws.services.s3.AmazonS3)1 AmazonS3Client (com.amazonaws.services.s3.AmazonS3Client)1 TransferManager (com.amazonaws.services.s3.transfer.TransferManager)1 ContentDownloader (com.yelp.nrtsearch.server.backup.ContentDownloader)1 ContentDownloaderImpl (com.yelp.nrtsearch.server.backup.ContentDownloaderImpl)1 FileCompressAndUploader (com.yelp.nrtsearch.server.backup.FileCompressAndUploader)1 IndexArchiver (com.yelp.nrtsearch.server.backup.IndexArchiver)1 TarImpl (com.yelp.nrtsearch.server.backup.TarImpl)1 VersionManager (com.yelp.nrtsearch.server.backup.VersionManager)1 Path (java.nio.file.Path)1 Before (org.junit.Before)1