/* Ċ Ġ* ĠSPDX - License - Identifier : ĠApache - 2 . 0 Ċ Ġ* Ċ Ġ* ĠThe ĠOpen Search ĠContributors Ġrequire Ġcontributions Ġmade Ġto Ċ Ġ* Ġthis Ġfile Ġbe Ġlicensed Ġunder Ġthe ĠApache - 2 . 0 Ġlicense Ġor Ġa Ċ Ġ* Ġcompatible Ġopen Ġsource Ġlicense . Ċ Ġ* Ċ Ġ* ĠMod ifications ĠCopyright ĠOpen Search ĠContributors . ĠSee Ċ Ġ* ĠGitHub Ġhistory Ġfor Ġdetails . Ċ Ġ*/ Ċ Ċ package Ġorg . opense arch . replication . action . repository Ċ Ċ import Ġorg . opense arch . replication . repository . Remote Cluster Restore Leader Service Ċ import Ġorg . apache . logging . log 4 j . Log Manager Ċ import Ġorg . opense arch . action . support . Action Filters Ċ import Ġorg . opense arch . action . support . single . shard . Transport Single Shard Action Ċ import Ġorg . opense arch . cluster . Cluster State Ċ import Ġorg . opense arch . cluster . metadata . Index Name Expression Resolver Ċ import Ġorg . opense arch . cluster . routing . Shards Iterator Ċ import Ġorg . opense arch . cluster . service . Cluster Service Ċ import Ġorg . opense arch . common . inject . Inject Ċ import Ġorg . opense arch . common . io . stream . Stream Input Ċ import Ġorg . opense arch . common . io . stream . Write able Ċ import Ġorg . opense arch . index . shard . Shard Id Ċ import Ġorg . opense arch . thread pool . ThreadPool Ċ import Ġorg . opense arch . transport . Transport Action Proxy Ċ import Ġorg . opense arch . transport . Transport Service Ċ Ċ class ĠTransport Get Store Metadata Action Ġ@ Inject Ġconstructor ( thread Pool : ĠThreadPool , Ġcluster Service : ĠCluster Service , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġtransport Service : ĠTransport Service , Ġaction Filters : ĠAction Filters , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġindex Name Expression Resolver : ĠIndex Name Expression Resolver , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġprivate Ġval Ġrestore Leader Service : ĠRemote Cluster Restore Leader Service ) Ġ: ĊĠĠĠĠĠĠĠ ĠTransport Single Shard Action < Get Store Metadata Request , ĠGet Store Metadata Response >( Get Store Metadata Action . NAME , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġthread Pool , Ġcluster Service , Ġtransport Service , Ġaction Filters , ĊĠĠĠĠĠĠĠĠĠĠĠĠĠĠĠ Ġindex Name Expression Resolver , Ġ:: Get Store Metadata Request , ĠThreadPool . Names . GET ) Ġ{ ĊĠĠĠ Ġinit Ġ{ ĊĠĠĠĠĠĠĠ ĠTransport Action Proxy . register Proxy Action ( transport Service , ĠGet Store Metadata Action . NAME , Ġ:: Get Store Metadata Response ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġcompanion Ġobject Ġ{ ĊĠĠĠĠĠĠĠ Ġprivate Ġval Ġlog Ġ= ĠLog Manager . getLogger ( Transport Get Store Metadata Action :: class . java ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġshard Operation ( request : ĠGet Store Metadata Request , Ġshard Id : ĠSh ard Id ): ĠGet Store Metadata Response Ġ{ ĊĠĠĠĠĠĠĠ Ġlog . debug ( request . toString ()) ĊĠĠĠĠĠĠĠ Ġvar Ġmetadata Snapshot Ġ= Ġrestore Leader Service . add Leader Cluster Restore ( request . restore UUID , Ġrequest ). metadata Snapshot ĊĠĠĠĠĠĠĠ Ġreturn ĠGet Store Metadata Response ( metadata Snapshot ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġresolve Index ( request : ĠGet Store Metadata Request ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġtrue ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġget Response Reader (): ĠWrite able . Reader < Get Store Metadata Response > Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠWrite able . Reader Ġ{ Ġinp : ĠStream Input Ġ-> ĠGet Store Metadata Response ( inp ) Ġ} ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġsh ards ( state : ĠCluster State , Ġrequest : ĠInternal Request ): ĠSh ards Iterator Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġstate . routing Table (). shard Routing Table ( request . request (). leader Shard Id ). primary Shard It () ĊĠĠĠ Ġ} Ċ } Ċ