Package org.apache.solr.handler
Class SnapShooter
- java.lang.Object
-
- org.apache.solr.handler.SnapShooter
-
public class SnapShooter extends Object
Provides functionality equivalent to the snapshooter script This is no longer used in standard replication.- Since:
- solr 1.4
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSnapShooter.CoreSnapshotResponse
-
Constructor Summary
Constructors Constructor Description SnapShooter(BackupRepository backupRepo, SolrCore core, URI location, String snapshotName, String commitName)SnapShooter(SolrCore core, String location, String snapshotName)Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcreateSnapAsync(int numberToKeep, Consumer<org.apache.solr.common.util.NamedList<?>> result)SnapShooter.CoreSnapshotResponsecreateSnapshot()protected SnapShooter.CoreSnapshotResponsecreateSnapshot(org.apache.lucene.index.IndexCommit indexCommit)Handles the logic of creating a snapshotprotected voiddeleteNamedSnapshot(ReplicationHandler replicationHandler)protected voiddeleteSnapAsync(ReplicationHandler replicationHandler)static org.apache.lucene.index.IndexCommitgetAndSaveNamedIndexCommit(SolrCore solrCore, String commitName)BackupRepositorygetBackupRepository()URIgetLocation()Gets the parent directory of the snapshots.voidvalidateCreateSnapshot()voidvalidateDeleteSnapshot()
-
-
-
Field Detail
-
DATE_FMT
public static final String DATE_FMT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SnapShooter
@Deprecated public SnapShooter(SolrCore core, String location, String snapshotName)
Deprecated.
-
SnapShooter
public SnapShooter(BackupRepository backupRepo, SolrCore core, URI location, String snapshotName, String commitName)
-
-
Method Detail
-
getBackupRepository
public BackupRepository getBackupRepository()
-
getLocation
public URI getLocation()
Gets the parent directory of the snapshots. This is thelocationgiven in the constructor.
-
validateDeleteSnapshot
public void validateDeleteSnapshot()
-
deleteSnapAsync
protected void deleteSnapAsync(ReplicationHandler replicationHandler)
-
validateCreateSnapshot
public void validateCreateSnapshot() throws IOException- Throws:
IOException
-
createSnapshot
public SnapShooter.CoreSnapshotResponse createSnapshot() throws Exception
- Throws:
Exception
-
getAndSaveNamedIndexCommit
public static org.apache.lucene.index.IndexCommit getAndSaveNamedIndexCommit(SolrCore solrCore, String commitName) throws IOException
- Throws:
IOException
-
createSnapAsync
public void createSnapAsync(int numberToKeep, Consumer<org.apache.solr.common.util.NamedList<?>> result) throws IOException- Throws:
IOException
-
createSnapshot
protected SnapShooter.CoreSnapshotResponse createSnapshot(org.apache.lucene.index.IndexCommit indexCommit) throws Exception
Handles the logic of creating a snapshotNOTE: The caller MUST ensure that the
IndexCommitis saved prior to calling this method, and released after calling this method, or there is no no garuntee that the method will function correctly.
-
deleteNamedSnapshot
protected void deleteNamedSnapshot(ReplicationHandler replicationHandler)
-
-