Package com.netflix.priam.aws

Examples of com.netflix.priam.aws.S3FileSystem


    @Test
    public void testFileUpload() throws Exception
    {
        MockS3PartUploader.setup();
        S3FileSystem fs = injector.getInstance(S3FileSystem.class);
        // String snapshotfile = "target/data/Keyspace1/Standard1/backups/201108082320/Keyspace1-Standard1-ia-1-Data.db";
        S3BackupPath backupfile = injector.getInstance(S3BackupPath.class);
        backupfile.parseLocal(new File(FILE_PATH), BackupFileType.SNAP);
        fs.upload(backupfile, backupfile.localReader());
        Assert.assertEquals(1, MockS3PartUploader.compattempts);
    }
View Full Code Here


    @Test
    public void testFileUploadFailures() throws Exception
    {
        MockS3PartUploader.setup();
        MockS3PartUploader.partFailure = true;
        S3FileSystem fs = injector.getInstance(S3FileSystem.class);
        String snapshotfile = "target/data/Keyspace1/Standard1/backups/201108082320/Keyspace1-Standard1-ia-1-Data.db";
        S3BackupPath backupfile = injector.getInstance(S3BackupPath.class);
        backupfile.parseLocal(new File(snapshotfile), BackupFileType.SNAP);
        try
        {
            fs.upload(backupfile, backupfile.localReader());
        }
        catch (BackupRestoreException e)
        {
            // ignore
        }
View Full Code Here

    @Test
    public void testFileUploadCompleteFailure() throws Exception
    {
        MockS3PartUploader.setup();
        MockS3PartUploader.completionFailure = true;
        S3FileSystem fs = injector.getInstance(S3FileSystem.class);
        String snapshotfile = "target/data/Keyspace1/Standard1/backups/201108082320/Keyspace1-Standard1-ia-1-Data.db";
        S3BackupPath backupfile = injector.getInstance(S3BackupPath.class);
        backupfile.parseLocal(new File(snapshotfile), BackupFileType.SNAP);
        try
        {
            fs.upload(backupfile, backupfile.localReader());
        }
        catch (BackupRestoreException e)
        {
            // ignore
        }
View Full Code Here

    @Test
    public void testCleanupAdd() throws Exception
    {
        MockAmazonS3Client.ruleAvailable = false;
        S3FileSystem fs = injector.getInstance(S3FileSystem.class);
        fs.cleanup();
        Assert.assertEquals(1, MockAmazonS3Client.bconf.getRules().size());
        BucketLifecycleConfiguration.Rule rule = MockAmazonS3Client.bconf.getRules().get(0);
        logger.info(rule.getPrefix());
        Assert.assertEquals("casstestbackup/"+FakeConfiguration.FAKE_REGION+"/fake-app/", rule.getPrefix());
        Assert.assertEquals(5, rule.getExpirationInDays());
View Full Code Here

    @Test
    public void testCleanupIgnore() throws Exception
    {
        MockAmazonS3Client.ruleAvailable = true;
        S3FileSystem fs = injector.getInstance(S3FileSystem.class);
        fs.cleanup();
        Assert.assertEquals(1, MockAmazonS3Client.bconf.getRules().size());
        BucketLifecycleConfiguration.Rule rule = MockAmazonS3Client.bconf.getRules().get(0);
        logger.info(rule.getPrefix());
        Assert.assertEquals("casstestbackup/"+FakeConfiguration.FAKE_REGION+"/fake-app/", rule.getPrefix());
        Assert.assertEquals(5, rule.getExpirationInDays());
View Full Code Here

TOP

Related Classes of com.netflix.priam.aws.S3FileSystem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.