Example usage for org.apache.solr.client.solrj.request CollectionAdminRequest backupCollection

List of usage examples for org.apache.solr.client.solrj.request CollectionAdminRequest backupCollection

Introduction

In this page you can find the example usage for org.apache.solr.client.solrj.request CollectionAdminRequest backupCollection.

Prototype

public static Backup backupCollection(String collection, String backupName) 

Source Link

Usage

From source file:org.codice.ddf.commands.solr.BackupCommand.java

License:Open Source License

private boolean backup(SolrClient client, String collection, String backupLocation, String backupName)
        throws IOException, SolrServerException {
    CollectionAdminRequest.Backup backup = CollectionAdminRequest.backupCollection(collection, backupName)
            .setLocation(backupLocation);
    CollectionAdminResponse response = backup.process(client, collection);
    LOGGER.debug("Backup status: {}", response.getStatus());
    if (response.getStatus() != 0) {
        printErrorMessage("Backup failed.");
        printResponseErrorMessages(response);
    }//from   www .  j a v a 2 s.  co  m
    return response.isSuccess();
}