Class BlobStoreIndexShardSnapshots

org.elasticsearch.index.snapshots.blobstore.BlobStoreIndexShardSnapshots
All Implemented Interfaces:
<SnapshotFiles>, org.elasticsearch.common.xcontent.ToXContent, org.elasticsearch.common.xcontent.ToXContentFragment

public class BlobStoreIndexShardSnapshots extends implements <SnapshotFiles>, org.elasticsearch.common.xcontent.ToXContentFragment
Contains information about all snapshots for the given shard in repository

This class is used to find files that were already snapshotted and clear out files that no longer referenced by any snapshots.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent

    org.elasticsearch.common.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.common.xcontent.ToXContent.MapParams, org.elasticsearch.common.xcontent.ToXContent.Params
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
     

    Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent

    EMPTY_PARAMS
  • Constructor Summary

    Constructors
    Constructor
    Description
    <SnapshotFiles> shardSnapshots)
     
  • Method Summary

    Modifier and Type
    Method
    Description
     name)
    Finds reference to a snapshotted file by its snapshot name
     physicalName)
    Finds reference to a snapshotted file by its original name
    fromXContent​(org.elasticsearch.common.xcontent.XContentParser parser)
     
     
    Returns list of snapshots
    org.elasticsearch.common.xcontent.XContentBuilder
    toXContent​(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)
    Writes index file for the shard in the following format.
     source,  target)
    Create a new instance that has a new snapshot by name target added which shares all files with the snapshot of name source.

    Methods inherited from class java.lang.

    , , , , , , , , , ,

    Methods inherited from interface java.lang.

    ,

    Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment

    isFragment
  • Field Details

  • Constructor Details

    • BlobStoreIndexShardSnapshots

      public BlobStoreIndexShardSnapshots(<SnapshotFiles> shardSnapshots)
  • Method Details

    • withClone

      public  source,  target)
      Create a new instance that has a new snapshot by name target added which shares all files with the snapshot of name source.
      Parameters:
      source - source snapshot name
      target - target snapshot name
      Returns:
      new instance with added cloned snapshot
    • snapshots

      public <SnapshotFiles> snapshots()
      Returns list of snapshots
      Returns:
      list of snapshots
    • findPhysicalIndexFiles

      public < physicalName)
      Finds reference to a snapshotted file by its original name
      Parameters:
      physicalName - original name
      Returns:
      a list of file infos that match specified physical file or null if the file is not present in any of snapshots
    • findNameFile

      public  name)
      Finds reference to a snapshotted file by its snapshot name
      Parameters:
      name - file name
      Returns:
      file info or null if file is not present in any of snapshots
    • iterator

      public <SnapshotFiles> iterator()
      Specified by:
       in interface <SnapshotFiles>
    • toXContent

      public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws
      Writes index file for the shard in the following format.
       
       {
           "files": [{
               "name": "__3",
               "physical_name": "_0.si",
               "length": 310,
               "checksum": "1tpsg3p",
               "written_by": "5.1.0",
               "meta_hash": "P9dsFxNMdWNlb......"
           }, {
               "name": "__2",
               "physical_name": "segments_2",
               "length": 150,
               "checksum": "11qjpz6",
               "written_by": "5.1.0",
               "meta_hash": "P9dsFwhzZWdtZ......."
           }, {
               "name": "__1",
               "physical_name": "_0.cfe",
               "length": 363,
               "checksum": "er9r9g",
               "written_by": "5.1.0"
           }, {
               "name": "__0",
               "physical_name": "_0.cfs",
               "length": 3354,
               "checksum": "491liz",
               "written_by": "5.1.0"
           }, {
               "name": "__4",
               "physical_name": "segments_3",
               "length": 150,
               "checksum": "134567",
               "written_by": "5.1.0",
               "meta_hash": "P9dsFwhzZWdtZ......."
           }],
           "snapshots": {
               "snapshot_1": {
                   "files": ["__0", "__1", "__2", "__3"]
               },
               "snapshot_2": {
                   "files": ["__0", "__1", "__2", "__4"]
               }
           }
       }
       }
       
       
      Specified by:
      toXContent in interface org.elasticsearch.common.xcontent.ToXContent
      Throws:
    • fromXContent

      public static BlobStoreIndexShardSnapshots fromXContent(org.elasticsearch.common.xcontent.XContentParser parser) throws
      Throws: