Tabnine Logo
HollowFilesystemBlobStorageCleaner
Code IndexAdd Tabnine to your IDE (free)

How to use
HollowFilesystemBlobStorageCleaner
in
com.netflix.hollow.api.producer.fs

Best Java code snippets using com.netflix.hollow.api.producer.fs.HollowFilesystemBlobStorageCleaner (Showing top 2 results out of 315)

origin: Netflix/hollow

/**
 * Cleans snapshot to keep the last 'n' snapshots. Defaults to 5.
 */
@Override
public void cleanSnapshots() {
  File[] files = getFilesByType(HollowProducer.Blob.Type.SNAPSHOT.prefix);
  if(files == null || files.length <= numOfSnapshotsToKeep) {
    return;
  }
  sortByLastModified(files);
  for(int i= numOfSnapshotsToKeep; i < files.length; i++){
    File file = files[i];
    boolean deleted = file.delete();
    if(!deleted) {
      log.warning("Could not delete snapshot " + file.getPath());
    }
  }
}
origin: Netflix/hollow

@Test
public void cleanSnapshotsWithDefaultValue() {
  HollowProducer.Publisher publisher = new HollowFilesystemPublisher(publishDir.toPath());
  HollowProducer.BlobStorageCleaner blobStorageCleaner = new HollowFilesystemBlobStorageCleaner(publishDir);
  HollowProducer producer = HollowProducer.withPublisher(publisher)
                      .withBlobStorageCleaner(blobStorageCleaner)
com.netflix.hollow.api.producer.fsHollowFilesystemBlobStorageCleaner

Most used methods

  • <init>
  • getFilesByType
  • sortByLastModified

Popular in Java

  • Updating database using SQL prepared statement
  • requestLocationUpdates (LocationManager)
  • getResourceAsStream (ClassLoader)
  • scheduleAtFixedRate (Timer)
  • ByteBuffer (java.nio)
    A buffer for bytes. A byte buffer can be created in either one of the following ways: * #allocate
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Join (org.hibernate.mapping)
  • Sublime Text for Python
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now