Examples of LocalBucket


Examples of com.splunk.shuttl.archiver.model.LocalBucket

    moveAndArchiveBucketUnderLock.moveThenArchiveBucket(bucket);
    verify(bucketMover).moveBucket(bucket);
  }

  public void moveThenArchiveBucket_givenBucket_archivesTheMovedBucket() {
    LocalBucket movedBucket = mock(LocalBucket.class);
    when(bucketMover.moveBucket(bucket)).thenReturn(movedBucket);
    moveAndArchiveBucketUnderLock.moveThenArchiveBucket(bucket);
    verify(archiveRestHandler).callRestToArchiveLocalBucket(movedBucket);
  }
View Full Code Here

Examples of com.splunk.shuttl.archiver.model.LocalBucket

  public void createFileFormatedAsBucket_validArgument_theDirCanBeUsedToCreateABucket() {
    File bucketDir = TUtilsBucket
        .createFileFormatedAsBucket("db_12351290_12351235_1");
    try {
      new LocalBucket(bucketDir, "index-name", BucketFormat.SPLUNK_BUCKET);
    } catch (Exception e) {
      TUtilsTestNG.failForException("Coudn't create a valid bucket dir", e);
    }
  }
View Full Code Here

Examples of com.splunk.shuttl.archiver.model.LocalBucket

    }
  }

  public void createBucketInDirectory_givenDirectory_createsBucketInThatDirectory() {
    File parent = TUtilsFile.createDirectory();
    LocalBucket bucketCreated = TUtilsBucket.createBucketInDirectory(parent);
    assertEquals(parent, bucketCreated.getDirectory().getParentFile());
  }
View Full Code Here

Examples of com.splunk.shuttl.archiver.model.LocalBucket

  public void createBucketInDirectoryWithTimes_givenDirectory_createsBucketInTheDirectory() {
    File parent = null;
    try {
      parent = createDirectory();
      LocalBucket bucket = TUtilsBucket.createBucketInDirectoryWithTimes(
          parent, new Date(), new Date());
      assertEquals(parent.getAbsolutePath(), bucket.getDirectory()
          .getParentFile().getAbsolutePath());
    } finally {
      FileUtils.deleteQuietly(parent);
    }
  }
View Full Code Here

Examples of com.splunk.shuttl.archiver.model.LocalBucket

        getShuttlTestDirectory(), new Date(), new Date(), "foo");
    assertEquals("foo", b.getIndex());
  }

  public void createBucketWithIndex_givenIndex_hasIndex() {
    LocalBucket b = TUtilsBucket.createBucketWithIndex("index");
    assertEquals(b.getIndex(), "index");
  }
View Full Code Here

Examples of com.splunk.shuttl.archiver.model.LocalBucket

    FileUtils.deleteQuietly(thawLocation);
    FileUtils.deleteQuietly(archiverData);
  }

  public void BucketSize_archiveBucket_remoteBucketHasSameSizeAsBeforeArchiving() {
    LocalBucket bucket = TUtilsBucket.createRealBucket();
    long bucketSize = bucket.getSize();

    TUtilsFunctional.archiveBucket(bucket, bucketArchiver);
    ListsBucketsFiltered listsBucketsFiltered = ListsBucketsFilteredFactory
        .create(config);
    List<Bucket> listBucketsInIndex = listsBucketsFiltered
        .listFilteredBucketsAtIndex(bucket.getIndex(), bucket.getEarliest(),
            bucket.getLatest());

    assertEquals(1, listBucketsInIndex.size());
    Bucket bucketInArchive = listBucketsInIndex.get(0);
    assertEquals(bucketSize,
        (long) archiveBucketSize.readBucketSize(bucketInArchive));
View Full Code Here

Examples of com.splunk.shuttl.archiver.model.LocalBucket

    assertTrue(bucket.getName().startsWith("rb"));
  }

  public void createReplicatedBucket_parent_directoryIsInParent() {
    File parent = createDirectory();
    LocalBucket b = TUtilsBucket.createReplicatedBucket("foo", parent, "baz");
    assertEquals(b.getDirectory().getParentFile().getAbsolutePath(),
        parent.getAbsolutePath());
  }
View Full Code Here

Examples of com.splunk.shuttl.archiver.model.LocalBucket

    assertEquals(b.getGuid(), "baz");
  }

  public void createReplicatedBucket_index_hasThatIndex() {
    String index = "replicated_index";
    LocalBucket b = TUtilsBucket.createReplicatedBucket(index,
        createDirectory(), "baz");
    assertEquals(index, b.getIndex());
  }
View Full Code Here

Examples of com.splunk.shuttl.archiver.model.LocalBucket

        new ArrayList<File>());
    assertFalse(localBucketStorage.hasBucket(bucket));
  }

  public void hasBucket_bucketWithTheSameNameExistsLocally_true() {
    LocalBucket bucketWithSameName = TUtilsBucket.createBucketWithName(bucket
        .getName());
    when(indexStoragePaths.getDbPathsForIndex(bucket.getIndex())).thenReturn(
        asList(bucketWithSameName.getDirectory().getParentFile()));

    assertTrue(localBucketStorage.hasBucket(bucket));
  }
View Full Code Here

Examples of com.splunk.shuttl.archiver.model.LocalBucket

  }

  @Test(groups = { "slow-unit" })
  public void createRealReplicatedBucket_parameters_hasParameterProperties() {
    File parent = createDirectory();
    LocalBucket bucket = TUtilsBucket.createRealReplicatedBucket("theIndex",
        parent, "theGuid");
    assertEquals("theIndex", bucket.getIndex());
    assertEquals(parent.getAbsolutePath(), bucket.getDirectory()
        .getParentFile().getAbsolutePath());
    assertEquals(bucket.getGuid(), "theGuid");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.