Package com.splunk.shuttl.archiver.flush

Examples of com.splunk.shuttl.archiver.flush.Flusher


    Date fromDate = RestUtil.getValidFromDate(from);
    Date toDate = RestUtil.getValidToDate(to);

    List<Exception> errors = new ArrayList<Exception>();
    Flusher flusher = new Flusher(SplunkIndexedLayerFactory.create());

    List<String> indexes;
    if (index == null)
      indexes = ArchivedIndexesListerFactory.create().listIndexes();
    else
      indexes = asList(index);

    for (String i : indexes) {
      try {
        flusher.flush(i, fromDate, toDate);
      } catch (Exception e) {
        errors.add(e);
      }
    }

    JSONObject json = JsonUtils.writeKeyValueAsJson(
        JsonObjectNames.BUCKET_COLLECTION, flusher.getFlushedBuckets(),
        JsonObjectNames.FAILED_BUCKET_COLLECTION, errors);

    List<JSONObject> jsons = RequestOnSearchPeers.createPost(
        ENDPOINT_BUCKET_FLUSH, index, from, to).execute().jsons;
    jsons.add(json);
View Full Code Here


    archiveBuckets(b1, b2);
    thawBuckets(early, later);

    assertArchivingAndThawingWasSuccessful(b1, b2);

    Flusher flusher = new Flusher(splunkIndexesLayer);
    flusher.flush(index, later, later);

    List<Bucket> flushedBuckets = flusher.getFlushedBuckets();
    assertEquals(1, flushedBuckets.size());
    Bucket flushedBucket = flushedBuckets.get(0);
    assertEquals(b2.getName(), flushedBucket.getName());
    assertEquals(b2.getIndex(), flushedBucket.getIndex());
  }
View Full Code Here

TOP

Related Classes of com.splunk.shuttl.archiver.flush.Flusher

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.