Package com.splunk.shuttl.archiver.model

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


   *           if the import of the thawed bucket fails.
   */
  public LocalBucket getBucketFromArchive(Bucket bucket)
      throws ThawTransferFailException, ImportThawedBucketFailException {
    logger.info(will("Attempting to thaw bucket", "bucket", bucket));
    LocalBucket thawedBucket = getTransferedBucket(bucket);
    LocalBucket importedBucket = importThawedBucket(thawedBucket);
    Bucket bucketWithSize = bucketSizeResolver.resolveBucketSize(thawedBucket);
    logger.info(done("Thawed bucket", "bucket", importedBucket));
    return BucketFactory.createBucketWithIndexDirectoryAndSize(
        importedBucket.getIndex(), importedBucket.getDirectory(),
        importedBucket.getFormat(), bucketWithSize.getSize());
  }
View Full Code Here


      throw new IllegalArgumentException("index must be specified");
    }
  }

  private void createAndRunBucketShuttling(String path, String index) {
    LocalBucket bucket = createBucket(path, index);
    List<BucketLock> bucketLocks = createBucketLocks(bucket);
    shuttlWithLocks(bucket, bucketLocks);
  }
View Full Code Here

    return new TransfersBuckets() {

      @Override
      public void put(Bucket bucket, String temp, String dst)
          throws IOException {
        LocalBucket localBucket = (LocalBucket) bucket;
        putFile(localBucket.getDirectory(), new Path(temp), new Path(dst));
      }

      @Override
      public void get(Bucket remoteBucket, File temp, File dst)
          throws IOException {
View Full Code Here

  }

  private void thawBucketFromArchive(Bucket bucket) {
    try {
      LocalBucket thawedBucket = getsBucketsFromArchive
          .getBucketFromArchive(bucket);
      successfulThawedBuckets.add(thawedBucket);
    } catch (ThawTransferFailException e) {
      logTransferException(bucket, e);
      failedBuckets.add(new FailedBucket(bucket, e));
View Full Code Here

  }

  private LocalBucket getImportedBucketCsvBucket(LocalBucket bucket) {
    List<String> importCommand = createCommandForImportingBucket(bucket);
    int exit = executeImportCommand(importCommand);
    LocalBucket newBucket = createNewBucket(bucket);
    deleteCsvFileOnSuccessfulImport(bucket, exit);
    return newBucket;
  }
View Full Code Here

    }
  }

  private void moveAndArchiveBucket(String indexName, String path)
      throws FileNotFoundException, FileNotDirectoryException {
    LocalBucket bucket = new LocalBucket(new File(path), indexName,
        BucketFormat.SPLUNK_BUCKET);

    bucketLocker.callBucketHandlerUnderSharedLock(bucket,
        new MoveAndArchiveBucketUnderLock(bucketMover, archiveRestHandler));
View Full Code Here

  /**
   * @param bucket
   *          to move and archive
   */
  public void moveThenArchiveBucket(LocalBucket bucket) {
    LocalBucket movedBucket = bucketMover.moveBucket(bucket);
    archiveRestHandler.callRestToArchiveLocalBucket(movedBucket);
  }
View Full Code Here

   * @return the new bucket moved to the new location.
   */
  public LocalBucket moveBucket(LocalBucket bucket) {
    logger.debug(will("moving bucket", "bucket", bucket, "destination",
        movedBucketsLocation));
    LocalBucket movedBucket = moveBucketToMovedBucketsLocationAndPerserveItsIndex(bucket);
    logger.debug(did("moved bucket", "success", null, "bucket", bucket,
        "destination", movedBucketsLocation));
    return movedBucket;
  }
View Full Code Here

  }

  private void putBucket(LocalBucket bucket, String temp, String dst)
      throws IOException {
    if (bucket.getFormat().equals(BucketFormat.SPLUNK_BUCKET)) {
      LocalBucket tgzBucket = exportToTgzBucketWithWarning(bucket);
      uploadBucket(tgzBucket, dst);
      bucketDeleter.deleteBucket(tgzBucket);
    } else {
      uploadBucket(bucket, dst);
    }
View Full Code Here

      uploadBucket(bucket, dst);
    }
  }

  private LocalBucket exportToTgzBucketWithWarning(LocalBucket localBucket) {
    LocalBucket bucketToUpload = tgzFormatExporter.exportBucket(localBucket);
    logger.warn(warn("Exported bucket to tgz because glacier should only "
        + "upload one file", "Bucket got exported",
        "Will upload this tgz bucket. You can prevent this "
            + "warning by configuring glacier with bucket formats "
            + "that already are one file, i.e. CSV and SPLUNK_BUCKET_TGZ",
View Full Code Here

TOP

Related Classes of com.splunk.shuttl.archiver.model.LocalBucket

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.