
com.groupbyinc.flux.snapshots.RestoreService.class Maven / Gradle / Ivy
???? 3? ,com/groupbyinc/flux/snapshots/RestoreService 6com/groupbyinc/flux/common/component/AbstractComponent 0com/groupbyinc/flux/cluster/ClusterStateListener RestoreService.java Mcom/groupbyinc/flux/snapshots/RestoreService$UpdateRestoreStateRequestHandler UpdateRestoreStateRequestHandler Qcom/groupbyinc/flux/snapshots/RestoreService$UpdateIndexShardRestoreStatusRequest $UpdateIndexShardRestoreStatusRequest ;com/groupbyinc/flux/snapshots/RestoreService$RestoreRequest RestoreRequest Fcom/groupbyinc/flux/snapshots/RestoreService$RestoreCompletionResponse RestoreCompletionResponse .com/groupbyinc/flux/snapshots/RestoreService$2 .com/groupbyinc/flux/snapshots/RestoreService$1 @com/groupbyinc/flux/cluster/RestoreInProgress$ShardRestoreStatus -com/groupbyinc/flux/cluster/RestoreInProgress ShardRestoreStatus java/util/Map$Entry
java/util/Map Entry 3com/groupbyinc/flux/cluster/RestoreInProgress$Entry " /com/groupbyinc/flux/threadpool/ThreadPool$Names $ )com/groupbyinc/flux/threadpool/ThreadPool & Names 3com/groupbyinc/flux/cluster/RestoreInProgress$State ) State /com/groupbyinc/flux/cluster/ClusterState$Custom , (com/groupbyinc/flux/cluster/ClusterState . Custom Ecom/groupbyinc/flux/common/google/common/collect/ImmutableSet$Builder 1 =com/groupbyinc/flux/common/google/common/collect/ImmutableSet 3 Builder UPDATE_RESTORE_ACTION_NAME Ljava/lang/String; (internal:cluster/snapshot/update_restore 8 UNMODIFIABLE_SETTINGS ?Lcom/groupbyinc/flux/common/google/common/collect/ImmutableSet; SLcom/groupbyinc/flux/common/google/common/collect/ImmutableSet; UNREMOVABLE_SETTINGS clusterService ,Lcom/groupbyinc/flux/cluster/ClusterService; repositoriesService 6Lcom/groupbyinc/flux/repositories/RepositoriesService; transportService 0Lcom/groupbyinc/flux/transport/TransportService; allocationService BLcom/groupbyinc/flux/cluster/routing/allocation/AllocationService; createIndexService ALcom/groupbyinc/flux/cluster/metadata/MetaDataCreateIndexService; dynamicSettings 6Lcom/groupbyinc/flux/cluster/settings/DynamicSettings; metaDataIndexUpgradeService BLcom/groupbyinc/flux/cluster/metadata/MetaDataIndexUpgradeService; listeners +Ljava/util/concurrent/CopyOnWriteArrayList; ?Ljava/util/concurrent/CopyOnWriteArrayList;>; updatedSnapshotStateQueue $Ljava/util/concurrent/BlockingQueue; yLjava/util/concurrent/BlockingQueue; ?(Lcom/groupbyinc/flux/common/settings/Settings;Lcom/groupbyinc/flux/cluster/ClusterService;Lcom/groupbyinc/flux/repositories/RepositoriesService;Lcom/groupbyinc/flux/transport/TransportService;Lcom/groupbyinc/flux/cluster/routing/allocation/AllocationService;Lcom/groupbyinc/flux/cluster/metadata/MetaDataCreateIndexService;Lcom/groupbyinc/flux/cluster/settings/DynamicSettings;Lcom/groupbyinc/flux/cluster/metadata/MetaDataIndexUpgradeService;)V *Lcom/groupbyinc/flux/common/inject/Inject; =Lcom/groupbyinc/flux/cluster/settings/ClusterDynamicSettings; 1(Lcom/groupbyinc/flux/common/settings/Settings;)V R V
W )java/util/concurrent/CopyOnWriteArrayList Y ()V R [
Z \ L M ^ @com/groupbyinc/flux/common/util/concurrent/ConcurrentCollections ` newBlockingQueue &()Ljava/util/concurrent/BlockingQueue; b c
a d O P f > ? h @ A j B C l D E n F G p H I r J K t same v 1(Lcom/groupbyinc/flux/snapshots/RestoreService;)V R x
y .com/groupbyinc/flux/transport/TransportService { registerRequestHandler o(Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;Lcom/groupbyinc/flux/transport/TransportRequestHandler;)V } ~
| *com/groupbyinc/flux/cluster/ClusterService ? add 5(Lcom/groupbyinc/flux/cluster/ClusterStateListener;)V ? ? ? ? this .Lcom/groupbyinc/flux/snapshots/RestoreService; settings .Lcom/groupbyinc/flux/common/settings/Settings; restoreSnapshot k(Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest;Lcom/groupbyinc/flux/action/ActionListener;)V java/lang/Throwable ?
repository ()Ljava/lang/String; ? ?
? 4com/groupbyinc/flux/repositories/RepositoriesService ? A(Ljava/lang/String;)Lcom/groupbyinc/flux/repositories/Repository; ? ?
? ? /com/groupbyinc/flux/cluster/metadata/SnapshotId ? name ? ?
? '(Ljava/lang/String;Ljava/lang/String;)V R ?
? ? +com/groupbyinc/flux/repositories/Repository ? readSnapshot [(Lcom/groupbyinc/flux/cluster/metadata/SnapshotId;)Lcom/groupbyinc/flux/snapshots/Snapshot; ? ? ? ? &com/groupbyinc/flux/snapshots/Snapshot ? indices ()Ljava/util/List; ? ?
? ? ()[Ljava/lang/String; ? ?
? indicesOptions 5()Lcom/groupbyinc/flux/action/support/IndicesOptions; ? ?
? +com/groupbyinc/flux/snapshots/SnapshotUtils ?
filterIndices h(Ljava/util/List;[Ljava/lang/String;Lcom/groupbyinc/flux/action/support/IndicesOptions;)Ljava/util/List; ? ?
? ? readSnapshotMetaData ?(Lcom/groupbyinc/flux/cluster/metadata/SnapshotId;Lcom/groupbyinc/flux/snapshots/Snapshot;Ljava/util/List;)Lcom/groupbyinc/flux/cluster/metadata/MetaData; ? ? ? ? version ()Lcom/groupbyinc/flux/Version; ? ?
? ? com/groupbyinc/flux/Version ?
V_2_0_0_beta1 Lcom/groupbyinc/flux/Version; ? ? ? ? before (Lcom/groupbyinc/flux/Version;)Z ? ?
? ? logger -Lcom/groupbyinc/flux/common/logging/ESLogger; ? ? ? -com/groupbyinc/flux/cluster/metadata/MetaData ? addDefaultUnitsIfNeeded ?(Lcom/groupbyinc/flux/common/logging/ESLogger;Lcom/groupbyinc/flux/cluster/metadata/MetaData;)Lcom/groupbyinc/flux/cluster/metadata/MetaData; ? ?
? ? )com/groupbyinc/flux/action/ActionListener ? java/util/List ? validateSnapshotRestorable \(Lcom/groupbyinc/flux/cluster/metadata/SnapshotId;Lcom/groupbyinc/flux/snapshots/Snapshot;)V ? ?
? renamedIndices ^(Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest;Ljava/util/List;)Ljava/util/Map; ? ?
? cause ? ?
?0(Lcom/groupbyinc/flux/snapshots/RestoreService;Lcom/groupbyinc/flux/cluster/metadata/SnapshotId;Ljava/util/Map;Lcom/groupbyinc/flux/snapshots/Snapshot;Lcom/groupbyinc/flux/cluster/metadata/MetaData;Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest;Lcom/groupbyinc/flux/action/ActionListener;)V R ?
? submitStateUpdateTask I(Ljava/lang/String;Lcom/groupbyinc/flux/cluster/ClusterStateUpdateTask;)V ? ? ? ? #[{}][{}] failed to restore snapshot ? java/lang/Object ? +com/groupbyinc/flux/common/logging/ESLogger ? warn =(Ljava/lang/String;Ljava/lang/Throwable;[Ljava/lang/Object;)V ? ? ? ? onFailure (Ljava/lang/Throwable;)V ? ? ? ? metaData /Lcom/groupbyinc/flux/cluster/metadata/MetaData; -Lcom/groupbyinc/flux/repositories/Repository;
snapshotId 1Lcom/groupbyinc/flux/cluster/metadata/SnapshotId; snapshot (Lcom/groupbyinc/flux/snapshots/Snapshot; filteredIndices $Ljava/util/List; Ljava/util/List;
metaDataIn 5Ljava/util/Map; Ljava/util/Map; e Ljava/lang/Throwable; request =Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest; listener XLcom/groupbyinc/flux/action/ActionListener; +Lcom/groupbyinc/flux/action/ActionListener; indexShardRestoreCompleted ](Lcom/groupbyinc/flux/cluster/metadata/SnapshotId;Lcom/groupbyinc/flux/index/shard/ShardId;)V &[{}] successfully restored shard [{}] trace ((Ljava/lang/String;[Ljava/lang/Object;)V ? state ,()Lcom/groupbyinc/flux/cluster/ClusterState; ? nodes 3()Lcom/groupbyinc/flux/cluster/node/DiscoveryNodes;
/ /com/groupbyinc/flux/cluster/node/DiscoveryNodes localNodeId ?
SUCCESS 5Lcom/groupbyinc/flux/cluster/RestoreInProgress$State;"# *$ J(Ljava/lang/String;Lcom/groupbyinc/flux/cluster/RestoreInProgress$State;)V R&
' ?(Lcom/groupbyinc/flux/cluster/metadata/SnapshotId;Lcom/groupbyinc/flux/index/shard/ShardId;Lcom/groupbyinc/flux/cluster/RestoreInProgress$ShardRestoreStatus;Lcom/groupbyinc/flux/snapshots/RestoreService$1;)V R)
*
masterNode 2()Lcom/groupbyinc/flux/cluster/node/DiscoveryNode;,-
. ;com/groupbyinc/flux/transport/EmptyTransportResponseHandler0
INSTANCE_SAME =Lcom/groupbyinc/flux/transport/EmptyTransportResponseHandler;23 14 sendRequest ?(Lcom/groupbyinc/flux/cluster/node/DiscoveryNode;Ljava/lang/String;Lcom/groupbyinc/flux/transport/TransportRequest;Lcom/groupbyinc/flux/transport/TransportResponseHandler;)V67
|8 shardId )Lcom/groupbyinc/flux/index/shard/ShardId; SLcom/groupbyinc/flux/snapshots/RestoreService$UpdateIndexShardRestoreStatusRequest; updateRestoreStateOnMaster V(Lcom/groupbyinc/flux/snapshots/RestoreService$UpdateIndexShardRestoreStatusRequest;)V ,received updated snapshot restore state [{}]? "java/util/concurrent/BlockingQueueA (Ljava/lang/Object;)Z ?CBD update snapshot stateF ?(Lcom/groupbyinc/flux/snapshots/RestoreService;Lcom/groupbyinc/flux/snapshots/RestoreService$UpdateIndexShardRestoreStatusRequest;)V RH
I completed (Ljava/util/Map;)Z values ()Ljava/util/Collection;MN O java/util/CollectionQ iterator ()Ljava/util/Iterator;STRU java/util/IteratorW hasNext ()ZYZX[ next ()Ljava/lang/Object;]^X_ 7()Lcom/groupbyinc/flux/cluster/RestoreInProgress$State;a
bKZ
*d status BLcom/groupbyinc/flux/cluster/RestoreInProgress$ShardRestoreStatus; shards |Ljava/util/Map; failedShards (Ljava/util/Map;)I FAILUREl# *m I 5com/groupbyinc/flux/common/google/common/collect/Mapsp
newHashMap ()Ljava/util/HashMap;rs
qt ?U java/lang/Stringw renameReplacementy ?
z
renamePattern| ?
}
replaceAll 8(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;?
x? put 8(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;?? ? 6com/groupbyinc/flux/snapshots/SnapshotRestoreException? java/lang/StringBuilder?
? \ indices [? append -(Ljava/lang/String;)Ljava/lang/StringBuilder;??
?? ] and [? #] are renamed into the same index [? ]? toString? ?
?? F(Lcom/groupbyinc/flux/cluster/metadata/SnapshotId;Ljava/lang/String;)V R?
?? renamedIndex
previousIndex index /()Lcom/groupbyinc/flux/snapshots/SnapshotState;?
?? +com/groupbyinc/flux/snapshots/SnapshotState?
restorable?Z
?? unsupported snapshot state [? -(Ljava/lang/Object;)Ljava/lang/StringBuilder;??
?? CURRENT? ? ?? 5the snapshot was created with Elasticsearch version [? 1] which is higher than the version of this node [? processDeletedIndices 4(Lcom/groupbyinc/flux/cluster/ClusterChangedEvent;)V /com/groupbyinc/flux/cluster/ClusterChangedEvent?
? restore? custom E(Ljava/lang/String;)Lcom/groupbyinc/flux/cluster/ClusterState$Custom;??
/? indicesDeleted? ?
?? isEmpty?Z ?? entries? ?
? A()Lcom/groupbyinc/flux/common/google/common/collect/ImmutableMap;h?
#? =com/groupbyinc/flux/common/google/common/collect/ImmutableMap? entrySet A()Lcom/groupbyinc/flux/common/google/common/collect/ImmutableSet;??
?? I()Lcom/groupbyinc/flux/common/google/common/collect/UnmodifiableIterator;S?
4? getValue?^ ? 1()Lcom/groupbyinc/flux/cluster/metadata/MetaData; ??
/? getKey?^ ? 'com/groupbyinc/flux/index/shard/ShardId? getIndex? ?
?? hasIndex (Ljava/lang/String;)Z??
?? java/util/ArrayList?
? \ ?D '[{}] failing running shard restore [{}]? 3()Lcom/groupbyinc/flux/cluster/metadata/SnapshotId; ??
#? index was deleted? \(Ljava/lang/String;Lcom/groupbyinc/flux/cluster/RestoreInProgress$State;Ljava/lang/String;)V R?
?=>
? shard ?Ljava/util/Map$Entry; Ljava/util/Map$Entry; shardsToFail ;Ljava/util/List; entry 5Lcom/groupbyinc/flux/cluster/RestoreInProgress$Entry; event 1Lcom/groupbyinc/flux/cluster/ClusterChangedEvent; /Lcom/groupbyinc/flux/cluster/RestoreInProgress; failRestore "[{}] failed to restore shard [{}] debug ? failed =(Lcom/groupbyinc/flux/snapshots/Snapshot;Ljava/lang/String;)Z
shardFailures ?
?
2com/groupbyinc/flux/snapshots/SnapshotShardFailure? ?
equalsC
x failure 4Lcom/groupbyinc/flux/snapshots/SnapshotShardFailure; addListener .(Lcom/groupbyinc/flux/action/ActionListener;)V
ZD uLcom/groupbyinc/flux/action/ActionListener; removeListener removeC
Z clusterChanged localNodeMasterZ
???
! Failed to update restore state # t isRepositoryInUse ?(Lcom/groupbyinc/flux/cluster/ClusterState;Ljava/lang/String;)Z
getRepository( ?
?) clusterState *Lcom/groupbyinc/flux/cluster/ClusterState; snapshots
access$200 r(Lcom/groupbyinc/flux/snapshots/RestoreService;)Lcom/groupbyinc/flux/cluster/metadata/MetaDataIndexUpgradeService; x0
access$300 q(Lcom/groupbyinc/flux/snapshots/RestoreService;)Lcom/groupbyinc/flux/cluster/metadata/MetaDataCreateIndexService;
access$400 \(Lcom/groupbyinc/flux/snapshots/RestoreService;)Lcom/groupbyinc/flux/cluster/ClusterService;
access$500 @(Lcom/groupbyinc/flux/snapshots/RestoreService;Ljava/util/Map;)ZKL
7 x1
access$600 @(Lcom/groupbyinc/flux/snapshots/RestoreService;Ljava/util/Map;)Ijk
<
access$700 r(Lcom/groupbyinc/flux/snapshots/RestoreService;)Lcom/groupbyinc/flux/cluster/routing/allocation/AllocationService;
access$800 k(Lcom/groupbyinc/flux/snapshots/RestoreService;Lcom/groupbyinc/flux/snapshots/Snapshot;Ljava/lang/String;)Z
B x2
access$900 = ; F access$1000 : ; I access$1100 f(Lcom/groupbyinc/flux/snapshots/RestoreService;)Lcom/groupbyinc/flux/cluster/settings/DynamicSettings; access$1200 ](Lcom/groupbyinc/flux/snapshots/RestoreService;)Lcom/groupbyinc/flux/common/logging/ESLogger; access$1300 access$1400 access$1600 T(Lcom/groupbyinc/flux/snapshots/RestoreService;)Ljava/util/concurrent/BlockingQueue; access$1700 access$1800 access$1900 access$2000 access$2100 access$2300 access$2500 [(Lcom/groupbyinc/flux/snapshots/RestoreService;)Ljava/util/concurrent/CopyOnWriteArrayList; access$2700 access$2800 index.number_of_shards^ index.version.created` index.legacy.routing.hash.typeb index.legacy.routing.use_typed
index.uuidf index.creation_dateh of ?(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;[Ljava/lang/Object;)Lcom/groupbyinc/flux/common/google/common/collect/ImmutableSet;jk
4l builder I()Lcom/groupbyinc/flux/common/google/common/collect/ImmutableSet$Builder;no
4p addAll ](Ljava/lang/Iterable;)Lcom/groupbyinc/flux/common/google/common/collect/ImmutableSet$Builder;rs
2t index.number_of_replicasv [(Ljava/lang/Object;)Lcom/groupbyinc/flux/common/google/common/collect/ImmutableSet$Builder; ?x
2y index.auto_expand_replicas{ index.version.upgraded} index.version.minimum_compatible build??
2?
ConstantValue Signature Code LocalVariableTable LineNumberTable RuntimeVisibleAnnotations "RuntimeVisibleParameterAnnotations LocalVariableTypeTable
StackMapTable ?(Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest;Lcom/groupbyinc/flux/action/ActionListener;)V (Ljava/util/Map;)Z (Ljava/util/Map;)I ?(Lcom/groupbyinc/flux/snapshots/RestoreService$RestoreRequest;Ljava/util/List;)Ljava/util/Map; x(Lcom/groupbyinc/flux/action/ActionListener;)V
SourceFile InnerClasses ! 6 7 ? 9 : ; ? <