Class FilterRepository

    • Constructor Detail

      • FilterRepository

        public FilterRepository​(Repository in)
    • Method Detail

      • getSnapshotInfo

        public SnapshotInfo getSnapshotInfo​(SnapshotId snapshotId)
        Description copied from interface: Repository
        Reads snapshot description from repository.
        Specified by:
        getSnapshotInfo in interface Repository
        Parameters:
        snapshotId - snapshot id
        Returns:
        information about snapshot
      • getSnapshotGlobalMetaData

        public MetaData getSnapshotGlobalMetaData​(SnapshotId snapshotId)
        Description copied from interface: Repository
        Returns global metadata associated with the snapshot.
        Specified by:
        getSnapshotGlobalMetaData in interface Repository
        Parameters:
        snapshotId - the snapshot id to load the global metadata from
        Returns:
        the global metadata about the snapshot
      • getSnapshotIndexMetaData

        public IndexMetaData getSnapshotIndexMetaData​(SnapshotId snapshotId,
                                                      IndexId index)
                                               throws java.io.IOException
        Description copied from interface: Repository
        Returns the index metadata associated with the snapshot.
        Specified by:
        getSnapshotIndexMetaData in interface Repository
        Parameters:
        snapshotId - the snapshot id to load the index metadata from
        index - the IndexId to load the metadata from
        Returns:
        the index metadata about the given index for the given snapshot
        Throws:
        java.io.IOException
      • initializeSnapshot

        public void initializeSnapshot​(SnapshotId snapshotId,
                                       java.util.List<IndexId> indices,
                                       MetaData metaData)
        Description copied from interface: Repository
        Starts snapshotting process
        Specified by:
        initializeSnapshot in interface Repository
        Parameters:
        snapshotId - snapshot id
        indices - list of indices to be snapshotted
        metaData - cluster metadata
      • finalizeSnapshot

        public void finalizeSnapshot​(SnapshotId snapshotId,
                                     java.util.List<IndexId> indices,
                                     long startTime,
                                     java.lang.String failure,
                                     int totalShards,
                                     java.util.List<SnapshotShardFailure> shardFailures,
                                     long repositoryStateId,
                                     boolean includeGlobalState,
                                     MetaData metaData,
                                     java.util.Map<java.lang.String,​java.lang.Object> userMetadata,
                                     ActionListener<SnapshotInfo> listener)
        Description copied from interface: Repository
        Finalizes snapshotting process

        This method is called on master after all shards are snapshotted.

        Specified by:
        finalizeSnapshot in interface Repository
        Parameters:
        snapshotId - snapshot id
        indices - list of indices in the snapshot
        startTime - start time of the snapshot
        failure - global failure reason or null
        totalShards - total number of shards
        shardFailures - list of shard failures
        repositoryStateId - the unique id identifying the state of the repository when the snapshot began
        includeGlobalState - include cluster global state
        listener - listener to be called on completion of the snapshot
      • deleteSnapshot

        public void deleteSnapshot​(SnapshotId snapshotId,
                                   long repositoryStateId,
                                   ActionListener<java.lang.Void> listener)
        Description copied from interface: Repository
        Deletes snapshot
        Specified by:
        deleteSnapshot in interface Repository
        Parameters:
        snapshotId - snapshot id
        repositoryStateId - the unique id identifying the state of the repository when the snapshot deletion began
        listener - completion listener
      • startVerification

        public java.lang.String startVerification()
        Description copied from interface: Repository
        Verifies repository on the master node and returns the verification token.

        If the verification token is not null, it's passed to all data nodes for verification. If it's null - no additional verification is required

        Specified by:
        startVerification in interface Repository
        Returns:
        verification token that should be passed to all Index Shard Repositories for additional verification or null
      • endVerification

        public void endVerification​(java.lang.String verificationToken)
        Description copied from interface: Repository
        Called at the end of repository verification process.

        This method should perform all necessary cleanup of the temporary files created in the repository

        Specified by:
        endVerification in interface Repository
        Parameters:
        verificationToken - verification request generated by Repository.startVerification() command
      • verify

        public void verify​(java.lang.String verificationToken,
                           DiscoveryNode localNode)
        Description copied from interface: Repository
        Verifies repository settings on data node.
        Specified by:
        verify in interface Repository
        Parameters:
        verificationToken - value returned by Repository.startVerification()
        localNode - the local node information, for inclusion in verification errors
      • isReadOnly

        public boolean isReadOnly()
        Description copied from interface: Repository
        Returns true if the repository supports only read operations
        Specified by:
        isReadOnly in interface Repository
        Returns:
        true if the repository is read/only
      • snapshotShard

        public void snapshotShard​(Store store,
                                  MapperService mapperService,
                                  SnapshotId snapshotId,
                                  IndexId indexId,
                                  org.apache.lucene.index.IndexCommit snapshotIndexCommit,
                                  IndexShardSnapshotStatus snapshotStatus,
                                  ActionListener<java.lang.Void> listener)
        Description copied from interface: Repository
        Creates a snapshot of the shard based on the index commit point.

        The index commit point can be obtained by using Engine.acquireLastIndexCommit(boolean) method. Repository implementations shouldn't release the snapshot index commit point. It is done by the method caller.

        As snapshot process progresses, implementation of this method should update IndexShardSnapshotStatus object and check IndexShardSnapshotStatus.isAborted() to see if the snapshot process should be aborted.

        Specified by:
        snapshotShard in interface Repository
        Parameters:
        store - store to be snapshotted
        mapperService - the shards mapper service
        snapshotId - snapshot id
        indexId - id for the index being snapshotted
        snapshotIndexCommit - commit point
        snapshotStatus - snapshot status
        listener - listener invoked on completion
      • restoreShard

        public void restoreShard​(Store store,
                                 SnapshotId snapshotId,
                                 Version version,
                                 IndexId indexId,
                                 ShardId snapshotShardId,
                                 RecoveryState recoveryState)
        Description copied from interface: Repository
        Restores snapshot of the shard.

        The index can be renamed on restore, hence different shardId and snapshotShardId are supplied.

        Specified by:
        restoreShard in interface Repository
        Parameters:
        store - the store to restore the index into
        snapshotId - snapshot id
        version - version of elasticsearch that created this snapshot
        indexId - id of the index in the repository from which the restore is occurring
        snapshotShardId - shard id (in the snapshot)
        recoveryState - recovery state
      • getShardSnapshotStatus

        public IndexShardSnapshotStatus getShardSnapshotStatus​(SnapshotId snapshotId,
                                                               Version version,
                                                               IndexId indexId,
                                                               ShardId shardId)
        Description copied from interface: Repository
        Retrieve shard snapshot status for the stored snapshot
        Specified by:
        getShardSnapshotStatus in interface Repository
        Parameters:
        snapshotId - snapshot id
        version - version of elasticsearch that created this snapshot
        indexId - the snapshotted index id for the shard to get status for
        shardId - shard id
        Returns:
        snapshot status
      • close

        public void close()
        Specified by:
        close in interface java.lang.AutoCloseable
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface Releasable